From 0b9b46a065b52a0f72ce025bc0a8545388a4f5ac Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 30 May 2019 18:06:07 -0400 Subject: [PATCH] v0.7.3b: fixed death by electricity not trigger normal death logic --- .../shatteredpixeldungeon/actors/blobs/Electricity.java | 8 ++++++++ .../messages/actors/actors.properties | 1 + 2 files changed, 9 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Electricity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Electricity.java index 890cc2292..463c5d285 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Electricity.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Electricity.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.blobs; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; @@ -32,7 +33,9 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; +import com.shatteredpixel.shatteredpixeldungeon.messages.Languages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -72,6 +75,11 @@ public class Electricity extends Blob { Buff.prolong( ch, Paralysis.class, 1f); if (cur[cell] % 2 == 1) { ch.damage(Math.round(Random.Float(2 + Dungeon.depth / 5f)), this); + if (!ch.isAlive() && ch == Dungeon.hero){ + Dungeon.fail( getClass() ); + //FIXME add other languages in next update + if (SPDSettings.language() == Languages.ENGLISH) GLog.n( Messages.get(this, "ondeath") ); + } } } diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties index e26255e58..dfa78c2e7 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties @@ -5,6 +5,7 @@ actors.blobs.confusiongas.desc=A cloud of confusion gas is swirling here. actors.blobs.electricity.desc=A field of electricity is sparking brightly here. actors.blobs.electricity.rankings_desc=Electrocuted +actors.blobs.electricity.ondeath=You were shocked to death... actors.blobs.fire.desc=A fire is raging here.