Stamina tweak.

This commit is contained in:
Dustin 2025-04-10 22:45:27 -07:00
parent 6dfba1b5b9
commit 18424079b4
2 changed files with 9 additions and 10 deletions

View File

@ -120,14 +120,13 @@ func use_primary_item() -> String:
if state_to_item_map.has(_item_name): if state_to_item_map.has(_item_name):
var state_name = state_to_item_map[_item_name] var state_name = state_to_item_map[_item_name]
## This item state has a cost associated with it. ## This item state has a cost associated with it.
if state_stamina_cost.has(state_name): if enough_stamina_for(state_name):
if state_stamina_cost[state_name] <= stamina_component.stamina:
#print("Yup: ", 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) player_inventory.remove_from_inventory(player_inventory.primary_selection)
return state_to_item_map[_item_name] return state_to_item_map[_item_name]
else: else:
## TODO: maybe some sort of 'fail' animation state ## TODO: maybe some sort of 'fail' animation state
print("Nope: ", state_stamina_cost[state_name], "<=", stamina_component.stamina) #print("Nope: ", state_stamina_cost[state_name], "<=", stamina_component.stamina)
return '' ## you can't use this return '' ## you can't use this
player_inventory.remove_from_inventory(player_inventory.primary_selection) player_inventory.remove_from_inventory(player_inventory.primary_selection)
return state_to_item_map[_item_name] return state_to_item_map[_item_name]

View File

@ -138,7 +138,7 @@ max_health = 100
[node name="Stamina_Component" parent="." index="9" instance=ExtResource( 29 )] [node name="Stamina_Component" parent="." index="9" instance=ExtResource( 29 )]
unique_name_in_owner = true unique_name_in_owner = true
max_stamina = 50 max_stamina = 50
recovery_rate = 5 recovery_rate = 12
[node name="Hurtbox_Component" parent="." index="10" instance=ExtResource( 16 )] [node name="Hurtbox_Component" parent="." index="10" instance=ExtResource( 16 )]
collision_layer = 16 collision_layer = 16