From cd282c9148195dd726428cbffe1fe3824b2a7ee6 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 16 May 2019 16:24:36 -0400 Subject: [PATCH] v0.7.3: more bug fixes: - fixed force cubes now correctly handling hero death - fixed being able to stack many windows in the changes scene --- .../shatteredpixel/shatteredpixeldungeon/actors/Char.java | 4 ++++ .../items/weapon/missiles/ForceCube.java | 6 ++++++ .../shatteredpixeldungeon/scenes/ChangesScene.java | 6 ++++-- .../shatteredpixeldungeon/messages/items/items.properties | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index 1024abe5b..956ce49b8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -240,6 +240,10 @@ public abstract class Char extends Actor { if (!enemy.isAlive() && visibleFight) { if (enemy == Dungeon.hero) { + + if (this == Dungeon.hero) { + return true; + } Dungeon.fail( getClass() ); GLog.n( Messages.capitalize(Messages.get(Char.class, "kill", name)) ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/ForceCube.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/ForceCube.java index c992497b6..a42916187 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/ForceCube.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/ForceCube.java @@ -26,7 +26,9 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; import com.watabou.utils.PathFinder; @@ -57,6 +59,10 @@ public class ForceCube extends MissileWeapon { for (Char target : targets){ curUser.shoot(target, this); + if (target == Dungeon.hero && !target.isAlive()){ + Dungeon.fail(getClass()); + GLog.n(Messages.get(this, "ondeath")); + } } rangedHit( null, cell ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java index 6b38ddec2..1bffd69d7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java @@ -2460,12 +2460,14 @@ public class ChangesScene extends PixelScene { public ChangesWindow( Image icon, String title, String message ) { super( icon, title, message); - add( new TouchArea( chrome ) { + TouchArea blocker = new TouchArea( 0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height ) { @Override protected void onClick( Touchscreen.Touch touch ) { hide(); } - } ); + }; + blocker.camera = uiCamera; + add(blocker); } diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index ec11a778f..0ff49f7dd 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -1407,6 +1407,7 @@ items.weapon.missiles.fishingspear.name=fishing spear items.weapon.missiles.fishingspear.desc=Tiny throwing spears designed for fishing. They work well as an improvised weapon too. items.weapon.missiles.forcecube.name=force cube +items.weapon.missiles.forcecube.ondeath=You killed yourself with your own Force Cube... items.weapon.missiles.forcecube.desc=This oddly-shaped weapon is small enough to hold in your hand, but is incredibly heavy. When thrown, it will spread the force of its impact over a small area, damaging everything in the blast. items.weapon.missiles.heavyboomerang.name=heavy boomerang