From 9b84674042ecf513149845862637a8f39c7bb06c Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 23 Aug 2022 13:17:06 -0400 Subject: [PATCH] v1.4.0: fixed friendly fire badge unlocking from chaos elementals --- .../shatteredpixeldungeon/items/wands/CursedWand.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java index f6edb8536..1d6d4ae47 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java @@ -66,6 +66,7 @@ import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; import com.shatteredpixel.shatteredpixeldungeon.plants.Swiftthistle; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene; +import com.shatteredpixel.shatteredpixeldungeon.ui.BadgesList; import com.shatteredpixel.shatteredpixeldungeon.ui.Icons; import com.shatteredpixel.shatteredpixeldungeon.ui.TargetHealthIndicator; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -223,12 +224,12 @@ public class CursedWand { if (toDamage == Dungeon.hero){ Sample.INSTANCE.play(Assets.Sounds.CURSED); if (!toDamage.isAlive()) { - if (origin != null) { + if (user == Dungeon.hero && origin != null) { Badges.validateDeathFromFriendlyMagic(); Dungeon.fail( origin.getClass() ); GLog.n( Messages.get( CursedWand.class, "ondeath", origin.name() ) ); } else { - Badges.validateDeathFromFriendlyMagic(); + Badges.validateDeathFromEnemyMagic(); Dungeon.fail( toHeal.getClass() ); } }