Skip to content

Commit

Permalink
Logging for Inserting & Removing Things Surgically (#9873)
Browse files Browse the repository at this point in the history
* Logging for Inserting & Removing Surgically

Adds logging for inserting new organs via Organ Manipulation.
Adds logging for extracting implants from people.
Adds logging for storing or removing items surgically using a cavity implant.

* Logs Surgery Attempts, Removes Surgery Intent

Adds an additional log for when someone attempts to implant/remove organs, implant/remove cavity items, and remove/check for implants.
Removed user intent for surgical steps, as they can only be done on help, or disarm (Intentional Failure) which causes a combat log anyway.
  • Loading branch information
VickiMorris authored Sep 22, 2023
1 parent deff6ae commit 98f6a8a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions code/modules/surgery/cavity_implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@
display_results(user, target, "<span class='notice'>You begin to insert [tool] into [target]'s [target_zone]...</span>",
"[user] begins to insert [tool] into [target]'s [target_zone].",
"[user] begins to insert [tool.w_class > WEIGHT_CLASS_SMALL ? tool : "something"] into [target]'s [target_zone].")
//Incase they are interupted mid-insert, log it; shows intent to implant
log_combat(user, target, "tried to cavity implant [tool.name] into")
else
display_results(user, target, "<span class='notice'>You check for items in [target]'s [target_zone]...</span>",
"[user] checks for items in [target]'s [target_zone].",
"[user] looks for something in [target]'s [target_zone].")
log_combat(user, target, "searched for cavity item [IC ? "([IC.name])" : null] in")

/datum/surgery_step/handle_cavity/success(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/obj/item/bodypart/chest/CH = target.get_bodypart(BODY_ZONE_CHEST)
Expand All @@ -46,6 +49,8 @@
"[user] stuffs [tool.w_class > WEIGHT_CLASS_SMALL ? tool : "something"] into [target]'s [target_zone].")
user.transferItemToLoc(tool, target, TRUE)
CH.cavity_item = tool
//Logs stowing items in a cavity, similar to organ manipulation
log_combat(user, target, "cavity implanted [tool.name] into")
return 1
else
if(IC)
Expand All @@ -54,6 +59,8 @@
"[user] pulls [IC.w_class > WEIGHT_CLASS_SMALL ? IC : "something"] out of [target]'s [target_zone].")
user.put_in_hands(IC)
CH.cavity_item = null
//Log when cavity items are surgically removed, we don't care about it popping out from gibbing
log_combat(user, target, "extracted [IC.name] from cavity in")
return 1
else
to_chat(user, "<span class='warning'>You don't find anything in [target]'s [target_zone].</span>")
Expand Down
7 changes: 7 additions & 0 deletions code/modules/surgery/implant_removal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
display_results(user, target, "<span class='notice'>You begin to extract [I] from [target]'s [target_zone]...</span>",
"[user] begins to extract [I] from [target]'s [target_zone].",
"[user] begins to extract something from [target]'s [target_zone].")
//Incase they are interupted mid-extraction, log it
log_combat(user, target, "tried to extract [I.name] from")
else
display_results(user, target, "<span class='notice'>You look for an implant in [target]'s [target_zone]...</span>",
"[user] looks for an implant in [target]'s [target_zone].",
"[user] looks for something in [target]'s [target_zone].")
//Doesn't matter if they finish or not, defaults to this if there are no implants
log_combat(user, target, "implant checked")

/datum/surgery_step/extract_implant/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(I)
Expand All @@ -32,6 +36,9 @@
"[user] successfully removes something from [target]'s [target_zone]!")
I.removed(target)

//Logs removal of implants, similar to removal of organs during organ manipulation
log_combat(user, target, "surgically extracted [I.name] from")

var/obj/item/implantcase/case
for(var/obj/item/implantcase/ic in user.held_items)
case = ic
Expand Down
5 changes: 4 additions & 1 deletion code/modules/surgery/organ_manipulation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
display_results(user, target, "<span class='notice'>You begin to insert [tool] into [target]'s [parse_zone(target_zone)]...</span>",
"<span class='notice'>[user] begins to insert [tool] into [target]'s [parse_zone(target_zone)].</span>",
"<span class='notice'>[user] begins to insert something into [target]'s [parse_zone(target_zone)].</span>")
log_combat(user, target, "tried to insert [I.name] into")

else if(implement_type in implements_extract)
current_type = "extract"
Expand All @@ -136,6 +137,7 @@
display_results(user, target, "<span class='notice'>You begin to extract [I] from [target]'s [parse_zone(target_zone)]...</span>",
"[user] begins to extract [I] from [target]'s [parse_zone(target_zone)].",
"[user] begins to extract something from [target]'s [parse_zone(target_zone)].")
log_combat(user, target, "tried to extract [I.name] from")
else
return -1

Expand All @@ -154,13 +156,14 @@
display_results(user, target, "<span class='notice'>You insert [tool] into [target]'s [parse_zone(target_zone)].</span>",
"[user] inserts [tool] into [target]'s [parse_zone(target_zone)]!",
"[user] inserts something into [target]'s [parse_zone(target_zone)]!")
log_combat(user, target, "surgically installed [I.name] into")

else if(current_type == "extract")
if(I && I.owner == target)
display_results(user, target, "<span class='notice'>You successfully extract [I] from [target]'s [parse_zone(target_zone)].</span>",
"[user] successfully extracts [I] from [target]'s [parse_zone(target_zone)]!",
"[user] successfully extracts something from [target]'s [parse_zone(target_zone)]!")
log_combat(user, target, "surgically removed [I.name] from", addition="INTENT: [uppertext(user.a_intent)]")
log_combat(user, target, "surgically removed [I.name] from")
I.Remove(target)
I.forceMove(get_turf(target))
else
Expand Down

0 comments on commit 98f6a8a

Please sign in to comment.