diff --git a/code/__DEFINES/keybinding.dm b/code/__DEFINES/keybinding.dm index 285b7e6ea58..2a2a092c6d0 100644 --- a/code/__DEFINES/keybinding.dm +++ b/code/__DEFINES/keybinding.dm @@ -66,6 +66,7 @@ #define COMSIG_KB_MOB_ACTIVATEINHAND_DOWN "keybinding_mob_activateinhand_down" #define COMSIG_KB_MOB_DROPITEM_DOWN "keybinding_mob_dropitem_down" #define COMSIG_KB_MOB_TARGETCYCLEHEAD_DOWN "keybinding_mob_targetcyclehead_down" +#define COMSIG_KB_MOB_TARGETHEAD_DOWN "keybinding_mob_targethead_down" #define COMSIG_KB_MOB_TARGETEYES_DOWN "keybinding_mob_targeteyes_down" #define COMSIG_KB_MOB_TARGETMOUTH_DOWN "keybinding_mob_targetmouth_down" #define COMSIG_KB_MOB_TARGETRIGHTARM_DOWN "keybinding_mob_targetrightarm_down" diff --git a/code/datums/keybinding/mob.dm b/code/datums/keybinding/mob.dm index def4ec36fb2..4963e87266c 100644 --- a/code/datums/keybinding/mob.dm +++ b/code/datums/keybinding/mob.dm @@ -80,6 +80,8 @@ switch(keybind_signal) if(COMSIG_KB_MOB_TARGETCYCLEHEAD_DOWN) user.body_toggle_head() + if(COMSIG_KB_MOB_TARGETHEAD_DOWN) + user.body_head() if(COMSIG_KB_MOB_TARGETEYES_DOWN) user.body_eyes() if(COMSIG_KB_MOB_TARGETMOUTH_DOWN) @@ -108,6 +110,13 @@ description = "Pressing this key targets the head, and continued presses will cycle to the eyes and mouth. This will impact where you hit people, and can be used for surgery." keybind_signal = COMSIG_KB_MOB_TARGETCYCLEHEAD_DOWN +/datum/keybinding/mob/target/head + hotkey_keys = list("Unbound") + name = "target_head" + full_name = "Target: Head" + description = "Pressing this key targets the head. This will impact where you hit people, and can be used for surgery." + keybind_signal = COMSIG_KB_MOB_TARGETHEAD_DOWN + /datum/keybinding/mob/target/eyes hotkey_keys = list("Numpad7") name = "target_eyes" diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index b96f3aec6ca..9b62bd07743 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -352,7 +352,7 @@ //bodypart selection verbs - Cyberboss //8: repeated presses toggles through head - eyes - mouth -//9: eyes 8: head 7: mouth +//7: mouth 8: head 9: eyes //4: r-arm 5: chest 6: l-arm //1: r-leg 2: groin 3: l-leg @@ -361,12 +361,12 @@ return mob && mob.hud_used && mob.hud_used.zone_select && istype(mob.hud_used.zone_select, /atom/movable/screen/zone_sel) /** - * Hidden verb to set the target zone of a mob to the head + * Hidden verbs to set desired body target zone * - * (bound to 8) - repeated presses toggles through head - eyes - mouth + * Uses numpad keys 1-9 */ -///Hidden verb to target the head, bound to 8 +///Hidden verb to cycle through head zone with repeated presses, head - eyes - mouth. Bound to 8 /client/verb/body_toggle_head() set name = "body-toggle-head" set hidden = TRUE @@ -386,6 +386,17 @@ var/atom/movable/screen/zone_sel/selector = mob.hud_used.zone_select selector.set_selected_zone(next_in_line, mob) +///Hidden verb to target the head, unbound by default. +/client/verb/body_head() + set name = "body-head" + set hidden = TRUE + + if(!check_has_body_select()) + return + + var/atom/movable/screen/zone_sel/selector = mob.hud_used.zone_select + selector.set_selected_zone(BODY_ZONE_HEAD, mob) + ///Hidden verb to target the eyes, bound to 7 /client/verb/body_eyes() set name = "body-eyes"