Function damage_entity

Source
pub fn damage_entity(
    sink: &mut dyn FightSink,
    rng: &GameRng,
    lookups: &ContentLookups,
    entity: &Entity,
    raw_dmg: f64,
    custom_data: CustomEventData,
) -> Result<Option<i64>, Error>
Expand description

Native: apply raw_dmg to entity (armor, shield, block roll, received damage multiplier). Returns the floored post-mitigation damage value; None only for the no-damage early-outs (godmode / a missing received_damage base value — a content-extraction regression), which short-circuit before the block roll. When a shield fully absorbs the hit the function still returns Some(floored_damage) (and emits the shield decrement) — this value drives attack’s return / lifesteal, so it must not be None or the caller would discard the shield event. Consumes one block stat_throw from rng when it is reached.