magarena/release/Magarena/scripts/Teleportal.groovy

58 lines
2.2 KiB
Groovy
Raw Normal View History

2013-02-20 06:15:53 -08:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_CREATURE_YOU_CONTROL,
new MagicTapTargetPicker(true,false),
this,
"Target creature\$ you control gets +1/+0 until end of turn and is unblockable this turn."
);
}
@Override
public void executeEvent(
final MagicGame game,
2013-03-22 22:00:53 -07:00
final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
2013-02-20 06:15:53 -08:00
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicChangeTurnPTAction(creature, 1, 0));
game.doAction(new MagicSetAbilityAction(creature, MagicAbility.Unblockable));
}
});
}
},
new MagicCardActivation(
[
MagicConditionFactory.ManaCost("{3}{U}{R}")
2013-02-20 06:15:53 -08:00
],
new MagicActivationHints(MagicTiming.Tapping,true),
"Overload"
) {
public MagicEvent[] getCostEvent(final MagicCard source) {
return [
2013-05-21 19:54:06 -07:00
new MagicPayManaCostEvent(source,"{3}{U}{R}")
2013-02-20 06:15:53 -08:00
];
}
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Each creature you control gets +1/+0 until end of turn and is unblockable this turn."
);
}
@Override
public void executeEvent(
final MagicGame game,
2013-03-22 22:00:53 -07:00
final MagicEvent event) {
2013-02-20 06:15:53 -08:00
final Collection<MagicPermanent> targets=
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL);
for (final MagicPermanent creature : targets) {
game.doAction(new MagicChangeTurnPTAction(creature, 1, 0));
game.doAction(new MagicSetAbilityAction(creature, MagicAbility.Unblockable));
}
}
}
]