From 6d2aa45a245560a8ac3470a85c114f6f0fb2aa39 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 21 Aug 2024 11:23:45 -0400 Subject: [PATCH] v2.5.0: added on-kill messages to dart traps --- core/src/main/assets/messages/levels/levels.properties | 2 ++ .../shatteredpixeldungeon/levels/traps/PoisonDartTrap.java | 3 +++ .../shatteredpixeldungeon/levels/traps/WornDartTrap.java | 3 +++ 3 files changed, 8 insertions(+) diff --git a/core/src/main/assets/messages/levels/levels.properties b/core/src/main/assets/messages/levels/levels.properties index 479c09130..624cc18c2 100644 --- a/core/src/main/assets/messages/levels/levels.properties +++ b/core/src/main/assets/messages/levels/levels.properties @@ -111,6 +111,7 @@ levels.traps.pitfalltrap.no_pit=the ground is too solid for a pitfall trap to wo levels.traps.pitfalltrap.desc=This trap is connected to a large trapdoor mechanism, and shortly after it is triggered anything near it will slip right through the ground and fall! It won't work in areas with especially solid floors though. levels.traps.poisondarttrap.name=poison dart trap +levels.traps.poisondarttrap.ondeath=You were killed by the poison dart trap... levels.traps.poisondarttrap.desc=A small dart-blower must be hidden nearby, activating this trap will cause it to shoot a poisoned dart at the nearest target.\n\nThankfully the trigger mechanism isn't hidden. levels.traps.rockfalltrap.name=rockfall trap @@ -146,6 +147,7 @@ levels.traps.weakeningtrap.name=weakening trap levels.traps.weakeningtrap.desc=Dark magic in this trap sucks the energy out of anything that comes into contact with it. Powerful enemies may resist the effect, however. levels.traps.worndarttrap.name=worn dart trap +levels.traps.worndarttrap.ondeath=You were killed by the worn dart trap... levels.traps.worndarttrap.desc=A small dart-blower must be hidden nearby, activating this trap will cause it to shoot at the nearest target.\n\nDue to its age it's not very harmful though, it isn't even hidden... diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PoisonDartTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PoisonDartTrap.java index 6c028ebfb..2668c79fa 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PoisonDartTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PoisonDartTrap.java @@ -31,7 +31,9 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.PoisonDart; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.MissileSprite; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Callback; import com.watabou.utils.Random; @@ -109,6 +111,7 @@ public class PoisonDartTrap extends Trap { } if (!finalTarget.isAlive()) { Dungeon.fail(PoisonDartTrap.this); + GLog.n(Messages.get(PoisonDartTrap.class, "ondeath")); } } Buff.affect( finalTarget, Poison.class ).set( poisonAmount() ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/WornDartTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/WornDartTrap.java index 62448a637..fee132c85 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/WornDartTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/WornDartTrap.java @@ -28,7 +28,9 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.MissileSprite; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Callback; import com.watabou.utils.Random; @@ -88,6 +90,7 @@ public class WornDartTrap extends Trap { finalTarget.damage(dmg, WornDartTrap.this); if (finalTarget == Dungeon.hero && !finalTarget.isAlive()){ Dungeon.fail( WornDartTrap.this ); + GLog.n(Messages.get(WornDartTrap.class, "ondeath")); } Sample.INSTANCE.play(Assets.Sounds.HIT, 1, 1, Random.Float(0.8f, 1.25f)); finalTarget.sprite.bloodBurstA(finalTarget.sprite.center(), dmg);