From 9224f1539a7c8ec8b5760b03c50a8f3773b500dd Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 29 Aug 2014 19:32:30 -0400 Subject: [PATCH] V0.2.0: fixed two bugs with buff logic. --- .../shatteredpixeldungeon/actors/buffs/Drowsy.java | 3 +-- .../shatteredpixeldungeon/actors/buffs/Regeneration.java | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Drowsy.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Drowsy.java index c6a76570e..377da5548 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Drowsy.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Drowsy.java @@ -39,14 +39,13 @@ public class Drowsy extends Buff { if (target instanceof Hero) if (target.HP == target.HT) { GLog.i("You are too healthy, and resist the urge to sleep."); - detach(); } else { GLog.i("You fall into a deep magical sleep."); Buff.affect(target, MagicalSleep.class); - detach(); } else Buff.affect(target, MagicalSleep.class); + detach(); return true; } else { placed = true; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java index bcde74270..71dda68c6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java @@ -34,8 +34,10 @@ public class Regeneration extends Buff { } ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero.buff( ChaliceOfBlood.chaliceRegen.class); - - spend( REGENERATION_DELAY - regenBuff.level() ); + if (regenBuff != null) + spend( REGENERATION_DELAY - regenBuff.level() ); + else + spend( REGENERATION_DELAY ); } else {