From 4e347c21a625f4996de867a2d7caf8b3b03e0d33 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 10 Jun 2022 19:45:13 -0500 Subject: [PATCH] Add disease resistance effects for spaceacillin (#67448) About The Pull Request Spaceacillin is currently an under utilized medical chem. Its only effect is to stop a person who is already infected from spreading an airborne disease. My changes add the following when someone has taken spaceacillin: Infected mobs slow down disease progression by 50% Uninfected mobs have a 75% chance to block being infected Uninfected mobs have a 75% chance to block zombie infection when attacked Impregnated mobs that have an alien larva slow down larva growth by 50% Why It's Good For The Game Gives spaceacillin more utility since it was such a niche thing. Changelog cl add: Add disease resistance to spaceacillin. It now gives 50% disease progression slowdown, 75% to block disease infection, 75% to block zombie infection when attacked, and 50% alien larva growth slowdown. /cl --- code/datums/diseases/_MobProcs.dm | 8 ++++++++ code/datums/diseases/_disease.dm | 5 +++-- .../mob/living/carbon/alien/special/alien_embryo.dm | 6 +++++- .../reagents/chemistry/reagents/medicine_reagents.dm | 2 +- code/modules/zombie/items.dm | 4 ++++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/code/datums/diseases/_MobProcs.dm b/code/datums/diseases/_MobProcs.dm index 024f1ee94f2..795af490991 100644 --- a/code/datums/diseases/_MobProcs.dm +++ b/code/datums/diseases/_MobProcs.dm @@ -64,6 +64,9 @@ if(ishuman(src)) var/mob/living/carbon/human/infecting_human = src + if(infecting_human.reagents.has_reagent(/datum/reagent/medicine/spaceacillin) && prob(75)) + return + switch(target_zone) if(BODY_ZONE_HEAD) if(isobj(infecting_human.head)) @@ -92,6 +95,11 @@ disease.try_infect(src) /mob/living/proc/AirborneContractDisease(datum/disease/disease, force_spread) + if(ishuman(src)) + var/mob/living/carbon/human/infecting_human = src + if(infecting_human.reagents.has_reagent(/datum/reagent/medicine/spaceacillin) && prob(75)) + return + if(((disease.spread_flags & DISEASE_SPREAD_AIRBORNE) || force_spread) && prob((50*disease.spreading_modifier) - 1)) ForceContractDisease(disease) diff --git a/code/datums/diseases/_disease.dm b/code/datums/diseases/_disease.dm index f85b0a4ca89..d420d838b85 100644 --- a/code/datums/diseases/_disease.dm +++ b/code/datums/diseases/_disease.dm @@ -64,6 +64,8 @@ ///Proc to process the disease and decide on whether to advance, cure or make the sympthoms appear. Returns a boolean on whether to continue acting on the symptoms or not. /datum/disease/proc/stage_act(delta_time, times_fired) + var/slowdown = affected_mob.reagents.has_reagent(/datum/reagent/medicine/spaceacillin) ? 0.5 : 1 // spaceacillin slows stage speed by 50% + if(has_cure()) if(DT_PROB(cure_chance, delta_time)) update_stage(max(stage - 1, 1)) @@ -71,8 +73,7 @@ if(disease_flags & CURABLE && DT_PROB(cure_chance, delta_time)) cure() return FALSE - - else if(DT_PROB(stage_prob, delta_time)) + else if(DT_PROB(stage_prob*slowdown, delta_time)) update_stage(min(stage + 1, max_stages)) return !carrier diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index c2eeb6947f9..85a8804eea2 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -60,7 +60,11 @@ return if(++stage < 6) INVOKE_ASYNC(src, .proc/RefreshInfectionImage) - addtimer(CALLBACK(src, .proc/advance_embryo_stage), growth_time) + var/slowdown = 1 + if(ishuman(owner)) + var/mob/living/carbon/human/baby_momma = owner + slowdown = baby_momma.reagents.has_reagent(/datum/reagent/medicine/spaceacillin) ? 2 : 1 // spaceacillin doubles the time it takes to grow + addtimer(CALLBACK(src, .proc/advance_embryo_stage), growth_time*slowdown) /obj/item/organ/internal/body_egg/alien_embryo/egg_process() if(stage == 6 && prob(50)) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 87dfa1fad69..788ab166511 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -271,7 +271,7 @@ /datum/reagent/medicine/spaceacillin name = "Spaceacillin" - description = "Spaceacillin will prevent a patient from conventionally spreading any diseases they are currently infected with. Also reduces infection in serious burns." + description = "Spaceacillin will provide limited resistance against disease and parasites. Also reduces infection in serious burns." color = "#E1F2E6" metabolization_rate = 0.1 * REAGENTS_METABOLISM ph = 8.1 diff --git a/code/modules/zombie/items.dm b/code/modules/zombie/items.dm index 38863c56637..f7aa4854917 100644 --- a/code/modules/zombie/items.dm +++ b/code/modules/zombie/items.dm @@ -48,6 +48,10 @@ // zombies) return + // spaceacillin has a 75% chance to block infection + if(istype(target) && target.reagents.has_reagent(/datum/reagent/medicine/spaceacillin) && prob(75)) + return + var/obj/item/organ/internal/zombie_infection/infection infection = target.getorganslot(ORGAN_SLOT_ZOMBIE) if(!infection)