From b0205da8be5e1be1ef09eaa6d447f819e56645e8 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 10 Jun 2020 15:41:44 -0400 Subject: [PATCH] v0.8.1: checked cell vfx now appear ontop of terrain and fog of war --- .../shatteredpixeldungeon/actors/hero/Hero.java | 2 +- .../items/stones/StoneOfClairvoyance.java | 2 +- .../shatteredpixeldungeon/scenes/GameScene.java | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 90485edd2..8f885bbd2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -1719,7 +1719,7 @@ public class Hero extends Char { if (fieldOfView[p] && p != pos) { if (intentional) { - sprite.parent.addToBack(new CheckedCell(p, pos)); + GameScene.effectOverFog(new CheckedCell(p, pos)); } if (Dungeon.level.secret[p]){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java index b46265062..707ea27d2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java @@ -62,7 +62,7 @@ public class StoneOfClairvoyance extends Runestone { left = Math.max(0, left); for (curr = left + y * Dungeon.level.width(); curr <= right + y * Dungeon.level.width(); curr++){ - curUser.sprite.parent.addToBack( new CheckedCell( curr, cell ) ); + GameScene.effectOverFog( new CheckedCell( curr, cell ) ); Dungeon.level.mapped[curr] = true; if (Dungeon.level.secret[curr]) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index a75c1d572..698109a5a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -155,6 +155,7 @@ public class GameScene extends PixelScene { private Group spells; private Group statuses; private Group emoicons; + private Group overFogEffects; private Group healthIndicators; private Toolbar toolbar; @@ -243,6 +244,7 @@ public class GameScene extends PixelScene { effects = new Group(); healthIndicators = new Group(); emoicons = new Group(); + overFogEffects = new Group(); mobs = new Group(); add( mobs ); @@ -292,6 +294,8 @@ public class GameScene extends PixelScene { spells = new Group(); add( spells ); + + add(overFogEffects); statuses = new Group(); add( statuses ); @@ -809,6 +813,10 @@ public class GameScene extends PixelScene { public static void effect( Visual effect ) { scene.effects.add( effect ); } + + public static void effectOverFog( Visual effect ) { + scene.overFogEffects.add( effect ); + } public static Ripple ripple( int pos ) { if (scene != null) {