pain hud display

This commit is contained in:
quotefox
2022-03-26 12:34:02 +00:00
parent de8caa4724
commit 2ff6b41e2d
5 changed files with 25 additions and 2 deletions
+10
View File
@@ -177,6 +177,16 @@
desc = "You're severely dehydrated."
icon_state = "dehydrated"
/obj/screen/alert/pain
name = "Pain"
desc = "You're in pain!"
icon_state = "pain"
/obj/screen/alert/painmajor
name = "Major Pain"
desc = "You're in major pain!"
icon_state = "pain_major"
/obj/screen/alert/gross
name = "Grossed out."
desc = "That was kind of gross..."
@@ -36,7 +36,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
*/
/datum/reagent/consumable/ethanol/on_mob_life(mob/living/carbon/C)
M.adjustPainLoss(-0.25*REM, 0) //alchol dulls pain
C.adjustPainLoss(-0.25*REM, 0) //alchol dulls pain
if(C.drunkenness < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER)
var/booze_power = boozepwr
if(HAS_TRAIT(C, TRAIT_ALCOHOL_TOLERANCE)) //we're an accomplished drinker
@@ -391,7 +391,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/mine_salve/on_mob_life(mob/living/carbon/C)
C.hal_screwyhud = SCREWYHUD_HEALTHY
C.adjustBruteLoss(-0.25*REM, 0)
M.adjustPainLoss(-1*REM, 0)
C.adjustPainLoss(-1*REM, 0)
C.adjustFireLoss(-0.25*REM, 0)
C.adjustStaminaLoss(-0.5*REM, 0)
..()
@@ -16,6 +16,7 @@
/mob/living/carbon/proc/handle_pain()
var/pain_amount = 0
pain_effect += 1
//build up pain in the system from all your limbs and natrually heal pain if its attached to a live body.
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
@@ -55,6 +56,16 @@
total_pain = pain_amount
//handle onscreen alert
if (pain_effect == 5) //alittle early to give you a 5 second warning
switch(total_pain)
if(-100 to 29)
clear_alert("pain")
if(30 to 79)
throw_alert("pain", /obj/screen/alert/pain)
if(80 to 200)
throw_alert("pain", /obj/screen/alert/painmajor)
if (pain_effect > 10)
pain_effect = 0 //reset the timer 10 seconds.
if(stat != DEAD)
@@ -79,6 +90,8 @@
visible_message("<span class='danger'>[src] goes into shock!</span>")
death() // kill.
//HS Pain heal
/mob/living/carbon/adjustPainLoss(amount, updating_health = TRUE, forced = FALSE)
if (!forced && amount < 0 && HAS_TRAIT(src,TRAIT_NONATURALHEAL))
Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 106 KiB