Add sounds and flashing effects to slot machines (#77390)

## About The Pull Request
This adds some sounds and flashing effects to slot machines while they
are played.

I also added a new creative commons ding sound from:
https://freesound.org/people/Natty23/sounds/411747/

## Why It's Good For The Game
Slot machines should not be quiet.

## Changelog
🆑
qol: Add sounds and flashing effects to slot machines
sound: Add new ding sound to slot machines from
https://freesound.org/people/Natty23/sounds/411747/
/🆑
This commit is contained in:
Tim
2023-08-07 14:31:08 -04:00
committed by GitHub
parent dc0e5caca7
commit 0c4b4f7cdb
3 changed files with 22 additions and 6 deletions
+17 -4
View File
@@ -35,7 +35,7 @@
var/static/list/coinvalues
var/list/reels = list(list("", "", "") = 0, list("", "", "") = 0, list("", "", "") = 0, list("", "", "") = 0, list("", "", "") = 0)
var/list/symbols = list(SEVEN = 1, "<font color='orange'>&</font>" = 2, "<font color='yellow'>@</font>" = 2, "<font color='green'>$</font>" = 2, "<font color='blue'>?</font>" = 2, "<font color='grey'>#</font>" = 2, "<font color='white'>!</font>" = 2, "<font color='fuchsia'>%</font>" = 2) //if people are winning too much, multiply every number in this list by 2 and see if they are still winning too much.
var/static/list/ray_filter = list(type = "rays", y = 16, size = 40, density = 4, color = COLOR_RED_LIGHT, factor = 15, flags = FILTER_OVERLAY)
/obj/machinery/computer/slot_machine/Initialize(mapload)
. = ..()
@@ -251,6 +251,8 @@
/obj/machinery/computer/slot_machine/proc/toggle_reel_spin(value, delay = 0) //value is 1 or 0 aka on or off
for(var/list/reel in reels)
if(!value)
playsound(src, 'sound/machines/ding_short.ogg', 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
reels[reel] = value
sleep(delay)
@@ -264,6 +266,7 @@
/obj/machinery/computer/slot_machine/proc/give_prizes(usrname, mob/user)
var/linelength = get_lines()
var/did_player_win = TRUE
if(reels[1][2] + reels[2][2] + reels[3][2] + reels[4][2] + reels[5][2] == "[SEVEN][SEVEN][SEVEN][SEVEN][SEVEN]")
visible_message("<b>[src]</b> says, 'JACKPOT! You win [money] credits!'")
@@ -272,12 +275,14 @@
balance += money - give_payout(JACKPOT)
money = 0
if(paymode == HOLOCHIP)
new /obj/item/holochip(loc,JACKPOT)
new /obj/item/holochip(loc, JACKPOT)
else
for(var/i in 1 to 5)
cointype = pick(subtypesof(/obj/item/coin))
var/obj/item/coin/C = new cointype(loc)
random_step(C, 2, 50)
var/obj/item/coin/payout_coin = new cointype(loc)
random_step(payout_coin, 2, 50)
playsound(src, pick(list('sound/machines/coindrop.ogg', 'sound/machines/coindrop2.ogg')), 50, TRUE)
sleep(REEL_DEACTIVATE_DELAY)
else if(linelength == 5)
visible_message("<b>[src]</b> says, 'Big Winner! You win a thousand credits!'")
@@ -294,6 +299,13 @@
else
to_chat(user, span_warning("No luck!"))
did_player_win = FALSE
if(did_player_win)
add_filter("jackpot_rays", 3, ray_filter)
animate(get_filter("jackpot_rays"), offset = 10, time = 3 SECONDS, loop = -1)
addtimer(CALLBACK(src, TYPE_PROC_REF(/datum, remove_filter), "jackpot_rays"), 3 SECONDS)
playsound(src, 'sound/machines/roulettejackpot.ogg', 50, TRUE)
/obj/machinery/computer/slot_machine/proc/get_lines()
var/amountthesame
@@ -354,6 +366,7 @@
else
random_step(C, 2, 40)
playsound(src, pick(list('sound/machines/coindrop.ogg', 'sound/machines/coindrop2.ogg')), 50, TRUE)
return amount
#undef BIG_PRIZE
+5 -2
View File
@@ -65,7 +65,7 @@ https://freesound.org/people/uagadugu/sounds/222521/
earth_rumble_distant1, earth_rumble_distant2, earth_rumble_distant3, and earth_rumble_distant4 are adapted from metrostock99's "EARTHQUAKE OR DISTANT SPACE SHUTTLE RUMBLE.WAV" (CC 0)
https://freesound.org/people/metrostock99/sounds/203281/
metal_creak.ogg is adapted from BloodPixelHero's "Metal door creak" under CC Attribution 4.0
metal_creak.ogg is adapted from BloodPixelHero's "Metal door creak" under CC Attribution 4.0
https://freesound.org/people/BloodPixelHero/sounds/585323/
revolutionary_tide.ogg is adapted from several audio samples:
@@ -83,4 +83,7 @@ zip_up.ogg and un_zip.ogg adapted from aboxinghelena's Zip.wav (CC 4)
https://freesound.org/people/aboxinghelena/sounds/401139/
car_crash.ogg is adapted from squareal's "Car Crash" (CC 0)
https://freesound.org/people/squareal/sounds/237375/
https://freesound.org/people/squareal/sounds/237375/
ding_short.ogg is from Natty23 (CC 4)
https://freesound.org/people/Natty23/sounds/411747/
Binary file not shown.