mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 08:34:16 +01:00
Chemicals that reduce pain make the users personal health bar less accurate (#20970)
* Chemicals that reduce pain make the users personal health bar less accurate * Update medicine.dm * health doll accuracy / screen cover * define that shit * makes it a proc
This commit is contained in:
@@ -1122,6 +1122,14 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
|
||||
KnockDown(knockdown)
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/proc/shock_reduction()
|
||||
var/shock_reduction = 0
|
||||
if(reagents)
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
if(R.shock_reduction)
|
||||
shock_reduction += R.shock_reduction
|
||||
return shock_reduction
|
||||
|
||||
/mob/living/carbon/proc/can_eat(flags = 255)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -293,10 +293,11 @@
|
||||
/mob/living/carbon/update_damage_hud()
|
||||
if(!client)
|
||||
return
|
||||
var/shock_reduction = shock_reduction()
|
||||
if(stat == UNCONSCIOUS && health <= HEALTH_THRESHOLD_CRIT)
|
||||
if(check_death_method())
|
||||
var/severity = 0
|
||||
switch(health)
|
||||
switch(health - shock_reduction)
|
||||
if(-20 to -10)
|
||||
severity = 1
|
||||
if(-30 to -20)
|
||||
@@ -323,7 +324,7 @@
|
||||
clear_fullscreen("crit")
|
||||
if(getOxyLoss())
|
||||
var/severity = 0
|
||||
switch(getOxyLoss())
|
||||
switch(getOxyLoss() - shock_reduction)
|
||||
if(10 to 20)
|
||||
severity = 1
|
||||
if(20 to 25)
|
||||
@@ -345,7 +346,7 @@
|
||||
//Fire and Brute damage overlay (BSSR)
|
||||
var/hurtdamage = getBruteLoss() + getFireLoss() + damageoverlaytemp
|
||||
damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not.
|
||||
if(hurtdamage)
|
||||
if(hurtdamage - shock_reduction > 0)
|
||||
var/severity = 0
|
||||
switch(hurtdamage)
|
||||
if(5 to 15) severity = 1
|
||||
|
||||
@@ -658,14 +658,17 @@
|
||||
to_chat(src, "<span class='userdanger'>You feel [pick("terrible", "awful", "like shit", "sick", "numb", "cold", "sweaty", "tingly", "horrible")]!</span>")
|
||||
Weaken(6 SECONDS)
|
||||
|
||||
#define BODYPART_PAIN_REDUCTION 5
|
||||
|
||||
/mob/living/carbon/human/update_health_hud()
|
||||
if(!client)
|
||||
return
|
||||
if(dna.species.update_health_hud())
|
||||
return
|
||||
else
|
||||
var/shock_reduction = shock_reduction()
|
||||
if(healths)
|
||||
var/health_amount = get_perceived_trauma()
|
||||
var/health_amount = get_perceived_trauma(shock_reduction)
|
||||
if(..(health_amount)) //not dead
|
||||
switch(health_hud_override)
|
||||
if(HEALTH_HUD_OVERRIDE_CRIT)
|
||||
@@ -687,9 +690,10 @@
|
||||
healthdoll.icon_state = "healthdoll_DEAD"
|
||||
for(var/obj/item/organ/external/O in bodyparts)
|
||||
var/damage = O.get_damage()
|
||||
damage -= shock_reduction / BODYPART_PAIN_REDUCTION
|
||||
var/comparison = (O.max_damage/5)
|
||||
var/icon_num = 0
|
||||
if(damage)
|
||||
if(damage > 0)
|
||||
icon_num = 1
|
||||
if(damage > (comparison))
|
||||
icon_num = 2
|
||||
@@ -704,6 +708,8 @@
|
||||
healthdoll.overlays -= (cached_overlays - new_overlays)
|
||||
healthdoll.cached_healthdoll_overlays = new_overlays
|
||||
|
||||
#undef BODYPART_PAIN_REDUCTION
|
||||
|
||||
/mob/living/carbon/human/proc/handle_nutrition_alerts() //This is a terrible abuse of the alert system; something like this should be a HUD element
|
||||
if(HAS_TRAIT(src, TRAIT_NOHUNGER))
|
||||
return
|
||||
|
||||
@@ -2011,8 +2011,8 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
|
||||
O.toggle_biolum(TRUE)
|
||||
visible_message("<span class='danger'>[src] is engulfed in shadows and fades into the darkness.</span>", "<span class='danger'>A sense of dread washes over you as you suddenly dim dark.</span>")
|
||||
|
||||
/mob/living/carbon/human/proc/get_perceived_trauma()
|
||||
return min(health, maxHealth - getStaminaLoss())
|
||||
/mob/living/carbon/human/proc/get_perceived_trauma(shock_reduction)
|
||||
return min(health, maxHealth - getStaminaLoss()) + shock_reduction
|
||||
|
||||
/mob/living/carbon/human/WakeUp(updating = TRUE)
|
||||
if(dna.species.spec_WakeUp(src))
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
shock_reduction = 200
|
||||
taste_description = "numbness"
|
||||
|
||||
/datum/reagent/medicine/hydrocodone/on_mob_life(mob/living/M) //Needed so the hud updates when injested / removed from system
|
||||
var/update_flags = STATUS_UPDATE_HEALTH
|
||||
return ..() | update_flags
|
||||
|
||||
/datum/reagent/medicine/sterilizine
|
||||
name = "Sterilizine"
|
||||
id = "sterilizine"
|
||||
|
||||
Reference in New Issue
Block a user