convert from java code to groovy code

master
melvin 2013-03-18 21:16:29 +08:00
parent 16f5fa8cdd
commit 3e3a217747
4 changed files with 29 additions and 39 deletions

View File

@ -0,0 +1,9 @@
[
MagicAtUpkeepTrigger.EachPlayerDraw,
new MagicStatic(MagicLayer.Game) {
@Override
public void modGame(final MagicPermanent source, final MagicGame game) {
game.incMaxLand();
}
}
]

View File

@ -6,4 +6,4 @@ rarity=R
type=Enchantment
cost={2}{G}
timing=enchantment
requires_card_code
requires_groovy_code

View File

@ -1,38 +0,0 @@
package magic.card;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicDrawAction;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicAtUpkeepTrigger;
import magic.model.trigger.MagicWhenComesIntoPlayTrigger;
import magic.model.mstatic.MagicStatic;
import magic.model.mstatic.MagicLayer;
public class Rites_of_Flourishing {
public static final MagicAtUpkeepTrigger T3 = new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return new MagicEvent(
permanent,
upkeepPlayer,
this,
"PN draws a card."
);
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] choiceResults) {
final MagicPlayer player = event.getPlayer();
game.doAction(new MagicDrawAction(player,1));
}
};
public static final MagicStatic S = new MagicStatic(MagicLayer.Game) {
@Override
public void modGame(final MagicPermanent source, final MagicGame game) {
game.incMaxLand();
}
};
}

View File

@ -8,6 +8,7 @@ import magic.model.MagicSource;
import magic.model.MagicCounterType;
import magic.model.event.MagicEvent;
import magic.model.action.MagicChangeCountersAction;
import magic.model.action.MagicDrawAction;
import magic.model.choice.MagicSimpleMayChoice;
import magic.model.choice.MagicMayChoice;
@ -46,4 +47,22 @@ public abstract class MagicAtUpkeepTrigger extends MagicTrigger<MagicPlayer> {
}
}
};
public static final MagicAtUpkeepTrigger EachPlayerDraw = new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return new MagicEvent(
permanent,
upkeepPlayer,
this,
"PN draws a card."
);
}
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] choiceResults) {
final MagicPlayer player = event.getPlayer();
game.doAction(new MagicDrawAction(player,1));
}
};
}