Skip to content

Commit

Permalink
Transfers cashing-in functionality to the vendor itself and depoists …
Browse files Browse the repository at this point in the history
…large sums directly into your account.
  • Loading branch information
west3436 committed Feb 10, 2022
1 parent e829406 commit 3fb8798
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
7 changes: 0 additions & 7 deletions code/game/machinery/computer/cargo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,6 @@ For vending packs, see vending_packs.dm*/
A.anchored = 1
src.transfer_fingerprints_to(A)
qdel(src)
if(istype(I, /obj/item/toy/lotto_ticket))
var/obj/item/toy/lotto_ticket/T = I
for(var/mob/V in hearers(src))
V.show_message("<b>[src]</b>'s monitor flashes, \"Withdrawing [T.winnings] credits from the Lottery account!\"")
dispense_cash(T.winnings, get_turf(src))
playsound(src, "polaroid", 50, 1)
qdel(T)
else
return ..()

Expand Down
27 changes: 26 additions & 1 deletion code/game/machinery/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3739,4 +3739,29 @@ var/global/num_vending_terminals = 1
/obj/item/toy/lotto_ticket/supermatter_surprise = 100
)

pack = /obj/structure/vendomatpack/lotto
pack = /obj/structure/vendomatpack/lotto

/obj/machinery/vending/lotto/attackby(obj/item/I as obj, user as mob)
add_fingerprint(user)
if(istype(I, /obj/item/toy/lotto_ticket))
var/obj/item/toy/lotto_ticket/T = I
if(!T.iswinner)
playsound(src, "buzz-sigh", 50, 1)
for(var/mob/V in hearers(src))
V.visible_message("<b>[src]</b>'s monitor flashes, \"This ticket is not a winning ticket.\"")
return
else
if(T.winnings <= 10000)
for(var/mob/V in hearers(src))
V.visible_message("<b>[src]</b>'s monitor flashes, \"Withdrawing [T.winnings] credits from the Central Command Lottery Fund!\"")
dispense_cash(T.winnings, get_turf(src))
playsound(src, "polaroid", 50, 1)
else
var/mob/living/carbon/human/H = user
var/account_num = H?.mind?.initial_account?.account_number
var/datum/money_account/account = get_money_account_global(account_num)
account.money += T.winnings
playsound(src, "ping", 50, 1)
for(var/mob/V in hearers(src))
V.visible_message("<b>[src]</b>'s monitor flashes, \"Withdrawing [T.winnings] credits from the Central Command Lottery Fund into your account!\"")
qdel(T)

0 comments on commit 3fb8798

Please sign in to comment.