magarena/release/Magarena/scripts/Siege_Gang_Commander.groovy

57 lines
2.0 KiB
Groovy

[
new MagicPermanentActivation(
[
MagicConditionFactory.ManaCost("{1}{R}"),
MagicCondition.CONTROL_GOBLIN_CONDITION
],
new MagicActivationHints(MagicTiming.Removal,true),
"Damage"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [
new MagicPayManaCostEvent(source,"{1}{R}"),
new MagicSacrificePermanentEvent(source,MagicTargetChoice.SACRIFICE_GOBLIN)
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,
new MagicDamageTargetPicker(2),
this,
"SN deals 2 damage to target creature or player\$."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTarget(game,new MagicTargetAction() {
public void doAction(final MagicTarget target) {
final MagicDamage damage=new MagicDamage(event.getSource(),target,2);
game.doAction(new MagicDealDamageAction(damage));
}
});
}
},
new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
return new MagicEvent(
permanent,
this,
"PN puts three 1/1 red Goblin creature tokens onto the battlefield."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicPlayTokensAction(
event.getPlayer(),
TokenCardDefinitions.get("Goblin1"),
3
));
}
}
]