Expand description
Native functions for the ability_ids category (run_abilities_ids_script).
Both fns here answer the same question — “which of the things I own should
quick-equip put in my slots?” — and both answer it the same way: rarity
first, then the system’s own power metric inside a rarity band, take the
top Slots. The metric itself is already native
(crate::mechanics::balance::ability_damage_from_id for abilities,
crate::mechanics::balance::character_attrs_power_raw for pets), so these
fns only handle the scoring / sort / take marshalling.
Follows the super::power reference shape: a typed *Ctx, a *Fn alias, a
native impl, and a register.
Structs§
- Ability
IdsCtx fast_equip_abilities_scriptsees (Abilities,Slots) plus the config / content lookups thebalancemodule carries (needed bybalance::ability_damage).- Item
IdsCtx - Inputs available to an
item_idsnative fn for thefast_equip_pets_script/ content lookups thebalancemodule carries.
Functions§
- fast_
equip_ abilities - Ranks the player’s non-class abilities by rarity first, then damage, and
returns the
template_ids of the topmin(len, Slots). - fast_
equip_ pets - Rank the roster by rarity first, then power, and return the
template_ids of the topmin(pets.len, Slots).
Type Aliases§
- Ability
IdsFn - Signature of an
ability_idsnative fn. Freefn(no captured state) so it isCopyand trivially stored in the registry; runtime context arrives viaAbilityIdsCtx. - Item
IdsFn - Signature of an
item_idsnative fn. Freefn(no captured state) so it isCopyand trivially stored in the registry; runtime context arrives viaItemIdsCtx.