Expand description
Native functions for the power categories (character_power, item_power,
…). These handle the loadout marshalling and then call the
crate::mechanics::balance logic for the core power formula.
Reference category for the rollout: every other category follows the same
shape — a typed *Ctx, a *Fn alias, native impls, and a register.
Structs§
- Character
Power Ctx character_power_calculate_scriptsees (CharacterState) plus the config / content lookups thebalancemodule carries.- Item
Power Ctx item_power_calculate_scriptsees in the production path: the owningCharacterStateand the candidateItem, plus the config / content lookups thebalancemodule carries.- Party
Power Adjust Ctx - Inputs available to a
party_power_adjustnative fn — the same scope the member’sCharacterState(the slot’s twoset_constbindings inrun_party_power_adjust).
Functions§
- character_
power - Native port of
character_power_calculate_script(theCharacterStatebranch): keep equipped inventory items, then callbalance::character_power. - item_
power - Native port of
item_power_calculate_script: power of the equipped loadout with the candidate item minus the power without any item of the same type. - power_
adjust - Native port of the shipped
power_adjust_script: clamp the party member’s power into[floor(0.5 * player), floor(1.1 * player)].
Type Aliases§
- Character
Power Fn - Signature of a
character_powernative fn. Freefn(no captured state) so it isCopyand trivially stored in the registry; runtime context arrives viaCharacterPowerCtx. - Item
Power Fn - Signature of an
item_powernative fn. Freefn(no captured state) so it isCopyand trivially stored in the registry; runtime context arrives viaItemPowerCtx. - Party
Power Adjust Fn - Signature of a
party_power_adjustnative fn. Freefn(no captured state) so it isCopyand trivially stored in the registry; runtime context arrives viaPartyPowerAdjustCtx.