From c4a9044ad354fa003db02858fcbf54ff422c8c16 Mon Sep 17 00:00:00 2001 From: Coolrune206 <71326864+Coolrune206@users.noreply.github.com> Date: Fri, 25 Nov 2022 07:47:24 +1000 Subject: [PATCH] Fixes the syndie multitool tech origin, adds unit test for origin tech (#19729) * fixes the syndie multitool tech origin, I am god * someone didn't know how origin_tech worked heh * I dunno what this is but AA wanted it * Revert "I dunno what this is but AA wanted it" This reverts commit 073dc5b8b5c968de25996c9d045ba8743d6890fc. * maybe this-a-work? * Revert "maybe this-a-work?" This reverts commit 6b9b4a43a1dcf1fdd0e3518fd710505bf6dc3a4e. * Affected Arc, more like Affected Arc * WILL, THIS, WORK? * amogus * I'm a genius * Warriorstar request --- code/game/objects/items/tools/multitool.dm | 2 +- code/modules/unit_tests/_unit_tests.dm | 1 + code/modules/unit_tests/origin_tech.dm | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 code/modules/unit_tests/origin_tech.dm diff --git a/code/game/objects/items/tools/multitool.dm b/code/game/objects/items/tools/multitool.dm index b8151e40b99..f0d1a98fabd 100644 --- a/code/game/objects/items/tools/multitool.dm +++ b/code/game/objects/items/tools/multitool.dm @@ -105,7 +105,7 @@ icon_state = "multitool_syndi" belt_icon = "multitool_syndi" toolspeed = 0.95 // dangerously fast... not like multitools use speed anyways - origin_tech = "magnets=1;engineering=2,syndicate=1" + origin_tech = "magnets=1;engineering=2;syndicate=1" /obj/item/multitool/ai_detect/admin desc = "Used for pulsing wires to test which to cut. Not recommended by doctors. Has a strange tag that says 'Grief in Safety'" //What else should I say for a meme item? diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index 5147bf47b6e..dd0bbd0ed9c 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -11,6 +11,7 @@ #include "log_format.dm" #include "map_templates.dm" #include "map_tests.dm" +#include "origin_tech.dm" #include "purchase_reference_test.dm" #include "reagent_id_typos.dm" #include "rustg_version.dm" diff --git a/code/modules/unit_tests/origin_tech.dm b/code/modules/unit_tests/origin_tech.dm new file mode 100644 index 00000000000..177c89b36b9 --- /dev/null +++ b/code/modules/unit_tests/origin_tech.dm @@ -0,0 +1,12 @@ +// Unit test to ensure people have appropriately set up their origin_techs in items, ensuring they give the appropriate resources in RnD breakdown +/datum/unit_test/origin_tech/Run() + var/regex/nums = regex("^\[0-9]+") + for(var/tpath in subtypesof(/obj/item)) + var/obj/item/I = tpath + var/tech_str = initial(I.origin_tech) + + var/list/tech_list = params2list(tech_str) + + for(var/k in tech_list) + if(length(nums.Replace(tech_list[k], "")) > 0) + Fail("Invalid origin tech for [tpath]: [tech_str]")