From 70af94f30b34f11e5ba9d207ceadefce2dadf7c0 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 21 Mar 2023 13:26:10 -0400 Subject: [PATCH] v2.0.1: noisemaker now can't be defused or collected once triggered --- .../items/bombs/Noisemaker.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Noisemaker.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Noisemaker.java index 2e928cdb8..2b7c1f942 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Noisemaker.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Noisemaker.java @@ -25,11 +25,13 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; @@ -43,6 +45,7 @@ public class Noisemaker extends Bomb { public void setTrigger(int cell){ Buff.affect(Dungeon.hero, Trigger.class).set(cell); + fuse = null; CellEmitter.center( cell ).start( Speck.factory( Speck.SCREAM ), 0.3f, 3 ); Sample.INSTANCE.play( Assets.Sounds.ALERT ); @@ -52,7 +55,23 @@ public class Noisemaker extends Bomb { } } - + + @Override + public ItemSprite.Glowing glowing() { + if (Dungeon.hero.buff(Trigger.class) != null){ + return new ItemSprite.Glowing( 0xFF0000, 0.6f); + } + return super.glowing(); + } + + @Override + public boolean doPickUp(Hero hero, int pos) { + if (fuse == null && hero.buff(Trigger.class) != null){ + return false; + } + return super.doPickUp(hero, pos); + } + public static class Trigger extends Buff { { @@ -89,7 +108,7 @@ public class Noisemaker extends Bomb { } } - if (bomb == null || bomb.fuse == null) { + if (bomb == null) { detach(); } else if (Actor.findChar(cell) != null) {