From 75b8459cf01a238e3d53621b918c503cfc662305 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 30 Oct 2019 18:46:27 -0400 Subject: [PATCH] v0.8.0: Various bugfixes for: - Goo's health bar not appearing in some cases - Viscocity not considering sources of extra damage reduction - Bolts from wand of warding not pressing tiles if they fail to summon --- .../shatteredpixeldungeon/actors/mobs/Goo.java | 3 +++ .../shatteredpixeldungeon/items/armor/glyphs/Viscosity.java | 2 +- .../shatteredpixeldungeon/items/wands/WandOfWarding.java | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java index fbac47588..18446245b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java @@ -211,6 +211,9 @@ public class Goo extends Mob { @Override public void damage(int dmg, Object src) { + if (!BossHealthBar.isAssigned()){ + BossHealthBar.assignBoss( this ); + } boolean bleeding = (HP*2 <= HT); super.damage(dmg, src); if ((HP*2 <= HT) && !bleeding){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java index 7ef150e70..b84d6cac3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java @@ -45,7 +45,7 @@ public class Viscosity extends Glyph { //FIXME this glyph should really just proc after DR is accounted for. //should build in functionality for that, but this works for now - int realDamage = damage - Random.NormalIntRange( armor.DRMin(), armor.DRMax()); + int realDamage = damage - defender.drRoll(); if (realDamage <= 0) { return 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java index 2973ed281..c0c2641df 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java @@ -78,6 +78,7 @@ public class WandOfWarding extends Wand { Char ch = Actor.findChar(bolt.collisionPos); if (!curUser.fieldOfView[bolt.collisionPos] || !Dungeon.level.passable[bolt.collisionPos]){ GLog.w( Messages.get(this, "bad_location")); + Dungeon.level.pressCell(bolt.collisionPos); } else if (ch != null){ if (ch instanceof Ward){ @@ -89,7 +90,9 @@ public class WandOfWarding extends Wand { ch.sprite.emitter().burst(MagicMissile.WardParticle.UP, ((Ward) ch).tier); } else { GLog.w( Messages.get(this, "bad_location")); + Dungeon.level.pressCell(bolt.collisionPos); } + } else if (canPlaceWard(bolt.collisionPos)){ Ward ward = new Ward(); ward.pos = bolt.collisionPos; @@ -97,8 +100,10 @@ public class WandOfWarding extends Wand { GameScene.add(ward, 1f); Dungeon.level.occupyCell(ward); ward.sprite.emitter().burst(MagicMissile.WardParticle.UP, ward.tier); + } else { GLog.w( Messages.get(this, "bad_location")); + Dungeon.level.pressCell(bolt.collisionPos); } }