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

Simplified bodyzone targeting preference #9845

Merged

Conversation

PowerfulBacon
Copy link
Member

@PowerfulBacon PowerfulBacon commented Sep 17, 2023

  • Complete combat interactions
  • Add in the wheel for all medical actions
  • Add in hotkeys that depend on if the mode is turned on or not
  • Make it so the mouse wheel can control the simplified group you have selected
  • Make it so changing the simplified group will add an overlay on your character showing which zone you selected This is not necessary I think
  • Surgery

About The Pull Request

This adds a new setting for simplified bodyzone targetting, when enabled this preference will replace the bodyzone targetting system with a new system that splits the bodyparts into groups, grouped by the reason you would be targetting them during combat:

  • Arms: Disarm a target and prevent them from attacking
  • Legs: Limit a target's mobility
  • Chest/Head: Damage output

During combat, the bodypart you are targetting will be determined contextually based on the zone you have selected.

If you are using a hypospray then it will pick the first limb in the group that isn't pierce protected. This only affects the head/chest zone as it will work if the target isn't wearing peirce protection in either slot.

If you are in combat, then:

  • Targetting head/chest has a 30% chance to target the head and a 70% chance to target the chest.
  • Targetting arms will target the target's active arm.
  • Targetting legs will randomly pick 1 of the target's legs.

If you do not enable the pref, then it will use your selected limb instead and will work the same as it did before.

Outside of combat, the user will be given a popup menu which lets them choose which limb they want to selected. If you are wearing a medhud or have a medical scanner in your off-hand, then the limb overlay colour will be based on the colour of the limb health.

image

If you do not enable the pref, then this wheel will not show and it will work the same as it did before

Since this change was pretty contraversial when proposed, I have made this a preference setting and it is not the default. After some time of playing with this, if the system works well and is easier to use then I will switch the default over to this system.

Since this system is made to be easier to use, bodyzone related combat will be easier when this preference is enabled. This may give players a slight advantage when using this preference setting, however the impact won't be huge and some more precise controls are limited.

Changes when the preference is enabled

  • You can now only target chest/legs/arms.
  • Rather than having hotkeys to set a specific zone, you have hotkeys to set the group, a hotkey to move up the group and a hotkey to move down the group. Moving up and down is bound to the mouse wheel by default.
  • When enabled, when you change a zone there will be an overlay applied on your mob temporarilly to show you which zone group you have selected.
  • When enabled, medical processes that target specific limbs will bring up the zone selection wheel.
  • Eye stabbing has a 40% probability of happening when targetting chest/head rather than a 100% chance when targetting the eyes.
  • You can no longer boop people on the head with the cyborg hug arms and you will no longer be able to headpat people (The default will be hugging instead).
  • Execution shots will be determined contextually. Instead of targetting the mouth, it will be based on if the target is buckled, lying down or tied up.
  • Interactions such as groin stomp require you to target the leg zone instead of the groin zone. These behaviours have specific enough controls that it doesn't matter too much.
  • Slicing the neck simply requires you to target head/chest and be on grab intent. Grab intent is a big enough of a barrier that it shouldn't make you accidentally slice someone's neck in combat instead of deal an attack to them. If we switch to combat mode, neck slicing can be made a right click thing and removed from bodyzone targetting entirely.
  • Any interactions that didn't have multiple per group are the same (most of them). Interactions such as bible healing on the head were actually never tied to the bodyzone system to begin with and do not need you to target the head.

image

image

image

If you do not set the preference to simplified, then there are no behavioural changes and this PR will have no effect on bodyzone targetting.

Why It's Good For The Game

This gives you the ability to change the bodyzone system into a system that is significantly easier to use and makes the game playable on a keyboard that does not have a numpad. Currently the bodyzone targetting system is so clunky that it doesn't actually add that much depth on combat because not many players are actually using it. This adds in an optional alternative that makes the bodyzone system significantly less clunky and easier to learn which is both good for existing players and good for old players (and good for anyone who doesn't have a numpad).

Any players who stick to the old intent system may be put at a slight disadvantage, since they need to manually change limbs to target the correct hand, however they get more precise control over what they target. My counter-argument to thinking that this could make other people more robust is simply to switch to the simplified bodyzone targetting system if you see it as being an advantage.

Testing Photographs and Procedure

image

image

image

image

image

image

image

image

image

image

image

image

image

image
On simple targetting (There are now hotkeys to control group direction)

image
On precise targetting

scroll_zone.mp4

Changelog

🆑
add: Adds in a preference for simplified bodyzone targetting, which makes the bodyzone targetting system easier to use and usable without a numpad.
tweak: You can now only start 1 surgery per mob.
factor: Shining a flashlight at someone will give both eye and mouth information when pointed at any part of the head.
add: Keybindings can now be hidden based on the value of preferences.
fix: Fixes some incorrect logic inside of technophile bible healing.
/:cl:

@github-actions github-actions bot added Mapping DMM Change Sprites TGUI-Changes Contains changes to TGUI. Make sure its up to date with TGUI 4.0 labels Sep 17, 2023
@ToasterBan
Copy link
Contributor

ToasterBan commented Sep 17, 2023

targetting arms will target the target's active arm.

this seems incredibly powerful if you have something like a stunbaton that can one-hit disable one

@PowerfulBacon
Copy link
Member Author

It will be more powerful, however it isn't anything that you can't do without the precise bodyzone targetting system. Targetting the arms is specifically to trigger a disarm on the target, I think stun batons require 2-3 hits to make the limb unusable but anything too strong can be nerfed.

@itsmeow
Copy link
Member

itsmeow commented Sep 17, 2023

Can you add a HUD button that switches the preference by the body selector so you could switch easily when needed?

@itsmeow
Copy link
Member

itsmeow commented Sep 17, 2023

Also it's spelled Targeting not Targetting

@PowerfulBacon PowerfulBacon changed the title Simplified bodyzone targetting preference Simplified bodyzone targeting preference Sep 17, 2023
@PowerfulBacon
Copy link
Member Author

Can you add a HUD button that switches the preference by the body selector so you could switch easily when needed?

I could do, although when enabled anything that needs precise targeting will give you a zone selection popup wheel to choose which zone you want and the different modes have different hotkey settings; so it is playable entirely in 1 mode or the other with only some very limited interactivity loss. Part of my reasoning for doing this was cleaning up the UI, so I'll see if I can add that without adding any additional clutter or confusion

code/__DEFINES/preferences.dm Outdated Show resolved Hide resolved
code/datums/elements/mechanical_repair.dm Show resolved Hide resolved
code/datums/keybinding/keybinding.dm Outdated Show resolved Hide resolved
code/datums/keybinding/mob.dm Outdated Show resolved Hide resolved
code/datums/keybinding/mob.dm Outdated Show resolved Hide resolved

/proc/select_bodyzone_limb_health(accurate_health = FALSE, mob/user, atom/target, bodyzone, is_precise_part = FALSE)
// Get the colours
var/list/healthy = rgb2num(FULL_HEALTH_COLOUR)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you define something only to immediately rgb2num it why not define it in the correct format

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well the VS code plugin I have doesn't handle the byond specific list() format of colours compared to RGB colours, so it makes it a lot easier to see what colours have been defined.
image
Compared to
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need it in list() format? BYOND supports hex colors

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am generating a colour matrix from it because the target icon is red instead of white

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change it to whiteee

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@lowwy
Copy link
Contributor

lowwy commented Sep 25, 2023

Repairing an IPC with 200+ brute/burn is a pain in the ass as the menu closes when doing one fix.

Could the menu stay open for welding/cables? (+maybe band-aids/burn cream?)
Or something else (shift+click?) to it that makes it less tedious when you need to click the horizontal a lot

@PowerfulBacon
Copy link
Member Author

Ah, I guess wires and welding should probably just repeat like tend wounds surgery

@Rukofamicom
Copy link
Contributor

image

I hate that I can misclick your checkboxes.

@Rukofamicom
Copy link
Contributor

image

@PowerfulBacon
Copy link
Member Author

PowerfulBacon commented Dec 16, 2023

Repairing an IPC with 200+ brute/burn is a pain in the ass as the menu closes when doing one fix.

Could the menu stay open for welding/cables? (+maybe band-aids/burn cream?) Or something else (shift+click?) to it that makes it less tedious when you need to click the horizontal a lot

Updated and tested: Mechanical repeairs will now repeat until you are fully healed or the welding tool runs out.

@itsmeow
Copy link
Member

itsmeow commented Dec 17, 2023

Did you fix #9885?

@PowerfulBacon
Copy link
Member Author

I'll take a look into that

@PowerfulBacon
Copy link
Member Author

Fixed
image

Copy link
Member

@itsmeow itsmeow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This thing was testmerged for a while, so I'm gonna say it's good. It's optional and the major bugs have been fixed.

@itsmeow itsmeow added this pull request to the merge queue Dec 19, 2023
Merged via the queue into BeeStation:master with commit 3518341 Dec 19, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Fix Mapping DMM Change Sprites TGUI-Changes Contains changes to TGUI. Make sure its up to date with TGUI 4.0 Tweak
Projects
Status: Major Systems
Development

Successfully merging this pull request may close these issues.

5 participants