mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Standardized damage overlay updates (#29730)
* standard damage overlay updates * Update vgstation13.dme * durp
This commit is contained in:
@@ -55,9 +55,10 @@
|
|||||||
client.screen -= screen
|
client.screen -= screen
|
||||||
qdel(screen)
|
qdel(screen)
|
||||||
|
|
||||||
/mob/proc/clear_fullscreens()
|
/mob/proc/clear_fullscreens(var/dead_mob = FALSE, var/animate = 10)
|
||||||
for(var/category in screens)
|
for(var/category in screens)
|
||||||
clear_fullscreen(category)
|
if (!dead_mob || ((category != "brute") && (category != "oxy")))
|
||||||
|
clear_fullscreen(category, animate)
|
||||||
|
|
||||||
/datum/hud/proc/reload_fullscreen()
|
/datum/hud/proc/reload_fullscreen()
|
||||||
if(mymob && mymob.client && mymob.stat != DEAD)
|
if(mymob && mymob.client && mymob.stat != DEAD)
|
||||||
|
|||||||
@@ -424,16 +424,8 @@
|
|||||||
clear_alert(SCREEN_ALARM_FIRE)
|
clear_alert(SCREEN_ALARM_FIRE)
|
||||||
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
|
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
|
||||||
//blame the person who coded them. Temporary fix added.
|
//blame the person who coded them. Temporary fix added.
|
||||||
if(client)
|
|
||||||
clear_fullscreens()
|
standard_damage_overlay_updates()
|
||||||
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)
|
|
||||||
|
|
||||||
if(!isDead())
|
if(!isDead())
|
||||||
if(machine)
|
if(machine)
|
||||||
|
|||||||
@@ -349,16 +349,7 @@
|
|||||||
else
|
else
|
||||||
clear_alert(SCREEN_ALARM_FIRE)
|
clear_alert(SCREEN_ALARM_FIRE)
|
||||||
|
|
||||||
if (client)
|
standard_damage_overlay_updates()
|
||||||
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)
|
|
||||||
|
|
||||||
if(!isDead())
|
if(!isDead())
|
||||||
if(machine)
|
if(machine)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// It functions almost identically (see code/datums/diseases/alien_embryo.dm)
|
// It functions almost identically (see code/datums/diseases/alien_embryo.dm)
|
||||||
|
|
||||||
/obj/item/alien_embryo
|
/obj/item/alien_embryo
|
||||||
name = "alien embryo" //The alien embryo, not Alien Embryo
|
name = "alien embryo"
|
||||||
desc = "All slimy and yuck."
|
desc = "All slimy and yuck."
|
||||||
icon = 'icons/mob/alien.dmi'
|
icon = 'icons/mob/alien.dmi'
|
||||||
icon_state = "larva0_dead"
|
icon_state = "larva0_dead"
|
||||||
@@ -24,6 +24,11 @@
|
|||||||
spawn(0)
|
spawn(0)
|
||||||
AddInfectionImages(affected_mob)
|
AddInfectionImages(affected_mob)
|
||||||
else
|
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)
|
qdel(src)
|
||||||
|
|
||||||
/obj/item/alien_embryo/Topic(href,href_list)
|
/obj/item/alien_embryo/Topic(href,href_list)
|
||||||
@@ -148,7 +153,7 @@
|
|||||||
spawn(6)
|
spawn(6)
|
||||||
var/mob/living/carbon/alien/larva/new_xeno = new(get_turf(affected_mob))
|
var/mob/living/carbon/alien/larva/new_xeno = new(get_turf(affected_mob))
|
||||||
new_xeno.key = picked
|
new_xeno.key = picked
|
||||||
|
|
||||||
var/datum/role/new_role = new /datum/role/xenomorph
|
var/datum/role/new_role = new /datum/role/xenomorph
|
||||||
new_role.AssignToRole(new_xeno.mind, 1)
|
new_role.AssignToRole(new_xeno.mind, 1)
|
||||||
var/datum/faction/xeno_fac = find_active_faction_by_type(/datum/faction/xenomorph)
|
var/datum/faction/xeno_fac = find_active_faction_by_type(/datum/faction/xenomorph)
|
||||||
|
|||||||
@@ -134,6 +134,7 @@
|
|||||||
if(ticker && ticker.mode)
|
if(ticker && ticker.mode)
|
||||||
sql_report_death(src)
|
sql_report_death(src)
|
||||||
species.handle_death(src)
|
species.handle_death(src)
|
||||||
|
|
||||||
if(become_zombie_after_death && isjusthuman(src))
|
if(become_zombie_after_death && isjusthuman(src))
|
||||||
spawn(30 SECONDS)
|
spawn(30 SECONDS)
|
||||||
if(!gcDestroyed)
|
if(!gcDestroyed)
|
||||||
|
|||||||
@@ -10,82 +10,8 @@
|
|||||||
|
|
||||||
update_action_buttons_icon()
|
update_action_buttons_icon()
|
||||||
|
|
||||||
if(stat == UNCONSCIOUS && health <= config.health_threshold_crit)
|
standard_damage_overlay_updates()
|
||||||
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")
|
|
||||||
if(stat == DEAD)
|
if(stat == DEAD)
|
||||||
change_sight(adding = SEE_TURFS|SEE_MOBS|SEE_OBJS)
|
change_sight(adding = SEE_TURFS|SEE_MOBS|SEE_OBJS)
|
||||||
see_in_dark = 8
|
see_in_dark = 8
|
||||||
@@ -295,33 +221,6 @@
|
|||||||
|
|
||||||
update_pull_icon()
|
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))
|
if (istype(glasses, /obj/item/clothing/glasses/science))
|
||||||
var/obj/item/clothing/glasses/science/S = glasses
|
var/obj/item/clothing/glasses/science/S = glasses
|
||||||
if (S.on)
|
if (S.on)
|
||||||
|
|||||||
@@ -177,7 +177,7 @@
|
|||||||
/mob/living/carbon/human/earprot()
|
/mob/living/carbon/human/earprot()
|
||||||
return is_on_ears(/obj/item/clothing/ears/earmuffs) || is_on_ears(/obj/item/device/radio/headset/headset_earmuffs)
|
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)
|
if(!reagents || !ticker)
|
||||||
return 0
|
return 0
|
||||||
return reagents.has_reagent(reagent_name,amount)
|
return reagents.has_reagent(reagent_name,amount)
|
||||||
|
|||||||
@@ -72,6 +72,7 @@
|
|||||||
|
|
||||||
if(client)
|
if(client)
|
||||||
handle_regular_hud_updates()
|
handle_regular_hud_updates()
|
||||||
|
standard_damage_overlay_updates()
|
||||||
|
|
||||||
// Grabbing
|
// Grabbing
|
||||||
for(var/obj/item/weapon/grab/G in src)
|
for(var/obj/item/weapon/grab/G in src)
|
||||||
|
|||||||
@@ -361,6 +361,11 @@
|
|||||||
wear_id.emp_act(severity)
|
wear_id.emp_act(severity)
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
/mob/living/carbon/monkey/adjustBruteLoss(damage)
|
||||||
|
..()
|
||||||
|
if (damage > 0)
|
||||||
|
damageoverlaytemp = 20
|
||||||
|
|
||||||
/mob/living/carbon/monkey/ex_act(severity)
|
/mob/living/carbon/monkey/ex_act(severity)
|
||||||
if(flags & INVULNERABLE)
|
if(flags & INVULNERABLE)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/mob/living/carbon/var/pain_shock_stage = 0
|
/mob/living/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/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_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
|
// proc to find out in how much pain the mob is at the moment
|
||||||
/mob/living/carbon/proc/update_pain_level()
|
/mob/living/carbon/proc/update_pain_level()
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
// Basically just deletes any screen objects :<
|
// Basically just deletes any screen objects :<
|
||||||
regular_hud_updates()
|
regular_hud_updates()
|
||||||
|
standard_damage_overlay_updates()
|
||||||
|
|
||||||
//Handle temperature/pressure differences between body and environment
|
//Handle temperature/pressure differences between body and environment
|
||||||
if(environment)
|
if(environment)
|
||||||
@@ -323,7 +324,7 @@
|
|||||||
|
|
||||||
if(say_mute)
|
if(say_mute)
|
||||||
say_mute = 0
|
say_mute = 0
|
||||||
|
|
||||||
src.setDensity(!src.lying)
|
src.setDensity(!src.lying)
|
||||||
|
|
||||||
if (src.sdisabilities & BLIND)
|
if (src.sdisabilities & BLIND)
|
||||||
@@ -568,8 +569,6 @@
|
|||||||
if(client)
|
if(client)
|
||||||
update_pull_icon()
|
update_pull_icon()
|
||||||
|
|
||||||
var/severity = 0
|
|
||||||
|
|
||||||
var/healthpercent = (health/maxHealth) * 100
|
var/healthpercent = (health/maxHealth) * 100
|
||||||
|
|
||||||
switch(healthpercent)
|
switch(healthpercent)
|
||||||
@@ -577,27 +576,16 @@
|
|||||||
healths.icon_state = "slime_health0"
|
healths.icon_state = "slime_health0"
|
||||||
if(80 to 100)
|
if(80 to 100)
|
||||||
healths.icon_state = "slime_health1"
|
healths.icon_state = "slime_health1"
|
||||||
severity = 1
|
|
||||||
if(60 to 80)
|
if(60 to 80)
|
||||||
healths.icon_state = "slime_health2"
|
healths.icon_state = "slime_health2"
|
||||||
severity = 2
|
|
||||||
if(40 to 60)
|
if(40 to 60)
|
||||||
healths.icon_state = "slime_health3"
|
healths.icon_state = "slime_health3"
|
||||||
severity = 3
|
|
||||||
if(20 to 40)
|
if(20 to 40)
|
||||||
healths.icon_state = "slime_health4"
|
healths.icon_state = "slime_health4"
|
||||||
severity = 4
|
|
||||||
if(0 to 20)
|
if(0 to 20)
|
||||||
healths.icon_state = "slime_health5"
|
healths.icon_state = "slime_health5"
|
||||||
severity = 5
|
|
||||||
if(-99 to 0)
|
if(-99 to 0)
|
||||||
healths.icon_state = "slime_health6"
|
healths.icon_state = "slime_health6"
|
||||||
severity = 6
|
|
||||||
else
|
else
|
||||||
healths.icon_state = "slime_health7"
|
healths.icon_state = "slime_health7"
|
||||||
severity = 6
|
|
||||||
|
|
||||||
if(severity > 0)
|
|
||||||
overlay_fullscreen("brute", /obj/abstract/screen/fullscreen/brute, severity)
|
|
||||||
else
|
|
||||||
clear_fullscreen("brute")
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
//See code/datums/helper_datums/butchering.dm
|
//See code/datums/helper_datums/butchering.dm
|
||||||
init_butchering_list()
|
init_butchering_list()
|
||||||
|
|
||||||
clear_fullscreens()
|
clear_fullscreens(TRUE)
|
||||||
|
|
||||||
handle_symptom_on_death()
|
handle_symptom_on_death()
|
||||||
..()
|
..()
|
||||||
|
standard_damage_overlay_updates()
|
||||||
|
|
||||||
/mob/living/gib(animation = FALSE, meat = TRUE)
|
/mob/living/gib(animation = FALSE, meat = TRUE)
|
||||||
if(!isUnconscious())
|
if(!isUnconscious())
|
||||||
|
|||||||
@@ -627,6 +627,8 @@ Thanks.
|
|||||||
regenerate_icons()
|
regenerate_icons()
|
||||||
update_canmove()
|
update_canmove()
|
||||||
|
|
||||||
|
clear_fullscreens()
|
||||||
|
|
||||||
hud_updateflag |= 1 << HEALTH_HUD
|
hud_updateflag |= 1 << HEALTH_HUD
|
||||||
hud_updateflag |= 1 << STATUS_HUD
|
hud_updateflag |= 1 << STATUS_HUD
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
/mob/living/Login()
|
/mob/living/Login()
|
||||||
..()
|
..()
|
||||||
|
standard_damage_overlay_updates()
|
||||||
|
|
||||||
//Mind updates
|
//Mind updates
|
||||||
mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist)
|
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
|
mind.active = 1 //indicates that the mind is currently synced with a client
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ var/global/borer_unlock_types_leg = typesof(/datum/unlockable/borer/leg) - /datu
|
|||||||
|
|
||||||
if(client)
|
if(client)
|
||||||
regular_hud_updates()
|
regular_hud_updates()
|
||||||
|
standard_damage_overlay_updates()
|
||||||
|
|
||||||
/mob/living/simple_animal/borer/regular_hud_updates()
|
/mob/living/simple_animal/borer/regular_hud_updates()
|
||||||
if(fire_alert)
|
if(fire_alert)
|
||||||
@@ -190,8 +191,6 @@ var/global/borer_unlock_types_leg = typesof(/datum/unlockable/borer/leg) - /datu
|
|||||||
else
|
else
|
||||||
clear_alert(SCREEN_ALARM_FIRE)
|
clear_alert(SCREEN_ALARM_FIRE)
|
||||||
|
|
||||||
var/severity = 0
|
|
||||||
|
|
||||||
var/healthpercent = (health/maxHealth)*100
|
var/healthpercent = (health/maxHealth)*100
|
||||||
|
|
||||||
switch(healthpercent)
|
switch(healthpercent)
|
||||||
@@ -199,24 +198,14 @@ var/global/borer_unlock_types_leg = typesof(/datum/unlockable/borer/leg) - /datu
|
|||||||
healths.icon_state = "borer_health0"
|
healths.icon_state = "borer_health0"
|
||||||
if(75 to 100)
|
if(75 to 100)
|
||||||
healths.icon_state = "borer_health1"
|
healths.icon_state = "borer_health1"
|
||||||
severity = 2
|
|
||||||
if(50 to 75)
|
if(50 to 75)
|
||||||
healths.icon_state = "borer_health2"
|
healths.icon_state = "borer_health2"
|
||||||
severity = 3
|
|
||||||
if(25 to 50)
|
if(25 to 50)
|
||||||
healths.icon_state = "borer_health3"
|
healths.icon_state = "borer_health3"
|
||||||
severity = 4
|
|
||||||
if(1 to 25)
|
if(1 to 25)
|
||||||
healths.icon_state = "borer_health4"
|
healths.icon_state = "borer_health4"
|
||||||
severity = 5
|
|
||||||
else
|
else
|
||||||
healths.icon_state = "borer_health5"
|
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)
|
/mob/living/simple_animal/borer/proc/update_verbs(var/mode)
|
||||||
if(verb_holders.len>0)
|
if(verb_holders.len>0)
|
||||||
|
|||||||
@@ -536,6 +536,8 @@
|
|||||||
if(.)
|
if(.)
|
||||||
regular_hud_updates()
|
regular_hud_updates()
|
||||||
|
|
||||||
|
standard_damage_overlay_updates()
|
||||||
|
|
||||||
|
|
||||||
/mob/living/simple_animal/construct/regular_hud_updates()
|
/mob/living/simple_animal/construct/regular_hud_updates()
|
||||||
if(fire_alert)
|
if(fire_alert)
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
. = ..()
|
. = ..()
|
||||||
if(.)
|
if(.)
|
||||||
regular_hud_updates()
|
regular_hud_updates()
|
||||||
|
standard_damage_overlay_updates()
|
||||||
if(!stat && !resting && !locked_to && (ckey == null)) //Behavior mechanisms (om nom :3)
|
if(!stat && !resting && !locked_to && (ckey == null)) //Behavior mechanisms (om nom :3)
|
||||||
if(corgi_status == IDLE)
|
if(corgi_status == IDLE)
|
||||||
get_target()
|
get_target()
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
if(timestopped)
|
if(timestopped)
|
||||||
return 0 //under effects of time magick
|
return 0 //under effects of time magick
|
||||||
..()
|
..()
|
||||||
|
standard_damage_overlay_updates()
|
||||||
if(!stat && prob(speak_chance))
|
if(!stat && prob(speak_chance))
|
||||||
for(var/mob/M in view())
|
for(var/mob/M in view())
|
||||||
M << 'sound/effects/mousesqueek.ogg'
|
M << 'sound/effects/mousesqueek.ogg'
|
||||||
|
|||||||
@@ -168,6 +168,7 @@
|
|||||||
a_51,a_52,a_53,a_54)
|
a_51,a_52,a_53,a_54)
|
||||||
|
|
||||||
regular_hud_updates()
|
regular_hud_updates()
|
||||||
|
standard_damage_overlay_updates()
|
||||||
|
|
||||||
/mob/living/simple_animal/hostile/giant_spider/regular_hud_updates()
|
/mob/living/simple_animal/hostile/giant_spider/regular_hud_updates()
|
||||||
if (!client)
|
if (!client)
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
return FALSE //under effects of time magick
|
return FALSE //under effects of time magick
|
||||||
..()
|
..()
|
||||||
regular_hud_updates()
|
regular_hud_updates()
|
||||||
|
standard_damage_overlay_updates()
|
||||||
if(isDead())
|
if(isDead())
|
||||||
for(var/i=0;i<3;i++)
|
for(var/i=0;i<3;i++)
|
||||||
new /obj/item/weapon/ectoplasm (src.loc)
|
new /obj/item/weapon/ectoplasm (src.loc)
|
||||||
|
|||||||
@@ -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)))
|
if(lazy_invoke_event(/lazy_event/on_damaged, list("kind" = BRUTE, "amount" = damage)))
|
||||||
return 0
|
return 0
|
||||||
|
if (damage > 0)
|
||||||
|
damageoverlaytemp = 20
|
||||||
if(skinned())
|
if(skinned())
|
||||||
damage = damage * 2
|
damage = damage * 2
|
||||||
if(purge)
|
if(purge)
|
||||||
|
|||||||
119
code/modules/mob/living/standard_damage_overlay_updates.dm
Normal file
119
code/modules/mob/living/standard_damage_overlay_updates.dm
Normal file
@@ -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")
|
||||||
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
log_access("Logout: [key_name(src)] ([formatLocation(loc)])")
|
log_access("Logout: [key_name(src)] ([formatLocation(loc)])")
|
||||||
|
|
||||||
|
clear_fullscreens(FALSE, 0)
|
||||||
|
|
||||||
remove_screen_objs() //Used to remove hud elements
|
remove_screen_objs() //Used to remove hud elements
|
||||||
|
|
||||||
if (src in science_goggles_wearers)
|
if (src in science_goggles_wearers)
|
||||||
|
|||||||
@@ -1753,6 +1753,7 @@
|
|||||||
#include "code\modules\mob\living\login.dm"
|
#include "code\modules\mob\living\login.dm"
|
||||||
#include "code\modules\mob\living\logout.dm"
|
#include "code\modules\mob\living\logout.dm"
|
||||||
#include "code\modules\mob\living\say.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.dm"
|
||||||
#include "code\modules\mob\living\carbon\carbon_defines.dm"
|
#include "code\modules\mob\living\carbon\carbon_defines.dm"
|
||||||
#include "code\modules\mob\living\carbon\combat.dm"
|
#include "code\modules\mob\living\carbon\combat.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user