FINISHED DAMN DROP SYSTEM
This commit is contained in:
parent
3302fcfc96
commit
100afe5e51
17 changed files with 151 additions and 25 deletions
|
|
@ -15,11 +15,12 @@ func state_input(event: InputEvent) -> void:
|
|||
init_reload.rpc()
|
||||
|
||||
func use_begin() -> void:
|
||||
transition.emit("Shoot")
|
||||
if machine.ammo > 0:
|
||||
transition.emit("Shoot")
|
||||
|
||||
@rpc("authority","call_local","reliable")
|
||||
func init_reload():
|
||||
if machine.ammo == machine.max_ammo:
|
||||
if machine.ammo == machine.max_ammo or machine.remaining_ammo <= 0:
|
||||
return
|
||||
transition.emit("Reload")
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,12 @@ func exit() -> void:
|
|||
|
||||
func on_animation_finished(animation):
|
||||
if animation == with_morphems("reload"):
|
||||
machine.ammo = machine.max_ammo
|
||||
if machine.remaining_ammo > machine.max_ammo:
|
||||
machine.ammo = machine.max_ammo
|
||||
machine.remaining_ammo -= machine.max_ammo
|
||||
else:
|
||||
machine.ammo = machine.remaining_ammo
|
||||
machine.remaining_ammo = 0
|
||||
transition.emit("Idle")
|
||||
|
||||
func with_morphems(animation):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue