Skip to content

Commit

Permalink
normalize card scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
melvinzhang committed Oct 27, 2014
1 parent fbcc40f commit 345a64a
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 192 deletions.
64 changes: 32 additions & 32 deletions release/Magarena/scripts/Atogatog.groovy
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
def choice = new MagicTargetChoice("a Pegasus to sacrifice");

[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Pump),
"Pump"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicSacrificePermanentEvent(source,choice)
];
}

@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
payedCost.getTarget(),
this,
"SN gets +X/+X until end of turn, where X is the sacrificed creature's power."
);
}

@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent sacrificed=event.getRefPermanent();
final int X = sacrificed.getPower();
game.doAction(new MagicChangeTurnPTAction(event.getPermanent(), X, X));
}
}
]
def choice = new MagicTargetChoice("a Pegasus to sacrifice");

[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Pump),
"Pump"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [
new MagicSacrificePermanentEvent(source,choice)
];
}

@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
payedCost.getTarget(),
this,
"SN gets +X/+X until end of turn, where X is the sacrificed creature's power."
);
}

@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent sacrificed=event.getRefPermanent();
final int X = sacrificed.getPower();
game.doAction(new MagicChangeTurnPTAction(event.getPermanent(), X, X));
}
}
]
22 changes: 11 additions & 11 deletions release/Magarena/scripts/Atogatog.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name=Atogatog
image=http://mtgimage.com/card/atogatog.jpg
value=2.500
rarity=R
type=Legendary,Creature
subtype=Atog
cost={W}{U}{B}{R}{G}
pt=5/5
timing=main
requires_groovy_code
oracle=Sacrifice an Atog creature: Atogatog gets +X/+X until end of turn, where X is the sacrificed creature's power.
name=Atogatog
image=http://mtgimage.com/card/atogatog.jpg
value=2.500
rarity=R
type=Legendary,Creature
subtype=Atog
cost={W}{U}{B}{R}{G}
pt=5/5
timing=main
requires_groovy_code
oracle=Sacrifice an Atog creature: Atogatog gets +X/+X until end of turn, where X is the sacrificed creature's power.
60 changes: 30 additions & 30 deletions release/Magarena/scripts/Cabal_Inquisitor.groovy
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
def choice = new MagicTargetChoice("a card from your graveyard");

def EFFECT = MagicRuleEventAction.create("Target player discards a card.");

[
new MagicPermanentActivation(
[
MagicCondition.THRESHOLD_CONDITION,
MagicConditionFactory.GraveyardAtLeast(2),
MagicCondition.SORCERY_CONDITION
],
new MagicActivationHints(MagicTiming.Draw),
"Discard"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [new MagicPayManaCostEvent(source,"{1}{B}"),
new MagicTapEvent(source),
new MagicExileCardEvent(source, choice),
new MagicExileCardEvent(source, choice)

];
}

@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return EFFECT.getEvent(source);
}
}
]
def choice = new MagicTargetChoice("a card from your graveyard");

def EFFECT = MagicRuleEventAction.create("Target player discards a card.");

[
new MagicPermanentActivation(
[
MagicCondition.THRESHOLD_CONDITION,
MagicConditionFactory.GraveyardAtLeast(2),
MagicCondition.SORCERY_CONDITION
],
new MagicActivationHints(MagicTiming.Draw),
"Discard"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [new MagicPayManaCostEvent(source,"{1}{B}"),
new MagicTapEvent(source),
new MagicExileCardEvent(source, choice),
new MagicExileCardEvent(source, choice)

];
}

@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return EFFECT.getEvent(source);
}
}
]
22 changes: 11 additions & 11 deletions release/Magarena/scripts/Cabal_Inquisitor.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name=Cabal Inquisitor
image=http://mtgimage.com/card/cabal%20inquisitor.jpg
value=2.500
rarity=C
type=Creature
subtype=Human,Minion
cost={1}{B}
pt=1/1
timing=main
requires_groovy_code
oracle=Threshold — {1}{B}, {T}, Exile two cards from your graveyard: Target player discards a card. Activate this ability only any time you could cast a sorcery, and only if seven or more cards are in your graveyard.
name=Cabal Inquisitor
image=http://mtgimage.com/card/cabal%20inquisitor.jpg
value=2.500
rarity=C
type=Creature
subtype=Human,Minion
cost={1}{B}
pt=1/1
timing=main
requires_groovy_code
oracle=Threshold — {1}{B}, {T}, Exile two cards from your graveyard: Target player discards a card. Activate this ability only any time you could cast a sorcery, and only if seven or more cards are in your graveyard.
58 changes: 29 additions & 29 deletions release/Magarena/scripts/Kirtar_s_Wrath.groovy
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Destroy all creatures. They can't be regenerated. " +
"If seven or more cards are in your graveyard, instead destroy all creatures, then put two 1/1 white Spirit creature tokens with flying onto the battlefield. Creatures destroyed this way can't be regenerated."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final Collection<MagicPermanent> targets = game.filterPermanents(MagicTargetFilterFactory.CREATURE);
for (final MagicPermanent target : targets) {
game.doAction(MagicChangeStateAction.Set(target,MagicPermanentState.CannotBeRegenerated));
}
final MagicDestroyAction destroy = new MagicDestroyAction(targets);
game.doAction(destroy);
if (MagicCondition.THRESHOLD_CONDITION.accept(event.getSource())) {
game.doAction(new MagicPlayTokensAction(
event.getPlayer(),
TokenCardDefinitions.get("1/1 white Spirit creature token with flying"),
2
));
}
}
}
]
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Destroy all creatures. They can't be regenerated. " +
"If seven or more cards are in your graveyard, instead destroy all creatures, then put two 1/1 white Spirit creature tokens with flying onto the battlefield. Creatures destroyed this way can't be regenerated."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final Collection<MagicPermanent> targets = game.filterPermanents(MagicTargetFilterFactory.CREATURE);
for (final MagicPermanent target : targets) {
game.doAction(MagicChangeStateAction.Set(target,MagicPermanentState.CannotBeRegenerated));
}
final MagicDestroyAction destroy = new MagicDestroyAction(targets);
game.doAction(destroy);
if (MagicCondition.THRESHOLD_CONDITION.accept(event.getSource())) {
game.doAction(new MagicPlayTokensAction(
event.getPlayer(),
TokenCardDefinitions.get("1/1 white Spirit creature token with flying"),
2
));
}
}
}
]
18 changes: 9 additions & 9 deletions release/Magarena/scripts/Kirtar_s_Wrath.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=Kirtar's Wrath
image=http://mtgimage.com/card/kirtar%27s%20wrath.jpg
value=2.500
rarity=R
type=Sorcery
cost={4}{W}{W}
timing=main
requires_groovy_code
oracle=Destroy all creatures. They can't be regenerated. Threshold — If seven or more cards are in your graveyard, instead destroy all creatures, then put two 1/1 white Spirit creature tokens with flying onto the battlefield. Creatures destroyed this way can't be regenerated.
name=Kirtar's Wrath
image=http://mtgimage.com/card/kirtar%27s%20wrath.jpg
value=2.500
rarity=R
type=Sorcery
cost={4}{W}{W}
timing=main
requires_groovy_code
oracle=Destroy all creatures. They can't be regenerated. Threshold — If seven or more cards are in your graveyard, instead destroy all creatures, then put two 1/1 white Spirit creature tokens with flying onto the battlefield. Creatures destroyed this way can't be regenerated.
42 changes: 21 additions & 21 deletions release/Magarena/scripts/Laquatus_s_Creativity.groovy
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_PLAYER,
this,
"Target player\$ draws cards equal to the number of cards in his or her hand, then discards that many cards."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPlayer(game, {
final int amount = it.getHandSize();
game.doAction(new MagicDrawAction(it,amount));
game.addEvent(new MagicDiscardEvent(event.getSource(), it, amount));
});
}
}
]
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.TARGET_PLAYER,
this,
"Target player\$ draws cards equal to the number of cards in his or her hand, then discards that many cards."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPlayer(game, {
final int amount = it.getHandSize();
game.doAction(new MagicDrawAction(it,amount));
game.addEvent(new MagicDiscardEvent(event.getSource(), it, amount));
});
}
}
]
18 changes: 9 additions & 9 deletions release/Magarena/scripts/Laquatus_s_Creativity.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=Laquatus's Creativity
image=http://mtgimage.com/card/laquatus%27s%20creativity.jpg
value=2.500
rarity=U
type=Sorcery
cost={4}{U}
timing=main
requires_groovy_code
oracle=Target player draws cards equal to the number of cards in his or her hand, then discards that many cards.
name=Laquatus's Creativity
image=http://mtgimage.com/card/laquatus%27s%20creativity.jpg
value=2.500
rarity=U
type=Sorcery
cost={4}{U}
timing=main
requires_groovy_code
oracle=Target player draws cards equal to the number of cards in his or her hand, then discards that many cards.
11 changes: 0 additions & 11 deletions release/Magarena/scripts_missing/Atogatog.txt

This file was deleted.

11 changes: 0 additions & 11 deletions release/Magarena/scripts_missing/Cabal_Inquisitor.txt

This file was deleted.

9 changes: 0 additions & 9 deletions release/Magarena/scripts_missing/Kirtar_s_Wrath.txt

This file was deleted.

9 changes: 0 additions & 9 deletions release/Magarena/scripts_missing/Laquatus_s_Creativity.txt

This file was deleted.

0 comments on commit 345a64a

Please sign in to comment.