magarena/release/Magarena/scripts/Blinkmoth_Nexus.groovy

90 lines
3.0 KiB
Groovy

def PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
@Override
public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
pt.set(1,1);
}
};
def AB = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) {
@Override
public void modAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final Set<MagicAbility> flags) {
flags.add(MagicAbility.Flying);
}
};
def ST = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
@Override
public int getTypeFlags(final MagicPermanent permanent,final int flags) {
return flags |
MagicType.Artifact.getMask() |
MagicType.Creature.getMask();
}
@Override
public void modSubTypeFlags(final MagicPermanent permanent, final Set<MagicSubType> flags) {
flags.add(MagicSubType.Blinkmoth);
}
};
[
new MagicPermanentActivation(
[
new MagicArtificialCondition(
MagicConditionFactory.ManaCost("{2}")
)
],
new MagicActivationHints(MagicTiming.Animate),
"Animate"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [new MagicPayManaCostEvent(source,"{1}")];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"SN becomes a 1/1 Blinkmoth artifact creature with flying until end of turn. " +
"It's still a land."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicBecomesCreatureAction(event.getPermanent(),PT,AB,ST));
}
},
new MagicPermanentActivation(
[
new MagicArtificialCondition(
MagicConditionFactory.ManaCost("{2}")
)
],
new MagicActivationHints(MagicTiming.Pump,true),
"Pump"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [new MagicPayManaCostTapEvent(source,"{1}")];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.POS_TARGET_BLINKMOTH_CREATURE,
MagicPumpTargetPicker.create(),
this,
"Target Blinkmoth creature\$ gets +1/+1 until end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicChangeTurnPTAction(creature,1,1));
}
});
}
}
]