From a6d744c6a79fd455f82edb9c34778c2ffdb6581e Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 6 Oct 2018 00:13:15 -0400 Subject: [PATCH] v0.7.0: bugfixes: - fixed preparation not being cleared with invisibility in some cases - fixed the ghost hero rarely attacking nonexistant enemies - fixed elixir of vitality - fixed wand of blast wave registering a dungeon fail when it isn't what killed the hero - fixed bones rarely appearing inside of bookcases on floor 20 --- .../actors/buffs/Invisibility.java | 5 +++++ .../items/artifacts/DriedRose.java | 3 ++- .../items/potions/elixirs/ElixirOfVitality.java | 1 + .../items/wands/WandOfBlastWave.java | 10 +++++----- .../shatteredpixeldungeon/levels/CityBossLevel.java | 5 +++-- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Invisibility.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Invisibility.java index 537983cf4..08e458c1a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Invisibility.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Invisibility.java @@ -104,6 +104,11 @@ public class Invisibility extends FlavourBuff { timeFreeze.detach(); } + Preparation prep = Dungeon.hero.buff( Preparation.class ); + if (prep != null){ + prep.detach(); + } + Swiftthistle.TimeBubble bubble = Dungeon.hero.buff( Swiftthistle.TimeBubble.class ); if (bubble != null){ bubble.detach(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index 0e795ed1c..5452a227f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -474,7 +474,8 @@ public class DriedRose extends Artifact { Char enemy = super.chooseEnemy(); //will never attack something far from the player - if (enemy != null && Dungeon.level.distance(enemy.pos, Dungeon.hero.pos) <= 8){ + if (enemy != null && Dungeon.level.mobs.contains(enemy) + && Dungeon.level.distance(enemy.pos, Dungeon.hero.pos) <= 8){ return enemy; } else { return null; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfVitality.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfVitality.java index 745065c66..5f01c5f54 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfVitality.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfVitality.java @@ -38,6 +38,7 @@ public class ElixirOfVitality extends Elixir { @Override public void apply(Hero hero) { Buff.affect( hero, Healing.class ).setHeal((int)(0.8f*hero.HT + 14), 0.25f, 0); + PotionOfHealing.cure(hero); Buff.affect(hero, Barrier.class).set((int)(0.6f*hero.HT + 10)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java index d56a7d2b9..13109753a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java @@ -84,6 +84,9 @@ public class WandOfBlastWave extends DamageWand { Ballistica trajectory = new Ballistica(ch.pos, ch.pos + i, Ballistica.MAGIC_BOLT); int strength = 1 + Math.round(level() / 2f); throwChar(ch, trajectory, strength); + } else if (ch == Dungeon.hero){ + Dungeon.fail( getClass() ); + GLog.n( Messages.get( this, "ondeath") ); } } } @@ -100,11 +103,7 @@ public class WandOfBlastWave extends DamageWand { throwChar(ch, trajectory, strength); } } - - if (!curUser.isAlive()) { - Dungeon.fail( getClass() ); - GLog.n( Messages.get( this, "ondeath") ); - } + } public static void throwChar(final Char ch, final Ballistica trajectory, int power){ @@ -140,6 +139,7 @@ public class WandOfBlastWave extends DamageWand { } Dungeon.level.press(ch.pos, ch, true); if (ch == Dungeon.hero){ + //FIXME currently no logic here if the throw effect kills the hero Dungeon.observe(); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java index 8339dd0ce..ce904a34e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.King; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; +import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; @@ -165,13 +166,13 @@ public class CityBossLevel extends Level { @Override protected void createItems() { - Item item = Bones.get(); + Item item = new Gold(10); if (item != null) { int pos; do { pos = Random.IntRange( LEFT + 1, LEFT + HALL_WIDTH - 2 ) + - Random.IntRange( TOP + HALL_HEIGHT + 1, TOP + HALL_HEIGHT + CHAMBER_HEIGHT ) * width(); + Random.IntRange( TOP + HALL_HEIGHT + 2, TOP + HALL_HEIGHT + CHAMBER_HEIGHT ) * width(); } while (pos == entrance); drop( item, pos ).type = Heap.Type.REMAINS; }