Function power_from_attrs

Source
pub fn power_from_attrs(attrs: &AttrMap) -> i64
Expand description

Compute character power from a composed AttrMap as P = DPS × EHP (balance v2). DPS is the offensive product (attack · rate · crit · multicast · bravery · counterattack); EHP the survivability product (hp ÷ the damage that gets through), where armor and dodge use the diminishing-returns curves armor_k and ev/(ev+K_DODGE). Normalised by POWER_NORM so a reference character (attack=BASE_ATTACK, hp=BASE_HP, neutral elsewhere) anchors at BASE_POWER. Replaces the legacy opaque -style formula; every factor maps 1:1 to the old one except armor and evasion, which move from a linear cap to a DR curve.

Float-accumulation order is load-bearing (see character_attrs_power): the per-attribute reads happen in a fixed order so the floored result is deterministic.