From f8b11e814d860eeae0159bb0d04b7bb795e12551 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 20 Oct 2021 15:43:45 -0400 Subject: [PATCH] v1.1.0: fixed chilled ghouls would get extra turns after reviving --- .../shatteredpixel/shatteredpixeldungeon/actors/Actor.java | 4 ++++ .../shatteredpixeldungeon/actors/mobs/Ghoul.java | 4 ++-- .../shatteredpixeldungeon/actors/mobs/Tengu.java | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java index d4e77ab5e..c1d206c73 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java @@ -86,6 +86,10 @@ public abstract class Actor implements Bundlable { public void clearTime() { time = 0; } + + public void timeToNow() { + time = now; + } protected void diactivate() { time = Float.MAX_VALUE; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java index c71360698..19eafdc5f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Ghoul.java @@ -266,7 +266,7 @@ public class Ghoul extends Mob { } ghoul.HP = Math.round(ghoul.HT/10f); Actor.add(ghoul); - ghoul.spend(-ghoul.cooldown()); + ghoul.timeToNow(); Dungeon.level.mobs.add(ghoul); Dungeon.level.occupyCell( ghoul ); ghoul.sprite.idle(); @@ -297,7 +297,7 @@ public class Ghoul extends Mob { Ghoul newHost = searchForHost(ghoul); if (newHost != null){ attachTo(newHost); - spend(-cooldown()); + timeToNow(); } else { ghoul.die(this); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java index a681946d0..fb8957d12 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java @@ -101,7 +101,7 @@ public class Tengu extends Mob { protected void onAdd() { //when he's removed and re-added to the fight, his time is always set to now. if (cooldown() > TICK) { - spend(-cooldown()); + timeToNow(); spendToWhole(); } super.onAdd();