diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index d93953daaf1..0ef30cbe4ae 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -436,6 +436,7 @@ /obj/screen/inventory/hand var/image/active_overlay var/image/handcuff_overlay + var/static/mutable_appearance/blocked_overlay = mutable_appearance('icons/mob/screen_gen.dmi', "blocked") /obj/screen/inventory/hand/update_overlays() . = ..() @@ -451,6 +452,10 @@ if(C.handcuffed) . += handcuff_overlay + var/obj/item/organ/external/hand = C.get_organ("[slot_id == slot_l_hand ? "l" : "r"]_hand") + if(!hand || !hand.is_usable()) + . += blocked_overlay + if(slot_id == slot_l_hand && hud.mymob.hand) . += active_overlay else if(slot_id == slot_r_hand && !hud.mymob.hand) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 02cdbf43b15..20b0d812f57 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -194,12 +194,7 @@ to_chat(usr, "Your other hand is too busy holding the [item_in_hand.name]") 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)) diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index 2b9bbee950d..d4292464953 100644 --- a/code/modules/mob/living/carbon/carbon_update_icons.dm +++ b/code/modules/mob/living/carbon/carbon_update_icons.dm @@ -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) diff --git a/code/modules/surgery/organs/subtypes/standard_organs.dm b/code/modules/surgery/organs/subtypes/standard_organs.dm index ad496d9ca2b..9c219794f0e 100644 --- a/code/modules/surgery/organs/subtypes/standard_organs.dm +++ b/code/modules/surgery/organs/subtypes/standard_organs.dm @@ -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"