Merge pull request #4371 from Anewbe/phoron_contamination

Contaminated items now respect gloves
This commit is contained in:
Neerti
2017-11-30 20:43:27 -05:00
committed by GitHub
5 changed files with 45 additions and 18 deletions
+22 -6
View File
@@ -820,18 +820,34 @@
if(!isSynthetic())
if(touching) touching.metabolize()
if(ingested) ingested.metabolize()
if(bloodstr) bloodstr.metabolize()
if(touching)
touching.metabolize()
if(ingested)
ingested.metabolize()
if(bloodstr)
bloodstr.metabolize()
var/total_phoronloss = 0
for(var/obj/item/I in src)
if(I.contaminated)
if(src.species && src.species.get_bodytype() != "Vox")
total_phoronloss += vsc.plc.CONTAMINATION_LOSS
if(!(status_flags & GODMODE)) adjustToxLoss(total_phoronloss)
// This is hacky, I'm so sorry.
if(I != l_hand && I != r_hand) //If the item isn't in your hands, you're probably wearing it. Full damage for you.
total_phoronloss += vsc.plc.CONTAMINATION_LOSS
else if(I == l_hand) //If the item is in your hands, but you're wearing protection, you might be alright.
var/l_hand_blocked = 0
l_hand_blocked = 1-(100-getarmor(BP_L_HAND, "bio"))/100 //This should get a number between 0 and 1
total_phoronloss += vsc.plc.CONTAMINATION_LOSS * l_hand_blocked
else if(I == r_hand) //If the item is in your hands, but you're wearing protection, you might be alright.
var/r_hand_blocked = 0
r_hand_blocked = 1-(100-getarmor(BP_R_HAND, "bio"))/100 //This should get a number between 0 and 1
total_phoronloss += vsc.plc.CONTAMINATION_LOSS * r_hand_blocked
if(total_phoronloss)
if(!(status_flags & GODMODE))
adjustToxLoss(total_phoronloss)
if(status_flags & GODMODE) return 0 //godmode
if(status_flags & GODMODE)
return 0 //godmode
var/obj/item/organ/internal/diona/node/light_organ = locate() in internal_organs