diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm
index e9d90e234..d0453ca80 100644
--- a/code/__DEFINES/combat.dm
+++ b/code/__DEFINES/combat.dm
@@ -10,6 +10,7 @@
#define CLONE "clone"
#define STAMINA "stamina"
#define BRAIN "brain"
+#define PAIN "pain"
//bitflag damage defines used for suicide_act
#define BRUTELOSS (1<<0)
diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm
index 6faa4406e..4c5ae9ca4 100644
--- a/code/modules/mob/living/carbon/damage_procs.dm
+++ b/code/modules/mob/living/carbon/damage_procs.dm
@@ -40,7 +40,6 @@
update_damage_overlays()
else
adjustStaminaLoss(damage * hit_percent)
- //citadel code
if(AROUSAL)
adjustArousalLoss(damage * hit_percent)
return TRUE
@@ -62,7 +61,6 @@
amount += BP.burn_dam
return amount
-
/mob/living/carbon/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE)
if (!forced && amount < 0 && HAS_TRAIT(src,TRAIT_NONATURALHEAL))
return FALSE
diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm
index 60ba3cb72..dccbd77f2 100644
--- a/code/modules/mob/living/damage_procs.dm
+++ b/code/modules/mob/living/damage_procs.dm
@@ -57,7 +57,6 @@
if(STAMINA)
return getStaminaLoss()
-
/mob/living/proc/apply_damages(brute = 0, burn = 0, tox = 0, oxy = 0, clone = 0, def_zone = null, blocked = FALSE, stamina = 0, brain = 0)
if(blocked >= 100)
return 0
@@ -230,6 +229,9 @@
/mob/living/proc/setStaminaLoss(amount, updating_stamina = TRUE, forced = FALSE)
return
+/mob/living/proc/adjustPainLoss(amount, updating_health = TRUE, forced = FALSE)
+ return
+
// heal ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/heal_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update
diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
index 4fefc0fd1..e3d0be6bb 100644
--- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
@@ -36,6 +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
if(C.drunkenness < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER)
var/booze_power = boozepwr
if(HAS_TRAIT(C, TRAIT_ALCOHOL_TOLERANCE)) //we're an accomplished drinker
diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
index 6272d3773..a6d6fec74 100644
--- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
@@ -391,6 +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.adjustFireLoss(-0.25*REM, 0)
C.adjustStaminaLoss(-0.5*REM, 0)
..()
@@ -698,7 +699,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/morphine
name = "Morphine"
- description = "A painkiller that allows the patient to move at full speed even in bulky objects. Causes drowsiness and eventually unconsciousness in high doses. Overdose will cause a variety of effects, ranging from minor to lethal."
+ description = "A painkiller. Causes drowsiness and eventually unconsciousness in high doses. Overdose will cause a variety of effects, ranging from minor to lethal."
reagent_state = LIQUID
color = "#A9FBFB"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
@@ -706,23 +707,8 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
addiction_threshold = 25
pH = 8.96
-/datum/reagent/medicine/morphine/on_mob_metabolize(mob/living/L)
- ..()
- L.ignore_slowdown(type)
-
-/datum/reagent/medicine/morphine/on_mob_end_metabolize(mob/living/L)
- L.unignore_slowdown(type)
- ..()
-
/datum/reagent/medicine/morphine/on_mob_life(mob/living/carbon/M)
- switch(current_cycle)
- if(11)
- to_chat(M, "You start to feel tired..." )
- if(12 to 24)
- M.drowsyness += 1
- if(24 to INFINITY)
- M.Sleeping(40, 0)
- . = 1
+ M.adjustPainLoss(-3*REM, 0)// very good pain killer.
..()
/datum/reagent/medicine/morphine/overdose_process(mob/living/M)
@@ -1022,6 +1008,7 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M)
/datum/reagent/medicine/bicaridine/on_mob_life(mob/living/carbon/M)
M.adjustBruteLoss(-2*REM, 0)
+ M.adjustPainLoss(-1*REM, 0) //stabilize pain at threshold. and bring it down faster if above.
..()
. = 1
diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm
index 061676899..7f3b477bc 100644
--- a/code/modules/surgery/bodyparts/bodyparts.dm
+++ b/code/modules/surgery/bodyparts/bodyparts.dm
@@ -31,6 +31,7 @@
var/burnstate = 0
var/brute_dam = 0
var/burn_dam = 0
+ var/pain_dam = 0
var/stamina_dam = 0
var/max_stamina_damage = 0
var/max_damage = 0
@@ -193,6 +194,9 @@
brute_dam += brute
burn_dam += burn
+ if(status == BODYPART_ORGANIC) //pain is only applied to organic organs, because nerves.
+ pain_dam += (brute+burn)*1.2 //add the total damage applied to the limb as pain damage, build pain quicker, because sudden pain is more.. painful.
+
//We've dealt the physical damages, if there's room lets apply the stamina damage.
var/current_damage = get_damage(TRUE) //This time around, count stamina loss too.
var/available_damage = max_damage - current_damage
diff --git a/hyperstation/code/modules/mob/living/carbon/carbon.dm b/hyperstation/code/modules/mob/living/carbon/carbon.dm
new file mode 100644
index 000000000..2b6f4d682
--- /dev/null
+++ b/hyperstation/code/modules/mob/living/carbon/carbon.dm
@@ -0,0 +1,94 @@
+/mob/living/carbon
+ var/total_pain = 0
+ var/pain_effect = 0
+
+//pain
+/mob/living/carbon/adjustPainLoss(amount, updating_health = TRUE, forced = FALSE, affected_zone = BODY_ZONE_CHEST)
+ if(!forced && (status_flags & GODMODE))
+ return FALSE
+ apply_damage(amount > 0 ? amount : amount, PAIN, affected_zone)
+ return amount
+
+/mob/living/carbon/handle_status_effects()
+ ..()
+ handle_pain()
+
+/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
+ pain_amount += BP.pain_dam
+
+ var/pain_target = (BP.brute_dam + BP.burn_dam)*0.8
+ //natural healing of pain, capped at current damage * 0.8, if the pain is lower, slowly bring up the pain. this will let people "get used, to it."
+ if (BP.pain_dam > (pain_target))
+ BP.pain_dam -= 1 //bring down to the pain_level.
+ else
+ BP.pain_dam += 1 //slowly bring pain back, from pain killers.
+
+ //just make sure its zero'd
+ if (BP.pain_dam < 0)
+ BP.pain_dam = 0
+ continue //dont need to do the rest, your fine.
+
+ if (BP.pain_dam && pain_effect > 10 && (stat != DEAD))
+ var pain_level = (round(BP.pain_dam / 10))
+ if (pain_level <= 4)
+ switch(pain_level) //for every 10 points of damage minor -> major
+ if(1)//start at 10 just so it doesnt get annoying with micro damage
+ to_chat(src, "You feel minor pain in your [BP.name].")
+ if(2)
+ to_chat(src, "You feel pain in your [BP.name].")
+ if(3)
+ to_chat(src, "You feel severe pain in your [BP.name].")
+ if(4)
+ to_chat(src, "You feel overwhelming pain in your [BP.name].")
+ jitteriness += 2
+ stuttering += 2
+
+ else //god damn.. thats alot of pain owe.
+ to_chat(src, "You cant handle the pain in your [BP.name].")
+ jitteriness += 2
+ stuttering += 2
+
+ total_pain = pain_amount
+
+ if (pain_effect > 10)
+ pain_effect = 0 //reset the timer 10 seconds.
+ if(stat != DEAD)
+ //status effects for pain..
+ if (total_pain > 50 && total_pain < 80)
+ to_chat(src, "You cant handle the pain...")
+ if(prob(20))
+ emote("scream")
+ jitteriness += 3 //shake
+ stuttering += 35 //stutter words, your in pain bro.
+
+ if (total_pain > 80) //your in trouble. fainting..
+ to_chat(src, "You cant handle the intense pain...")
+ if(prob(20)) //chance of fainting..
+ visible_message("[src] collapses!")
+ Unconscious(100)
+ jitteriness += 3 //shake
+ stuttering += 3 //stutter words
+
+ if (total_pain > 110 && stat != DEAD) //taking 77 all damage at once from full health, will put you into shock and kill you. This cant be achived with chip damage (or fist fights), because youll die before you reach this pain level.
+ to_chat(src, "You give into the pain...")
+ visible_message("[src] goes into shock!")
+ death() // kill.
+
+//HS Pain heal
+/mob/living/carbon/adjustPainLoss(amount, updating_health = TRUE, forced = FALSE)
+ if (!forced && amount < 0 && HAS_TRAIT(src,TRAIT_NONATURALHEAL))
+ return FALSE
+ if(!forced && (status_flags & GODMODE))
+ return FALSE
+
+ //all attached limbs get pain damage
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ BP.pain_dam += amount
+
+ return amount
\ No newline at end of file
diff --git a/tgstation.dme b/tgstation.dme
index 2d44c3dab..54b85eb8f 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -3164,6 +3164,7 @@
#include "hyperstation\code\modules\mob\mob_helpers.dm"
#include "hyperstation\code\modules\mob\dead\new_player\sprite_accessories.dm"
#include "hyperstation\code\modules\mob\living\status_indicators.dm"
+#include "hyperstation\code\modules\mob\living\carbon\carbon.dm"
#include "hyperstation\code\modules\mob\living\silicon\robot\robot.dm"
#include "hyperstation\code\modules\mob\living\silicon\robot\robot_modules.dm"
#include "hyperstation\code\modules\patreon\patreon.dm"