Skip to content

Commit

Permalink
fix(surgery & accessories): fixed surgery operation through clothings…
Browse files Browse the repository at this point in the history
… && fix remote stripping of accessories

#10857
  • Loading branch information
Zert0X authored Nov 3, 2023
1 parent 13f76c0 commit f6b3c07
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
1 change: 0 additions & 1 deletion code/datums/surgery/steps/limb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Default limb attachment step, does nothing.
*/
/datum/surgery_step/limb
accessible = FALSE
delicate = TRUE
shock_level = 40
priority = 3 // Must be higher than /datum/surgery_step/internal.
Expand Down
1 change: 1 addition & 0 deletions code/datums/surgery/steps/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Cutting powersuit step.
*/
/datum/surgery_step/powersuit
needs_uncovered_organ = FALSE
priority = 3
duration = SAW_DURATION * 2

Expand Down
5 changes: 3 additions & 2 deletions code/datums/surgery/surgery_step.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// Whether performing this step can cause infection.
var/can_infect = FALSE
/// Whether this step require not covered organ.
var/accessible = FALSE
var/needs_uncovered_organ = TRUE
/// Whether this step can be successfully performed on any surface.
var/delicate = FALSE
/**
Expand Down Expand Up @@ -67,7 +67,8 @@
if(!check_zone(target, parent_zone))
return FALSE

if(accessible && !check_clothing(target, target_zone))
if(needs_uncovered_organ && !check_clothing(target, target_zone))
to_chat(user, SPAN_DANGER("Clothing on [target]'s [organ_name_by_zone(target, target_zone)] blocks surgery!"))
return SURGERY_FAILURE

var/obj/item/organ/parent_organ = target.get_organ(parent_zone)
Expand Down
4 changes: 3 additions & 1 deletion code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ GLOBAL_LIST_EMPTY(clothing_blood_icons)

/obj/item/clothing/equipped(mob/user)
playsound(src, SFX_USE_OUTFIT, 75, 1)

SHOULD_CALL_PARENT(TRUE)
for(var/obj/item/clothing/accessory/accessory in accessories)
accessory.equipped(user)
if(needs_vision_update())
update_vision()
return ..()
Expand Down
4 changes: 4 additions & 0 deletions code/modules/clothing/under/accessories/holster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
var/obj/item/clothing/accessory/A = target
if(!istype(A))
return TRUE

if(..() && isnull(A.has_suit))
return TRUE

if(!isnull(A.has_suit) && !(A.has_suit in user))
return TRUE

/obj/item/clothing/accessory/holster/Initialize()
. = ..()
holster_action = new /datum/action/item_action/holster
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/human/stripping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
A = show_radial_menu(usr, usr, make_item_radial_menu_choices(holder.accessories), radius = 42)
if(!istype(A))
return

if(user.incapacitated() || !user.Adjacent(src))
return

visible_message("<span class='danger'>\The [user] is trying to remove \the [src]'s [A.name]!</span>")

if(!do_after(user, HUMAN_STRIP_DELAY, src))
Expand Down

0 comments on commit f6b3c07

Please sign in to comment.