convert from java code to groovy code
parent
d332db12f8
commit
53fc1b9a50
|
@ -1,18 +1,5 @@
|
||||||
package magic.card;
|
[
|
||||||
|
new MagicAtUpkeepTrigger() {
|
||||||
import magic.model.MagicDamage;
|
|
||||||
import magic.model.MagicGame;
|
|
||||||
import magic.model.MagicPermanent;
|
|
||||||
import magic.model.MagicPlayer;
|
|
||||||
import magic.model.action.MagicDealDamageAction;
|
|
||||||
import magic.model.event.MagicEvent;
|
|
||||||
import magic.model.target.MagicTarget;
|
|
||||||
import magic.model.trigger.MagicAtUpkeepTrigger;
|
|
||||||
import magic.model.trigger.MagicWhenComesIntoPlayTrigger;
|
|
||||||
|
|
||||||
|
|
||||||
public class Black_Vise {
|
|
||||||
public static final MagicAtUpkeepTrigger T1 = new MagicAtUpkeepTrigger() {
|
|
||||||
@Override
|
@Override
|
||||||
public MagicEvent executeTrigger(
|
public MagicEvent executeTrigger(
|
||||||
final MagicGame game,
|
final MagicGame game,
|
||||||
|
@ -25,13 +12,12 @@ public class Black_Vise {
|
||||||
upkeepPlayer,
|
upkeepPlayer,
|
||||||
this,
|
this,
|
||||||
"PN deals X damage to PN " +
|
"PN deals X damage to PN " +
|
||||||
"where X is the number of cards in his or her hand minus 4."):
|
"where X is the number of cards in his or her hand minus 4."
|
||||||
|
):
|
||||||
MagicEvent.NONE;
|
MagicEvent.NONE;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void executeEvent(
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||||
final MagicGame game,
|
|
||||||
final MagicEvent event) {
|
|
||||||
final MagicPlayer player = event.getPlayer();
|
final MagicPlayer player = event.getPlayer();
|
||||||
final int amount = player.getHandSize() - 4;
|
final int amount = player.getHandSize() - 4;
|
||||||
if (amount > 0) {
|
if (amount > 0) {
|
||||||
|
@ -43,9 +29,8 @@ public class Black_Vise {
|
||||||
game.doAction(new MagicDealDamageAction(damage));
|
game.doAction(new MagicDealDamageAction(damage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
new MagicWhenComesIntoPlayTrigger() {
|
||||||
public static final MagicWhenComesIntoPlayTrigger T2 = new MagicWhenComesIntoPlayTrigger() {
|
|
||||||
@Override
|
@Override
|
||||||
public MagicEvent executeTrigger(
|
public MagicEvent executeTrigger(
|
||||||
final MagicGame game,
|
final MagicGame game,
|
||||||
|
@ -54,11 +39,5 @@ public class Black_Vise {
|
||||||
permanent.setChosenTarget(player.getOpponent());
|
permanent.setChosenTarget(player.getOpponent());
|
||||||
return MagicEvent.NONE;
|
return MagicEvent.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void executeEvent(
|
|
||||||
final MagicGame game,
|
|
||||||
final MagicEvent event) {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
]
|
|
@ -6,4 +6,4 @@ rarity=U
|
||||||
type=Artifact
|
type=Artifact
|
||||||
cost={1}
|
cost={1}
|
||||||
timing=smain
|
timing=smain
|
||||||
requires_card_code
|
requires_groovy_code
|
||||||
|
|
Loading…
Reference in New Issue