Skip to content

Commit

Permalink
Disease protection (#4524)
Browse files Browse the repository at this point in the history
# About the pull request
Wearing mask/latex gloves/bio suit/space suit will now impact the
likeliness of you getting infected from flu/cold/whatever. Doesnt affect
black goo(zombie)

I also have absolutely no idea what Astar proc is and why its there so I
replaced that with adjacent. UPD: astar returned. its pathfinding.

Nuked one single letter var so be happy
<!-- 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
More interesting moments with those events of flu disease once in a
decade, like mask and gloves distribution.(perhaps we will have more of
them now)
Plus I was so sad that wearing new cool biosuit doesn't protect you from
it.
Wearing full kit wont give 100% immunity, final random roll always does
-5
# 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: Kivts
add: You can partially protect yourself from flu and other disease by
wearing a mask and other PPE. Doesnt affect Black Goo.
/:cl:
  • Loading branch information
kiVts authored Oct 7, 2023
1 parent 78f1ba2 commit 199a27a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 26 deletions.
10 changes: 4 additions & 6 deletions code/datums/disease.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
check_range = 1 // everything else, like infect-on-contact things, only infect things on top of it

if(isturf(source.loc))
for(var/mob/living/carbon/M in oview(check_range, source))
if(isturf(M.loc))
if(AStar(source.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, check_range))
M.contract_disease(src, 0, 1, force_spread)
for(var/mob/living/carbon/victim in oview(check_range, source))
if(isturf(victim.loc))
if(AStar(source.loc, victim.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, check_range))
victim.contract_disease(src, 0, 1, force_spread)

return

Expand Down Expand Up @@ -173,8 +173,6 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
var/mob/living/carbon/human/H = affected_mob
H.med_hud_set_status()



/datum/disease/New(process=TRUE)//process = 1 - adding the object to global list. List is processed by master controller.
cure_list = list(cure_id) // to add more cures, add more vars to this list in the actual disease's New()
if(process) // Viruses in list are considered active.
Expand Down
30 changes: 15 additions & 15 deletions code/datums/diseases/mob_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@

passed = check_disease_pass_clothes(target_zone)

if(!passed && spread_type == AIRBORNE && !internal)
passed = (prob((50*virus.permeability_mod) - 1))

if(passed)
AddDisease(virus)

Expand Down Expand Up @@ -111,36 +108,39 @@

/mob/living/carbon/human/check_disease_pass_clothes(target_zone)
var/obj/item/clothing/Cl
var/protection = 0
switch(target_zone)
if(1)
if(isobj(head) && !istype(head, /obj/item/paper))
Cl = head
. = prob((Cl.permeability_coefficient*100) - 1)
if(. && wear_mask)
. = prob((Cl.permeability_coefficient*100) - 1)
protection += (Cl.permeability_coefficient*100)-100
if(isobj(wear_mask))
Cl = wear_mask
protection += (Cl.permeability_coefficient*100)-100
if(2)//arms and legs included
if(isobj(wear_suit))
Cl = wear_suit
. = prob((Cl.permeability_coefficient*100) - 1)
if(. && isobj(WEAR_BODY))
protection += (Cl.permeability_coefficient*100)-100
if(isobj(WEAR_BODY))
Cl = WEAR_BODY
. = prob((Cl.permeability_coefficient*100) - 1)
protection += (Cl.permeability_coefficient*100)-100
if(3)
if(isobj(wear_suit) && wear_suit.flags_armor_protection & BODY_FLAG_HANDS)
Cl = wear_suit
. = prob((Cl.permeability_coefficient*100) - 1)
protection += (Cl.permeability_coefficient*100)-100

if(. && isobj(gloves))
if(isobj(gloves))
Cl = gloves
. = prob((Cl.permeability_coefficient*100) - 1)
protection += (Cl.permeability_coefficient*100)-100
if(4)
if(isobj(wear_suit) && wear_suit.flags_armor_protection & BODY_FLAG_FEET)
Cl = wear_suit
. = prob((Cl.permeability_coefficient*100) - 1)
protection += (Cl.permeability_coefficient*100)-100

if(. && isobj(shoes))
if(isobj(shoes))
Cl = shoes
. = prob((Cl.permeability_coefficient*100) - 1)
protection += (Cl.permeability_coefficient*100)-100
else
to_chat(src, "Something bad happened with disease target zone code, tell a dev or admin ")
return prob(clamp(protection, 5, 90))

2 changes: 1 addition & 1 deletion code/modules/clothing/gloves/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
icon_state = "latex"
item_state = "lgloves"
siemens_coefficient = 0.30
permeability_coefficient = 0.01
permeability_coefficient = 0.35

/obj/item/clothing/gloves/botanic_leather
desc = "These leather gloves protect against thorns, barbs, prickles, spikes and other harmful objects of floral origin."
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/masks/gasmask.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
w_class = SIZE_SMALL
item_state = "gas_alt"
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.01
permeability_coefficient = 0.9
armor_melee = CLOTHING_ARMOR_NONE
armor_bullet = CLOTHING_ARMOR_NONE
armor_laser = CLOTHING_ARMOR_NONE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/masks/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
flags_inventory = COVERMOUTH
flags_armor_protection = 0
gas_transfer_coefficient = 0.90
permeability_coefficient = 0.01
permeability_coefficient = 0.3
armor_melee = CLOTHING_ARMOR_NONE
armor_bullet = CLOTHING_ARMOR_NONE
armor_laser = CLOTHING_ARMOR_NONE
Expand Down
4 changes: 2 additions & 2 deletions code/modules/clothing/suits/bio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name = "bio hood"
icon_state = "bio"
desc = "A hood that protects the head and face from biological contaminants."
permeability_coefficient = 0.01
permeability_coefficient = 0.2
armor_melee = CLOTHING_ARMOR_NONE
armor_bullet = CLOTHING_ARMOR_NONE
armor_laser = CLOTHING_ARMOR_NONE
Expand All @@ -30,7 +30,7 @@
item_state = "bio_suit"
w_class = SIZE_LARGE//bulky item
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.01
permeability_coefficient = 0.2
flags_armor_protection = BODY_FLAG_CHEST|BODY_FLAG_GROIN|BODY_FLAG_LEGS|BODY_FLAG_FEET|BODY_FLAG_ARMS|BODY_FLAG_HANDS
slowdown = 1
armor_melee = CLOTHING_ARMOR_NONE
Expand Down

0 comments on commit 199a27a

Please sign in to comment.