magarena/release/Magarena/scripts/Sliver_Overlord.groovy

80 lines
2.4 KiB
Groovy

def SLIVER_CARD_FROM_LIBRARY = new MagicCardFilterImpl() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicCard target) {
return target.hasSubType(MagicSubType.Sliver);
}
public boolean acceptType(final MagicTargetType targetType) {
return targetType == MagicTargetType.Library;
}
};
def A_SLIVER_CARD_FROM_LIBRARY = new MagicTargetChoice(
SLIVER_CARD_FROM_LIBRARY,
"a Sliver card"
);
[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Draw),
"Search"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicPayManaCostEvent(source, "{3}")
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"PN searches his or her library for a Sliver card, reveal it, put it into his or her hand, and shuffle his or her library."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.addEvent(new MagicSearchIntoHandEvent(
event,
A_SLIVER_CARD_FROM_LIBRARY
));
}
},
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Removal),
"Control"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicPayManaCostEvent(source, "{3}")
];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.Negative("target Sliver"),
MagicExileTargetPicker.create(),
this,
"PN gains control of target Sliver\$."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent perm ->
game.doAction(new MagicGainControlAction(
event.getPlayer(),
perm
));
} as MagicPermanentAction);
}
}
]