v2.5.0: added on-kill messages to dart traps

This commit is contained in:
Evan Debenham
2024-08-21 11:23:45 -04:00
parent 93801f0872
commit 6d2aa45a24
3 changed files with 8 additions and 0 deletions

View File

@@ -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...

View File

@@ -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() );

View File

@@ -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);