Function item_power

Source
pub fn item_power(ctx: &ItemPowerCtx<'_>) -> Result<i64>
Expand description

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.

  • level = CharacterState.character.character_level
  • inventory = every CharacterState.inventory item whose item_type.str not on is_equipped, so we keep all non-matching items here.
  • abilities = CharacterState.equipped_abilities
  • pets = CharacterState.equipped_pets

Then power_without = balance::character_power(...), push the candidate, power_with = balance::character_power(...), return power_with - power_without.