Exemplo n.º 1
0
    public void OnUseCard(AbstractCard _card, UseCardAction _action)
    {
        if (!_card.IsPurgeOnUse && _card.Type == CardType.Attack && Amount > 0)
        {
            //flash
            AbstractMonster tMonster = null;
            if (_action.Target != null)
            {
                tMonster = _action.Target as AbstractMonster;
            }
            AbstractCard tCard = _card.MakeStatEquivalentCopy();
            AbstractDungeon.Player.Limbo.AddToBottom(tCard);
            tCard.IsFreeToPlayOnce = true;
            if (null != tMonster)
            {
                tCard.CalculateCardDamage(tMonster);
            }

            tCard.IsPurgeOnUse = true;
            AbstractDungeon.ActionManager.CardQueue.Add(new CardQueueItem(tCard, tMonster, _card.EnergyOnUse));
            if (tCard.CardID.Equals("Rampage"))
            {
                AbstractDungeon.ActionManager.AddToBottom(new ModifyDamageAction(_card, tCard.MagicNumber));
            }

            Amount--;
            if (Amount == 0)
            {
                AbstractDungeon.ActionManager.AddToBottom(new RemoveSpecificPowerAction(Owner, Owner, "DoubleTap"));
            }
        }
    }