Stamina Cost Per Hit Component 
A component that adds stamina cost to item attacks.
This component allows items to consume stamina when used to attack, with different costs for attacking living beings vs other atoms, and separate costs for wielded vs one-handed use.
Vars | |
attack_cost | Calculated stamina cost for the current attack |
---|---|
ignore_exhaustion | Whether to ignore stamina exhaustion checks |
stamina_cost | Base stamina cost for attacking living beings |
stamina_cost_on_atom | Stamina cost for attacking non-living atoms |
stamina_cost_wielded | Stamina cost for attacking living beings when wielded |
stamina_cost_wielded_on_atom | Stamina cost for attacking non-living atoms when wielded |
Procs | |
Initialize | Initialize the stamina cost per hit component |
on_afterattack | Apply stamina cost after a successful attack |
on_attack | Handle attack validation and stamina cost calculation |
Var Details
attack_cost 
Calculated stamina cost for the current attack
ignore_exhaustion 
Whether to ignore stamina exhaustion checks
stamina_cost 
Base stamina cost for attacking living beings
stamina_cost_on_atom 
Stamina cost for attacking non-living atoms
stamina_cost_wielded 
Stamina cost for attacking living beings when wielded
stamina_cost_wielded_on_atom 
Stamina cost for attacking non-living atoms when wielded
Proc Details
Initialize
Initialize the stamina cost per hit component
Sets up the component parameters for stamina consumption on attacks Arguments:
- stamina_cost - Base stamina cost for attacking living beings
- stamina_cost_wielded - Stamina cost for attacking living beings when wielded (uses stamina_cost if null)
- stamina_cost_on_atom - Stamina cost for attacking non-living atoms (uses stamina_cost if null)
- stamina_cost_wielded_on_atom - Stamina cost for attacking non-living atoms when wielded (uses stamina_cost_wielded if null)
- ignore_exhaustion - Whether to ignore stamina exhaustion checks
on_afterattack
Apply stamina cost after a successful attack
Deducts the calculated stamina cost from the user after an attack completes
on_attack
Handle attack validation and stamina cost calculation
Calculates the appropriate stamina cost based on target type and wield status, and cancels the attack if the user would be exhausted by the cost Returns: COMPONENT_CANCEL_ATTACK_CHAIN if attack should be canceled due to exhaustion, otherwise NONE