magarena/release/Magarena/scripts/Szadek__Lord_of_Secrets.groovy

36 lines
1.4 KiB
Groovy
Raw Normal View History

2013-05-17 23:14:23 -07:00
[
2013-07-23 23:41:12 -07:00
new MagicIfDamageWouldBeDealtTrigger(MagicTrigger.REPLACE_DAMAGE) {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
2013-07-23 23:41:12 -07:00
int amount = 0;
if (permanent == damage.getSource() &&
2013-06-23 18:29:26 -07:00
damage.isCombat() &&
2011-08-13 23:57:22 -07:00
damage.getTarget().isPlayer()) {
2012-06-17 05:19:08 -07:00
// Replacement effect.
2013-07-23 23:41:12 -07:00
amount = damage.replace();
2013-06-23 18:29:26 -07:00
}
2013-07-23 23:41:12 -07:00
return amount > 0 ?
new MagicEvent(
permanent,
damage.getTarget(),
{
final MagicGame G, final MagicEvent E ->
G.doAction(new MagicChangeCountersAction(
E.getPermanent(),
MagicCounterType.PlusOne,
amount,
true
));
G.doAction(new MagicMillLibraryAction(
E.getRefPlayer(),
amount
));
} as MagicEventAction,
"Put ${amount} +1/+1 counters on SN and RN puts that many cards from the top of his or her library into his or her graveyard."
):
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
2013-05-17 23:14:23 -07:00
}
]