mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-10 23:54:14 +01:00
4fe16acd0b
## About The Pull Request `shock` was copy pasted across a bunch of base types I needed the behavior unified and it was fairly trivial to do So now we have `/obj/proc/shock` which all the old implementations call ## Changelog 🆑 Melbert refactor: Made some minor changes to how things like airlocks, vendors, and autolathes shock you. Report any wierdness with that /🆑
73 lines
1.9 KiB
Plaintext
73 lines
1.9 KiB
Plaintext
/datum/wires/roulette
|
|
holder_type = /obj/machinery/roulette
|
|
proper_name = "Roulette Table"
|
|
randomize = TRUE
|
|
|
|
/datum/wires/roulette/New(atom/holder)
|
|
wires = list(
|
|
WIRE_RESETOWNER,
|
|
WIRE_PRIZEVEND,
|
|
WIRE_SHOCK,
|
|
WIRE_BOLTS
|
|
)
|
|
..()
|
|
|
|
/datum/wires/roulette/interactable(mob/user)
|
|
if(!..())
|
|
return FALSE
|
|
. = FALSE
|
|
var/obj/machinery/roulette/R = holder
|
|
if(R.machine_stat & MAINT)
|
|
. = TRUE
|
|
|
|
/datum/wires/roulette/get_status()
|
|
var/obj/machinery/roulette/R = holder
|
|
var/list/status = list()
|
|
status += "The machines bolts [R.anchored ? "have engaged!" : "have disengaged."]"
|
|
status += "The main circuit is [R.on ? "on" : "off"]."
|
|
status += "The main system lock appears to be [R.locked ? "on" : "off"]."
|
|
status += "The account balance system appears to be [R.my_card ? "connected to [R.my_card.registered_account.account_holder]" : "disconnected"]."
|
|
return status
|
|
|
|
/datum/wires/roulette/on_pulse(wire)
|
|
var/obj/machinery/roulette/R = holder
|
|
switch(wire)
|
|
if(WIRE_SHOCK)
|
|
R.shock(usr, 50)
|
|
if(WIRE_BOLTS) // Pulse to toggle bolts (but only raise if power is on).
|
|
if(!R.on)
|
|
return
|
|
R.set_anchored(!R.anchored)
|
|
if(WIRE_RESETOWNER)
|
|
R.my_card = null
|
|
R.audible_message(span_warning("Owner reset!"))
|
|
R.locked = FALSE
|
|
if(WIRE_PRIZEVEND)
|
|
R.shock(usr, 70)
|
|
if(R.locked)
|
|
return
|
|
R.audible_message(span_warning("Unauthorized prize vend detected! Locking down machine!"))
|
|
R.prize_theft(0.20)
|
|
|
|
/datum/wires/roulette/on_cut(wire, mend, source)
|
|
var/obj/machinery/roulette/R = holder
|
|
switch(wire)
|
|
if(WIRE_SHOCK)
|
|
R.shock(usr, 60)
|
|
if(mend)
|
|
R.on = TRUE
|
|
else
|
|
R.on = FALSE
|
|
if(WIRE_BOLTS) // Always drop
|
|
if(!R.on)
|
|
return
|
|
R.set_anchored(TRUE)
|
|
if(WIRE_RESETOWNER)
|
|
R.shock(usr, 70)
|
|
if(WIRE_PRIZEVEND)
|
|
R.shock(usr, 75)
|
|
if(R.locked)
|
|
return
|
|
R.audible_message(span_warning("Unauthorized prize vend detected! Locking down machine!"))
|
|
R.prize_theft(0.10)
|