mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 00:23:29 +01:00
Limb overhaul first comit
This commit is contained in:
@@ -6,9 +6,11 @@
|
||||
return
|
||||
var/total_burn = 0
|
||||
var/total_brute = 0
|
||||
limbpain = 0
|
||||
for(var/datum/organ/external/O in organs) //hardcoded to streamline things a bit
|
||||
total_brute += O.brute_dam
|
||||
total_burn += O.burn_dam
|
||||
if(O.vital)
|
||||
total_brute += O.brute_dam
|
||||
total_burn += O.burn_dam
|
||||
health = 100 - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
|
||||
//TODO: fix husking
|
||||
if( (((100 - total_burn) < config.health_threshold_dead) && stat == DEAD) && (!species.flags & IS_SYNTHETIC))//100 only being used as the magic human max health number, feel free to change it if you add a var for it -- Urist
|
||||
@@ -49,20 +51,21 @@
|
||||
/mob/living/carbon/human/getBruteLoss()
|
||||
var/amount = 0
|
||||
for(var/datum/organ/external/O in organs)
|
||||
amount += O.brute_dam
|
||||
if(O.vital)
|
||||
amount += O.brute_dam
|
||||
return amount
|
||||
|
||||
/mob/living/carbon/human/getFireLoss()
|
||||
var/amount = 0
|
||||
for(var/datum/organ/external/O in organs)
|
||||
amount += O.burn_dam
|
||||
if(O.vital)
|
||||
amount += O.burn_dam
|
||||
return amount
|
||||
|
||||
|
||||
/mob/living/carbon/human/adjustBruteLoss(var/amount)
|
||||
if(species && species.brute_mod)
|
||||
amount = amount*species.brute_mod
|
||||
|
||||
if(amount > 0)
|
||||
take_overall_damage(amount, 0)
|
||||
else
|
||||
@@ -72,7 +75,6 @@
|
||||
/mob/living/carbon/human/adjustFireLoss(var/amount)
|
||||
if(species && species.burn_mod)
|
||||
amount = amount*species.burn_mod
|
||||
|
||||
if(amount > 0)
|
||||
take_overall_damage(0, amount)
|
||||
else
|
||||
|
||||
@@ -79,5 +79,7 @@
|
||||
|
||||
var/frozen = 0 //used for preventing attacks on admin-frozen people
|
||||
|
||||
var/limbpain = 0
|
||||
|
||||
fire_dmi = 'icons/mob/OnFire.dmi'
|
||||
fire_sprite = "Standing"
|
||||
|
||||
@@ -139,6 +139,9 @@
|
||||
if (burn || brute)
|
||||
if (status & ORGAN_ROBOT && body_part != UPPER_TORSO && body_part != LOWER_TORSO)
|
||||
droplimb(1) //Robot limbs just kinda fail at full damage.
|
||||
|
||||
//Removing shuffling limb damage over to parent if limb is out of HP
|
||||
/*
|
||||
else
|
||||
//List organs we can pass it to
|
||||
var/list/datum/organ/external/possible_points = list()
|
||||
@@ -152,18 +155,20 @@
|
||||
//And pass the pain around
|
||||
var/datum/organ/external/target = pick(possible_points)
|
||||
target.take_damage(brute, burn, sharp, edge, used_weapon, forbidden_limbs + src)
|
||||
*/
|
||||
|
||||
// sync the organ's damage with its wounds
|
||||
src.update_damages()
|
||||
|
||||
//If limb took enough damage, try to cut or tear it off
|
||||
/*
|
||||
/*
|
||||
if(body_part != UPPER_TORSO && body_part != LOWER_TORSO) //as hilarious as it is, getting hit on the chest too much shouldn't effectively gib you.
|
||||
if(config.limbs_can_break && brute_dam >= max_damage * config.organ_health_multiplier)
|
||||
if( (edge && prob(5 * brute)) || (brute > 20 && prob(2 * brute)) )
|
||||
droplimb(1)
|
||||
return
|
||||
*/
|
||||
*/
|
||||
|
||||
owner.updatehealth()
|
||||
|
||||
var/result = update_icon()
|
||||
@@ -875,8 +880,8 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
name = "chest"
|
||||
icon_name = "torso"
|
||||
display_name = "chest"
|
||||
max_damage = 75
|
||||
min_broken_damage = 40
|
||||
max_damage = 200
|
||||
min_broken_damage = 50
|
||||
body_part = UPPER_TORSO
|
||||
vital = 1
|
||||
|
||||
@@ -887,14 +892,13 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
max_damage = 50
|
||||
min_broken_damage = 30
|
||||
body_part = LOWER_TORSO
|
||||
vital = 1
|
||||
|
||||
/datum/organ/external/l_arm
|
||||
name = "l_arm"
|
||||
display_name = "left arm"
|
||||
icon_name = "l_arm"
|
||||
max_damage = 50
|
||||
min_broken_damage = 20
|
||||
min_broken_damage = 30
|
||||
body_part = ARM_LEFT
|
||||
|
||||
process()
|
||||
@@ -906,7 +910,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
display_name = "left leg"
|
||||
icon_name = "l_leg"
|
||||
max_damage = 50
|
||||
min_broken_damage = 20
|
||||
min_broken_damage = 30
|
||||
body_part = LEG_LEFT
|
||||
icon_position = LEFT
|
||||
|
||||
@@ -915,7 +919,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
display_name = "right arm"
|
||||
icon_name = "r_arm"
|
||||
max_damage = 50
|
||||
min_broken_damage = 20
|
||||
min_broken_damage = 30
|
||||
body_part = ARM_RIGHT
|
||||
|
||||
process()
|
||||
@@ -927,7 +931,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
display_name = "right leg"
|
||||
icon_name = "r_leg"
|
||||
max_damage = 50
|
||||
min_broken_damage = 20
|
||||
min_broken_damage = 30
|
||||
body_part = LEG_RIGHT
|
||||
icon_position = RIGHT
|
||||
|
||||
@@ -936,7 +940,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
display_name = "left foot"
|
||||
icon_name = "l_foot"
|
||||
max_damage = 30
|
||||
min_broken_damage = 15
|
||||
min_broken_damage = 20
|
||||
body_part = FOOT_LEFT
|
||||
icon_position = LEFT
|
||||
|
||||
@@ -945,7 +949,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
display_name = "right foot"
|
||||
icon_name = "r_foot"
|
||||
max_damage = 30
|
||||
min_broken_damage = 15
|
||||
min_broken_damage = 20
|
||||
body_part = FOOT_RIGHT
|
||||
icon_position = RIGHT
|
||||
|
||||
@@ -954,7 +958,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
display_name = "right hand"
|
||||
icon_name = "r_hand"
|
||||
max_damage = 30
|
||||
min_broken_damage = 15
|
||||
min_broken_damage = 20
|
||||
body_part = HAND_RIGHT
|
||||
|
||||
process()
|
||||
@@ -966,7 +970,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
display_name = "left hand"
|
||||
icon_name = "l_hand"
|
||||
max_damage = 30
|
||||
min_broken_damage = 15
|
||||
min_broken_damage = 20
|
||||
body_part = HAND_LEFT
|
||||
|
||||
process()
|
||||
@@ -977,8 +981,8 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
name = "head"
|
||||
icon_name = "head"
|
||||
display_name = "head"
|
||||
max_damage = 75
|
||||
min_broken_damage = 40
|
||||
max_damage = 200
|
||||
min_broken_damage = 50
|
||||
body_part = HEAD
|
||||
var/disfigured = 0
|
||||
var/brained = 0
|
||||
|
||||
@@ -88,6 +88,7 @@ mob/living/carbon/human/proc/handle_pain()
|
||||
return
|
||||
var/maxdam = 0
|
||||
var/datum/organ/external/damaged_organ = null
|
||||
limbpain = 0
|
||||
for(var/datum/organ/external/E in organs)
|
||||
// amputated limbs don't cause pain
|
||||
if(E.amputated) continue
|
||||
@@ -98,8 +99,10 @@ mob/living/carbon/human/proc/handle_pain()
|
||||
if(dam > maxdam && (maxdam == 0 || prob(70)) )
|
||||
damaged_organ = E
|
||||
maxdam = dam
|
||||
if(damaged_organ)
|
||||
pain(damaged_organ.display_name, maxdam, 0)
|
||||
if(damaged_organ)
|
||||
pain(damaged_organ.display_name, maxdam, 0)
|
||||
if(!E.vital)
|
||||
limbpain += dam
|
||||
|
||||
// Damage to internal organs hurts a lot.
|
||||
for(var/n in internal_organs_by_name)
|
||||
|
||||
Reference in New Issue
Block a user