From e90adb920926704d08f39ffa65739b55d31dc22a Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 23:26:48 +0000 Subject: [PATCH] add Phyrexian Ingester (from New Phyrexia) --- .gitattributes | 1 + res/cardsfolder/phyrexian_ingester.txt | 14 ++++++++++++++ src/forge/GameActionUtil.java | 24 +++++++++++++++++++++--- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 res/cardsfolder/phyrexian_ingester.txt diff --git a/.gitattributes b/.gitattributes index 9c16e2cd394..79c01b117b4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5091,6 +5091,7 @@ res/cardsfolder/phyrexian_gargantua.txt -text svneol=native#text/plain res/cardsfolder/phyrexian_ghoul.txt -text svneol=native#text/plain res/cardsfolder/phyrexian_hulk.txt -text svneol=native#text/plain res/cardsfolder/phyrexian_hydra.txt -text svneol=native#text/plain +res/cardsfolder/phyrexian_ingester.txt -text svneol=native#text/plain res/cardsfolder/phyrexian_ironfoot.txt -text svneol=native#text/plain res/cardsfolder/phyrexian_juggernaut.txt -text svneol=native#text/plain res/cardsfolder/phyrexian_lens.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/phyrexian_ingester.txt b/res/cardsfolder/phyrexian_ingester.txt new file mode 100644 index 00000000000..f59b3430fa3 --- /dev/null +++ b/res/cardsfolder/phyrexian_ingester.txt @@ -0,0 +1,14 @@ +Name:Phyrexian Ingester +ManaCost:6 U +Types:Creature Beast +Text:no text +PT:3/3 +T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | OptionalDecider$ You | Execute$ TrigExile | TriggerDescription$ Imprint - When CARDNAME enters the battlefield, you may exile target nontoken creature. +SVar:TrigExile:AB$ChangeZone | Cost$ 0 | Imprint$ True | ValidTgts$ Creature.nonToken | TgtPrompt$ Select target nontoken creature | Origin$ Battlefield | Destination$ Exile +K:stPumpSelf:Creature:X/Y:Imprint:CARDNAME gets +X/+Y, where X is the exiled creature card's power and Y is its toughness. +SVar:X:Imprinted$CardPower +SVar:Y:Imprinted$CardToughness +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_ingester.jpg +End \ No newline at end of file diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index e5de0bb2f73..abb7242b6f0 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -5756,17 +5756,32 @@ public class GameActionUtil { String[] pt = k[2].split("/"); + Card cardWithXValue; + String xString = cardWithKeyword.getSVar("X").split("$")[0]; + Card cardWithYValue; + String yString = cardWithKeyword.getSVar("Y").split("$")[0]; + + if(xString.startsWith("Imprinted") && !cardWithKeyword.getImprinted().isEmpty()) { + cardWithXValue = cardWithKeyword.getImprinted().get(0); + } + else cardWithXValue = cardWithKeyword; + + if(yString.startsWith("Imprinted") && !cardWithKeyword.getImprinted().isEmpty()) { + cardWithYValue = cardWithKeyword.getImprinted().get(0); + } + else cardWithYValue = cardWithKeyword; + int x = 0; if (pt[0].contains("X") || pt[1].contains("X")) - x = CardFactoryUtil.xCount(cardWithKeyword, cardWithKeyword.getSVar("X").split("\\$")[1]); + x = CardFactoryUtil.xCount(cardWithXValue, cardWithKeyword.getSVar("X").split("\\$")[1]); se.setXValue(x); int y = 0; if (pt[1].contains("Y")) - y = CardFactoryUtil.xCount(cardWithKeyword, cardWithKeyword.getSVar("Y").split("\\$")[1]); + y = CardFactoryUtil.xCount(cardWithYValue, cardWithKeyword.getSVar("Y").split("\\$")[1]); se.setYValue(y); - addStaticEffects(cardWithKeyword,affectedCards,k[2],x, y); //give the boni to the affected cards + addStaticEffects(cardWithKeyword, affectedCards, k[2], x, y); //give the boni to the affected cards storage.add(se); // store the information } @@ -5925,6 +5940,9 @@ public class GameActionUtil { if(SpecialConditions.contains("Threshold")) { if (!SourceCard.getController().hasThreshold()) return false; } + if(SpecialConditions.contains("Imprint")) { + if(SourceCard.getImprinted().isEmpty()) return false; + } if(SpecialConditions.contains("Hellbent")) { CardList Handcards = new CardList(); Handcards.addAll(AllZone.getZone(Constant.Zone.Hand, SourceCard.getController()).getCards());