v0.7.3b: fixed death by electricity not trigger normal death logic

This commit is contained in:
Evan Debenham 2019-05-30 18:06:07 -04:00
parent 49b85e5775
commit 0b9b46a065
2 changed files with 9 additions and 0 deletions

View File

@ -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") );
}
}
}

View File

@ -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.