upgraded to Groovy 2.2.0, removed explicit type coercion in scripts as 2.2.0 supports implicit closure coercion

master
melvin 2013-11-22 09:41:43 +08:00
parent d64bd58234
commit 247b61c0a8
82 changed files with 90 additions and 90 deletions

View File

@ -7,7 +7,7 @@
<property name="target" value="1.7"/>
<property name="source" value="1.7"/>
<property name="lib" value="release/lib" />
<property name="groovy-version" value="2.1.7-indy" />
<property name="groovy-version" value="2.2.0-indy" />
<path id="classpath">
<fileset dir="${lib}">
@ -22,7 +22,7 @@
<!-- deps - Download dependencies -->
<target name="deps" unless="skip.download">
<echo message="downloading groovy to ${lib}"/>
<get src="http://search.maven.org/remotecontent?filepath=org/codehaus/groovy/groovy-all/2.1.7/groovy-all-${groovy-version}.jar"
<get src="http://search.maven.org/remotecontent?filepath=org/codehaus/groovy/groovy-all/2.2.0/groovy-all-${groovy-version}.jar"
dest="${lib}/groovy-all-${groovy-version}.jar"
skipexisting="true" />
<echo message="downloading MigLayout to ${lib}"/>

View File

@ -20,7 +20,7 @@
permanent,
MagicAtEndOfCombatTrigger.Return
))
} as MagicPermanentAction);
});
}
}
]

View File

@ -33,7 +33,7 @@
E.getRefPermanent()
));
}
} as MagicEventAction,
},
"You may\$ attach SN to RN."
));
}

View File

@ -19,7 +19,7 @@
permanent,
MagicAtEndOfCombatTrigger.Destroy
))
} as MagicPermanentAction);
});
}
}
]

View File

@ -53,7 +53,7 @@ def ST = new MagicStatic(MagicLayer.Type) {
game.doAction(new MagicChangeCountersAction(creature,MagicCounterType.Gold,1,true));
game.doAction(new MagicAddStaticAction(creature, AB));
game.doAction(new MagicAddStaticAction(creature, ST));
} as MagicPermanentAction);
});
}
},
new MagicWhenLeavesPlayTrigger() {

View File

@ -56,7 +56,7 @@ def AB = new MagicStatic(MagicLayer.Ability) {
game.doAction(new MagicChangeCountersAction(creature,MagicCounterType.Feather,1,true));
game.doAction(new MagicAddStaticAction(creature, PT));
game.doAction(new MagicAddStaticAction(creature, AB));
} as MagicPermanentAction);
});
}
}
}

View File

@ -20,7 +20,7 @@
permanent,
MagicAbility.Lifelink
));
} as MagicPermanentAction);
});
}
}
]

View File

@ -8,7 +8,7 @@ def action = {
MagicTargetChoice.SACRIFICE_CREATURE
));
}
} as MagicEventAction
}
def event = {
final MagicPermanent permanent ->

View File

@ -20,7 +20,7 @@
event.getCardOnStack(),
chosen
));
} as MagicPermanentAction);
});
} else {
game.doAction(new MagicPlayCardFromStackAction(
event.getCardOnStack()

View File

@ -37,7 +37,7 @@
player,
perm
));
} as MagicPermanentAction);
});
}else{
event.processTargetPermanent(game, new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {

View File

@ -6,7 +6,7 @@ def action = {
game.doAction(new MagicMoveCardAction(targetCard,MagicLocationType.Graveyard,MagicLocationType.OwnersHand));
}
});
} as MagicEventAction
}
def event = {
final MagicPermanent permanent ->

View File

@ -20,7 +20,7 @@
permanent,
MagicAtEndOfCombatTrigger.Destroy
))
} as MagicPermanentAction);
});
}
}
]

View File

@ -22,7 +22,7 @@ def PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
event.processTargetPermanent(game, {
MagicPermanent creature ->
game.doAction(new MagicBecomesCreatureAction(creature,PT));
} as MagicPermanentAction);
});
}
}
]

View File

@ -45,7 +45,7 @@ def control = {
game.doAction(new MagicTapAction(perm, true));
final MagicTargetFilter<MagicPermanent> filter = new MagicTargetFilter.MagicPermanentTargetFilter(perm);
game.doAction(new MagicAddStaticAction(source, control(source.getController().getIndex(), filter)));
} as MagicPermanentAction);
});
}
}
]

View File

@ -10,7 +10,7 @@ def action = {
} else {
game.doAction(new MagicDestroyAction(event.getRefPermanent()));
}
} as MagicEventAction
}
[
new MagicPermanentActivation(
@ -47,7 +47,7 @@ def action = {
action,
"PN may\$ have SN deal 2 damage to him or her."
));
} as MagicPermanentAction);
});
}
}
]

View File

@ -43,7 +43,7 @@ def ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
}
};
game.doAction(new MagicBecomesCreatureAction(land,PT,ST));
} as MagicPermanentAction);
});
}
}
]

View File

@ -24,7 +24,7 @@ def act = {
}
});
}
} as MagicEventAction
}
def evt = {
final MagicEvent event, final MagicChoice choice ->

View File

@ -69,7 +69,7 @@ def GainAct = new MagicStatic(MagicLayer.Ability) {
action.getPermanent(),
GainAct
));
} as MagicPermanentAction);
});
} else {
game.doAction(new MagicPlayCardFromStackAction(
event.getCardOnStack()

View File

@ -3,7 +3,7 @@ def action = {
if (event.isYes()) {
game.doAction(new MagicChangeCountersAction(event.getRefPermanent(),MagicCounterType.PlusOne,1,true));
}
} as MagicEventAction
}
def event = {
final MagicPermanent permanent, final MagicPermanent target ->

View File

@ -3,7 +3,7 @@ def action = {
if (event.isNo()) {
game.doAction(new MagicSacrificeAction(event.getPermanent()));
}
} as MagicEventAction ;
} ;
[
new MagicAtUpkeepTrigger() {

View File

@ -6,7 +6,7 @@ def action = {
game.doAction(MagicChangeStateAction.Set(perm,MagicPermanentState.DoesNotUntapDuringNext));
}
});
} as MagicEventAction
}
def event = {
final MagicPermanent permanent ->

View File

@ -2,7 +2,7 @@ def action = {
final MagicGame game, final MagicEvent event ->
final int amount = event.getPlayer().getOpponent().getNrOfAttackers() + event.getPlayer().getNrOfAttackers();
game.doAction(new MagicChangeTurnPTAction(event.getPermanent(),amount,amount));
} as MagicEventAction
}
def event = {
final MagicPermanent permanent ->

View File

@ -9,7 +9,7 @@ def action = {
));
}
});
} as MagicEventAction
}
[
new MagicSpellCardEvent() {

View File

@ -9,7 +9,7 @@ def action = {
}
}
});
} as MagicEventAction
}
[
new MagicPermanentActivation(
@ -46,7 +46,7 @@ def action = {
"PN exiles a card\$ from his or her graveyard."
));
}
} as MagicPlayerAction);
});
}
}
]

View File

@ -17,7 +17,7 @@
amount
)
));
} as MagicEventAction,
},
"SN deals ${amount} damage to RN."
):
MagicEvent.NONE;

View File

@ -7,7 +7,7 @@ def Action = {
game.doAction(new MagicChangeTurnPTAction(creature,1,1));
}
}
} as MagicEventAction
}
def Event = {
final MagicPermanent permanent ->

View File

@ -24,7 +24,7 @@ def act = {
}
});
}
} as MagicEventAction
}
def evt = {
final MagicEvent event, final MagicChoice choice ->

View File

@ -36,7 +36,7 @@ def ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
event.processTargetPermanent(game, {
final MagicPermanent land ->
game.doAction(new MagicBecomesCreatureAction(land,PT,ST));
} as MagicPermanentAction);
});
}
},
new MagicPermanentActivation(

View File

@ -50,7 +50,7 @@ def TP = new MagicTargetPicker<MagicPermanent>() {
event.processTargetPermanent(game, {
final MagicPermanent creature ->
game.doAction(new MagicBecomesCreatureAction(creature,PT,ST));
} as MagicPermanentAction);
});
}
}
]

View File

@ -41,7 +41,7 @@ def TP = new MagicTargetPicker<MagicPermanent>() {
event.processTargetPermanent(game, {
final MagicPermanent creature ->
game.doAction(new MagicBecomesCreatureAction(creature,PT,ST));
} as MagicPermanentAction);
});
}
}
]

View File

@ -20,7 +20,7 @@
permanent,
MagicAtEndOfCombatTrigger.Destroy
))
} as MagicPermanentAction);
});
}
}
]

View File

@ -25,7 +25,7 @@
perm
)
));
} as MagicPermanentAction);
});
}
}
]

View File

@ -62,7 +62,7 @@
event.getPlayer(),
perm
));
} as MagicPermanentAction);
});
}
}
]

View File

@ -16,7 +16,7 @@
{
final MagicGame G, final MagicEvent E ->
G.doAction(new MagicSacrificeAction(E.getPermanent()));
} as MagicEventAction,
},
"Sacrifice SN."
);
}

View File

@ -19,7 +19,7 @@
new MagicDamage(event.getSource(),target,2)
));
game.doAction(new MagicGainAbilityAction(target, MagicAbility.CannotBlock));
} as MagicPermanentAction);
});
}
}
]

View File

@ -3,7 +3,7 @@ def action = {
if (event.isYes()) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),5));
}
} as MagicEventAction
}
def event = {
final MagicPermanent permanent ->

View File

@ -24,7 +24,7 @@ def act = {
}
});
}
} as MagicEventAction
}
def evt = {
final MagicEvent event, final MagicChoice choice ->

View File

@ -22,7 +22,7 @@ def TP = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
MagicPermanent creature ->
game.doAction(new MagicBecomesCreatureAction(creature,TP));
game.doAction(new MagicChangeTurnPTAction(creature,3,-3));
} as MagicPermanentAction);
});
}
}
]

View File

@ -87,7 +87,7 @@
perm
)
));
} as MagicPermanentAction);
});
}
}
]

View File

@ -40,7 +40,7 @@ def ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
event.processTargetPermanent(game, {
final MagicPermanent creature ->
game.doAction(new MagicBecomesCreatureAction(creature,PT,ST));
} as MagicPermanentAction);
});
}
}
]

View File

@ -45,7 +45,7 @@
));
}
}
} as MagicEventAction,
},
"Chosen color\$."
));
}

View File

@ -6,7 +6,7 @@ def action = {
game.doAction(new MagicDealDamageAction(damage));
}
});
} as MagicEventAction
}
[
new MagicSpellCardEvent() {
@ -38,7 +38,7 @@ def action = {
action,
"SN deals RN damage to target creature\$."
));
} as MagicPermanentAction);
});
}
}
]

View File

@ -9,7 +9,7 @@ def action = {
));
}
});
} as MagicEventAction
}
[
new MagicPermanentActivation(
@ -48,7 +48,7 @@ def action = {
action,
"PN exiles a card from his or her hand."
));
} as MagicPlayerAction);
});
}
},
new MagicWhenLeavesPlayTrigger() {

View File

@ -24,7 +24,7 @@ def act = {
}
});
}
} as MagicEventAction
}
def evt = {
final MagicEvent event, final MagicChoice choice ->

View File

@ -29,7 +29,7 @@
G.doAction(new MagicTapAction(P, true))
}
}
} as MagicEventAction,
},
"PN may\$ " + (perm.isTapped() ? "untap" : "tap") + " RN."
));
}

View File

@ -32,7 +32,7 @@ def ST = new MagicStatic(MagicLayer.Type) {
final MagicPermanent perm = action.getPermanent();
game.doAction(new MagicAddStaticAction(perm, ST));
game.doAction(new MagicAddTriggerAction(perm, MagicWhenTargetedTrigger.SacWhenTargeted));
} as MagicPermanentAction);
});
} else {
game.doAction(new MagicPlayCardFromStackAction(
event.getCardOnStack()

View File

@ -2,7 +2,7 @@ def Action = {
final MagicGame game, final MagicEvent event ->
final MagicDamage damage = new MagicDamage(event.getSource(),event.getRefPermanent(),2);
game.doAction(new MagicDealDamageAction(damage));
} as MagicEventAction
}
def Event = {
final MagicPermanent permanent, final MagicPermanent creature ->

View File

@ -10,7 +10,7 @@ def EventAction = {
);
game.addEvent(search);
game.addEvent(search);
} as MagicEventAction;
};
def Event = {
final MagicPermanent permanent ->

View File

@ -52,7 +52,7 @@ def GainTrig = new MagicStatic(MagicLayer.Ability) {
game.doAction(action);
final MagicPermanent perm = action.getPermanent();
game.doAction(new MagicAddStaticAction(perm, GainTrig));
} as MagicPermanentAction);
});
} else {
game.doAction(new MagicPlayCardFromStackAction(
event.getCardOnStack()

View File

@ -17,7 +17,7 @@ def PulmonicTrigger = new MagicWouldBeMovedTrigger() {
//needs to be delayed so it occurs after trigger is remove
G.addDelayedAction(new MagicMoveCardAction(E.getRefCard(), act.fromLocation, MagicLocationType.Graveyard));
}
} as MagicEventAction,
},
"PN may\$ put SN on top of its owner's library."
));
}

View File

@ -19,7 +19,7 @@
permanent,
MagicAbility.DoubleStrike
));
} as MagicPermanentAction);
});
}
}
]

View File

@ -6,7 +6,7 @@ def action = {
game.doAction(new MagicMoveCardAction(card,MagicLocationType.Graveyard,MagicLocationType.Exile));
}
});
} as MagicEventAction
}
[
new MagicPermanentActivation(
@ -38,7 +38,7 @@ def action = {
action,
"PN exiles a card\$ from his or her graveyard."
));
} as MagicPlayerAction);
});
}
},
new MagicPermanentActivation(

View File

@ -21,7 +21,7 @@
event.getPlayer(),
[MagicPlayMod.BLACK, MagicPlayMod.ZOMBIE]
));
} as MagicCardAction);
});
}
}
]

View File

@ -20,7 +20,7 @@
permanent,
MagicAtEndOfCombatTrigger.Destroy
))
} as MagicPermanentAction);
});
}
}
]

View File

@ -24,7 +24,7 @@
perm
)
));
} as MagicPermanentAction);
});
}
}
}

View File

@ -48,7 +48,7 @@ def Spirit = new MagicStatic(MagicLayer.Type) {
final MagicPermanent permanent = action.getPermanent();
game.doAction(new MagicAddStaticAction(permanent, Spirit));
game.doAction(new MagicAddTriggerAction(permanent, MagicAtEndOfTurnTrigger.ExileAtEnd));
} as MagicCardAction);
});
}
}
}

View File

@ -6,7 +6,7 @@ def action = {
1,
true
));
} as MagicEventAction
}
def getEvent = {
final MagicPermanent permanent ->

View File

@ -42,7 +42,7 @@ def SU = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
event.processTargetPermanent(game, {
final MagicPermanent land ->
game.doAction(new MagicBecomesCreatureAction(land,PT,ST,SU));
} as MagicPermanentAction);
});
}
}
]

View File

@ -37,7 +37,7 @@ def cantBePrevented = new MagicIfDamageWouldBeDealtTrigger() {
final MagicDamage damage=new MagicDamage(event.getSource(),player,3);
game.doAction(new MagicDealDamageAction(damage));
} as MagicPlayerAction);
});
}
}
]

View File

@ -73,7 +73,7 @@ def A_SLIVER_CARD_FROM_LIBRARY = new MagicTargetChoice(
event.getPlayer(),
perm
));
} as MagicPermanentAction);
});
}
}
]

View File

@ -8,7 +8,7 @@ def action = {
}
});
}
} as MagicEventAction
}
def event = {
final MagicPermanent permanent ->

View File

@ -24,7 +24,7 @@
permanent,
MagicAtEndOfCombatTrigger.Destroy
))
} as MagicPermanentAction);
});
}
}
]

View File

@ -19,7 +19,7 @@
new MagicDamage(event.getSource(),target,1)
));
game.addEvent(new MagicScryEvent(event));
} as MagicTargetAction);
});
}
}
]

View File

@ -5,7 +5,7 @@ def action = {
game.doAction(new MagicSacrificeAction(permanent));
}
});
} as MagicEventAction;
};
[
new MagicPermanentActivation(

View File

@ -15,7 +15,7 @@
event.processTargetPlayer(game, {
final MagicPlayer player ->
game.doAction(new MagicChangeLifeAction(player, event.getRefInt()));
} as MagicPlayerAction);
});
}
}
]

View File

@ -7,7 +7,7 @@ def action = {
final MagicDamage damage = new MagicDamage(source,creature,1);
game.doAction(new MagicDealDamageAction(damage));
}
} as MagicEventAction
}
def genEvent = {
final MagicPermanent permanent ->

View File

@ -50,7 +50,7 @@ def TP = new MagicTargetPicker<MagicPermanent>() {
event.processTargetPermanent(game, {
final MagicPermanent creature ->
game.doAction(new MagicBecomesCreatureAction(creature,PT,ST));
} as MagicPermanentAction);
});
}
}
]

View File

@ -24,7 +24,7 @@ def act = {
}
});
}
} as MagicEventAction
}
def evt = {
final MagicEvent event, final MagicChoice choice ->

View File

@ -26,7 +26,7 @@
E.getRefPlayer(),
amount
));
} as MagicEventAction,
},
"Put ${amount} +1/+1 counters on SN and RN puts that many cards from the top of his or her library into his or her graveyard."
):
MagicEvent.NONE;

View File

@ -21,7 +21,7 @@ def AB = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) {
event.processRefPermanent(game, {
final MagicPermanent permanent ->
game.doAction(new MagicAddStaticAction(permanent, AB));
} as MagicPermanentAction);
});
}
}
]

View File

@ -17,7 +17,7 @@
permanent,
MagicAtEndOfCombatTrigger.Destroy
))
} as MagicPermanentAction);
});
}
}
]

View File

@ -33,7 +33,7 @@
event.getPlayer()
));
}
} as MagicPlayerAction);
});
}
}
]

View File

@ -7,7 +7,7 @@ def action = {
game.doAction(new MagicChangeLifeAction(event.getRefPlayer(),toughness));
}
});
} as MagicEventAction
}
[
new MagicSpellCardEvent() {
@ -34,7 +34,7 @@ def action = {
action,
"Choose a creature to sacrifice\$."
));
} as MagicPlayerAction);
});
}
}
]

View File

@ -43,7 +43,7 @@ def C = new MagicStatic(MagicLayer.Color, MagicStatic.UntilEOT) {
//Does not lose static or triggers
game.doAction(new MagicGainAbilityAction(creature,MagicAbility.CantActivateAbilities));
game.doAction(new MagicBecomesCreatureAction(creature,PT,AB,ST,C));
} as MagicPermanentAction);
});
}
}
]

View File

@ -25,7 +25,7 @@ def act = {
}
});
}
} as MagicEventAction
}
def evt = {
final MagicEvent event, final MagicChoice choice ->

View File

@ -23,7 +23,7 @@
permanent,
MagicAtEndOfCombatTrigger.Destroy
))
} as MagicPermanentAction);
});
}
}
]

View File

@ -2,7 +2,7 @@ def act = {
final MagicGame game, final MagicEvent event ->
final int amount = event.getPlayer().getOpponent().getNrOfAttackers() + event.getPlayer().getNrOfAttackers();
game.doAction(new MagicChangeTurnPTAction(event.getPermanent(),amount,amount));
} as MagicEventAction
}
def evt = {
final MagicPermanent permanent ->

View File

@ -23,7 +23,7 @@
amount,
true
));
} as MagicEventAction,
},
"Prevent ${amount} damage and put ${amount} +1/+1 counters on RN"
):
MagicEvent.NONE;

View File

@ -1,7 +1,7 @@
def Action = {
final MagicGame game, final MagicEvent event ->
game.doAction(new MagicPlayTokenAction(event.getPlayer(), TokenCardDefinitions.get("green and white Elemental creature token")));
} as MagicEventAction
}
def Event = {
final MagicPermanent permanent ->

View File

@ -16,7 +16,7 @@ def action = {
}
}
});
} as MagicEventAction
}
[
new MagicSpellCardEvent() {
@ -43,7 +43,7 @@ def action = {
action,
"Choose a creature to sacrifice\$."
));
} as MagicPlayerAction);
});
}
}
]

View File

@ -33,7 +33,7 @@ def AB = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) {
MagicStatic.AllCreatureTypesUntilEOT,
AB
));
} as MagicPermanentAction);
});
}
}
]

View File

@ -17,7 +17,7 @@
permanent,
MagicAbility.Wither
));
} as MagicPermanentAction);
});
}
},
new MagicWhenDamageIsDealtTrigger() {