Skip to content

Commit

Permalink
Yautja surgery target zone change (#3911)
Browse files Browse the repository at this point in the history
# About the pull request

I had a bit of an issue with the medicomp. My head as yautja was damaged
and I targeted my head.
There is no indication at all you must target the chest. Now you can
target any zone.
I ran to a few issues/glitches on the way. 

1. The yautja mask blocks surgery.
2. Parallel surgery would become possible.

The mask had a flag (BLOCKSHARPOBJ) that is only used once: 
[Here
exactly](https://github.com/cmss13-devs/cmss13/blob/823c9ce54631bab0dd65bec0e8299c842658f686/code/modules/mob/living/carbon/human/human_defense.dm#L79C1-L82)
That proc is only called specificly once:
[Over
here](https://github.com/cmss13-devs/cmss13/blob/823c9ce54631bab0dd65bec0e8299c842658f686/code/modules/surgery/surgery_steps.dm#L66-L90)
To litterly block surgery. There is nothing else the flag does.

By not caring about what is targeted you could start multiple surgeries
in parallel.
And I edited the initial surgery check to check for this.
It also tells you where it is ongoing should you have changed targets or
not know for some reason.

I have tested my changes. With all targetable regions. You cannot do it
on the limb you are holding the items in and thats fine.

# Explain why it's good for the game

Mostly because it gives no feedback on what you do wrong. And it's a
trivial thing to overlook. It also makes sense to target the head if you
have head damage on instinct.

# Testing Photographs and Procedure




</details>


# Changelog
:cl:
code: Medicomp surgery tools no longer care about what zone you target.
/:cl:
  • Loading branch information
Awantje authored Jul 20, 2023
1 parent 8ac357f commit da0c1fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/modules/cm_preds/yaut_mask.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
min_cold_protection_temperature = SPACE_HELMET_MIN_COLD_PROT
flags_armor_protection = BODY_FLAG_HEAD|BODY_FLAG_FACE|BODY_FLAG_EYES
flags_cold_protection = BODY_FLAG_HEAD
flags_inventory = COVEREYES|COVERMOUTH|NOPRESSUREDMAGE|ALLOWINTERNALS|ALLOWREBREATH|BLOCKGASEFFECT|BLOCKSHARPOBJ
flags_inventory = COVEREYES|COVERMOUTH|NOPRESSUREDMAGE|ALLOWINTERNALS|ALLOWREBREATH|BLOCKGASEFFECT
flags_inv_hide = HIDEEARS|HIDEEYES|HIDEFACE|HIDELOWHAIR
flags_item = ITEM_PREDATOR
filtered_gases = list("phoron", "sleeping_agent", "carbon_dioxide")
Expand Down
10 changes: 9 additions & 1 deletion code/modules/surgery/mcomp_tendwounds.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/datum/surgery/mcomp_wounds
name = "Tend Wounds"
possible_locs = list("chest")
possible_locs = DEFENSE_ZONES_LIVING //all hud aiming locations are suitable for yautja to target.
invasiveness = list(SURGERY_DEPTH_SURFACE)
required_surgery_skill = SKILL_SURGERY_TRAINED
var/required_trait = TRAIT_YAUTJA_TECH// Only predators can do this
Expand All @@ -15,6 +15,14 @@
self_operable = TRUE

/datum/surgery/mcomp_wounds/can_start(mob/living/carbon/human/user, mob/living/carbon/human/patient, obj/limb/limb, obj/item/tool)
var/list/surgery_limbs = DEFENSE_ZONES_LIVING //Creates a list of all targetable locations
surgery_limbs -= user.zone_selected //Removes the zone you are currently targeting

for(var/zone in surgery_limbs) //Loops through the limbs of the patient
if(istype(patient.active_surgeries[zone], /datum/surgery/mcomp_wounds)) //Checks if there is already a surgery of this type existing elsewhere.
to_chat(user, SPAN_WARNING("The [zone] is already being worked on and you have to finish that first!"))//gives a message to the person trying to perform the action
return FALSE

if(istype(user) && HAS_TRAIT(user, TRAIT_YAUTJA_TECH))
if (patient.getBruteLoss() || patient.getFireLoss()) //Heals brute or burn
return TRUE
Expand Down

0 comments on commit da0c1fd

Please sign in to comment.