Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes the numpad a hotkey for selecting damage zones #3641

Merged
merged 1 commit into from
Oct 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@
update_icon()
return 1

/obj/screen/zone_sel/proc/set_selected_zone(bodypart)
var/old_selecting = selecting
selecting = bodypart
if(old_selecting != selecting)
update_icon()

/obj/screen/zone_sel/update_icon()
overlays.Cut()
overlays += image('icons/mob/zone_sel.dmi', "[selecting]")
Expand Down
44 changes: 44 additions & 0 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1278,3 +1278,47 @@ mob/proc/yank_out_object()
//Helper proc for figuring out if the active hand (or given hand) is usable.
/mob/proc/can_use_hand()
return 1

/client/proc/check_has_body_select()
return mob && mob.hud_used && istype(mob.zone_sel, /obj/screen/zone_sel)

/client/verb/body_toggle_head()
set name = "body-toggle-head"
set hidden = 1
toggle_zone_sel(list("head","eyes","mouth"))

/client/verb/body_r_arm()
set name = "body-r-arm"
set hidden = 1
toggle_zone_sel(list("r_arm","r_hand"))

/client/verb/body_l_arm()
set name = "body-l-arm"
set hidden = 1
toggle_zone_sel(list("l_arm","l_hand"))

/client/verb/body_chest()
set name = "body-chest"
set hidden = 1
toggle_zone_sel(list("chest"))

/client/verb/body_groin()
set name = "body-groin"
set hidden = 1
toggle_zone_sel(list("groin"))

/client/verb/body_r_leg()
set name = "body-r-leg"
set hidden = 1
toggle_zone_sel(list("r_leg","r_foot"))

/client/verb/body_l_leg()
set name = "body-l-leg"
set hidden = 1
toggle_zone_sel(list("l_leg","l_foot"))

/client/proc/toggle_zone_sel(list/zones)
if(!check_has_body_select())
return
var/obj/screen/zone_sel/selector = mob.zone_sel
selector.set_selected_zone(next_in_list(mob.zone_sel.selecting,zones))
37 changes: 37 additions & 0 deletions html/changelogs/ezuo-limbselection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
#################################

# Your name.
author: Ezuo

# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True

# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "Ported Chinsky's implementation of using the numpad to select damage zones. 1-6 for limbs, body and groin. The limb keys toggle between arm/leg and hand/foot. The 8 key toggles between head/mouth/eyes. Use control+numpad if you dont use hotkeys."
112 changes: 112 additions & 0 deletions interface/skin.dmf
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,34 @@ macro "borghotkeymode"
name = "F12"
command = "F12"
is-disabled = false
elem
name = "NUMPAD8"
command = "body-toggle-head"
is-disabled = false
elem
name = "NUMPAD5"
command = "body-chest"
is-disabled = false
elem
name = "NUMPAD4"
command = "body-r-arm"
is-disabled = false
elem
name = "NUMPAD6"
command = "body-l-arm"
is-disabled = false
elem
name = "NUMPAD2"
command = "body-groin"
is-disabled = false
elem
name = "NUMPAD1"
command = "body-r-leg"
is-disabled = false
elem
name = "NUMPAD3"
command = "body-l-leg"
is-disabled = false

macro "macro"
elem
Expand Down Expand Up @@ -461,6 +489,34 @@ macro "macro"
name = "F12"
command = "F12"
is-disabled = false
elem
name = "CTRL+NUMPAD8"
command = "body-toggle-head"
is-disabled = false
elem
name = "CTRL+NUMPAD5"
command = "body-chest"
is-disabled = false
elem
name = "CTRL+NUMPAD4"
command = "body-r-arm"
is-disabled = false
elem
name = "CTRL+NUMPAD6"
command = "body-l-arm"
is-disabled = false
elem
name = "CTRL+NUMPAD2"
command = "body-groin"
is-disabled = false
elem
name = "CTRL+NUMPAD1"
command = "body-r-leg"
is-disabled = false
elem
name = "CTRL+NUMPAD3"
command = "body-l-leg"
is-disabled = false

macro "hotkeymode"
elem
Expand Down Expand Up @@ -743,6 +799,34 @@ macro "hotkeymode"
name = "F12"
command = "F12"
is-disabled = false
elem
name = "NUMPAD8"
command = "body-toggle-head"
is-disabled = false
elem
name = "NUMPAD5"
command = "body-chest"
is-disabled = false
elem
name = "NUMPAD4"
command = "body-r-arm"
is-disabled = false
elem
name = "NUMPAD6"
command = "body-l-arm"
is-disabled = false
elem
name = "NUMPAD2"
command = "body-groin"
is-disabled = false
elem
name = "NUMPAD1"
command = "body-r-leg"
is-disabled = false
elem
name = "NUMPAD3"
command = "body-l-leg"
is-disabled = false

macro "borgmacro"
elem
Expand Down Expand Up @@ -933,6 +1017,34 @@ macro "borgmacro"
name = "F12"
command = "F12"
is-disabled = false
elem
name = "CTRL+NUMPAD8"
command = "body-toggle-head"
is-disabled = false
elem
name = "CTRL+NUMPAD5"
command = "body-chest"
is-disabled = false
elem
name = "CTRL+NUMPAD4"
command = "body-r-arm"
is-disabled = false
elem
name = "CTRL+NUMPAD6"
command = "body-l-arm"
is-disabled = false
elem
name = "CTRL+NUMPAD2"
command = "body-groin"
is-disabled = false
elem
name = "CTRL+NUMPAD1"
command = "body-r-leg"
is-disabled = false
elem
name = "CTRL+NUMPAD3"
command = "body-l-leg"
is-disabled = false


menu "menu"
Expand Down