diff --git a/res/cardsfolder/p/purity.txt b/res/cardsfolder/p/purity.txt index 67de8eafa6b..49484d99a91 100644 --- a/res/cardsfolder/p/purity.txt +++ b/res/cardsfolder/p/purity.txt @@ -1,9 +1,12 @@ Name:Purity ManaCost:3 W W W Types:Creature Elemental Incarnation -Text:If noncombat damage would be dealt to you, prevent that damage. You gain life equal to the damage prevented this way. +Text: PT:6/6 K:Flying +R:Event$ DamageDone | ValidTarget$ You | ReplaceWith$ GainLife | PreventionEffect$ True | IsCombat$ False | Description$ If noncombat damage would be dealt to you, prevent that damage. You gain life equal to the damage prevented this way. +SVar:GainLife:AB$GainLife | Cost$ 0 | Defined$ ReplacedTarget | LifeAmount$ X +SVar:X:ReplaceCount$DamageAmount T:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Creature.Self | Execute$ TrigShuffle | TriggerDescription$ When CARDNAME is put into a graveyard from anywhere, shuffle it into its owner's library. SVar:TrigShuffle:AB$ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Library | Shuffle$ True | Defined$ Self SVar:Rarity:Rare diff --git a/src/main/java/forge/Player.java b/src/main/java/forge/Player.java index 561064de787..6df9b37c2f1 100644 --- a/src/main/java/forge/Player.java +++ b/src/main/java/forge/Player.java @@ -618,10 +618,7 @@ public abstract class Player extends GameEntity { if (source.hasKeyword("Prevent all damage that would be dealt by CARDNAME.")) { return 0; } - if (AllZoneUtil.isCardInPlay("Purity", this) && !isCombat) { - return 0; - } - + // Prevent Damage static abilities final CardList allp = AllZoneUtil.getCardsIn(Zone.Battlefield); for (final Card ca : allp) { @@ -796,9 +793,15 @@ public abstract class Player extends GameEntity { int restDamage = damage; - // Purity has to stay here because it changes the game state - if (AllZoneUtil.isCardInPlay("Purity", this) && !isCombat) { - this.gainLife(restDamage, null); + final HashMap repParams = new HashMap(); + repParams.put("Event", "DamageDone"); + repParams.put("Affected", this); + repParams.put("DamageSource", source); + repParams.put("DamageAmount", damage); + repParams.put("IsCombat", isCombat); + repParams.put("Prevention", false); + + if (AllZone.getReplacementHandler().run(repParams)) { return 0; }