From 50566234c77e5bb9e1e162e987594d91dde000e7 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 12 Sep 2017 00:07:55 -0400 Subject: [PATCH] v0.6.2: Hourglass charge use is now frontloaded to match new cloak --- .../shatteredpixeldungeon/actors/hero/Hero.java | 7 +++++-- .../items/artifacts/TimekeepersHourglass.java | 12 ++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 8f67db27e..b6e19ace5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -452,8 +452,11 @@ public class Hero extends Char { @Override public void spend( float time ) { TimekeepersHourglass.timeFreeze buff = buff(TimekeepersHourglass.timeFreeze.class); - if (!(buff != null && buff.processTime(time))) - super.spend( time ); + if (buff != null){ + buff.processTime(time); + } else { + super.spend(time); + } } public void spendAndNext( float time ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java index 2800aa61f..a6f07063e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java @@ -105,6 +105,7 @@ public class TimekeepersHourglass extends Artifact { activeBuff = new timeFreeze(); activeBuff.attachTo(Dungeon.hero); + ((timeFreeze)activeBuff).processTime(0f); } }; } @@ -269,11 +270,11 @@ public class TimekeepersHourglass extends Artifact { public class timeFreeze extends ArtifactBuff { - float partialTime = 0f; + float partialTime = 1f; ArrayList presses = new ArrayList(); - public boolean processTime(float time){ + public void processTime(float time){ partialTime += time; while (partialTime >= 1f){ @@ -283,11 +284,10 @@ public class TimekeepersHourglass extends Artifact { updateQuickslot(); - if (charge <= 0){ + if (charge < 0){ + charge = 0; detach(); - return false; - } else - return true; + } }