Skip to content

Commit

Permalink
Play sound when using balloon
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed Jun 22, 2024
1 parent d46506f commit 2b2c340
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 3 deletions.
Binary file added data/sounds/balloon/inflate.ogg
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions doc/contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,7 @@ The following people released their work to the public with a suitable license f
* [Inchadney](http://inchadney.com/sounds.html)
* [Bart Kelsey](https://opengameart.org/users/bart)
* [David Kvistorf (fluffclipse)](https://soundcloud.com/david-kvistorf)
* [Dan Nicholls (d.n.audio.uk)](https://audiary.co.uk/)
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
6 changes: 6 additions & 0 deletions doc/contributors/contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -4773,6 +4773,12 @@
"fullname": "David Kvistorf",
"link": "https://soundcloud.com/david-kvistorf",
"link_alt": "https://opengameart.org/users/fluffclipse"
},
{
"name": "d.n.audio.uk",
"fullname": "Dan Nicholls",
"link": "https://audiary.co.uk/",
"link_alt": "https://freesound.org/people/d.n.audio.uk/"
}
]
}
1 change: 1 addition & 0 deletions doc/sources/audio-sfx.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

data/sounds/

balloon/inflate Dan Nicholls (d.n.audio.uk); CC0; https://opengameart.org/node/132360, https://freesound.org/s/263809/
alligator-1.ogg U.S. Fish and Wildlife Service; public domain; https://fws.gov/video/sound.htm
arrow-hit-1.ogg Storyteller; GPL
attack-fire-1.* Nic3_one; CC0; https://freesound.org/people/Nic3_one/sounds/166555/
Expand Down
12 changes: 11 additions & 1 deletion src/games/stendhal/server/entity/item/scroll/BalloonScroll.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2024 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand All @@ -14,8 +14,11 @@

import java.util.Map;

import games.stendhal.common.constants.SoundLayer;
import games.stendhal.server.core.engine.StendhalRPZone;
import games.stendhal.server.core.events.DelayedPlayerTextSender;
import games.stendhal.server.entity.player.Player;
import games.stendhal.server.events.SoundEvent;
import games.stendhal.server.util.TimeUtil;

/**
Expand Down Expand Up @@ -93,4 +96,11 @@ protected boolean useTeleportScroll(final Player player) {

return super.useTeleportScroll(player);
}

@Override
protected boolean teleportPlayer(final Player player, final int targetX, final int targetY,
final StendhalRPZone targetZone) {
return player.teleportWithSound(targetZone, targetX, targetY,
new SoundEvent("balloon/inflate", SoundLayer.FIGHTING_NOISE), player);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* $Id$
*/
/***************************************************************************
* (C) Copyright 2003-2023 - Stendhal *
* (C) Copyright 2003-2024 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand Down Expand Up @@ -233,7 +233,7 @@ protected boolean useTeleportScroll(final Player player, final String targetZone
* @param targetZone the zone to teleport to.
* @return true if successful
*/
private boolean teleportPlayer(final Player player, final int targetX,
protected boolean teleportPlayer(final Player player, final int targetX,
final int targetY, final StendhalRPZone targetZone) {

return player.teleport(targetZone, targetX, targetY, null, player);
Expand Down

0 comments on commit 2b2c340

Please sign in to comment.