From 6c18bc613cf1ffc187dbec8f1a9aeb4fc5268d08 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 24 Sep 2019 23:54:02 -0400 Subject: [PATCH] v0.7.5: detached shocking sfx from lightning vfx --- .../shatteredpixeldungeon/effects/Lightning.java | 4 ---- .../shatteredpixeldungeon/items/bombs/ShockBomb.java | 3 +++ .../shatteredpixeldungeon/items/stones/StoneOfShock.java | 2 ++ .../shatteredpixeldungeon/items/wands/WandOfLightning.java | 3 +++ .../items/weapon/enchantments/Shocking.java | 3 +++ .../items/weapon/missiles/darts/ShockingDart.java | 3 +++ 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Lightning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Lightning.java index dba8dff32..c1365d978 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Lightning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/effects/Lightning.java @@ -21,13 +21,11 @@ package com.shatteredpixel.shatteredpixeldungeon.effects; -import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.watabou.glwrap.Blending; import com.watabou.noosa.Game; import com.watabou.noosa.Group; import com.watabou.noosa.Image; -import com.watabou.noosa.audio.Sample; import com.watabou.utils.Callback; import com.watabou.utils.PointF; import com.watabou.utils.Random; @@ -72,8 +70,6 @@ public class Lightning extends Group { this.callback = callback; life = DURATION; - - Sample.INSTANCE.play( Assets.SND_LIGHTNING ); } private static final double A = 180 / Math.PI; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShockBomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShockBomb.java index f36dee96e..567a0be20 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShockBomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShockBomb.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.bombs; +import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; @@ -33,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; +import com.watabou.noosa.audio.Sample; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -78,6 +80,7 @@ public class ShockBomb extends Bomb { CellEmitter.center(cell).burst(SparkParticle.FACTORY, 20); Dungeon.hero.sprite.parent.addToFront(new Lightning(arcs, null)); + Sample.INSTANCE.play( Assets.SND_LIGHTNING ); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfShock.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfShock.java index 519261eac..046302b6b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfShock.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfShock.java @@ -69,6 +69,8 @@ public class StoneOfShock extends Runestone { if (hits > 0) { curUser.sprite.parent.addToFront( new Lightning( arcs, null ) ); curUser.sprite.centerEmitter().burst(EnergyParticle.FACTORY, 10); + Sample.INSTANCE.play( Assets.SND_LIGHTNING ); + curUser.belongings.charge(1f + hits); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java index e5e2421c3..0379a52e2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands; +import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; @@ -36,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.Camera; +import com.watabou.noosa.audio.Sample; import com.watabou.utils.Callback; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -136,6 +138,7 @@ public class WandOfLightning extends DamageWand { //don't want to wait for the effect before processing damage. curUser.sprite.parent.addToFront( new Lightning( arcs, null ) ); + Sample.INSTANCE.play( Assets.SND_LIGHTNING ); callback.call(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java index 6b0bd5d08..664bda754 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments; +import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; @@ -29,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; +import com.watabou.noosa.audio.Sample; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -58,6 +60,7 @@ public class Shocking extends Weapon.Enchantment { } attacker.sprite.parent.addToFront( new Lightning( arcs, null ) ); + Sample.INSTANCE.play( Assets.SND_LIGHTNING ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java index d79a16231..efa1b8a98 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java @@ -21,10 +21,12 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts; +import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.watabou.noosa.audio.Sample; import com.watabou.utils.PointF; import com.watabou.utils.Random; @@ -47,6 +49,7 @@ public class ShockingDart extends TippedDart { arcs.add(new Lightning.Arc(new PointF(s.x, s.y + s.height / 2), new PointF(s.x + s.width, s.y + s.height / 2))); arcs.add(new Lightning.Arc(new PointF(s.x + s.width / 2, s.y), new PointF(s.x + s.width / 2, s.y + s.height))); s.parent.add(new Lightning(arcs, null)); + Sample.INSTANCE.play( Assets.SND_LIGHTNING ); } return super.proc(attacker, defender, damage);