From 949278045da90e2b22433caadc2d1c094b6025de Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Tue, 18 Jun 2024 22:19:47 -0400 Subject: [PATCH 1/6] behavior --- code/datums/research_upgrade_datum.dm | 2 +- .../reagents/chemistry_machinery/xenomorph_analyzer.dm | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/datums/research_upgrade_datum.dm b/code/datums/research_upgrade_datum.dm index 1620543f6604..741541745f48 100644 --- a/code/datums/research_upgrade_datum.dm +++ b/code/datums/research_upgrade_datum.dm @@ -3,7 +3,7 @@ var/name = "Upgrade." ///name of upgrades, not items. Items are at research_upgrades.dm somewhere in item folder. var/desc = "something is broken. yippee!!" - ///which behavior should this type follow. Should this be completely excluded from the buy menu? should it be one of the dropdown options? This is also what gets passed to the initizialize of an item, this can be any number *but* it cannot be -1 or -2, as it messes with the buy menu. + ///which behavior should this type follow. Should this be completely excluded from the buy menu? should it be one of the dropdown options? This is also what gets passed to the initizialize of an item, this can be any number *but* it cannot be -1 or -2, as it messes with the buy menu. null to not pass anything. var/behavior = RESEARCH_UPGRADE_EXCLUDE_BUY // should this be on the list? /// the price of the upgrade, refer to this: 500 is a runner, 8k is queen. T3 is usually 3k, woyer is 2k. var/value_upgrade = 1000 diff --git a/code/modules/reagents/chemistry_machinery/xenomorph_analyzer.dm b/code/modules/reagents/chemistry_machinery/xenomorph_analyzer.dm index 5bf6561b28f4..499a68d36f63 100644 --- a/code/modules/reagents/chemistry_machinery/xenomorph_analyzer.dm +++ b/code/modules/reagents/chemistry_machinery/xenomorph_analyzer.dm @@ -178,5 +178,8 @@ /obj/structure/machinery/xenoanalyzer/proc/print_upgrade(produce_path, variation) busy = FALSE - new produce_path(get_turf(src), variation) + if(!isnull(variation)) + new produce_path(get_turf(src), variation) + return + new produce_path(get_turf(src)) From b9a36b99b870c56620aec101555773f948c8857e Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Tue, 18 Jun 2024 22:23:06 -0400 Subject: [PATCH 2/6] remove behavior where its not needed --- code/datums/research_upgrade_datum.dm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/code/datums/research_upgrade_datum.dm b/code/datums/research_upgrade_datum.dm index 741541745f48..7161a38ff931 100644 --- a/code/datums/research_upgrade_datum.dm +++ b/code/datums/research_upgrade_datum.dm @@ -62,7 +62,7 @@ /datum/research_upgrades/machinery/sleeper name = "Sleeper Upgrade" desc = "Research upgrade for Sleeper system, technology on this disk is used on a sleeper to allow wider spectrum of chemicals to be administered, as well as upgrading dialysis software." - behavior = RESEARCH_UPGRADE_TIER_1 + behavior = null value_upgrade = 500 item_reference = /obj/item/research_upgrades/sleeper upgrade_type = ITEM_MACHINERY_UPGRADE @@ -77,7 +77,7 @@ desc = "Sell the data acquired to the nearest Weyland-Yutani Science division team for 8 or 9 points." value_upgrade = 2000 item_reference = /obj/item/research_upgrades/credits - behavior = RESEARCH_UPGRADE_TIER_1 + behavior = null upgrade_type = ITEM_ACCESSORY_UPGRADE change_purchase = 500 maximum_price = 5000 @@ -88,7 +88,7 @@ desc = "An advanced, robust version of the normal scalpel, allowing it to pierce through thick skin and chitin alike with extreme ease." value_upgrade = 3000 item_reference = /obj/item/tool/surgery/scalpel/laser/advanced - behavior = RESEARCH_UPGRADE_TIER_1 + behavior = null upgrade_type = ITEM_ACCESSORY_UPGRADE clearance_req = 3 @@ -97,7 +97,7 @@ desc = "A true extension of the surgeon's body, this marvel instantly and completely prepares an incision, allowing for the immediate commencement of therapeutic steps." value_upgrade = 3000 item_reference = /obj/item/tool/surgery/scalpel/manager - behavior = RESEARCH_UPGRADE_TIER_1 + behavior = null upgrade_type = ITEM_ACCESSORY_UPGRADE clearance_req = 4 /datum/research_upgrades/item/nanosplints @@ -119,7 +119,7 @@ name = "Universal Translator Plate" desc = "A uniform-attachable plate capable of translating any unknown language heard by the wearer." value_upgrade = 2000 - behavior = RESEARCH_UPGRADE_TIER_1 + behavior = null clearance_req = 6 upgrade_type = ITEM_ARMOR_UPGRADE item_reference = /obj/item/clothing/accessory/health/research_plate/translator @@ -129,7 +129,7 @@ name = "Active Blood Coagulator Plate" desc = "A uniform-attachable plate capable of coagulating any bleeding wounds the user possesses." value_upgrade = 1200 - behavior = RESEARCH_UPGRADE_TIER_1 + behavior = null clearance_req = 2 change_purchase = -200 minimum_price = 200 @@ -141,7 +141,7 @@ desc = "A medical plate with two buttons on the sides and a hefty chemical tank. Attached to a uniform and on a simultaneous press, it injects an emergency dose of medical chemicals much larger than a normal emergency autoinjector. Single time use and is recycled in biomass printer. Features overdose protection." value_upgrade = 250 clearance_req = 1 - behavior = RESEARCH_UPGRADE_TIER_1 + behavior = null change_purchase = -100 minimum_price = 100 upgrade_type = ITEM_ARMOR_UPGRADE @@ -152,7 +152,7 @@ desc = "A strong trauma plate, able to protect the user from a large amount of bullets. Completely useless against sharp objects." value_upgrade = 500 clearance_req = 4 - behavior = RESEARCH_UPGRADE_TIER_1 + behavior = null upgrade_type = ITEM_ARMOR_UPGRADE change_purchase = -50 minimum_price = 200 @@ -163,7 +163,7 @@ desc = "preservation plate which activates once the user is dead, uses variety of different substances and sensors to slow down the decay and increase the time before the user is permanently dead, due to small tank of preservatives, it needs to be replaced on each death. Extends time to permadeath by around four minutes." value_upgrade = 500 clearance_req = 4 - behavior = RESEARCH_UPGRADE_TIER_1 + behavior = null upgrade_type = ITEM_ARMOR_UPGRADE change_purchase = -100 minimum_price = 100 From 287b96d7daf01b467ab3d3793b6114353926d084 Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Tue, 18 Jun 2024 22:40:21 -0400 Subject: [PATCH 3/6] coool commit --- code/__DEFINES/misc.dm | 1 + code/datums/research_upgrade_datum.dm | 48 ++++++++++++++++++--------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 3da1aa8d24c0..82b0d99593d5 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -162,6 +162,7 @@ #define MATRIX_NVG 1 #define MATRIX_WIDE 2 +#define RESEARCH_UPGRADE_NOTHING_TO_PASS null #define RESEARCH_UPGRADE_EXCLUDE_BUY -2 #define RESEARCH_UPGRADE_CATEGORY -1 //lord forgive me #define RESEARCH_UPGRADE_TIER_1 1 diff --git a/code/datums/research_upgrade_datum.dm b/code/datums/research_upgrade_datum.dm index 7161a38ff931..89a8551ade50 100644 --- a/code/datums/research_upgrade_datum.dm +++ b/code/datums/research_upgrade_datum.dm @@ -3,8 +3,10 @@ var/name = "Upgrade." ///name of upgrades, not items. Items are at research_upgrades.dm somewhere in item folder. var/desc = "something is broken. yippee!!" - ///which behavior should this type follow. Should this be completely excluded from the buy menu? should it be one of the dropdown options? This is also what gets passed to the initizialize of an item, this can be any number *but* it cannot be -1 or -2, as it messes with the buy menu. null to not pass anything. + ///which behavior should this type follow. Should this be completely excluded from the buy menu? should it be one of the dropdown options? var/behavior = RESEARCH_UPGRADE_EXCLUDE_BUY // should this be on the list? + //This is what gets passed to the initizialize of an item, RESEARCH_UPGRADE_NOTHING_TO_PASS to not pass anything. + var/on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS /// the price of the upgrade, refer to this: 500 is a runner, 8k is queen. T3 is usually 3k, woyer is 2k. var/value_upgrade = 1000 /// actual path to the item.(upgrade) @@ -33,28 +35,32 @@ /datum/research_upgrades/machinery/autodoc/internal_bleed name = "AutoDoc Internal Bleeding Repair" desc = "A data and instruction set for the AutoDoc, making it capable of rapidly fixing internal bleeding." - behavior = RESEARCH_UPGRADE_TIER_1 + on_init_argument = RESEARCH_UPGRADE_TIER_1 + behavior = RESEARCH_UPGRADE_ITEM value_upgrade = 200 clearance_req = 1 /datum/research_upgrades/machinery/autodoc/broken_bone name = "AutoDoc Bone Fracture Repair" desc = "A data instruction set for the AutoDoc, making it capable of setting fractures and applying bonegel." - behavior = RESEARCH_UPGRADE_TIER_2 + on_init_argument = RESEARCH_UPGRADE_TIER_2 + behavior = RESEARCH_UPGRADE_ITEM value_upgrade = 2000 clearance_req = 3 /datum/research_upgrades/machinery/autodoc/organ_damage name = "AutoDoc Broken Organ Repair" desc = "A data and instruction set for the AutoDoc, making it capable of fixing organ damage." - behavior = RESEARCH_UPGRADE_TIER_3 + on_init_argument = RESEARCH_UPGRADE_TIER_3 + behavior = RESEARCH_UPGRADE_ITEM value_upgrade = 1500 clearance_req = 2 /datum/research_upgrades/machinery/autodoc/larva_removal name = "AutoDoc Embryo Removal" desc = "Data and instruction set for AutoDoc making it mildly proficient in removing parasites left by unknown organism." - behavior = RESEARCH_UPGRADE_TIER_4 + on_init_argument = RESEARCH_UPGRADE_TIER_4 + behavior = RESEARCH_UPGRADE_ITEM value_upgrade = 4000 clearance_req = 6 @@ -62,7 +68,8 @@ /datum/research_upgrades/machinery/sleeper name = "Sleeper Upgrade" desc = "Research upgrade for Sleeper system, technology on this disk is used on a sleeper to allow wider spectrum of chemicals to be administered, as well as upgrading dialysis software." - behavior = null + on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS + behavior = RESEARCH_UPGRADE_ITEM value_upgrade = 500 item_reference = /obj/item/research_upgrades/sleeper upgrade_type = ITEM_MACHINERY_UPGRADE @@ -77,7 +84,8 @@ desc = "Sell the data acquired to the nearest Weyland-Yutani Science division team for 8 or 9 points." value_upgrade = 2000 item_reference = /obj/item/research_upgrades/credits - behavior = null + on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS + behavior = RESEARCH_UPGRADE_ITEM upgrade_type = ITEM_ACCESSORY_UPGRADE change_purchase = 500 maximum_price = 5000 @@ -88,7 +96,8 @@ desc = "An advanced, robust version of the normal scalpel, allowing it to pierce through thick skin and chitin alike with extreme ease." value_upgrade = 3000 item_reference = /obj/item/tool/surgery/scalpel/laser/advanced - behavior = null + on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS + behavior = RESEARCH_UPGRADE_ITEM upgrade_type = ITEM_ACCESSORY_UPGRADE clearance_req = 3 @@ -97,7 +106,8 @@ desc = "A true extension of the surgeon's body, this marvel instantly and completely prepares an incision, allowing for the immediate commencement of therapeutic steps." value_upgrade = 3000 item_reference = /obj/item/tool/surgery/scalpel/manager - behavior = null + on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS + behavior = RESEARCH_UPGRADE_ITEM upgrade_type = ITEM_ACCESSORY_UPGRADE clearance_req = 4 /datum/research_upgrades/item/nanosplints @@ -108,7 +118,8 @@ change_purchase = -200 minimum_price = 200 item_reference = /obj/item/stack/medical/splint/nano/research - behavior = RESEARCH_UPGRADE_TIER_5 //adjust this to change amount of nanosplints in a stack, cant be higher than five, go change max_amount in the nanosplint itself, then change it. + on_init_argument = RESEARCH_UPGRADE_TIER_5 //adjust this to change amount of nanosplints in a stack, cant be higher than five, go change max_amount in the nanosplint itself, then change it. + behavior = RESEARCH_UPGRADE_ITEM upgrade_type = ITEM_ACCESSORY_UPGRADE /datum/research_upgrades/armor @@ -119,7 +130,8 @@ name = "Universal Translator Plate" desc = "A uniform-attachable plate capable of translating any unknown language heard by the wearer." value_upgrade = 2000 - behavior = null + on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS + behavior = RESEARCH_UPGRADE_ITEM clearance_req = 6 upgrade_type = ITEM_ARMOR_UPGRADE item_reference = /obj/item/clothing/accessory/health/research_plate/translator @@ -129,7 +141,8 @@ name = "Active Blood Coagulator Plate" desc = "A uniform-attachable plate capable of coagulating any bleeding wounds the user possesses." value_upgrade = 1200 - behavior = null + on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS + behavior = RESEARCH_UPGRADE_ITEM clearance_req = 2 change_purchase = -200 minimum_price = 200 @@ -141,7 +154,8 @@ desc = "A medical plate with two buttons on the sides and a hefty chemical tank. Attached to a uniform and on a simultaneous press, it injects an emergency dose of medical chemicals much larger than a normal emergency autoinjector. Single time use and is recycled in biomass printer. Features overdose protection." value_upgrade = 250 clearance_req = 1 - behavior = null + on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS + behavior = RESEARCH_UPGRADE_ITEM change_purchase = -100 minimum_price = 100 upgrade_type = ITEM_ARMOR_UPGRADE @@ -152,7 +166,8 @@ desc = "A strong trauma plate, able to protect the user from a large amount of bullets. Completely useless against sharp objects." value_upgrade = 500 clearance_req = 4 - behavior = null + on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS + behavior = RESEARCH_UPGRADE_ITEM upgrade_type = ITEM_ARMOR_UPGRADE change_purchase = -50 minimum_price = 200 @@ -160,10 +175,11 @@ /datum/research_upgrades/armor/preservation name = "Death Preservation Plate" - desc = "preservation plate which activates once the user is dead, uses variety of different substances and sensors to slow down the decay and increase the time before the user is permanently dead, due to small tank of preservatives, it needs to be replaced on each death. Extends time to permadeath by around four minutes." + desc = "Preservation plate which activates once the user is dead, uses variety of different substances and sensors to slow down the decay and increase the time before the user is permanently dead, due to small tank of preservatives, it needs to be replaced on each death. Extends time to permadeath by around four minutes." value_upgrade = 500 clearance_req = 4 - behavior = null + on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS + behavior = RESEARCH_UPGRADE_ITEM upgrade_type = ITEM_ARMOR_UPGRADE change_purchase = -100 minimum_price = 100 From f0b81a2b8f4faa06ddc6d6e3fc1ab05dd72887bf Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Tue, 18 Jun 2024 22:40:53 -0400 Subject: [PATCH 4/6] aaa --- code/__DEFINES/misc.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 82b0d99593d5..9f14423b5964 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -165,6 +165,7 @@ #define RESEARCH_UPGRADE_NOTHING_TO_PASS null #define RESEARCH_UPGRADE_EXCLUDE_BUY -2 #define RESEARCH_UPGRADE_CATEGORY -1 //lord forgive me +#define RESEARCH_UPGRADE_ITEM 1 #define RESEARCH_UPGRADE_TIER_1 1 #define RESEARCH_UPGRADE_TIER_2 2 #define RESEARCH_UPGRADE_TIER_3 3 From 7e7e51f63b4bc8160df07b9e1af98ba4a4f2633e Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Tue, 18 Jun 2024 22:44:22 -0400 Subject: [PATCH 5/6] this --- code/datums/research_upgrade_datum.dm | 2 +- .../reagents/chemistry_machinery/xenomorph_analyzer.dm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/datums/research_upgrade_datum.dm b/code/datums/research_upgrade_datum.dm index 89a8551ade50..3a39c849b79d 100644 --- a/code/datums/research_upgrade_datum.dm +++ b/code/datums/research_upgrade_datum.dm @@ -3,7 +3,7 @@ var/name = "Upgrade." ///name of upgrades, not items. Items are at research_upgrades.dm somewhere in item folder. var/desc = "something is broken. yippee!!" - ///which behavior should this type follow. Should this be completely excluded from the buy menu? should it be one of the dropdown options? + ///which behavior should this type follow. Should this be completely excluded from the buy menu? should it be one of the dropdown options? or a normal item? var/behavior = RESEARCH_UPGRADE_EXCLUDE_BUY // should this be on the list? //This is what gets passed to the initizialize of an item, RESEARCH_UPGRADE_NOTHING_TO_PASS to not pass anything. var/on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS diff --git a/code/modules/reagents/chemistry_machinery/xenomorph_analyzer.dm b/code/modules/reagents/chemistry_machinery/xenomorph_analyzer.dm index 499a68d36f63..62ceb37386ff 100644 --- a/code/modules/reagents/chemistry_machinery/xenomorph_analyzer.dm +++ b/code/modules/reagents/chemistry_machinery/xenomorph_analyzer.dm @@ -96,7 +96,7 @@ data["upgrades"] += list(list( "name" = capitalize_first_letters(upgrade.name), "desc" = upgrade.desc, - "vari" = upgrade.behavior, + "vari" = upgrade.on_init_argument, "cost" = price_adjustment, "ref" = upgrade.item_reference, "category" = upgrade.upgrade_type, @@ -158,7 +158,7 @@ upgrade = datum_upgrades if(upgrade.behavior == RESEARCH_UPGRADE_CATEGORY || upgrade.behavior == RESEARCH_UPGRADE_EXCLUDE_BUY) continue - if(produce_path == upgrade.item_reference && upgrade.behavior == variation) + if(produce_path == upgrade.item_reference && upgrade.on_init_argument == variation) path_exists = TRUE break if(!path_exists) @@ -178,7 +178,7 @@ /obj/structure/machinery/xenoanalyzer/proc/print_upgrade(produce_path, variation) busy = FALSE - if(!isnull(variation)) + if(variation != RESEARCH_UPGRADE_NOTHING_TO_PASS) new produce_path(get_turf(src), variation) return new produce_path(get_turf(src)) From e28f4a797cfb73fcc0aa57b6c1af3fd0ee5b0f6d Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Wed, 19 Jun 2024 14:42:26 -0400 Subject: [PATCH 6/6] thiss too --- code/datums/research_upgrade_datum.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/datums/research_upgrade_datum.dm b/code/datums/research_upgrade_datum.dm index c713d95ea597..fd571afdfcf0 100644 --- a/code/datums/research_upgrade_datum.dm +++ b/code/datums/research_upgrade_datum.dm @@ -132,7 +132,8 @@ minimum_price = 100 maximum_price = 1000 item_reference = /obj/item/ammo_magazine/flamer_tank/custom/upgraded - behavior = RESEARCH_UPGRADE_NULL + on_init_argument = RESEARCH_UPGRADE_NOTHING_TO_PASS + behavior = RESEARCH_UPGRADE_ITEM upgrade_type = ITEM_ACCESSORY_UPGRADE /datum/research_upgrades/item/flamer_tank/smoke