From bb4f09cd92b09a97e9a1d1c13417754bf76d98e7 Mon Sep 17 00:00:00 2001 From: zxaber <37497534+zxaber@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:29:53 -0800 Subject: [PATCH] Replaces the Exosuit Materials 2 experiment with one about equipping mechs rather than destroying them. (#80267) ## About The Pull Request Replaces "Exosuit Materials 2: Excessive Damage Test" with "Exosuit Materials 2: Load Strain Test". Rather than building and then destroying two exosuits, you now equip them with any two (compatible) main equipment pieces. Once the experiment is done, you'll have two exosuits still, so consider making exosuits that you can donate to other crew afterwards. Note that the exosuit *has* to be built by the crew. Round-start exosuits (or those obtained through other means like the nuke ops' uplink) will not work. ## Why It's Good For The Game The idea of creating and destroying a few rounds of mechs sounds like a neat concept. But in practice, it burns through station resources for no real good reason, and is somewhat antithetical to the idea of robotics making mechs for other departments. With this change, you're still required to make the two mechs if you want the discount, but now they'll be available afterwards. If someone has requested a mech for their department, for example, you can now accomplish that and part of this experiment simultaneously. ## Changelog :cl: add: Adds a new discount experiment for unlocking the combat exosuit nodes - complete it by scanning two exosuits with equipment in the left and right hand slots. This replaces the prior discount experiment about destroying exosuits. /:cl: --- code/__DEFINES/traits/declarations.dm | 3 +++ code/_globalvars/traits/_traits.dm | 3 +++ .../experisci/experiment/experiments.dm | 18 ++++++++++++++---- code/modules/research/techweb/all_nodes.dm | 2 +- .../mecha/equipment/tools/work_tools.dm | 2 ++ .../vehicles/mecha/mecha_construction_paths.dm | 1 + 6 files changed, 24 insertions(+), 5 deletions(-) diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 56f5f72f8bd..60366b69a12 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -820,6 +820,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// Trait given to mechs that can have orebox functionality on movement #define TRAIT_OREBOX_FUNCTIONAL "orebox_functional" +///A trait for mechs that were created through the normal construction process, and not spawned by map or other effects. +#define TRAIT_MECHA_CREATED_NORMALLY "trait_mecha_created_normally" + ///fish traits #define TRAIT_RESIST_EMULSIFY "resist_emulsify" #define TRAIT_FISH_SELF_REPRODUCE "fish_self_reproduce" diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 7bc2f8100b8..5fd5f03fd50 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -555,6 +555,9 @@ GLOBAL_LIST_INIT(traits_by_type, list( /obj/vehicle = list( "TRAIT_OREBOX_FUNCTIONAL" = TRAIT_OREBOX_FUNCTIONAL, ), + /obj/vehicle/sealed/mecha = list( + "TRAIT_MECHA_CREATED_NORMALLY" = TRAIT_MECHA_CREATED_NORMALLY + ), /turf = list( "TRAIT_CHASM_STOPPED" = TRAIT_CHASM_STOPPED, "TRAIT_FIREDOOR_STOP" = TRAIT_FIREDOOR_STOP, diff --git a/code/modules/experisci/experiment/experiments.dm b/code/modules/experisci/experiment/experiments.dm index 31a8fb8ce55..5a4bf4ba028 100644 --- a/code/modules/experisci/experiment/experiments.dm +++ b/code/modules/experisci/experiment/experiments.dm @@ -333,12 +333,22 @@ var/found_percent = round((target.get_integrity() / target.max_integrity) * 100) return ..() && (found_percent <= (damage_percent + 2) && found_percent >= (damage_percent - 2)) -/datum/experiment/scanning/random/mecha_destroyed_scan - name = "Exosuit Materials 2: Excessive Damage Test" - description = "As an extension of testing exosuit damage results, scanning examples of complete structural failure will accelerate our material stress simulations." - possible_types = list(/obj/structure/mecha_wreckage) +/datum/experiment/scanning/random/mecha_equipped_scan + name = "Exosuit Materials 2: Load Strain Test" + description = "Exosuit equipment places unique strain upon the structure of the vehicle. Scan exosuits you have assembled from your exosuit fabricator and fully equipped to accelerate our structural stress simulations." + possible_types = list(/obj/vehicle/sealed/mecha) total_requirement = 2 +/datum/experiment/scanning/random/mecha_equipped_scan/final_contributing_index_checks(atom/target, typepath) + var/obj/vehicle/sealed/mecha/stompy = target + if(!istype(stompy)) + return FALSE //Not a mech + if(!HAS_TRAIT(stompy,TRAIT_MECHA_CREATED_NORMALLY)) + return FALSE //Not hand-crafted + if(!(stompy.equip_by_category[MECHA_L_ARM] && stompy.equip_by_category[MECHA_R_ARM])) + return FALSE //Both arms need be filled + return ..() + /// Scan for organs you didn't start the round with /datum/experiment/scanning/people/novel_organs name = "Human Field Research: Divergent Biology" diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 22054119594..1ef4ccd1c63 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -2011,7 +2011,7 @@ "mech_proj_armor", ) required_experiments = list(/datum/experiment/scanning/random/mecha_damage_scan) - discount_experiments = list(/datum/experiment/scanning/random/mecha_destroyed_scan = 5000) + discount_experiments = list(/datum/experiment/scanning/random/mecha_equipped_scan = 5000) research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 10000) /datum/techweb_node/mech_scattershot diff --git a/code/modules/vehicles/mecha/equipment/tools/work_tools.dm b/code/modules/vehicles/mecha/equipment/tools/work_tools.dm index 4b87f7484fd..eb5041e23da 100644 --- a/code/modules/vehicles/mecha/equipment/tools/work_tools.dm +++ b/code/modules/vehicles/mecha/equipment/tools/work_tools.dm @@ -392,6 +392,8 @@ if(markone.name != initial(markone.name)) newmech.name = markone.name markone.wreckage = FALSE + if(HAS_TRAIT(markone, TRAIT_MECHA_CREATED_NORMALLY)) + ADD_TRAIT(newmech, TRAIT_MECHA_CREATED_NORMALLY, newmech) qdel(markone) playsound(get_turf(newmech),'sound/items/ratchet.ogg',50,TRUE) diff --git a/code/modules/vehicles/mecha/mecha_construction_paths.dm b/code/modules/vehicles/mecha/mecha_construction_paths.dm index 3ff01b51166..3287d66c7bf 100644 --- a/code/modules/vehicles/mecha/mecha_construction_paths.dm +++ b/code/modules/vehicles/mecha/mecha_construction_paths.dm @@ -33,6 +33,7 @@ var/obj/item/mecha_parts/chassis/parent_chassis = parent mech.CheckParts(parent_chassis.contents) SSblackbox.record_feedback("tally", "mechas_created", 1, mech.name) + ADD_TRAIT(mech, TRAIT_MECHA_CREATED_NORMALLY, mech) QDEL_NULL(parent) // Default proc to generate mech steps.