コード例 #1
0
ファイル: Actor.cs プロジェクト: scossgrove/RougeTiler
        /// This is called on the defender when some attacker is attempting to hit it.
        /// The defender can modify the attack or simply return the incoming one.
        public virtual Attack Defend(Attack attack)
        {
            // Apply temporary resistance.
            var resistance = Resistances[attack.Element];

            if (resistance != null && resistance.IsActive)
            {
                attack = attack.AddResistance(resistance.Intensity);
            }

            return(attack);
        }