Esempio n. 1
0
        public bool CanBeDestroyedByTopSpell(Card card, bool targetOnly = false)
        {
            if (IsEmpty)
            {
                return(false);
            }

            if (card.CanBeDestroyed == false)
            {
                return(false);
            }

            if (TopSpell.HasTag(EffectTag.Destroy))
            {
                return(TopSpell.HasEffectTargets()
          ? TopSpell.HasEffectTarget(card)
          : !targetOnly);
            }

            if (card.Is().Creature == false)
            {
                return(false);
            }

            return(CanThougnessBeReducedToLeathalByTopSpell(card) || CanBeDealtLeathalDamageByTopSpell(card));
        }
Esempio n. 2
0
 private bool CanThougnessBeReducedToLeathalByTopSpell(Card card)
 {
     if (IsEmpty)
     {
         return(false);
     }
     return(card.Life <= TopSpell.CalculateToughnessReduction(card));
 }
Esempio n. 3
0
        public bool IsTargetedByTopSpell(Card card)
        {
            if (IsEmpty)
            {
                return(false);
            }

            return(TopSpell.HasEffectTarget(card));
        }
Esempio n. 4
0
        public int GetDamageTopSpellWillDealToPlayer(Player player)
        {
            if (TopSpell == null)
            {
                return(0);
            }

            return(TopSpell.CalculatePlayerDamage(player));
        }
Esempio n. 5
0
        public bool CanTopSpellReducePlayersLifeToZero(Player player)
        {
            if (TopSpell == null)
            {
                return(false);
            }

            var damage = TopSpell.CalculatePlayerDamage(player);

            return(damage >= player.Life);
        }
Esempio n. 6
0
        public int GetDamageTopSpellWillDealToCreature(Card card, bool targetOnly = false)
        {
            if (TopSpell == null)
            {
                return(0);
            }

            if (!TopSpell.HasEffectTargets() && targetOnly)
            {
                return(0);
            }

            var total     = TopSpell.CalculateCreatureDamage(card);
            var prevented = card.CalculatePreventedDamageAmount(total, TopSpell.Source.OwningCard);

            return(total - prevented);
        }
Esempio n. 7
0
 public bool TopSpellHas(EffectTag tag)
 {
     return(!IsEmpty && TopSpell.HasTag(tag));
 }