Implemented Makeshift Battalion

This commit is contained in:
Evan Kranzler 2019-04-05 08:07:49 -04:00
parent 695e9b48e6
commit 67111ed742
2 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,75 @@
package mage.cards.m;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class MakeshiftBattalion extends CardImpl {
public MakeshiftBattalion(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SOLDIER);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// Whenever Makeshift Battalion and at least two other creatures attack, put a +1/+1 counter on Makeshift Battalion.
this.addAbility(new MakeshiftBattalionTriggeredAbility());
}
private MakeshiftBattalion(final MakeshiftBattalion card) {
super(card);
}
@Override
public MakeshiftBattalion copy() {
return new MakeshiftBattalion(this);
}
}
class MakeshiftBattalionTriggeredAbility extends TriggeredAbilityImpl {
MakeshiftBattalionTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
}
private MakeshiftBattalionTriggeredAbility(final MakeshiftBattalionTriggeredAbility ability) {
super(ability);
}
@Override
public MakeshiftBattalionTriggeredAbility copy() {
return new MakeshiftBattalionTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return game.getCombat().getAttackers().size() >= 3
&& game.getCombat().getAttackers().contains(this.sourceId);
}
@Override
public String getRule() {
return "Whenever {this} and at least two other creatures attack, "
+ "put a +1/+1 counter on {this}.";
}
}

View file

@ -76,6 +76,7 @@ public final class WarOfTheSpark extends ExpansionSet {
cards.add(new SetCardInfo("Leyline Prowler", 202, Rarity.UNCOMMON, mage.cards.l.LeylineProwler.class));
cards.add(new SetCardInfo("Liliana's Triumph", 98, Rarity.UNCOMMON, mage.cards.l.LilianasTriumph.class));
cards.add(new SetCardInfo("Liliana, Dreadhorde General", 97, Rarity.MYTHIC, mage.cards.l.LilianaDreadhordeGeneral.class));
cards.add(new SetCardInfo("Makeshift Battalion", 22, Rarity.COMMON, mage.cards.m.MakeshiftBattalion.class));
cards.add(new SetCardInfo("Mountain", 260, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Mountain", 261, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Mowu, Loyal Companion", 167, Rarity.UNCOMMON, mage.cards.m.MowuLoyalCompanion.class));