Skip to content

Commit

Permalink
Refactor got handling infection stage and progess of the black goo di…
Browse files Browse the repository at this point in the history
…sease (#5044)

# About the pull request

1- reduce the number of stages from 5 to 3. each stage take 6 min or
360s

2-rework the logic that handle the disease progress

A-Set stage_prob to zero to prevent random stage increase.

B-add a stage_level variable that when is at-least 360 make an increase
of the disease stage...

C-add an infection_rate variable that handle how fast the stage_level
increase passively.
( stage_level = stage_level +infection_rate )
i also made it so that infection-rate is quadruple when the host is
dead.

D-I also added that the goo messages (you feel warm ....) give a boost
to stage_level to add some randomness to the infection progress.

To do list:
i need to figure out how to increase stage level when someone get hit by
a zombie after he is infected...
no idea if i can manage that so i am just going to put what i made up
for review...

<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
those change are to make infection evolution less random and way more
smooth progress with the addition of some random boost with the good
message since it's something that could represent a natural boost of the
infection progress in the host.
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
balance: reduce the number of stages from 5 to 3. each stage take 6 min
or 360s.
balance: rework the logic that handle the disease progress
balance: A-Set stage_prob to zero to prevent random stage increase.
balance: B-add a stage_level variable that when is at-least 360 make an
increase of the disease stage...
balance: C-add an infection_rate variable that handle how fast the
stage_level increase passively.
balance: D-infection_rate is quadruple when the host is dead.
balance: E-I also added that the goo messages (you feel warm ....) give
a boost to stage_level to add some randomness to the infection progress.
/:cl:

---------

Co-authored-by: Julien <[email protected]>
Co-authored-by: Zonespace <[email protected]>
  • Loading branch information
3 people authored Dec 16, 2023
1 parent 5b015a9 commit 0db0ae0
Showing 1 changed file with 96 additions and 68 deletions.
164 changes: 96 additions & 68 deletions code/datums/diseases/black_goo.dm
Original file line number Diff line number Diff line change
@@ -1,100 +1,128 @@
//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
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
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.
stage_prob = 0//no randomness

/// whether we're currently transforming the host into a zombie.
var/zombie_transforming = 0
/// tells a dead infectee their stage, so they can know when-abouts they'll revive
var/stage_counter = 0

//new variables to handle infection progression inside a stage.

/// variable that contain accumulated virus progression for an host.
var/stage_level = 0
/// variable that handle passive increase of the virus of an host.
var/infection_rate = 1

///the number of stage level needed to pass another stage.
var/stage_level_check = 360

/// cooldown between each check to see if we display a symptome idea is to get 60s between symptome atleast.
var/message_cooldown_time = 1 MINUTES
COOLDOWN_DECLARE(goo_message_cooldown)

/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(iszombie(H))
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 += 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 >= stage_level_check)
stage++
stage_level -= stage_level_check

switch(stage)
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..."))
goo_message_cooldown = world.time + 100

if (!COOLDOWN_FINISHED(src, goo_message_cooldown))
return
COOLDOWN_START(src, goo_message_cooldown, message_cooldown_time)

switch(rand(0, 100))
if(0 to 25)
return
if(25 to 75)
to_chat(affected_mob, SPAN_DANGER("You feel warm..."))
stage_level += 9
if(75 to 95)
to_chat(affected_mob, SPAN_DANGER("Your throat is really dry..."))
stage_level += 18
if(95 to 100)
to_chat(affected_mob, SPAN_DANGER("You can't trust them..."))
stage_level += 36

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."))
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))
to_chat(affected_mob, SPAN_DANGER("Your throat is really dry..."))
goo_message_cooldown = world.time + 100
else if (prob(9))

if (!COOLDOWN_FINISHED(src, goo_message_cooldown))
return
COOLDOWN_START(src, goo_message_cooldown, message_cooldown_time)

switch(rand(0, 100))
if(0 to 25)
return
if(25 to 50)
to_chat(affected_mob, SPAN_DANGER("You can't trust them..."))
stage_level += 5
if(50 to 75)
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 += 9
if(75 to 85)
to_chat(affected_mob, SPAN_DANGER("Your throat is really dry..."))
stage_level += 18
if(85 to 95)
H.vomit_on_floor()
if(4)
stage_level += 36
if(95 to 100)
to_chat(affected_mob, SPAN_DANGER("You cough up some black fluid..."))
stage_level += 42

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(iszombie(H))
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!"))
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 +141,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

0 comments on commit 0db0ae0

Please sign in to comment.