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

Disease protection #4524

Merged
merged 8 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
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 @@ -24,7 +24,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