more hub world tweaking
This commit is contained in:
@@ -74,17 +74,17 @@ func _process(_delta):
|
||||
|
||||
|
||||
func reload_finished():
|
||||
if player.ammo_reserve[str(ammo_type)] >= max_ammo:
|
||||
player.gun_ammo[gun_name] += max_ammo
|
||||
player.ammo_reserve[str(ammo_type)] -= max_ammo
|
||||
if GameGlobals.ammo_reserve[str(ammo_type)] >= max_ammo:
|
||||
GameGlobals.gun_ammo[gun_name] += max_ammo
|
||||
GameGlobals.ammo_reserve[str(ammo_type)] -= max_ammo
|
||||
|
||||
else:
|
||||
player.gun_ammo[gun_name] += player.ammo_reserve[str(ammo_type)]
|
||||
player.ammo_reserve[str(ammo_type)] -= player.ammo_reserve[str(ammo_type)]
|
||||
GameGlobals.gun_ammo[gun_name] += GameGlobals.ammo_reserve[str(ammo_type)]
|
||||
GameGlobals.ammo_reserve[str(ammo_type)] -= GameGlobals.ammo_reserve[str(ammo_type)]
|
||||
|
||||
|
||||
func shoot(delta):
|
||||
if player.gun_ammo[gun_name] > 0:
|
||||
if GameGlobals.gun_ammo[gun_name] > 0:
|
||||
if !anim_player.is_playing():
|
||||
anim_player.play("shoot")
|
||||
elif !anim_player.is_playing() and cycle_count != 0:
|
||||
@@ -92,7 +92,7 @@ func shoot(delta):
|
||||
audio_empty.play()
|
||||
|
||||
func fire():
|
||||
player.gun_ammo[gun_name] -= 1
|
||||
GameGlobals.gun_ammo[gun_name] -= 1
|
||||
audio_fire.pitch_scale = 1 + rng.randf_range(-fire_pitch_scale_amt,fire_pitch_scale_amt)
|
||||
audio_fire.play()
|
||||
pellet_spawn()
|
||||
@@ -106,15 +106,15 @@ func fire():
|
||||
SignalBus.emit_signal("shot_fired")
|
||||
|
||||
func reload():
|
||||
if player.gun_ammo[gun_name] < max_ammo and player.gun.anim_player.get_current_animation() != "reload" and player.ammo_reserve[str(ammo_type)] > 0:
|
||||
if GameGlobals.gun_ammo[gun_name] < max_ammo and player.gun.anim_player.get_current_animation() != "reload" and GameGlobals.ammo_reserve[str(ammo_type)] > 0:
|
||||
#player.reloading = true
|
||||
anim_player.play("reload")
|
||||
audio_reload.play()
|
||||
if anim_player.is_playing() and anim_player.current_animation == "reload":
|
||||
if player.gun_ammo[gun_name] == 0:
|
||||
player.gun_ammo[gun_name] = 0
|
||||
if GameGlobals.gun_ammo[gun_name] == 0:
|
||||
GameGlobals.gun_ammo[gun_name] = 0
|
||||
else:
|
||||
player.gun_ammo[gun_name] = 1
|
||||
GameGlobals.gun_ammo[gun_name] = 1
|
||||
|
||||
func pellet_spawn():
|
||||
var pellets_remaining = pellets_per_shot
|
||||
|
||||
Reference in New Issue
Block a user