magarena/release/Magarena/scripts/Sludge_Strider.groovy

47 lines
1.6 KiB
Groovy
Raw Normal View History

2013-05-30 20:35:30 -07:00
def action = {
final MagicGame game, final MagicEvent event ->
if (event.isYes()) {
event.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
game.doAction(new MagicChangeLifeAction(player,-1));
game.doAction(new MagicChangeLifeAction(event.getPlayer(),1));
}
});
2013-06-23 18:29:26 -07:00
}
2013-05-30 20:52:57 -07:00
} as MagicEventAction
2013-05-30 20:35:30 -07:00
def event = {
final MagicPermanent permanent ->
return new MagicEvent(
permanent,
new MagicMayChoice(
new MagicPayManaCostChoice(MagicManaCost.create("{1}")),
MagicTargetChoice.NEG_TARGET_PLAYER
),
action,
2013-05-30 20:51:15 -07:00
"You may\$ pay {1}\$. If you do, target player\$ loses 1 life and you gain 1 life."
2013-05-30 20:35:30 -07:00
);
}
[
new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (otherPermanent != permanent &&
otherPermanent.isArtifact() &&
otherPermanent.isFriend(permanent)) ?
event(permanent) : MagicEvent.NONE;
}
},
new MagicWhenLeavesPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicRemoveFromPlayAction act) {
final MagicPermanent left = act.getPermanent();
2013-05-30 20:35:30 -07:00
return (left != permanent &&
left.isArtifact() &&
left.isFriend(permanent)) ?
event(permanent) : MagicEvent.NONE;
}
}
]