Skip to content

Commit

Permalink
Virology tweaks (#496)
Browse files Browse the repository at this point in the history
* Tiny tweaks & name fixes

* Removes silver from possible cures

* Less convoluted cures, spaceacillin now helps against diseases

* Fix to antiviral effect

* Minor fixes

* Four new symptoms!

* Tweaks to available cures

* Changes & Fixes formaldehyde recipe

* Minor tweaks

Changes cure description of cold-9; Fixes/updates bottle.dm code

* Buffs hemorrhage

* Changes hemorrhage a bit

* Fix antiviral effect

* Fix narcolepsy symptom

* Tiny ossarepantes tweak

* Removes update_icon check from check-paths.sh
  • Loading branch information
EgorDinamit authored Jan 22, 2024
1 parent d28ac21 commit 68a8896
Show file tree
Hide file tree
Showing 18 changed files with 402 additions and 85 deletions.
2 changes: 2 additions & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
#include "code\datums\disease\advance\_advance.dm"
#include "code\datums\disease\advance\presets.dm"
#include "code\datums\disease\advance\symptoms\_symptom.dm"
#include "code\datums\disease\advance\symptoms\alien_hand.dm"
#include "code\datums\disease\advance\symptoms\bone.dm"
#include "code\datums\disease\advance\symptoms\choking.dm"
#include "code\datums\disease\advance\symptoms\confusion.dm"
Expand All @@ -330,6 +331,7 @@
#include "code\datums\disease\advance\symptoms\flesh_eating.dm"
#include "code\datums\disease\advance\symptoms\headache.dm"
#include "code\datums\disease\advance\symptoms\heal.dm"
#include "code\datums\disease\advance\symptoms\hemorrhage.dm"
#include "code\datums\disease\advance\symptoms\itching.dm"
#include "code\datums\disease\advance\symptoms\narcolepsy.dm"
#include "code\datums\disease\advance\symptoms\pain.dm"
Expand Down
7 changes: 7 additions & 0 deletions code/__defines/diseases.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,10 @@
#define DISEASE_SEVERITY_DANGEROUS "Dangerous"
/// Diseases that can quickly kill an unprepared victim (fungal tb, gbs)
#define DISEASE_SEVERITY_BIOHAZARD "BIOHAZARD"

// Defines for antiviral chem effects
#define ANTIVIRAL_WEAK 5
#define ANTIVIRAL_MEDIUM 10
#define ANTIVIRAL_STRONG 15
// Guaranteed to stop diseases from progressing
#define ANTIVIRAL_OVERPOWERING 100
6 changes: 0 additions & 6 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,6 @@

#define MIDNIGHT_ROLLOVER 864000 //number of deciseconds in a day

//Virus badness defines
#define VIRUS_MILD 1
#define VIRUS_COMMON 2 //Random events don't go higher (mutations aside)
#define VIRUS_ENGINEERED 3
#define VIRUS_EXOTIC 4 //Usually adminbus only

//Error handler defines
#define ERROR_USEFUL_LEN 2

Expand Down
13 changes: 13 additions & 0 deletions code/datums/disease/_disease.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
Cure()
return FALSE

// Spaceacillin may slow down the progression of the disease
else if(AntiViralEffect())
// Can decrease the stage slightly
if(stage > 3 && prob(15))
UpdateStage(stage - 1)

else if(prob(stage_prob))
UpdateStage(min(stage + 1, max_stages))

Expand All @@ -95,6 +101,9 @@
if(!. || (needs_all_cures && . < cures.len))
return FALSE

/datum/disease/proc/AntiViralEffect()
return prob(affected_mob.has_chem_effect(CE_ANTIVIRAL, round(50 / cure_chance)))

//Airborne spreading
/datum/disease/proc/Spread(force_spread = 0)
if(!affected_mob)
Expand Down Expand Up @@ -125,6 +134,10 @@
for(var/turf/T in getline(start, end)) // Should probably be replaced with something else
if(T.density)
return FALSE
// Shitty check for fulltile windows
for(var/obj/structure/window/W in T)
if(W.is_fulltile())
return FALSE
return TRUE

/datum/disease/proc/Cure(add_resistance = TRUE)
Expand Down
19 changes: 11 additions & 8 deletions code/datums/disease/advance/_advance.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@

// The order goes from easy to cure to hard to cure. Keep in mind that sentient diseases pick two cures from tier 6 and up, ensure they won't react away in bodies.
var/static/list/advance_cures = list(
list(/datum/reagent/water, /datum/reagent/copper, /datum/reagent/silver, /datum/reagent/iron),
list(/datum/reagent/water/boiling, /datum/reagent/carbon, /datum/reagent/lithium, /datum/reagent/silicon),
list(/datum/reagent/acetone, /datum/reagent/ethanol, /datum/reagent/mercury, /datum/reagent/radium),
list(/datum/reagent/ammonia, /datum/chemical_reaction/methyl_bromide, /datum/reagent/medicine/inaprovaline, /datum/reagent/medicine/noexcutite),
list(/datum/reagent/hydrazine, /datum/reagent/medicine/sterilizine, /datum/reagent/medicine/tricordrazine, /datum/reagent/medicine/alkysine),
list(/datum/reagent/water, /datum/reagent/copper, /datum/reagent/iron),
list(/datum/reagent/carbon, /datum/reagent/lithium, /datum/reagent/silicon),
list(/datum/reagent/acetone, /datum/reagent/ethanol, /datum/reagent/mercury, /datum/reagent/radium, /datum/reagent/ammonia),
list(/datum/reagent/ethanol/beer, /datum/reagent/medicine/inaprovaline, /datum/reagent/medicine/noexcutite),
list(/datum/reagent/medicine/fluff/antidexafen, /datum/reagent/toxin/methyl_bromide),
list(/datum/reagent/medicine/cryogenic/cryoxadone, /datum/reagent/hydrazine, /datum/reagent/medicine/sterilizine, /datum/reagent/medicine/tricordrazine, /datum/reagent/medicine/alkysine),
list(/datum/reagent/medicine/bicaridine, /datum/reagent/medicine/kelotane, /datum/reagent/medicine/ethylredoxrazine, /datum/reagent/medicine/imidazoline),
list(/datum/reagent/medicine/meraline, /datum/reagent/medicine/dermaline, /datum/reagent/medicine/hyronalin, /datum/reagent/medicine/peridaxon),
list(/datum/reagent/medicine/dylovene/venaxilin, /datum/reagent/medicine/arithrazine),
list(/datum/reagent/medicine/dylovene/venaxilin),
list(/datum/reagent/medicine/arithrazine),
list(/datum/reagent/medicine/rezadone),
list(/datum/reagent/toxin/zombie_powder),
list(/datum/reagent/three_eye)
list(/datum/reagent/toxin/zombie_powder)
)

/datum/disease/advance/New()
Expand Down Expand Up @@ -105,6 +106,8 @@
//this is a new disease starting over at stage 1, so processing is not copied
return A

/datum/disease/advance/AntiViralEffect()
return affected_mob.has_chem_effect(CE_ANTIVIRAL, max(1, properties["resistance"]))

// Mix the symptoms of two diseases (the src and the argument)
/datum/disease/advance/proc/Mix(datum/disease/advance/D)
Expand Down
59 changes: 59 additions & 0 deletions code/datums/disease/advance/symptoms/alien_hand.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
//////////////////////////////////////
Alien Hand Syndrome
Quite noticeable.
Resistant.
Increases stage speed.
Reduces transmittablity.
Medium Level.
//////////////////////////////////////
*/

/datum/symptom/alien_hand
name = "Alien Hand Syndrome"
desc = "The virus causes its host's hands to act on their own, without conscious control over actions."
stealth = -2
resistance = 3
stage_speed = 1
transmittable = -2
level = 5
severity = 2
symptom_delay_min = 5
symptom_delay_max = 25
threshold_descs = list(
"Stage Speed 9" = "Increases frequency of actions.",
)

/datum/symptom/alien_hand/Start(datum/disease/advance/A)
if(!..())
return
if(A.properties["stage_rate"] >= 9)
symptom_delay_min = 4
symptom_delay_max = 16

/datum/symptom/alien_hand/Activate(datum/disease/advance/A)
if(!..())
return
if(A.stage < 4)
return
var/mob/living/carbon/human/H = A.affected_mob
var/list/random_atoms = list()
var/view_range = 1
// Shoot some people >:)
if(istype(H.get_active_hand(), /obj/item/gun))
view_range = 5
for(var/atom/movable/AA in view(view_range, H))
var/act_prob = 1
// There's generally way too many random things lying around compared to rare humans
if(isliving(A))
act_prob = 10
random_atoms[AA] = act_prob
if(!LAZYLEN(random_atoms))
return
var/atom/movable/AA = pickweight(random_atoms)
if(isliving(AA))
admin_attack_log(H, AA, "Alien Hand Syndrome activated", "Has been targeted by alien hand syndrome")
H.ClickOn(AA)
145 changes: 136 additions & 9 deletions code/datums/disease/advance/symptoms/heal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
symptom_delay_min = 1
symptom_delay_max = 1
var/passive_message = "" //random message to infected but not actively healing people
threshold_descs = list(
"Stage Speed 6" = "Doubles healing speed.",
)

/datum/symptom/heal/Start(datum/disease/advance/A)
if(!..())
return
if(A.properties["stage_rate"] >= 6) //stronger healing
power = 2

/datum/symptom/heal/Activate(datum/disease/advance/A)
if(!..())
Expand Down Expand Up @@ -146,3 +137,139 @@
if(M.getBruteLoss() || M.getFireLoss())
return TRUE
return FALSE


/datum/symptom/heal/organ
name = "Autophagic Tissuegrafting"
desc = "The virus uses soft tissue of the host's body to regenerate internal organs."
stealth = -2
resistance = 0
stage_speed = 0
transmittable = -2
level = 7
/// Organ damage healed translates to brute damage dealt, multiplied by this coefficient
var/damage_coeff = 3
threshold_descs = list(
"Resistance 7" = "Decreases amount of brute damage done.",
"Resistance 14" = "Virus ceases to deal any brute damage.",
"Stage Speed 8" = "Increases healing speed.",
)

/datum/symptom/heal/organ/Start(datum/disease/advance/A)
if(!..())
return
if(A.properties["resistance"] >= 7)
damage_coeff = 1.5
if(A.properties["resistance"] >= 14)
damage_coeff = 0
if(A.properties["stage_rate"] >= 8)
power = 2

/datum/symptom/heal/organ/CanHeal(datum/disease/advance/A)
var/mob/living/carbon/human/H = A.affected_mob
for(var/obj/item/organ/internal/I in H.internal_organs)
if(BP_IS_ROBOTIC(I))
continue
if(I.organ_tag == BP_BRAIN)
continue
if(I.is_broken())
continue
if(!I.damage)
continue
return TRUE
return FALSE

/datum/symptom/heal/organ/Heal(mob/living/carbon/human/H, datum/disease/advance/A)
if(prob(5))
to_chat(H, SPAN_WARNING("You feel your innards moving around!"))

for(var/obj/item/organ/internal/I in H.internal_organs)
if(BP_IS_ROBOTIC(I))
continue
if(I.organ_tag == BP_BRAIN)
continue
I.heal_damage(power)
var/obj/item/organ/external/BP = H.get_organ(I.parent_organ)
if(istype(BP))
BP.take_external_damage(power * damage_coeff)

return TRUE

/datum/symptom/heal/organ/PassiveMessageCondition(mob/living/M)
return FALSE


/datum/symptom/heal/hemostasis
name = "Hemostasis"
desc = "The virus restores damaged blood vessels, stopping the external bleeding."
stealth = 1
resistance = -3
stage_speed = -2
transmittable = -3
level = 4
symptom_delay_min = 30
symptom_delay_max = 40
base_message_chance = 20
threshold_descs = list(
"Resistance 8" = "Restores missing blood volume.",
"Stage Speed 6" = "Increases healing speed.",
"Stage Speed 12" = "Prevents internal bleeding.",
)
var/blood_restore = FALSE
var/heal_internal = FALSE

/datum/symptom/heal/hemostasis/Start(datum/disease/advance/A)
if(!..())
return
if(A.properties["resistance"] >= 8)
blood_restore = TRUE
if(A.properties["stage_rate"] >= 6)
symptom_delay_min = 10
symptom_delay_max = 20
if(A.properties["stage_rate"] >= 12)
heal_internal = TRUE

/datum/symptom/heal/hemostasis/CanHeal(datum/disease/advance/A)
. = FALSE
var/mob/living/carbon/human/H = A.affected_mob
if(LAZYLEN(ListWounds(H)))
. = TRUE
if(blood_restore && H.vessel.get_reagent_amount(/datum/reagent/blood) < H.species.blood_volume)
. = TRUE
if(heal_internal && LAZYLEN(ListInternalBleeds(H)))
. = TRUE

/datum/symptom/heal/hemostasis/Heal(mob/living/carbon/human/H, datum/disease/advance/A)
if(prob(5))
to_chat(H, SPAN_NOTICE("The blood stops flowing out from your wounds..."))

for(var/datum/wound/W in ListWounds(H))
W.bleed_timer = max(0, W.bleed_timer - rand(10, 20))
W.parent_organ.update_damages()

if(blood_restore)
H.regenerate_blood(round(H.species.blood_volume * 0.05))

if(heal_internal)
for(var/obj/item/organ/external/E in ListInternalBleeds(H))
E.status &= ~ORGAN_ARTERY_CUT

return TRUE

/datum/symptom/heal/hemostasis/PassiveMessageCondition(mob/living/M)
return FALSE

/datum/symptom/heal/hemostasis/proc/ListWounds(mob/living/carbon/human/H)
. = list()
for(var/obj/item/organ/external/E in H.organs)
for(var/datum/wound/W in E.wounds)
if(!W.bleeding())
continue
. += W

/datum/symptom/heal/hemostasis/proc/ListInternalBleeds(mob/living/carbon/human/H)
. = list()
for(var/obj/item/organ/external/E in H.organs)
if(!(E.status & ORGAN_ARTERY_CUT))
continue
. += E
Loading

0 comments on commit 68a8896

Please sign in to comment.