stamina tweak on old state.
This commit is contained in:
parent
5196b3eb6e
commit
1ceec696cc
|
|
@ -18,6 +18,8 @@ func _ready():
|
|||
if debug_velocity_controller:
|
||||
velocity_controller.debug = true
|
||||
|
||||
assert(parent is Actor, "Movement state receiver assumes parent is an Actor type.")
|
||||
|
||||
#var state_ref :State
|
||||
#var state_name :String
|
||||
#state_name = 'jump'
|
||||
|
|
|
|||
|
|
@ -198,6 +198,13 @@ func use_secondary_item() -> String:
|
|||
func _on_Movement_StateMachine_state_changed(old_state_name, new_state):
|
||||
## Reduce stamina if this state has a cost
|
||||
if state_stamina_cost.has(new_state.name):
|
||||
## Skip stamina removal when coming from certain states
|
||||
match old_state_name:
|
||||
'climb':
|
||||
pass
|
||||
'ledge_grab':
|
||||
pass
|
||||
_:
|
||||
stamina_component.reduce_stamina(state_stamina_cost[new_state.name])
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user