From a71488f6f510c8efabc22249576d71e0393e9615 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 24 Oct 2017 19:55:56 -0400 Subject: [PATCH] v0.6.2: fixed bugs relating to corruption and awarding exp/kills --- .../shatteredpixeldungeon/actors/mobs/Mob.java | 12 ++++++------ .../items/wands/WandOfCorruption.java | 7 ++++++- 2 files changed, 12 insertions(+), 7 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 37c24aca4..e9574cd41 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 @@ -549,12 +549,12 @@ public abstract class Mob extends Char { Statistics.enemiesSlain++; Badges.validateMonstersSlain(); Statistics.qualifiedForNoKilling = false; - } - - int exp = Dungeon.hero.lvl <= maxLvl ? EXP : 0; - if (exp > 0) { - Dungeon.hero.sprite.showStatus( CharSprite.POSITIVE, Messages.get(this, "exp", exp) ); - Dungeon.hero.earnExp( exp ); + + int exp = Dungeon.hero.lvl <= maxLvl ? EXP : 0; + if (exp > 0) { + Dungeon.hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "exp", exp)); + Dungeon.hero.earnExp(exp); + } } } } 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 9bae64ad0..d5f0838ce 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 @@ -22,7 +22,9 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; @@ -209,10 +211,13 @@ public class WandOfCorruption extends Wand { buff.detach(); } 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.EXP = 0; } //TODO perhaps enemies should also drop loot here } else {