From 25277573fbd037496c6c01ba484d2f1eb3fe293e Mon Sep 17 00:00:00 2001 From: moomarc Date: Wed, 28 Mar 2012 10:23:02 +0000 Subject: [PATCH] Added Pulse of the Dross Added Pulse of the Forge CardFactoryUtil can now count life total and cards in hand of targeted players --- .gitattributes | 2 ++ res/cardsfolder/p/pulse_of_the_dross.txt | 13 +++++++ res/cardsfolder/p/pulse_of_the_forge.txt | 12 +++++++ .../card/cardfactory/CardFactoryUtil.java | 34 ++++++++++++++++++- 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 res/cardsfolder/p/pulse_of_the_dross.txt create mode 100644 res/cardsfolder/p/pulse_of_the_forge.txt diff --git a/.gitattributes b/.gitattributes index 5224074e546..d1f0346628b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6813,7 +6813,9 @@ res/cardsfolder/p/pull_from_eternity.txt -text res/cardsfolder/p/pull_under.txt svneol=native#text/plain res/cardsfolder/p/pulling_teeth.txt svneol=native#text/plain res/cardsfolder/p/pulsating_illusion.txt svneol=native#text/plain +res/cardsfolder/p/pulse_of_the_dross.txt -text res/cardsfolder/p/pulse_of_the_fields.txt svneol=native#text/plain +res/cardsfolder/p/pulse_of_the_forge.txt -text res/cardsfolder/p/pulse_of_the_grid.txt -text res/cardsfolder/p/pulse_of_the_tangle.txt svneol=native#text/plain res/cardsfolder/p/pulse_tracker.txt svneol=native#text/plain diff --git a/res/cardsfolder/p/pulse_of_the_dross.txt b/res/cardsfolder/p/pulse_of_the_dross.txt new file mode 100644 index 00000000000..f0901355212 --- /dev/null +++ b/res/cardsfolder/p/pulse_of_the_dross.txt @@ -0,0 +1,13 @@ +Name:Pulse of the Dross +ManaCost:1 B B +Types:Sorcery +Text:no text +A:SP$ Discard | Cost$ 1 B B | ValidTgts$ Player | TgtPrompt$ Select target player | Mode$ RevealYouChoose | RevealNumber$ 3 | NumCards$ 1 | SubAbility$ ReturnDross | SpellDescription$ Target player reveals three cards from his or her hand and you choose one of them. That player discards that card. Then if that player has more cards in hand than you, return CARDNAME to its owner's hand. +SVar:ReturnDross:DB$ ChangeZone | ConditionCheckSVar$ X | ConditionSVarCompare$ GTY | Defined$ Self | Origin$ Stack | Destination$ Hand +SVar:X:Count$InTargetedHand +SVar:Y:Count$InYourHand +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/pulse_of_the_dross.jpg +SetInfo:DST|Rare|http://magiccards.info/scans/en/ds/50.jpg +Oracle:Target player reveals three cards from his or her hand and you choose one of them. That player discards that card. Then if that player has more cards in hand than you, return Pulse of the Dross to its owner's hand. +End \ No newline at end of file diff --git a/res/cardsfolder/p/pulse_of_the_forge.txt b/res/cardsfolder/p/pulse_of_the_forge.txt new file mode 100644 index 00000000000..c9c5c6d3700 --- /dev/null +++ b/res/cardsfolder/p/pulse_of_the_forge.txt @@ -0,0 +1,12 @@ +Name:Pulse of the Forge +ManaCost:1 R R +Types:Instant +Text:no text +A:SP$ DealDamage | Cost$ 1 R R | ValidTgts$ Player | TgtPrompt$ Select target player | NumDmg$ 4 | SubAbility$ ReheatTheForge | SpellDescription$ CARDNAME deals 4 damage to target player. Then if that player has more life than you, return CARDNAME to its owner's hand. +SVar:ReheatTheForge:DB$ ChangeZone | ConditionLifeTotal$ You | ConditionLifeAmount$ LTX | Defined$ Self | Origin$ Stack | Destination$ Hand | ConditionDescription$ If an opponent has more life than you, +SVar:X:Count$TargetedLifeTotal +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/pulse_of_the_forge.jpg +SetInfo:DST|Rare|http://magiccards.info/scans/en/ds/66.jpg +Oracle:Pulse of the Forge deals 4 damage to target player. Then if that player has more life than you, return Pulse of the Forge to its owner's hand. +End \ No newline at end of file diff --git a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java index c67b380dd9c..18b49ff0c90 100644 --- a/src/main/java/forge/card/cardfactory/CardFactoryUtil.java +++ b/src/main/java/forge/card/cardfactory/CardFactoryUtil.java @@ -2894,6 +2894,22 @@ public class CardFactoryUtil { return CardFactoryUtil.doXMath(oppController.getLife(), m, c); } + // Count$TargetedLifeTotal (targeted player's life total) + if (sq[0].contains("TargetedLifeTotal")) { + for (final SpellAbility sa : c.getCharacteristics().getSpellAbility()) { + final SpellAbility parent = AbilityFactory.findParentsTargetedPlayer(sa); + if (parent != null) { + if (parent.getTarget() != null) { + for (final Object tgtP : parent.getTarget().getTargetPlayers()) { + if (tgtP instanceof Player) { + return CardFactoryUtil.doXMath(((Player) tgtP).getLife(), m, c); + } + } + } + } + } + } + if (sq[0].contains("LifeYouLostThisTurn")) { return CardFactoryUtil.doXMath(cardController.getLifeLostThisTurn(), m, c); } @@ -3255,6 +3271,22 @@ public class CardFactoryUtil { } } + // Count$InTargetedHand (targeted player's cards in hand) + if (sq[0].contains("InTargetedHand")) { + for (final SpellAbility sa : c.getCharacteristics().getSpellAbility()) { + final SpellAbility parent = AbilityFactory.findParentsTargetedPlayer(sa); + if (parent != null) { + if (parent.getTarget() != null) { + for (final Object tgtP : parent.getTarget().getTargetPlayers()) { + if (tgtP instanceof Player) { + someCards.addAll(((Player) tgtP).getCardsIn(Zone.Hand)); + } + } + } + } + } + } + // filter lists based on the specified quality // "Clerics you control" - Count$TypeYouCtrl.Cleric @@ -4098,7 +4130,7 @@ public class CardFactoryUtil { * Copies stats like power, toughness, etc. *

* - * @param o + * @param sim * a {@link java.lang.Object} object. * @return a {@link forge.Card} object. */