magarena/release/Magarena/scripts/Riku_of_Two_Reflections.groovy

55 lines
2.1 KiB
Groovy

[
new MagicWhenOtherSpellIsCastTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicCardOnStack cardOnStack) {
return (permanent.isFriend(cardOnStack) && cardOnStack.isInstantOrSorcerySpell()) ?
new MagicEvent(
permanent,
new MagicMayChoice(
new MagicPayManaCostChoice(MagicManaCost.create("{U}{R}"))
),
cardOnStack,
this,
"You may\$ pay {U}{R}. If you do, copy RN. You may choose new targets for the copy."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicCopyCardOnStackAction(event.getPlayer(),event.getRefCardOnStack()));
}
}
},
new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPermanent otherPermanent) {
return (otherPermanent != permanent &&
otherPermanent.isNonToken() &&
otherPermanent.isCreature() &&
otherPermanent.isFriend(permanent)) ?
new MagicEvent(
permanent,
new MagicMayChoice(
new MagicPayManaCostChoice(MagicManaCost.create("{G}{U}"))
),
otherPermanent,
this,
"You may\$ pay {G}{U}. If you do, put a token that's a copy of RN onto the battlefield."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicPlayTokenAction(
event.getPlayer(),
event.getRefPermanent()
));
}
}
}
]