diff --git a/code/game/machinery/clawmachine.dm b/code/game/machinery/clawmachine.dm new file mode 100644 index 00000000000..ff65f31c847 --- /dev/null +++ b/code/game/machinery/clawmachine.dm @@ -0,0 +1,209 @@ + +//Original Codebase created by Shadowfire117#1269 - Ported from CHOMPstation +//Modified by GhostActual#2055 to produce Claw Machine + +/* + * Space Crane + */ + +/obj/machinery/clawmachine + name = "Space Crane" + desc = "Try your luck at winning a cute plush toy! No refunds, and whining won't win you anything." + icon = 'icons/obj/computer.dmi' + icon_state = "clawmachine" + anchored = 1 + density = 1 + power_channel = EQUIP + use_power = USE_POWER_IDLE + idle_power_usage = 10 + active_power_usage = 100 + light_power = 0.9 + light_range = 2 + light_color = "#B1FBBFF" + var/isbroken = 0 //1 if someone banged it with something heavy + var/ispowered = 1 //starts powered, changes with power_change() + var/busy = 0 + var/symbol1 = null + var/symbol2 = null + var/symbol3 = null + var/list/prizes = list(/obj/random/carp_plushie, + /obj/item/toy/plushie/nymph, + /obj/item/toy/plushie/teshari, + /obj/item/toy/plushie/mouse, + /obj/item/toy/plushie/kitten, + /obj/item/toy/plushie/lizard, + /obj/item/toy/plushie/spider, + /obj/item/toy/plushie/farwa, + /obj/item/toy/plushie/corgi, + /obj/item/toy/plushie/girly_corgi, + /obj/item/toy/plushie/robo_corgi, + /obj/item/toy/plushie/octopus, + /obj/item/toy/plushie/face_hugger, + /obj/item/toy/plushie/red_fox, + /obj/item/toy/plushie/black_fox, + /obj/item/toy/plushie/marble_fox, + /obj/item/toy/plushie/blue_fox, + /obj/item/toy/plushie/orange_fox, + /obj/item/toy/plushie/coffee_fox, + /obj/item/toy/plushie/pink_fox, + /obj/item/toy/plushie/purple_fox, + /obj/item/toy/plushie/crimson_fox, + /obj/item/toy/plushie/deer, + /obj/item/toy/plushie/black_cat, + /obj/item/toy/plushie/grey_cat, + /obj/item/toy/plushie/white_cat, + /obj/item/toy/plushie/orange_cat, + /obj/item/toy/plushie/siamese_cat, + /obj/item/toy/plushie/tabby_cat, + /obj/item/toy/plushie/tuxedo_cat, + /obj/item/toy/plushie/borgplushie/medihound, + /obj/item/toy/plushie/borgplushie/scrubpuppy, + /obj/item/toy/plushie/borgplushie/drakiesec, + /obj/item/toy/plushie/borgplushie/drakiemed, + /obj/item/toy/plushie/otter + ) + +/obj/machinery/clawmachine/update_icon() + cut_overlays() + if(!ispowered || isbroken) + icon_state = "clawmachine_off" + if(isbroken) //If the thing is smashed, add crack overlay on top of the unpowered sprite. + add_overlay("clawmachine_broken") + set_light(0) + set_light_on(FALSE) + return + + icon_state = "clawmachine" + set_light(2) + set_light_on(TRUE) + return + +/obj/machinery/clawmachine/power_change() + if(isbroken) //Broken shit can't be powered. + return + ..() + if(!(stat & NOPOWER)) + ispowered = 1 + update_icon() + else + spawn(rand(0, 15)) + ispowered = 0 + update_icon() + +/obj/machinery/clawmachine/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(busy) + to_chat(user,"The claw machine is currently running. ") + return + if(W.is_wrench()) + playsound(src, W.usesound, 100, 1) + if(anchored) + user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") + else + user.visible_message("[user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.") + + if(do_after(user, 20 * W.toolspeed)) + if(!src) return + to_chat(user, "You [anchored? "un" : ""]secured \the [src]!") + anchored = !anchored + return + + if(!anchored) + to_chat(user," The machine isn't secured.") + return + + var/handled = 0 + var/paid = 0 + + if(istype(W, /obj/item/weapon/spacecash)) + var/obj/item/weapon/spacecash/C = W + paid = insert_cash(C, user) + handled = 1 + if(paid) + return + if(handled) + SStgui.update_uis(src) + return // don't smack that machine with your 2 chips + + else if(!(stat & NOPOWER)) + return + + else if(isbroken) + return + +/obj/machinery/clawmachine/proc/prizevend() + if(LAZYLEN(prizes)) + var/prizeselect = pickweight(prizes) + new prizeselect(src.loc) + +/obj/machinery/clawmachine/proc/insert_cash(var/obj/item/weapon/spacecash/cashmoney, mob/user) + if (ispowered == 0) + return + if (isbroken) + return + if(busy) + to_chat(user,"The claw machine is currently running. ") + return + if(cashmoney.worth < 5) + to_chat(user,"You dont have enough Thalers to play! ") + return + + to_chat(user,"You put 5 Thalers in the claw machine and press start.") + cashmoney.worth -= 5 + cashmoney.update_icon() + + if(cashmoney.worth <= 0) + usr.drop_from_inventory(cashmoney) + qdel(cashmoney) + cashmoney.update_icon() + + busy = 1 + icon_state = "clawmachine_play" + playsound(src.loc, 'sound/machines/clawmachine_play.ogg', 50, 0) + + var/slot1 = rand(0,4) + switch(slot1) + if(0 to 2) symbol1 = "one" + if(3 to 4) symbol1 = "two" + + var/slot2 = rand(0,4) + switch(slot2) + if(0 to 2) symbol2 = "one" + if(3 to 4) symbol2 = "two" + + var/slot3 = rand(0,4) + switch(slot3) + if(0 to 2) symbol3 = "one" + if(3 to 4) symbol3 = "two" + + var/output //Output variable to send out in chat after the large if statement. + var/winnings = 0 //If you win a toy or not + var/delaytime = 7 SECONDS + + spawn(delaytime) + to_chat(user,"The clam machine lights up and starts to play!") + + if (symbol1 == "one" && symbol2 == "one" && symbol3 == "one") + output = "Hooray! You Win!" + winnings = TRUE + + if (symbol1 == "two" && symbol2 == "two" && symbol3 == "two") + output = "Hooray! You Win!!" + winnings = TRUE + + icon_state = initial(icon_state) // Set it back to the original iconstate. + + if(!output) // Is there anything to output? If not, consider it a loss. + to_chat(user,"Better luck next time!") + busy = FALSE + return + + to_chat(user,output) //Output message + + if(winnings) //Did the person win? + icon_state = "clawmachine_win" + prizevend() + playsound(src.loc, 'sound/machines/clawmachine_win.ogg', 50, 0) + spawn(delaytime) + icon_state = "clawmachine" + + busy = FALSE \ No newline at end of file diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 059f0582431..59cb5769712 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -40,7 +40,7 @@ var/atom/movable/AM = pick_n_take(special_prizes) AM.forceMove(get_turf(src)) special_prizes -= AM - + else if(LAZYLEN(prizes)) var/prizeselect = pickweight(prizes) new prizeselect(src.loc) @@ -1322,7 +1322,7 @@ gameStatus = "CLAWMACHINE_NEW" emagged = 1 return 1 - + /obj/machinery/computer/arcade/attackby(obj/item/O, mob/user, params) if(istype(O, /obj/item/stack/arcadeticket)) var/obj/item/stack/arcadeticket/T = O diff --git a/code/game/objects/items/weapons/storage/wallets.dm b/code/game/objects/items/weapons/storage/wallets.dm index 4161ae740b9..b36078028b1 100644 --- a/code/game/objects/items/weapons/storage/wallets.dm +++ b/code/game/objects/items/weapons/storage/wallets.dm @@ -139,3 +139,61 @@ desc = "A stylish wallet typically used by women." icon_state = "girl_wallet" item_state_slots = list(slot_r_hand_str = "wowallet", slot_l_hand_str = "wowallet") + +//Casino Wallet + +/obj/item/weapon/storage/wallet/casino + name = "casino wallet" + desc = "A fancy casino wallet with flashy lights, oooh~" + icon = 'icons/obj/casino.dmi' + icon_state = "casinowallet_black" + can_hold = list( + /obj/item/weapon/spacecash, + /obj/item/weapon/card, + /obj/item/clothing/mask/smokable/cigarette/, + /obj/item/device/flashlight/pen, + /obj/item/device/tape, + /obj/item/weapon/cartridge, + /obj/item/device/encryptionkey, + /obj/item/seeds, + /obj/item/stack/medical, + /obj/item/weapon/coin, + /obj/item/weapon/dice, + /obj/item/weapon/disk, + /obj/item/weapon/implanter, + /obj/item/weapon/flame/lighter, + /obj/item/weapon/flame/match, + /obj/item/weapon/forensics, + /obj/item/weapon/glass_extra, + /obj/item/weapon/haircomb, + /obj/item/weapon/hand, + /obj/item/weapon/key, + /obj/item/weapon/lipstick, + /obj/item/weapon/paper, + /obj/item/weapon/pen, + /obj/item/weapon/photo, + /obj/item/weapon/reagent_containers/dropper, + /obj/item/weapon/sample, + /obj/item/weapon/tool/screwdriver, + /obj/item/weapon/stamp, + /obj/item/clothing/accessory/permit, + /obj/item/clothing/accessory/badge, + /obj/item/weapon/makeover, + /obj/item/weapon/spacecasinocash, + /obj/item/weapon/casino_platinum_chip, + /obj/item/weapon/deck + ) + +/obj/item/weapon/storage/wallet/casino/verb/toggle_design() + set category = "Object" + set name = "Toggle design" + set src in usr + + if (icon_state == "casinowallet_black") + icon_state = "casinowallet_brown" + return + if (icon_state == "casinowallet_brown") + icon_state = "casinowallet_white" + return + else + icon_state = "casinowallet_black" \ No newline at end of file diff --git a/code/game/objects/structures/dancepole_vr.dm b/code/game/objects/structures/dancepole_vr.dm index 3a548f11332..90270b88ce3 100644 --- a/code/game/objects/structures/dancepole_vr.dm +++ b/code/game/objects/structures/dancepole_vr.dm @@ -2,10 +2,22 @@ /obj/structure/dancepole name = "dance pole" desc = "Engineered for your entertainment" - icon = 'icons/obj/objects_vr.dmi' - icon_state = "dancepole" + icon = 'icons/obj/casino.dmi' + icon_state = "dance_pole" density = FALSE anchored = TRUE + density = 0 + +/obj/structure/dancepole/attack_hand(mob/user) + dance(user) + user.spin(32,2) + ..() + +/obj/structure/dancepole/proc/dance(mob/user) + if(layer == BELOW_MOB_LAYER) + layer = ABOVE_MOB_LAYER + else + layer = BELOW_MOB_LAYER /obj/structure/dancepole/attackby(var/obj/item/O as obj, var/mob/user as mob) if(O.is_screwdriver()) @@ -22,4 +34,4 @@ if(!src) return to_chat(user, "You dissasembled \the [src]!") new /obj/item/stack/material/steel(src.loc, 1) - qdel(src) \ No newline at end of file + qdel(src) diff --git a/code/game/objects/structures/salvageable.dm b/code/game/objects/structures/salvageable.dm index 0a35848d8d2..2073e150348 100644 --- a/code/game/objects/structures/salvageable.dm +++ b/code/game/objects/structures/salvageable.dm @@ -364,3 +364,30 @@ /obj/item/weapon/computer_hardware/card_slot = 40, /obj/item/weapon/computer_hardware/network_card/advanced = 40 ) + + +/obj/structure/salvageable/slotmachine1 + name = "broken slot machine" + icon_state = "slot1" + salvageable_parts = list( + /obj/item/stack/cable_coil{amount = 5} = 90, + /obj/item/weapon/stock_parts/console_screen = 90, + /obj/item/stack/cable_coil{amount = 5} = 90, + /obj/item/stack/material/glass{amount = 5} = 90, + /obj/item/weapon/stock_parts/capacitor = 60, + /obj/item/weapon/stock_parts/capacitor = 60, + /obj/item/weapon/computer_hardware/network_card/advanced = 40 + ) + +/obj/structure/salvageable/slotmachine2 + name = "broken slot machine" + icon_state = "slot2" + salvageable_parts = list( + /obj/item/stack/cable_coil{amount = 5} = 90, + /obj/item/weapon/stock_parts/console_screen = 90, + /obj/item/stack/cable_coil{amount = 5} = 90, + /obj/item/stack/material/glass{amount = 5} = 90, + /obj/item/weapon/stock_parts/capacitor = 60, + /obj/item/weapon/stock_parts/capacitor = 60, + /obj/item/weapon/computer_hardware/network_card/advanced = 40 + ) \ No newline at end of file diff --git a/code/modules/casino/casino.dm b/code/modules/casino/casino.dm new file mode 100644 index 00000000000..eeb850f6880 --- /dev/null +++ b/code/modules/casino/casino.dm @@ -0,0 +1,485 @@ + +//Original Casino Code created by Shadowfire117#1269 - Ported from CHOMPstation +//Modified by GhostActual#2055 for use with VOREstation + +// +//Roulette Table +// + +/obj/structure/casino_table + name = "casino table" + desc = "this is an unremarkable table for a casino." + icon = 'icons/obj/casino.dmi' + icon_state = "roulette_table" + density = 1 + anchored = 1 + climbable = 1 + layer = TABLE_LAYER + throwpass = 1 + var/item_place = 1 //allows items to be placed on the table, but not on benches. + + var/busy = 0 + +/obj/structure/casino_table/attackby(obj/item/W as obj, mob/user as mob) + if(item_place) + user.drop_item(src.loc) + return + +/obj/structure/casino_table/roulette_table + name = "roulette" + desc = "Spin the roulette to try your luck." + icon_state = "roulette_wheel" + +/obj/structure/casino_table/roulette_table/attack_hand(mob/user as mob) + if (busy) + to_chat(user,"You cannot spin now! The roulette is already spinning. ") + return + visible_message("\ [user] spins the roulette and throws inside little ball.") + playsound(src.loc, 'sound/machines/roulette.ogg', 40, 1) + busy = 1 + icon_state = "roulette_wheel_spinning" + var/result = rand(0,36) + var/color = "green" + add_fingerprint(user) + if ((result>0 && result<11) || (result>18 && result<29)) + if (result%2) + color="red" + else + color="black" + if ( (result>10 && result<19) || (result>28) ) + if (result%2) + color="black" + else + color="red" + spawn(5 SECONDS) + visible_message("The roulette stops spinning, the ball landing on [result], [color].") + busy=0 + icon_state = "roulette_wheel" + +/obj/structure/casino_table/roulette_chart + name = "roulette chart" + desc = "Roulette chart. Place your bets!" + icon_state = "roulette_table" + +// +//Blackjack table - no sprite +// + +/obj/structure/casino_table/blackjack_l + name = "gambling table" + desc = "Gambling table, try your luck and skills! " + icon_state = "blackjack_l" + +/obj/structure/casino_table/blackjack_r + name = "gambling table" + desc = "Gambling table, try your luck and skills! " + icon_state = "blackjack_r" + +/obj/structure/casino_table/blackjack_m + name = "gambling table" + desc = "Gambling table, try your luck and skills! " + icon_state = "blackjack_m" + +// +//Wheel. Of. FORTUNE! +// + +/obj/machinery/wheel_of_fortune + name = "wheel of fortune" + desc = "The Wheel of Fortune! Insert chips and may fortune favour the lucky one at the next lottery!" + icon = 'icons/obj/64x64.dmi' + icon_state = "wheel_of_fortune" + density = 1 + anchored = 1 + pixel_x = -16 + + req_access = list(300) + var/interval = 1 + var/busy = 0 + var/public_spin = 0 + var/lottery_sale = "disabled" + var/lottery_price = 100 + var/lottery_entries = 0 + var/lottery_tickets = list() + var/lottery_tickets_ckeys = list() + + var/datum/effect/effect/system/confetti_spread + var/confetti_strength = 15 + + +/obj/machinery/wheel_of_fortune/attack_hand(mob/user as mob) + if (busy) + to_chat(user,"The wheel of fortune is already spinning! ") + return + + if(usr.incapacitated()) + return + if(ishuman(usr) || istype(usr, /mob/living/silicon/robot)) + switch(input(user,"Choose what to do","Wheel Of Fortune") in list("Spin the Wheel! (Not Lottery)", "Set the interval", "Cancel")) + if("Cancel") + return + if("Spin the Wheel! (Not Lottery)") + if(public_spin == 0) + to_chat(user,"The Wheel makes a sad beep, public spins are not enabled right now.. ") + return + else + to_chat(user,"You spin the wheel! ") + spin_the_wheel("not_lottery") + if("Set the interval") + setinterval() + + +/obj/machinery/wheel_of_fortune/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (busy) + to_chat(user,"The wheel of fortune is already spinning! ") + return + + if(usr.incapacitated()) + return + + if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) + if(!check_access(W)) + to_chat(user, "Access Denied.") + return + else + to_chat(user, "Proper access, allowed staff controls.") + if(ishuman(usr) || istype(usr, /mob/living/silicon/robot)) + switch(input(user,"Choose what to do (Management)","Wheel Of Fortune (Management)") in list("Spin the Lottery Wheel!", "Toggle Lottery Sales", "Toggle Public Spins", "Reset Lottery", "Cancel")) + if("Cancel") + return + if("Spin the Lottery Wheel!") + to_chat(user,"You spin the wheel for the lottery! ") + spin_the_wheel("lottery") + + if("Toggle Lottery Sales") + if(lottery_sale == "disabled") + lottery_sale = "enabled" + to_chat(user,"Public Lottery sale has been enabled. ") + else + lottery_sale = "disabled" + to_chat(user,"Public Lottery sale has been disabled. ") + + if("Toggle Public Spins") + if(public_spin == 0) + public_spin = 1 + to_chat(user,"Public spins has been enabled. ") + else + public_spin = 0 + to_chat(user,"Public spins has been disabled. ") + + if("Reset Lottery") + var/confirm = tgui_alert(usr, "Are you sure you want to reset Lottery?", "Confirm Lottery Reset", list("Yes", "No")) + if(confirm == "Yes") + to_chat(user, "Lottery has been Reset!") + lottery_entries = 0 + lottery_tickets = list() + lottery_tickets_ckeys = list() + + if(istype(W, /obj/item/weapon/spacecasinocash)) + if(lottery_sale == "disabled") + to_chat(user, "Lottery sales are currently disabled.") + return + else + if(user.client.ckey in lottery_tickets_ckeys) + to_chat(user, "The scanner beeps in an upset manner, you already have a ticket!") + return + + var/obj/item/weapon/spacecasinocash/C = W + insert_chip(C, user) + +/obj/machinery/wheel_of_fortune/proc/insert_chip(var/obj/item/weapon/spacecasinocash/cashmoney, mob/user) + if (busy) + to_chat(user,"The Wheel of Fortune is busy, wait for it to be done to buy a lottery ticket. ") + return + if(cashmoney.worth < lottery_price) + to_chat(user,"You dont have enough chips to buy a lottery ticket! ") + return + + to_chat(user,"You put [lottery_price] credits worth of chips into the Wheel of Fortune and it pings to notify of your lottery ticket registered!") + cashmoney.worth -= lottery_price + cashmoney.update_icon() + + if(cashmoney.worth <= 0) + usr.drop_from_inventory(cashmoney) + qdel(cashmoney) + cashmoney.update_icon() + + lottery_entries++ + lottery_tickets += "Number.[lottery_entries] [user.name]" + lottery_tickets_ckeys += user.client.ckey + +/obj/machinery/wheel_of_fortune/proc/spin_the_wheel(var/mode) + var/result = 0 + + if(mode == "not_lottery") + busy = 1 + icon_state = "wheel_of_fortune_spinning" + result = rand(1,interval) + + spawn(5 SECONDS) + visible_message("The wheel of fortune stops spinning, the number is [result]!") + src.confetti_spread = new /datum/effect/effect/system/confetti_spread() + src.confetti_spread.attach(src) //If somehow people start dragging slot machine + spawn(0) + for(var/i = 1 to confetti_strength) + src.confetti_spread.start() + sleep(10) + + flick("[icon_state]-winning",src) + busy = 0 + icon_state = "wheel_of_fortune" + + if(mode == "lottery") + if(lottery_entries == 0) + visible_message("There are no tickets in the system!") + return + + busy = 1 + icon_state = "wheel_of_fortune_spinning" + result = pick(lottery_tickets) + + spawn(5 SECONDS) + visible_message("The wheel of fortune stops spinning, and the winner is [result]!") + src.confetti_spread = new /datum/effect/effect/system/confetti_spread() + src.confetti_spread.attach(src) //If somehow people start dragging slot machine + spawn(0) + for(var/i = 1 to confetti_strength) + src.confetti_spread.start() + sleep(10) + + flick("[icon_state]-winning",src) + busy = 0 + icon_state = "wheel_of_fortune" + +/obj/machinery/wheel_of_fortune/verb/setinterval() + set name = "Change interval" + set category = "Object" + set src in view(1) + + if(usr.incapacitated()) + return + if(ishuman(usr) || istype(usr, /mob/living/silicon/robot)) + interval = input("Put the desired interval (1-1000)", "Set Interval") as num + if(interval>1000 || interval<1) + usr << "Invalid interval." + return + usr << "You set the interval to [interval]" + return + +// +//Slave Terminal +// + +/obj/machinery/casinoslave_handler + name = "Sentient Prize Automated Sales Machinery" + desc = "The Sentient Prize Automated Sales Machinery, also known as SPASM! Here one can see who is on sale as sentinet prizes, as well as selling self and also buying prizes." + icon = 'icons/obj/casino.dmi' + icon_state = "casinoslave_hub_off" + density = 1 + anchored = 1 + req_access = list(300) + + var/casinoslave_sale = "disabled" + var/casinoslave_price = 100 + var/collar_list = list() + var/slaves_ckeys_list = list() //Same trick as lottery, to keep life simple + var/obj/item/clothing/accessory/collar/casinoslave/selected_collar = null + +/obj/machinery/casinoslave_handler/attack_hand(mob/living/user as mob) + if(usr.incapacitated()) + return + if(casinoslave_sale == "disabled") + to_chat(user,"The SPASM is disabled. ") + return + + if(ishuman(usr) || istype(usr, /mob/living/silicon/robot)) + switch(input(user,"Choose what to do","SPASM") in list("Show selected Prize", "Select Prize", "Become Prize (Please examine yourself first)", "Cancel")) + if("Cancel") + return + if("Show selected Prize") + if(QDELETED(selected_collar)) + collar_list -= selected_collar + slaves_ckeys_list -= selected_collar.slaveckey + to_chat(user, "No collar is currently selected or the currently selected one has been destroyed or disabled.") + selected_collar = null + return + to_chat(user, "Sentient Prize information") + to_chat(user, "Name: [selected_collar.slavename]") + to_chat(user, "Description: [selected_collar.slaveflavor]") + to_chat(user, "OOC: [selected_collar.slaveooc]") + if(selected_collar.ownername != null) + to_chat(user, "This prize is already owned by [selected_collar.ownername]") + + if("Select Prize") + selected_collar = tgui_input_list(user, "Select a prize", "Chose a collar", collar_list) + if(QDELETED(selected_collar)) + collar_list -= selected_collar + slaves_ckeys_list -= selected_collar.slaveckey + to_chat(user, "No collars to chose, or selected collar has been destroyed or deactived, selection has been removed from list.") + selected_collar = null + return + + if("Become Prize (Please examine yourself first)") //Its awkward, but no easy way to obtain flavor_text due to server not loading text of mob until its been examined at least once. + var/safety_ckey = user.client.ckey + if(safety_ckey in slaves_ckeys_list) + to_chat(user, "The SPASM beeps in an upset manner, you already have a collar!") + return + var/confirm = tgui_alert(usr, "Are you sure you want to become a sentient prize?", "Confirm Sentient Prize", list("Yes", "No")) + if(confirm == "Yes") + to_chat(user, "You are now a prize!") + if(safety_ckey in slaves_ckeys_list) + to_chat(user, "The SPASM beeps in an upset manner, you already have a collar!") + return + slaves_ckeys_list += user.ckey + var/obj/item/clothing/accessory/collar/casinoslave/C = new(src.loc) + C.slavename = "[user.name]" + C.slaveckey = "[user.ckey]" + C.slaveflavor = user.flavor_text + C.slaveooc = user.ooc_notes + C.name = "Sentient Prize Collar: Available! [user.name] purchaseable at the SPASM!" + C.desc = "SPASM collar. The tags shows in flashy colorful text the wearer is [user.name] and is currently available to buy at the Sentient Prize Automated Sales Machinery!" + C.icon_state = "casinoslave_available" + C.update_icon() + collar_list += C + + spawn_casinochips(casinoslave_price, src.loc) + +/obj/machinery/casinoslave_handler/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(usr.incapacitated()) + return + + if(istype(W, /obj/item/weapon/spacecasinocash)) + if(casinoslave_sale == "disabled") + to_chat(user, "Sentient Prize sales are currently disabled.") + return + if(!selected_collar.ownername) + var/obj/item/weapon/spacecasinocash/C = W + if(user.client.ckey == selected_collar.slaveckey) + insert_chip(C, user, "selfbuy") + return + else + insert_chip(C, user, "buy") + return + else + to_chat(user, "This Sentient Prize is already owned! If you are the owner you can release the prize by swiping the collar on the SPASM!") + return + + if(istype(W, /obj/item/clothing/accessory/collar/casinoslave)) + var/obj/item/clothing/accessory/collar/casinoslave/C = W + if(user.name != C.slavename && user.name != C.ownername) + to_chat(user, "This Sentient Prize collar isn't yours, please give it to the one it tagged for, belongs to, or a casino staff member!") + return + if(user.name == C.slavename) + if(!C.ownername) + to_chat(user,"If collar isn't disabled and entry removed, please select your entry and insert chips. Or contact staff if you need assistance. ") + return + else + to_chat(user,"If collar isn't disabled and entry removed, please ask your owner to free you with collar swipe on the SPASM, or contact staff if you need assistance. ") + return + if(user.name == C.ownername) + var/confirm = tgui_alert(usr, "Are you sure you want to wipe [C.slavename] entry?", "Confirm Sentient Prize Release", list("Yes", "No")) + if(confirm == "Yes") + to_chat(user, "[C.slavename] collar has been deleted from registry!") + C.icon_state = "casinoslave" + C.update_icon() + C.name = "a disabled Sentient Prize Collar: [C.slavename]" + C.desc = "A collar worn by sentient prizes registered to a SPASM. The tag says its registered to [C.slavename], but harsh red text informs you its been disabled." + slaves_ckeys_list -= C.slaveckey + C.slaveckey = null + collar_list -= C + + if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) + if(!check_access(W)) + to_chat(user, "Access Denied.") + return + else + to_chat(user, "Proper access, allowed staff controls.") + if(ishuman(usr) || istype(usr, /mob/living/silicon/robot)) + switch(input(user,"Choose what to do (Management)","SPASM (Management)") in list("Toggle Sentient Prize Sales", "Wipe Selected Prize Entry", "Change Prize Value", "Cancel")) + if("Cancel") + return + + if("Toggle Sentient Prize Sales") + if(casinoslave_sale == "disabled") + casinoslave_sale = "enabled" + icon_state = "casinoslave_hub_on" + update_icon() + to_chat(user,"Prize sale has been enabled. ") + else + casinoslave_sale = "disabled" + icon_state = "casinoslave_hub_off" + update_icon() + to_chat(user,"Prize sale has been disabled. ") + + if("Wipe Selected Prize Entry") + if(!selected_collar) + to_chat(user, "No collar selected!") + return + if(QDELETED(selected_collar)) + collar_list -= selected_collar + slaves_ckeys_list -= selected_collar.slaveckey + to_chat(user, "Collar has been destroyed!") + selected_collar = null + return + var/safety_ckey = selected_collar.slaveckey + var/confirm = tgui_alert(usr, "Are you sure you want to wipe [selected_collar.slavename] entry?", "Confirm Sentient Prize", list("Yes", "No")) + if(confirm == "Yes") + if(safety_ckey == selected_collar.slaveckey) + to_chat(user, "[selected_collar.slavename] collar has been deleted from registry!") + selected_collar.icon_state = "casinoslave" + selected_collar.update_icon() + selected_collar.name = "a disabled Sentient Prize Collar: [selected_collar.slavename]" + selected_collar.desc = "A collar worn by sentient prizes registered to a SPASM. The tag says its registered to [selected_collar.slavename], but harsh red text informs you its been disabled." + slaves_ckeys_list -= selected_collar.slaveckey + selected_collar.slaveckey = null + collar_list -= selected_collar + selected_collar = null + else + to_chat(user, "Registry deletion aborted! Changed collar selection!") + return + + if("Change Prize Value") + setprice(user) + +/obj/machinery/casinoslave_handler/proc/insert_chip(var/obj/item/weapon/spacecasinocash/cashmoney, mob/user, var/buystate) + if(cashmoney.worth < casinoslave_price) + to_chat(user,"You dont have enough chips to pay for the sentient prize! ") + return + + cashmoney.worth -= casinoslave_price + cashmoney.update_icon() + + if(cashmoney.worth <= 0) + usr.drop_from_inventory(cashmoney) + qdel(cashmoney) + cashmoney.update_icon() + + if(buystate == "selfbuy") + to_chat(user,"You put [casinoslave_price] credits worth of chips into the SPASM and nullify your collar! ") + selected_collar.icon_state = "casinoslave" + selected_collar.update_icon() + selected_collar.name = "a disabled Sentient Prize Collar: [selected_collar.slavename]" + selected_collar.desc = "A collar worn by sentient prizes registered to a SPASM. The tag says its registered to [selected_collar.slavename], but harsh red text informs you its been disabled." + slaves_ckeys_list -= selected_collar.slaveckey + selected_collar.slaveckey = null + collar_list -= selected_collar + selected_collar = null + + if(buystate == "buy") + to_chat(user,"You put [casinoslave_price] credits worth of chips into the SPASM and it pings to inform you bought [selected_collar.slavename]! ") + selected_collar.icon_state = "casinoslave_owned" + selected_collar.update_icon() + selected_collar.ownername = user.name + selected_collar.name = "Sentient Prize Collar: [selected_collar.slavename] owned by [selected_collar.ownername]!" + selected_collar.desc = "A collar worn by sentient prizes registered to a SPASM. The tag says its registered to [selected_collar.slavename] and they are owned by [selected_collar.ownername]." + selected_collar = null + +/obj/machinery/casinoslave_handler/proc/setprice(mob/living/user as mob) + if(usr.incapacitated()) + return + if(ishuman(usr) || istype(usr, /mob/living/silicon/robot)) + casinoslave_price = input("Select the desired price (1-1000)", "Set Price") as num + if(casinoslave_price>1000 || casinoslave_price<1) + to_chat(user,"Invalid price. ") + return + to_chat(user,"You set the price to [casinoslave_price] ") diff --git a/code/modules/casino/casino_book.dm b/code/modules/casino/casino_book.dm new file mode 100644 index 00000000000..1f80817112b --- /dev/null +++ b/code/modules/casino/casino_book.dm @@ -0,0 +1,284 @@ + +//Original Casino Code created by Shadowfire117#1269 - Ported from CHOMPstation +//Modified by GhostActual#2055 for use with VOREstation + +// +//Casino Manual - NEEDS EDITING +// + +/obj/item/weapon/book/manual/casino + name = "A dummy guide to losing your thalers" + icon = 'icons/obj/casino.dmi' + icon_state ="casinomanual" + author = "Sleazy Serpent Saren" + w_class = 2 // To allow it to be stuffed away into wallets for easy readings during events + title = "A dummy guide to losing your thalers" + dat = {" + + + + + +

Contents

+
    +
  1. Foreword: Welcome to gambling!
  2. +
  3. Blackjack
  4. +
  5. Roulette
  6. +
  7. Poker
  8. +
  9. Cards against the galaxy
  10. +
  11. Prizes
  12. +
  13. Sentient prizes
  14. +
+
+

Foreword: Welcome to gambling!

+ In this book I'll teach you all about how to gamble your money away or at least get lucky and win some! This book also has a handy little overview of the prizes one can earn and the limitations of what can do with the living and breathing ones.
+ (This book will also contain out of character information to help people be aware of how touchy subjects like sentient prizes are to be handled.) + +

Blackjack

+ First up is the classic sport of blackjack, blackjack is played normally between a gambler and a dealer, the goal is to have the higher number than the opponent but not go above 21 or it will be a bust and one loses automatically.
+ The values of cards are as follow: + + A game of blackjack begins with the dealer giving the gambler two cards, in normal blackjack all cards dealt to gambler and dealer are always shown. The two cards dealt have their values put together, the gambler has three choices, stand, hit, or double down. + + When it becomes the dealer's turn they do the same as the gambler, though their only goal is to get a higher or equal value to gambler. The dealer cant double down, and the large majority of casino's has the rule that a dealer cant draw anymore cards once they reach or go above a value. The most common value is 17, and there are two variants to that rule, soft and hard 17. + + The casino who supplies this version of the manual follows the rule of hard 17.
+ The game ends when the dealer busts, reaches the threshold of what they are allowed to draw, or if they get a higher value than the gambler. Again, the one who has the highest value that isnt higher than 21 wins, but if both has the same value no one wins and the bet goes back to the gambler.
+ And thats it! Now go out there and gamble your savings away! This casino allows bets between 5 and 50 with double down ignoring that limit!

+ + But wait! Theres more! Theres also group blackjack! This game is a little different, the dealer can be part of it or simple deal for players, this game works differently with everyone keeping their hands hidden, everyone makes initial bets, gets two facedown cards, then its a matter of trying to get as good a hand as possible, but if you go bust, its over. But dont tell or show until everyone reveals! If youre going down, its best if youre opponents dont know they simply can play safe and win, if youre lucky everyone else gets themselves busted and you dont lose your beloved chips!
+ Its kinda like texas hold em in a way, everyone draws, folks can raise bets or fold, then draw more. Rinse and repeat until no one wants to raise any more nor draw cards, if everyone except one person has folded, they win by default even if they have busted, cause they dont need to reveal their hand that game, so you can choose to either sit and wait and fold if someone raise the bets, or you can gamble and make it look like you have an amazing hand and win by default since everyone else folds and no one is wise that you had a bust! This game has turned from simple probability and chance against the dealer to a game of risk and deception, fun fun fun! + +

Roulette

+ So this game of roulette is all about chance! what happens is that people bet on different odds and hope for the best as the dealer rolls the ball and makes that roulette thingy make than fun addicting spin! Once it lands on a number between 0 and 36 its either bust or payout! Pretty simple, right?
+ Everyone starts by putting their bets down, people can bet more than once before the ball goes rolling, the odds and their payoffs are these: + + Theres not much more to it! Bets made, ball rolls, number announced, people win, people lose! Bets allowed here are from 1 to 25 per bet. Oh, im also being told this casino has the fancy rule that if ball lands on 0, one wins at least one bet no matter what it is! So lets hope you got that big bet on a single number! + +

Poker

+ Aaah yes, good old poker. This casino runs by the rules of texas hold em, though the might be a little modified to be simpler for the average joe. In a game of poker it can be a single gambler and a dealer against each other, but most often its the dealer making the game proceed while several gamblers fights tooth and nail to steal each others chips, but the dealer can still join in on the free for all if they so wish!
+ To simply explain the game, people gamble with each other, a game of trying to get the best hand and raise bets or back out depending on what the outcome may be. The game starts with everyone betting a certain amount, it can be 5 or 10 chips depending on dealer, but if one wants to join, there needs to be chips on that table! Once everyone has made their initial bet, everyone gets two cards face down, these are kept hidden, no one not even dealer gets to see players cards until the end, not even folded cards are to be shown unless wanted to, sometimes its better making people unsure if you dropped out with bad cards or if you have other motives, deception is a large part of this game!
+ With everyone having cards dealt, its time for the dealer to lay three on the table face up, these cards are 3 of 5 cards in the community pool, everyone can use these cards to make sets like pairs and such, this doesnt mean they are taken, multiple people can use the same community card for their own sets!
+ With the community having three we enter the second betting stage, here people have two options, standing or raising. Standing means you dont want to raise, raising explains itself, though if someone bets, people have three options, commit putting the chips in to risk as much as the raised bet, but if one doesnt have enough, then they can still go all in with their remaining chips, one can also drop out if its too risky, the chips bet will remain on the table, but at least you wont lose more eh? Final one is to raise further, sometimes people can dare each other to raise more, but its not allowed for someone to raise, then raise further if no one else raises after them!
+ As said earlier, we got like a community pool of 5 cards total, this time another card is revealed and we enter a new betting phase, then the final fifth card is revealed and final bets are made, and then the cards are revealed so it can be determined who has the best hand! If two or more have equally good sets, then the chips are split evenly between them.
+ But notice, if someone is left because everyone else didnt dare to raise with their bet, they can decide to not reveal their hand, they might have had a winning hand, or maybe its terrible and they just bluffed their way to victory, only they know and can decide if they want to expose their cards to gloat or confuse their opponents. So in summary, the game can be simple, but hard to master!

+ And here is the order of winning hands folks! + + Wew, what a long lesson, but thats how one does the Texas hold em here at this casino, hope you guys have fun winning and losing your hard earned cash with this one! + +

Cards against the galaxy

+ + So hear this, NT is now sponsoring team building at the casino, so folks who wants to just relax with friends, play some games, earn chips with no risk, even the ones broke can join in on a fun game of Cards against the galaxy and have fun!
+ The idea is that once a round has concluded and a casino member is present to see the game being actually played, everyone gets 10 chips while the one who won the round gets 25 instead! Interested? Good! Its easy and simple to play and very fun and vulgar!

+ + The game is best played with at least 4 players and starts with everyone drawing 7 white cards, the person who most recently pooped starts as the 'card czar', but folks can agree on another criteria for the czar or simply pick one. Each round the current card czar draws a black card that has text written on it and blank lines, everyone aside from the czar takes a white card from their hand for every blank line which they find funny in that sentence and puts on the table face down with the others. The card czar cant know who has which white card and simply reads the black card with the white ones, the most funniest combination is choosen by the czar and the one who made that combination is the current rounds winner and the next rounds czar. At the end of each round everyone makes sure to draw enough white card to have 7 on hand and if theres a casino staff member playing or watching, they note down or hand out chips for everyone, and if they are playing, they get to add chips to their own personal stockpile too!
+ Thats it for cards against the galaxy! Simple, fun and vulgar, whats there not to love? + +

Prizes

+ + Hey folks, welcome to the prize section! This part is definently important for you folks operating the prize booth! First off I wanna tell you some great news! Nanotransen has gone along with a nice deal that allows crew to occasionally keep their hard earned rewards on station for a limited time, now you can enjoy your new fancy toolbelt or bluespace beaker for more than just the shift where the casino comes around!
+ ((Be aware, there can be limitations on how many rewards you get to keep after the shift, it might be unfair if some shows up and wins one thing, while they watch as command staff crew with high background income as well as hyperactive miners walks home with 20 prizes they get to enjoy while having almost done no gambling at all.))

+ + Lets get to the prizes and exchange rate before we get started on the stuff specifically for the booth operators, so heres the current prizes one can win and their costs! Be aware there might be new prizes or absent ones from time to time!
+ + EXCHANGE RATE
+ FROM = TO
+ 5 Thalers = 1 casino chip
+ 1 casino chip = 5 Thalers

+ + The special sentient prize is 100 chips! More about it in section below!

+ + Melee weapons + + Guns and 'guns' ((disclaimer, giving out guns will mean you get a weapons license as well with the shifts you have it, abusing these weapons will quickly get them removed!)) + + Gear + + Masks and hats - EVERYTHING IS 50 except chameleon! + + Costumes - All costumes are 100 except the hoodies which are 50! + + Toys and misc - ALL THESE ARE 50 + + Booze - ALL BOOZE IS 50 + + Pets + + Mechs + + Implants + + + Thats it for prizes!

+ + Now comes the part for the both operators, you got a very important job, it has a lot of responsibility, so it means that you gotta put that first before your own fun, cause unless you do it, a lot of folks are gonna be left sad and dissappointed they cant get any goodies! But the process is simple and can be quick, someone comes to you, they want some chips, or thalers back or a prize, you simply check this nice guide above to determine cost and ask for the amount of thalers or chips needed, if its a prize, then you follow this procedure: +
    +
  1. First get the thalers or chips for payment.
  2. +
  3. Before giving the prize you take out your prize winner folder and a piece of paper, this paper will be named after the one getting the reward and will have further prizes noted down into it, so make sure its safe in that folder!
  4. +
  5. You write at the top of the document the winner's name, then below write in big letters 'PRIZES' and put each new reward on its own line! ((You skip to a new line by writing < br > without the space between the br and the clamps))
  6. +
  7. Once written down, you just put the paper back in the folder and hand over the prize!
  8. +
+ ((When shift is nearing its end you pray to staff or DM the one responsible for the event, they will get the folder and copy paste all the reward info before shift is over and ensure people get their rewards. This is a very important job and we understand it might not be so fun being restricted during an event, but just like the rest of volunteer staff, you get rewarded with guaranteed prizes to enjoy after the shift for being a big help!))
+ ((This gets to the sour part, cheating and giving others and yourself free prizes and/or chips is absolutely forbidden, this has OOC consequences and will likely blacklist you from being important roles in future events. Though dont fear getting punished even if you havent done anything wrong, we will rather let cheaters slip than let honest players get wrongfully punished!)) + +

Sentient prizes

+ Goodness me this is quite the casino huh? Who would have thought one could win other people as a prize? Well you can do just about anything you want with them! Be it just company, some less children friendly company, heck you can even eat them or make them eat you! The options and possibilities are quite frankly limitless!
+ Now you might ask, how does one get these fancy prizes? Well they can be obtained by checking in at the exchange both and see the list of prizes, there might be none, there might be many, it depends on volunteers and losers! This brings us first to volunteers and then to losers!
+ Volunteering is simple! Anyone can walk up to the booth and ask to be a sentient prize, what this means is that you get a nice sum of 150 chips for you to do whatever you want, but someone might come at any point and claim you!
+ Losers are obtained differently, if youre completly busted and have nothing left, you become a prize that the one you lost to can do whatever they want with, this means both gamblers and dealers can end up as a prize, though if for whatever reason you dont become their prize, you get added to the list for someone else to enjoy. Becoming a prize means you also get 100 chips in compensation!
+ + Now hear this! The casino has decided that to spice things up, folks can bet themselves at any time and arent already a prize on the list! Doesnt matter if youre rich or broke, playing blackjack or roulette, you can bet yourself in any game and youre worth 250 chips! But be careful, cause if you lose, youre the winners prize! They can keep you, give you to someone else. or to the prize booth and get the chips you would have gotten as volunteer! But if given to the booth, the winner cant buy their prize back for the lower cost!

+ + ((Sour part again, but very important. These sentient prizes can be fun, but one thing always dictates how these things goes down, preferences and ooc wants. If preferences dont line up and people dont agree to do winner/loser scene it becomes sentient prize on list. And someone cant win a prize if the prize ooc doesnt want to do what the winner wants to do. We still wish people to try and reach out and try things with new people and/or new things they are comfortable doing, but never shall anyone be forced into a situation they dont want!)) + + + + "} \ No newline at end of file diff --git a/code/modules/casino/casino_cards.dm b/code/modules/casino/casino_cards.dm new file mode 100644 index 00000000000..9df021abbe8 --- /dev/null +++ b/code/modules/casino/casino_cards.dm @@ -0,0 +1,48 @@ + +//Original Casino Code created by Shadowfire117#1269 - Ported from CHOMPstation +//Modified by GhostActual#2055 for use with VOREstation + +/obj/item/weapon/deck/cards/casino/New() + var/datum/playingcard/casino/P + for(var/suit in list("spades","clubs","diamonds","hearts")) + + var/colour + if(suit == "spades" || suit == "clubs") + colour = "black_" + else + colour = "red_" + + for(var/number in list("ace","two","three","four","five","six","seven","eight","nine","ten")) + P = new() + P.name = "[number] of [suit]" + P.card_icon = "casino_[colour]num" + P.back_icon = "casino_card_back" + cards += P + + for(var/number in list("jack","queen","king")) + P = new() + P.name = "[number] of [suit]" + P.card_icon = "casino_[colour]col" + P.back_icon = "casino_card_back" + cards += P + +/datum/playingcard/casino + name = "playing card" + card_icon = "card_back" + back_icon = "card_back" + +/obj/item/weapon/deck/casino + w_class = ITEMSIZE_SMALL + icon = 'icons/obj/playing_cards.dmi' + +/obj/item/weapon/deck/holder/casino //WIP In future do a cool holder + name = "card box" + desc = "A small leather case to show how classy you are compared to everyone else." + icon = 'icons/obj/playing_cards.dmi' + icon_state = "card_holder" + +/obj/item/weapon/deck/cards/casino + name = "deck of casino cards" + desc = "A deck of playing cards from the golden goose casino, comes without a joker card!" + icon = 'icons/obj/playing_cards.dmi' + icon_state = "casino_deck" \ No newline at end of file diff --git a/code/modules/casino/casino_prize_vendor.dm b/code/modules/casino/casino_prize_vendor.dm new file mode 100644 index 00000000000..0672170d8f2 --- /dev/null +++ b/code/modules/casino/casino_prize_vendor.dm @@ -0,0 +1,305 @@ + +//Original Casino Code created by Shadowfire117#1269 - Ported from CHOMPstation +//Modified by GhostActual#2055 for use with VOREstation + +// Use this define to register a prize! +// * n - The proper name of the purchasable +// * o - The object type path of the purchasable to spawn +// * r - The amount to dispense +// * p - The price of the purchasable in chips +// * l - The restriction of the item +#define CASINO_PRIZE(n, o, r, p, l) n = new /datum/data/casino_prize(n, o, r, p, l) + +/datum/data/casino_prize + var/equipment_path = null + var/equipment_amt = 1 + var/cost = 0 + var/category = null + var/restriction = null + +/datum/data/casino_prize/New(name, path, amt, cost, restriction) + src.name = name + src.equipment_path = path + src.equipment_amt = amt + src.cost = cost + src.category = category + src.restriction = restriction + +/obj/machinery/casino_prize_dispenser + name = "Casino Prize Exchanger" + desc = "Exchange your chips to obtain wonderful prizes! Hoepfully you'll get to keep some of them for a while." + icon = 'icons/obj/casino.dmi' + icon_state ="casino_prize_dispenser" + var/icon_vend ="casino_prize_dispenser-vend" + anchored = 1 + density = 1 + opacity = 0 + var/list/item_list + + clicksound = "button" + var/vending_sound = "machines/vending/vending_drop.ogg" + + // Power + use_power = USE_POWER_IDLE + idle_power_usage = 10 + var/vend_power_usage = 150 //actuators and stuff + + // Vending-related + var/datum/data/casino_prize/currently_vending = null // What we're requesting payment for right now + var/list/log = list() //Log only SS13 staff is allowed to look at, CKEYS are listed here for record keeping of prizes and players for events! + + var/category_weapons = 1 //For listing categories, if false then prizes of this categories cant be obtained nor bought for post-shift enjoyment + var/category_gear = 1 //If 1 prizes will be only logged + var/category_clothing = 1 //If 2 prizes will both be logged and spawned + var/category_misc = 1 + var/category_drinks = 1 + var/category_implants = 1 + var/category_event = 1 //For special events, holidays, etc + +/obj/machinery/casino_prize_dispenser/Initialize() + . = ..() + power_change() + + item_list = list() + item_list["Weapons"] = list( + CASINO_PRIZE("Scepter", /obj/item/weapon/scepter, 1, 500, "weapons"), + CASINO_PRIZE("Chain of Command", /obj/item/weapon/melee/chainofcommand, 1, 250, "weapons"), + CASINO_PRIZE("Size Gun", /obj/item/weapon/gun/energy/sizegun, 1, 100, "weapons"), + CASINO_PRIZE("Advanced Particle Rifle", /obj/item/weapon/gun/energy/particle/advanced, 1, 500, "weapons"), + CASINO_PRIZE("Temperature Gun", /obj/item/weapon/gun/energy/temperature, 1, 250, "weapons"), + CASINO_PRIZE("Alien Pistol", /obj/item/weapon/gun/energy/alien, 1, 1000, "weapons"), + CASINO_PRIZE("Floral Gun", /obj/item/weapon/gun/energy/floragun, 1, 250, "weapons"), + CASINO_PRIZE("Net Gun", /obj/item/weapon/gun/energy/netgun, 1, 500, "weapons"), + ) + item_list["Gear"] = list( + CASINO_PRIZE("Experimental Welder", /obj/item/weapon/weldingtool/experimental, 1, 500, "gear"), + CASINO_PRIZE("Chameleon Tie", /obj/item/clothing/accessory/chameleon, 1, 250, "gear"), + CASINO_PRIZE("Chemsprayer", /obj/item/weapon/reagent_containers/spray/chemsprayer, 1, 250, "gear"), + CASINO_PRIZE("Bluespace Beaker", /obj/item/weapon/reagent_containers/glass/beaker/bluespace, 1, 200, "gear"), + CASINO_PRIZE("Cryo Beaker", /obj/item/weapon/reagent_containers/glass/beaker/noreact, 1, 200, "gear"), + ) + item_list["Clothing"] = list( + CASINO_PRIZE("Shark mask", /obj/item/clothing/mask/shark, 1, 50, "clothing"), + CASINO_PRIZE("Pig mask", /obj/item/clothing/mask/pig, 1, 50, "clothing"), + CASINO_PRIZE("Luchador mask", /obj/item/clothing/mask/luchador, 1, 50, "clothing"), + CASINO_PRIZE("Horse mask", /obj/item/clothing/mask/horsehead, 1, 50, "clothing"), + CASINO_PRIZE("Goblin mask", /obj/item/clothing/mask/goblin, 1, 50, "clothing"), + CASINO_PRIZE("Fake moustache", /obj/item/clothing/mask/fakemoustache, 1, 50, "clothing"), + CASINO_PRIZE("Dolphin mask", /obj/item/clothing/mask/dolphin, 1, 50, "clothing"), + CASINO_PRIZE("Demon mask", /obj/item/clothing/mask/demon, 1, 50, "clothing"), + CASINO_PRIZE("Chameleon mask", /obj/item/clothing/under/chameleon, 1, 250, "clothing"), + CASINO_PRIZE("Ian costume", /obj/item/clothing/suit/storage/hooded/ian_costume, 1, 50, "clothing"), + CASINO_PRIZE("Carp costume", /obj/item/clothing/suit/storage/hooded/carp_costume, 1, 50, "clothing"), + ) + item_list["Miscellaneous"] = list( + CASINO_PRIZE("Toy sword", /obj/item/toy/sword, 1, 50, "misc"), + CASINO_PRIZE("Waterflower", /obj/item/weapon/reagent_containers/spray/waterflower, 1, 50, "misc"), + CASINO_PRIZE("Horse stick", /obj/item/toy/stickhorse, 1, 50, "misc"), + CASINO_PRIZE("Katana", /obj/item/toy/katana, 1, 50, "misc"), + CASINO_PRIZE("Conch", /obj/item/toy/eight_ball/conch, 1, 50, "misc"), + CASINO_PRIZE("Eight ball", /obj/item/toy/eight_ball, 1, 50, "misc"), + CASINO_PRIZE("Foam sword", /obj/item/weapon/material/sword/foam, 1, 50, "misc"), + CASINO_PRIZE("Whistle", /obj/item/toy/bosunwhistle, 1, 50, "misc"), + CASINO_PRIZE("Golden cup", /obj/item/weapon/reagent_containers/food/drinks/golden_cup, 1, 50, "misc"), + CASINO_PRIZE("Quality cigars", /obj/item/weapon/storage/fancy/cigar/havana, 1, 50, "misc"), + CASINO_PRIZE("Casino wallet (kept after event)", /obj/item/weapon/storage/wallet/casino, 1, 50, "misc"), + CASINO_PRIZE("Casino cards", /obj/item/weapon/deck/cards/casino, 1, 50, "misc"), + ) + item_list["Drinks"] = list( + CASINO_PRIZE("Redeemer's brew", /obj/item/weapon/reagent_containers/food/drinks/bottle/redeemersbrew, 1, 50, "drinks"), + CASINO_PRIZE("Poison wine", /obj/item/weapon/reagent_containers/food/drinks/bottle/pwine, 1, 50, "drinks"), + CASINO_PRIZE("Patron", /obj/item/weapon/reagent_containers/food/drinks/bottle/patron, 1, 50, "drinks"), + CASINO_PRIZE("Holy water", /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, 1, 50, "drinks"), + CASINO_PRIZE("Goldschlager", /obj/item/weapon/reagent_containers/food/drinks/bottle/goldschlager, 1, 50, "drinks"), + CASINO_PRIZE("Champagne", /obj/item/weapon/reagent_containers/food/drinks/bottle/champagne, 1, 50, "drinks"), + CASINO_PRIZE("Bottle of Nothing", /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing, 1, 50, "drinks"), + CASINO_PRIZE("Whiskey bliss", /obj/item/weapon/reagent_containers/food/drinks/bottle/specialwhiskey, 1, 50, "drinks"), + ) + + item_list["Implants"] = list( + CASINO_PRIZE("Implanter (Remember to get one unless you want to borrow from station!)", /obj/item/weapon/implanter, 1, 100, "implants"), + CASINO_PRIZE("Implant: Tazer", /obj/item/weapon/implantcase/taser, 1, 1000, "implants"), + CASINO_PRIZE("Implant: Medkit", /obj/item/weapon/implantcase/medkit, 1, 500, "implants"), + CASINO_PRIZE("Implant: Shades", /obj/item/weapon/implantcase/shades, 1, 750, "implants"), + CASINO_PRIZE("Implant: Sprinter", /obj/item/weapon/implantcase/sprinter, 1, 1500, "implants"), + CASINO_PRIZE("Implant: Toolkit", /obj/item/weapon/implantcase/toolkit, 1, 500, "implants"), + CASINO_PRIZE("Implant: Language", /obj/item/weapon/implantcase/vrlanguage, 1, 1000, "implants"), + CASINO_PRIZE("Implant: Analyzer", /obj/item/weapon/implantcase/analyzer, 1, 500, "implants"), + CASINO_PRIZE("Implant: Size control", /obj/item/weapon/implant/sizecontrol , 1, 500, "implants"), + ) + + item_list["Event"] = list( + ) + +/obj/machinery/casino_prize_dispenser/power_change() + ..() + if(stat & BROKEN) + icon_state = "[initial(icon_state)]-broken" + else + if(!(stat & NOPOWER)) + icon_state = initial(icon_state) + else + spawn(rand(0, 15)) + icon_state = "[initial(icon_state)]-off" + +/obj/machinery/casino_prize_dispenser/attack_hand(mob/user as mob) + if(stat & (BROKEN|NOPOWER)) + return + tgui_interact(user) + +/obj/machinery/casino_prize_dispenser/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(currently_vending) + if(istype(W, /obj/item/weapon/spacecasinocash)) + to_chat(usr, "Please select prize on display with sufficient amount of chips.") + else + SStgui.update_uis(src) + return // don't smack that machine with your 2 chips + + if(istype(W, /obj/item/weapon/spacecasinocash)) + attack_hand(user) + return + ..() + +/obj/machinery/casino_prize_dispenser/proc/pay_with_chips(var/obj/item/weapon/spacecasinocash/cashmoney, mob/user, var/price) + //"cashmoney_:[cashmoney] user:[user] currently_vending:[currently_vending]" + if(price > cashmoney.worth) + to_chat(usr, "\icon[cashmoney] That is not enough chips.") + return 0 + + if(istype(cashmoney, /obj/item/weapon/spacecasinocash)) + visible_message("\The [usr] inserts some chips into \the [src].") + cashmoney.worth -= price + + if(cashmoney.worth <= 0) + usr.drop_from_inventory(cashmoney) + qdel(cashmoney) + else + cashmoney.update_icon() + return 1 + +/obj/machinery/casino_prize_dispenser/ui_assets(mob/user) + return list( + get_asset_datum(/datum/asset/spritesheet/vending), + ) + +/obj/machinery/casino_prize_dispenser/tgui_data(mob/user) + var/list/data[0] + + data["items"] = list() + for(var/cat in item_list) + var/list/cat_items = list() + for(var/prize_name in item_list[cat]) + var/datum/data/casino_prize/prize = item_list[cat][prize_name] + cat_items[prize_name] = list("name" = prize_name, "price" = prize.cost, "restriction" = prize.restriction) + data["items"][cat] = cat_items + return data + +/obj/machinery/casino_prize_dispenser/tgui_interact(mob/user, datum/tgui/ui = null) + // Open the window + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "CasinoPrizeDispenser", name) + ui.open() + +/obj/machinery/casino_prize_dispenser/tgui_act(action, params) + if(stat & (BROKEN|NOPOWER)) + return + if(usr.stat || usr.restrained()) + return + if(..()) + return TRUE + . = TRUE + switch(action) + if("purchase") + var/paid = FALSE + var/category = params["cat"] + var/restriction_category = params["restriction"] + var/restriction_check = 0 + var/item_given = FALSE + var/name = params["name"] + var/price = params["price"] + var/datum/data/casino_prize/bi = item_list[category][name] + switch(restriction_category) + if("weapons") + restriction_check = category_weapons + if("gear") + restriction_check = category_gear + if("clothing") + restriction_check = category_clothing + if("misc") + restriction_check = category_misc + if("drinks") + restriction_check = category_drinks + if("implants") + restriction_check = category_implants + if("event") + restriction_check = category_event + else + to_chat(usr, "Prize checkout error has occured, purchase cancelled.") + return FALSE + + if(restriction_check < 1) + to_chat(usr, "[name] is restricted, this prize can't be bought.") + return FALSE + if(restriction_check > 1) + item_given = TRUE + + if(price <= 0 && item_given == TRUE) + vend(bi, usr) + return TRUE + + currently_vending = bi + + if(istype(usr.get_active_hand(), /obj/item/weapon/spacecasinocash)) + var/obj/item/weapon/spacecasinocash/cash = usr.get_active_hand() + paid = pay_with_chips(cash, usr, price) + else + to_chat(usr, "Payment failure: Improper payment method, please provide chips.") + return TRUE // we set this because they shouldn't even be able to get this far, and we want the UI to update. + if(paid) + if(item_given == TRUE) + vend(bi, usr) + + speak("Thank you for your purchase, your [bi] has been logged.") + do_logging(currently_vending, usr, bi) + . = TRUE + else + to_chat(usr, "Payment failure: unable to process payment.") + +/obj/machinery/casino_prize_dispenser/proc/vend(datum/data/casino_prize/bi, mob/user) + SStgui.update_uis(src) + + if(ispath(bi.equipment_path, /obj/item/stack)) + var/obj/item/stack/S = new bi.equipment_path(loc) + S.amount = bi.equipment_amt + playsound(src, 'sound/machines/vending/vending_drop.ogg', 100, 1) + return TRUE + + for(var/i in 1 to bi.equipment_amt) + new bi.equipment_path(loc) + playsound(src, 'sound/machines/vending/vending_drop.ogg', 100, 1) + + currently_vending = null + use_power(vend_power_usage) //actuators and stuff + flick("[icon_state]-vend",src) + + +/obj/machinery/casino_prize_dispenser/proc/do_logging(item, mob/user, datum/data/casino_prize/bi) + var/prize_log = "{ckey:[user.ckey]character_name:[user.name]item_path: [bi.equipment_path]}" + log[++log.len] = prize_log + //Currently doesnt have an ingame way to show. Can only be viewed through View-Variables, to ensure theres no chance of players ckeys exposed - Jack + +/obj/machinery/casino_prize_dispenser/proc/speak(var/message) + if(stat & NOPOWER) + return + + if(!message) + return + + for(var/mob/O in hearers(src, null)) + O.show_message("\The [src] beeps, \"[message]\"",2) + return + +/obj/machinery/casino_prize_dispenser/process() //Might not need this, but just to be safe for now + if(stat & (BROKEN|NOPOWER)) + return \ No newline at end of file diff --git a/code/modules/casino/premium_dispenser.dm b/code/modules/casino/premium_dispenser.dm new file mode 100644 index 00000000000..91b4833d6ef --- /dev/null +++ b/code/modules/casino/premium_dispenser.dm @@ -0,0 +1,69 @@ + +//Original Casino Code created by Shadowfire117#1269 - Ported from CHOMPstation +//Modified by GhostActual#2055 for use with VOREstation + +/obj/machinery/chemical_dispenser/premium + name = "premium drink dispensary" + desc = "A specialty dispenser unit designed with Bluespace Technology." + icon = 'icons/obj/casino.dmi' + icon_state = "premiumdispenser" + ui_title = "Premium Drink Dispensary" + accept_drinking = 1 + var/max_cartridges = 90 + +/obj/machinery/chemical_dispenser/premium/full + spawn_cartridges = list( + /obj/item/weapon/reagent_containers/chem_disp_cartridge/lemon_lime, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/sugar, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/orange, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/lime, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/sodawater, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/tonic, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/beer, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/kahlua, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/whiskey, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/redwine, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/whitewine, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/vodka, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/gin, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/rum, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/tequila, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/vermouth, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/cognac, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/cider, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/ale, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/mead, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/water, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/ice, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/coffee, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/cream, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/tea, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/icetea, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/cola, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/smw, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/dr_gibb, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/spaceup, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/tonic, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/sodawater, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/lemon_lime, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/sugar, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/orange, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/lime, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/watermelon, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/lemon, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/coffee, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/cafe_latte, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/soy_latte, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/hot_coco, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/milk, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/cream, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/tea, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/ice, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/mint, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/orange, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/lemon, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/lime, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/berry, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/greentea, + /obj/item/weapon/reagent_containers/chem_disp_cartridge/decaf + ) \ No newline at end of file diff --git a/code/modules/casino/premium_vendors.dm b/code/modules/casino/premium_vendors.dm new file mode 100644 index 00000000000..81075857458 --- /dev/null +++ b/code/modules/casino/premium_vendors.dm @@ -0,0 +1,129 @@ + +//Original Casino Code created by Shadowfire117#1269 - Ported from CHOMPstation +//Modified by GhostActual#2055 for use with VOREstation + +// +//The code for Casino Vendors +//Devs Feel free to modify this to vend what you please +// + +/obj/machinery/vending/deluxe_boozeomat + name = "Premium Drink Distributor" + desc = "A top of the line drink vendor that carries some of the finest drinks." + icon = 'icons/obj/casino.dmi' + icon_state = "premiumbooze" + products = list(/obj/item/weapon/glass_extra/stick = 50, + /obj/item/weapon/glass_extra/straw = 50, + /obj/item/weapon/reagent_containers/food/drinks/glass2/square = 25, + /obj/item/weapon/reagent_containers/food/drinks/glass2/rocks = 25, + /obj/item/weapon/reagent_containers/food/drinks/glass2/shake = 25, + /obj/item/weapon/reagent_containers/food/drinks/glass2/cocktail = 25, + /obj/item/weapon/reagent_containers/food/drinks/glass2/shot = 25, + /obj/item/weapon/reagent_containers/food/drinks/glass2/pint = 25, + /obj/item/weapon/reagent_containers/food/drinks/glass2/mug = 25, + /obj/item/weapon/reagent_containers/food/drinks/glass2/wine = 25, + /obj/item/weapon/reagent_containers/food/drinks/glass2/carafe = 2, + /obj/item/weapon/reagent_containers/food/drinks/glass2/pitcher = 2, + /obj/item/weapon/reagent_containers/food/drinks/metaglass = 25, + /obj/item/weapon/reagent_containers/food/drinks/metaglass/metapint = 25, + /obj/item/weapon/reagent_containers/food/drinks/bottle/gin = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/absinthe = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/bluecuracao = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/cognac = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/grenadine = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/kahlua = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/melonliquor = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/rum = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/sake = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/specialwhiskey = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/tequilla = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/vermouth = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/vodka = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/wine = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/redeemersbrew = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/patron = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/goldschlager = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/champagne = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/small/ale = 15, + /obj/item/weapon/reagent_containers/food/drinks/bottle/small/ale/hushedwhisper = 15, + /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer = 15, + /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer/silverdragon = 15, + /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer/meteor = 15, + /obj/item/weapon/reagent_containers/food/drinks/bottle/small/litebeer = 15, + /obj/item/weapon/reagent_containers/food/drinks/bottle/small/cider = 15, + /obj/item/weapon/reagent_containers/food/drinks/cans/tonic = 50, + /obj/item/weapon/reagent_containers/food/drinks/cans/gingerale = 50, + /obj/item/weapon/reagent_containers/food/drinks/cans/sodawater = 50, + /obj/item/weapon/reagent_containers/food/drinks/tea = 50, + /obj/item/weapon/reagent_containers/food/drinks/bottle/cola = 15, + /obj/item/weapon/reagent_containers/food/drinks/bottle/space_up = 15, + /obj/item/weapon/reagent_containers/food/drinks/bottle/space_mountain_wind = 15, + /obj/item/weapon/reagent_containers/food/drinks/bottle/orangejuice = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/tomatojuice = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/limejuice = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/lemonjuice = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/applejuice = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/milk = 10, + /obj/item/weapon/reagent_containers/food/drinks/bottle/cream = 10, + /obj/item/weapon/reagent_containers/food/drinks/ice = 10 + ) + + contraband = list() + vend_delay = 15 + idle_power_usage = 211 //refrigerator - believe it or not, this is actually the average power consumption of a refrigerated vending machine according to NRCan. + req_access = list(access_bar) + req_log_access = access_bar + has_logs = 1 + vending_sound = "machines/vending/vending_cans.ogg" + +/obj/machinery/vending/deluxe_dinner + name = "Premium Dining Distributor" + desc = "A top of the line drink vendor that carries some of the finest foods in the frontier." + icon = 'icons/obj/casino.dmi' + icon_state = "premiumfood" + products = list(/obj/item/weapon/reagent_containers/food/snacks/bigbiteburger = 30, + /obj/item/weapon/reagent_containers/food/snacks/meatsteak = 30, + /obj/item/weapon/reagent_containers/food/snacks/fries = 30, + /obj/item/weapon/reagent_containers/food/snacks/onionrings = 30, + /obj/item/weapon/reagent_containers/food/snacks/cheeseburrito= 30, + /obj/item/weapon/reagent_containers/food/snacks/enchiladas= 30, + /obj/item/weapon/reagent_containers/food/snacks/meatburrito= 30, + /obj/item/weapon/reagent_containers/food/snacks/taco= 30, + /obj/item/weapon/reagent_containers/food/snacks/cheesenachos= 30, + /obj/item/weapon/reagent_containers/food/snacks/cubannachos= 30, + /obj/item/weapon/reagent_containers/food/snacks/stew= 20, + /obj/item/weapon/reagent_containers/food/snacks/roastbeef = 20, + /obj/item/weapon/reagent_containers/food/snacks/aesirsalad = 20, + /obj/item/weapon/reagent_containers/food/snacks/sliceable/sushi = 20, + /obj/item/weapon/reagent_containers/food/snacks/kitsuneudon = 20, + /obj/item/weapon/reagent_containers/food/snacks/baguette = 30, + /obj/item/weapon/reagent_containers/food/snacks/appletart = 30, + /obj/item/weapon/reagent_containers/food/snacks/muffin = 30, + /obj/item/weapon/reagent_containers/food/snacks/berrymuffin = 30, + /obj/item/weapon/reagent_containers/food/snacks/cherrypie = 30, + /obj/item/weapon/reagent_containers/food/snacks/croissant = 30, + /obj/item/weapon/reagent_containers/food/snacks/pie = 30, + /obj/item/weapon/reagent_containers/food/snacks/poppypretzel = 30, + /obj/item/weapon/reagent_containers/food/snacks/sugarcookie = 30, + /obj/item/weapon/reagent_containers/food/snacks/waffles = 30, + /obj/item/weapon/reagent_containers/food/snacks/sliceable/applecake = 2, + /obj/item/weapon/reagent_containers/food/snacks/sliceable/birthdaycake = 2, + /obj/item/weapon/reagent_containers/food/snacks/sliceable/carrotcake = 2, + /obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesecake = 2, + /obj/item/weapon/reagent_containers/food/snacks/sliceable/chocolatecake = 2, + /obj/item/weapon/reagent_containers/food/snacks/sliceable/lemoncake = 2, + /obj/item/weapon/reagent_containers/food/snacks/sliceable/limecake = 2, + /obj/item/weapon/reagent_containers/food/snacks/sliceable/orangecake = 2, + /obj/item/weapon/reagent_containers/food/snacks/sliceable/plaincake = 2 + ) + + contraband = list() + vend_delay = 15 + idle_power_usage = 211 //refrigerator - believe it or not, this is actually the average power consumption of a refrigerated vending machine according to NRCan. + req_access = list(access_bar) + req_log_access = access_bar + has_logs = 1 + vending_sound = "machines/vending/vending_cans.ogg" \ No newline at end of file diff --git a/code/modules/casino/slots.dm b/code/modules/casino/slots.dm new file mode 100644 index 00000000000..773c1d15e05 --- /dev/null +++ b/code/modules/casino/slots.dm @@ -0,0 +1,462 @@ + +//Original Casino Code created by Shadowfire117#1269 - Ported from CHOMPstation +//Modified by GhostActual#2055 for use with VOREstation + +/* + * Slot Machine + */ + +/obj/machinery/slot_machine + name = "slot machine" + desc = "A gambling machine designed to give you false hope and rob you of your wealth, hence why it's often called a one armed bandit." + icon = 'icons/obj/casino.dmi' + icon_state = "slotmachine" + anchored = 1 + density = 1 + power_channel = EQUIP + use_power = USE_POWER_IDLE + idle_power_usage = 10 + active_power_usage = 100 + light_power = 0.9 + light_range = 2 + light_color = "#B1FBBFF" + var/isbroken = 0 //1 if someone banged it with something heavy + var/ispowered = 1 //starts powered, changes with power_change() + var/busy = 0 + var/symbol1 = null + var/symbol2 = null + var/symbol3 = null + + var/datum/effect/effect/system/confetti_spread + var/confetti_strength = 8 + +/obj/machinery/slot_machine/update_icon() + cut_overlays() + if(!ispowered || isbroken) + icon_state = "slotmachine_off" + if(isbroken) //If the thing is smashed, add crack overlay on top of the unpowered sprite. + add_overlay("slotmachine_broken") + set_light(0) + set_light_on(FALSE) + return + + icon_state = "slotmachine" + set_light(2) + set_light_on(TRUE) + return + +/obj/machinery/slot_machine/power_change() + if(isbroken) //Broken shit can't be powered. + return + ..() + if(!(stat & NOPOWER)) + ispowered = 1 + update_icon() + else + spawn(rand(0, 15)) + ispowered = 0 + update_icon() + +/obj/machinery/slot_machine/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(busy) + to_chat(user,"The slot machine is currently running. ") + return + if(W.is_wrench()) + playsound(src, W.usesound, 100, 1) + if(anchored) + user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") + else + user.visible_message("[user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.") + + if(do_after(user, 20 * W.toolspeed)) + if(!src) return + to_chat(user, "You [anchored? "un" : ""]secured \the [src]!") + anchored = !anchored + return + + if(!anchored) + to_chat(user," The slot machine isn't secured.") + return + + var/handled = 0 + var/paid = 0 + + if(istype(W, /obj/item/weapon/spacecasinocash)) + var/obj/item/weapon/spacecasinocash/C = W + paid = insert_chip(C, user) + handled = 1 + + if(paid) + return + if(handled) + SStgui.update_uis(src) + return // don't smack that machine with your 2 chips + + else if(!(stat & NOPOWER)) + return + + else if(isbroken) + return + +/obj/machinery/slot_machine/proc/insert_chip(var/obj/item/weapon/spacecasinocash/cashmoney, mob/user) + if (ispowered == 0) + return + if (isbroken) + return + if (busy) + to_chat(user,"The slot machine is currently rolling. ") + return + if(cashmoney.worth < 5) + to_chat(user,"You dont have enough chips to gamble! ") + return + + to_chat(user,"You puts 5 credits in the slot machine and presses start.") + cashmoney.worth -= 5 + cashmoney.update_icon() + + if(cashmoney.worth <= 0) + usr.drop_from_inventory(cashmoney) + qdel(cashmoney) + cashmoney.update_icon() + + busy = 1 + icon_state = "slotmachine_rolling" + playsound(src.loc, 'sound/machines/slotmachine_pull.ogg', 15, 1) + + var/slot1 = rand(0,9) + switch(slot1) + if(0 to 3) symbol1 = "cherry" + if(4 to 4) symbol1 = "lemon" + if(5 to 5) symbol1 = "bell" + if(6 to 6) symbol1 = "four leaf clover" + if(7 to 7) symbol1 = "seven" + if(8 to 8) symbol1 = "diamond" + if(9 to 9) symbol1 = "platinum coin" + + var/slot2 = rand(0,16) + switch(slot2) + if(0 to 5) symbol2 = "cherry" + if(6 to 7) symbol2 = "lemon" + if(8 to 9) symbol2 = "bell" + if(10 to 11) symbol2 = "four leaf clover" + if(12 to 13) symbol2 = "seven" + if(14 to 15) symbol2 = "diamond" + if(16) symbol2 = "platinum coin" + + var/slot3 = rand(0,9) + switch(slot3) + if(0 to 3) symbol3 = "cherry" + if(4 to 4) symbol3 = "lemon" + if(5 to 5) symbol3 = "bell" + if(6 to 6) symbol3 = "four leaf clover" + if(7 to 7) symbol3 = "seven" + if(8 to 8) symbol3 = "diamond" + if(9 to 9) symbol3 = "platinum coin" + + var/output //Output variable to send out in chat after the large if statement. + var/winnings = 0 //How much money will be given if any. + var/platinumwin = 0 // If you win the platinum chip or not + var/celebrate = 0 + var/delaytime = 5 SECONDS + + + spawn(delaytime) + to_chat(user,"The slot machine flashes with bright colours as the slots lights up with a [symbol1], a [symbol2] and a [symbol3]!") + + if (symbol1 == "cherry" && symbol2 == "cherry" && symbol3 == "cherry") + output = "Three cherries! The slot machine deposits chips worth 25 credits!" + winnings = 25 + + if ((symbol1 != "cherry" && symbol2 == "cherry" && symbol3 == "cherry") || (symbol1 == "cherry" && symbol2 != "cherry" && symbol3 == "cherry") ||(symbol1 == "cherry" && symbol2 == "cherry" && symbol3 != "cherry")) + output = "Two cherries! The slot machine deposits a 10 credit chip!" + winnings = 10 + + if (symbol1 == "lemon" && symbol2 == "lemon" && symbol3 == "lemon") + output = "Three lemons! The slot machine deposits a 50 credit chip!" + winnings = 50 + + if (symbol1 == "watermelon" && symbol2 == "watermelon" && symbol3 == "watermelon") + output = "Three watermelons! The slot machine deposits chips worth 75 credits!" + winnings = 75 + + if (symbol1 == "bell" && symbol2 == "bell" && symbol3 == "bell") + output = "Three bells! The slot machine deposits chips a 100 credit chip!" + winnings = 100 + + if (symbol1 == "four leaf clover" && symbol2 == "four leaf clover" && symbol3 == "four leaf clover") + output = "Three four leaf clovers! The slot machine deposits a 200 credit chip!" + winnings = 200 + + if (symbol1 == "seven" && symbol2 == "seven" && symbol3 == "seven") + output = "Three sevens! The slot machine deposits a 500 credit chip!" + winnings = 500 + celebrate = 1 + + if (symbol1 == "diamond" && symbol2 == "diamond" && symbol3 == "diamond") + output = "Three diamonds! The slot machine deposits a 1000 credit chip!" + winnings = 1000 + celebrate = 1 + + if (symbol1 == "platinum coin" && symbol2 == "platinum coin" && symbol3 == "platinum coin") + output = "Three platinum coins! The slot machine deposits a platinum chip!" + platinumwin = TRUE; + celebrate = 1 + + icon_state = initial(icon_state) // Set it back to the original iconstate. + + if(!output) // Is there anything to output? If not, consider it a loss. + to_chat(user,"Better luck next time!") + busy = FALSE + return + + to_chat(user,output) //Output message + + if(platinumwin) // Did they win the platinum chip? + new /obj/item/weapon/casino_platinum_chip(src.loc) + playsound(src.loc, 'sound/machines/slotmachine.ogg', 25, 1) + + if(winnings) //Did the person win? + icon_state = "slotmachine_winning" + playsound(src.loc, 'sound/machines/slotmachine.ogg', 25, 1) + spawn(delaytime) + spawn_casinochips(winnings, src.loc) + icon_state = "slotmachine" + + if(celebrate) // Happy celebrations! + src.confetti_spread = new /datum/effect/effect/system/confetti_spread() + src.confetti_spread.attach(src) //If somehow people start dragging slot machine + spawn(0) + for(var/i = 1 to confetti_strength) + src.confetti_spread.start() + sleep(10) + + busy = FALSE + +/* + * Station Slot Machine (takes space cash instead of chips) + */ + +/obj/machinery/station_slot_machine + name = "station slot machine" + desc = "A gambling machine owned by NanoTrasen, designed to take Thalers as opposed to casino chips." + icon = 'icons/obj/casino.dmi' + icon_state = "ntslotmachine" + anchored = 1 + density = 1 + power_channel = EQUIP + use_power = USE_POWER_IDLE + idle_power_usage = 10 + active_power_usage = 100 + light_power = 0.9 + light_range = 2 + light_color = "#B1FBBFF" + var/isbroken = 0 //1 if someone banged it with something heavy + var/ispowered = 1 //starts powered, changes with power_change() + var/busy = 0 + var/symbol1 = null + var/symbol2 = null + var/symbol3 = null + + var/datum/effect/effect/system/confetti_spread + var/confetti_strength = 8 + +/obj/machinery/station_slot_machine/update_icon() + cut_overlays() + if(!ispowered || isbroken) + icon_state = "ntslotmachine_off" + if(isbroken) //If the thing is smashed, add crack overlay on top of the unpowered sprite. + add_overlay("ntslotmachine_broken") + set_light(0) + set_light_on(FALSE) + return + + icon_state = "ntslotmachine" + set_light(2) + set_light_on(TRUE) + return + +/obj/machinery/station_slot_machine/power_change() + if(isbroken) //Broken shit can't be powered. + return + ..() + if(!(stat & NOPOWER)) + ispowered = 1 + update_icon() + else + spawn(rand(0, 15)) + ispowered = 0 + update_icon() + +/obj/machinery/station_slot_machine/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(busy) + to_chat(user,"The slot machine is currently running. ") + return + if(W.is_wrench()) + playsound(src, W.usesound, 100, 1) + if(anchored) + user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.") + else + user.visible_message("[user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.") + + if(do_after(user, 20 * W.toolspeed)) + if(!src) return + to_chat(user, "You [anchored? "un" : ""]secured \the [src]!") + anchored = !anchored + return + + if(!anchored) + to_chat(user," The slot machine isn't secured.") + return + + var/handled = 0 + var/paid = 0 + + if(istype(W, /obj/item/weapon/spacecash)) + var/obj/item/weapon/spacecash/C = W + paid = insert_cash(C, user) + handled = 1 + if(paid) + return + if(handled) + SStgui.update_uis(src) + return // don't smack that machine with your 2 chips + + else if(!(stat & NOPOWER)) + return + + else if(isbroken) + return + +/obj/machinery/station_slot_machine/proc/insert_cash(var/obj/item/weapon/spacecash/cashmoney, mob/user) + if (ispowered == 0) + return + if (isbroken) + return + if (busy) + to_chat(user,"The slot machine is currently rolling. ") + return + if(cashmoney.worth < 5) + to_chat(user,"You dont have enough Thalers to gamble! ") + return + + to_chat(user,"You puts 5 Thalers in the slot machine and presses start.") + cashmoney.worth -= 5 + cashmoney.update_icon() + + if(cashmoney.worth <= 0) + usr.drop_from_inventory(cashmoney) + qdel(cashmoney) + cashmoney.update_icon() + + busy = 1 + icon_state = "ntslotmachine_rolling" + playsound(src.loc, 'sound/machines/slotmachine_pull.ogg', 15, 1) + + var/slot1 = rand(0,9) + switch(slot1) + if(0 to 3) symbol1 = "cherry" + if(4 to 4) symbol1 = "lemon" + if(5 to 5) symbol1 = "bell" + if(6 to 6) symbol1 = "four leaf clover" + if(7 to 7) symbol1 = "seven" + if(8 to 8) symbol1 = "diamond" + if(9 to 9) symbol1 = "platinum coin" + + var/slot2 = rand(0,16) + switch(slot2) + if(0 to 5) symbol2 = "cherry" + if(6 to 7) symbol2 = "lemon" + if(8 to 9) symbol2 = "bell" + if(10 to 11) symbol2 = "four leaf clover" + if(12 to 13) symbol2 = "seven" + if(14 to 15) symbol2 = "diamond" + if(16) symbol2 = "platinum coin" + + var/slot3 = rand(0,9) + switch(slot3) + if(0 to 3) symbol3 = "cherry" + if(4 to 4) symbol3 = "lemon" + if(5 to 5) symbol3 = "bell" + if(6 to 6) symbol3 = "four leaf clover" + if(7 to 7) symbol3 = "seven" + if(8 to 8) symbol3 = "diamond" + if(9 to 9) symbol3 = "platinum coin" + + var/output //Output variable to send out in chat after the large if statement. + var/winnings = 0 //How much money will be given if any. + var/platinumwin = 0 // If you win the platinum chip or not + var/celebrate = 0 + var/delaytime = 5 SECONDS + + + spawn(delaytime) + to_chat(user,"The slot machine flashes with bright colours as the slots lights up with a [symbol1], a [symbol2] and a [symbol3]!") + + if (symbol1 == "cherry" && symbol2 == "cherry" && symbol3 == "cherry") + output = "Three cherries! The slot machine deposits 25 Thalers!" + winnings = 25 + + if ((symbol1 != "cherry" && symbol2 == "cherry" && symbol3 == "cherry") || (symbol1 == "cherry" && symbol2 != "cherry" && symbol3 == "cherry") ||(symbol1 == "cherry" && symbol2 == "cherry" && symbol3 != "cherry")) + output = "Two cherries! The slot machine deposits 10 Thalers!" + winnings = 10 + + if (symbol1 == "lemon" && symbol2 == "lemon" && symbol3 == "lemon") + output = "Three lemons! The slot machine deposits 50 Thalers!" + winnings = 50 + + if (symbol1 == "watermelon" && symbol2 == "watermelon" && symbol3 == "watermelon") + output = "Three watermelons! The slot machine deposits 75 Thalers!" + winnings = 75 + + if (symbol1 == "bell" && symbol2 == "bell" && symbol3 == "bell") + output = "Three bells! The slot machine deposits 100 Thalers!" + winnings = 100 + + if (symbol1 == "four leaf clover" && symbol2 == "four leaf clover" && symbol3 == "four leaf clover") + output = "Three four leaf clovers! The slot machine deposits 200 Thalers!" + winnings = 200 + + if (symbol1 == "seven" && symbol2 == "seven" && symbol3 == "seven") + output = "Three sevens! The slot machine deposits 500 Thalers!" + winnings = 500 + celebrate = 1 + + if (symbol1 == "diamond" && symbol2 == "diamond" && symbol3 == "diamond") + output = "Three diamonds! The slot machine deposits 1000 Thalers!" + winnings = 1000 + celebrate = 1 + + if (symbol1 == "platinum coin" && symbol2 == "platinum coin" && symbol3 == "platinum coin") + output = "Three platinum coins! The slot machine deposits a platinum chip!" + platinumwin = TRUE; + celebrate = 1 + + icon_state = initial(icon_state) // Set it back to the original iconstate. + + if(!output) // Is there anything to output? If not, consider it a loss. + to_chat(user,"Better luck next time!") + busy = FALSE + return + + to_chat(user,output) //Output message + + if(platinumwin) // Did they win the platinum chip? + new /obj/item/weapon/casino_platinum_chip(src.loc) + playsound(src.loc, 'sound/machines/slotmachine.ogg', 25, 1) + + if(winnings) //Did the person win? + icon_state = "ntslotmachine_winning" + playsound(src.loc, 'sound/machines/slotmachine.ogg', 25, 1) + spawn(delaytime) + spawn_money(winnings, src.loc) + icon_state = "ntslotmachine" + + if(celebrate) // Happy celebrations! + src.confetti_spread = new /datum/effect/effect/system/confetti_spread() + src.confetti_spread.attach(src) //If somehow people start dragging slot machine + spawn(0) + for(var/i = 1 to confetti_strength) + src.confetti_spread.start() + sleep(10) + + busy = FALSE diff --git a/code/modules/clothing/under/accessories/accessory_vr.dm b/code/modules/clothing/under/accessories/accessory_vr.dm index a35580499db..1a4c93eb678 100644 --- a/code/modules/clothing/under/accessories/accessory_vr.dm +++ b/code/modules/clothing/under/accessories/accessory_vr.dm @@ -374,4 +374,31 @@ icon_override = 'icons/inventory/accessory/mob_vr.dmi' icon_state = "talon_pin" item_state = "talonpin" - overlay_state = "talonpin" \ No newline at end of file + overlay_state = "talonpin" + +//Casino Slave Collar + +/obj/item/clothing/accessory/collar/casinoslave + name = "a disabled Sentient Prize Collar" + desc = "A collar worn by sentient prizes registered to a SPASM. Although the red text on it shows its disconnected and nonfunctional." + + icon_state = "casinoslave" + item_state = "casinoslave" + overlay_state = "casinoslave" + + var/slavename = null //Name for system to put on collar description + var/ownername = null //Name for system to put on collar description + var/slaveckey = null //Ckey for system to check who is the person and ensure no abuse of system or errors + var/slaveflavor = null //Description to show on the SPASM + var/slaveooc = null //OOC text to show on the SPASM + +/obj/item/clothing/accessory/collar/casinoslave/attack_self(mob/user as mob) + //keeping it blank so people don't tag and reset collar status + +/obj/item/clothing/accessory/collar/casinoslave_fake + name = "a Sentient Prize Collar" + desc = "A collar worn by sentient prizes registered to a SPASM. This one has been disconnected from the system and is now an accessory!" + + icon_state = "casinoslave_owned" + item_state = "casinoslave_owned" + overlay_state = "casinoslave_owned" \ No newline at end of file diff --git a/code/modules/economy/casinocash.dm b/code/modules/economy/casinocash.dm new file mode 100644 index 00000000000..25486c33f83 --- /dev/null +++ b/code/modules/economy/casinocash.dm @@ -0,0 +1,207 @@ + +//Original Casino Code created by Shadowfire117#1269 - Ported from CHOMPstation +//Modified by GhostActual#2055 for use with VOREstation + +/obj/machinery/chipmachine + name = "Casino Chip Exchange" + desc = "Takes all your cash and gives you chips back! No change and half refund!" + icon = 'icons/obj/casino.dmi' + icon_state ="chipmachine" + anchored = 1 + +/obj/machinery/chipmachine/attackby(obj/item/I as obj, mob/user as mob) + if(istype(I,/obj/item/weapon/spacecash)) + //consume the money + if(prob(50)) + playsound(loc, 'sound/items/polaroid1.ogg', 50, 1) + else + playsound(loc, 'sound/items/polaroid2.ogg', 50, 1) + + user << "You insert [I] into [src]." + spawn_casinochips(round(I:worth/5), src.loc) + src.attack_hand(user) + qdel(I) + + if(istype(I,/obj/item/weapon/spacecasinocash)) + //consume the chips + if(prob(50)) + playsound(loc, 'sound/items/polaroid1.ogg', 50, 1) + else + playsound(loc, 'sound/items/polaroid2.ogg', 50, 1) + + user << "You insert [I] into [src]." + spawn_money(round(I:worth/5), src.loc) + src.attack_hand(user) + qdel(I) + +/obj/item/weapon/spacecasinocash + name = "broken casino chip" + desc = "It's worth nothing in a casino." + gender = PLURAL + icon = 'icons/obj/casino.dmi' + icon_state = "spacecasinocash1" + opacity = 0 + density = 0 + anchored = 0.0 + force = 1.0 + throwforce = 1.0 + throw_speed = 1 + throw_range = 2 + w_class = ITEMSIZE_SMALL + var/access = list() + access = access_crate_cash + var/worth = 0 + +/obj/item/weapon/spacecasinocash/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/spacecasinocash)) + + var/obj/item/weapon/spacecasinocash/SC = W + + SC.adjust_worth(src.worth) + if(istype(user, /mob/living/carbon/human)) + var/mob/living/carbon/human/h_user = user + + h_user.drop_from_inventory(src) + h_user.drop_from_inventory(SC) + h_user.put_in_hands(SC) + user << "You combine the casino chips to a stack of [SC.worth] of credits." + qdel(src) + +/obj/item/weapon/spacecasinocash/update_icon() + overlays.Cut() + name = "[worth] casino credit\s" + if(worth in list(1000,500,200,100,50,20,10,1)) + icon_state = "spacecasinocash[worth]" + desc = "It's a stack of casino chips with a combined value of [worth] credits." + return + var/sum = src.worth + var/num = 0 + for(var/i in list(1000,500,200,100,50,20,10,1)) + while(sum >= i && num < 50) + sum -= i + num++ + var/image/banknote = image('icons/obj/casino.dmi', "spacecasinocash[i]") + var/matrix/M = matrix() + M.Translate(rand(-6, 6), rand(-4, 8)) + M.Turn(pick(-45, -27.5, 0, 0, 0, 0, 0, 0, 0, 27.5, 45)) + banknote.transform = M + src.overlays += banknote + if(num == 0) // Less than one credit, let's just make it look like 1 for ease + var/image/banknote = image('icons/obj/casino.dmi', "spacecasinocash1") + var/matrix/M = matrix() + M.Translate(rand(-6, 6), rand(-4, 8)) + M.Turn(pick(-45, -27.5, 0, 0, 0, 0, 0, 0, 0, 27.5, 45)) + banknote.transform = M + src.overlays += banknote + src.desc = "They are worth [worth] of credits." + +/obj/item/weapon/spacecasinocash/proc/adjust_worth(var/adjust_worth = 0, var/update = 1) + worth += adjust_worth + if(worth > 0) + if(update) + update_icon() + return worth + else + qdel(src) + return 0 + +/obj/item/weapon/spacecasinocash/proc/set_worth(var/new_worth = 0, var/update = 1) + worth = max(0, new_worth) + if(update) + update_icon() + return worth + +/obj/item/weapon/spacecasinocash/attack_self() + var/amount = input(usr, "How much credits worth of chips do you want to take? (0 to [src.worth])", "Take chips", 20) as num + if(!src || QDELETED(src)) + return + amount = round(CLAMP(amount, 0, src.worth)) + + if(!amount) + return + + adjust_worth(-amount) + var/obj/item/weapon/spacecasinocash/SC = new (usr.loc) + SC.set_worth(amount) + usr.put_in_hands(SC) + +/obj/item/weapon/spacecasinocash/c1 + name = "1 credit casino chip" + icon_state = "spacecasinocash1" + desc = "It's worth 1 credit." + worth = 1 + +/obj/item/weapon/spacecasinocash/c10 + name = "10 credit casino chip" + icon_state = "spacecasinocash10" + desc = "It's worth 10 credits." + worth = 10 + +/obj/item/weapon/spacecasinocash/c20 + name = "20 credit casino chip" + icon_state = "spacecasinocash20" + desc = "It's worth 20 credits." + worth = 20 + +/obj/item/weapon/spacecasinocash/c50 + name = "50 credit casino chip" + icon_state = "spacecasinocash50" + desc = "It's worth 50 credits." + worth = 50 + +/obj/item/weapon/spacecasinocash/c100 + name = "100 credit casino chip" + icon_state = "spacecasinocash100" + desc = "It's worth 100 credits." + worth = 100 + +/obj/item/weapon/spacecasinocash/c200 + name = "200 credit casino chip" + icon_state = "spacecasinocash200" + desc = "It's worth 200 credits." + worth = 200 + +/obj/item/weapon/spacecasinocash/c500 + name = "500 credit casino chip" + icon_state = "spacecasinocash500" + desc = "It's worth 500 credits." + worth = 500 + +/obj/item/weapon/spacecasinocash/c1000 + name = "1000 credit casino chip" + icon_state = "spacecasinocash1000" + desc = "It's worth 1000 credits." + worth = 1000 + +/proc/spawn_casinochips(var/sum, spawnloc, mob/living/carbon/human/human_user as mob) + var/obj/item/weapon/spacecasinocash/SC = new (spawnloc) + + SC.set_worth(sum) + if (ishuman(human_user) && !human_user.get_active_hand()) + human_user.put_in_hands(SC) + return + +/obj/item/weapon/casino_platinum_chip + name = "platinum chip" + desc = "Ringa-a-Ding-Ding!" + icon = 'icons/obj/casino.dmi' + icon_state = "platinum_chip" + var/sides = 2 + opacity = 0 + density = 0 + anchored = 0.0 + force = 1.0 + throwforce = 1.0 + throw_speed = 1 + throw_range = 2 + w_class = ITEMSIZE_SMALL + +/obj/item/weapon/casino_platinum_chip/attack_self(mob/user as mob) + var/result = rand(1, sides) + var/comment = "" + if(result == 1) + comment = "Ace" + else if(result == 2) + comment = "Joker" + user.visible_message("[user] has thrown \the [src]. It lands on [comment]! ", \ + "You throw \the [src]. It lands on [comment]! ") \ No newline at end of file diff --git a/icons/inventory/accessory/item_vr.dmi b/icons/inventory/accessory/item_vr.dmi index fdb86086483..f4b317aba94 100644 Binary files a/icons/inventory/accessory/item_vr.dmi and b/icons/inventory/accessory/item_vr.dmi differ diff --git a/icons/inventory/accessory/mob_vr.dmi b/icons/inventory/accessory/mob_vr.dmi index c5e7908d711..834ba6f831b 100644 Binary files a/icons/inventory/accessory/mob_vr.dmi and b/icons/inventory/accessory/mob_vr.dmi differ diff --git a/icons/inventory/accessory/mob_vr_teshari.dmi b/icons/inventory/accessory/mob_vr_teshari.dmi index fce61f2bb89..45e62b93258 100644 Binary files a/icons/inventory/accessory/mob_vr_teshari.dmi and b/icons/inventory/accessory/mob_vr_teshari.dmi differ diff --git a/icons/obj/64x64.dmi b/icons/obj/64x64.dmi new file mode 100644 index 00000000000..db555529a7e Binary files /dev/null and b/icons/obj/64x64.dmi differ diff --git a/icons/obj/casino.dmi b/icons/obj/casino.dmi new file mode 100644 index 00000000000..17405361e24 Binary files /dev/null and b/icons/obj/casino.dmi differ diff --git a/icons/obj/computer.dmi b/icons/obj/computer.dmi index 1c73e51f3fe..5b58a84313f 100644 Binary files a/icons/obj/computer.dmi and b/icons/obj/computer.dmi differ diff --git a/icons/obj/playing_cards.dmi b/icons/obj/playing_cards.dmi index 04239be49d3..04e7af96fea 100644 Binary files a/icons/obj/playing_cards.dmi and b/icons/obj/playing_cards.dmi differ diff --git a/icons/obj/salvageable.dmi b/icons/obj/salvageable.dmi index ea2004324aa..f2e0aaed20f 100644 Binary files a/icons/obj/salvageable.dmi and b/icons/obj/salvageable.dmi differ diff --git a/maps/tether/tether-01-surface1.dmm b/maps/tether/tether-01-surface1.dmm index ee8a16e6adb..76a66b19ab3 100644 --- a/maps/tether/tether-01-surface1.dmm +++ b/maps/tether/tether-01-surface1.dmm @@ -33125,6 +33125,13 @@ }, /turf/simulated/floor/tiled, /area/tether/surfacebase/lowernorthhall) +"gQH" = ( +/obj/structure/grille, +/obj/structure/window/reinforced/full, +/obj/machinery/door/firedoor, +/obj/structure/window/reinforced, +/turf/simulated/floor/plating, +/area/crew_quarters/visitor_laundry) "gVe" = ( /obj/effect/floor_decal/borderfloor{ dir = 4 @@ -39200,11 +39207,11 @@ aah aah yiS aHo +aHL +aHL aad -aad -aad -aad -aad +aHL +aHL aad aad aad @@ -39342,13 +39349,13 @@ aah aah yiS aah +aHL aad aad +aHL aad aad -aad -aad -aad +aHL aad aad aad @@ -39484,7 +39491,7 @@ aah aah yiS aah -aad +aHL aad aad aad @@ -39628,10 +39635,10 @@ yiS aah aah aad +aHL aad aad -aad -aad +aHL aad aad aad @@ -39772,8 +39779,8 @@ aah aad aad aad -aad -aad +aHL +aHL aad aad aad @@ -39917,7 +39924,7 @@ aad aad aad aad -aad +aHL aad aad aad @@ -40055,11 +40062,11 @@ aah baU baU aad +aHL aad aad aad -aad -aad +aHL aad aHL aad @@ -40199,7 +40206,7 @@ baU aad aad aad -aad +aHL aad aad aad @@ -40486,7 +40493,7 @@ aad aad aad aad -aad +aHL aad aad aad @@ -40625,7 +40632,7 @@ baU aad aad aad -aad +aHL aad aad aad @@ -54990,7 +54997,7 @@ rnt aUP aUP sch -aWn +gQH baU baU baU diff --git a/maps/tether/tether_areas.dm b/maps/tether/tether_areas.dm index b7458caaf46..cf1774eb9ad 100644 --- a/maps/tether/tether_areas.dm +++ b/maps/tether/tether_areas.dm @@ -215,6 +215,9 @@ /area/tether/surfacebase/barbackmaintenance name = "\improper Bar Back Maintenance" icon_state = "red" +/area/tether/surfacebase/arcade + name = "\improper Arcade" + icon_state = "green" /area/tether/surfacebase/public_garden_lg name = "\improper Public Garden Looking Glass" diff --git a/sound/machines/clawmachine_play.ogg b/sound/machines/clawmachine_play.ogg new file mode 100644 index 00000000000..2f72abfbe0b Binary files /dev/null and b/sound/machines/clawmachine_play.ogg differ diff --git a/sound/machines/clawmachine_win.ogg b/sound/machines/clawmachine_win.ogg new file mode 100644 index 00000000000..3a2269e03cf Binary files /dev/null and b/sound/machines/clawmachine_win.ogg differ diff --git a/sound/machines/roulette.ogg b/sound/machines/roulette.ogg new file mode 100644 index 00000000000..2a80d802990 Binary files /dev/null and b/sound/machines/roulette.ogg differ diff --git a/sound/machines/slotmachine.ogg b/sound/machines/slotmachine.ogg new file mode 100644 index 00000000000..366d9857215 Binary files /dev/null and b/sound/machines/slotmachine.ogg differ diff --git a/sound/machines/slotmachine_pull.ogg b/sound/machines/slotmachine_pull.ogg new file mode 100644 index 00000000000..d97a815bf80 Binary files /dev/null and b/sound/machines/slotmachine_pull.ogg differ diff --git a/tgui/packages/tgui/interfaces/CasinoPrizeDispenser.js b/tgui/packages/tgui/interfaces/CasinoPrizeDispenser.js new file mode 100644 index 00000000000..12f2838faf0 --- /dev/null +++ b/tgui/packages/tgui/interfaces/CasinoPrizeDispenser.js @@ -0,0 +1,180 @@ +import { createSearch } from 'common/string'; +import { Fragment } from 'inferno'; +import { useBackend, useLocalState } from "../backend"; +import { Box, Button, Collapsible, Dropdown, Flex, Input, NoticeBox, Section } from '../components'; +import { Window } from "../layouts"; +import { refocusLayout } from '../layouts'; +import { logger } from '../logging'; + +const sortTypes = { + 'Alphabetical': (a, b) => a - b, + 'By availability': (a, b) => -(a.affordable - b.affordable), + 'By price': (a, b) => a.price - b.price, +}; + +export const CasinoPrizeDispenser = (props, context) => { + const { act, data } = useBackend(context); + return ( + + + + + + + + + ); +}; + +const CasinoPrizeDispenserSearch = (props, context) => { + const [ + _searchText, + setSearchText, + ] = useLocalState(context, 'search', ''); + const [ + _sortOrder, + setSortOrder, + ] = useLocalState(context, 'sort', ''); + const [ + descending, + setDescending, + ] = useLocalState(context, 'descending', false); + return ( + + + + setSearchText(value)} + /> + + + setSortOrder(v)} /> + + +