mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-18 11:30:35 +01:00
4ecb0bc21c
Repaths obj/machinery to obj/structure/machinery. **Note for reviewers:** the only meaningful changed code exists within **code/game/objects/structures.dm** and **code/game/objects/structures/_machinery.dm**, largely concerning damage procs. With the exception of moving airlock defines to their own file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES. Objects, _categorically_, are largely divided between those you can hold in your hand/inventory and those you can't. Machinery objects are already subtypes of Structures behaviorally, this PR just makes their pathing reflect that, and allows for future work (tool actions, more health/destruction functionality) to be developed without unnecessary code duplication. I have tested this PR by loading up the Horizon and dismantling various machines and structures with tools, shooting guns of various types throughout the ship, and detonating a bunch of explosions throughout the ship.
74 lines
1.7 KiB
Plaintext
74 lines
1.7 KiB
Plaintext
/datum/wires/smartfridge
|
|
proper_name = "SmartFridge"
|
|
holder_type = /obj/structure/machinery/smartfridge
|
|
|
|
/datum/wires/smartfridge/New()
|
|
wires = list(
|
|
WIRE_THROW,
|
|
WIRE_SHOCK,
|
|
WIRE_IDSCAN,
|
|
WIRE_COOLING,
|
|
WIRE_HEATING
|
|
)
|
|
add_duds(1)
|
|
..()
|
|
|
|
/datum/wires/smartfridge/secure
|
|
random = 1
|
|
|
|
/datum/wires/smartfridge/interactable(mob/user)
|
|
if(!..())
|
|
return FALSE
|
|
var/obj/structure/machinery/smartfridge/S = holder
|
|
if(S.panel_open)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/datum/wires/smartfridge/get_status()
|
|
var/obj/structure/machinery/smartfridge/S = holder
|
|
. += ..()
|
|
. += "The orange light is [S.seconds_electrified ? "off" : "on"]."
|
|
. += "The red light is [S.shoot_inventory ? "off" : "blinking"]."
|
|
. += "A [S.scan_id ? "purple" : "yellow"] light is on."
|
|
. += "The cyan light is [S.cooling ? "on" : "off"]."
|
|
. += "The blue light is [S.heating ? "on" : "off"]."
|
|
|
|
/datum/wires/smartfridge/on_pulse(wire, user)
|
|
var/obj/structure/machinery/smartfridge/S = holder
|
|
switch(wire)
|
|
if(WIRE_THROW)
|
|
S.shoot_inventory = !S.shoot_inventory
|
|
if(WIRE_SHOCK)
|
|
if(ismob(user))
|
|
S.shock(user, 100)
|
|
S.seconds_electrified = 30
|
|
if(WIRE_IDSCAN)
|
|
S.scan_id = !S.scan_id
|
|
if(WIRE_COOLING)
|
|
S.cooling = !S.cooling
|
|
S.heating = FALSE
|
|
if(WIRE_HEATING)
|
|
S.heating = !S.cooling
|
|
S.cooling = FALSE
|
|
|
|
/datum/wires/smartfridge/on_cut(wire, mend, source)
|
|
var/obj/structure/machinery/smartfridge/S = holder
|
|
switch(wire)
|
|
if(WIRE_THROW)
|
|
S.shoot_inventory = !mend
|
|
if(WIRE_SHOCK)
|
|
if(mend)
|
|
S.seconds_electrified = 0
|
|
else
|
|
S.seconds_electrified = -1
|
|
if(WIRE_IDSCAN)
|
|
S.scan_id = 1
|
|
if(WIRE_COOLING)
|
|
S.cooling = mend
|
|
S.heating = FALSE
|
|
if(WIRE_HEATING)
|
|
S.heating = mend
|
|
S.cooling = FALSE
|
|
|
|
|