From 169e8fb73e42bbf85893b951af324dfc3edf74ad Mon Sep 17 00:00:00 2001 From: jendave Date: Sun, 7 Aug 2011 00:06:15 +0000 Subject: [PATCH] - Converted Urza's Armor and Guardian Seraph to stPreventDamage. --- res/cardsfolder/guardian_seraph.txt | 3 ++- res/cardsfolder/urzas_armor.txt | 3 ++- src/forge/Player.java | 41 +++-------------------------- 3 files changed, 7 insertions(+), 40 deletions(-) diff --git a/res/cardsfolder/guardian_seraph.txt b/res/cardsfolder/guardian_seraph.txt index 185fee0c068..9a2dee12bd1 100644 --- a/res/cardsfolder/guardian_seraph.txt +++ b/res/cardsfolder/guardian_seraph.txt @@ -1,9 +1,10 @@ Name:Guardian Seraph ManaCost:2 W W Types:Creature Angel -Text:If a source an opponent controls would deal damage to you, prevent 1 of that damage. +Text:no text PT:3/4 K:Flying +K:stPreventDamage:You:Card.YouDontCtrl:1:If a source an opponent controls would deal damage to you, prevent 1 of that damage. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/guardian_seraph.jpg SetInfo:M10|Rare|http://magiccards.info/scans/en/m10/13.jpg diff --git a/res/cardsfolder/urzas_armor.txt b/res/cardsfolder/urzas_armor.txt index ab77ec21400..8372c62c97f 100644 --- a/res/cardsfolder/urzas_armor.txt +++ b/res/cardsfolder/urzas_armor.txt @@ -1,7 +1,8 @@ Name:Urza's Armor ManaCost:6 Types:Artifact -Text:If a source would deal damage to you, prevent 1 of that damage. +Text:no text +K:stPreventDamage:You:Card:1:If a source would deal damage to you, prevent 1 of that damage. SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/urzas_armor.jpg SetInfo:USG|Uncommon|http://magiccards.info/scans/en/us/313.jpg diff --git a/src/forge/Player.java b/src/forge/Player.java index 987ba263468..615b585fdae 100644 --- a/src/forge/Player.java +++ b/src/forge/Player.java @@ -311,43 +311,6 @@ public abstract class Player extends MyObservable{ } //stPreventDamage //specific cards - //if (AllZoneUtil.isCardInPlay("Energy Storm") && source.isSpell()) return 0; - - //if (AllZoneUtil.isCardInPlay("Energy Field") && !source.getController().equals(this)) return 0; - - if (AllZoneUtil.isCardInPlay("Spirit of Resistance", this) && !source.getController().equals(this) - && restDamage > 0) restDamage = restDamage - 1; - - /*if (AllZoneUtil.isCardInPlay("Plated Pegasus") && source.isSpell() && restDamage > 0) restDamage = restDamage - 1; - - if (AllZoneUtil.isCardInPlay("Sphere of Purity", this) && source.isArtifact() && restDamage > 0) - restDamage = restDamage - 1; - - if (AllZoneUtil.isCardInPlay("Sphere of Duty", this) && source.isGreen()) { - if (restDamage > 1) restDamage = restDamage - 2; - else return 0; - } - if (AllZoneUtil.isCardInPlay("Sphere of Grace", this) && source.isBlack()) { - if (restDamage > 1) restDamage = restDamage - 2; - else return 0; - } - if (AllZoneUtil.isCardInPlay("Sphere of Law", this) && source.isRed()) { - if (restDamage > 1) restDamage = restDamage - 2; - else return 0; - } - if (AllZoneUtil.isCardInPlay("Sphere of Reason", this) && source.isBlue()) { - if (restDamage > 1) restDamage = restDamage - 2; - else return 0; - } - if (AllZoneUtil.isCardInPlay("Sphere of Truth", this) && source.isWhite()) { - if (restDamage > 1) restDamage = restDamage - 2; - else return 0; - }*/ - if (AllZoneUtil.isCardInPlay("Urza's Armor", this) && restDamage > 0) restDamage = restDamage - 1; - - if (AllZoneUtil.isCardInPlay("Guardian Seraph", this) && !source.getController().isPlayer(this) && restDamage > 0) - restDamage = restDamage - 1; - if(AllZoneUtil.isCardInPlay("Spirit of Resistance", this)) { if( AllZoneUtil.getPlayerColorInPlay(this, Constant.Color.Black).size() > 0 && AllZoneUtil.getPlayerColorInPlay(this, Constant.Color.Blue).size() > 0 @@ -357,7 +320,9 @@ public abstract class Player extends MyObservable{ return 0; } } - return restDamage; + if(restDamage>0) + return restDamage; + else return 0; } //This should be also usable by the AI to forecast an effect (so it must not change the game state)