Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor got handling infection stage and progess of the black goo disease #5044

Merged
merged 25 commits into from
Dec 16, 2023
Merged
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 67 additions & 61 deletions code/datums/diseases/black_goo.dm
Original file line number Diff line number Diff line change
@@ -1,100 +1,106 @@
//Disease Datum
/datum/disease/black_goo
name = "Black Goo"
max_stages = 5
max_stages = 3
cure = "Anti-Zed"
cure_id = "antiZed"
spread = "Bites"
spread_type = SPECIAL
affected_species = list("Human")
curable = 0
cure_chance = 100
desc = ""
cure_chance = 100 //meaning the cure will kill the virus asap
severity = "Medium"
agent = "Unknown Biological Organism X-65"
hidden = list(1,0) //Hidden from med-huds, but not pandemic scanners. BLOOD TESTS FOR THE WIN
permeability_mod = 2
stage_prob = 4
stage_minimum_age = 150
survive_mob_death = TRUE //FALSE //switch to true to make dead infected humans still transform
longevity = 500 //should allow the dead to rise

survive_mob_death = TRUE //We want the dead to turn into zombie.
longevity = 500 //the virus tend to die before the dead is turn into zombie this should fix it.
var/zombie_transforming = 0 //whether we're currently transforming the host into a zombie.
var/goo_message_cooldown = 0 //to make sure we don't spam messages too often.
var/stage_counter = 0 // tells a dead infectee their stage, so they can know when-abouts they'll revive

// set of new var to handle stage progress and
var/stage_level = 0 // we start at zero when dead everything go twice as fast each stage take 6 min so it need 360 and if your dead it require 180 so 3 min
var/infection_rate = 1
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
stage_prob = 0//no randomness
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved

/datum/disease/black_goo/stage_act()
..()
if(!ishuman(affected_mob)) return
var/mob/living/carbon/human/H = affected_mob

if(age > 1.5*stage_minimum_age) stage_prob = 100 //if it takes too long we force a stage increase
else stage_prob = initial(stage_prob)
if(H.stat == DEAD) stage_minimum_age = 75 //the virus progress faster when the host is dead.
// check if your already a zombie or in the process of being transform into one...
if(H.species.name == SPECIES_ZOMBIE || zombie_transforming == TRUE)
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
return

// check if dead
if(H.stat == DEAD)
infection_rate = 4

// check if he isn't dead
if(H.stat != DEAD)
infection_rate = 1

// here we add the new infection rate to the stage level.
stage_level = stage_level + infection_rate

// we want to check if we have reach enough stage level to gain a stage 3 stage of 6 min if you get it once.
if(stage_level >= 360)
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
stage ++
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
stage_level = stage_level - 360

switch(stage)
//stage 1 : Viatiate "afflicted"
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
if(1)
if(H.stat == DEAD && stage_counter != stage)
to_chat(H, SPAN_CENTERBOLD("Your zombie infection is now at Stage One! Zombie transformation begins at Stage Four."))
to_chat(H, SPAN_CENTERBOLD("Your zombie infection is now at Stage One! Zombie transformation begins at Stage Three."))
stage_counter = stage
survive_mob_death = TRUE //changed because infection rate was REALLY horrible.
if(goo_message_cooldown < world.time )
if(prob(3))
to_chat(affected_mob, SPAN_DANGER("You feel really warm..."))
if(prob(5))
to_chat(affected_mob, SPAN_DANGER("You feel warm..."))
goo_message_cooldown = world.time + 100
stage_level = stage_level + 4
else if(prob(3))
to_chat(affected_mob, SPAN_DANGER("You can't trust them..."))
goo_message_cooldown = world.time + 100
stage_level = stage_level + 2

//stage 2 : Ague "Febrile"
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
if(2)
if(H.stat == DEAD && stage_counter != stage)
to_chat(H, SPAN_CENTERBOLD("Your zombie infection is now at Stage Two! Zombie transformation begins at Stage Four."))
stage_counter = stage
if(goo_message_cooldown < world.time)
if (prob(3)) to_chat(affected_mob, SPAN_DANGER("Your throat is really dry..."))
else if (prob(6)) to_chat(affected_mob, SPAN_DANGER("You feel really warm..."))
else if (prob(2)) H.vomit_on_floor()
goo_message_cooldown = world.time + 100
if(3)
if(H.stat == DEAD && stage_counter != stage)
to_chat(H, SPAN_CENTERBOLD("Your zombie infection is now at Stage Three! Zombie transformation begins at Stage Four, which will be soon."))
to_chat(H, SPAN_CENTERBOLD("Your zombie infection is now at Stage Two! Zombie transformation begins at Stage Three."))
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
stage_counter = stage
hidden = list(0,0)
//survive_mob_death = TRUE //even if host dies now, the transformation will occur.
H.next_move_slowdown = max(H.next_move_slowdown, 1)
if(goo_message_cooldown < world.time)
if (prob(3))
to_chat(affected_mob, SPAN_DANGER("You cough up some black fluid..."))
goo_message_cooldown = world.time + 100
else if (prob(6))
if (prob(5))
to_chat(affected_mob, SPAN_DANGER("Your throat is really dry..."))
goo_message_cooldown = world.time + 100
else if (prob(9))
stage_level = stage_level + 10
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
else if (prob(6))
to_chat(affected_mob, SPAN_DANGER("You feel really warm..."))
goo_message_cooldown = world.time + 100
else if(prob(5))
goo_message_cooldown = world.time + 100
stage_level = stage_level +5
else if (prob(2))
to_chat(affected_mob, SPAN_DANGER("You cough up some black fluid..."))
stage_level = stage_level + 20
else if (prob(2))
H.vomit_on_floor()
if(4)
stage_level = stage_level + 15
else if(prob(3))
to_chat(affected_mob, SPAN_DANGER("You can't trust them..."))
stage_level = stage_level + 4
goo_message_cooldown = world.time + 100
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved

//stage 3 : Lusus "Freak"
if(3)
//check if your already a zombie just return to avoid weird stuff... if for some weird reason first filter deoesn't work...
if(H.species.name == SPECIES_ZOMBIE || zombie_transforming == TRUE)
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
return

if(H.stat == DEAD && stage_counter != stage)
to_chat(H, SPAN_CENTERBOLD("Your zombie infection is now at Stage Four! Your transformation will happen any moment now."))
to_chat(H, SPAN_CENTERBOLD("Your zombie infection is now at Stage Three! Zombie transformation begin!"))
Huffie56 marked this conversation as resolved.
Show resolved Hide resolved
stage_counter = stage
hidden = list(0,0)
if(!zombie_transforming)
zombie_transform(H)
H.next_move_slowdown = max(H.next_move_slowdown, 2)
if(prob(5) || age >= stage_minimum_age-1)
if(!zombie_transforming)
zombie_transform(H)
else if(prob(5))
H.vomit_on_floor()
if(5)
if(H.stat == DEAD && stage_counter != stage)
stage_counter = stage
if(H.species.name != SPECIES_ZOMBIE && !zombie_transforming)
to_chat(H, SPAN_CENTERBOLD("Your zombie infection is now at Stage Five! Your transformation should have happened already, but will be forced now."))
zombie_transform(H)
if(!zombie_transforming && prob(50))
if(H.stat != DEAD)
var/healamt = 2
if(H.health < H.maxHealth)
H.apply_damage(-healamt, BURN)
H.apply_damage(-healamt, BRUTE)
H.apply_damage(-healamt, TOX)
H.apply_damage(-healamt, OXY)
H.nutrition = NUTRITION_MAX //never hungry


/datum/disease/black_goo/proc/zombie_transform(mob/living/carbon/human/human)
set waitfor = 0
Expand All @@ -113,7 +119,7 @@
playsound(human.loc, 'sound/hallucinations/wail.ogg', 25, 1)
human.jitteriness = 0
human.set_species(SPECIES_ZOMBIE)
stage = 5
stage = 3
human.faction = FACTION_ZOMBIE
zombie_transforming = FALSE

Expand Down