[MIRROR] Better borg modules (#11095)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-06-20 13:04:56 -07:00
committed by GitHub
parent 85abe91473
commit f7e20d021e
78 changed files with 1785 additions and 1133 deletions

View File

@@ -20,6 +20,7 @@
var/supplied_law = "SuppliedLaw"
var/supplied_law_position = MIN_SUPPLIED_LAW_NUMBER
var/list/datum/ai_laws/law_list
var/obj/item/robotic_multibelt/multibelt_holder //Currently selected multibelt.
/datum/eventkit/modify_robot/New()
. = ..()
@@ -81,6 +82,10 @@
var/obj/item/gun/energy/kinetic_accelerator/kin = locate() in target.module.modules
if(kin)
.["target"]["pka"] += get_pka(kin)
for(var/obj/item/robotic_multibelt/multibelt in target.module.modules)
.["target"]["multibelt"] += list(get_mult_belt(multibelt))
// Radio section
var/list/radio_channels = list()
for(var/channel in target.radio.channels)
@@ -336,6 +341,39 @@
kin.modkits.Remove(rem_kit)
qdel(rem_kit)
return TRUE
if("select_multibelt")
multibelt_holder = locate(params["multibelt"])
return TRUE
if("install_tool")
if(!istype(multibelt_holder))
return FALSE
if(istype(multibelt_holder, /obj/item/robotic_multibelt/materials))
target.add_new_material(text2path(params["tool"]))
return TRUE
var/new_tool = text2path(params["tool"])
if(new_tool in GLOB.all_borg_multitool_options)
multibelt_holder.cyborg_integrated_tools += new_tool //Make sure you don't add items directly to it, or you can't ever remove them.
multibelt_holder.generate_tools()
return TRUE
if("remove_tool")
if(!istype(multibelt_holder))
return FALSE
if(istype(multibelt_holder, /obj/item/robotic_multibelt/materials))
var/datum/matter_synth/synth = locate(params["tool"])
target.module.synths -= synth
qdel(synth)
target.update_material_multibelts()
return TRUE
var/obj/item/rem_tool = locate(params["tool"])
if(multibelt_holder.selected_item == rem_tool)
multibelt_holder.dropped() //Reset to original icon.
multibelt_holder.contents -= rem_tool
multibelt_holder.cyborg_integrated_tools -= rem_tool.type
multibelt_holder.integrated_tools_by_name -= rem_tool.name
multibelt_holder.integrated_tool_images -= rem_tool.name
qdel(rem_tool)
return TRUE
if("add_channel")
var/selected_radio_channel = params["channel"]
if(selected_radio_channel == CHANNEL_SPECIAL_OPS || selected_radio_channel == CHANNEL_RESPONSE_TEAM)
@@ -694,6 +732,33 @@
pka["max_capacity"] = kin.max_mod_capacity
return pka
/datum/eventkit/modify_robot/proc/get_mult_belt(var/obj/item/robotic_multibelt/mult_belt)
var/list/multi_belt_list = list()
multi_belt_list["name"] = mult_belt.name
multi_belt_list["ref"] = REF(mult_belt)
var/list/integrated_tools = list()
var/list/tools = list()
if(istype(mult_belt, /obj/item/robotic_multibelt/materials))
for(var/datum/matter_synth/synth in target.module.synths)
integrated_tools += list(list("name" = synth.name, "ref" = "\ref[synth]"))
for(var/tool in GLOB.material_synth_list)
var/material_path = GLOB.material_synth_list[tool]
if(!target.can_install_synth(material_path)) //Don't add it to the list if we already have it!
continue
tools += list(list("name" = tool, "path" = material_path))
else
for(var/obj/tool in mult_belt.contents)
integrated_tools += list(list("name" = tool.name, "ref" = "\ref[tool]"))
for(var/tool in GLOB.all_borg_multitool_options)
if(tool in mult_belt.cyborg_integrated_tools) //Don't add it to the list if we already have it!
continue
var/obj/item/tool_to_add = tool
tools += list(list("name" = initial(tool_to_add.name), "path" = tool_to_add))
multi_belt_list["integrated_tools"] = integrated_tools
multi_belt_list["tools"] = tools
return multi_belt_list
/datum/eventkit/modify_robot/proc/get_cells()
var/list/cell_options = list()
for(var/cell in typesof(/obj/item/cell))

View File

@@ -861,11 +861,11 @@ CHOMP Remove end */
if(A.outdoors)
return AREA_SPACE
for (var/type in BUILDABLE_AREA_TYPES)
for (var/type in GLOB.BUILDABLE_AREA_TYPES)
if ( istype(A,type) )
return AREA_SPACE
for (var/type in SPECIALS)
for (var/type in GLOB.SPECIALS)
if ( istype(A,type) )
return AREA_SPECIAL
return AREA_STATION