magarena/release/Magarena/scripts/Kor_Spiritdancer.groovy

42 lines
1.4 KiB
Groovy

[
new MagicStatic(MagicLayer.ModPT) {
@Override
public void modPowerToughness(
final MagicPermanent source,
final MagicPermanent permanent,
final MagicPowerToughness pt) {
if (permanent.isEnchanted()) {
pt.add(
2 * permanent.getAuraPermanents().size(),
2 * permanent.getAuraPermanents().size()
);
}
}
},
new MagicWhenOtherSpellIsCastTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack spell) {
return (permanent.isFriend(spell) &&
spell.getCardDefinition().isAura()) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.DRAW_CARDS,
1,
MagicSimpleMayChoice.DEFAULT_NONE
),
this,
"PN may\$ draw a card."
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicDrawAction(event.getPlayer(),1));
}
}
}
]