55 lines
1.8 KiB
Groovy
55 lines
1.8 KiB
Groovy
[
|
|
new MagicStatic(MagicLayer.Player) {
|
|
@Override
|
|
public void modPlayer(final MagicPermanent source, final MagicPlayer player) {
|
|
player.setState(MagicPlayerState.CantCastSpells);
|
|
}
|
|
@Override
|
|
public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
|
|
return game.isCombatPhase();
|
|
}
|
|
},
|
|
new MagicPermanentActivation(
|
|
[MagicConditionFactory.ManaCost("{R}")],
|
|
new MagicActivationHints(MagicTiming.MustAttack),
|
|
"Attacks"
|
|
) {
|
|
@Override
|
|
public MagicEvent[] getCostEvent(final MagicPermanent source) {
|
|
return [
|
|
new MagicPayManaCostEvent(
|
|
source,
|
|
source.getController(),
|
|
MagicManaCost.create("{R}")
|
|
)
|
|
];
|
|
}
|
|
|
|
@Override
|
|
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
|
|
return new MagicEvent(
|
|
source,
|
|
MagicTargetChoice.NEG_TARGET_CREATURE,
|
|
MagicMustAttackTargetPicker.create(),
|
|
this,
|
|
"Target creature\$ attacks this turn if able."
|
|
);
|
|
}
|
|
|
|
@Override
|
|
public void executeEvent(
|
|
final MagicGame game,
|
|
final MagicEvent event,
|
|
final Object[] choiceResults) {
|
|
event.processTargetPermanent(game,choiceResults,0,new MagicPermanentAction() {
|
|
public void doAction(final MagicPermanent creature) {
|
|
game.doAction(new MagicSetAbilityAction(
|
|
creature,
|
|
MagicAbility.AttacksEachTurnIfAble
|
|
));
|
|
}
|
|
});
|
|
}
|
|
}
|
|
]
|