From 39dea55d00fab5b930c12b364deb16d5c90ca43a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 6 Nov 2020 16:27:42 -0500 Subject: [PATCH] v0.9.1: fixed various corruption issues, including: - Mimics not dropping their loot if instantly corrupted - Corrupted mobs being constantly alerted - Attempting to corrupt immune mobs leading to a tracked kill --- .../actors/mobs/Mob.java | 2 +- .../items/wands/WandOfCorruption.java | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 14 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 1f1199b44..c52da9548 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 @@ -627,7 +627,7 @@ public abstract class Mob extends Char { if (state == SLEEPING) { state = WANDERING; } - if (state != HUNTING) { + if (state != HUNTING && !(src instanceof Corruption)) { alerted = true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java index 25869d2d7..31a733bf9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java @@ -231,20 +231,21 @@ public class WandOfCorruption extends Wand { buff.detach(); } } - if (enemy.alignment == Char.Alignment.ENEMY){ - enemy.rollToDropLoot(); - } - + + boolean droppingLoot = enemy.alignment != Char.Alignment.ALLY; Buff.affect(enemy, Corruption.class); - - Statistics.enemiesSlain++; - Badges.validateMonstersSlain(); - Statistics.qualifiedForNoKilling = false; - if (enemy.EXP > 0 && curUser.lvl <= enemy.maxLvl) { - curUser.sprite.showStatus(CharSprite.POSITIVE, Messages.get(enemy, "exp", enemy.EXP)); - curUser.earnExp(enemy.EXP, enemy.getClass()); - } else { - curUser.earnExp(0, enemy.getClass()); + + if (enemy.buff(Corruption.class) != null){ + if (droppingLoot) enemy.rollToDropLoot(); + Statistics.enemiesSlain++; + Badges.validateMonstersSlain(); + Statistics.qualifiedForNoKilling = false; + if (enemy.EXP > 0 && curUser.lvl <= enemy.maxLvl) { + curUser.sprite.showStatus(CharSprite.POSITIVE, Messages.get(enemy, "exp", enemy.EXP)); + curUser.earnExp(enemy.EXP, enemy.getClass()); + } else { + curUser.earnExp(0, enemy.getClass()); + } } } else { Buff.affect(enemy, Doom.class);