magarena/release/Magarena/scripts/Electrickery.groovy

58 lines
2.1 KiB
Groovy
Raw Normal View History

2013-02-22 19:19:38 -08:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_CREATURE_YOU_DONT_CONTROL,
new MagicDamageTargetPicker(1),
this,
"SN deals 1 damage to target creature\$ you don't control."
);
}
@Override
public void executeEvent(
final MagicGame game,
2013-03-22 22:00:53 -07:00
final MagicEvent event) {
event.processTarget(game,new MagicTargetAction() {
2013-02-22 19:19:38 -08:00
public void doAction(final MagicTarget target) {
final MagicDamage damage=new MagicDamage(event.getSource(),target,1);
2013-02-22 19:19:38 -08:00
game.doAction(new MagicDealDamageAction(damage));
}
});
}
},
new MagicCardActivation(
[
MagicConditionFactory.ManaCost("{1}{R}")
2013-02-22 19:19:38 -08:00
],
new MagicActivationHints(MagicTiming.Tapping,true),
"Overload"
) {
public MagicEvent[] getCostEvent(final MagicCard source) {
return [
2013-05-21 19:54:06 -07:00
new MagicPayManaCostEvent(source,"{1}{R}")
2013-02-22 19:19:38 -08:00
];
}
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"SN deals 1 damage to each creature\$ you don't control."
);
}
@Override
public void executeEvent(
final MagicGame game,
2013-03-22 22:00:53 -07:00
final MagicEvent event) {
2013-02-22 19:19:38 -08:00
final Collection<MagicPermanent> targets=
game.filterPermanents(event.getPlayer(),MagicTargetFilter.TARGET_CREATURE_YOUR_OPPONENT_CONTROLS);
for (final MagicPermanent target : targets) {
final MagicDamage damage=new MagicDamage(event.getSource(),target,1);
2013-02-22 19:19:38 -08:00
game.doAction(new MagicDealDamageAction(damage));
}
}
}
]