From 64df321aa121911517a8882a2e4f90a9fc7e3435 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 16 Dec 2015 22:31:43 -0500 Subject: [PATCH] v0.3.3: fixed bugs with rot heard and lashers --- .../actors/mobs/RotHeart.java | 10 +++++----- .../actors/mobs/RotLasher.java | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotHeart.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotHeart.java index acbda89a8..d6b93ca62 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotHeart.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotHeart.java @@ -24,7 +24,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; -import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.RotHeartSprite; @@ -49,13 +49,13 @@ public class RotHeart extends Mob { } @Override - protected boolean act() { - if (Dungeon.level.map[pos] != Terrain.GRASS && Dungeon.level.map[pos] != Terrain.HIGH_GRASS){ + public void damage(int dmg, Object src) { + //TODO: when effect properties are done, change this to FIRE + if (src instanceof Burning) { destroy(); sprite.die(); - return true; } else { - return super.act(); + super.damage(dmg, src); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotLasher.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotLasher.java index 5199e5621..cee485fed 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotLasher.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotLasher.java @@ -20,14 +20,13 @@ */ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; -import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; -import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.sprites.RotLasherSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.watabou.utils.Random; @@ -55,15 +54,19 @@ public class RotLasher extends Mob { @Override protected boolean act() { - if (Dungeon.level.map[pos] != Terrain.GRASS && Dungeon.level.map[pos] != Terrain.HIGH_GRASS){ + if (enemy == null || !Level.adjacent(pos, enemy.pos)) { + HP = Math.min(HT, HP + 3); + } + return super.act(); + } + + @Override + public void damage(int dmg, Object src) { + if (src instanceof Burning) { destroy(); sprite.die(); - return true; } else { - if (enemy == null || !Level.adjacent(pos, enemy.pos)) { - HP = Math.min(HT, HP + 3); - } - return super.act(); + super.damage(dmg, src); } }