diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index ecde87a5a16..a743e779687 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -313,6 +313,7 @@ /mob/living/carbon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0) . = ..() var/damage = intensity - check_eye_prot() + var/extra_damage = 0 if(.) if(visual) return @@ -323,19 +324,32 @@ if(!E || (E && E.weld_proof)) return + var/extra_darkview = 0 + if(E.dark_view) + extra_darkview = max(E.dark_view - 2, 0) + extra_damage = extra_darkview + + var/light_amount = 10 // assume full brightness + if(isturf(src.loc)) + var/turf/T = src.loc + light_amount = round(T.get_lumcount() * 10) + + // a dark view of 8, in full darkness, will result in maximum 1st tier damage + var/extra_prob = (10 - light_amount) * extra_darkview + switch(damage) if(1) to_chat(src, "Your eyes sting a little.") - if(prob(40)) //waiting on carbon organs - E.receive_damage(1, 1) - + var/minor_damage_multiplier = min(40 + extra_prob, 100) / 100 + var/minor_damage = minor_damage_multiplier * (1 + extra_damage) + E.receive_damage(minor_damage, 1) if(2) to_chat(src, "Your eyes burn.") - E.receive_damage(rand(2, 4), 1) + E.receive_damage(rand(2, 4) + extra_damage, 1) else to_chat(src, "Your eyes itch and burn severely!") - E.receive_damage(rand(12, 16), 1) + E.receive_damage(rand(12, 16) + extra_damage, 1) if(E.damage > E.min_bruised_damage) AdjustEyeBlind(damage) @@ -1105,4 +1119,4 @@ so that different stomachs can handle things in different ways VB*/ update_tint() if(I.flags_inv & HIDEMASK || forced) update_inv_wear_mask() - update_inv_head() \ No newline at end of file + update_inv_head()