Implemented Ancestor Dragon

This commit is contained in:
Evan Kranzler 2018-06-08 08:54:12 -04:00
parent 6d976befcf
commit 9d8d67036b
2 changed files with 77 additions and 0 deletions

View file

@ -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;
}
}

View file

@ -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));