From a2c17c1338ad0ab75c8f72c0082f77a95ed0327a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 12 Jan 2015 22:27:21 -0500 Subject: [PATCH] v0.2.3d: tweaks to stealth deactivation, also fixes some bugs with hourglass --- .../shatteredpixeldungeon/actors/buffs/Invisibility.java | 6 +++--- .../shatteredpixeldungeon/items/armor/ClassArmor.java | 2 ++ .../shatteredpixeldungeon/items/armor/WarriorArmor.java | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Invisibility.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Invisibility.java index dd5ae4683..13c5c9cb4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Invisibility.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Invisibility.java @@ -56,17 +56,17 @@ public class Invisibility extends FlavourBuff { public static void dispel() { Invisibility buff = Dungeon.hero.buff( Invisibility.class ); - if (buff != null && Dungeon.hero.visibleEnemies() > 0) { + if (buff != null) { buff.detach(); } CloakOfShadows.cloakStealth cloakBuff = Dungeon.hero.buff( CloakOfShadows.cloakStealth.class ); - if (cloakBuff != null && Dungeon.hero.visibleEnemies() > 0) { + if (cloakBuff != null) { cloakBuff.act(); cloakBuff.detach(); } //this isn't a form of invisibilty, but it is meant to dispel at the same time as it. TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff( TimekeepersHourglass.timeFreeze.class ); - if (timeFreeze != null && Dungeon.hero.visibleEnemies() > 0) { + if (timeFreeze != null) { timeFreeze.detach(); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java index 60500e0cd..b1d881416 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/ClassArmor.java @@ -17,6 +17,7 @@ */ package com.shatteredpixel.shatteredpixeldungeon.items.armor; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.utils.Bundle; @@ -103,6 +104,7 @@ abstract public class ClassArmor extends Armor { GLog.w( TXT_NOT_EQUIPPED ); } else { curUser = hero; + Invisibility.dispel(); doSpecial(); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java index 53ad17f04..c9893e4d3 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/WarriorArmor.java @@ -24,7 +24,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Fury; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; @@ -95,7 +94,7 @@ public class WarriorArmor extends ClassArmor { Buff.affect( curUser, Fury.class ); } - Invisibility.dispel(); + final int dest = cell; curUser.busy();