Adds additional remedies to more severe symptoms (#30580)

* adds defines and code for physical treatments

* adds wetness check and evaporation for combustion symptom

* adds sleep as treatment for vomiting

* adds treatment to flesheating

* adjustments
This commit is contained in:
Migratingcocofruit
2025-10-07 20:59:03 +03:00
committed by GitHub
parent 71aa860711
commit a6ab445f8c
7 changed files with 70 additions and 9 deletions
+3
View File
@@ -208,6 +208,9 @@
///cancel eating attempt
#define COMSIG_MOB_CANCEL_EAT (1<<0)
/// From /datum/status_effect/incapacitating/sleeping/tick()
#define COMSIG_MOB_SLEEP_TICK "mob_sleep_tick"
/// From /datum/element/basic_eating/finish_eating()
#define COMSIG_MOB_ATE "mob_ate"
///cancel post eating
+4 -2
View File
@@ -5,8 +5,10 @@
#define VIRUS_SYMPTOM_LIMIT 6
/// The maximum amount of time a symptom will be delayed for after the treating reagents have left the body
#define VIRUS_MAX_TREATMENT_TIMER 300
#define VIRUS_TREATMENT_TIMER_MOD 2
#define VIRUS_MAX_CHEM_TREATMENT_TIMER 300
#define VIRUS_CHEM_TREATMENT_TIMER_MOD 2
#define VIRUS_MAX_PHYS_TREATMENT_TIMER 90
#define VIRUS_PHYS_TREATMENT_TIMER_MOD 30
/// Evoltion chance each cycle in percents.
/// The base chance in % that a virus will mutate as it spreads. Further modified by stage speed and the viral evolutionary acceleration trait
@@ -31,6 +31,8 @@ Bonus
/datum/symptom/fire/symptom_act(datum/disease/advance/A, unmitigated)
var/mob/living/M = A.affected_mob
if(evaporate_wetness(A, unmitigated * A.progress / 100))
return
switch(A.progress)
if(30 to 59)
to_chat(M, "<span class='warning'>[pick("You feel hot.", "You hear a crackling noise.", "You smell smoke.")]</span>")
@@ -57,3 +59,14 @@ Bonus
M.adjust_fire_stacks(get_stacks)
return 1
/datum/symptom/fire/proc/evaporate_wetness(datum/disease/advance/A, heat_mod)
. = TRUE
var/mob/living/carbon/target = A.affected_mob
if(target.wetlevel < 3 * heat_mod)
. = FALSE
target.wetlevel = max(round(target.wetlevel - 3 * heat_mod), 0)
if(target.wetlevel)
to_chat(target, "<span class='userdanger'>Some water steams off your body</span>")
else
to_chat(target, "<span class='userdanger'>All of the water steams off your body!</span>")
@@ -26,19 +26,32 @@ Bonus
chem_treatments = list(
"synthflesh" = list("multiplier" = 0, "timer" = 0),
"lazarus_reagent" = list("multiplier" = 0, "timer" = 0))
phys_treatments = list(
"body_temp" = list("multiplier" = 0.6, "timer" = 0, "max_timer" = VIRUS_MAX_PHYS_TREATMENT_TIMER * 6),
)
/datum/symptom/flesh_eating/symptom_act(datum/disease/advance/A, unmitigated)
var/mob/living/M = A.affected_mob
if(A.stage > 1)
if(prob(A.progress))
to_chat(M, "<span class='userdanger'>[pick("You cringe as a violent pain takes over your body.", "It feels like your body is eating itself inside out.", "IT HURTS.")]</span>")
Flesheat(M, A)
Flesheat(M, A, unmitigated)
else
to_chat(M, "<span class='warning'>[pick("You feel a sudden pain across your body.", "Drops of blood appear suddenly on your skin.")]</span>")
return
/datum/symptom/flesh_eating/proc/Flesheat(mob/living/M, datum/disease/advance/A)
var/get_damage = (A.progress / 100) * ((sqrtor0(49 + 2 * A.totalStageSpeed()))*5)
/datum/symptom/flesh_eating/proc/Flesheat(mob/living/M, datum/disease/advance/A, unmitigated)
var/get_damage = unmitigated * sqrtor0(49 + 2 * A.totalStageSpeed()) * A.progress / 20
M.adjustBruteLoss(get_damage)
return 1
/datum/symptom/flesh_eating/check_phys_treatment(datum/disease/advance/A)
. = ..()
if(!A.affected_mob)
return
var/temp_dist = max(A.affected_mob.bodytemperature - 313.15, 305.15 - A.affected_mob.bodytemperature)
if(temp_dist > 0)
increase_phys_treatment_timer("body_temp", min(temp_dist * 2, VIRUS_PHYS_TREATMENT_TIMER_MOD))
@@ -17,6 +17,8 @@ GLOBAL_LIST_INIT(list_symptoms, subtypesof(/datum/symptom))
var/id = ""
/// Asoc list of treatment reagents to multiplier and timer. Multiplier multiplies the frequency and strength of the symptom
var/list/chem_treatments = list()
/// Asoc list of physical treatments to multiplier and timer. Multiplier multiplies the frequency and strength of the symptom
var/list/phys_treatments = list()
/// Amount of treatment reagents the symptom will consume
var/purge_amount = 0.4
/// How likely the symptom is to activate each process cycle
@@ -75,10 +77,20 @@ GLOBAL_LIST_INIT(list_symptoms, subtypesof(/datum/symptom))
chem_treatments[treatment]["timer"]--
if(treatment in mob_reagents)
// Consume as much as we need but no more than we have
var/consumption_mod = min(mob_reagents[treatment] / purge_amount, (VIRUS_MAX_TREATMENT_TIMER - chem_treatments[treatment]["timer"]) / VIRUS_TREATMENT_TIMER_MOD, 1)
var/consumption_mod = min(mob_reagents[treatment] / purge_amount, (VIRUS_MAX_CHEM_TREATMENT_TIMER - chem_treatments[treatment]["timer"]) / VIRUS_CHEM_TREATMENT_TIMER_MOD, 1)
A.affected_mob.reagents.remove_reagent(treatment, purge_amount * consumption_mod)
// Add to timer according to the amount consumed
chem_treatments[treatment]["timer"] += VIRUS_TREATMENT_TIMER_MOD * consumption_mod
chem_treatments[treatment]["timer"] += VIRUS_CHEM_TREATMENT_TIMER_MOD * consumption_mod
/// Default behaviour for physical treatments. Mitigate the symptoms while effects remain
/datum/symptom/proc/check_phys_treatment(datum/disease/advance/A)
return 1
. = 1
for(var/treatment in phys_treatments)
if(phys_treatments[treatment]["timer"] >= 1)
. *= phys_treatments[treatment]["multiplier"]
phys_treatments[treatment]["timer"]--
/datum/symptom/proc/increase_phys_treatment_timer(treatment, time = VIRUS_PHYS_TREATMENT_TIMER_MOD)
if(!phys_treatments[treatment])
return
phys_treatments[treatment]["timer"] = min(phys_treatments[treatment]["timer"] + time, phys_treatments[treatment]["max_timer"])
+18 -1
View File
@@ -30,7 +30,18 @@ Bonus
chem_treatments = list(
"calomel" = list("multiplier" = 0, "timer" = 0),
"charcoal" = list("multiplier" = 0, "timer" = 0),
"pen_acid" = list("multiplier" = 0, "timer" = 0))
"pen_acid" = list("multiplier" = 0, "timer" = 0),
)
phys_treatments = list(
"sleep" = list("multiplier" = 0.2, "timer" = 0, "max_timer" = 2),
"sleep_linger" = list("multiplier" = 0.6, "timer" = 0, "max_timer" = VIRUS_MAX_PHYS_TREATMENT_TIMER * 7),
)
/datum/symptom/vomit/Start(datum/disease/advance/A)
if(!iscarbon(A.affected_mob))
return
var/mob/living/carbon/target = A.affected_mob
RegisterSignal(target, COMSIG_MOB_SLEEP_TICK, PROC_REF(on_mob_sleep))
/datum/symptom/vomit/symptom_act(datum/disease/advance/A, unmitigated)
var/mob/living/M = A.affected_mob
@@ -47,6 +58,12 @@ Bonus
/datum/symptom/vomit/proc/Vomit(mob/living/carbon/M, progress)
M.vomit(20 * (progress / 100))
/datum/symptom/vomit/proc/on_mob_sleep(mob/source, comfort)
SIGNAL_HANDLER // COMSIG_MOB_SLEEP_TICK
if(comfort)
increase_phys_treatment_timer("sleep", 2)
increase_phys_treatment_timer("sleep_linger", 10 * comfort)
/*
//////////////////////////////////////
+1
View File
@@ -681,6 +681,7 @@
dreamer.adjustFireLoss(-1 * comfort)
if(prob(10) && dreamer.health && dreamer.health_hud_override != HEALTH_HUD_OVERRIDE_CRIT)
dreamer.emote("snore")
SEND_SIGNAL(owner, COMSIG_MOB_SLEEP_TICK, comfort)
//SLOWED - slows down the victim for a duration and a given slowdown value.