From e0cf44509fd6db62f74ef0bf53b7b5e83f16cfe0 Mon Sep 17 00:00:00 2001 From: JesusChristItsJasonBourne Date: Sun, 8 Sep 2019 21:01:58 +1000 Subject: [PATCH] functional gender changing chemicals that respect the users prefs cleanly. --- .../mob/living/carbon/human/human_defines.dm | 1 + .../Chemistry-Reagents_chomp.dm | 47 +++++++++++++++++++ code/modules/reagents/Chemistry-Recipes_ch.dm | 23 ++++++++- 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index d4c33117b2..aded403c8a 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -98,6 +98,7 @@ mob_swap_flags = ~HEAVY var/identifying_gender // In case the human identifies as another gender than it's biological + var/gender_change_cooldown = 0 // A cooldown for gender and gender indentify changing procs to make it easy to avoid spam of gender change var/step_count = 0 // Track how many footsteps have been taken to know when to play footstep sounds diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents_chomp.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents_chomp.dm index 54a7e37954..b9f3157460 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents_chomp.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents_chomp.dm @@ -188,7 +188,54 @@ M.adjustBruteLoss(1) M.adjustToxLoss(1) +/datum/reagent/change_drug //base chemical + name = "Elixer of Change" //always the same name + id = "change_drug" + metabolism = 100 //set high enough that it does not process multiple times(delay implemented below) + description = "the bloods DNA in this seems aggressive" + taste_description = "this shouldn't be here" //unobtainable ingame + color = "#7F0000" + var/gender_change = null //set the gender variable here so we can set it to others in varients +/datum/reagent/change_drug/male //inherits base chemical properties listed above + id = "change_drug_male" //unique ID for each varient + taste_description = "old spice odor blocker body wash" + reagent_state = LIQUID + color = "#428AFF" + gender_change = "male" + scannable = 1 + +/datum/reagent/change_drug/female + id = "change_drug_female" + taste_description = "spiced honey" + reagent_state = LIQUID + color = "#FFA0FA" + gender_change = "female" + scannable = 1 + +/datum/reagent/change_drug/intersex + id = "change_drug_intersex" + taste_description = "something salty and sweet" + reagent_state = LIQUID + color = "#CB9EFF" + gender_change = "herm" + scannable = 1 + +/datum/reagent/change_drug/affect_blood(var/mob/living/carbon/human/M, var/alien, var/removed) //we need to process the change + if(alien == IS_DIONA) //doesn't work on multiple creature hiveminds + return + if(M.identifying_gender == gender_change) //don't bug them if they're already the same gender + return + if(M.gender_change_cooldown == 1) //if already done, don't bug them + return + else + M.gender_change_cooldown = 1 //set not to bug them because the chem is activating + M << "You lose focus as warmth spreads throughout your chest and abdomen." + spawn(300) //wait 30 seconds, growth takes time yo + M.gender_change_cooldown = 0 //allow it to bug them again now that we've waited + if (alert(M,"This chemical will change your gender, proceed?", "Warning", "Yes", "No") == "Yes") //check if they want this to happen for pref sake + M.change_gender_identity(gender_change) + M << "You feel like a new person" //success //////////////////////////////////////////////// /////////DRINKS//////////////////////////////// ////////////////////////////////////////////// diff --git a/code/modules/reagents/Chemistry-Recipes_ch.dm b/code/modules/reagents/Chemistry-Recipes_ch.dm index e8c6bff15c..c6e3911495 100644 --- a/code/modules/reagents/Chemistry-Recipes_ch.dm +++ b/code/modules/reagents/Chemistry-Recipes_ch.dm @@ -59,4 +59,25 @@ id = "matcha_latte" result = "matcha_latte" required_reagents = list ("matchapowder" = 1, "milk" = 5) - result_amount = 5 \ No newline at end of file + result_amount = 5 + +/datum/chemical_reaction/change_drug/male + name = "Elixer of Change" + id = "change_drug_male" + result = "change_drug_male" + required_reagents = list("blood" = 1, "mutagen" = 1, "iron" = 1) + result_amount = 1 + +/datum/chemical_reaction/change_drug/female + name = "Elixer of Change" + id = "change_drug_female" + result = "change_drug_female" + required_reagents = list("blood" = 1, "mutagen" = 1, "sugar" = 1) + result_amount = 1 + +/datum/chemical_reaction/change_drug/intersex + name = "Elixer of Change" + id = "change_drug_intersex" + result = "change_drug_intersex" + required_reagents = list("change_drug_male" = 1, "change_drug_female" = 1) + result_amount = 1 \ No newline at end of file