diff --git a/code/modules/urist/datums/supplycrates.dm b/code/modules/urist/datums/supplycrates.dm index e7442c10d19..bdb33f63cdb 100644 --- a/code/modules/urist/datums/supplycrates.dm +++ b/code/modules/urist/datums/supplycrates.dm @@ -201,3 +201,10 @@ Please keep it tidy, by which I mean put comments describing the item before the newcargocost = 15 //675th on Nerva containertype = /obj/structure/closet/crate/secure containername = "yew wooden flooring crate" + +/singleton/hierarchy/supply_pack/supply/lottovendor + name = "Vendor - Games - Lordania Lottery" + contains = list(/obj/machinery/vending/urist/lotto{anchored = FALSE}) + cost = 100 + containertype = /obj/structure/largecrate + containername = "\improper Vending Machine" diff --git a/code/modules/urist/items/vgitems.dm b/code/modules/urist/items/vgitems.dm index 1f8b782cec5..5846a78d5b5 100644 --- a/code/modules/urist/items/vgitems.dm +++ b/code/modules/urist/items/vgitems.dm @@ -80,3 +80,73 @@ w_class = ITEM_SIZE_SMALL obj_flags = OBJ_FLAG_CONDUCTIBLE insultmsg = list("HONK!", "HELP, SHITCURITY!", "HELP MAINT", "SHITSEC", "I AM IN A CONSTANT STATE OF SUFFERING, EACH EON SPENT ON THIS PLANE OF EXISTENCE ECHOES ONLY PURE PAIN TO MY MORTAL COIL. GOD HAS DIED, AND HE HAS ONLY LEFT ME SUFFERING. ", "MY FUNNY BONE!") + +//lottery scratchers - west3436 of /vg/station13 +/obj/item/toy/lotto_ticket + name = "scratch-off lotto ticket" + desc = "A scratch-off lotto ticket." + icon = 'icons/urist/items/tgitems.dmi' //i see no reason to change this + w_class = ITEM_SIZE_TINY + var/revealed = FALSE + var/prize_multiplier + var/winnings = 0 + var/list/prizelist = list(100000,50000,10000,5000,1000,500,250,100,50,20,10,5,4,3,2,1) + var/list/problist = list(0.0001, 0.0002, 0.001, 0.002, 0.01, 0.02, 0.04, 0.2, 1, 2.5, 5, 10, 12.5, 17, 20, 25) + +/obj/item/toy/lotto_ticket/Initialize() + ..() + pixel_y = rand(-8, 8) * PIXEL_MULTIPLIER + pixel_x = rand(-9, 9) * PIXEL_MULTIPLIER + +/obj/item/toy/lotto_ticket/proc/scratch(var/input_prize_multiplier) + var/tuning_value = 1/5 //Used to adjust expected values. + var/profit = 0 + for(var/prize = 1 to problist.len) + if(prob(problist[prize])) + profit = prizelist[prize]*input_prize_multiplier*tuning_value + return profit + +/obj/item/toy/lotto_ticket/attackby(obj/item/S, mob/user) + if(revealed) + to_chat(user, SPAN_NOTICE("The film covering the prizes has already been scratched off.")) + return + + if(!is_sharp(S) && !istype(S, /obj/item/material/coin)) + to_chat(user, SPAN_NOTICE("You need to use something sharp to scratch the ticket.")) + return + + if(do_after(user, src, 1 SECONDS)) + src.revealed = TRUE + src.update_icon() + to_chat(user, SPAN_NOTICE("You scratch off the film covering the prizes.")) + winnings = scratch(prize_multiplier) + + +/obj/item/toy/lotto_ticket/examine(mob/user) + . = ..() + if(revealed && winnings) + to_chat(user, SPAN_NOTICE("This one is a winner! You've won [winnings] thalers.")) + +/obj/item/toy/lotto_ticket/on_update_icon() + icon_state = initial(icon_state) + (revealed ? "_scratched" : "") + +//Tier 1 card +/obj/item/toy/lotto_ticket/gold_rush + name = "Gold Rush lottery ticket" + desc = "A cheap scratch-off lottery ticket. Win up to 100,000 credits!" + icon_state = "lotto_1" + prize_multiplier = 5 //EV 4.55, ER -0.45 + +//Tier 2 card +/obj/item/toy/lotto_ticket/diamond_hands + name = "Diamond Hands lottery ticket" + desc = "A mid-price scratch-off lottery ticket. Win up to 400,000 credits!" + icon_state = "lotto_2" + prize_multiplier = 20 //EV 18.20, ER -1.80 + +//Tier 3 card +/obj/item/toy/lotto_ticket/phoron_fortune + name = "Phoron Fortune lottery ticket" + desc = "An expensive scratch-off lottery ticket. Win up to 1,000,000 credits!" + icon_state = "lotto_3" + prize_multiplier = 50 //EV 45.50, ER -4.50 diff --git a/code/modules/urist/machinery/uristvending.dm b/code/modules/urist/machinery/uristvending.dm index 554a87da318..13609b575cf 100644 --- a/code/modules/urist/machinery/uristvending.dm +++ b/code/modules/urist/machinery/uristvending.dm @@ -216,3 +216,55 @@ Please keep it tidy, by which I mean put comments describing the item before the products = list( /obj/item/device/assembly/prox_sensor = 5, /obj/item/device/assembly/signaler = 4, /obj/item/device/assembly/infra = 4, /obj/item/device/assembly/prox_sensor = 4, /obj/item/handcuffs = 8, /obj/item/device/flash = 4, /obj/item/clothing/glasses/sunglasses = 4) + +//lottery scratchers - west3436 of /vg/station13 +/obj/machinery/vending/urist/lotto + name = "\improper Lordania Lottery" + desc = "A table-mounted machine which prints proprietary scratch-off lottery tickets. Winners can be cashed here by reinserting the winning ticket." + product_slogans = list( + "Feeling lucky?", + "Money won is twice as sweet as money earned.", + "The greatest risk is not taking one." + ) + product_ads = list( + "Quit while you're ahead. All the best gamblers do.", + "If there weren't luck involved, you would win every time.", + "Better an ounce of luck than a pound of gold.", + "Behind bad luck comes good luck." + ) + vend_reply = "Good luck!" + icon_state = "Lotto" + products = list( + /obj/item/toy/lotto_ticket/gold_rush = 50, + /obj/item/toy/lotto_ticket/diamond_hands = 20, + /obj/item/toy/lotto_ticket/phoron_fortune = 10 + ) + prices = list( + /obj/item/toy/lotto_ticket/gold_rush = 10, + /obj/item/toy/lotto_ticket/diamond_hands = 25, + /obj/item/toy/lotto_ticket/phoron_fortune = 50, + ) + +/obj/machinery/vending/lotto/attackby(obj/item/I, user) + add_fingerprint(user) + if(istype(I, /obj/item/toy/lotto_ticket)) + var/obj/item/toy/lotto_ticket/T = I + if(!T.winnings) + playsound(src, "buzz-sigh", 50, 1) + visible_message("[src]'s monitor flashes, \"This ticket is not a winning ticket.\"") + else + visible_message("[src]'s monitor flashes, \"Withdrawing [T.winnings] thalers from the Lordania Planetary Lottery Fund!\"") + spawn_money(T.winnings, get_turf(src)) + playsound(loc, 'sound/items/polaroid1.ogg', 50, 1) + qdel(T) + else + ..() + +/obj/machinery/vending/lotto/throw_item() + var/mob/living/target = locate() in view(7, src) + + if (!target) + return 0 + for(var/i = 0 to rand(3,12)) + var/obj/I = new /obj/item/paper(get_turf(src)) + I.throw_at(target, 16, 3) diff --git a/icons/urist/items/tgitems.dmi b/icons/urist/items/tgitems.dmi index 34fea6c07cf..a4271c2606a 100644 Binary files a/icons/urist/items/tgitems.dmi and b/icons/urist/items/tgitems.dmi differ diff --git a/icons/urist/structures&machinery/machinery.dmi b/icons/urist/structures&machinery/machinery.dmi index be57d6c1545..91e4d78fce4 100644 Binary files a/icons/urist/structures&machinery/machinery.dmi and b/icons/urist/structures&machinery/machinery.dmi differ diff --git a/maps/nerva/nerva-2.dmm b/maps/nerva/nerva-2.dmm index 5d877bc8035..100f9d42f79 100644 --- a/maps/nerva/nerva-2.dmm +++ b/maps/nerva/nerva-2.dmm @@ -13501,6 +13501,7 @@ dir = 4 }, /obj/structure/table/woodentable_reinforced/walnut, +/obj/machinery/vending/urist/lotto, /turf/simulated/floor/wood/walnut, /area/civilian/bar) "axr" = (