mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-02-04 13:20:15 +00:00
Merge branch 'master' of https://github.com/PolarisSS13/Polaris into polaris-sync
# Conflicts: # code/modules/client/preference_setup/general/03_body.dm # code/modules/mob/new_player/sprite_accessories.dm # html/changelogs/.all_changelog.yml # icons/mob/human_races/markings.dmi # vorestation.dme
This commit is contained in:
@@ -6,6 +6,7 @@ var/const/BLOOD_VOLUME_SAFE = 85
|
||||
var/const/BLOOD_VOLUME_OKAY = 75
|
||||
var/const/BLOOD_VOLUME_BAD = 60
|
||||
var/const/BLOOD_VOLUME_SURVIVE = 40
|
||||
var/const/CE_STABLE_THRESHOLD = 0.5
|
||||
|
||||
/mob/living/carbon/human/var/datum/reagents/vessel // Container for blood and BLOOD ONLY. Do not transfer other chems here.
|
||||
/mob/living/carbon/human/var/var/pale = 0 // Should affect how mob sprite is drawn, but currently doesn't.
|
||||
@@ -68,14 +69,24 @@ var/const/BLOOD_VOLUME_SURVIVE = 40
|
||||
|
||||
if(!heart)
|
||||
blood_volume = 0
|
||||
else if(heart.damage > 1 && heart.damage < heart.min_bruised_damage)
|
||||
blood_volume *= 0.8
|
||||
else if(heart.damage >= heart.min_bruised_damage && heart.damage < heart.min_broken_damage)
|
||||
blood_volume *= 0.6
|
||||
else if(heart.damage >= heart.min_broken_damage && heart.damage < INFINITY)
|
||||
else if(heart.is_broken())
|
||||
blood_volume *= 0.3
|
||||
else if(heart.is_bruised())
|
||||
blood_volume *= 0.7
|
||||
else if(heart.damage)
|
||||
blood_volume *= 0.8
|
||||
|
||||
//Effects of bloodloss
|
||||
var/dmg_coef = 1 //Lower means less damage taken
|
||||
var/threshold_coef = 1 //Lower means the damage caps off lower
|
||||
|
||||
if(CE_STABLE in chem_effects)
|
||||
dmg_coef = 0.5
|
||||
threshold_coef = 0.75
|
||||
// These are Bay bits, do some sort of calculation.
|
||||
// dmg_coef = min(1, 10/chem_effects[CE_STABLE]) //TODO: add effect for increased damage
|
||||
// threshold_coef = min(dmg_coef / CE_STABLE_THRESHOLD, 1)
|
||||
|
||||
if(blood_volume >= BLOOD_VOLUME_SAFE)
|
||||
if(pale)
|
||||
pale = 0
|
||||
@@ -89,23 +100,23 @@ var/const/BLOOD_VOLUME_SURVIVE = 40
|
||||
if(prob(1))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel [word]"
|
||||
if(oxyloss < 20)
|
||||
oxyloss += 3
|
||||
if(getOxyLoss() < 20 * threshold_coef)
|
||||
adjustOxyLoss(3 * dmg_coef)
|
||||
else if(blood_volume >= BLOOD_VOLUME_BAD)
|
||||
if(!pale)
|
||||
pale = 1
|
||||
update_body()
|
||||
eye_blurry = max(eye_blurry,6)
|
||||
if(oxyloss < 50)
|
||||
oxyloss += 10
|
||||
oxyloss += 1
|
||||
if(getOxyLoss() < 50 * threshold_coef)
|
||||
adjustOxyLoss(10 * dmg_coef)
|
||||
adjustOxyLoss(1 * dmg_coef)
|
||||
if(prob(15))
|
||||
Paralyse(rand(1,3))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel extremely [word]"
|
||||
else if(blood_volume >= BLOOD_VOLUME_SURVIVE)
|
||||
oxyloss += 5
|
||||
toxloss += 3
|
||||
adjustOxyLoss(5 * dmg_coef)
|
||||
adjustToxLoss(3 * dmg_coef)
|
||||
if(prob(15))
|
||||
var/word = pick("dizzy","woosey","faint")
|
||||
src << "\red You feel extremely [word]"
|
||||
@@ -115,8 +126,8 @@ var/const/BLOOD_VOLUME_SURVIVE = 40
|
||||
update_body()
|
||||
eye_blurry = max(eye_blurry,6)
|
||||
Paralyse(3)
|
||||
toxloss += 3
|
||||
oxyloss += 75 // 15 more than dexp fixes (also more than dex+dexp+tricord)
|
||||
adjustToxLoss(3 * dmg_coef)
|
||||
adjustOxyLoss(75 * dmg_coef) // 15 more than dexp fixes (also more than dex+dexp+tricord)
|
||||
|
||||
// Without enough blood you slowly go hungry.
|
||||
if(blood_volume < BLOOD_VOLUME_SAFE)
|
||||
@@ -144,6 +155,8 @@ var/const/BLOOD_VOLUME_SURVIVE = 40
|
||||
blood_loss_divisor += 5
|
||||
else if((temp.organ_tag == BP_L_HAND) || (temp.organ_tag == BP_R_HAND) || (temp.organ_tag == BP_L_FOOT) || (temp.organ_tag == BP_R_FOOT))
|
||||
blood_loss_divisor += 10
|
||||
if(CE_STABLE in chem_effects) //Inaprov slows bloodloss
|
||||
blood_loss_divisor += 10
|
||||
if(temp.applied_pressure)
|
||||
if(ishuman(temp.applied_pressure))
|
||||
var/mob/living/carbon/human/H = temp.applied_pressure
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
/obj/item/organ/internal/lungs/proc/rupture()
|
||||
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
|
||||
if(istype(parent))
|
||||
owner.custom_pain("You feel a stabbing pain in your [parent.name]!", 1)
|
||||
owner.custom_pain("You feel a stabbing pain in your [parent.name]!", 50)
|
||||
bruise()
|
||||
|
||||
/obj/item/organ/internal/lungs/handle_germ_effects()
|
||||
|
||||
@@ -256,7 +256,7 @@ var/list/organ_cache = list()
|
||||
if(owner && parent_organ && amount > 0)
|
||||
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
|
||||
if(parent && !silent)
|
||||
owner.custom_pain("Something inside your [parent.name] hurts a lot.", 1)
|
||||
owner.custom_pain("Something inside your [parent.name] hurts a lot.", amount)
|
||||
|
||||
/obj/item/organ/proc/bruise()
|
||||
damage = max(damage, min_bruised_damage)
|
||||
@@ -372,5 +372,11 @@ var/list/organ_cache = list()
|
||||
bitten(user)
|
||||
return
|
||||
|
||||
/obj/item/organ/proc/can_feel_pain()
|
||||
return !(robotic >= (ORGAN_ROBOT|ORGAN_DESTROYED)) && !(species.flags & NO_PAIN)
|
||||
/obj/item/organ/proc/organ_can_feel_pain()
|
||||
if(species.flags & NO_PAIN)
|
||||
return 0
|
||||
if(status & ORGAN_DESTROYED)
|
||||
return 0
|
||||
if(robotic && robotic < ORGAN_LIFELIKE) //Super fancy humanlike robotics probably have sensors, or something?
|
||||
return 0
|
||||
return 1
|
||||
@@ -268,7 +268,7 @@
|
||||
|
||||
if(status & ORGAN_BROKEN && brute)
|
||||
jostle_bone(brute)
|
||||
if(can_feel_pain() && prob(40))
|
||||
if(organ_can_feel_pain() && prob(40))
|
||||
owner.emote("scream") //getting hit on broken hand hurts
|
||||
if(used_weapon)
|
||||
add_autopsy_data("[used_weapon]", brute + burn)
|
||||
@@ -488,7 +488,7 @@ This function completely restores a damaged organ to perfect condition.
|
||||
if((damage > 15) && (type != BURN) && (local_damage > 30) && prob(damage) && (robotic < ORGAN_ROBOT))
|
||||
var/datum/wound/internal_bleeding/I = new (min(damage - 15, 15))
|
||||
wounds += I
|
||||
owner.custom_pain("You feel something rip in your [name]!", 1)
|
||||
owner.custom_pain("You feel something rip in your [name]!", 50)
|
||||
|
||||
//Burn damage can cause fluid loss due to blistering and cook-off
|
||||
if((damage > 5 || damage + burn_dam >= 15) && type == BURN && (robotic < ORGAN_ROBOT) && !istype(owner.loc,/mob/living) && !istype(owner.loc,/obj/item/device/dogborg/sleeper)) // VOREStation Edit
|
||||
@@ -699,14 +699,13 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(W.internal && owner.bodytemperature >= 170)
|
||||
var/bicardose = owner.reagents.get_reagent_amount("bicaridine")
|
||||
var/inaprovaline = owner.reagents.get_reagent_amount("inaprovaline")
|
||||
if(!(W.can_autoheal() || (bicardose && inaprovaline))) //bicaridine and inaprovaline stop internal wounds from growing bigger with time, unless it is so small that it is already healing
|
||||
var/myeldose = owner.reagents.get_reagent_amount("myelamine")
|
||||
if(!(W.can_autoheal() || (bicardose && inaprovaline) || myeldose)) //bicaridine and inaprovaline stop internal wounds from growing bigger with time, unless it is so small that it is already healing
|
||||
W.open_wound(0.1 * wound_update_accuracy)
|
||||
if(bicardose >= 30) //overdose of bicaridine begins healing IB
|
||||
W.damage = max(0, W.damage - 0.2)
|
||||
|
||||
owner.vessel.remove_reagent("blood", wound_update_accuracy * W.damage/40) //line should possibly be moved to handle_blood, so all the bleeding stuff is in one place.
|
||||
if(prob(1 * wound_update_accuracy))
|
||||
owner.custom_pain("You feel a stabbing pain in your [name]!",1)
|
||||
owner.custom_pain("You feel a stabbing pain in your [name]!", 50)
|
||||
|
||||
// slow healing
|
||||
var/heal_amt = 0
|
||||
@@ -1011,7 +1010,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
"<span class='danger'>Something feels like it shattered in your [name]!</span>",\
|
||||
"<span class='danger'>You hear a sickening crack.</span>")
|
||||
jostle_bone()
|
||||
if(can_feel_pain())
|
||||
if(organ_can_feel_pain())
|
||||
owner.emote("scream")
|
||||
|
||||
playsound(src.loc, "fracture", 10, 1, -2)
|
||||
|
||||
@@ -248,20 +248,23 @@
|
||||
|
||||
if(inflamed == 1)
|
||||
if(prob(5))
|
||||
owner << "<span class='warning'>You feel a stinging pain in your abdomen!</span>"
|
||||
owner.emote("me", 1, "winces slightly.")
|
||||
if(owner.can_feel_pain())
|
||||
owner.custom_pain("You feel a stinging pain in your abdomen!", 25)
|
||||
if(inflamed > 1)
|
||||
if(prob(3))
|
||||
owner << "<span class='warning'>You feel a stabbing pain in your abdomen!</span>"
|
||||
owner.emote("me", 1, "winces painfully.")
|
||||
if(owner.can_feel_pain())
|
||||
owner.custom_pain("You feel a stabbing pain in your abdomen!", 50)
|
||||
owner.adjustToxLoss(1)
|
||||
if(inflamed > 2)
|
||||
if(prob(1))
|
||||
owner.vomit()
|
||||
if(owner.can_feel_pain())
|
||||
owner.custom_pain("You feel a horrible pain in your abdomen!", 70)
|
||||
if(inflamed > 3)
|
||||
if(prob(1))
|
||||
owner << "<span class='danger'>Your abdomen is a world of pain!</span>"
|
||||
owner.Weaken(10)
|
||||
if(owner.can_feel_pain())
|
||||
owner.custom_pain("You feel a stinging pain in your abdomen!", 100)
|
||||
owner.Weaken(10)
|
||||
|
||||
var/obj/item/organ/external/groin = owner.get_organ(BP_GROIN)
|
||||
var/datum/wound/W = new /datum/wound/internal_bleeding(20)
|
||||
|
||||
@@ -5,118 +5,73 @@ mob/var/list/pain_stored = list()
|
||||
mob/var/last_pain_message = ""
|
||||
mob/var/next_pain_time = 0
|
||||
|
||||
// partname is the name of a body part
|
||||
// amount is a num from 1 to 100
|
||||
mob/living/carbon/proc/pain(var/partname, var/amount, var/force, var/burning = 0)
|
||||
if(stat >= 1)
|
||||
return
|
||||
if(!can_feel_pain())
|
||||
return
|
||||
if(analgesic > 40)
|
||||
return
|
||||
if(world.time < next_pain_time && !force)
|
||||
return
|
||||
if(amount > 10 && istype(src,/mob/living/carbon/human))
|
||||
if(src:paralysis)
|
||||
src:paralysis = max(0, src:paralysis-round(amount/10))
|
||||
if(amount > 50 && prob(amount / 5))
|
||||
src:drop_item()
|
||||
var/msg
|
||||
if(burning)
|
||||
switch(amount)
|
||||
if(1 to 10)
|
||||
msg = "<span class='danger'>Your [partname] burns.</span>"
|
||||
if(11 to 90)
|
||||
flash_weak_pain()
|
||||
msg = "<span class='danger'><font size=2>Your [partname] burns badly!</font></span>"
|
||||
if(91 to 10000)
|
||||
flash_pain()
|
||||
msg = "<span class='danger'><font size=3>OH GOD! Your [partname] is on fire!</font></span>"
|
||||
else
|
||||
switch(amount)
|
||||
if(1 to 10)
|
||||
msg = "<b>Your [partname] hurts.</b>"
|
||||
if(11 to 90)
|
||||
flash_weak_pain()
|
||||
msg = "<b><font size=2>Your [partname] hurts badly.</font></b>"
|
||||
if(91 to 10000)
|
||||
flash_pain()
|
||||
msg = "<b><font size=3>OH GOD! Your [partname] is hurting terribly!</font></b>"
|
||||
if(msg && (msg != last_pain_message || prob(10)))
|
||||
last_pain_message = msg
|
||||
src << msg
|
||||
next_pain_time = world.time + (100 - amount)
|
||||
|
||||
|
||||
// message is the custom message to be displayed
|
||||
// flash_strength is 0 for weak pain flash, 1 for strong pain flash
|
||||
mob/living/carbon/human/proc/custom_pain(var/message, var/flash_strength)
|
||||
if(stat >= 1)
|
||||
return
|
||||
if(!can_feel_pain())
|
||||
return
|
||||
if(reagents.has_reagent("tramadol"))
|
||||
return
|
||||
if(reagents.has_reagent("oxycodone"))
|
||||
return
|
||||
if(analgesic)
|
||||
return
|
||||
var/msg = "<span class='danger'>[message]</span>"
|
||||
if(flash_strength >= 1)
|
||||
msg = "<span class='danger'><font size=3>[message]</font></span>"
|
||||
// power decides how much painkillers will stop the message
|
||||
// force means it ignores anti-spam timer
|
||||
mob/living/carbon/proc/custom_pain(message, power, force)
|
||||
if(!message || stat || !can_feel_pain() || chem_effects[CE_PAINKILLER] > power)
|
||||
return 0
|
||||
message = "<span class='danger'>[message]</span>"
|
||||
if(power >= 50)
|
||||
message = "<font size=3>[message]</font>"
|
||||
|
||||
// Anti message spam checks
|
||||
if(msg && ((msg != last_pain_message) || (world.time >= next_pain_time)))
|
||||
last_pain_message = msg
|
||||
src << msg
|
||||
next_pain_time = world.time + 100
|
||||
if(force || (message != last_pain_message) || (world.time >= next_pain_time))
|
||||
last_pain_message = message
|
||||
src << message
|
||||
next_pain_time = world.time + (100-power)
|
||||
|
||||
mob/living/carbon/human/proc/handle_pain()
|
||||
// not when sleeping
|
||||
if(stat)
|
||||
return
|
||||
|
||||
if(!can_feel_pain()) return
|
||||
if(!can_feel_pain())
|
||||
return
|
||||
|
||||
if(stat >= 2) return
|
||||
if(analgesic > 70)
|
||||
if(world.time < next_pain_time)
|
||||
return
|
||||
var/maxdam = 0
|
||||
var/obj/item/organ/external/damaged_organ = null
|
||||
for(var/obj/item/organ/external/E in organs)
|
||||
if((E.status & ORGAN_DEAD) || E.robotic >= ORGAN_ROBOT) continue
|
||||
if(!E.organ_can_feel_pain()) continue
|
||||
var/dam = E.get_damage()
|
||||
// make the choice of the organ depend on damage,
|
||||
// but also sometimes use one of the less damaged ones
|
||||
if(dam > maxdam && (maxdam == 0 || prob(70)) )
|
||||
damaged_organ = E
|
||||
maxdam = dam
|
||||
if(damaged_organ)
|
||||
pain(damaged_organ.name, maxdam, 0)
|
||||
if(damaged_organ && chem_effects[CE_PAINKILLER] < maxdam)
|
||||
if(maxdam > 10 && paralysis)
|
||||
paralysis = max(0, paralysis - round(maxdam/10))
|
||||
if(maxdam > 50 && prob(maxdam / 5))
|
||||
drop_item()
|
||||
var/burning = damaged_organ.burn_dam > damaged_organ.brute_dam
|
||||
var/msg
|
||||
switch(maxdam)
|
||||
if(1 to 10)
|
||||
msg = "Your [damaged_organ.name] [burning ? "burns" : "hurts"]."
|
||||
if(11 to 90)
|
||||
flash_weak_pain()
|
||||
msg = "<font size=2>Your [damaged_organ.name] [burning ? "burns" : "hurts"] badly!</font>"
|
||||
if(91 to 10000)
|
||||
flash_pain()
|
||||
msg = "<font size=3>OH GOD! Your [damaged_organ.name] is [burning ? "on fire" : "hurting terribly"]!</font>"
|
||||
custom_pain(msg, maxdam, prob(10))
|
||||
|
||||
// Damage to internal organs hurts a lot.
|
||||
for(var/obj/item/organ/I in internal_organs)
|
||||
if((I.status & ORGAN_DEAD) || I.robotic >= ORGAN_ROBOT) continue
|
||||
if(I.damage > 2) if(prob(2))
|
||||
var/obj/item/organ/external/parent = get_organ(I.parent_organ)
|
||||
src.custom_pain("You feel a sharp pain in your [parent.name]", 1)
|
||||
src.custom_pain("You feel a sharp pain in your [parent.name]", 50)
|
||||
|
||||
var/toxDamageMessage = null
|
||||
var/toxMessageProb = 1
|
||||
switch(getToxLoss())
|
||||
if(1 to 5)
|
||||
toxMessageProb = 1
|
||||
toxDamageMessage = "Your body stings slightly."
|
||||
if(6 to 10)
|
||||
toxMessageProb = 2
|
||||
toxDamageMessage = "Your whole body hurts a little."
|
||||
if(11 to 15)
|
||||
toxMessageProb = 2
|
||||
toxDamageMessage = "Your whole body hurts."
|
||||
if(15 to 25)
|
||||
toxMessageProb = 3
|
||||
toxDamageMessage = "Your whole body hurts badly."
|
||||
if(26 to INFINITY)
|
||||
toxMessageProb = 5
|
||||
toxDamageMessage = "Your body aches all over, it's driving you mad."
|
||||
|
||||
if(toxDamageMessage && prob(toxMessageProb))
|
||||
src.custom_pain(toxDamageMessage, getToxLoss() >= 15)
|
||||
if(prob(2))
|
||||
switch(getToxLoss())
|
||||
if(1 to 10)
|
||||
custom_pain("Your body stings slightly.", getToxLoss())
|
||||
if(11 to 30)
|
||||
custom_pain("Your body hurts a little.", getToxLoss())
|
||||
if(31 to 60)
|
||||
custom_pain("Your whole body hurts badly.", getToxLoss())
|
||||
if(61 to INFINITY)
|
||||
custom_pain("Your body aches all over, it's driving you mad.", getToxLoss())
|
||||
@@ -52,7 +52,7 @@
|
||||
name = "left upper tendril"
|
||||
organ_tag = "l_arm"
|
||||
icon_name = "l_arm"
|
||||
max_damage = 50
|
||||
max_damage = 30
|
||||
min_broken_damage = 20
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
body_part = ARM_LEFT
|
||||
@@ -69,7 +69,7 @@
|
||||
name = "left lower tendril"
|
||||
organ_tag = "l_leg"
|
||||
icon_name = "l_leg"
|
||||
max_damage = 50
|
||||
max_damage = 30
|
||||
min_broken_damage = 20
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
body_part = LEG_LEFT
|
||||
@@ -88,7 +88,7 @@
|
||||
name = "left foot"
|
||||
organ_tag = "l_foot"
|
||||
icon_name = "l_foot"
|
||||
max_damage = 35
|
||||
max_damage = 25
|
||||
min_broken_damage = 10
|
||||
w_class = ITEMSIZE_SMALL
|
||||
body_part = FOOT_LEFT
|
||||
@@ -110,7 +110,7 @@
|
||||
name = "left grasper"
|
||||
organ_tag = "l_hand"
|
||||
icon_name = "l_hand"
|
||||
max_damage = 40
|
||||
max_damage = 25
|
||||
min_broken_damage = 15
|
||||
w_class = ITEMSIZE_SMALL
|
||||
body_part = HAND_LEFT
|
||||
|
||||
Reference in New Issue
Block a user