Function calculate_entity_stats_with_mods

Source
pub fn calculate_entity_stats_with_mods(
    game_config: &GameConfig,
    attributes_deltas: AttributeDeltas,
    extra_mods: &[(&str, i64)],
) -> Result<EntityStats>
Expand description

Same as calculate_entity_stats, plus .mod multipliers addressed by attribute code rather than by config id.

The artifact ownership bonus is a percentage on hp / attack / armor, and <code>.mod is read generically by both combat (get_entity_stat) and the honest power scalar (balance::get_attr_from_attrs) — so it needs no attribute of its own in the catalog, which is what lets armor.mod work without one existing. Folded in before compose_max_hp, so an artifact’s HP percentage reaches the fight’s max_hp and not just the displayed number.