From f8aebee09bc9ed1ca8f89401d2de565df91ee5f0 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 25 Aug 2020 13:57:52 -0400 Subject: [PATCH] v0.8.2c: tweaked terror logic, should now better enforce fleeing --- .../shatteredpixeldungeon/actors/mobs/Mob.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index c9ff6f091..ae8e8db7e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -180,6 +180,10 @@ public abstract class Mob extends Char { spend( TICK ); return true; } + + if (buff(Terror.class) != null){ + state = FLEEING; + } enemy = chooseEnemy(); @@ -332,8 +336,12 @@ public abstract class Mob extends Char { public void remove( Buff buff ) { super.remove( buff ); if (buff instanceof Terror) { - sprite.showStatus( CharSprite.NEGATIVE, Messages.get(this, "rage") ); - state = HUNTING; + if (enemySeen) { + sprite.showStatus(CharSprite.NEGATIVE, Messages.get(this, "rage")); + state = HUNTING; + } else { + state = WANDERING; + } } } @@ -729,7 +737,7 @@ public abstract class Mob extends Char { notice(); - if (state != HUNTING) { + if (state != HUNTING && state != FLEEING) { state = WANDERING; } target = cell;