From 49b73a75750a79e9114706264f28e871f74d6918 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 17 Oct 2022 12:17:52 -0400 Subject: [PATCH] v1.4.2: plants now trigger like traps from time freeze --- .../shatteredpixeldungeon/levels/Level.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 61e45f879..28ba04179 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -1109,36 +1109,27 @@ public abstract class Level implements Bundlable { break; } + TimekeepersHourglass.timeFreeze timeFreeze = + Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class); + + Swiftthistle.TimeBubble bubble = + Dungeon.hero.buff(Swiftthistle.TimeBubble.class); + if (trap != null) { - - TimekeepersHourglass.timeFreeze timeFreeze = - Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class); - - Swiftthistle.TimeBubble bubble = - Dungeon.hero.buff(Swiftthistle.TimeBubble.class); - if (bubble != null){ - Sample.INSTANCE.play(Assets.Sounds.TRAP); - discover(cell); - bubble.setDelayedPress(cell); } else if (timeFreeze != null){ - Sample.INSTANCE.play(Assets.Sounds.TRAP); - discover(cell); - timeFreeze.setDelayedPress(cell); } else { - if (Dungeon.hero.pos == cell) { Dungeon.hero.interrupt(); } - trap.trigger(); } @@ -1146,7 +1137,18 @@ public abstract class Level implements Bundlable { Plant plant = plants.get( cell ); if (plant != null) { - plant.trigger(); + if (bubble != null){ + Sample.INSTANCE.play(Assets.Sounds.TRAMPLE, 1, Random.Float( 0.96f, 1.05f ) ); + bubble.setDelayedPress(cell); + + } else if (timeFreeze != null){ + Sample.INSTANCE.play(Assets.Sounds.TRAMPLE, 1, Random.Float( 0.96f, 1.05f ) ); + timeFreeze.setDelayedPress(cell); + + } else { + plant.trigger(); + + } } if (hard && Blob.volumeAt(cell, Web.class) > 0){