Ejemplo n.º 1
0
    //return true if the unit is dead after this
    public bool ApplyTriggerEffectAndCheckDead(Trigger trigger)
    {
        trigger.ApplyEffectOnActivation(this);

        if (HitPoints <= 0)
        {
            if (UnitDestroyed != null)
            {
                UnitDestroyed.Invoke(this, new AttackEventArgs(trigger, this, trigger.Damage));
            }
            OnDestroyed();

            return(true);
        }

        return(false);
    }