예제 #1
0
파일: Stack.cs 프로젝트: longde123/grove
        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));
        }
예제 #2
0
파일: Stack.cs 프로젝트: longde123/grove
 private bool CanThougnessBeReducedToLeathalByTopSpell(Card card)
 {
     if (IsEmpty)
     {
         return(false);
     }
     return(card.Life <= TopSpell.CalculateToughnessReduction(card));
 }
예제 #3
0
파일: Stack.cs 프로젝트: longde123/grove
        public bool IsTargetedByTopSpell(Card card)
        {
            if (IsEmpty)
            {
                return(false);
            }

            return(TopSpell.HasEffectTarget(card));
        }
예제 #4
0
파일: Stack.cs 프로젝트: longde123/grove
        public int GetDamageTopSpellWillDealToPlayer(Player player)
        {
            if (TopSpell == null)
            {
                return(0);
            }

            return(TopSpell.CalculatePlayerDamage(player));
        }
예제 #5
0
파일: Stack.cs 프로젝트: longde123/grove
        public bool CanTopSpellReducePlayersLifeToZero(Player player)
        {
            if (TopSpell == null)
            {
                return(false);
            }

            var damage = TopSpell.CalculatePlayerDamage(player);

            return(damage >= player.Life);
        }
예제 #6
0
파일: Stack.cs 프로젝트: longde123/grove
        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);
        }
예제 #7
0
파일: Stack.cs 프로젝트: longde123/grove
 public bool TopSpellHas(EffectTag tag)
 {
     return(!IsEmpty && TopSpell.HasTag(tag));
 }