From 108a9f7295bc932607a71a7d4f17bef837ecc44d Mon Sep 17 00:00:00 2001 From: DeityLink Date: Sat, 12 Jun 2021 07:35:39 +0200 Subject: [PATCH] Standardized damage overlay updates (#29730) * standard damage overlay updates * Update vgstation13.dme * durp --- code/_onclick/hud/fullscreen.dm | 5 +- .../mob/living/carbon/alien/humanoid/life.dm | 12 +- .../mob/living/carbon/alien/larva/life.dm | 11 +- .../carbon/alien/special/alien_embryo.dm | 9 +- code/modules/mob/living/carbon/human/death.dm | 1 + .../human/life/handle_regular_hud_updates.dm | 105 +--------------- .../living/carbon/human/life/life_helpers.dm | 2 +- code/modules/mob/living/carbon/monkey/life.dm | 1 + .../mob/living/carbon/monkey/monkey.dm | 5 + code/modules/mob/living/carbon/shock.dm | 6 +- code/modules/mob/living/carbon/slime/life.dm | 16 +-- code/modules/mob/living/death.dm | 4 +- code/modules/mob/living/living.dm | 2 + code/modules/mob/living/login.dm | 2 + .../modules/mob/living/simple_animal/borer.dm | 13 +- .../mob/living/simple_animal/constructs.dm | 2 + .../living/simple_animal/friendly/corgi.dm | 1 + .../living/simple_animal/friendly/mouse.dm | 1 + .../hostile/giant_spider/base_spider.dm | 1 + .../modules/mob/living/simple_animal/shade.dm | 1 + .../mob/living/simple_animal/simple_animal.dm | 2 + .../living/standard_damage_overlay_updates.dm | 119 ++++++++++++++++++ code/modules/mob/logout.dm | 2 + vgstation13.dme | 1 + 24 files changed, 165 insertions(+), 159 deletions(-) create mode 100644 code/modules/mob/living/standard_damage_overlay_updates.dm diff --git a/code/_onclick/hud/fullscreen.dm b/code/_onclick/hud/fullscreen.dm index 40c3714d37e..72ef49013f4 100644 --- a/code/_onclick/hud/fullscreen.dm +++ b/code/_onclick/hud/fullscreen.dm @@ -55,9 +55,10 @@ client.screen -= screen qdel(screen) -/mob/proc/clear_fullscreens() +/mob/proc/clear_fullscreens(var/dead_mob = FALSE, var/animate = 10) for(var/category in screens) - clear_fullscreen(category) + if (!dead_mob || ((category != "brute") && (category != "oxy"))) + clear_fullscreen(category, animate) /datum/hud/proc/reload_fullscreen() if(mymob && mymob.client && mymob.stat != DEAD) diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index d36fa492a73..529a4fee5d7 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -424,16 +424,8 @@ clear_alert(SCREEN_ALARM_FIRE) //NOTE: the alerts dont reset when youre out of danger. dont blame me, //blame the person who coded them. Temporary fix added. - if(client) - clear_fullscreens() - if(src.eye_blind) - overlay_fullscreen("blind", /obj/abstract/screen/fullscreen/blind) - if (src.disabilities & NEARSIGHTED) - overlay_fullscreen("impaired", /obj/abstract/screen/fullscreen/impaired) - if (src.eye_blurry) - overlay_fullscreen("blurry", /obj/abstract/screen/fullscreen/blurry) - if (src.druggy) - overlay_fullscreen("high", /obj/abstract/screen/fullscreen/high) + + standard_damage_overlay_updates() if(!isDead()) if(machine) diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 31cd4bbb903..feae96a5827 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -349,16 +349,7 @@ else clear_alert(SCREEN_ALARM_FIRE) - if (client) - clear_fullscreens() - if(src.eye_blind || src.blinded) - overlay_fullscreen("blind", /obj/abstract/screen/fullscreen/blind) - if(src.disabilities & NEARSIGHTED) - overlay_fullscreen("impaired", /obj/abstract/screen/fullscreen/impaired) - if(src.eye_blurry) - overlay_fullscreen("blurry", /obj/abstract/screen/fullscreen/blurry) - if(src.druggy) - overlay_fullscreen("high", /obj/abstract/screen/fullscreen/high) + standard_damage_overlay_updates() if(!isDead()) if(machine) diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index 3b609628bc3..a9bf4d43b4a 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -2,7 +2,7 @@ // It functions almost identically (see code/datums/diseases/alien_embryo.dm) /obj/item/alien_embryo - name = "alien embryo" //The alien embryo, not Alien Embryo + name = "alien embryo" desc = "All slimy and yuck." icon = 'icons/mob/alien.dmi' icon_state = "larva0_dead" @@ -24,6 +24,11 @@ spawn(0) AddInfectionImages(affected_mob) else + var/mob/living/carbon/alien/larva/larva_corpse = new(get_turf(src)) + larva_corpse.bruteloss = 25 + larva_corpse.oxyloss = 26 + larva_corpse.death() + qdel(src) /obj/item/alien_embryo/Topic(href,href_list) @@ -148,7 +153,7 @@ spawn(6) var/mob/living/carbon/alien/larva/new_xeno = new(get_turf(affected_mob)) new_xeno.key = picked - + var/datum/role/new_role = new /datum/role/xenomorph new_role.AssignToRole(new_xeno.mind, 1) var/datum/faction/xeno_fac = find_active_faction_by_type(/datum/faction/xenomorph) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index abea8972998..c4e74fb161b 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -134,6 +134,7 @@ if(ticker && ticker.mode) sql_report_death(src) species.handle_death(src) + if(become_zombie_after_death && isjusthuman(src)) spawn(30 SECONDS) if(!gcDestroyed) diff --git a/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm b/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm index 1fe3b87ca8a..5660ca57c98 100644 --- a/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm +++ b/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm @@ -10,82 +10,8 @@ update_action_buttons_icon() - if(stat == UNCONSCIOUS && health <= config.health_threshold_crit) - var/severity = 0 - switch(health) - if(-20 to -10) - severity = 1 - if(-30 to -20) - severity = 2 - if(-40 to -30) - severity = 3 - if(-50 to -40) - severity = 4 - if(-60 to -50) - severity = 5 - if(-70 to -60) - severity = 6 - if(-80 to -70) - severity = 7 - if(-90 to -80) - severity = 8 - if(-95 to -90) - severity = 9 - if(-INFINITY to -95) - severity = 10 - overlay_fullscreen("crit", /obj/abstract/screen/fullscreen/crit, severity) - else - clear_fullscreen("crit") - if(oxyloss) - if(pain_numb) - oxyloss = max((oxyloss - 20) / 2, 0) //Make the damage appear smaller than it really is - var/severity = 0 - switch(oxyloss) - if(10 to 20) - severity = 1 - if(20 to 25) - severity = 2 - if(25 to 30) - severity = 3 - if(30 to 35) - severity = 4 - if(35 to 40) - severity = 5 - if(40 to 45) - severity = 6 - if(45 to INFINITY) - severity = 7 - overlay_fullscreen("oxy", /obj/abstract/screen/fullscreen/oxy, severity) - else - clear_fullscreen("oxy") - //Fire and Brute damage overlay (BSSR) - var/hurtdamage = src.getBruteLoss() + src.getFireLoss() + damageoverlaytemp - damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not. - if(hurtdamage) - if(pain_numb) - hurtdamage = max((hurtdamage - 20) / 2, 0) //Make the damage appear smaller than it really is - var/severity = 0 - switch(hurtdamage) - if(5 to 15) - severity = 1 - if(15 to 30) - severity = 2 - if(30 to 45) - severity = 3 - if(45 to 70) - severity = 4 - if(70 to 85) - severity = 5 - if(85 to INFINITY) - severity = 6 - overlay_fullscreen("brute", /obj/abstract/screen/fullscreen/brute, severity) - else - clear_fullscreen("brute") - //damageoverlay.overlays += I - if(pain_numb) - overlay_fullscreen("numb", /obj/abstract/screen/fullscreen/numb) - else - clear_fullscreen("numb") + standard_damage_overlay_updates() + if(stat == DEAD) change_sight(adding = SEE_TURFS|SEE_MOBS|SEE_OBJS) see_in_dark = 8 @@ -295,33 +221,6 @@ update_pull_icon() - if(disabilities & NEARSIGHTED) //This looks meh but saves a lot of memory by not requiring to add var/prescription - if(glasses) //To every /obj/item - var/obj/item/clothing/glasses/G = glasses - if(!G.prescription) - overlay_fullscreen("nearsighted", /obj/abstract/screen/fullscreen/impaired, 1) - else - clear_fullscreen("nearsighted") - else - overlay_fullscreen("nearsighted", /obj/abstract/screen/fullscreen/impaired, 1) - else - clear_fullscreen("nearsighted") - if(eye_blind || blinded) - overlay_fullscreen("blind", /obj/abstract/screen/fullscreen/blind) - else - clear_fullscreen("blind") - if(eye_blurry) - overlay_fullscreen("blurry", /obj/abstract/screen/fullscreen/blurry) - else - clear_fullscreen("blurry") - if(druggy) - overlay_fullscreen("high", /obj/abstract/screen/fullscreen/high) - else - clear_fullscreen("high") - if(has_reagent_in_blood(INCENSE_MOONFLOWERS)) - overlay_fullscreen("high_red", /obj/abstract/screen/fullscreen/high/red) - else - clear_fullscreen("high_red") if (istype(glasses, /obj/item/clothing/glasses/science)) var/obj/item/clothing/glasses/science/S = glasses if (S.on) diff --git a/code/modules/mob/living/carbon/human/life/life_helpers.dm b/code/modules/mob/living/carbon/human/life/life_helpers.dm index 38d6a02f210..85c322fe08e 100644 --- a/code/modules/mob/living/carbon/human/life/life_helpers.dm +++ b/code/modules/mob/living/carbon/human/life/life_helpers.dm @@ -177,7 +177,7 @@ /mob/living/carbon/human/earprot() return is_on_ears(/obj/item/clothing/ears/earmuffs) || is_on_ears(/obj/item/device/radio/headset/headset_earmuffs) -/mob/living/carbon/human/proc/has_reagent_in_blood(var/reagent_name,var/amount = -1) +/mob/living/proc/has_reagent_in_blood(var/reagent_name,var/amount = -1) if(!reagents || !ticker) return 0 return reagents.has_reagent(reagent_name,amount) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 69864cf6e25..e66d129dae7 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -72,6 +72,7 @@ if(client) handle_regular_hud_updates() + standard_damage_overlay_updates() // Grabbing for(var/obj/item/weapon/grab/G in src) diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 1e7df8b99a6..6fbe2dd1c1e 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -361,6 +361,11 @@ wear_id.emp_act(severity) ..() +/mob/living/carbon/monkey/adjustBruteLoss(damage) + ..() + if (damage > 0) + damageoverlaytemp = 20 + /mob/living/carbon/monkey/ex_act(severity) if(flags & INVULNERABLE) return diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm index 3dbc522820f..c993f1f6929 100644 --- a/code/modules/mob/living/carbon/shock.dm +++ b/code/modules/mob/living/carbon/shock.dm @@ -1,6 +1,6 @@ -/mob/living/carbon/var/pain_shock_stage = 0 -/mob/living/carbon/var/pain_level = 0 //Gets overwritten every tick! If you want to add pain "resistance" or constain pain, see update_pain_level() -/mob/living/carbon/var/pain_numb = 0 // When this is set, the mob isn't affected by shock or pain, but can't see their health. +/mob/living/var/pain_shock_stage = 0 +/mob/living/var/pain_level = 0 //Gets overwritten every tick! If you want to add pain "resistance" or constain pain, see update_pain_level() +/mob/living/var/pain_numb = 0 // When this is set, the mob isn't affected by shock or pain, but can't see their health. // proc to find out in how much pain the mob is at the moment /mob/living/carbon/proc/update_pain_level() diff --git a/code/modules/mob/living/carbon/slime/life.dm b/code/modules/mob/living/carbon/slime/life.dm index f7d5ebcba56..5965c8a97a3 100644 --- a/code/modules/mob/living/carbon/slime/life.dm +++ b/code/modules/mob/living/carbon/slime/life.dm @@ -40,6 +40,7 @@ // Basically just deletes any screen objects :< regular_hud_updates() + standard_damage_overlay_updates() //Handle temperature/pressure differences between body and environment if(environment) @@ -323,7 +324,7 @@ if(say_mute) say_mute = 0 - + src.setDensity(!src.lying) if (src.sdisabilities & BLIND) @@ -568,8 +569,6 @@ if(client) update_pull_icon() - var/severity = 0 - var/healthpercent = (health/maxHealth) * 100 switch(healthpercent) @@ -577,27 +576,16 @@ healths.icon_state = "slime_health0" if(80 to 100) healths.icon_state = "slime_health1" - severity = 1 if(60 to 80) healths.icon_state = "slime_health2" - severity = 2 if(40 to 60) healths.icon_state = "slime_health3" - severity = 3 if(20 to 40) healths.icon_state = "slime_health4" - severity = 4 if(0 to 20) healths.icon_state = "slime_health5" - severity = 5 if(-99 to 0) healths.icon_state = "slime_health6" - severity = 6 else healths.icon_state = "slime_health7" - severity = 6 - if(severity > 0) - overlay_fullscreen("brute", /obj/abstract/screen/fullscreen/brute, severity) - else - clear_fullscreen("brute") diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index e0961d23138..5c0621cf2a9 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -6,10 +6,10 @@ //See code/datums/helper_datums/butchering.dm init_butchering_list() - clear_fullscreens() - + clear_fullscreens(TRUE) handle_symptom_on_death() ..() + standard_damage_overlay_updates() /mob/living/gib(animation = FALSE, meat = TRUE) if(!isUnconscious()) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 7fd7e6676d7..ce4ad6f4459 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -627,6 +627,8 @@ Thanks. regenerate_icons() update_canmove() + clear_fullscreens() + hud_updateflag |= 1 << HEALTH_HUD hud_updateflag |= 1 << STATUS_HUD diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm index a5de332a7b8..7b8b1849278 100644 --- a/code/modules/mob/living/login.dm +++ b/code/modules/mob/living/login.dm @@ -1,6 +1,8 @@ /mob/living/Login() ..() + standard_damage_overlay_updates() + //Mind updates mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist) mind.active = 1 //indicates that the mind is currently synced with a client diff --git a/code/modules/mob/living/simple_animal/borer.dm b/code/modules/mob/living/simple_animal/borer.dm index 6f70e4c4d7d..1307c725ad9 100644 --- a/code/modules/mob/living/simple_animal/borer.dm +++ b/code/modules/mob/living/simple_animal/borer.dm @@ -183,6 +183,7 @@ var/global/borer_unlock_types_leg = typesof(/datum/unlockable/borer/leg) - /datu if(client) regular_hud_updates() + standard_damage_overlay_updates() /mob/living/simple_animal/borer/regular_hud_updates() if(fire_alert) @@ -190,8 +191,6 @@ var/global/borer_unlock_types_leg = typesof(/datum/unlockable/borer/leg) - /datu else clear_alert(SCREEN_ALARM_FIRE) - var/severity = 0 - var/healthpercent = (health/maxHealth)*100 switch(healthpercent) @@ -199,24 +198,14 @@ var/global/borer_unlock_types_leg = typesof(/datum/unlockable/borer/leg) - /datu healths.icon_state = "borer_health0" if(75 to 100) healths.icon_state = "borer_health1" - severity = 2 if(50 to 75) healths.icon_state = "borer_health2" - severity = 3 if(25 to 50) healths.icon_state = "borer_health3" - severity = 4 if(1 to 25) healths.icon_state = "borer_health4" - severity = 5 else healths.icon_state = "borer_health5" - severity = 6 - - if(severity > 0) - overlay_fullscreen("damage", /obj/abstract/screen/fullscreen/brute, severity) - else - clear_fullscreen("damage") /mob/living/simple_animal/borer/proc/update_verbs(var/mode) if(verb_holders.len>0) diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index af228061ab4..2e6ee2ff9c0 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -536,6 +536,8 @@ if(.) regular_hud_updates() + standard_damage_overlay_updates() + /mob/living/simple_animal/construct/regular_hud_updates() if(fire_alert) diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index 4cda820b88b..7ecd560b248 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -61,6 +61,7 @@ . = ..() if(.) regular_hud_updates() + standard_damage_overlay_updates() if(!stat && !resting && !locked_to && (ckey == null)) //Behavior mechanisms (om nom :3) if(corgi_status == IDLE) get_target() diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 770ba8cb6c2..fbec54744dc 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -69,6 +69,7 @@ if(timestopped) return 0 //under effects of time magick ..() + standard_damage_overlay_updates() if(!stat && prob(speak_chance)) for(var/mob/M in view()) M << 'sound/effects/mousesqueek.ogg' diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider/base_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider/base_spider.dm index ffd42841f0e..61e1571b698 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider/base_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider/base_spider.dm @@ -168,6 +168,7 @@ a_51,a_52,a_53,a_54) regular_hud_updates() + standard_damage_overlay_updates() /mob/living/simple_animal/hostile/giant_spider/regular_hud_updates() if (!client) diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm index 0f60a197c63..dcdb9ea07f3 100644 --- a/code/modules/mob/living/simple_animal/shade.dm +++ b/code/modules/mob/living/simple_animal/shade.dm @@ -80,6 +80,7 @@ return FALSE //under effects of time magick ..() regular_hud_updates() + standard_damage_overlay_updates() if(isDead()) for(var/i=0;i<3;i++) new /obj/item/weapon/ectoplasm (src.loc) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index f856851c2be..b40328bd363 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -595,6 +595,8 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t if(lazy_invoke_event(/lazy_event/on_damaged, list("kind" = BRUTE, "amount" = damage))) return 0 + if (damage > 0) + damageoverlaytemp = 20 if(skinned()) damage = damage * 2 if(purge) diff --git a/code/modules/mob/living/standard_damage_overlay_updates.dm b/code/modules/mob/living/standard_damage_overlay_updates.dm new file mode 100644 index 00000000000..f020b79d15c --- /dev/null +++ b/code/modules/mob/living/standard_damage_overlay_updates.dm @@ -0,0 +1,119 @@ + +/mob/living/proc/standard_damage_overlay_updates() + if(!client) + return 0 + + var/health_percent = health * 100 / maxHealth + + if(stat == UNCONSCIOUS && health_percent <= config.health_threshold_crit) + var/severity = 0 + switch(health_percent) + if(-20 to -10) + severity = 1 + if(-30 to -20) + severity = 2 + if(-40 to -30) + severity = 3 + if(-50 to -40) + severity = 4 + if(-60 to -50) + severity = 5 + if(-70 to -60) + severity = 6 + if(-80 to -70) + severity = 7 + if(-90 to -80) + severity = 8 + if(-95 to -90) + severity = 9 + if(-INFINITY to -95) + severity = 10 + overlay_fullscreen("crit", /obj/abstract/screen/fullscreen/crit, severity) + else + clear_fullscreen("crit") + var/oxyloss_percent = oxyloss * 100 / maxHealth + if (istype(src,/mob/living/simple_animal) || istype(src,/mob/living/carbon/slime)) + oxyloss_percent = (100 - health_percent)/2 + if(oxyloss_percent) + if(pain_numb) + oxyloss_percent = max((oxyloss_percent - 20) / 2, 0) //Make the damage appear smaller than it really is + var/severity = 0 + switch(oxyloss_percent) + if(10 to 20) + severity = 1 + if(20 to 25) + severity = 2 + if(25 to 30) + severity = 3 + if(30 to 35) + severity = 4 + if(35 to 40) + severity = 5 + if(40 to 45) + severity = 6 + if(45 to INFINITY) + severity = 7 + overlay_fullscreen("oxy", /obj/abstract/screen/fullscreen/oxy, severity) + else + clear_fullscreen("oxy") + //Fire and Brute damage overlay (BSSR) + var/hurtdamage = (getBruteLoss()*100/maxHealth) + (getFireLoss()*100/maxHealth) + (damageoverlaytemp * 100 / maxHealth) + if (istype(src,/mob/living/simple_animal) || istype(src,/mob/living/carbon/slime)) + hurtdamage = (100 - health_percent) + (damageoverlaytemp * 100 / maxHealth) + damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not. + if(hurtdamage) + if(pain_numb) + hurtdamage = max((hurtdamage - 20) / 2, 0) //Make the damage appear smaller than it really is + var/severity = 0 + switch(hurtdamage) + if(5 to 15) + severity = 1 + if(15 to 30) + severity = 2 + if(30 to 45) + severity = 3 + if(45 to 70) + severity = 4 + if(70 to 85) + severity = 5 + if(85 to INFINITY) + severity = 6 + overlay_fullscreen("brute", /obj/abstract/screen/fullscreen/brute, severity) + else + clear_fullscreen("brute") + //damageoverlay.overlays += I + if(pain_numb) + overlay_fullscreen("numb", /obj/abstract/screen/fullscreen/numb) + else + clear_fullscreen("numb") + + if(stat != DEAD) + if(disabilities & NEARSIGHTED) //This looks meh but saves a lot of memory by not requiring to add var/prescription + if (ishuman(src)) + var/mob/living/carbon/human/H = src + if(H.glasses) //To every /obj/item + var/obj/item/clothing/glasses/G = H.glasses + if(!G.prescription) + overlay_fullscreen("nearsighted", /obj/abstract/screen/fullscreen/impaired, 1) + else + clear_fullscreen("nearsighted") + else + overlay_fullscreen("nearsighted", /obj/abstract/screen/fullscreen/impaired, 1) + else + clear_fullscreen("nearsighted") + if(eye_blind || blinded) + overlay_fullscreen("blind", /obj/abstract/screen/fullscreen/blind) + else + clear_fullscreen("blind") + if(eye_blurry) + overlay_fullscreen("blurry", /obj/abstract/screen/fullscreen/blurry) + else + clear_fullscreen("blurry") + if(druggy) + overlay_fullscreen("high", /obj/abstract/screen/fullscreen/high) + else + clear_fullscreen("high") + if(has_reagent_in_blood(INCENSE_MOONFLOWERS)) + overlay_fullscreen("high_red", /obj/abstract/screen/fullscreen/high/red) + else + clear_fullscreen("high_red") diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index dc3938e1df0..a731aca9868 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -20,6 +20,8 @@ log_access("Logout: [key_name(src)] ([formatLocation(loc)])") + clear_fullscreens(FALSE, 0) + remove_screen_objs() //Used to remove hud elements if (src in science_goggles_wearers) diff --git a/vgstation13.dme b/vgstation13.dme index f75305ea7af..eb9a92b8193 100644 --- a/vgstation13.dme +++ b/vgstation13.dme @@ -1753,6 +1753,7 @@ #include "code\modules\mob\living\login.dm" #include "code\modules\mob\living\logout.dm" #include "code\modules\mob\living\say.dm" +#include "code\modules\mob\living\standard_damage_overlay_updates.dm" #include "code\modules\mob\living\carbon\carbon.dm" #include "code\modules\mob\living\carbon\carbon_defines.dm" #include "code\modules\mob\living\carbon\combat.dm"