Module fast_equip

Source
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§

AbilityIdsCtx
fast_equip_abilities_script sees (Abilities, Slots) plus the config / content lookups the balance module carries (needed by balance::ability_damage).
ItemIdsCtx
Inputs available to an item_ids native fn for the fast_equip_pets_script / content lookups the balance module carries.

Functions§

fast_equip_abilities
Ranks the player’s non-class abilities by rarity first, then damage, and returns the template_ids of the top min(len, Slots).
fast_equip_pets
Rank the roster by rarity first, then power, and return the template_ids of the top min(pets.len, Slots).

Type Aliases§

AbilityIdsFn
Signature of an ability_ids native fn. Free fn (no captured state) so it is Copy and trivially stored in the registry; runtime context arrives via AbilityIdsCtx.
ItemIdsFn
Signature of an item_ids native fn. Free fn (no captured state) so it is Copy and trivially stored in the registry; runtime context arrives via ItemIdsCtx.