magarena/release/Magarena/scripts/Frost_Titan.groovy

59 lines
2.2 KiB
Groovy
Raw Normal View History

2013-05-30 22:21:25 -07:00
def action = {
final MagicGame game, final MagicEvent event ->
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent perm) {
game.doAction(new MagicTapAction(perm,true));
game.doAction(MagicChangeStateAction.Set(perm,MagicPermanentState.DoesNotUntapDuringNext));
2013-05-30 22:21:25 -07:00
}
});
2013-05-30 22:36:14 -07:00
} as MagicEventAction
2013-05-30 22:21:25 -07:00
def event = {
final MagicPermanent permanent ->
return new MagicEvent(
permanent,
MagicTargetChoice.TARGET_PERMANENT,
2013-05-30 22:36:14 -07:00
action,
2013-05-30 22:21:25 -07:00
"Tap target permanent\$. It doesn't untap during its controller's next untap step."
);
}
[
//counter opponent spell or ability unless its controller pay {2}
new MagicWhenTargetedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicItemOnStack target) {
return (target.containsInChoiceResults(permanent) &&
target.getController() != permanent.getController()) ?
new MagicEvent(
permanent,
target,
this,
"Counter spell or ability\$ unless its controller pays {2}."
):
MagicEvent.NONE;
}
2013-06-23 18:29:26 -07:00
2013-05-30 22:21:25 -07:00
@Override
2013-05-30 22:36:14 -07:00
public void executeEvent(final MagicGame game, final MagicEvent mevent) {
final MagicSource source = mevent.getSource();
final MagicItemOnStack target = mevent.getRefItemOnStack();
2013-05-30 22:21:25 -07:00
game.addEvent(new MagicCounterUnlessEvent(source,target,MagicManaCost.create("{2}")));
}
},
//tap target permanent. It doesn't untap during its controller's next untap step.
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:21:25 -07:00
return event(permanent);
}
},
new MagicWhenAttacksTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
return (permanent == creature) ?
event(permanent) : MagicEvent.NONE;
}
}
]