diff --git a/Mage.Sets/src/mage/cards/a/AncestorDragon.java b/Mage.Sets/src/mage/cards/a/AncestorDragon.java new file mode 100644 index 0000000000..ffb6f54a8a --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AncestorDragon.java @@ -0,0 +1,76 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksWithCreaturesTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.constants.SubType; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author TheElk801 + */ +public final class AncestorDragon extends CardImpl { + + public AncestorDragon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + + this.subtype.add(SubType.DRAGON); + this.power = new MageInt(5); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever one or more creatures you control attack, you gain 1 life for each attacking creature. + this.addAbility(new AttacksWithCreaturesTriggeredAbility(new AncestorDragonEffect(), 1)); + } + + public AncestorDragon(final AncestorDragon card) { + super(card); + } + + @Override + public AncestorDragon copy() { + return new AncestorDragon(this); + } +} + +class AncestorDragonEffect extends OneShotEffect { + + private int attackers; + + public AncestorDragonEffect() { + super(Outcome.GainLife); + staticText = "you gain 1 life for each attacking creature"; + } + + public AncestorDragonEffect(final AncestorDragonEffect effect) { + super(effect); + } + + @Override + public AncestorDragonEffect copy() { + return new AncestorDragonEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player you = game.getPlayer(source.getControllerId()); + attackers = game.getCombat().getAttackers().size(); + if (you != null) { + you.gainLife(attackers, game, source); + attackers = 0; + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/JiangYangguMuYanling.java b/Mage.Sets/src/mage/sets/JiangYangguMuYanling.java index e2cb2a3615..06c46c0e71 100644 --- a/Mage.Sets/src/mage/sets/JiangYangguMuYanling.java +++ b/Mage.Sets/src/mage/sets/JiangYangguMuYanling.java @@ -21,6 +21,7 @@ public final class JiangYangguMuYanling extends ExpansionSet { this.blockName = "Global Series"; this.hasBasicLands = true; cards.add(new SetCardInfo("Aggressive Instinct", 34, Rarity.COMMON, mage.cards.a.AggressiveInstinct.class)); + cards.add(new SetCardInfo("Ancestor Dragon", 12, Rarity.RARE, mage.cards.a.AncestorDragon.class)); cards.add(new SetCardInfo("Armored Whirl Turtle", 7, Rarity.COMMON, mage.cards.a.ArmoredWhirlTurtle.class)); cards.add(new SetCardInfo("Breath of Fire", 33, Rarity.COMMON, mage.cards.b.BreathOfFire.class)); cards.add(new SetCardInfo("Brilliant Plan", 17, Rarity.UNCOMMON, mage.cards.b.BrilliantPlan.class));