From 4e1da695a25fe51ca1c7dd0a7bb2f6e98dba1a03 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 29 Sep 2025 10:51:28 -0400 Subject: [PATCH] v3.2.5: properly fixed bee AI re-aggression debuff --- .../actors/mobs/Bee.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Bee.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Bee.java index a173228f2..053ae7f76 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Bee.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Bee.java @@ -152,7 +152,24 @@ public class Bee extends Mob { return (Char) Actor.findById(potHolder); //if the pot is on the ground - }else { + } else { + + //copypasta from regular mob logic for aggression with added limit for pot distance + if ((alignment == Alignment.ENEMY || buff(Amok.class) != null ) && state != PASSIVE && state != SLEEPING) { + if (enemy != null + && enemy.buff(StoneOfAggression.Aggression.class) != null + && Dungeon.level.distance(enemy.pos, potPos) <= 3){ + state = HUNTING; + return enemy; + } + for (Char ch : Actor.chars()) { + if (ch != this && fieldOfView[ch.pos] && Dungeon.level.distance(ch.pos, potPos) <= 3 + && ch.buff(StoneOfAggression.Aggression.class) != null) { + state = HUNTING; + return ch; + } + } + } //try to find a new enemy in these circumstances if (enemy == null || !enemy.isAlive() || !Actor.chars().contains(enemy) || state == WANDERING @@ -168,9 +185,7 @@ public class Bee extends Mob { && mob.alignment != Alignment.NEUTRAL && !mob.isInvulnerable(getClass()) && !(alignment == Alignment.ALLY && mob.alignment == Alignment.ALLY)) { - //prefers char affected by aggression - if (closest == null || mob.buff(StoneOfAggression.Aggression.class) != null - || Dungeon.level.distance(closest.pos, pos) > Dungeon.level.distance(mob.pos, pos)){ + if (closest == null || Dungeon.level.distance(closest.pos, pos) > Dungeon.level.distance(mob.pos, pos)){ closest = mob; } }