From e3dac13370969dc72dbe48f34454a425543d6334 Mon Sep 17 00:00:00 2001
From: Kashargul <144968721+Kashargul@users.noreply.github.com>
Date: Sun, 26 Nov 2023 11:15:05 +0100
Subject: [PATCH 01/10] Admin verb to add / remove borg modules
---
code/__defines/admin_vr.dm | 2 +
code/modules/admin/admin_verb_lists_vr.dm | 1 +
code/modules/admin/verbs/modify_robot.dm | 58 +++++++++++++++++++++++
vorestation.dme | 1 +
4 files changed, 62 insertions(+)
create mode 100644 code/modules/admin/verbs/modify_robot.dm
diff --git a/code/__defines/admin_vr.dm b/code/__defines/admin_vr.dm
index 5cc4ac22992..6de1ba8aad4 100644
--- a/code/__defines/admin_vr.dm
+++ b/code/__defines/admin_vr.dm
@@ -4,3 +4,5 @@
#define SMITE_AD_SPAM "Ad Spam"
#define SMITE_AUTOSAVE "10 Second Autosave"
#define SMITE_AUTOSAVE_WIDE "10 Second Autosave (AoE)"
+#define MODIFIY_ROBOT_MODULE_ADD "Add a Module"
+#define MODIFIY_ROBOT_MODULE_REMOVE "Remove a Module"
diff --git a/code/modules/admin/admin_verb_lists_vr.dm b/code/modules/admin/admin_verb_lists_vr.dm
index c5c1be9a5df..5f536df841d 100644
--- a/code/modules/admin/admin_verb_lists_vr.dm
+++ b/code/modules/admin/admin_verb_lists_vr.dm
@@ -77,6 +77,7 @@ var/list/admin_verbs_admin = list(
/client/proc/check_ai_laws, //shows AI and borg laws,
/client/proc/rename_silicon, //properly renames silicons,
/client/proc/manage_silicon_laws, // Allows viewing and editing silicon laws. ,
+ /client/proc/modify_robot,
/client/proc/check_antagonists,
/client/proc/admin_memo, //admin memo system. show/delete/write. +SERVER needed to delete admin memos of others,
/client/proc/dsay, //talk in deadchat using our ckey/fakekey,
diff --git a/code/modules/admin/verbs/modify_robot.dm b/code/modules/admin/verbs/modify_robot.dm
new file mode 100644
index 00000000000..484c88e87ce
--- /dev/null
+++ b/code/modules/admin/verbs/modify_robot.dm
@@ -0,0 +1,58 @@
+//Allows to add and remove modules from bogs
+/client/proc/modify_robot(var/mob/living/silicon/robot/target in player_list)
+ set name = "Modify Robot Module"
+ set desc = "Allows to add or remove modules to/from robots."
+ set category = "Admin"
+ if(!check_rights(R_ADMIN))
+ return
+
+ if(!istype(target))
+ return
+
+ var/list/modification_options = list(MODIFIY_ROBOT_MODULE_ADD,MODIFIY_ROBOT_MODULE_REMOVE)
+
+ var/modification_choice = tgui_input_list(usr, "Select if you want to add or remove a module to/from [target]","Choice", modification_options)
+ if(!modification_choice)
+ return
+
+ log_and_message_admins("[key_name(src)] has used MODIFYROBOT ([modification_choice]) on [key_name(target)].")
+ feedback_add_details("admin_verb","MODIFYROBOT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+
+ switch(modification_choice)
+ if(MODIFIY_ROBOT_MODULE_ADD)
+ while(TRUE)
+ var/selection = tgui_input_list(usr, "Please select the module to pick modules from", "Module", robot_modules)
+ if(!selection || selection == "Cancel")
+ break
+ var/module_type = robot_modules[selection]
+ var/mob/living/silicon/robot/robot = new /mob/living/silicon/robot(null)
+ var/obj/item/weapon/robot_module/robot/robot_type = new module_type(robot)
+ robot.emag_items = 1
+ if(!istype(robot_type, /obj/item/weapon/robot_module/robot/))
+ robot.Destroy()
+ break
+ while(TRUE)
+ var/list/all_modules = robot.module.modules
+ all_modules += robot.module.emag
+ var/add_item = tgui_input_list(usr, "Please select the modules to add", "Modules", all_modules)
+ if(!istype(add_item, /obj/item/))
+ break
+ to_chat(usr, "You added [add_item] to [target]")
+ robot.module.modules.Remove(add_item)
+ robot.module.contents.Remove(add_item)
+ target.module.modules.Add(add_item)
+ target.module.contents.Add(add_item)
+ robot.Destroy()
+ if(MODIFIY_ROBOT_MODULE_REMOVE)
+ if(!target.module.modules)
+ return
+ while(TRUE)
+ var/list/active_modules = target.module.modules
+ if(target.emagged || target.emag_items)
+ active_modules += target.module.emag
+ var/selected_module_module = tgui_input_list(usr, "Please select the modules to remove", "Modules", active_modules)
+ if(!istype(selected_module_module, /obj/item/))
+ break
+ target.module.modules.Remove(selected_module_module)
+ target.module.contents.Remove(selected_module_module)
+ qdel(selected_module_module)
diff --git a/vorestation.dme b/vorestation.dme
index eeee57d62ae..c2ca8ad51c8 100644
--- a/vorestation.dme
+++ b/vorestation.dme
@@ -1779,6 +1779,7 @@
#include "code\modules\admin\verbs\lightning_strike.dm"
#include "code\modules\admin\verbs\map_template_loadverb.dm"
#include "code\modules\admin\verbs\mapping.dm"
+#include "code\modules\admin\verbs\modify_robot.dm"
#include "code\modules\admin\verbs\panicbunker.dm"
#include "code\modules\admin\verbs\playsound.dm"
#include "code\modules\admin\verbs\possess.dm"
From 6f604aae9eaf43f700a60b1ba7fe2c5017f85320 Mon Sep 17 00:00:00 2001
From: Kashargul <144968721+Kashargul@users.noreply.github.com>
Date: Sun, 26 Nov 2023 16:07:47 +0100
Subject: [PATCH 02/10] moved return to top, emag handling
---
code/modules/admin/verbs/modify_robot.dm | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/code/modules/admin/verbs/modify_robot.dm b/code/modules/admin/verbs/modify_robot.dm
index 484c88e87ce..918beb68de8 100644
--- a/code/modules/admin/verbs/modify_robot.dm
+++ b/code/modules/admin/verbs/modify_robot.dm
@@ -9,6 +9,9 @@
if(!istype(target))
return
+ if(!target.module.modules)
+ return
+
var/list/modification_options = list(MODIFIY_ROBOT_MODULE_ADD,MODIFIY_ROBOT_MODULE_REMOVE)
var/modification_choice = tgui_input_list(usr, "Select if you want to add or remove a module to/from [target]","Choice", modification_options)
@@ -38,21 +41,19 @@
if(!istype(add_item, /obj/item/))
break
to_chat(usr, "You added [add_item] to [target]")
+ robot.module.emag.Remove(add_item)
robot.module.modules.Remove(add_item)
robot.module.contents.Remove(add_item)
target.module.modules.Add(add_item)
target.module.contents.Add(add_item)
robot.Destroy()
if(MODIFIY_ROBOT_MODULE_REMOVE)
- if(!target.module.modules)
- return
while(TRUE)
var/list/active_modules = target.module.modules
- if(target.emagged || target.emag_items)
- active_modules += target.module.emag
var/selected_module_module = tgui_input_list(usr, "Please select the modules to remove", "Modules", active_modules)
if(!istype(selected_module_module, /obj/item/))
break
+ target.module.emag.Remove(selected_module_module)
target.module.modules.Remove(selected_module_module)
target.module.contents.Remove(selected_module_module)
qdel(selected_module_module)
From d298c1e512535e2d31570819437fad69471cee1b Mon Sep 17 00:00:00 2001
From: Kashargul <144968721+Kashargul@users.noreply.github.com>
Date: Sun, 26 Nov 2023 23:05:03 +0100
Subject: [PATCH 03/10] minor sprite fix, radio selection added
---
code/__defines/admin_vr.dm | 2 +
code/modules/admin/verbs/modify_robot.dm | 102 ++++++++++++++++--
.../silicon/robot/robot_modules/station.dm | 2 +
icons/mob/robot/crisis.dmi | Bin 41078 -> 41075 bytes
4 files changed, 97 insertions(+), 9 deletions(-)
diff --git a/code/__defines/admin_vr.dm b/code/__defines/admin_vr.dm
index 6de1ba8aad4..aceb8c08beb 100644
--- a/code/__defines/admin_vr.dm
+++ b/code/__defines/admin_vr.dm
@@ -6,3 +6,5 @@
#define SMITE_AUTOSAVE_WIDE "10 Second Autosave (AoE)"
#define MODIFIY_ROBOT_MODULE_ADD "Add a Module"
#define MODIFIY_ROBOT_MODULE_REMOVE "Remove a Module"
+#define MODIFIY_ROBOT_RADIOC_ADD "Add a Radio Channel"
+#define MODIFIY_ROBOT_RADIOC_REMOVE "Remove a Radio Channel"
diff --git a/code/modules/admin/verbs/modify_robot.dm b/code/modules/admin/verbs/modify_robot.dm
index 918beb68de8..5059aac0ec6 100644
--- a/code/modules/admin/verbs/modify_robot.dm
+++ b/code/modules/admin/verbs/modify_robot.dm
@@ -12,7 +12,7 @@
if(!target.module.modules)
return
- var/list/modification_options = list(MODIFIY_ROBOT_MODULE_ADD,MODIFIY_ROBOT_MODULE_REMOVE)
+ var/list/modification_options = list(MODIFIY_ROBOT_MODULE_ADD,MODIFIY_ROBOT_MODULE_REMOVE, MODIFIY_ROBOT_RADIOC_ADD, MODIFIY_ROBOT_RADIOC_REMOVE)
var/modification_choice = tgui_input_list(usr, "Select if you want to add or remove a module to/from [target]","Choice", modification_options)
if(!modification_choice)
@@ -24,36 +24,120 @@
switch(modification_choice)
if(MODIFIY_ROBOT_MODULE_ADD)
while(TRUE)
- var/selection = tgui_input_list(usr, "Please select the module to pick modules from", "Module", robot_modules)
- if(!selection || selection == "Cancel")
+ var/selected_module_module = tgui_input_list(usr, "Please select the module to pick modules from", "Module", robot_modules)
+ if(!selected_module_module || selected_module_module == "Cancel")
break
- var/module_type = robot_modules[selection]
+ var/module_type = robot_modules[selected_module_module]
var/mob/living/silicon/robot/robot = new /mob/living/silicon/robot(null)
var/obj/item/weapon/robot_module/robot/robot_type = new module_type(robot)
robot.emag_items = 1
if(!istype(robot_type, /obj/item/weapon/robot_module/robot/))
robot.Destroy()
break
+ var/list/all_modules = robot.module.modules
+ all_modules += robot.module.emag
while(TRUE)
- var/list/all_modules = robot.module.modules
- all_modules += robot.module.emag
- var/add_item = tgui_input_list(usr, "Please select the modules to add", "Modules", all_modules)
+ var/add_item = tgui_input_list(usr, "Please select the module to add", "Modules", all_modules)
if(!istype(add_item, /obj/item/))
break
- to_chat(usr, "You added [add_item] to [target]")
+ to_chat(usr, "You added \"[add_item]\" to [target]")
robot.module.emag.Remove(add_item)
robot.module.modules.Remove(add_item)
robot.module.contents.Remove(add_item)
target.module.modules.Add(add_item)
target.module.contents.Add(add_item)
+ if(istype(add_item, /obj/item/stack/))
+ var/obj/item/stack/item_with_synth = add_item
+ for(var/synth in item_with_synth.synths)
+ var/found = target.module.synths.Find(synth)
+ if(!found)
+ robot.module.synths.Remove(synth)
+ target.module.synths.Add(synth)
+ else
+ item_with_synth.synths = list(target.module.synths[found])
+ continue
+ if(istype(add_item, /obj/item/weapon/matter_decompiler/) || istype(add_item, /obj/item/device/dogborg/sleeper/compactor/decompiler/))
+ var/obj/item/weapon/matter_decompiler/item_with_matter = add_item
+ if(item_with_matter.metal)
+ var/found = target.module.synths.Find(item_with_matter.metal)
+ if(!found)
+ robot.module.synths.Remove(item_with_matter.metal)
+ target.module.synths.Add(item_with_matter.metal)
+ else
+ item_with_matter.metal = target.module.synths[found]
+ if(item_with_matter.glass)
+ var/found = target.module.synths.Find(item_with_matter.glass)
+ if(!found)
+ robot.module.synths.Remove(item_with_matter.glass)
+ target.module.synths.Add(item_with_matter.glass)
+ else
+ item_with_matter.glass = target.module.synths[found]
+ if(item_with_matter.wood)
+ var/found = target.module.synths.Find(item_with_matter.wood)
+ if(!found)
+ robot.module.synths.Remove(item_with_matter.wood)
+ target.module.synths.Add(item_with_matter.wood)
+ else
+ item_with_matter.wood = target.module.synths[found]
+ if(item_with_matter.plastic)
+ var/found = target.module.synths.Find(item_with_matter.plastic)
+ if(!found)
+ robot.module.synths.Remove(item_with_matter.plastic)
+ target.module.synths.Add(item_with_matter.plastic)
+ else
+ item_with_matter.plastic = target.module.synths[found]
robot.Destroy()
if(MODIFIY_ROBOT_MODULE_REMOVE)
while(TRUE)
var/list/active_modules = target.module.modules
- var/selected_module_module = tgui_input_list(usr, "Please select the modules to remove", "Modules", active_modules)
+ var/selected_module_module = tgui_input_list(usr, "Please select the module to remove", "Modules", active_modules)
if(!istype(selected_module_module, /obj/item/))
break
+ to_chat(usr, "You removed \"[selected_module_module]\" from [target]")
target.module.emag.Remove(selected_module_module)
target.module.modules.Remove(selected_module_module)
target.module.contents.Remove(selected_module_module)
qdel(selected_module_module)
+ if(MODIFIY_ROBOT_RADIOC_ADD)
+ var/list/available_channels = radiochannels.Copy()
+ for(var/has_channel in target.radio.channels)
+ available_channels -= has_channel
+ while(TRUE)
+ var/selected_radio_channel = tgui_input_list(usr, "Please select the radio channel to add", "Channels", available_channels)
+ if(!selected_radio_channel || selected_radio_channel == "Cancel")
+ break
+ to_chat(usr, "You added \"[selected_radio_channel]\" channel to [target]")
+ if(selected_radio_channel == "Special Ops")
+ target.radio.centComm = 1
+ to_chat(usr, "Debug, Add cetCOm key")
+ if(selected_radio_channel == "Raider")
+ qdel(target.radio.keyslot)
+ target.radio.keyslot = new /obj/item/device/encryptionkey/raider(src)
+ target.radio.syndie = 1
+ to_chat(usr, "Debug, Add raid key")
+ if(selected_radio_channel == "Mercenary")
+ qdel(target.radio.keyslot)
+ target.radio.keyslot = new /obj/item/device/encryptionkey/syndicate(src)
+ target.radio.syndie = 1
+ target.module.channels += list("[selected_radio_channel]" = 1)
+ target.radio.channels[selected_radio_channel] += target.module.channels[selected_radio_channel]
+ target.radio.secure_radio_connections[selected_radio_channel] += radio_controller.add_object(target.radio, radiochannels[selected_radio_channel], RADIO_CHAT)
+ available_channels -= selected_radio_channel
+ if(MODIFIY_ROBOT_RADIOC_REMOVE)
+ while(TRUE)
+ var/selected_radio_channel = tgui_input_list(usr, "Please select the radio channel to remove", "Channels", target.radio.channels)
+ if(!selected_radio_channel || selected_radio_channel == "Cancel")
+ break
+ to_chat(usr, "You removed \"[selected_radio_channel]\" channel from [target]")
+ if(selected_radio_channel == "Special Ops")
+ target.radio.centComm = 0
+ target.module.channels -= selected_radio_channel
+ if((selected_radio_channel == "Mercenary" || selected_radio_channel == "Raider") && !(target.module.channels["Raider"] || target.module.channels["Mercenary"]))
+ qdel(target.radio.keyslot)
+ target.radio.keyslot = null
+ target.radio.syndie = 0
+ target.radio.channels = list()
+ for(var/n_chan in target.module.channels)
+ target.radio.channels[n_chan] -= target.module.channels[n_chan]
+ radio_controller.remove_object(target.radio, radiochannels[selected_radio_channel])
+ target.radio.secure_radio_connections -= selected_radio_channel
diff --git a/code/modules/mob/living/silicon/robot/robot_modules/station.dm b/code/modules/mob/living/silicon/robot/robot_modules/station.dm
index 0c4ac258c08..62a965d089d 100644
--- a/code/modules/mob/living/silicon/robot/robot_modules/station.dm
+++ b/code/modules/mob/living/silicon/robot/robot_modules/station.dm
@@ -102,6 +102,8 @@ var/global/list/robot_modules = list(
/obj/item/weapon/robot_module/Destroy()
for(var/module in modules)
qdel(module)
+ for(var/emg in emag)
+ qdel(emg)
for(var/synth in synths)
qdel(synth)
modules.Cut()
diff --git a/icons/mob/robot/crisis.dmi b/icons/mob/robot/crisis.dmi
index e4eb242001c7db6d85f04815b4b54ec54975979a..4f7ce6ed3400c7ee502ad7a31b2b3aa6457386a4 100644
GIT binary patch
delta 276
zcmV+v0qg$uzykBY0+1vDdyyqI6OHrqvw(~kffh9^faE*p_8yu`k!>M6)i2gD2ROr%
z35p7CEY5I@qMcz9>gRtzSD-4UK>Vou3a37J414ynPICcnt6exbgA3ShJV8+bf?aTt
z$s9$CNywZeWZtbFs26PE|CXO^D@x+#qCuuTp7XY6N@9|b=I(Xu*%<*1mmr_fK9_b0
z^3_@2T0Wojt=|JV?*(@b%uZaqlPUonVX3*mA=JR5M)|$y5siPeR|<}j1!7_SHteW&
z?=%lc{LTJqEw}z=hcJ5GJs%`Sk<=%Upj?+jSX^FqRLQe}y!8w1IaM4h$As`Mt;Po1
anBwJTffwr)`UAuJqD+!@G`+K{0n478CWe&&
delta 279
zcmV+y0qFkozykKb0+1vDevu_L6Akn9vyhA!ffh9^faE*pau3aIk!>M6U0$qX4seDi
z6BHHPSe)S)MLWYJT%P{{U4g2Y0`a5rE1de^G3?pPI?V;Rt#;w$3~I35c!Ht=1gmk8
z$s9!=laM({$h=!UP%qfR|1Uq=R+PleMT1OxJm+oCl*A+<&E4zRvoZo2EuBB@UxLAfr6u(-VJsFG&`d20*pIaM4h$AlQ%7+W;d
dU}r&+DPC?Cc(GogKQS+-!1dklq_e02%bvrDhj;)0
From bc17c501dfe63b71fa101f16528ed62b5dbdb441 Mon Sep 17 00:00:00 2001
From: Kashargul <144968721+Kashargul@users.noreply.github.com>
Date: Sun, 26 Nov 2023 23:29:13 +0100
Subject: [PATCH 04/10] removed overseen debugs
---
code/modules/admin/verbs/modify_robot.dm | 2 --
1 file changed, 2 deletions(-)
diff --git a/code/modules/admin/verbs/modify_robot.dm b/code/modules/admin/verbs/modify_robot.dm
index 5059aac0ec6..6cf2d8d0b02 100644
--- a/code/modules/admin/verbs/modify_robot.dm
+++ b/code/modules/admin/verbs/modify_robot.dm
@@ -109,12 +109,10 @@
to_chat(usr, "You added \"[selected_radio_channel]\" channel to [target]")
if(selected_radio_channel == "Special Ops")
target.radio.centComm = 1
- to_chat(usr, "Debug, Add cetCOm key")
if(selected_radio_channel == "Raider")
qdel(target.radio.keyslot)
target.radio.keyslot = new /obj/item/device/encryptionkey/raider(src)
target.radio.syndie = 1
- to_chat(usr, "Debug, Add raid key")
if(selected_radio_channel == "Mercenary")
qdel(target.radio.keyslot)
target.radio.keyslot = new /obj/item/device/encryptionkey/syndicate(src)
From 607dd639419a046fa92222e91a0b2038b26a995e Mon Sep 17 00:00:00 2001
From: Kashargul <144968721+Kashargul@users.noreply.github.com>
Date: Tue, 28 Nov 2023 03:11:06 +0100
Subject: [PATCH 05/10] finished todos -> moved robot batteries to path ->
reworked the rejuvenation -> added component add / remove
---
code/__defines/admin_vr.dm | 2 +
code/modules/admin/verbs/modify_robot.dm | 47 ++++++++++++++++++-
.../modules/mob/living/silicon/robot/robot.dm | 36 ++++++++++++--
.../mob/living/silicon/robot/syndicate.dm | 4 +-
code/modules/power/cells/power_cells.dm | 17 ++++++-
5 files changed, 98 insertions(+), 8 deletions(-)
diff --git a/code/__defines/admin_vr.dm b/code/__defines/admin_vr.dm
index aceb8c08beb..c03c24bb810 100644
--- a/code/__defines/admin_vr.dm
+++ b/code/__defines/admin_vr.dm
@@ -8,3 +8,5 @@
#define MODIFIY_ROBOT_MODULE_REMOVE "Remove a Module"
#define MODIFIY_ROBOT_RADIOC_ADD "Add a Radio Channel"
#define MODIFIY_ROBOT_RADIOC_REMOVE "Remove a Radio Channel"
+#define MODIFIY_ROBOT_COMP_ADD "Replace a Component"
+#define MODIFIY_ROBOT_COMP_REMOVE "Remove a Component"
diff --git a/code/modules/admin/verbs/modify_robot.dm b/code/modules/admin/verbs/modify_robot.dm
index 6cf2d8d0b02..e05f48adede 100644
--- a/code/modules/admin/verbs/modify_robot.dm
+++ b/code/modules/admin/verbs/modify_robot.dm
@@ -12,7 +12,7 @@
if(!target.module.modules)
return
- var/list/modification_options = list(MODIFIY_ROBOT_MODULE_ADD,MODIFIY_ROBOT_MODULE_REMOVE, MODIFIY_ROBOT_RADIOC_ADD, MODIFIY_ROBOT_RADIOC_REMOVE)
+ var/list/modification_options = list(MODIFIY_ROBOT_MODULE_ADD,MODIFIY_ROBOT_MODULE_REMOVE, MODIFIY_ROBOT_RADIOC_ADD, MODIFIY_ROBOT_RADIOC_REMOVE, MODIFIY_ROBOT_COMP_ADD, MODIFIY_ROBOT_COMP_REMOVE)
var/modification_choice = tgui_input_list(usr, "Select if you want to add or remove a module to/from [target]","Choice", modification_options)
if(!modification_choice)
@@ -139,3 +139,48 @@
target.radio.channels[n_chan] -= target.module.channels[n_chan]
radio_controller.remove_object(target.radio, radiochannels[selected_radio_channel])
target.radio.secure_radio_connections -= selected_radio_channel
+ if(MODIFIY_ROBOT_COMP_ADD)
+ while(TRUE)
+ var/selected_component = tgui_input_list(usr, "Please select the component to add or replace", "Component", target.components)
+ if(!selected_component || selected_component == "Cancel")
+ break
+ var/datum/robot_component/C = target.components[selected_component]
+ if(C.wrapped && !selected_component == "power cell")
+ qdel(C.wrapped)
+ switch(selected_component)
+ if("actuator")
+ C.wrapped = new /obj/item/robot_parts/robot_component/actuator(src)
+ if("radio")
+ C.wrapped = new /obj/item/robot_parts/robot_component/radio(src)
+ if("power cell")
+ var/list/recommended_cells = list(/obj/item/weapon/cell/robot_station, /obj/item/weapon/cell/high, /obj/item/weapon/cell/super, /obj/item/weapon/cell/robot_syndi, /obj/item/weapon/cell/hyper,
+ /obj/item/weapon/cell/infinite, /obj/item/weapon/cell/potato, /obj/item/weapon/cell/slime)
+ var/celltype = tgui_input_list(usr, "What kind of cell do you want to install?", "Cells", recommended_cells)
+ if(!celltype || celltype == "Cancel")
+ continue
+ qdel(C.wrapped)
+ target.cell = new celltype(src)
+ C.wrapped = target.cell
+ if("diagnosis unit")
+ C.wrapped = new /obj/item/robot_parts/robot_component/diagnosis_unit(src)
+ if("camera")
+ C.wrapped = new /obj/item/robot_parts/robot_component/camera(src)
+ if("comms")
+ C.wrapped = new /obj/item/robot_parts/robot_component/binary_communication_device(src)
+ if("armour")
+ C.wrapped = new /obj/item/robot_parts/robot_component/armour(src)
+ C.install()
+ C.installed = 1
+ if(MODIFIY_ROBOT_COMP_REMOVE)
+ while(TRUE)
+ var/selected_component = tgui_input_list(usr, "Please select the component to remove", "Component", target.components)
+ if(!selected_component || selected_component == "Cancel")
+ break
+ var/datum/robot_component/C = target.components[selected_component]
+ if(C.wrapped)
+ C.uninstall()
+ C.installed = 0
+ qdel(C.wrapped)
+ C.wrapped = null
+ if(selected_component == "power cell")
+ target.cell = null
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 05ce14c9164..e05e0322d0c 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -148,9 +148,7 @@
C.wrapped = new C.external_type
if(!cell)
- cell = new /obj/item/weapon/cell(src)
- cell.maxcharge = 7500
- cell.charge = 7500
+ cell = new /obj/item/weapon/cell/robot_station(src)
else if(ispath(cell))
cell = new cell(src)
@@ -177,6 +175,38 @@
. = ..()
update_icon()
+/mob/living/silicon/robot/rejuvenate()
+ for (var/V in components)
+ var/datum/robot_component/C = components[V]
+ if(istype(C.wrapped, /obj/item/broken_device))
+ qdel(C.wrapped)
+ if(!C.wrapped)
+ switch(V)
+ if("actuator")
+ C.wrapped = new /obj/item/robot_parts/robot_component/actuator(src)
+ if("radio")
+ C.wrapped = new /obj/item/robot_parts/robot_component/radio(src)
+ if("power cell")
+ var/list/recommended_cells = list(/obj/item/weapon/cell/robot_station, /obj/item/weapon/cell/high, /obj/item/weapon/cell/super, /obj/item/weapon/cell/robot_syndi, /obj/item/weapon/cell/hyper,
+ /obj/item/weapon/cell/infinite, /obj/item/weapon/cell/potato, /obj/item/weapon/cell/slime)
+ var/celltype = tgui_input_list(usr, "What kind of cell do you want to install? Cancel installs a default robot cell.", "Cells", recommended_cells)
+ if(!celltype || !celltype == "Cancel")
+ celltype = /obj/item/weapon/cell/robot_station
+ cell = new celltype(src)
+ C.wrapped = cell
+ if("diagnosis unit")
+ C.wrapped = new /obj/item/robot_parts/robot_component/diagnosis_unit(src)
+ if("camera")
+ C.wrapped = new /obj/item/robot_parts/robot_component/camera(src)
+ if("comms")
+ C.wrapped = new /obj/item/robot_parts/robot_component/binary_communication_device(src)
+ if("armour")
+ C.wrapped = new /obj/item/robot_parts/robot_component/armour(src)
+ C.installed = 1
+ C.install()
+ cell.charge = cell.maxcharge
+ ..()
+
/mob/living/silicon/robot/proc/init()
aiCamera = new/obj/item/device/camera/siliconcam/robot_camera(src)
laws = new /datum/ai_laws/nanotrasen()
diff --git a/code/modules/mob/living/silicon/robot/syndicate.dm b/code/modules/mob/living/silicon/robot/syndicate.dm
index 18d2b9ce80d..286b2abf75c 100644
--- a/code/modules/mob/living/silicon/robot/syndicate.dm
+++ b/code/modules/mob/living/silicon/robot/syndicate.dm
@@ -8,9 +8,7 @@
/mob/living/silicon/robot/syndicate/New()
if(!cell)
- cell = new /obj/item/weapon/cell(src)
- cell.maxcharge = 25000
- cell.charge = 25000
+ cell = new /obj/item/weapon/cell/robot_syndi(src)
..()
diff --git a/code/modules/power/cells/power_cells.dm b/code/modules/power/cells/power_cells.dm
index 082abfb9da4..c164c9e17c9 100644
--- a/code/modules/power/cells/power_cells.dm
+++ b/code/modules/power/cells/power_cells.dm
@@ -34,6 +34,13 @@
maxcharge = 5000
matter = list(MAT_STEEL = 700, MAT_GLASS = 50)
+/*
+ * Robot
+ */
+/obj/item/weapon/cell/robot_station
+ name = "A standard robot power cell"
+ maxcharge = 7500
+
/*
* High
*/
@@ -64,6 +71,14 @@
charge = 0
update_icon()
+/*
+ * Syndicate
+ */
+/obj/item/weapon/cell/robot_syndi
+ name = "A syndicate robot power cell"
+ description_fluff = "Almost as good as a hyper."
+ maxcharge = 25000
+
/*
* Hyper
*/
@@ -223,4 +238,4 @@
desc += " This one has already been used."
cut_overlays()
target.adjust_nutrition(amount)
- user.custom_emote(message = "connects \the [src] to [user == target ? "their" : "[target]'s"] charging port, expending it.")
\ No newline at end of file
+ user.custom_emote(message = "connects \the [src] to [user == target ? "their" : "[target]'s"] charging port, expending it.")
From fe66178f93fe492131a77fff01cb8b7c49cec5a3 Mon Sep 17 00:00:00 2001
From: Kashargul <144968721+Kashargul@users.noreply.github.com>
Date: Tue, 28 Nov 2023 20:22:44 +0100
Subject: [PATCH 06/10] changed icon of the syndicate cell to make it clear
that it's better than a standard
---
code/modules/power/cells/power_cells.dm | 1 +
1 file changed, 1 insertion(+)
diff --git a/code/modules/power/cells/power_cells.dm b/code/modules/power/cells/power_cells.dm
index c164c9e17c9..381ac483cca 100644
--- a/code/modules/power/cells/power_cells.dm
+++ b/code/modules/power/cells/power_cells.dm
@@ -77,6 +77,7 @@
/obj/item/weapon/cell/robot_syndi
name = "A syndicate robot power cell"
description_fluff = "Almost as good as a hyper."
+ icon_state = "super" //We don't want roboticists confuse it with a low standard cell
maxcharge = 25000
/*
From f8d785e2de4d37a82af4cefa112ce881556da65e Mon Sep 17 00:00:00 2001
From: Kashargul <144968721+Kashargul@users.noreply.github.com>
Date: Thu, 30 Nov 2023 22:05:40 +0100
Subject: [PATCH 07/10] using associated list for nicer naming of the cell
selection Some imporvements / fixes on source as well as ensuring that the
components on rejuv are actually nulled.
---
code/modules/admin/verbs/modify_robot.dm | 27 +++++++++++--------
.../modules/mob/living/silicon/robot/robot.dm | 14 +++++++---
2 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/code/modules/admin/verbs/modify_robot.dm b/code/modules/admin/verbs/modify_robot.dm
index e05f48adede..18e68eff3c1 100644
--- a/code/modules/admin/verbs/modify_robot.dm
+++ b/code/modules/admin/verbs/modify_robot.dm
@@ -111,11 +111,11 @@
target.radio.centComm = 1
if(selected_radio_channel == "Raider")
qdel(target.radio.keyslot)
- target.radio.keyslot = new /obj/item/device/encryptionkey/raider(src)
+ target.radio.keyslot = new /obj/item/device/encryptionkey/raider(target)
target.radio.syndie = 1
if(selected_radio_channel == "Mercenary")
qdel(target.radio.keyslot)
- target.radio.keyslot = new /obj/item/device/encryptionkey/syndicate(src)
+ target.radio.keyslot = new /obj/item/device/encryptionkey/syndicate(target)
target.radio.syndie = 1
target.module.channels += list("[selected_radio_channel]" = 1)
target.radio.channels[selected_radio_channel] += target.module.channels[selected_radio_channel]
@@ -149,26 +149,31 @@
qdel(C.wrapped)
switch(selected_component)
if("actuator")
- C.wrapped = new /obj/item/robot_parts/robot_component/actuator(src)
+ C.wrapped = new /obj/item/robot_parts/robot_component/actuator(target)
if("radio")
- C.wrapped = new /obj/item/robot_parts/robot_component/radio(src)
+ C.wrapped = new /obj/item/robot_parts/robot_component/radio(target)
if("power cell")
var/list/recommended_cells = list(/obj/item/weapon/cell/robot_station, /obj/item/weapon/cell/high, /obj/item/weapon/cell/super, /obj/item/weapon/cell/robot_syndi, /obj/item/weapon/cell/hyper,
/obj/item/weapon/cell/infinite, /obj/item/weapon/cell/potato, /obj/item/weapon/cell/slime)
- var/celltype = tgui_input_list(usr, "What kind of cell do you want to install?", "Cells", recommended_cells)
- if(!celltype || celltype == "Cancel")
+ var/list/cell_names = list()
+ for(var/cell_type in recommended_cells)
+ var/obj/item/weapon/cell/single_cell = cell_type
+ cell_names[capitalize(initial(single_cell.name))] = cell_type
+ var/selected_cell = tgui_input_list(usr, "What kind of cell do you want to install?", "Cells", cell_names)
+ if(!selected_cell || selected_cell == "Cancel")
continue
qdel(C.wrapped)
- target.cell = new celltype(src)
+ var/new_power_cell = cell_names[capitalize(selected_cell)]
+ target.cell = new new_power_cell(target)
C.wrapped = target.cell
if("diagnosis unit")
- C.wrapped = new /obj/item/robot_parts/robot_component/diagnosis_unit(src)
+ C.wrapped = new /obj/item/robot_parts/robot_component/diagnosis_unit(target)
if("camera")
- C.wrapped = new /obj/item/robot_parts/robot_component/camera(src)
+ C.wrapped = new /obj/item/robot_parts/robot_component/camera(target)
if("comms")
- C.wrapped = new /obj/item/robot_parts/robot_component/binary_communication_device(src)
+ C.wrapped = new /obj/item/robot_parts/robot_component/binary_communication_device(target)
if("armour")
- C.wrapped = new /obj/item/robot_parts/robot_component/armour(src)
+ C.wrapped = new /obj/item/robot_parts/robot_component/armour(target)
C.install()
C.installed = 1
if(MODIFIY_ROBOT_COMP_REMOVE)
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index e05e0322d0c..438bc52a27c 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -180,6 +180,7 @@
var/datum/robot_component/C = components[V]
if(istype(C.wrapped, /obj/item/broken_device))
qdel(C.wrapped)
+ C.wrapped = null
if(!C.wrapped)
switch(V)
if("actuator")
@@ -189,10 +190,15 @@
if("power cell")
var/list/recommended_cells = list(/obj/item/weapon/cell/robot_station, /obj/item/weapon/cell/high, /obj/item/weapon/cell/super, /obj/item/weapon/cell/robot_syndi, /obj/item/weapon/cell/hyper,
/obj/item/weapon/cell/infinite, /obj/item/weapon/cell/potato, /obj/item/weapon/cell/slime)
- var/celltype = tgui_input_list(usr, "What kind of cell do you want to install? Cancel installs a default robot cell.", "Cells", recommended_cells)
- if(!celltype || !celltype == "Cancel")
- celltype = /obj/item/weapon/cell/robot_station
- cell = new celltype(src)
+ var/list/cell_names = list()
+ for(var/cell_type in recommended_cells)
+ var/obj/item/weapon/cell/single_cell = cell_type
+ cell_names[capitalize(initial(single_cell.name))] = cell_type
+ var/selected_cell = tgui_input_list(usr, "What kind of cell do you want to install? Cancel installs a default robot cell.", "Cells", cell_names)
+ if(!selected_cell || selected_cell == "Cancel")
+ selected_cell = "A standard robot power cell"
+ var/new_power_cell = cell_names[capitalize(selected_cell)]
+ cell = new new_power_cell(src)
C.wrapped = cell
if("diagnosis unit")
C.wrapped = new /obj/item/robot_parts/robot_component/diagnosis_unit(src)
From c9ad9e220503e74924a8200a23b55a53afab4b7a Mon Sep 17 00:00:00 2001
From: Kashargul <144968721+Kashargul@users.noreply.github.com>
Date: Thu, 30 Nov 2023 22:23:40 +0100
Subject: [PATCH 08/10] Adds full module reset to the options
---
code/__defines/admin_vr.dm | 1 +
code/modules/admin/verbs/modify_robot.dm | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/code/__defines/admin_vr.dm b/code/__defines/admin_vr.dm
index c03c24bb810..6dd0afc4801 100644
--- a/code/__defines/admin_vr.dm
+++ b/code/__defines/admin_vr.dm
@@ -10,3 +10,4 @@
#define MODIFIY_ROBOT_RADIOC_REMOVE "Remove a Radio Channel"
#define MODIFIY_ROBOT_COMP_ADD "Replace a Component"
#define MODIFIY_ROBOT_COMP_REMOVE "Remove a Component"
+#define MODIFIY_ROBOT_RESET_MODULE "Fully Resets a Robot Module"
diff --git a/code/modules/admin/verbs/modify_robot.dm b/code/modules/admin/verbs/modify_robot.dm
index 18e68eff3c1..876c156fee0 100644
--- a/code/modules/admin/verbs/modify_robot.dm
+++ b/code/modules/admin/verbs/modify_robot.dm
@@ -12,7 +12,7 @@
if(!target.module.modules)
return
- var/list/modification_options = list(MODIFIY_ROBOT_MODULE_ADD,MODIFIY_ROBOT_MODULE_REMOVE, MODIFIY_ROBOT_RADIOC_ADD, MODIFIY_ROBOT_RADIOC_REMOVE, MODIFIY_ROBOT_COMP_ADD, MODIFIY_ROBOT_COMP_REMOVE)
+ var/list/modification_options = list(MODIFIY_ROBOT_MODULE_ADD,MODIFIY_ROBOT_MODULE_REMOVE, MODIFIY_ROBOT_RADIOC_ADD, MODIFIY_ROBOT_RADIOC_REMOVE, MODIFIY_ROBOT_COMP_ADD, MODIFIY_ROBOT_COMP_REMOVE, MODIFIY_ROBOT_RESET_MODULE)
var/modification_choice = tgui_input_list(usr, "Select if you want to add or remove a module to/from [target]","Choice", modification_options)
if(!modification_choice)
@@ -189,3 +189,5 @@
C.wrapped = null
if(selected_component == "power cell")
target.cell = null
+ if(MODIFIY_ROBOT_RESET_MODULE)
+ target.module_reset()
From 48877faa0569a33c11951a77ffb6facfeac1f8db Mon Sep 17 00:00:00 2001
From: Kashargul <144968721+Kashargul@users.noreply.github.com>
Date: Thu, 30 Nov 2023 22:40:05 +0100
Subject: [PATCH 09/10] adds safety check before resstet.
---
code/modules/admin/verbs/modify_robot.dm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/code/modules/admin/verbs/modify_robot.dm b/code/modules/admin/verbs/modify_robot.dm
index 876c156fee0..f7101edbd88 100644
--- a/code/modules/admin/verbs/modify_robot.dm
+++ b/code/modules/admin/verbs/modify_robot.dm
@@ -190,4 +190,6 @@
if(selected_component == "power cell")
target.cell = null
if(MODIFIY_ROBOT_RESET_MODULE)
+ if(tgui_alert(usr, "Are you sure that you want to reset the entire module?","Confirm",list("Yes","No"))=="No")
+ return
target.module_reset()
From cea40f7a378ddcdd519680851c80ff216e29f204 Mon Sep 17 00:00:00 2001
From: Kashargul <144968721+Kashargul@users.noreply.github.com>
Date: Thu, 30 Nov 2023 23:48:15 +0100
Subject: [PATCH 10/10] added more chat response alerts
---
code/modules/admin/verbs/modify_robot.dm | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/code/modules/admin/verbs/modify_robot.dm b/code/modules/admin/verbs/modify_robot.dm
index f7101edbd88..2562d891b38 100644
--- a/code/modules/admin/verbs/modify_robot.dm
+++ b/code/modules/admin/verbs/modify_robot.dm
@@ -1,4 +1,4 @@
-//Allows to add and remove modules from bogs
+//Allows to add and remove modules from borgs
/client/proc/modify_robot(var/mob/living/silicon/robot/target in player_list)
set name = "Modify Robot Module"
set desc = "Allows to add or remove modules to/from robots."
@@ -40,12 +40,12 @@
var/add_item = tgui_input_list(usr, "Please select the module to add", "Modules", all_modules)
if(!istype(add_item, /obj/item/))
break
- to_chat(usr, "You added \"[add_item]\" to [target]")
robot.module.emag.Remove(add_item)
robot.module.modules.Remove(add_item)
robot.module.contents.Remove(add_item)
target.module.modules.Add(add_item)
target.module.contents.Add(add_item)
+ to_chat(usr, "You added \"[add_item]\" to [target].")
if(istype(add_item, /obj/item/stack/))
var/obj/item/stack/item_with_synth = add_item
for(var/synth in item_with_synth.synths)
@@ -106,7 +106,6 @@
var/selected_radio_channel = tgui_input_list(usr, "Please select the radio channel to add", "Channels", available_channels)
if(!selected_radio_channel || selected_radio_channel == "Cancel")
break
- to_chat(usr, "You added \"[selected_radio_channel]\" channel to [target]")
if(selected_radio_channel == "Special Ops")
target.radio.centComm = 1
if(selected_radio_channel == "Raider")
@@ -121,12 +120,12 @@
target.radio.channels[selected_radio_channel] += target.module.channels[selected_radio_channel]
target.radio.secure_radio_connections[selected_radio_channel] += radio_controller.add_object(target.radio, radiochannels[selected_radio_channel], RADIO_CHAT)
available_channels -= selected_radio_channel
+ to_chat(usr, "You added \"[selected_radio_channel]\" channel to [target].")
if(MODIFIY_ROBOT_RADIOC_REMOVE)
while(TRUE)
var/selected_radio_channel = tgui_input_list(usr, "Please select the radio channel to remove", "Channels", target.radio.channels)
if(!selected_radio_channel || selected_radio_channel == "Cancel")
break
- to_chat(usr, "You removed \"[selected_radio_channel]\" channel from [target]")
if(selected_radio_channel == "Special Ops")
target.radio.centComm = 0
target.module.channels -= selected_radio_channel
@@ -139,13 +138,14 @@
target.radio.channels[n_chan] -= target.module.channels[n_chan]
radio_controller.remove_object(target.radio, radiochannels[selected_radio_channel])
target.radio.secure_radio_connections -= selected_radio_channel
+ to_chat(usr, "You removed \"[selected_radio_channel]\" channel from [target].")
if(MODIFIY_ROBOT_COMP_ADD)
while(TRUE)
var/selected_component = tgui_input_list(usr, "Please select the component to add or replace", "Component", target.components)
if(!selected_component || selected_component == "Cancel")
break
var/datum/robot_component/C = target.components[selected_component]
- if(C.wrapped && !selected_component == "power cell")
+ if(C.wrapped && selected_component != "power cell")
qdel(C.wrapped)
switch(selected_component)
if("actuator")
@@ -166,6 +166,7 @@
var/new_power_cell = cell_names[capitalize(selected_cell)]
target.cell = new new_power_cell(target)
C.wrapped = target.cell
+ to_chat(usr, "You replaced \"[C]\" on [target] with \"[selected_cell]\".")
if("diagnosis unit")
C.wrapped = new /obj/item/robot_parts/robot_component/diagnosis_unit(target)
if("camera")
@@ -176,6 +177,8 @@
C.wrapped = new /obj/item/robot_parts/robot_component/armour(target)
C.install()
C.installed = 1
+ if(selected_component != "power cell")
+ to_chat(usr, "You repplaced \"[C]\" on [target].")
if(MODIFIY_ROBOT_COMP_REMOVE)
while(TRUE)
var/selected_component = tgui_input_list(usr, "Please select the component to remove", "Component", target.components)
@@ -189,7 +192,9 @@
C.wrapped = null
if(selected_component == "power cell")
target.cell = null
+ to_chat(usr, "You removed \"[C]\" from [target]")
if(MODIFIY_ROBOT_RESET_MODULE)
if(tgui_alert(usr, "Are you sure that you want to reset the entire module?","Confirm",list("Yes","No"))=="No")
return
target.module_reset()
+ to_chat(usr, "You resetted [target]'s module selection.")