Menu

Submission for Catapult Master

18

Config

name=Catapult Master
image=http://mtgimage.com/card/catapult%20master.jpg
value=4.202
rarity=R
type=Creature
subtype=Human,Soldier
cost={3}{W}{W}
pt=3/3
timing=main
requires_groovy_code
oracle=Tap five untapped Soldiers you control: Exile target creature.

Script

def UNTAPPED_SOLDIER_YOU_CONTROL=new MagicPermanentFilterImpl(){
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target)
{
return target.hasSubType(MagicSubType.SOLDIER) &&
target.isUntapped() &&
target.isController(player);
}
};

def FIVE_UNTAPPED_SOLDIER_CONDITION = new MagicCondition() {
public boolean accept(final MagicSource source) {
return source.getController().getNrOfPermanents(UNTAPPED_SOLDIER_YOU_CONTROL) >= 5;
}
};

def AN_UNTAPPED_SOLDIER_YOU_CONTROL = new MagicTargetChoice(UNTAPPED_SOLDIER_YOU_CONTROL,"an untapped SOLDIER you control");

[
new MagicPermanentActivation(
[FIVE_UNTAPPED_SOLDIER_CONDITION],
new MagicActivationHints(MagicTiming.Removal),
"Untap"
) {
	@Override
	public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
		return [
			new MagicTapPermanentEvent(source, AN_UNTAPPED_SOLDIER_YOU_CONTROL),
			new MagicTapPermanentEvent(source, AN_UNTAPPED_SOLDIER_YOU_CONTROL),
			new MagicTapPermanentEvent(source, AN_UNTAPPED_SOLDIER_YOU_CONTROL),
			new MagicTapPermanentEvent(source, AN_UNTAPPED_SOLDIER_YOU_CONTROL),
			new MagicTapPermanentEvent(source, AN_UNTAPPED_SOLDIER_YOU_CONTROL)
		];
	}

	@Override
	public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {		
		return new MagicEvent(
			source,
			MagicTargetChoice.NEG_TARGET_CREATURE,
			MagicExileTargetPicker.create(),
			this,
			"Exile target creature\$."
		);		
	}

	@Override
	public void executeEvent(final MagicGame game, final MagicEvent event) {
		final MagicPermanent creature ->
		game.doAction(new MagicRemoveFromPlayAction(creature,MagicLocationType.Exile));
	}
}
]
Pushed