Ejemplo n.º 1
0
    void OnPerformAttack(Msg.PerformAttack m)
    {
        if (_IsFighting)
        {
            if (AttackQueue.Count > 0)
            {
                ActiveAbility a = _AttackQueue[0];
                _AttackQueue.RemoveAt(0);

                if (a.CanPerformAbility(this))
                {
                    if (a.Color == Ability.AbilityColor.Neutral)
                    {
                        Adrenaline = Adrenaline + 1;
                    }
                    else
                    {
                        Adrenaline = Adrenaline + a.AdrenalineCost;
                    }

                    TinyMessengerHub.Instance.Publish <Msg.PerformActiveAbility>(new Msg.PerformActiveAbility(a, _Id));
                }
                else
                {
                    Adrenaline = Adrenaline + 1;

                    TinyMessengerHub.Instance.Publish <Msg.NotEnughAdrenaline>(new Msg.NotEnughAdrenaline(_Id));
                }
            }
        }
    }