diff --git a/data/sounds/balloon/pop.ogg b/data/sounds/balloon/pop.ogg new file mode 100644 index 00000000000..28f42a0d1db Binary files /dev/null and b/data/sounds/balloon/pop.ogg differ diff --git a/data/sounds/lossless_sources/balloon/pop.flac b/data/sounds/lossless_sources/balloon/pop.flac new file mode 100644 index 00000000000..28c7d9995af Binary files /dev/null and b/data/sounds/lossless_sources/balloon/pop.flac differ diff --git a/doc/contributors.md b/doc/contributors.md index 97a478d7439..fa90234577c 100644 --- a/doc/contributors.md +++ b/doc/contributors.md @@ -996,6 +996,7 @@ The following people released their work to the public with a suitable license f * [Hawkeye_Sprout](https://freesound.org/people/Hawkeye_Sprout/) * [YuriNikolai](https://opengameart.org/users/yurinikolai) * [Inchadney](http://inchadney.com/sounds.html) +* [Gniffelbaf](https://freesound.org/people/Gniffelbaf/) diff --git a/doc/contributors/contributors.json b/doc/contributors/contributors.json index 97cf2fdfcab..67199180cac 100644 --- a/doc/contributors/contributors.json +++ b/doc/contributors/contributors.json @@ -4763,6 +4763,10 @@ "name": "Inchadney", "link": "http://inchadney.com/sounds.html", "link_alt": "https://freesound.org/people/inchadney/" + }, + { + "name": "Gniffelbaf", + "link": "https://freesound.org/people/Gniffelbaf/" } ] } diff --git a/doc/sources/audio-sfx.txt b/doc/sources/audio-sfx.txt index 2de8338abd4..429a3c22345 100644 --- a/doc/sources/audio-sfx.txt +++ b/doc/sources/audio-sfx.txt @@ -1,6 +1,7 @@ data/sounds/ +balloon/pop Gniffelbaf; CC0; https://opengameart.org/node/132360, https://freesound.org/s/82119/ 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/ diff --git a/src/games/stendhal/server/entity/item/scroll/BalloonScroll.java b/src/games/stendhal/server/entity/item/scroll/BalloonScroll.java index 1dee8b023e0..b4a92e650cd 100644 --- a/src/games/stendhal/server/entity/item/scroll/BalloonScroll.java +++ b/src/games/stendhal/server/entity/item/scroll/BalloonScroll.java @@ -15,8 +15,10 @@ import java.util.Map; import games.stendhal.common.NotificationType; +import games.stendhal.common.constants.SoundLayer; import games.stendhal.server.core.events.DelayedPlayerTextSender; import games.stendhal.server.entity.player.Player; +import games.stendhal.server.events.SoundEvent; import games.stendhal.server.maps.kikareukin.islands.Gatekeeper; import games.stendhal.server.maps.kikareukin.islands.Gatekeeper.RequestState; import games.stendhal.server.util.TimeUtil; @@ -79,9 +81,7 @@ protected boolean useTeleportScroll(final Player player) { final RequestState requestState = Gatekeeper.requestEntrance(player); if (RequestState.DENIED.equals(requestState)) { - // balloon is used if player was punished - removeOne(); - player.sendPrivateText(NotificationType.NEGATIVE, "Your balloon popped."); + onPopped(player); return false; } else if (RequestState.PUNISH_QUEUED.equals(requestState)) { // player tried to use balloon again immediately after being denied @@ -108,4 +108,17 @@ protected boolean useTeleportScroll(final Player player) { return super.useTeleportScroll(player); } + + /** + * Events when a balloon "pops". + * + * @param player + * Player using balloon. + */ + private void onPopped(final Player player) { + player.addEvent(new SoundEvent("balloon/pop", SoundLayer.FIGHTING_NOISE)); + // balloon is used + removeOne(); + player.sendPrivateText(NotificationType.NEGATIVE, "Your balloon popped."); + } }