diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index cc7c270b904..ddfe76f56af 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -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, "&" = 2, "@" = 2, "$" = 2, "?" = 2, "#" = 2, "!" = 2, "%" = 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("[src] 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("[src] 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 diff --git a/sound/attributions.txt b/sound/attributions.txt index 1b25e90dc40..55b34c5618f 100644 --- a/sound/attributions.txt +++ b/sound/attributions.txt @@ -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/ \ No newline at end of file +https://freesound.org/people/squareal/sounds/237375/ + +ding_short.ogg is from Natty23 (CC 4) +https://freesound.org/people/Natty23/sounds/411747/ diff --git a/sound/machines/ding_short.ogg b/sound/machines/ding_short.ogg new file mode 100644 index 00000000000..79032ee2a9a Binary files /dev/null and b/sound/machines/ding_short.ogg differ