Stamina tweak.
This commit is contained in:
parent
6dfba1b5b9
commit
18424079b4
|
|
@ -120,15 +120,14 @@ func use_primary_item() -> String:
|
|||
if state_to_item_map.has(_item_name):
|
||||
var state_name = state_to_item_map[_item_name]
|
||||
## This item state has a cost associated with it.
|
||||
if state_stamina_cost.has(state_name):
|
||||
if state_stamina_cost[state_name] <= stamina_component.stamina:
|
||||
#print("Yup: ", state_stamina_cost[state_name], "<=", stamina_component.stamina)
|
||||
player_inventory.remove_from_inventory(player_inventory.primary_selection)
|
||||
return state_to_item_map[_item_name]
|
||||
else:
|
||||
## TODO: maybe some sort of 'fail' animation state
|
||||
print("Nope: ", state_stamina_cost[state_name], "<=", stamina_component.stamina)
|
||||
return '' ## you can't use this
|
||||
if enough_stamina_for(state_name):
|
||||
#print("Yup: ", state_stamina_cost[state_name], "<=", stamina_component.stamina)
|
||||
player_inventory.remove_from_inventory(player_inventory.primary_selection)
|
||||
return state_to_item_map[_item_name]
|
||||
else:
|
||||
## TODO: maybe some sort of 'fail' animation state
|
||||
#print("Nope: ", state_stamina_cost[state_name], "<=", stamina_component.stamina)
|
||||
return '' ## you can't use this
|
||||
player_inventory.remove_from_inventory(player_inventory.primary_selection)
|
||||
return state_to_item_map[_item_name]
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ max_health = 100
|
|||
[node name="Stamina_Component" parent="." index="9" instance=ExtResource( 29 )]
|
||||
unique_name_in_owner = true
|
||||
max_stamina = 50
|
||||
recovery_rate = 5
|
||||
recovery_rate = 12
|
||||
|
||||
[node name="Hurtbox_Component" parent="." index="10" instance=ExtResource( 16 )]
|
||||
collision_layer = 16
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user