From 36262149d8ddb5077de86795cb643df4bfd0c03d Mon Sep 17 00:00:00 2001 From: Darkmight9 <45213755+Darkmight9@users.noreply.github.com> Date: Tue, 24 Nov 2020 09:48:29 -0500 Subject: [PATCH] Greatly reduces Slot machine money abuse (#14953) * Greatly reduces Slot machine money abuse * fixes conflict * Hopefully fixes tgui issue --- code/game/machinery/slotmachine.dm | 54 ++++++++------------ tgui/packages/tgui/interfaces/SlotMachine.js | 2 +- tgui/packages/tgui/public/tgui.bundle.js | 2 +- 3 files changed, 23 insertions(+), 35 deletions(-) diff --git a/code/game/machinery/slotmachine.dm b/code/game/machinery/slotmachine.dm index 1624ef4bb92..f27f93440a6 100644 --- a/code/game/machinery/slotmachine.dm +++ b/code/game/machinery/slotmachine.dm @@ -47,9 +47,9 @@ if(action == "spin") if(working) return - if(!account || account.money < 10) + if(!account || account.money < 50) return - if(!account.charge(10, null, "Bet", "Slot Machine", "Slot Machine")) + if(!account.charge(50, null, "Bet", "Slot Machine", "Slot Machine")) return plays++ working = TRUE @@ -58,45 +58,33 @@ addtimer(CALLBACK(src, .proc/spin_slots, usr.name), 25) /obj/machinery/slot_machine/proc/spin_slots(userName) - switch(rand(1,4050)) - if(1) // .02% - atom_say("JACKPOT! [userName] has won a MILLION CREDITS!") - GLOB.event_announcement.Announce("Congratulations to [userName] on winning the Jackpot of ONE MILLION CREDITS!", "Jackpot Winner") - result = "JACKPOT! You win one million credits!" + switch(rand(1,5000)) + if(1) + atom_say("JACKPOT! [userName] has won ten thousand credits!") + GLOB.event_announcement.Announce("Congratulations to [userName] on winning the Jackpot of TEN THOUSAND CREDITS!", "Jackpot Winner") + result = "JACKPOT! You win ten thousand credits!" resultlvl = "teal" - win_money(1000000, 'sound/goonstation/misc/airraid_loop.ogg') - if(2 to 5) // .07% - atom_say("Big Winner! [userName] has won a hundred thousand credits!") - GLOB.event_announcement.Announce("Congratulations to [userName] on winning a hundred thousand credits!", "Big Winner") - result = "Big Winner! You win a hundred thousand credits!" - resultlvl = "green" - win_money(100000, 'sound/goonstation/misc/klaxon.ogg') - if(6 to 50) // 1.08% - atom_say("Big Winner! [userName] has won ten thousand credits!") - result = "You win ten thousand credits!" - resultlvl = "green" - win_money(10000, 'sound/goonstation/misc/klaxon.ogg') - if(51 to 100) // 1.21% - atom_say("Winner! [userName] has won a thousand credits!") + win_money(10000, 'sound/goonstation/misc/airraid_loop.ogg') + if(2 to 20) + atom_say("Big Winner! [userName] has won a thousand credits!") result = "You win a thousand credits!" resultlvl = "green" - win_money(1000, 'sound/goonstation/misc/bell.ogg') - if(101 to 200) // 2.44% - atom_say("Winner! [userName] has won a hundred credits!") - result = "You win a hundred credits!" + win_money(500, 'sound/goonstation/misc/klaxon.ogg') + if(21 to 100) + atom_say("Winner! [userName] has won five hundred credits!") + result = "You win five hundred credits!" resultlvl = "green" - win_money(100, 'sound/goonstation/misc/bell.ogg') - if(201 to 300) // 2.44% + win_money(500, 'sound/goonstation/misc/bell.ogg') + if(101 to 500) + atom_say("Winner! [userName] has won two hundred credits!") + result = "You win two hundred credits!" + resultlvl = "green" + if(501 to 1000) atom_say("Winner! [userName] has won fifty credits!") result = "You win fifty credits!" resultlvl = "green" win_money(50) - if(301 to 1000) // 17.26% - atom_say("Winner! [userName] has won ten credits!") - result = "You win ten credits!" - resultlvl = "green" - win_money(10) - else // 75.31% + else result = "No luck!" resultlvl = "orange" working = FALSE diff --git a/tgui/packages/tgui/interfaces/SlotMachine.js b/tgui/packages/tgui/interfaces/SlotMachine.js index ccdba8f0516..5f19717e341 100644 --- a/tgui/packages/tgui/interfaces/SlotMachine.js +++ b/tgui/packages/tgui/interfaces/SlotMachine.js @@ -39,7 +39,7 @@ export const SlotMachine = (props, context) => { value={data.money} /> - +