From a8e3f2d3a85aa9302a0b9a5f737b96c96c50cc7f Mon Sep 17 00:00:00 2001 From: Sloth Date: Sat, 15 Dec 2012 14:05:07 +0000 Subject: [PATCH] - Added the keyword "If CARDNAME would be destroyed, regenerate it.". - Added Clergy of the Holy Nimbus. --- .gitattributes | 1 + res/cardsfolder/c/clergy_of_the_holy_nimbus.txt | 12 ++++++++++++ res/gamedata/NonStackingKWList.txt | 1 + src/main/java/forge/GameAction.java | 4 ++-- .../forge/card/abilityfactory/ai/PumpAiBase.java | 9 +++++++-- .../card/spellability/SpellAbilityRestriction.java | 4 ++++ 6 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 res/cardsfolder/c/clergy_of_the_holy_nimbus.txt diff --git a/.gitattributes b/.gitattributes index 17a9c145573..5df56ceb01a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1726,6 +1726,7 @@ res/cardsfolder/c/clear_the_land.txt -text res/cardsfolder/c/clearwater_goblet.txt svneol=native#text/plain res/cardsfolder/c/cleaver_riot.txt -text res/cardsfolder/c/clergy_en_vec.txt svneol=native#text/plain +res/cardsfolder/c/clergy_of_the_holy_nimbus.txt -text res/cardsfolder/c/clickslither.txt svneol=native#text/plain res/cardsfolder/c/cliff_threader.txt svneol=native#text/plain res/cardsfolder/c/cliffrunner_behemoth.txt svneol=native#text/plain diff --git a/res/cardsfolder/c/clergy_of_the_holy_nimbus.txt b/res/cardsfolder/c/clergy_of_the_holy_nimbus.txt new file mode 100644 index 00000000000..2b9258c904b --- /dev/null +++ b/res/cardsfolder/c/clergy_of_the_holy_nimbus.txt @@ -0,0 +1,12 @@ +Name:Clergy of the Holy Nimbus +ManaCost:W +Types:Creature Human Cleric +Text:no text +PT:1/1 +K:If CARDNAME would be destroyed, regenerate it. +A:AB$ Pump | Cost$ 2 | AnyOpponent$ True | Defined$ Self | KW$ HIDDEN CARDNAME can't be regenerated. | IsCurse$ True | SpellDescription$ CARDNAME can't be regenerated this turn. Only any opponent may activate this ability. +SVar:Rarity:Common +SVar:Picture:http://www.wizards.com/global/images/magic/general/clergy_of_the_holy_nimbus.jpg +SetInfo:LEG|Common|http://magiccards.info/scans/en/lg/175.jpg +Oracle:If Clergy of the Holy Nimbus would be destroyed, regenerate it.\n{1}: Clergy of the Holy Nimbus can't be regenerated this turn. Only any opponent may activate this ability. +End \ No newline at end of file diff --git a/res/gamedata/NonStackingKWList.txt b/res/gamedata/NonStackingKWList.txt index a80c8091843..c31129d35b4 100644 --- a/res/gamedata/NonStackingKWList.txt +++ b/res/gamedata/NonStackingKWList.txt @@ -1,5 +1,6 @@ All creatures able to block CARDNAME do so. CARDNAME attacks each turn if able. +CARDNAME can't be regenerated. CARDNAME doesn't untap during your untap step. Changeling Convoke diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index 38c773b3ada..f04e328ee21 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -46,7 +46,6 @@ import forge.card.spellability.AbilityStatic; import forge.card.spellability.Spell; import forge.card.spellability.SpellAbility; import forge.card.spellability.SpellAbilityRequirements; -import forge.card.spellability.SpellAbilityStackInstance; import forge.card.spellability.Target; import forge.card.spellability.TargetSelection; import forge.card.staticability.StaticAbility; @@ -1528,7 +1527,8 @@ public class GameAction { return false; } - if (c.canBeShielded() && (c.getShield() > 0)) { + if (c.canBeShielded() + && (c.getShield() > 0 || c.hasKeyword("If CARDNAME would be destroyed, regenerate it."))) { c.subtractShield(); c.setDamage(0); c.tap(); diff --git a/src/main/java/forge/card/abilityfactory/ai/PumpAiBase.java b/src/main/java/forge/card/abilityfactory/ai/PumpAiBase.java index 0913c0e262f..165ea57f4f2 100644 --- a/src/main/java/forge/card/abilityfactory/ai/PumpAiBase.java +++ b/src/main/java/forge/card/abilityfactory/ai/PumpAiBase.java @@ -130,9 +130,14 @@ public abstract class PumpAiBase extends SpellAiLogic { return false; } } else if (keyword.endsWith("CARDNAME can't be regenerated.")) { - if (card.getShield() <= 0) { - return false; + if (card.getShield() > 0) { + return true; } + if (card.hasKeyword("If CARDNAME would be destroyed, regenerate it.") + && (card.isBlocked() || card.isBlocking())) { + return true; + } + return false; } else if (keyword.endsWith("CARDNAME's activated abilities can't be activated.")) { return false; //too complex } diff --git a/src/main/java/forge/card/spellability/SpellAbilityRestriction.java b/src/main/java/forge/card/spellability/SpellAbilityRestriction.java index d7e82e620e5..9b6ae703796 100644 --- a/src/main/java/forge/card/spellability/SpellAbilityRestriction.java +++ b/src/main/java/forge/card/spellability/SpellAbilityRestriction.java @@ -118,6 +118,10 @@ public class SpellAbilityRestriction extends SpellAbilityVariables { this.setAnyPlayer(true); } + if (params.containsKey("AnyOpponent")) { + this.setOpponentOnly(true); + } + if (params.containsKey("ActivationLimit")) { this.setLimitToCheck(params.get("ActivationLimit")); }