mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 04:17:33 +01:00
Repath obj/machinery to obj/structure/machinery [MDB Ignore] (#22500)
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.
This commit is contained in:
@@ -32,7 +32,7 @@ GLOBAL_DATUM_INIT(ntnet_global, /datum/ntnet, new)
|
||||
/datum/ntnet/New()
|
||||
if(GLOB.ntnet_global && (GLOB.ntnet_global != src))
|
||||
GLOB.ntnet_global = src // There can be only one.
|
||||
for(var/obj/machinery/ntnet_relay/R in SSmachinery.machinery)
|
||||
for(var/obj/structure/machinery/ntnet_relay/R in SSmachinery.machinery)
|
||||
relays.Add(R)
|
||||
R.NTNet = src
|
||||
build_software_lists()
|
||||
@@ -70,7 +70,7 @@ GLOBAL_DATUM_INIT(ntnet_global, /datum/ntnet, new)
|
||||
var/operating = FALSE
|
||||
|
||||
// Check all relays. If we have at least one working relay, network is up.
|
||||
for(var/obj/machinery/ntnet_relay/R in relays)
|
||||
for(var/obj/structure/machinery/ntnet_relay/R in relays)
|
||||
if(R.operable())
|
||||
operating = TRUE
|
||||
break
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Relays don't handle any actual communication. Global NTNet datum does that, relays only tell the datum if it should or shouldn't work.
|
||||
/obj/machinery/ntnet_relay
|
||||
/obj/structure/machinery/ntnet_relay
|
||||
name = "NTNet Quantum Relay"
|
||||
desc = "A very complex router and transmitter capable of connecting electronic devices together. Looks fragile."
|
||||
use_power = POWER_USE_ACTIVE
|
||||
@@ -25,7 +25,7 @@
|
||||
)
|
||||
|
||||
// TODO: Implement more logic here. For now it's only a placeholder.
|
||||
/obj/machinery/ntnet_relay/operable()
|
||||
/obj/structure/machinery/ntnet_relay/operable()
|
||||
if(!..(EMPED))
|
||||
return FALSE
|
||||
if(dos_failure)
|
||||
@@ -34,7 +34,7 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/ntnet_relay/update_icon()
|
||||
/obj/structure/machinery/ntnet_relay/update_icon()
|
||||
ClearOverlays()
|
||||
if(operable())
|
||||
AddOverlays(emissive_appearance(icon, "[icon_state]_lights"))
|
||||
@@ -48,7 +48,7 @@
|
||||
if(panel_open)
|
||||
AddOverlays("[icon_state]_panel")
|
||||
|
||||
/obj/machinery/ntnet_relay/process()
|
||||
/obj/structure/machinery/ntnet_relay/process()
|
||||
if(operable())
|
||||
update_use_power(POWER_USE_ACTIVE)
|
||||
else
|
||||
@@ -69,13 +69,13 @@
|
||||
GLOB.ntnet_global.add_log("Quantum relay switched from overload recovery mode to normal operation mode.")
|
||||
..()
|
||||
|
||||
/obj/machinery/ntnet_relay/ui_interact(mob/user, datum/tgui/ui)
|
||||
/obj/structure/machinery/ntnet_relay/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "NTNetRelay")
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/ntnet_relay/ui_data(mob/user)
|
||||
/obj/structure/machinery/ntnet_relay/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["enabled"] = enabled
|
||||
data["dos_capacity"] = dos_capacity
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/ntnet_relay/ui_act(action, params)
|
||||
/obj/structure/machinery/ntnet_relay/ui_act(action, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
@@ -100,10 +100,10 @@
|
||||
update_icon()
|
||||
. = TRUE
|
||||
|
||||
/obj/machinery/ntnet_relay/attack_hand(var/mob/living/user)
|
||||
/obj/structure/machinery/ntnet_relay/attack_hand(var/mob/living/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/ntnet_relay/Initialize()
|
||||
/obj/structure/machinery/ntnet_relay/Initialize()
|
||||
. = ..()
|
||||
uid = gl_uid
|
||||
gl_uid++
|
||||
@@ -115,13 +115,13 @@
|
||||
NTNet = GLOB.ntnet_global
|
||||
GLOB.ntnet_global.add_log("New quantum relay activated. Current amount of linked relays: [NTNet.relays.len]")
|
||||
|
||||
/obj/machinery/ntnet_relay/Destroy()
|
||||
/obj/structure/machinery/ntnet_relay/Destroy()
|
||||
if(GLOB.ntnet_global)
|
||||
GLOB.ntnet_global.relays.Remove(src)
|
||||
GLOB.ntnet_global.add_log("Quantum relay connection severed. Current amount of linked relays: [NTNet.relays.len]")
|
||||
return ..()
|
||||
|
||||
/obj/machinery/ntnet_relay/attackby(obj/item/attacking_item, mob/user)
|
||||
/obj/structure/machinery/ntnet_relay/attackby(obj/item/attacking_item, mob/user)
|
||||
if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
attacking_item.play_tool_sound(get_turf(src), 50)
|
||||
panel_open = !panel_open
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
for(var/atom/movable/A in component_parts)
|
||||
A.forceMove(get_turf(src))
|
||||
new /obj/machinery/constructable_frame/machine_frame(get_turf(src))
|
||||
new /obj/structure/machinery/constructable_frame/machine_frame(get_turf(src))
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -369,7 +369,7 @@
|
||||
var/mob/M = user
|
||||
if(use_check_and_message(M))
|
||||
return
|
||||
if(istype(over, /obj/machinery/power/apc) && tesla_link)
|
||||
if(istype(over, /obj/structure/machinery/power/apc) && tesla_link)
|
||||
return over.attackby(src, M)
|
||||
if(!istype(over, /atom/movable/screen) && !(over == src))
|
||||
return attack_self(M)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
//Cycle through the pistons and get their status
|
||||
var/i = 1
|
||||
for(var/obj/machinery/crusher_base/pstn in pistons)
|
||||
for(var/obj/structure/machinery/crusher_base/pstn in pistons)
|
||||
var/num_progress = pstn.get_num_progress()
|
||||
var/is_blocked = pstn.is_blocked()
|
||||
var/action = pstn.get_action()
|
||||
@@ -56,11 +56,11 @@
|
||||
switch(action)
|
||||
if("initialize")
|
||||
pistons = list()
|
||||
for(var/obj/machinery/crusher_base/pstn in orange(10, ui_host()))
|
||||
for(var/obj/structure/machinery/crusher_base/pstn in orange(10, ui_host()))
|
||||
pistons += pstn
|
||||
|
||||
airlocks = list()
|
||||
for(var/obj/machinery/door/airlock/arlk in orange(10, ui_host()))
|
||||
for(var/obj/structure/machinery/door/airlock/arlk in orange(10, ui_host()))
|
||||
if(arlk.id_tag != "compactor_access")
|
||||
continue
|
||||
airlocks += arlk
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
/datum/computer_file/program/crushercontrol/proc/airlock_open()
|
||||
for(var/thing in airlocks)
|
||||
var/obj/machinery/door/airlock/arlk = thing
|
||||
var/obj/structure/machinery/door/airlock/arlk = thing
|
||||
if(!arlk.cur_command)
|
||||
// Not using do_command so that the command queuer works.
|
||||
arlk.cur_command = "secure_open"
|
||||
@@ -104,15 +104,15 @@
|
||||
|
||||
/datum/computer_file/program/crushercontrol/proc/airlock_close()
|
||||
for(var/thing in airlocks)
|
||||
var/obj/machinery/door/airlock/arlk = thing
|
||||
var/obj/structure/machinery/door/airlock/arlk = thing
|
||||
if(!arlk.cur_command)
|
||||
arlk.cur_command = "secure_close"
|
||||
arlk.execute_current_command()
|
||||
|
||||
/datum/computer_file/program/crushercontrol/proc/crush_start()
|
||||
for(var/obj/machinery/crusher_base/pstn in pistons)
|
||||
for(var/obj/structure/machinery/crusher_base/pstn in pistons)
|
||||
pstn.crush_start()
|
||||
|
||||
/datum/computer_file/program/crushercontrol/proc/crush_stop()
|
||||
for(var/obj/machinery/crusher_base/pstn in pistons)
|
||||
for(var/obj/structure/machinery/crusher_base/pstn in pistons)
|
||||
pstn.crush_abort()
|
||||
|
||||
+1
-1
@@ -321,7 +321,7 @@ Command action procs
|
||||
|
||||
|
||||
/proc/is_relay_online()
|
||||
for(var/obj/machinery/bluespacerelay/M in SSmachinery.machinery)
|
||||
for(var/obj/structure/machinery/bluespacerelay/M in SSmachinery.machinery)
|
||||
if(M.stat == 0)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
. = data
|
||||
|
||||
var/turf/T = get_turf(computer.loc)
|
||||
var/obj/machinery/teleport/pad/linked_pad
|
||||
var/obj/structure/machinery/teleport/pad/linked_pad
|
||||
if(pad_ref)
|
||||
linked_pad = pad_ref.resolve()
|
||||
if(QDELETED(linked_pad))
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
if(!linked_pad)
|
||||
var/list/near_pads_info = list()
|
||||
for(var/obj/machinery/teleport/pad/S in range(3, T))
|
||||
for(var/obj/structure/machinery/teleport/pad/S in range(3, T))
|
||||
var/list/pad_info = list(
|
||||
"name" = "[S.name] ([S.x]-[S.y][S.z])",
|
||||
"ref" = "[REF(S)]"
|
||||
@@ -113,17 +113,17 @@
|
||||
|
||||
switch(action)
|
||||
if("pad")
|
||||
var/obj/machinery/teleport/pad/linked_pad = locate(params["pad"]) in range(3, get_turf(computer.loc))
|
||||
var/obj/structure/machinery/teleport/pad/linked_pad = locate(params["pad"]) in range(3, get_turf(computer.loc))
|
||||
pad_ref = WEAKREF(linked_pad)
|
||||
. = TRUE
|
||||
|
||||
if("recalibrate")
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
var/obj/structure/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
linked_pad.start_recalibration()
|
||||
. = TRUE
|
||||
|
||||
if("beacon")
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
var/obj/structure/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
var/obj/O = locate(params["beacon"]) in GLOB.teleportbeacons
|
||||
if(linked_pad.locked_obj)
|
||||
var/obj/LO = linked_pad.locked_obj.resolve()
|
||||
@@ -138,7 +138,7 @@
|
||||
. = TRUE
|
||||
|
||||
if("implant")
|
||||
var/obj/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
var/obj/structure/machinery/teleport/pad/linked_pad = pad_ref.resolve()
|
||||
var/obj/O = locate(params["implant"]) in GLOB.implants
|
||||
if(linked_pad.locked_obj)
|
||||
var/obj/LO = linked_pad.locked_obj.resolve()
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
if(.)
|
||||
return
|
||||
if(action == "switchTo")
|
||||
var/obj/machinery/camera/C = locate(params["switchTo"]) in GLOB.cameranet.cameras
|
||||
var/obj/structure/machinery/camera/C = locate(params["switchTo"]) in GLOB.cameranet.cameras
|
||||
if(!C)
|
||||
return
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
var/list/lost_sources = list()
|
||||
|
||||
if(isAI(user))
|
||||
for(var/obj/machinery/camera/C in A.cameras())
|
||||
for(var/obj/structure/machinery/camera/C in A.cameras())
|
||||
cameras += list(C.nano_structure())
|
||||
for(var/datum/alarm_source/AS in A.sources)
|
||||
if(!AS.source)
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
/datum/computer_file/program/atmos_control/proc/get_alarms(var/list/monitored_alarm_ids)
|
||||
if(computer)
|
||||
if(monitored_alarm_ids)
|
||||
for(var/obj/machinery/alarm/alarm in SSmachinery.processing)
|
||||
for(var/obj/structure/machinery/alarm/alarm in SSmachinery.processing)
|
||||
if(alarm.alarm_id && (alarm.alarm_id in monitored_alarm_ids) && AreConnectedZLevels(computer.z, alarm.z))
|
||||
monitored_alarms |= alarm
|
||||
else
|
||||
/// The computer of a silicon has null Z, so...
|
||||
var/turf/T = get_turf(computer)
|
||||
for(var/obj/machinery/alarm/alarm in SSmachinery.processing)
|
||||
for(var/obj/structure/machinery/alarm/alarm in SSmachinery.processing)
|
||||
if(AreConnectedZLevels(T.z, alarm.z))
|
||||
monitored_alarms |= alarm
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
switch(action)
|
||||
// Opens the interface for the given air alarm.
|
||||
if("alarm")
|
||||
var/obj/machinery/alarm/alarm = locate(params["alarm"]) in (monitored_alarms.len ? monitored_alarms : SSmachinery.processing)
|
||||
var/obj/structure/machinery/alarm/alarm = locate(params["alarm"]) in (monitored_alarms.len ? monitored_alarms : SSmachinery.processing)
|
||||
if(alarm)
|
||||
alarm.ui_interact(usr)
|
||||
return TRUE
|
||||
@@ -64,7 +64,7 @@
|
||||
get_alarms()
|
||||
|
||||
var/alarms = list()
|
||||
for(var/obj/machinery/alarm/alarm in monitored_alarms)
|
||||
for(var/obj/structure/machinery/alarm/alarm in monitored_alarms)
|
||||
alarms += list(list(
|
||||
"deck" = alarm.alarm_area.horizon_deck,
|
||||
"dept" = alarm.alarm_area.department,
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
/datum/computer_file/program/power_monitor/ui_data(mob/user)
|
||||
var/list/data = initial_data()
|
||||
var/list/sensors = list()
|
||||
var/obj/machinery/power/sensor/focus // Placeholder for selected sensor, if one has been selected from the UI list
|
||||
var/obj/structure/machinery/power/sensor/focus // Placeholder for selected sensor, if one has been selected from the UI list
|
||||
|
||||
// Prepare list of sensors (see refresh_sensors()) and set focus to sensor based of active_sensor (see ui_act()->setsensor)
|
||||
for(var/obj/machinery/power/sensor/S in grid_sensors)
|
||||
for(var/obj/structure/machinery/power/sensor/S in grid_sensors)
|
||||
sensors.Add(list(list(
|
||||
"name" = S.name_tag,
|
||||
"alarm" = S.check_grid_warning()
|
||||
@@ -48,7 +48,7 @@
|
||||
active_sensor = null // Reset UI navigation state
|
||||
|
||||
/datum/computer_file/program/power_monitor/proc/has_alarm()
|
||||
for(var/obj/machinery/power/sensor/S in grid_sensors)
|
||||
for(var/obj/structure/machinery/power/sensor/S in grid_sensors)
|
||||
if(S.check_grid_warning())
|
||||
return TRUE
|
||||
return FALSE
|
||||
@@ -59,7 +59,7 @@
|
||||
var/turf/T = get_turf(ui_host())
|
||||
if(!T) // Safety check
|
||||
return
|
||||
for(var/obj/machinery/power/sensor/S in SSmachinery.all_sensors)
|
||||
for(var/obj/structure/machinery/power/sensor/S in SSmachinery.all_sensors)
|
||||
if(AreConnectedZLevels(S.z, T.z) || (S.long_range))
|
||||
if(S.name_tag == "#UNKN#") // Default name. Shouldn't happen!
|
||||
warning("Powernet sensor with unset ID Tag! [S.x]X [S.y]Y [S.z]Z")
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
var/list/data = initial_data()
|
||||
|
||||
var/list/smeslist = list()
|
||||
for(var/obj/machinery/power/smes/buildable/SMES in SSmachinery.rcon_smes_units)
|
||||
for(var/obj/structure/machinery/power/smes/buildable/SMES in SSmachinery.rcon_smes_units)
|
||||
if(SMES.RCon)
|
||||
smeslist.Add(list(list(
|
||||
"charge" = round(SMES.Percentage()),
|
||||
@@ -40,7 +40,7 @@
|
||||
data["smes_info"] = smeslist
|
||||
// BREAKER DATA (simplified view)
|
||||
var/list/breakerlist = list()
|
||||
for(var/obj/machinery/power/breakerbox/BR in SSmachinery.rcon_breaker_units)
|
||||
for(var/obj/structure/machinery/power/breakerbox/BR in SSmachinery.rcon_breaker_units)
|
||||
breakerlist.Add(list(list(
|
||||
"RCON_tag" = BR.RCon_tag,
|
||||
"enabled" = BR.on,
|
||||
@@ -56,43 +56,43 @@
|
||||
|
||||
switch(action)
|
||||
if("smes_in_toggle")
|
||||
var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_in_toggle"])
|
||||
var/obj/structure/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_in_toggle"])
|
||||
if(SMES)
|
||||
SMES.toggle_input()
|
||||
. = TRUE
|
||||
|
||||
if("smes_out_toggle")
|
||||
var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_out_toggle"])
|
||||
var/obj/structure/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_out_toggle"])
|
||||
if(SMES)
|
||||
SMES.toggle_output()
|
||||
. = TRUE
|
||||
|
||||
if("smes_in_set")
|
||||
var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_in_set"])
|
||||
var/obj/structure/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_in_set"])
|
||||
if(SMES)
|
||||
SMES.set_input(params["value"])
|
||||
. = TRUE
|
||||
|
||||
if("smes_out_set")
|
||||
var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_out_set"])
|
||||
var/obj/structure/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_out_set"])
|
||||
if(SMES)
|
||||
SMES.set_output(params["value"])
|
||||
. = TRUE
|
||||
|
||||
if("smes_in_max")
|
||||
var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_in_max"])
|
||||
var/obj/structure/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_in_max"])
|
||||
if(SMES)
|
||||
SMES.set_input(SMES.input_level_max)
|
||||
. = TRUE
|
||||
|
||||
if("smes_out_max")
|
||||
var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_out_max"])
|
||||
var/obj/structure/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes_out_max"])
|
||||
if(SMES)
|
||||
SMES.set_output(SMES.output_level_max)
|
||||
. = TRUE
|
||||
|
||||
if("toggle_breaker")
|
||||
var/obj/machinery/power/breakerbox/toggle = SSmachinery.rcon_breaker_units_by_tag[params["toggle_breaker"]]
|
||||
var/obj/structure/machinery/power/breakerbox/toggle = SSmachinery.rcon_breaker_units_by_tag[params["toggle_breaker"]]
|
||||
if(toggle)
|
||||
if(toggle.update_locked)
|
||||
to_chat(usr, SPAN_WARNING("The breaker box was recently toggled. Please wait before toggling it again."))
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
to_chat(AI, "<font color = red><b>Network Alert: Brute-force encryption crack in progress in [T.loc].</b></font>")
|
||||
else
|
||||
to_chat(AI, "<font color = red><b>Network Alert: Brute-force encryption crack in progress. Unable to pinpoint location.</b></font>")
|
||||
var/obj/machinery/door/airlock/D = cable.machine
|
||||
var/obj/structure/machinery/door/airlock/D = cable.machine
|
||||
if(!istype(D))
|
||||
hack_aborted = 1
|
||||
hackprogress = 0
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
color = LIGHT_COLOR_ORANGE
|
||||
usage_flags = PROGRAM_CONSOLE | PROGRAM_LAPTOP
|
||||
tgui_id = "CameraMonitoring"
|
||||
var/obj/machinery/camera/current_camera
|
||||
var/obj/structure/machinery/camera/current_camera
|
||||
var/current_network
|
||||
/// Used for camera monitor consoles from which this interface can be launched. If it exists, only provide that console's "console_networks" networks.
|
||||
var/list/monitored_networks = list()
|
||||
@@ -115,7 +115,7 @@
|
||||
|
||||
switch(action)
|
||||
if("switch_camera")
|
||||
var/obj/machinery/camera/C = locate(params["switch_camera"]) in GLOB.cameranet.cameras
|
||||
var/obj/structure/machinery/camera/C = locate(params["switch_camera"]) in GLOB.cameranet.cameras
|
||||
if(!C)
|
||||
return
|
||||
if(!(current_network in C.network))
|
||||
@@ -145,7 +145,7 @@
|
||||
usr.reset_view(current_camera)
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/camera_monitor/proc/switch_to_camera(var/mob/user, var/obj/machinery/camera/C)
|
||||
/datum/computer_file/program/camera_monitor/proc/switch_to_camera(var/mob/user, var/obj/structure/machinery/camera/C)
|
||||
//don't need to check if the camera works for AI because the AI jumps to the camera location and doesn't actually look through cameras.
|
||||
if(isAI(user))
|
||||
var/mob/living/silicon/ai/A = user
|
||||
@@ -172,7 +172,7 @@
|
||||
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/camera_monitor/proc/set_current(var/obj/machinery/camera/C)
|
||||
/datum/computer_file/program/camera_monitor/proc/set_current(var/obj/structure/machinery/camera/C)
|
||||
if(current_camera == C)
|
||||
return
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
color = LIGHT_COLOR_ORANGE
|
||||
tgui_id = "PenalMechs"
|
||||
|
||||
var/obj/machinery/camera/current_camera
|
||||
var/obj/structure/machinery/camera/current_camera
|
||||
|
||||
/datum/computer_file/program/penal_mechs/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
@@ -82,7 +82,7 @@
|
||||
var/mob/living/heavy_vehicle/M = locate(params["track_mech"]) in GLOB.mob_list
|
||||
if(!istype(M))
|
||||
return FALSE
|
||||
var/obj/machinery/camera/C = M.camera
|
||||
var/obj/structure/machinery/camera/C = M.camera
|
||||
if(C)
|
||||
switch_to_camera(usr, C)
|
||||
return TRUE
|
||||
@@ -109,7 +109,7 @@
|
||||
to_chat(M, SPAN_WARNING("Remote Penal Monitoring: [message]"))
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/penal_mechs/proc/switch_to_camera(var/mob/user, var/obj/machinery/camera/C)
|
||||
/datum/computer_file/program/penal_mechs/proc/switch_to_camera(var/mob/user, var/obj/structure/machinery/camera/C)
|
||||
//don't need to check if the camera works for AI because the AI jumps to the camera location and doesn't actually look through cameras.
|
||||
if(isAI(user))
|
||||
var/mob/living/silicon/ai/A = user
|
||||
@@ -131,7 +131,7 @@
|
||||
check_eye(user)
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/penal_mechs/proc/set_current(var/obj/machinery/camera/C)
|
||||
/datum/computer_file/program/penal_mechs/proc/set_current(var/obj/structure/machinery/camera/C)
|
||||
if(current_camera == C)
|
||||
return
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
hardware_size = 1
|
||||
origin_tech = list(TECH_ENGINEERING = 1, TECH_POWER = 1)
|
||||
passive_charging_rate = 2500 // mW
|
||||
var/obj/machinery/power/source
|
||||
var/obj/structure/machinery/power/source
|
||||
var/datum/beam/beam
|
||||
var/cable_length = 3
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
untether()
|
||||
return ..()
|
||||
|
||||
/obj/item/computer_hardware/tesla_link/charging_cable/toggle(var/obj/machinery/power/power_source, mob/user)
|
||||
/obj/item/computer_hardware/tesla_link/charging_cable/toggle(var/obj/structure/machinery/power/power_source, mob/user)
|
||||
if(!source)
|
||||
if(!istype(power_source))
|
||||
return
|
||||
@@ -48,7 +48,7 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/computer_hardware/tesla_link/charging_cable/proc/tether(var/obj/machinery/power/P)
|
||||
/obj/item/computer_hardware/tesla_link/charging_cable/proc/tether(var/obj/structure/machinery/power/P)
|
||||
if(!istype(P))
|
||||
return
|
||||
source = P
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define LAPVEND_DEVICE_TABLET 2
|
||||
#define LAPVEND_DEVICE_PDA 3
|
||||
|
||||
/obj/machinery/lapvend
|
||||
/obj/structure/machinery/lapvend
|
||||
name = "computer vendor"
|
||||
desc = "A vending machine with microfabricator capable of dispensing various NT-branded computers."
|
||||
icon = 'icons/obj/vending.dmi'
|
||||
@@ -41,7 +41,7 @@
|
||||
var/dev_aislot = 0 // 0: None, 1: Standard
|
||||
|
||||
// Removes all traces of old order and allows you to begin configuration from scratch.
|
||||
/obj/machinery/lapvend/proc/reset_order()
|
||||
/obj/structure/machinery/lapvend/proc/reset_order()
|
||||
state = LAPVEND_STATE_SELECT
|
||||
devtype = LAPVEND_DEVICE_NONE
|
||||
if(fabricated_laptop)
|
||||
@@ -63,7 +63,7 @@
|
||||
dev_aislot = 0
|
||||
|
||||
// Recalculates the price and optionally even fabricates the device.
|
||||
/obj/machinery/lapvend/proc/fabricate_and_recalc_price(fabricate = FALSE)
|
||||
/obj/structure/machinery/lapvend/proc/fabricate_and_recalc_price(fabricate = FALSE)
|
||||
total_price = 0
|
||||
if(devtype == LAPVEND_DEVICE_LAPTOP) // Laptop, generally cheaper to make it accessible for most station roles
|
||||
if(fabricate)
|
||||
@@ -255,7 +255,7 @@
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/lapvend/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
/obj/structure/machinery/lapvend/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
@@ -305,13 +305,13 @@
|
||||
fabricate_and_recalc_price(FALSE)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/lapvend/attack_hand(mob/user)
|
||||
/obj/structure/machinery/lapvend/attack_hand(mob/user)
|
||||
if(anchored)
|
||||
ui_interact(user)
|
||||
else
|
||||
to_chat(user, SPAN_NOTICE("\The [src] needs to be anchored to the floor to function!"))
|
||||
|
||||
/obj/machinery/lapvend/ui_interact(mob/user, datum/tgui/ui)
|
||||
/obj/structure/machinery/lapvend/ui_interact(mob/user, datum/tgui/ui)
|
||||
if(stat & (BROKEN | NOPOWER | MAINT))
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
@@ -319,7 +319,7 @@
|
||||
ui = new(user, src, "ComputerFabricator", "Personal Computer Vendor")
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/lapvend/ui_data(mob/user)
|
||||
/obj/structure/machinery/lapvend/ui_data(mob/user)
|
||||
var/list/data = list("state" = src.state)
|
||||
if(src.state == LAPVEND_STATE_CONFIGURE)
|
||||
data["devtype"] = devtype
|
||||
@@ -335,7 +335,7 @@
|
||||
data["totalprice"] = total_price
|
||||
return data
|
||||
|
||||
/obj/machinery/lapvend/attackby(obj/item/attacking_item, mob/user)
|
||||
/obj/structure/machinery/lapvend/attackby(obj/item/attacking_item, mob/user)
|
||||
if(attacking_item.tool_behaviour == TOOL_WRENCH)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
if(anchored)
|
||||
@@ -361,7 +361,7 @@
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/machinery/lapvend/proc/create_device(mob/user, message = "Enjoy your new product!")
|
||||
/obj/structure/machinery/lapvend/proc/create_device(mob/user, message = "Enjoy your new product!")
|
||||
fabricate_and_recalc_price(TRUE)
|
||||
if((devtype == LAPVEND_DEVICE_LAPTOP) && fabricated_laptop)
|
||||
fabricated_laptop.forceMove(src.loc)
|
||||
@@ -392,7 +392,7 @@
|
||||
state = LAPVEND_STATE_COMPLETE
|
||||
|
||||
// Simplified payment processing, returns TRUE on success.
|
||||
/obj/machinery/lapvend/proc/process_payment(obj/item/card/id/id_card, obj/item/id_container)
|
||||
/obj/structure/machinery/lapvend/proc/process_payment(obj/item/card/id/id_card, obj/item/id_container)
|
||||
var/obj/item/spacecash/cash = null
|
||||
if(istype(id_container, /obj/item/spacecash))
|
||||
cash = id_container
|
||||
|
||||
Reference in New Issue
Block a user