convert from java code to groovy code

master
melvin 2013-05-18 18:44:18 +08:00
parent a4fe5a3966
commit 54fe7de590
3 changed files with 29 additions and 39 deletions

View File

@ -0,0 +1,28 @@
[
new MagicStatic(MagicLayer.ModPT) {
@Override
public void modPowerToughness(
final MagicPermanent source,
final MagicPermanent permanent,
final MagicPowerToughness pt) {
pt.add(1, 2);
}
@Override
public boolean accept(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
return MagicStatic.acceptLinked(game, source, target) && target.hasColor(MagicColor.White);
}
},
new MagicStatic(MagicLayer.ModPT) {
@Override
public void modPowerToughness(
final MagicPermanent source,
final MagicPermanent permanent,
final MagicPowerToughness pt) {
pt.add(2, 1);
}
@Override
public boolean accept(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
return MagicStatic.acceptLinked(game, source, target) && target.hasColor(MagicColor.Black);
}
}
]

View File

@ -7,5 +7,5 @@ type=Enchantment
subtype=Aura
cost={W/B}
timing=aura
requires_card_code
requires_groovy_code
enchant=pump,pos creature

View File

@ -1,38 +0,0 @@
package magic.card;
import magic.model.MagicColor;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPowerToughness;
import magic.model.mstatic.MagicLayer;
import magic.model.mstatic.MagicStatic;
public class Edge_of_the_Divinity {
public static final Object S1 = new MagicStatic(MagicLayer.ModPT) {
@Override
public void modPowerToughness(
final MagicPermanent source,
final MagicPermanent permanent,
final MagicPowerToughness pt) {
pt.add(1, 2);
}
@Override
public boolean accept(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
return MagicStatic.acceptLinked(game, source, target) && target.hasColor(MagicColor.White);
}
};
public static final Object S2 = new MagicStatic(MagicLayer.ModPT) {
@Override
public void modPowerToughness(
final MagicPermanent source,
final MagicPermanent permanent,
final MagicPowerToughness pt) {
pt.add(2, 1);
}
@Override
public boolean accept(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
return MagicStatic.acceptLinked(game, source, target) && target.hasColor(MagicColor.Black);
}
};
}