this was a hard one (#21598)

This commit is contained in:
Contrabang
2023-08-12 13:45:14 -04:00
committed by GitHub
parent fe0a7c5ec3
commit 5c18bbeedf
4 changed files with 35 additions and 14 deletions
+2 -7
View File
@@ -194,12 +194,7 @@
to_chat(usr, "<span class='warning'>Your other hand is too busy holding the [item_in_hand.name]</span>")
return
hand = !hand
if(hud_used && hud_used.inv_slots[slot_l_hand] && hud_used.inv_slots[slot_r_hand])
var/obj/screen/inventory/hand/H
H = hud_used.inv_slots[slot_l_hand]
H.update_icon()
H = hud_used.inv_slots[slot_r_hand]
H.update_icon()
update_hands_hud()
SEND_SIGNAL(src, COMSIG_CARBON_SWAP_HANDS)
@@ -1045,7 +1040,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
changeNext_move(CLICK_CD_RAPID) //reset click cooldown from handcuffs
update_action_buttons_icon() //some of our action buttons might be unusable when we're handcuffed.
update_inv_handcuffed()
update_hud_handcuffed()
update_hands_hud()
/mob/living/carbon/get_standard_pixel_y_offset()
if(IS_HORIZONTAL(src))
@@ -32,13 +32,13 @@
return
//update whether handcuffs appears on our hud.
/mob/living/carbon/proc/update_hud_handcuffed()
if(hud_used)
var/obj/screen/inventory/R = hud_used.inv_slots[slot_r_hand]
var/obj/screen/inventory/L = hud_used.inv_slots[slot_l_hand]
if(R && L)
R.update_icon()
L.update_icon()
/mob/living/carbon/proc/update_hands_hud()
if(!hud_used)
return
var/obj/screen/inventory/R = hud_used.inv_slots[slot_r_hand]
R?.update_icon()
var/obj/screen/inventory/L = hud_used.inv_slots[slot_l_hand]
L?.update_icon()
/mob/living/carbon/update_inv_r_hand(ignore_cuffs)
if(handcuffed && !ignore_cuffs)
@@ -177,6 +177,7 @@
/obj/item/organ/external/hand/remove()
if(owner)
update_hand_missing()
if(owner.gloves)
owner.unEquip(owner.gloves)
if(owner.l_hand)
@@ -186,6 +187,26 @@
. = ..()
/obj/item/organ/external/hand/necrotize(update_sprite)
. = ..()
update_hand_missing()
/obj/item/organ/external/hand/mutate()
. = ..()
update_hand_missing()
/obj/item/organ/external/hand/receive_damage(brute, burn, sharp, used_weapon, list/forbidden_limbs, ignore_resists, updating_health)
. = ..()
update_hand_missing()
/obj/item/organ/external/hand/droplimb(clean, disintegrate, ignore_children, nodamage)
. = ..()
update_hand_missing()
/obj/item/organ/external/hand/proc/update_hand_missing()
// we need to come back to this once the hand is actually removed/dead
addtimer(CALLBACK(owner, TYPE_PROC_REF(/mob/living/carbon/human, update_hands_hud), 0))
/obj/item/organ/external/hand/right
limb_name = "r_hand"
name = "right hand"