Example #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));
        }
Example #2
0
        private void PutToZoneAfterResolve(Card card, Effect.Context ctx)
        {
            if (card.Is().Sorcery || card.Is().Instant)
            {
                card.PutToGraveyard();
                return;
            }

            if (card.Is().Aura)
            {
                var attachedCardController = card.GetControllerOfACardThisIsAttachedTo();
                attachedCardController.PutCardToBattlefield(card);
                return;
            }

            card.PutToBattlefield();
        }
Example #3
0
        public void PutOnBottomOfLibrary(Card card)
        {
            if (card.Is().Token)
            {
                PutCardToExile(card);
                return;
            }

            _library.PutOnBottom(card);
        }
Example #4
0
        public void PutCardToHand(Card card)
        {
            if (card.Is().Token)
            {
                PutCardToExile(card);
                return;
            }

            _hand.Add(card);
        }
Example #5
0
        public void PutCardToGraveyard(Card card)
        {
            if (card.Is().Token)
            {
                PutCardToExile(card);
                return;
            }

            _graveyard.AddToEnd(card);
        }
Example #6
0
        public void PutCardIntoLibraryAtPosition(int positionFromTop, Card card)
        {
            if (card.Is().Token)
            {
                PutCardToExile(card);
                return;
            }

            _library.InsertAt(positionFromTop, card);
        }
Example #7
0
        public bool CanBeDealtLeathalDamageByTopSpell(Card card, bool targetOnly = false)
        {
            if (!card.Is().Creature)
            {
                return(false);
            }

            var dealtAmount = GetDamageTopSpellWillDealToCreature(card, targetOnly);

            return(card.Life <= dealtAmount);
        }
Example #8
0
        private void PutToZoneAfterResolve(Card card)
        {
            if (card.Is().Sorcery || card.Is().Instant)
              {
            card.PutToGraveyard();
            return;
              }

              if (card.Is().Aura)
              {
            var attachedCardController = card.GetControllerOfACardThisIsAttachedTo();
            attachedCardController.PutCardToBattlefield(card);
            return;
              }

              card.PutToBattlefield();
        }
Example #9
0
        public void PutOnBottomOfLibrary(Card card)
        {
            if (card.Is().Token)
              {
            PutCardToExile(card);
            return;
              }

              _library.PutOnBottom(card);
        }
Example #10
0
        public void PutCardToHand(Card card)
        {
            if (card.Is().Token)
              {
            PutCardToExile(card);
            return;
              }

              _hand.Add(card);
        }
Example #11
0
        public void PutCardToGraveyard(Card card)
        {
            if (card.Is().Token)
              {
            PutCardToExile(card);
            return;
              }

              _graveyard.AddToEnd(card);
        }
Example #12
0
        public bool CanBeBlockedBy(Card card)
        {
            if (card.IsTapped)
            {
                return(false);
            }

            if (Has().Unblockable)
            {
                return(false);
            }

            if (Has().Flying&& !card.Has().Flying&& !card.Has().Reach)
            {
                return(false);
            }

            if (Has().CanOnlyBeBlockedByCreaturesWithFlying&& !card.Has().Flying)
            {
                return(false);
            }

            if (Has().Fear&& !card.HasColor(CardColor.Black) && !card.Is().Artifact)
            {
                return(false);
            }

            if (HasProtectionFrom(card))
            {
                return(false);
            }

            if (Has().Swampwalk&&
                card.Controller.Battlefield.Any(x => x.Is("swamp")))
            {
                return(false);
            }

            if (Has().Islandwalk&&
                card.Controller.Battlefield.Any(x => x.Is("island")))
            {
                return(false);
            }

            if (Has().Mountainwalk&&
                card.Controller.Battlefield.Any(x => x.Is("mountain")))
            {
                return(false);
            }

            if (Has().Forestwalk&&
                card.Controller.Battlefield.Any(x => x.Is("forest")))
            {
                return(false);
            }

            if (Has().UnblockableIfDedenderHasArtifacts&&
                card.Controller.Battlefield.Any(x => x.Is().Artifact))
            {
                return(false);
            }

            if (Has().UnblockableIfDedenderHasEnchantments&&
                card.Controller.Battlefield.Any(x => x.Is().Enchantment))
            {
                return(false);
            }

            return(true);
        }
Example #13
0
        public bool CanBeBlockedBy(Card card)
        {
            if (card.IsTapped)
            return false;

              if (Has().Unblockable)
            return false;

              if (Has().Flying && !card.Has().Flying && !card.Has().Reach)
            return false;

              if (Has().CanOnlyBeBlockedByCreaturesWithFlying && !card.Has().Flying)
            return false;

              if (Has().Fear && !card.HasColor(CardColor.Black) && !card.Is().Artifact)
            return false;

              if (HasProtectionFrom(card))
            return false;

              if (Has().Swampwalk &&
            card.Controller.Battlefield.Any(x => x.Is("swamp")))
              {
            return false;
              }

              if (Has().Islandwalk &&
            card.Controller.Battlefield.Any(x => x.Is("island")))
              {
            return false;
              }

              if (Has().Mountainwalk &&
            card.Controller.Battlefield.Any(x => x.Is("mountain")))
              {
            return false;
              }

              if (Has().Forestwalk &&
            card.Controller.Battlefield.Any(x => x.Is("forest")))
              {
            return false;
              }

              if (Has().UnblockableIfDedenderHasArtifacts &&
            card.Controller.Battlefield.Any(x => x.Is().Artifact))
              {
            return false;
              }

              if (Has().UnblockableIfDedenderHasEnchantments &&
            card.Controller.Battlefield.Any(x => x.Is().Enchantment))
              {
            return false;
              }

              return true;
        }