Module fast_equip

Source
Expand description

Native functions for the ability_ids category (run_abilities_ids_script) fast_equip_abilities_script does (copy Abilities, sort by balance::ability_damage descending with a floored comparator, take the top Slots) and then call the already-native crate::mechanics::balance::ability_damage_from_id for the core damage formula, so this fn only handles the copy/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
Native port of the live fast_equip_abilities_script:
fast_equip_pets
sort_by(|a, b| floor((pet_power(b) - pet_power(a)) * 1000.0))) 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.