magarena/release/Magarena/scripts/Angelheart_Vial.groovy

57 lines
1.8 KiB
Groovy

[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Draw),
"Draw"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicTapEvent(source), new MagicPayManaCostEvent(source, "{2}"),
new MagicRemoveCounterEvent(
source,
MagicCounterType.Charge,
4
)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"PN gains 2 life and draws a card"
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),2));
game.doAction(new MagicDrawAction(event.getPlayer()));
}
},
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
return permanent.isController(damage.getTarget()) ?
new MagicEvent(
permanent,
damage.getDealtAmount(),
this,
"Put RN charge counters on SN."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicChangeCountersAction(
event.getPermanent(),
MagicCounterType.Charge,
event.getRefInt(),
false
));
}
}
]