mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-18 11:30:35 +01:00
Fix fall damage dislocating undislocatable joints (#14276)
* Fix fall damage dislocating undislocatable joints * Update code/modules/multiz/movement.dm
This commit is contained in:
@@ -545,20 +545,20 @@
|
||||
var/obj/item/organ/external/l_foot = get_organ(BP_L_FOOT)
|
||||
var/obj/item/organ/external/r_foot = get_organ(BP_R_FOOT)
|
||||
|
||||
if(prob(50) && l_foot)
|
||||
if(prob(50) && l_foot && l_foot.dislocated != -1)
|
||||
fall_message("left ankle", "bends unnaturally")
|
||||
l_foot.dislocate(TRUE)
|
||||
else if(r_foot)
|
||||
else if(r_foot && r_foot.dislocated != -1)
|
||||
fall_message("right ankle", "bends unnaturally")
|
||||
r_foot.dislocate(TRUE)
|
||||
else if(prob(15))
|
||||
var/obj/item/organ/external/l_leg = get_organ(BP_L_LEG)
|
||||
var/obj/item/organ/external/r_leg = get_organ(BP_R_LEG)
|
||||
|
||||
if(prob(50) && l_leg)
|
||||
if(prob(50) && l_leg && l_leg.dislocated != -1)
|
||||
fall_message("left knee", "caves in")
|
||||
l_leg.dislocate(TRUE)
|
||||
else if(r_leg)
|
||||
else if(r_leg && r_leg.dislocated != -1)
|
||||
fall_message("right knee", "caves in")
|
||||
l_leg.dislocate(TRUE)
|
||||
|
||||
@@ -588,20 +588,20 @@
|
||||
var/obj/item/organ/external/l_hand = get_organ(BP_L_HAND)
|
||||
var/obj/item/organ/external/r_hand = get_organ(BP_R_HAND)
|
||||
|
||||
if(prob(50) && l_hand)
|
||||
if(prob(50) && l_hand && l_hand.dislocated != -1)
|
||||
fall_message("left wrist", "bends unnaturally")
|
||||
l_hand.dislocate(TRUE)
|
||||
else if(r_hand)
|
||||
else if(r_hand && r_hand.dislocated != -1)
|
||||
fall_message("right wrist", "bends unnaturally")
|
||||
r_hand.dislocate(TRUE)
|
||||
else if(prob(15))
|
||||
var/obj/item/organ/external/l_arm = get_organ(BP_L_ARM)
|
||||
var/obj/item/organ/external/r_arm = get_organ(BP_R_ARM)
|
||||
|
||||
if(prob(50) && l_arm)
|
||||
if(prob(50) && l_arm && l_arm.dislocated != -1)
|
||||
fall_message("left elbow", "caves in")
|
||||
l_arm.dislocate(TRUE)
|
||||
else if(r_arm)
|
||||
else if(r_arm && r_arm.dislocated != -1)
|
||||
fall_message("right elbow", "caves in")
|
||||
r_arm.dislocate(TRUE)
|
||||
|
||||
@@ -611,7 +611,7 @@
|
||||
"<span class='danger'>With a loud thud, you land on your head. Hard.</span>", "You hear a thud!")
|
||||
|
||||
var/obj/item/organ/external/head = get_organ(BP_HEAD)
|
||||
if(prob(20) && head)
|
||||
if(prob(20) && head && head.dislocated != -1)
|
||||
fall_message("jaw", "cracks loose")
|
||||
head.dislocate(TRUE)
|
||||
|
||||
|
||||
@@ -187,19 +187,22 @@
|
||||
..()
|
||||
|
||||
/obj/item/organ/external/proc/dislocate(var/primary)
|
||||
if(dislocated != -1)
|
||||
if(primary)
|
||||
dislocated = 2
|
||||
else
|
||||
dislocated = 1
|
||||
if(dislocated == -1)
|
||||
return
|
||||
if(primary)
|
||||
dislocated = 2
|
||||
else
|
||||
dislocated = 1
|
||||
owner.verbs |= /mob/living/carbon/human/proc/undislocate
|
||||
if(children && children.len)
|
||||
for(var/obj/item/organ/external/child in children)
|
||||
child.dislocate()
|
||||
|
||||
/obj/item/organ/external/proc/undislocate()
|
||||
if(dislocated != -1)
|
||||
dislocated = 0
|
||||
if(dislocated == -1)
|
||||
return
|
||||
|
||||
dislocated = 0
|
||||
if(children && children.len)
|
||||
for(var/obj/item/organ/external/child in children)
|
||||
if(child.dislocated == 1)
|
||||
|
||||
Reference in New Issue
Block a user