Skip to content

Commit

Permalink
mob_procs + tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kiVts committed Sep 29, 2023
1 parent 08814f0 commit c22e59b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 40 deletions.
22 changes: 2 additions & 20 deletions code/datums/disease.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
if(isturf(source.loc))
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) && !locate(src) in victim.viruses)
if(get_infection_chance(victim))
victim.contract_disease(src, 0, 1, force_spread)
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 @@ -174,23 +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/proc/get_infection_chance(mob/living/carbon/human/victim)
if(ishuman(victim))
var/protection = 0 //Our current credit protection on how good are we protected from any sort of disease.
if(istype(victim.wear_mask, /obj/item/clothing/mask/surgical))
protection += 30
if(istype(victim.gloves, /obj/item/clothing/gloves/latex))
protection += 20
if(istype(victim.head, /obj/item/clothing/head/bio_hood) && istype(victim.wear_suit, /obj/item/clothing/suit/bio_suit))
protection += 80 // biosuit is VERY helpfull
else if(istype(victim.head, /obj/item/clothing/head/helmet/space) && istype(victim.wear_suit, /obj/item/clothing/suit/space))
protection += 60 // not as usefull but still very helpfull
protection = clamp(protection, 5, 95)
if(prob(protection))
return FALSE
return TRUE


/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

0 comments on commit c22e59b

Please sign in to comment.