mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-01 13:12:23 +00:00
* Get pants that match or else you gonna look silly yo
* Posters
* Fix other hud elements
* Rereviewed
* Update shotglass.dm
* Fix for new merged PRs
* Typo
* Coming across other stuff
* Update theblob.dm
* No takebacksies
* smh i forget to leave a comment
* Updated for the detgun and cards
* Should have rerun langserver again
* No longer plastic, more in scope
* Damn you bluespace
* Reverting turret logic, out of scope at this point
* Tweak that part
* Went over energy guns again, and fixed UI White's sprite sheet
* Welding masks, glasses, and JUSTICE
* Update portable_atmospherics.dm
* Cleaning up, clearing things up
* Review and suggestions
* Update valve.dm
* More tweaks
* Missing character
* Not distinct lightmasks, so they can be overlays
* Update generator.dm
* Add parameter so holodeck doesn't try to make a perfect copy
* Update unsorted.dm
* Spiders
* Better fix for spiders, fix vamps too
* Ghosts
* Update telekinesis.dm
* Cleaning up old procs
* It's set up to not copy datums... Unless they're in a list
* Donuts, duct tape, and detgun. D3VR coming to Early Access
* Update procs that interact with doors so they call update_state instead
* Forgot one spot, and actually might as well just force lock
* Cleaning up other things... Sigh, and kitty ears
* oops
* Getting used to how it works
* blinds
* Going back to the suit obscuring thing, so it doesn't update all the time
* Missed that from merging master
* I made this PR and forgot about it
* Fix runtimes in cards
* Make things a bit more unified
* Update update_icons.dm
* yarn, really?
* Update library_equipment.dm
* Update shieldgen.dm
* Every time Charlie merges something, I go back and see if I can improve things further
* what's this? more?
* Update misc_special.dm
* wow, paper
* Review
* More reviews
* To be sure, seems like being broken messed something sometimes
* Brought airlocks closer to how TG works to iron out some stuff
* Pizza and morgue
* Doesn't seem to hurt, tried with holodeck
* Revert "Doesn't seem to hurt, tried with holodeck"
This reverts commit 158529302b.
* Icon conflict
* Fix organ damage
* Don't ask how. Why. It's like that on prod too.
* Cutting down on things and updating from TG.
* More flexible. Just in case the thing you stuck it on didn't destroy.
* Hydro was one the things I touched earlier on, better rework it
* Reviews
* Cleaning up further, also bri'ish
* Undo a change I did, and switch over to a more recent implementation
* Update biogenerator.dm
* Rolling back to old airlocks, but with new duct taped note
* Functionally the same. I'd just rather not have the smoothing happen there
* Went over APCs again
* Fix welding helmet names in species files
* Update airlock.dm
* Update persistent_overlay.dm
* Oh, topic
147 lines
4.7 KiB
Plaintext
147 lines
4.7 KiB
Plaintext
|
|
/obj/machinery/arcade
|
|
name = "Arcade Game"
|
|
desc = "One of the most generic arcade games ever."
|
|
icon = 'icons/obj/arcade.dmi'
|
|
icon_state = "clawmachine_on"
|
|
density = TRUE
|
|
anchored = TRUE
|
|
use_power = IDLE_POWER_USE
|
|
idle_power_usage = 40
|
|
var/tokens = 0
|
|
var/freeplay = FALSE //for debugging and admin kindness
|
|
var/token_price = 0
|
|
var/last_winner = null //for letting people who to hunt down and steal prizes from
|
|
var/window_name = "arcade" //in case you want to change the window name for certain machines
|
|
|
|
/obj/machinery/arcade/Initialize(mapload)
|
|
. = ..()
|
|
if(type == /obj/machinery/arcade) //if you spawn the base-type, it will replace itself with a random subtype for randomness
|
|
var/choice = pick(subtypesof(/obj/machinery/arcade))
|
|
new choice(loc)
|
|
return INITIALIZE_HINT_QDEL
|
|
|
|
/obj/machinery/arcade/examine(mob/user)
|
|
. = ..()
|
|
if(freeplay)
|
|
. += "Someone enabled freeplay on this machine!"
|
|
else
|
|
if(token_price)
|
|
. += "\The [src.name] costs [token_price] credits per play."
|
|
if(!tokens)
|
|
. += "\The [src.name] has no available play credits. Better feed the machine!"
|
|
else if(tokens == 1)
|
|
. += "\The [src.name] has only 1 play credit left!"
|
|
else
|
|
. += "\The [src.name] has [tokens] play credits!"
|
|
|
|
/obj/machinery/arcade/attack_hand(mob/user as mob)
|
|
if(..())
|
|
if(in_use && src == user.machine) //this one checks if they fell down/died and closes the game
|
|
src.close_game()
|
|
return
|
|
if(in_use && src == user.machine) //this one just checks if they are playing so it doesn't eat tokens
|
|
return
|
|
interact(user)
|
|
|
|
/obj/machinery/arcade/interact(mob/user as mob)
|
|
if(stat & BROKEN || panel_open)
|
|
return
|
|
if(!tokens && !freeplay)
|
|
to_chat(user, "\The [src.name] doesn't have enough credits to play! Pay first!")
|
|
return
|
|
if(!in_use && (tokens || freeplay))
|
|
in_use = 1
|
|
start_play(user)
|
|
return
|
|
if(in_use)
|
|
if(src != user.machine)
|
|
to_chat(user, "Someone else is already playing this machine, please wait your turn!")
|
|
return
|
|
|
|
/obj/machinery/arcade/attackby(obj/item/O, mob/user, params)
|
|
if(exchange_parts(user, O))
|
|
return
|
|
if(!freeplay)
|
|
if(istype(O, /obj/item/card/id))
|
|
var/obj/item/card/id/C = O
|
|
if(pay_with_card(C))
|
|
tokens += 1
|
|
return
|
|
else if(istype(O, /obj/item/stack/spacecash))
|
|
var/obj/item/stack/spacecash/C = O
|
|
if(pay_with_cash(C, user))
|
|
tokens += 1
|
|
return
|
|
return ..()
|
|
|
|
/obj/machinery/arcade/screwdriver_act(mob/living/user, obj/item/I)
|
|
if(!anchored)
|
|
return FALSE
|
|
default_deconstruction_screwdriver(user, icon_state, icon_state, I)
|
|
update_icon()
|
|
return TRUE
|
|
|
|
/obj/machinery/arcade/crowbar_act(mob/living/user, obj/item/I)
|
|
if(!component_parts || !panel_open)
|
|
return FALSE
|
|
default_deconstruction_crowbar(user, I)
|
|
return TRUE
|
|
|
|
/obj/machinery/arcade/proc/pay_with_cash(obj/item/stack/spacecash/cashmoney, mob/user)
|
|
if(cashmoney.amount < token_price)
|
|
to_chat(user, "[bicon(cashmoney)] <span class='warning'>That is not enough money.</span>")
|
|
return 0
|
|
visible_message("<span class='info'>[usr] inserts a credit chip into [src].</span>")
|
|
cashmoney.use(token_price)
|
|
return 1
|
|
|
|
/obj/machinery/arcade/proc/pay_with_card(obj/item/card/id/I, mob/user)
|
|
visible_message("<span class='info'>[usr] swipes a card through [src].</span>")
|
|
var/datum/money_account/customer_account = attempt_account_access_nosec(I.associated_account_number)
|
|
if(!customer_account)
|
|
to_chat(user, "Error: Unable to access account. Please contact technical support if problem persists.")
|
|
return 0
|
|
|
|
if(customer_account.suspended)
|
|
to_chat(user, "Unable to access account: account suspended.")
|
|
return 0
|
|
|
|
// Have the customer punch in the PIN before checking if there's enough money. Prevents people from figuring out acct is
|
|
// empty at high security levels
|
|
if(customer_account.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
|
|
var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
|
|
customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2)
|
|
|
|
if(!customer_account)
|
|
to_chat(user, "Unable to access account: incorrect credentials.")
|
|
return 0
|
|
|
|
return customer_account.charge(token_price, null, "Purchase of [name] credit", name, name)
|
|
|
|
/obj/machinery/arcade/proc/start_play(mob/user as mob)
|
|
user.set_machine(src)
|
|
if(!freeplay)
|
|
tokens -= 1
|
|
|
|
/obj/machinery/arcade/proc/close_game()
|
|
in_use = 0
|
|
for(var/mob/user in viewers(world.view, src)) // I don't know who you are.
|
|
if(user.client && user.machine == src) // I will look for you,
|
|
user.unset_machine() // I will find you,
|
|
user << browse(null, "window=[window_name]") // And I will kill you.
|
|
return
|
|
|
|
/obj/machinery/arcade/proc/win()
|
|
return
|
|
|
|
/obj/machinery/arcade/process()
|
|
if(in_use)
|
|
src.updateUsrDialog()
|
|
if(!in_use)
|
|
src.close_game()
|
|
|
|
/obj/machinery/arcade/Destroy()
|
|
src.close_game()
|
|
return ..()
|