From 2f5cec832d7c6d8bf4970c9543860177fde1adb8 Mon Sep 17 00:00:00 2001
From: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Date: Wed, 27 Jul 2022 21:25:39 +0100
Subject: [PATCH] Cleanup redundant machine stuff (#18494)
---
code/datums/uplink_item.dm | 18 +-
code/game/machinery/camera/camera.dm | 2 -
code/game/machinery/computer/Operating.dm | 4 +-
code/game/machinery/computer/camera.dm | 1 -
code/game/machinery/computer/cloning.dm | 1 -
code/game/machinery/overview.dm | 350 ------------------
code/game/machinery/syndicatebeacon.dm | 99 -----
.../objects/items/devices/radio/headset.dm | 10 +-
.../game/objects/items/devices/radio/radio.dm | 12 +-
code/game/objects/items/weapons/rpd.dm | 1 -
.../kitchen_machinery/smartfridge.dm | 2 -
code/modules/newscaster/obj/newspaper.dm | 3 +-
code/modules/paperwork/paper_bundle.dm | 28 +-
code/modules/pda/PDA.dm | 1 -
code/modules/power/apc.dm | 2 -
.../projectiles/guns/energy/special.dm | 10 +-
.../chemistry/machinery/chem_master.dm | 1 -
code/modules/recycling/conveyor2.dm | 1 -
code/modules/research/circuitprinter.dm | 3 -
code/modules/research/destructive_analyzer.dm | 7 +-
code/modules/research/experimentor.dm | 9 +-
code/modules/research/protolathe.dm | 12 +-
code/modules/research/rdconsole.dm | 29 +-
code/modules/research/rdmachines.dm | 86 +----
code/modules/research/server.dm | 14 -
paradise.dme | 1 -
26 files changed, 80 insertions(+), 627 deletions(-)
delete mode 100644 code/game/machinery/overview.dm
diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm
index 62c22a2b84b..9db56b5b6fc 100644
--- a/code/datums/uplink_item.dm
+++ b/code/datums/uplink_item.dm
@@ -104,21 +104,19 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
return desc
/datum/uplink_item/proc/buy(obj/item/uplink/hidden/U, mob/user)
-
if(!istype(U))
- return 0
+ return FALSE
if(user.stat || user.restrained())
- return 0
+ return FALSE
if(!(istype(user, /mob/living/carbon/human)))
- return 0
+ return FALSE
// If the uplink's holder is in the user's contents
if((U.loc in user.contents || (in_range(U.loc, user) && istype(U.loc.loc, /turf))))
- user.set_machine(U)
if(cost > U.uses)
- return 0
+ return FALSE
var/obj/I = spawn_item(get_turf(user), U)
@@ -129,21 +127,23 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
log_game("[key_name(user)] purchased [name]. [name] was discounted to [cost].")
if(!user.mind.special_role)
message_admins("[key_name_admin(user)] purchased [name] (discounted to [cost]), as a non antagonist.")
+
else
log_game("[key_name(user)] purchased [name].")
if(!user.mind.special_role)
message_admins("[key_name_admin(user)] purchased [name], as a non antagonist.")
+
A.put_in_any_hand_if_possible(I)
if(istype(I,/obj/item/storage/box/) && I.contents.len>0)
for(var/atom/o in I)
U.purchase_log += "[bicon(o)]"
+
else
U.purchase_log += "[bicon(I)]"
- //U.interact(user)
- return 1
- return 0
+ return TRUE
+ return FALSE
/*
//
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index 31ddd360f16..1c8736be085 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -94,7 +94,6 @@
emped = 0 //Resets the consecutive EMP count
for(var/mob/M in GLOB.player_list)
if(M.client && M.client.eye == src)
- M.unset_machine()
M.reset_perspective(null)
to_chat(M, "The screen bursts into static.")
..()
@@ -284,7 +283,6 @@
//I guess that doesn't matter since they can't use it anyway?
for(var/mob/O in GLOB.player_list)
if(O.client && O.client.eye == src)
- O.unset_machine()
O.reset_perspective(null)
to_chat(O, "The screen bursts into static.")
diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm
index 5e89e8a0ddc..8dbb47daf97 100644
--- a/code/game/machinery/computer/Operating.dm
+++ b/code/game/machinery/computer/Operating.dm
@@ -140,12 +140,10 @@
/obj/machinery/computer/operating/ui_act(action, params)
if(..())
return
+
if(stat & (NOPOWER|BROKEN))
return
- if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
- usr.set_machine(src)
-
. = TRUE
switch(action)
if("verboseOn")
diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm
index aa158f76545..5eacee68a60 100644
--- a/code/game/machinery/computer/camera.dm
+++ b/code/game/machinery/computer/camera.dm
@@ -155,7 +155,6 @@
/obj/machinery/computer/security/attack_hand(mob/user)
if(stat || ..())
- user.unset_machine()
return
ui_interact(user)
diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm
index 4884193b937..fb889b6724b 100644
--- a/code/game/machinery/computer/cloning.dm
+++ b/code/game/machinery/computer/cloning.dm
@@ -102,7 +102,6 @@
return attack_hand(user)
/obj/machinery/computer/cloning/attack_hand(mob/user as mob)
- user.set_machine(src)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm
deleted file mode 100644
index b8805c93792..00000000000
--- a/code/game/machinery/overview.dm
+++ /dev/null
@@ -1,350 +0,0 @@
-//#define AMAP
-
-/obj/machinery/computer/security/verb/station_map()
- set name = ".map"
- set category = "Object"
- set src in view(1)
- usr.set_machine(src)
- if(!mapping) return
-
- log_game("[usr]([usr.key]) used station map L[z] in [src.loc.loc]")
-
- src.drawmap(usr)
-
-/obj/machinery/computer/security/proc/drawmap(mob/user as mob)
-
- var/icx = round(world.maxx/16) + 1
- var/icy = round(world.maxy/16) + 1
-
- var/xoff = round( (icx*16-world.maxx)-2)
- var/yoff = round( (icy*16-world.maxy)-2)
-
- var/icount = icx * icy
-
-
- var/list/imap = list()
-
-#ifdef AMAP
-
- for(var/i = 0; iScanning [pick("retina pattern", "voice print", "fingerprints", "dna sequence")]...
Identity confirmed,
"
- if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
- if(is_special_character(user))
- dat += "Operative record found. Greetings, Agent [user.name].
"
- else if(charges < 1)
- dat += "Connection severed.
"
- else
- var/honorific = "Mr."
- if(user.gender == FEMALE)
- honorific = "Ms."
- dat += "Identity not found in operative database. What can the Syndicate do for you today, [honorific] [user.name]?
"
- if(!selfdestructing)
- dat += "
\"[pick("I want to switch teams.", "I want to work for you.", "Let me join you.", "I can be of use to you.", "You want me working for you, and here's why...", "Give me an objective.", "How's the 401k over at the Syndicate?")]\"
"
- dat += temptext
- user << browse(dat, "window=syndbeacon")
- onclose(user, "syndbeacon")
-
-/obj/machinery/syndicate_beacon/Topic(href, href_list)
- if(..())
- return 1
- if(href_list["betraitor"])
- if(charges < 1)
- src.updateUsrDialog()
- return
- var/mob/M = locate(href_list["traitormob"])
- if(M.mind.special_role)
- temptext = "We have no need for you at this time. Have a pleasant day.
"
- src.updateUsrDialog()
- return
- charges -= 1
- if(prob(50))
- temptext = "Double-crosser. You planned to betray us from the start. Allow us to repay the favor in kind."
- updateUsrDialog()
- addtimer(CALLBACK(src, .proc/selfdestruct), rand(50, 200))
- return
- if(istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/N = M
- var/objective = "Free Objective"
- switch(rand(1,100))
- if(1 to 50)
- objective = "Steal [pick("a hand teleporter", "the Captain's antique laser gun", "a jetpack", "the Captain's ID", "the Captain's jumpsuit")]."
- if(51 to 60)
- objective = "Destroy 70% or more of the station's plasma tanks."
- if(61 to 70)
- objective = "Cut power to 80% or more of the station's tiles."
- if(71 to 80)
- objective = "Destroy the AI."
- if(81 to 90)
- objective = "Kill all monkeys aboard the station."
- else
- objective = "Make certain at least 80% of the station evacuates on the shuttle."
-
- var/datum/objective/custom_objective = new(objective)
- custom_objective.owner = N.mind
- N.mind.objectives += custom_objective
- var/datum/objective/escape/escape_objective = new
- escape_objective.owner = N.mind
- N.mind.objectives += escape_objective
-
- var/datum/antagonist/traitor/T = new()
- T.give_objectives = FALSE
- N.mind.add_antag_datum(T)
-
- to_chat(M, "You have joined the ranks of the Syndicate and become a traitor to the station!")
- message_admins("[key_name_admin(N)] has accepted a traitor objective from a syndicate beacon.")
-
-
- src.add_fingerprint(usr)
- src.updateUsrDialog()
- return
-
-
-/obj/machinery/syndicate_beacon/proc/selfdestruct()
- selfdestructing = TRUE
- spawn() explosion(src.loc, rand(3,8), rand(1,3), 1, 10)
-
-
-
////////////////////////////////////////
//Singularity beacon
////////////////////////////////////////
diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm
index a7e499671e6..d5ed752da0d 100644
--- a/code/game/objects/items/devices/radio/headset.dm
+++ b/code/game/objects/items/devices/radio/headset.dm
@@ -359,7 +359,7 @@
/obj/item/radio/headset/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/encryptionkey/))
- user.set_machine(src)
+
if(keyslot1 && keyslot2)
to_chat(user, "The headset can't hold another key!")
return
@@ -372,15 +372,17 @@
user.drop_item()
W.loc = src
keyslot2 = W
+
recalculateChannels()
- else
- return ..()
+ return
+
+ return ..()
/obj/item/radio/headset/screwdriver_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = 0))
return
- user.set_machine(src)
+
if(keyslot1 || keyslot2)
for(var/ch_name in channels)
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index c55d9a85c2d..629bae3407d 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -563,13 +563,14 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
- user.set_machine(src)
+
b_stat = !b_stat
if(!istype(src, /obj/item/radio/beacon))
if(b_stat)
user.show_message("The radio can now be attached and modified!")
else
user.show_message("The radio can no longer be modified or attached!")
+
updateDialog()
/obj/item/radio/wirecutter_act(mob/user, obj/item/I)
@@ -663,7 +664,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
/obj/item/radio/borg/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/encryptionkey/))
- user.set_machine(src)
+
if(keyslot)
to_chat(user, "The radio can't hold another key!")
return
@@ -674,14 +675,15 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
keyslot = W
recalculateChannels()
- else
- return ..()
+ return
+
+ return ..()
/obj/item/radio/borg/screwdriver_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = 0))
return
- user.set_machine(src)
+
if(keyslot)
for(var/ch_name in channels)
SSradio.remove_object(src, SSradio.radiochannels[ch_name])
diff --git a/code/game/objects/items/weapons/rpd.dm b/code/game/objects/items/weapons/rpd.dm
index 08e9e130742..d1edf8560cc 100644
--- a/code/game/objects/items/weapons/rpd.dm
+++ b/code/game/objects/items/weapons/rpd.dm
@@ -173,7 +173,6 @@
ui_interact(user)
/obj/item/rpd/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
- user.set_machine(src)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "RPD", name, 450, 650, master_ui, state)
diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
index 874eb61aac4..c635b0eac4d 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm
@@ -243,8 +243,6 @@
to_chat(user, "[failed] item\s [failed == 1 ? "is" : "are"] refused.")
/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
- user.set_machine(src)
-
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "Smartfridge", name, 500, 500)
diff --git a/code/modules/newscaster/obj/newspaper.dm b/code/modules/newscaster/obj/newspaper.dm
index aa7eb1bf2bf..26304662129 100644
--- a/code/modules/newscaster/obj/newspaper.dm
+++ b/code/modules/newscaster/obj/newspaper.dm
@@ -132,7 +132,7 @@
var/mob/living/M = usr
if(!Adjacent(M))
return
- M.set_machine(src)
+
if(href_list["next_page"])
if(curr_page == pages + 1)
return //Don't need that at all, but anyway.
@@ -142,6 +142,7 @@
screen = SCREEN_PAGE_INNER
curr_page++
playsound(loc, "pageturn", 50, TRUE)
+
else if(href_list["prev_page"])
if(curr_page == 0)
return
diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm
index 4a4679468b7..1d917a4f326 100644
--- a/code/modules/paperwork/paper_bundle.dm
+++ b/code/modules/paperwork/paper_bundle.dm
@@ -138,15 +138,16 @@
+ "