diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 8d6d25c930a..e512fefc53a 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -92,8 +92,8 @@ var/organ_health_multiplier = 1 var/organ_regeneration_multiplier = 1 - var/bones_can_break = 0 - var/limbs_can_break = 0 + var/bones_can_break = 1 + var/limbs_can_break = 1 var/revival_pod_plants = 1 var/revival_cloning = 1 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index a8e33fff58c..59467fd27ab 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -232,8 +232,8 @@ while(limbs_affected != 0) processing_dismember = pick(organs) - if(processing_dismember.name != "chest" && processing_dismember.name != "groin" && processing_dismember.name != "head") - processing_dismember.droplimb(1,1,1) + if(processing_dismember.name != "chest" && processing_dismember.name != "head") + processing_dismember.droplimb(1,0,1,pick(0,1,2)) limbs_affected -= 1 @@ -256,8 +256,8 @@ while(limbs_affected != 0) processing_dismember = pick(organs) - if(processing_dismember.name != "chest" && processing_dismember.name != "groin" && processing_dismember.name != "head") - processing_dismember.droplimb(1,1,1) + if(processing_dismember.name != "chest" && processing_dismember.name != "head") + processing_dismember.droplimb(1,0,1,pick(0,2)) limbs_affected -= 1 else @@ -266,8 +266,8 @@ while(limbs_affected != 0) processing_dismember = pick(organs) - if(processing_dismember.name != "chest" && processing_dismember.name != "groin" && processing_dismember.name != "head") - processing_dismember.droplimb(1,1,1) + if(processing_dismember.name != "chest" && processing_dismember.name != "head") + processing_dismember.droplimb(1,0,1,pick(0,2)) limbs_affected -= 1 if (!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs)) @@ -288,8 +288,8 @@ while(limbs_affected != 0) processing_dismember = pick(organs) - if(processing_dismember.name != "chest" && processing_dismember.name != "groin" && processing_dismember.name != "head") - processing_dismember.droplimb(1,1,1) + if(processing_dismember.name != "chest" && processing_dismember.name != "head") + processing_dismember.droplimb(1,0,1) limbs_affected -= 1 if (!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs)) diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index a296aabd7ea..a1ea2c4ea49 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -7,8 +7,8 @@ var/total_burn = 0 var/total_brute = 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 + 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 @@ -62,7 +62,6 @@ /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 +71,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 diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index bc74c3b34ec..9e7d3e37d8c 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -319,11 +319,6 @@ emp_act if(Iforce > 10 || Iforce >= 5 && prob(33)) forcesay(hit_appends) //forcesay checks stat already - if (I.damtype == BRUTE) - if((affecting.brute_dam + I.force) >= affecting.max_damage * config.organ_health_multiplier) - if(I.edge && prob(I.force)) - affecting.dismember_limb() - /* //Melee weapon embedded object code. Commented out, as most people on the forums seem to find this annoying and think it does not contribute to general gameplay. - Dave if (I.damtype == BRUTE && !I.is_robot_module()) var/damage = I.force diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index e83b7e4bff3..2b5bfe3bd35 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -157,13 +157,27 @@ 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 - */ +*/ + + //If limb took enough damage, try to cut or tear it off + if(config.limbs_can_break && (brute_dam + burn_dam) >= (max_damage * config.organ_health_multiplier)) + if((sharp || edge) && prob(brute)) + droplimb(1) + return + if(brute >= 20 && prob(brute)) // Wooden baseball bat in both hands == 23 + droplimb(1,0,0,2) + return + if(burn >= 20) // Most laser rifle shots. + if(body_part == HEAD) return //No ashing someone's head off since you don't get a brain back. + droplimb(1,0,0,1) + return + owner.updatehealth() var/result = update_icon() @@ -290,12 +304,6 @@ This function completely restores a damaged organ to perfect condition. return 1 return 0 -/datum/organ/external/proc/dismember_limb() - 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) - droplimb(1) - return - /datum/organ/external/process() //Dismemberment if(status & ORGAN_DESTROYED) @@ -566,15 +574,13 @@ Note that amputating the affected organ does in fact remove the infection from t O.setAmputatedTree() //Handles dismemberment -/datum/organ/external/proc/droplimb(var/override = 0,var/no_explode = 0,var/amputation=0, var/spawn_limb=0) +/datum/organ/external/proc/droplimb(var/override = 0,var/no_explode = 0,var/amputation=0, var/disintegrate) if(destspawn) return if(override) status |= ORGAN_DESTROYED if(status & ORGAN_DESTROYED) if(body_part == UPPER_TORSO) return - if(body_part == LOWER_TORSO) - return src.status &= ~ORGAN_BROKEN src.status &= ~ORGAN_BLEEDING src.status &= ~ORGAN_SPLINTED @@ -604,22 +610,23 @@ Note that amputating the affected organ does in fact remove the infection from t switch(body_part) if(HEAD) - if(owner.species.flags & IS_SYNTHETIC) - if(owner.mind) - organ= new /obj/item/weapon/organ/head/posi(owner.loc, owner) + if(!disintegrate) + if(owner.species.flags & IS_SYNTHETIC) + if(owner.mind) + organ= new /obj/item/weapon/organ/head/posi(owner.loc, owner) + owner.death() + else if(SKELETON in owner.mutations) + organ= new /obj/item/weapon/skeleton/head(owner.loc) + else + organ= new /obj/item/weapon/organ/head(owner.loc, owner) owner.death() - else if(SKELETON in owner.mutations) - organ= new /obj/item/weapon/skeleton/head(owner.loc) - else - organ= new /obj/item/weapon/organ/head(owner.loc, owner) - owner.death() - owner.unEquip(owner.glasses) - owner.unEquip(owner.head) - owner.unEquip(owner.l_ear) - owner.unEquip(owner.r_ear) - owner.unEquip(owner.wear_mask) + owner.unEquip(owner.glasses) + owner.unEquip(owner.head) + owner.unEquip(owner.l_ear) + owner.unEquip(owner.r_ear) + owner.unEquip(owner.wear_mask) if(ARM_RIGHT) - if(!spawn_limb) + if(!disintegrate) if(status & ORGAN_ROBOT) organ = new /obj/item/robot_parts/r_arm(owner.loc) else if(SKELETON in owner.mutations) @@ -627,7 +634,7 @@ Note that amputating the affected organ does in fact remove the infection from t else organ= new /obj/item/weapon/organ/r_arm(owner.loc, owner) if(ARM_LEFT) - if(!spawn_limb) + if(!disintegrate) if(status & ORGAN_ROBOT) organ= new /obj/item/robot_parts/l_arm(owner.loc) else if(SKELETON in owner.mutations) @@ -635,7 +642,7 @@ Note that amputating the affected organ does in fact remove the infection from t else organ= new /obj/item/weapon/organ/l_arm(owner.loc, owner) if(LEG_RIGHT) - if(!spawn_limb) + if(!disintegrate) if(status & ORGAN_ROBOT) organ = new /obj/item/robot_parts/r_leg(owner.loc) else if(SKELETON in owner.mutations) @@ -643,7 +650,7 @@ Note that amputating the affected organ does in fact remove the infection from t else organ= new /obj/item/weapon/organ/r_leg(owner.loc, owner) if(LEG_LEFT) - if(!spawn_limb) + if(!disintegrate) if(status & ORGAN_ROBOT) organ = new /obj/item/robot_parts/l_leg(owner.loc) else if(SKELETON in owner.mutations) @@ -651,7 +658,7 @@ Note that amputating the affected organ does in fact remove the infection from t else organ= new /obj/item/weapon/organ/l_leg(owner.loc, owner) if(HAND_RIGHT) - if(!spawn_limb) + if(!disintegrate) if(!(status & ORGAN_ROBOT)) if(SKELETON in owner.mutations) organ = new /obj/item/weapon/skeleton/r_hand(owner.loc) @@ -659,7 +666,7 @@ Note that amputating the affected organ does in fact remove the infection from t organ= new /obj/item/weapon/organ/r_hand(owner.loc, owner) owner.unEquip(owner.gloves) if(HAND_LEFT) - if(!spawn_limb) + if(!disintegrate) if(!(status & ORGAN_ROBOT)) if(SKELETON in owner.mutations) organ = new /obj/item/weapon/skeleton/l_hand(owner.loc) @@ -667,7 +674,7 @@ Note that amputating the affected organ does in fact remove the infection from t organ= new /obj/item/weapon/organ/l_hand(owner.loc, owner) owner.unEquip(owner.gloves) if(FOOT_RIGHT) - if(!spawn_limb) + if(!disintegrate) if(!(status & ORGAN_ROBOT)) if(SKELETON in owner.mutations) organ = new /obj/item/weapon/skeleton/r_foot(owner.loc) @@ -675,7 +682,7 @@ Note that amputating the affected organ does in fact remove the infection from t organ= new /obj/item/weapon/organ/r_foot/(owner.loc, owner) owner.unEquip(owner.shoes) if(FOOT_LEFT) - if(!spawn_limb) + if(!disintegrate) if(!(status & ORGAN_ROBOT)) if(SKELETON in owner.mutations) organ = new /obj/item/weapon/skeleton/l_foot(owner.loc) @@ -697,20 +704,58 @@ Note that amputating the affected organ does in fact remove the infection from t spawn(10) del(spark_system) - if(organ) - owner.visible_message("\red [owner.name]'s [display_name] flies off in an arc.",\ - "Your [display_name] goes flying off!",\ - "You hear a terrible sound of ripping tendons and flesh.") + switch(disintegrate) + if(1) + owner.visible_message( + "\The [owner]'s [display_name] flashes away into ashes!",\ + "Your [display_name] flashes away into ashes!",\ + "You hear the crackling sound of burning flesh.") + new /obj/effect/decal/cleanable/ash(get_turf(owner)) + if(2) + owner.visible_message( + "\The [owner]'s [display_name] explodes in a shower of gore!",\ + "Your [display_name] explodes in a shower of gore!",\ + "You hear the sickening splatter of gore.") + var/obj/effect/decal/cleanable/blood/gibs/gore = new(get_turf(owner)) + if(owner.species.flesh_color) + gore.fleshcolor = owner.species.flesh_color + if(owner.species.blood_color) + gore.basecolor = owner.species.blood_color + gore.update_icon() + gore.throw_at(get_edge_target_turf(owner,pick(alldirs)),rand(1,3),30) + if(body_part == HEAD && owner.brain_op_stage != 4.0) + var/mob/living/simple_animal/borer/borer = owner.has_brain_worms() + if(borer) + borer.detatch() //Should remove borer if the brain is removed - RR + if(owner.species && owner.species.flags & IS_SYNTHETIC) + var/obj/item/device/mmi/posibrain/P = new(owner.loc) + P.transfer_identity(owner) + if(istype(P.loc,/turf)) + P.throw_at(get_edge_target_turf(owner,pick(alldirs)),rand(1,3),30) + else + var/obj/item/brain/B = new(owner.loc) + B.transfer_identity(owner) + if(istype(B.loc,/turf)) + B.throw_at(get_edge_target_turf(owner,pick(alldirs)),rand(1,3),30) + + + + if(organ) + if(!amputation) + owner.visible_message( + "\The [owner]'s [display_name] flies off in an arc!",\ + "Your [display_name] goes flying off!",\ + "You hear a terrible sound of ripping tendons and flesh.") //Throw organs around var/lol = pick(cardinal) step(organ,lol) // OK so maybe your limb just flew off, but if it was attached to a pair of cuffs then hooray! Freedom! release_restraints() - owner.regenerate_icons() - if(vital) - owner.death() + if(vital) + owner.death() + owner.regenerate_icons() return organ /**************************************************** @@ -875,7 +920,7 @@ Note that amputating the affected organ does in fact remove the infection from t icon_name = "torso" display_name = "chest" max_damage = 75 - min_broken_damage = 40 + min_broken_damage = 50 body_part = UPPER_TORSO vital = 1 @@ -884,16 +929,15 @@ Note that amputating the affected organ does in fact remove the infection from t icon_name = "groin" display_name = "groin" max_damage = 50 - min_broken_damage = 30 + min_broken_damage = 60 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 = 25 body_part = ARM_LEFT process() @@ -905,7 +949,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 = 25 body_part = LEG_LEFT icon_position = LEFT @@ -914,7 +958,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 = 25 body_part = ARM_RIGHT process() @@ -926,7 +970,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 = 25 body_part = LEG_RIGHT icon_position = RIGHT @@ -977,7 +1021,7 @@ Note that amputating the affected organ does in fact remove the infection from t icon_name = "head" display_name = "head" max_damage = 75 - min_broken_damage = 40 + min_broken_damage = 50 body_part = HEAD var/disfigured = 0 var/brained = 0 diff --git a/code/modules/organs/pain.dm b/code/modules/organs/pain.dm index 831a7184084..3dc03924ceb 100644 --- a/code/modules/organs/pain.dm +++ b/code/modules/organs/pain.dm @@ -98,8 +98,9 @@ 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) + // Damage to internal organs hurts a lot. for(var/n in internal_organs_by_name)