mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 00:58:26 +01:00
## About The Pull Request Cleans up the code a little: experiments are now somewhat modular and are handled by datums, which simplifies adding new ones and maintaining the current ones <img width="862" height="472" alt="image" src="https://github.com/user-attachments/assets/632ab475-a4d5-4be5-a3fd-096695281b55" /> <br> <br> The E.X.P.E.R.I-MENTOR now has proper wires that can be pulsed to trigger various E.X.P.E.R.I-ments! <br> <br> <img width="524" height="328" alt="image" src="https://github.com/user-attachments/assets/0fd7558b-579f-498a-b9f7-f382b9f5e6c0" /> ## Why It's Good For The Game Allows for more robust automation and more cool science stuff
44 lines
927 B
Plaintext
44 lines
927 B
Plaintext
/datum/wires/rnd
|
|
holder_type = /obj/machinery/rnd
|
|
proper_name = "R&D Machinery"
|
|
randomize = TRUE
|
|
|
|
/datum/wires/rnd/New(atom/holder)
|
|
wires = list(
|
|
WIRE_HACK, WIRE_DISABLE,
|
|
WIRE_SHOCK
|
|
)
|
|
add_duds(5)
|
|
..()
|
|
|
|
/datum/wires/rnd/interactable(mob/user)
|
|
if(!..())
|
|
return FALSE
|
|
var/obj/machinery/rnd/R = holder
|
|
if(R.panel_open)
|
|
return TRUE
|
|
|
|
/datum/wires/rnd/get_status()
|
|
var/obj/machinery/rnd/R = holder
|
|
var/list/status = list()
|
|
status += "The red light is [R.disabled ? "off" : "on"]."
|
|
status += "The blue light is [R.hacked ? "off" : "on"]."
|
|
return status
|
|
|
|
/datum/wires/rnd/on_pulse(wire)
|
|
set waitfor = FALSE
|
|
var/obj/machinery/rnd/R = holder
|
|
switch(wire)
|
|
if(WIRE_HACK)
|
|
R.hacked = !R.hacked
|
|
if(WIRE_DISABLE)
|
|
R.disabled = !R.disabled
|
|
|
|
/datum/wires/rnd/on_cut(wire, mend, source)
|
|
var/obj/machinery/rnd/R = holder
|
|
switch(wire)
|
|
if(WIRE_HACK)
|
|
R.hacked = !mend
|
|
if(WIRE_DISABLE)
|
|
R.disabled = !mend
|