- Allow Count$Compare to calculateAmount of SVars

- Convert Apocalypse Hydra to script
This commit is contained in:
Sol
2013-04-21 01:59:11 +00:00
parent acfd320657
commit 2dfb0b58de
3 changed files with 5 additions and 26 deletions

View File

@@ -1,11 +1,13 @@
Name:Apocalypse Hydra Name:Apocalypse Hydra
ManaCost:X G R ManaCost:X G R
Types:Creature Hydra Types:Creature Hydra
Text:Apocalypse Hydra enters the battlefield with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it.
PT:0/0 PT:0/0
K:etbCounter:P1P1:Y:no condition:CARDNAME enters the battlefield with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it.
A:AB$ DealDamage | Cost$ 1 R SubCounter<1/P1P1> | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player. A:AB$ DealDamage | Cost$ 1 R SubCounter<1/P1P1> | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player.
# This xPaid doesn't do anything, it's just needed to make Cost work properly # This xPaid doesn't do anything, it's just needed to make Cost work properly
SVar:X:Count$xPaid SVar:X:Count$xPaid
SVar:Y:Count$Compare X LT5.X.Z
SVar:Z:Count$xPaid/Twice
SVar:Picture:http://www.wizards.com/global/images/magic/general/apocalypse_hydra.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/apocalypse_hydra.jpg
Oracle:Apocalypse Hydra enters the battlefield with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it.\n{1}{R}, Remove a +1/+1 counter from Apocalypse Hydra: Apocalypse Hydra deals 1 damage to target creature or player. Oracle:Apocalypse Hydra enters the battlefield with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it.\n{1}{R}, Remove a +1/+1 counter from Apocalypse Hydra: Apocalypse Hydra deals 1 damage to target creature or player.
SetInfo:CFX Mythic SetInfo:CFX Mythic

View File

@@ -1228,9 +1228,9 @@ public class AbilityUtils {
final int lhs = calculateAmount(c, compString[1], sa); final int lhs = calculateAmount(c, compString[1], sa);
final int rhs = calculateAmount(c, compString[2].substring(2), sa); final int rhs = calculateAmount(c, compString[2].substring(2), sa);
if (Expressions.compare(lhs, compString[2], rhs)) { if (Expressions.compare(lhs, compString[2], rhs)) {
return CardFactoryUtil.doXMath(Integer.parseInt(sq[1]), expr, c); return CardFactoryUtil.doXMath(calculateAmount(c, sq[1], sa), expr, c);
} else { } else {
return CardFactoryUtil.doXMath(Integer.parseInt(sq[2]), expr, c); return CardFactoryUtil.doXMath(calculateAmount(c, sq[2], sa), expr, c);
} }
} }
} }

View File

@@ -299,27 +299,6 @@ public class CardFactoryCreatures {
card.addSpellAbility(ability); card.addSpellAbility(ability);
} }
private static void getCard_ApocalypseHydra(final Card card) {
final SpellAbility spell = new SpellPermanent(card) {
private static final long serialVersionUID = -11489323313L;
@Override
public void resolve() {
int xCounters = card.getXManaCostPaid();
final Card c = Singletons.getModel().getGame().getAction().moveToPlay(this.getSourceCard());
if (xCounters >= 5) {
xCounters = 2 * xCounters;
}
c.addCounter(CounterType.P1P1, xCounters, true);
}
};
// Do not remove SpellAbilities created by AbilityFactory or
// Keywords.
card.clearFirstSpell();
card.addSpellAbility(spell);
}
private static void getCard_KinsbaileBorderguard(final Card card) { private static void getCard_KinsbaileBorderguard(final Card card) {
final SpellAbility ability = new Ability(card, ManaCost.ZERO) { final SpellAbility ability = new Ability(card, ManaCost.ZERO) {
@Override @Override
@@ -530,8 +509,6 @@ public class CardFactoryCreatures {
getCard_SphinxJwar(card); getCard_SphinxJwar(card);
} else if (cardName.equals("Master of the Wild Hunt")) { } else if (cardName.equals("Master of the Wild Hunt")) {
getCard_MasterOfTheWildHunt(card); getCard_MasterOfTheWildHunt(card);
} else if (cardName.equals("Apocalypse Hydra")) {
getCard_ApocalypseHydra(card);
} else if (cardName.equals("Kinsbaile Borderguard")) { } else if (cardName.equals("Kinsbaile Borderguard")) {
getCard_KinsbaileBorderguard(card); getCard_KinsbaileBorderguard(card);
} else if (cardName.equals("Sutured Ghoul")) { } else if (cardName.equals("Sutured Ghoul")) {