Grenade bounce and radius
This commit is contained in:
parent
f99108c4f0
commit
11eb875d2e
6 changed files with 28 additions and 16 deletions
|
|
@ -139,6 +139,8 @@ func check_for_empty() -> void:
|
|||
return
|
||||
for child in get_children():
|
||||
if child is WeaponSubStateMachine and child.ammo == 0 and child.remaining_ammo == 0 and child.destroy_when_empty:
|
||||
if child == current_state:
|
||||
return_to_previous(false)
|
||||
child.queue_free()
|
||||
|
||||
func on_ammo_updated() -> void:
|
||||
|
|
@ -159,13 +161,17 @@ func _physics_process(delta: float) -> void:
|
|||
current_state.physics_update(delta)
|
||||
|
||||
func use_begin() -> void:
|
||||
current_state.use_begin.rpc()
|
||||
if current_state != null:
|
||||
current_state.use_begin()
|
||||
|
||||
func use_end() -> void:
|
||||
current_state.use_end.rpc()
|
||||
if current_state != null:
|
||||
current_state.use_end()
|
||||
|
||||
func alternate_state() -> void:
|
||||
current_state.alternate_state()
|
||||
if current_state != null:
|
||||
current_state.alternate_state()
|
||||
|
||||
func switch_mode() -> void:
|
||||
current_state.switch_mode()
|
||||
if current_state != null:
|
||||
current_state.switch_mode()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue