turret tweaks

This commit is contained in:
derek
2024-07-18 13:45:37 -05:00
parent 330e4a599d
commit 5f67dbe6ba
11 changed files with 95 additions and 36 deletions

View File

@@ -124,7 +124,7 @@ func reload_finished():
await get_tree().create_timer(.01).timeout
player.reloading = false
func shoot(player,delta):
func shoot(delta):
if level_control.ammo_current[gun_index] > 0 and cycle_count > 0:
if !anim_player.is_playing():
level_control.ammo_current[gun_index] -= 1
@@ -159,7 +159,7 @@ func fire(delta):
chamber.rotate_object_local(Vector3(0,-1,0),deg_to_rad(60))
func reload(player,delta):
func reload(delta):
if level_control.ammo_current[gun_index] < max_ammo and player.gun.anim_player.get_current_animation() != "reload" and level_control.ammo_reserve[gun_index] > 0:
anim_player.play("reload")
audio_reload.play()