Merge pull request #15539 from Kashargul/adminAddBorgModule

Admin add/remove borg modules, radio channels and components verb + rejuvenate fully restores borgs
This commit is contained in:
Heroman3003
2023-12-03 11:09:27 +10:00
committed by GitHub
9 changed files with 268 additions and 7 deletions
+39 -3
View File
@@ -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,44 @@
. = ..()
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)
C.wrapped = null
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/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)
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()
@@ -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()
@@ -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)
..()