Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion code/modules/mechs/components/_components.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 0 additions & 3 deletions code/modules/mechs/components/arms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
80 changes: 76 additions & 4 deletions code/modules/mechs/components/body.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
..()
Expand All @@ -57,6 +63,7 @@
QDEL_NULL(diagnostics)
QDEL_NULL(m_armour)
QDEL_NULL(air_supply)
QDEL_NULL(software)
QDEL_NULL(storage_compartment)
. = ..()

Expand All @@ -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)
Expand All @@ -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()
. = ..()
Expand Down Expand Up @@ -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."))
Expand Down Expand Up @@ -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(" - <b>[capitalize(exosystem_software)]</b>"))
else
to_chat(user, SPAN_WARNING(" Control Module Missing or Non-functional."))
if(diagnostics)
to_chat(user, SPAN_NOTICE(" Diagnostics Unit Integrity: <b>[round((((diagnostics.max_dam - diagnostics.total_dam) / diagnostics.max_dam)) * 100)]%</b>"))
else
Expand All @@ -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"
Expand All @@ -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()
. = ..()
Expand Down Expand Up @@ -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()
. = ..()
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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()
. = ..()
Expand All @@ -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
14 changes: 12 additions & 2 deletions code/modules/mechs/components/frame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading