diff --git a/Mage.Sets/src/mage/cards/a/AncientAnimus.java b/Mage.Sets/src/mage/cards/a/AncientAnimus.java new file mode 100644 index 00000000000..d799698ae6d --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AncientAnimus.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.a; + +import java.util.UUID; +import mage.abilities.condition.common.TargetHasSuperTypeCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.FightTargetsEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SuperType; +import mage.counters.CounterType; +import mage.target.Target; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetOpponentsCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public class AncientAnimus extends CardImpl { + + public AncientAnimus(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}"); + + // Put a +1/+1 counter on target creature you control if it's legendary. Then it fights target creature an opponent controls. + Effect effect = new ConditionalOneShotEffect( + new AddCountersTargetEffect(CounterType.P1P1.createInstance()), + new TargetHasSuperTypeCondition(SuperType.LEGENDARY) + ); + effect.setText("Put a +1/+1 counter on target creature you control if it's legendary."); + this.getSpellAbility().addEffect(effect); + effect = new FightTargetsEffect(); + effect.setText("Then it fights target creature an opponent controls"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + Target target = new TargetOpponentsCreaturePermanent(); + this.getSpellAbility().addTarget(target); + } + + public AncientAnimus(final AncientAnimus card) { + super(card); + } + + @Override + public AncientAnimus copy() { + return new AncientAnimus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Dominaria.java b/Mage.Sets/src/mage/sets/Dominaria.java index 581bd9488ce..5046fd30269 100644 --- a/Mage.Sets/src/mage/sets/Dominaria.java +++ b/Mage.Sets/src/mage/sets/Dominaria.java @@ -60,6 +60,7 @@ public class Dominaria extends ExpansionSet { cards.add(new SetCardInfo("Adventurous Impulse", 153, Rarity.COMMON, mage.cards.a.AdventurousImpulse.class)); cards.add(new SetCardInfo("Aesthir Glider", 209, Rarity.COMMON, mage.cards.a.AesthirGlider.class)); cards.add(new SetCardInfo("Amaranthine Wall", 210, Rarity.UNCOMMON, mage.cards.a.AmaranthineWall.class)); + cards.add(new SetCardInfo("Ancient Animus", 154, Rarity.COMMON, mage.cards.a.AncientAnimus.class)); cards.add(new SetCardInfo("Arbor Armament", 155, Rarity.COMMON, mage.cards.a.ArborArmament.class)); cards.add(new SetCardInfo("Arcane Flight", 43, Rarity.COMMON, mage.cards.a.ArcaneFlight.class)); cards.add(new SetCardInfo("Artificer's Assistant", 44, Rarity.COMMON, mage.cards.a.ArtificersAssistant.class)); diff --git a/Mage/src/main/java/mage/abilities/condition/common/TargetHasSuperTypeCondition.java b/Mage/src/main/java/mage/abilities/condition/common/TargetHasSuperTypeCondition.java new file mode 100644 index 00000000000..af12e5cf83e --- /dev/null +++ b/Mage/src/main/java/mage/abilities/condition/common/TargetHasSuperTypeCondition.java @@ -0,0 +1,36 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.condition.common; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.constants.SuperType; +import mage.game.Game; + +/** + * + * @author LevelX2 + */ +public class TargetHasSuperTypeCondition implements Condition { + + private final SuperType superType; + + public TargetHasSuperTypeCondition(SuperType superType) { + this.superType = superType; + } + + @Override + public boolean apply(Game game, Ability source) { + if (!source.getTargets().isEmpty()) { + MageObject mageObject = game.getObject(source.getFirstTarget()); + if (mageObject != null) { + return mageObject.getSuperType().contains(superType); + } + } + return false; + } +}