convert from java code to groovy code
parent
333d4735b0
commit
d25d5b8e04
|
@ -0,0 +1,22 @@
|
|||
[
|
||||
new MagicSpellCardEvent() {
|
||||
@Override
|
||||
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
|
||||
return new MagicEvent(
|
||||
cardOnStack,
|
||||
this,
|
||||
"All creatures get -2/-2 until end of turn."
|
||||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
final Collection<MagicPermanent> targets=
|
||||
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_CREATURE);
|
||||
for (final MagicPermanent target : targets) {
|
||||
game.doAction(new MagicChangeTurnPTAction(target,-2,-2));
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
|
@ -7,4 +7,4 @@ rarity=U
|
|||
type=Sorcery
|
||||
cost={1}{B}{B}
|
||||
timing=removal
|
||||
requires_card_code
|
||||
requires_groovy_code
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
package magic.card;
|
||||
|
||||
import magic.model.MagicGame;
|
||||
import magic.model.MagicPayedCost;
|
||||
import magic.model.MagicPermanent;
|
||||
import magic.model.action.MagicChangeTurnPTAction;
|
||||
import magic.model.event.MagicEvent;
|
||||
import magic.model.event.MagicSpellCardEvent;
|
||||
import magic.model.stack.MagicCardOnStack;
|
||||
import magic.model.target.MagicTargetFilter;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class Infest {
|
||||
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
|
||||
@Override
|
||||
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
|
||||
return new MagicEvent(
|
||||
cardOnStack,
|
||||
this,
|
||||
"All creatures get -2/-2 until end of turn.");
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
final Collection<MagicPermanent> targets=
|
||||
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_CREATURE);
|
||||
for (final MagicPermanent target : targets) {
|
||||
game.doAction(new MagicChangeTurnPTAction(target,-2,-2));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue