From 3c57614a743c7efb9d163fc8cb29f02049bf9e0f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 15 Sep 2024 15:07:09 -0400 Subject: [PATCH] v2.5.1: fixed ratmog rats not adding entries to the bestiary --- .../actors/hero/abilities/Ratmogrify.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/Ratmogrify.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/Ratmogrify.java index 9d544656e..76a5f22c7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/Ratmogrify.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/Ratmogrify.java @@ -40,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.MasterThievesArmband; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; +import com.shatteredpixel.shatteredpixeldungeon.journal.Bestiary; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.RatSprite; @@ -266,6 +267,8 @@ public class Ratmogrify extends ArmorAbility { allied = true; alignment = Alignment.ALLY; timeLeft = Float.POSITIVE_INFINITY; + Bestiary.setSeen(original.getClass()); + Bestiary.countEncounter(original.getClass()); } public int attackSkill(Char target) { @@ -296,6 +299,15 @@ public class Ratmogrify extends ArmorAbility { original.rollToDropLoot(); } + @Override + public void destroy() { + super.destroy(); + if (alignment == Alignment.ENEMY) { + Bestiary.setSeen(original.getClass()); + Bestiary.countEncounter(original.getClass()); + } + } + @Override public String name() { return Messages.get(this, "name", original.name());