BandaStation - Modules - TypesVar Details - Proc Details

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_costCalculated stamina cost for the current attack
ignore_exhaustionWhether to ignore stamina exhaustion checks
stamina_costBase stamina cost for attacking living beings
stamina_cost_on_atomStamina cost for attacking non-living atoms
stamina_cost_wieldedStamina cost for attacking living beings when wielded
stamina_cost_wielded_on_atomStamina cost for attacking non-living atoms when wielded

Procs

InitializeInitialize the stamina cost per hit component
on_afterattackApply stamina cost after a successful attack
on_attackHandle 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:

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