-Viruses will now not count towards the chance of infecting someone with virus protection.

-Added some extra virus protection to objects.
-This should all fix randomly being infected while wearing full virus protection gear.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5233 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-11-30 20:18:29 +00:00
parent cd2fcfc920
commit 9e8ee77049
5 changed files with 24 additions and 27 deletions

View File

@@ -313,4 +313,11 @@ proc/listclearnulls(list/list)
if(index == i)
return key
i++
return null
return null
/proc/count_by_type(var/list/L, type)
var/i = 0
for(var/T in L)
if(istype(T, type))
i++
return i

View File

@@ -12,4 +12,5 @@
desc = "A close-fitting sterile mask that can be connected to an air supply."
name = "medical mask"
icon_state = "medical"
item_state = "medical"
item_state = "medical"
permeability_coefficient = 0.01

View File

@@ -24,7 +24,7 @@
w_class = 1
flags = FPRINT|TABLEPASS|MASKCOVERSMOUTH
gas_transfer_coefficient = 0.90
permeability_coefficient = 0.05
permeability_coefficient = 0.01
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 25, rad = 0)
/obj/item/clothing/mask/fakemoustache

View File

@@ -65,7 +65,7 @@
/obj/item/clothing/shoes/white
name = "white shoes"
icon_state = "white"
permeability_coefficient = 0.25
permeability_coefficient = 0.01
color = "white"
/obj/item/clothing/shoes/rainbow

View File

@@ -22,10 +22,7 @@ Put (mob/proc)s here that are in dire need of a code cleanup.
if(A.GetDiseaseID() in resistances)
//world << "It resisted us!"
return
var/count = 0
for(var/datum/disease/advance/AD in viruses)
count++
if(count >= 3)
if(count_by_type(viruses, /datum/disease/advance) >= 3)
return
else
@@ -118,41 +115,33 @@ Put (mob/proc)s here that are in dire need of a code cleanup.
if(1)
if(isobj(H.head) && !istype(H.head, /obj/item/weapon/paper))
Cl = H.head
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod)
// world << "Head pass [passed]"
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(H.wear_mask))
Cl = H.wear_mask
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod)
// world << "Mask pass [passed]"
passed = prob((Cl.permeability_coefficient*100) - 1)
if(2)//arms and legs included
if(isobj(H.wear_suit))
Cl = H.wear_suit
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod)
// world << "Suit pass [passed]"
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(slot_w_uniform))
Cl = slot_w_uniform
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod)
// world << "Uniform pass [passed]"
passed = prob((Cl.permeability_coefficient*100) - 1)
if(3)
if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&HANDS)
Cl = H.wear_suit
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod)
// world << "Suit pass [passed]"
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(H.gloves))
Cl = H.gloves
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod)
// world << "Gloves pass [passed]"
passed = prob((Cl.permeability_coefficient*100) - 1)
if(4)
if(isobj(H.wear_suit) && H.wear_suit.body_parts_covered&FEET)
Cl = H.wear_suit
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod)
// world << "Suit pass [passed]"
passed = prob((Cl.permeability_coefficient*100) - 1)
if(passed && isobj(H.shoes))
Cl = H.shoes
passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod)
// world << "Shoes pass [passed]"
passed = prob((Cl.permeability_coefficient*100) - 1)
else
src << "Something strange's going on, something's wrong."
@@ -169,11 +158,11 @@ Put (mob/proc)s here that are in dire need of a code cleanup.
if(1)
if(M.wear_mask && isobj(M.wear_mask))
Cl = M.wear_mask
passed = prob(Cl.permeability_coefficient*100+virus.permeability_mod)
passed = prob((Cl.permeability_coefficient*100) - 1)
//world << "Mask pass [passed]"
if(passed && spread_type == AIRBORNE && internals)
passed = (prob(50*virus.permeability_mod))
if(!passed && spread_type == AIRBORNE && !internals)
passed = (prob((50*virus.permeability_mod) - 1))
if(passed)
//world << "Infection in the mob [src]. YAY"