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.