Function attack

Source
pub fn attack(
    sink: &mut dyn FightSink,
    rng: &GameRng,
    lookups: &ContentLookups,
    effects: &mut dyn EffectCb,
    player_id: Uuid,
    caster: &Entity,
    target: &Entity,
    params: &AttackParams,
) -> Result<Option<i64>, Error>
Expand description

Native: perform an attack from caster on target. Returns the floored damage dealt (None => the no-damage paths: evasion, or no power given). RNG is consumed in the exact original order: evasion, counterattack_chance, deceit (+ randint(0,2) if it lands), crit_chance, then damage_entity’s block roll.