magarena/release/Magarena/scripts/Rise_of_the_Hobgoblins.groovy

63 lines
2.3 KiB
Groovy
Raw Normal View History

2013-05-30 22:15:02 -07:00
[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Block,true,1),
"First strike"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
2013-05-30 22:15:02 -07:00
return [
new MagicPayManaCostEvent(source,"{R/W}"),
new MagicPlayAbilityEvent(source)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"Red creatures and white creatures you control gain first strike until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player=event.getPlayer();
final Collection<MagicPermanent> targets=game.filterPermanents(
player,
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL);
for (final MagicPermanent creature : targets) {
if (creature.hasColor(MagicColor.Red) ||
creature.hasColor(MagicColor.White)) {
game.doAction(new MagicGainAbilityAction(creature,MagicAbility.FirstStrike));
2013-05-30 22:15:02 -07:00
}
}
}
},
new MagicWhenComesIntoPlayTrigger() {
@Override
2013-06-19 07:23:35 -07:00
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPayedCost payedCost) {
2013-05-30 22:15:02 -07:00
return new MagicEvent(
permanent,
new MagicMayChoice(
new MagicPayManaCostChoice(MagicManaCost.create("{X}"))
),
this,
"You may pay\$ {X}\$. If you do, put X 1/1 red and white Goblin Soldier creature tokens onto the battlefield."
);
}
2013-06-23 18:29:26 -07:00
2013-05-30 22:15:02 -07:00
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
2013-05-30 22:36:14 -07:00
game.doAction(new MagicPlayTokensAction(
event.getPlayer(),
2013-05-30 22:15:02 -07:00
TokenCardDefinitions.get("Goblin Soldier"),
2013-05-30 22:36:14 -07:00
event.getPaidMana().getX()
2013-05-30 22:15:02 -07:00
));
}
}
}
]