diff --git a/code/modules/mechs/components/_components.dm b/code/modules/mechs/components/_components.dm index 288e585b5c1f5..5a187425224b9 100644 --- a/code/modules/mechs/components/_components.dm +++ b/code/modules/mechs/components/_components.dm @@ -33,7 +33,6 @@ . = ..() if(ready_to_install()) to_chat(user, SPAN_NOTICE("It is ready for installation.")) - else show_missing_parts(user) //These icons have multiple directions but before they're attached we only want south. diff --git a/code/modules/mechs/components/arms.dm b/code/modules/mechs/components/arms.dm index 1a797fa45a43b..17d369d55a56d 100644 --- a/code/modules/mechs/components/arms.dm +++ b/code/modules/mechs/components/arms.dm @@ -19,9 +19,6 @@ if(!motivator) to_chat(user, SPAN_WARNING("It is missing an actuator.")) -/obj/item/mech_component/manipulators/ready_to_install() - return motivator - /obj/item/mech_component/manipulators/prebuild() motivator = new(src) diff --git a/code/modules/mechs/components/body.dm b/code/modules/mechs/components/body.dm index 3f9e691a0b437..ab00866289e6b 100644 --- a/code/modules/mechs/components/body.dm +++ b/code/modules/mechs/components/body.dm @@ -26,6 +26,7 @@ var/obj/item/cell/cell var/obj/item/robot_parts/robot_component/diagnosis_unit/diagnostics var/obj/item/robot_parts/robot_component/armour/exosuit/m_armour + var/obj/item/mech_component/control_module/software var/obj/machinery/portable_atmospherics/canister/air_supply var/obj/item/storage/mech/storage_compartment var/datum/gas_mixture/cockpit @@ -39,6 +40,11 @@ has_hardpoints = list(HARDPOINT_BACK, HARDPOINT_LEFT_SHOULDER, HARDPOINT_RIGHT_SHOULDER) var/damage_sound = 'sound/effects/bang.ogg' var/climb_time = 25 + ///If the body type can hold a head. + var/sensor_housing = TRUE + + /// Takes /obj/item/circuitboard/exosystem type paths for what boards get put in for prefabs + var/list/prebuilt_software = list() /obj/item/mech_component/chassis/New() ..() @@ -57,6 +63,7 @@ QDEL_NULL(diagnostics) QDEL_NULL(m_armour) QDEL_NULL(air_supply) + QDEL_NULL(software) QDEL_NULL(storage_compartment) . = ..() @@ -65,6 +72,7 @@ cell = locate() in src m_armour = locate() in src air_supply = locate() in src + software = locate() in src storage_compartment = locate() in src /obj/item/mech_component/chassis/show_missing_parts(mob/user) @@ -74,6 +82,8 @@ to_chat(user, SPAN_WARNING("It is missing a diagnostics unit.")) if(!m_armour) to_chat(user, SPAN_WARNING("It is missing exosuit armour plating.")) + if(!software) + to_chat(user, SPAN_WARNING("It is missing a software control module.")) /obj/item/mech_component/chassis/Initialize() . = ..() @@ -136,15 +146,23 @@ if(changed) cockpit.react() -/obj/item/mech_component/chassis/ready_to_install() - return (cell && diagnostics && m_armour) - /obj/item/mech_component/chassis/prebuild() diagnostics = new(src) cell = new /obj/item/cell/high(src) cell.charge = cell.maxcharge + software = new(src) + for(var/board in prebuilt_software) + software.install_software(new board) /obj/item/mech_component/chassis/use_tool(obj/item/thing, mob/living/user, list/click_params) + if(istype(thing, /obj/item/mech_component/control_module)) + if(software) + to_chat(user, SPAN_WARNING("\The [src] already has a control modules installed.")) + return TRUE + if(install_component(thing, user)) + software = thing + return TRUE + if(istype(thing,/obj/item/robot_parts/robot_component/diagnosis_unit)) if(diagnostics) to_chat(user, SPAN_WARNING("\The [src] already has a diagnostic system installed.")) @@ -197,6 +215,12 @@ /obj/item/mech_component/chassis/return_diagnostics(mob/user) ..() + if(software) + to_chat(user, SPAN_NOTICE(" Installed Software")) + for(var/exosystem_software in software.installed_software) + to_chat(user, SPAN_NOTICE(" - [capitalize(exosystem_software)]")) + else + to_chat(user, SPAN_WARNING(" Control Module Missing or Non-functional.")) if(diagnostics) to_chat(user, SPAN_NOTICE(" Diagnostics Unit Integrity: [round((((diagnostics.max_dam - diagnostics.total_dam) / diagnostics.max_dam)) * 100)]%")) else @@ -206,7 +230,6 @@ else to_chat(user, SPAN_WARNING(" Armor Missing or Non-functional.")) - /obj/item/mech_component/chassis/powerloader name = "open exosuit chassis" hatch_descriptor = "roll cage" @@ -217,6 +240,7 @@ mech_health = 400 power_use = 0 climb_time = 6 + prebuilt_software = list(/obj/item/circuitboard/exosystem/utility, /obj/item/circuitboard/exosystem/engineering) /obj/item/mech_component/chassis/powerloader/prebuild() . = ..() @@ -252,6 +276,7 @@ damage_sound = 'sound/effects/glass_crack1.ogg' desc = "The Veymed Odysseus series cockpits combine ultralight materials and clear aluminum laminates to provide an optimized cockpit experience." climb_time = 15 + prebuilt_software = list(/obj/item/circuitboard/exosystem/medical, /obj/item/circuitboard/exosystem/utility) /obj/item/mech_component/chassis/light/prebuild() . = ..() @@ -280,6 +305,7 @@ power_use = 5 has_hardpoints = list(HARDPOINT_BACK) desc = "The Necromundan Katamari series cockpits have won a massive tender by Imperium few years back. No one is sure why, but these terrible things keep popping up on every government facility." + prebuilt_software = list(/obj/item/circuitboard/exosystem/utility) /obj/item/mech_component/chassis/pod/Initialize() pilot_positions = list( @@ -324,6 +350,7 @@ mech_health = 750 power_use = 50 has_hardpoints = list(HARDPOINT_BACK) + prebuilt_software = list(/obj/item/circuitboard/exosystem/weapons) /obj/item/mech_component/chassis/heavy/prebuild() pilot_positions = list( @@ -350,6 +377,7 @@ max_damage = 300 mech_health = 500 power_use = 40 + prebuilt_software = list(/obj/item/circuitboard/exosystem/weapons) /obj/item/mech_component/chassis/combat/prebuild() . = ..() @@ -366,3 +394,47 @@ ) . = ..() +/obj/item/mech_component/control_module + name = "exosuit control module" + desc = "A clump of circuitry and software chip docks, used to program exosuits." + icon_state = "control" + icon = 'icons/mecha/mech_equipment.dmi' + gender = NEUTER + color = COLOR_WHITE + var/list/installed_software = list() + var/max_installed_software = 2 + +/obj/item/mech_component/control_module/examine(mob/user) + . = ..() + to_chat(user, SPAN_NOTICE("It has [max_installed_software - LAZYLEN(installed_software)] empty slot\s remaining out of [max_installed_software].")) + +/obj/item/mech_component/control_module/use_tool(obj/item/thing, mob/living/user, list/click_params) + if(istype(thing, /obj/item/circuitboard/exosystem)) + install_software(thing, user) + return TRUE + + if(isScrewdriver(thing)) + var/result = ..() + update_software() + return result + else + return ..() + +/obj/item/mech_component/control_module/proc/install_software(obj/item/circuitboard/exosystem/software, mob/user) + if(length(installed_software) >= max_installed_software) + if(user) + to_chat(user, SPAN_WARNING("\The [src] can only hold [max_installed_software] software modules.")) + return + if(user && !user.unEquip(software)) + return + + if(user) + to_chat(user, SPAN_NOTICE("You load \the [software] into \the [src]'s memory.")) + + software.forceMove(src) + update_software() + +/obj/item/mech_component/control_module/proc/update_software() + installed_software = list() + for(var/obj/item/circuitboard/exosystem/program in contents) + installed_software |= program.contains_software \ No newline at end of file diff --git a/code/modules/mechs/components/frame.dm b/code/modules/mechs/components/frame.dm index 850fa8247b5a7..b3e297cfaf32a 100644 --- a/code/modules/mechs/components/frame.dm +++ b/code/modules/mechs/components/frame.dm @@ -181,7 +181,7 @@ // Screwdriver - Finish construction if (isScrewdriver(tool)) // Check for basic components. - if (!(arms && legs && head && body)) + if (!(body)) USE_FEEDBACK_FAILURE("\The [src] is still missing parts and cannot be completed.") return TRUE // Check for wiring. @@ -208,7 +208,7 @@ if (!user.do_skilled((tool.toolspeed * 5) SECONDS, SKILL_DEVICES, src) || !user.use_sanity_check(src, tool)) return TRUE // Check for basic components. - if (!(arms && legs && head && body)) + if (!(body)) USE_FEEDBACK_FAILURE("\The [src] is still missing parts and cannot be completed.") return TRUE // Check for wiring. @@ -364,6 +364,10 @@ if (body) USE_FEEDBACK_FAILURE("\The [src] already has \a [body] installed.") return TRUE + var/obj/item/mech_component/chassis/m_chest = tool + if (m_chest.total_damage >= m_chest.max_damage) + USE_FEEDBACK_FAILURE("\The [m_chest] is too badly damaged to attach!") + return TRUE if (!install_component(tool, user)) return TRUE body = tool @@ -391,6 +395,12 @@ if (head) USE_FEEDBACK_FAILURE("\The [src] already has \a [head] installed.") return TRUE + if(!body) + USE_FEEDBACK_FAILURE("You must attach a body before attaching sensors!") + return TRUE + if (body && !body.sensor_housing) + USE_FEEDBACK_FAILURE("This type of chassis cannot support sensors!") + return TRUE if (!install_component(tool, user)) return TRUE head = tool diff --git a/code/modules/mechs/components/head.dm b/code/modules/mechs/components/head.dm index 764956b1a2452..e5d80fc1226ad 100644 --- a/code/modules/mechs/components/head.dm +++ b/code/modules/mechs/components/head.dm @@ -7,9 +7,6 @@ var/see_invisible = 0 var/obj/item/robot_parts/robot_component/radio/radio var/obj/item/robot_parts/robot_component/camera/camera - var/obj/item/mech_component/control_module/software - /// Takes /obj/item/circuitboard/exosystem type paths for what boards get put in for prefabs - var/list/prebuilt_software = list() has_hardpoints = list(HARDPOINT_HEAD) var/active_sensors = 0 power_use = 15 @@ -18,7 +15,6 @@ /obj/item/mech_component/sensors/Destroy() QDEL_NULL(camera) QDEL_NULL(radio) - QDEL_NULL(software) . = ..() /obj/item/mech_component/sensors/show_missing_parts(mob/user) @@ -26,24 +22,18 @@ to_chat(user, SPAN_WARNING("It is missing a radio.")) if(!camera) to_chat(user, SPAN_WARNING("It is missing a camera.")) - if(!software) - to_chat(user, SPAN_WARNING("It is missing a software control module.")) /obj/item/mech_component/sensors/prebuild() radio = new(src) camera = new(src) - software = new(src) - for(var/board in prebuilt_software) - software.install_software(new board) /obj/item/mech_component/sensors/update_components() radio = locate() in src camera = locate() in src - software = locate() in src /obj/item/mech_component/sensors/proc/get_sight(powered) var/flags = 0 - if(total_damage >= 0.8 * max_damage || !powered) + if(total_damage >= max_damage || !powered || !camera) flags |= BLIND else if(active_sensors && powered) flags |= vision_flags @@ -52,25 +42,12 @@ /obj/item/mech_component/sensors/proc/get_invisible(powered) var/invisible = 0 - if((total_damage <= 0.8 * max_damage) && active_sensors && powered) + if(total_damage <= max_damage && active_sensors && powered && camera) invisible = see_invisible return invisible - - -/obj/item/mech_component/sensors/ready_to_install() - return (radio && camera) - /obj/item/mech_component/sensors/use_tool(obj/item/thing, mob/living/user, list/click_params) - if(istype(thing, /obj/item/mech_component/control_module)) - if(software) - to_chat(user, SPAN_WARNING("\The [src] already has a control modules installed.")) - return TRUE - if(install_component(thing, user)) - software = thing - return TRUE - - else if(istype(thing,/obj/item/robot_parts/robot_component/radio)) + if(istype(thing,/obj/item/robot_parts/robot_component/radio)) if(radio) to_chat(user, SPAN_WARNING("\The [src] already has a radio installed.")) return TRUE @@ -90,12 +67,6 @@ /obj/item/mech_component/sensors/return_diagnostics(mob/user) ..() - if(software) - to_chat(user, SPAN_NOTICE(" Installed Software")) - for(var/exosystem_software in software.installed_software) - to_chat(user, SPAN_NOTICE(" - [capitalize(exosystem_software)]")) - else - to_chat(user, SPAN_WARNING(" Control Module Missing or Non-functional.")) if(radio) to_chat(user, SPAN_NOTICE(" Radio Integrity: [round((((radio.max_dam - radio.total_dam) / radio.max_dam)) * 100)]%")) else @@ -105,53 +76,6 @@ else to_chat(user, SPAN_WARNING(" Camera Missing or Non-functional.")) - -/obj/item/mech_component/control_module - name = "exosuit control module" - desc = "A clump of circuitry and software chip docks, used to program exosuits." - icon_state = "control" - icon = 'icons/mecha/mech_equipment.dmi' - gender = NEUTER - color = COLOR_WHITE - var/list/installed_software = list() - var/max_installed_software = 2 - -/obj/item/mech_component/control_module/examine(mob/user) - . = ..() - to_chat(user, SPAN_NOTICE("It has [max_installed_software - LAZYLEN(installed_software)] empty slot\s remaining out of [max_installed_software].")) - -/obj/item/mech_component/control_module/use_tool(obj/item/thing, mob/living/user, list/click_params) - if(istype(thing, /obj/item/circuitboard/exosystem)) - install_software(thing, user) - return TRUE - - if(isScrewdriver(thing)) - var/result = ..() - update_software() - return result - else - return ..() - -/obj/item/mech_component/control_module/proc/install_software(obj/item/circuitboard/exosystem/software, mob/user) - if(length(installed_software) >= max_installed_software) - if(user) - to_chat(user, SPAN_WARNING("\The [src] can only hold [max_installed_software] software modules.")) - return - if(user && !user.unEquip(software)) - return - - if(user) - to_chat(user, SPAN_NOTICE("You load \the [software] into \the [src]'s memory.")) - - software.forceMove(src) - update_software() - -/obj/item/mech_component/control_module/proc/update_software() - installed_software = list() - for(var/obj/item/circuitboard/exosystem/program in contents) - installed_software |= program.contains_software - - /obj/item/mech_component/sensors/powerloader name = "exosuit sensors" gender = PLURAL @@ -159,7 +83,6 @@ desc = "A primitive set of sensors designed to work in tandem with most MKI Eyeball platforms." max_damage = 150 power_use = 0 - prebuilt_software = list(/obj/item/circuitboard/exosystem/utility, /obj/item/circuitboard/exosystem/engineering) /obj/item/mech_component/sensors/light name = "light sensors" @@ -171,7 +94,6 @@ see_invisible = SEE_INVISIBLE_NOLIGHTING power_use = 50 desc = "A series of high resolution optical sensors. They can overlay several images to give the pilot a sense of location even in total darkness. " - prebuilt_software = list(/obj/item/circuitboard/exosystem/medical, /obj/item/circuitboard/exosystem/utility) /obj/item/mech_component/sensors/heavy name = "heavy sensors" @@ -180,7 +102,6 @@ icon_state = "heavy_head" max_damage = 300 power_use = 0 - prebuilt_software = list(/obj/item/circuitboard/exosystem/weapons) /obj/item/mech_component/sensors/combat name = "combat sensors" @@ -191,4 +112,3 @@ vision_flags = SEE_MOBS see_invisible = SEE_INVISIBLE_NOLIGHTING power_use = 200 - prebuilt_software = list(/obj/item/circuitboard/exosystem/weapons) diff --git a/code/modules/mechs/components/legs.dm b/code/modules/mechs/components/legs.dm index 3e4731524d85f..f11b671514e2d 100644 --- a/code/modules/mechs/components/legs.dm +++ b/code/modules/mechs/components/legs.dm @@ -19,9 +19,6 @@ if(!motivator) to_chat(user, SPAN_WARNING("It is missing an actuator.")) -/obj/item/mech_component/propulsion/ready_to_install() - return motivator - /obj/item/mech_component/propulsion/update_components() motivator = locate() in src diff --git a/code/modules/mechs/mech_construction.dm b/code/modules/mechs/mech_construction.dm index 1b038c1153bff..ec0479a828217 100644 --- a/code/modules/mechs/mech_construction.dm +++ b/code/modules/mechs/mech_construction.dm @@ -68,11 +68,11 @@ if(ME.restricted_hardpoints && !(system_hardpoint in ME.restricted_hardpoints)) return FALSE if(ME.restricted_software) - if(!head || !head.software) + if(!body || !body.software) return FALSE var/found for(var/software in ME.restricted_software) - if(software in head.software.installed_software) + if(software in body.software.installed_software) found = TRUE break if(!found) diff --git a/maps/away/scavver/scavver_gantry.dm b/maps/away/scavver/scavver_gantry.dm index cdbcc76b6d701..ee80cfca13d76 100644 --- a/maps/away/scavver/scavver_gantry.dm +++ b/maps/away/scavver/scavver_gantry.dm @@ -70,7 +70,7 @@ "Desperado" = list("nav_gantry_desperado") ) -/obj/item/mech_component/sensors/light/salvage +/obj/item/mech_component/chassis/pod/salvage prebuilt_software = list(/obj/item/circuitboard/exosystem/utility, /obj/item/circuitboard/exosystem/engineering) /mob/living/exosuit/premade/salvage_gantry @@ -79,7 +79,7 @@ /mob/living/exosuit/premade/salvage_gantry/Initialize() if(!body) - body = new /obj/item/mech_component/chassis/pod(src) + body = new /obj/item/mech_component/chassis/pod/salvage(src) body.color = COLOR_ORANGE if(!legs) legs = new /obj/item/mech_component/propulsion/spider(src) @@ -88,7 +88,7 @@ arms = new /obj/item/mech_component/manipulators/powerloader(src) arms.color = COLOR_GUNMETAL if(!head) - head = new /obj/item/mech_component/sensors/light/salvage(src) + head = new /obj/item/mech_component/sensors/light(src) head.color = COLOR_GUNMETAL . = ..()