From f4e50600412eb3f8cfd7e1eec0b83f7f07c361e5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 14 Sep 2014 04:36:05 -0400 Subject: [PATCH] V0.2.0: Corrected some misc. item buff detach logic --- .../shatteredpixeldungeon/items/artifacts/Artifact.java | 2 +- .../shatteredpixeldungeon/items/artifacts/CapeOfThorns.java | 1 + .../shatteredpixeldungeon/items/rings/Ring.java | 4 ++-- .../shatteredpixeldungeon/items/rings/RingOfMight.java | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 9c12e8bb5..8cf28b875 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -105,7 +105,7 @@ public class Artifact extends KindofMisc { hero.belongings.misc2 = null; } - hero.remove(passiveBuff); + passiveBuff.detach(); passiveBuff = null; hero.spendAndNext( TIME_TO_EQUIP ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java index 88fb82ca8..ee2b18714 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java @@ -118,6 +118,7 @@ public class CapeOfThorns extends Artifact { public void detach(){ timer = 0; charge = 0; + super.detach(); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java index 8c69ac44f..b40bf5675 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java @@ -160,8 +160,8 @@ public class Ring extends KindofMisc { hero.belongings.misc2 = null; } - hero.remove( buff ); - buff = null; + buff.detach(); + buff = null; hero.spendAndNext( TIME_TO_EQUIP ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java index 3f5198c9f..ea4a455cb 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java @@ -49,6 +49,7 @@ public class RingOfMight extends Ring { if (level > 0){ target.HT -= level*5; } + super.detach(); } } }