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
Add a procedure for repairing limbs via surgery. #5386
Merged
Anewbe
merged 1 commit into
PolarisSS13:master
from
Mechoid:End_The_Tyranny_Of_Chemistry
Jul 14, 2018
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,215 @@ | ||
//Procedures in this file: Organic limb repair | ||
////////////////////////////////////////////////////////////////// | ||
// LIMB REPAIR SURGERY // | ||
////////////////////////////////////////////////////////////////// | ||
/datum/surgery_step/repairflesh/ | ||
priority = 1 | ||
can_infect = 1 | ||
blood_level = 1 | ||
req_open = 1 | ||
|
||
/datum/surgery_step/repairflesh/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
if (target.stat == DEAD) // Sorry defibs, your subjects need to have pumping fluids for these to work. | ||
return 0 | ||
if (isslime(target)) | ||
return 0 | ||
if (target_zone == O_EYES || target_zone == O_MOUTH) | ||
return 0 | ||
if (!hasorgans(target)) | ||
return 0 | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
if (affected == null) | ||
return 0 | ||
if (affected.is_stump()) | ||
return 0 | ||
if (affected.robotic >= ORGAN_ROBOT) | ||
return 0 | ||
return 1 | ||
|
||
|
||
////////////////////////////////////////////////////////////////// | ||
// SCAN STEP // | ||
////////////////////////////////////////////////////////////////// | ||
|
||
/datum/surgery_step/repairflesh/scan_injury | ||
allowed_tools = list( | ||
/obj/item/weapon/autopsy_scanner = 100, | ||
/obj/item/device/healthanalyzer = 80, | ||
/obj/item/device/analyzer = 10 | ||
) | ||
|
||
priority = 2 | ||
|
||
can_infect = 0 //The only exception here. Sweeping a scanner probably won't transfer many germs. | ||
|
||
min_duration = 20 | ||
max_duration = 40 | ||
|
||
/datum/surgery_step/repairflesh/scan_injury/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
if(..()) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
if(affected.burn_stage || affected.brute_stage) | ||
return 0 | ||
return 1 | ||
return 0 | ||
|
||
/datum/surgery_step/repairflesh/scan_injury/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
user.visible_message("<span class='notice'>[user] begins scanning [target]'s [affected] with \the [tool].</span>", \ | ||
"<span class='notice'>You begin scanning [target]'s [affected] with \the [tool].</span>") | ||
..() | ||
|
||
/datum/surgery_step/repairflesh/scan_injury/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
user.visible_message("<span class='notice'>[user] finishes scanning [target]'s [affected].</span>", \ | ||
"<span class='notice'>You finish scanning [target]'s [affected].</span>") | ||
if(affected.brute_dam) | ||
to_chat(user, "<span class='notice'>The muscle in [target]'s [affected] is notably bruised.</span>") | ||
if(affected.status & ORGAN_BROKEN) | ||
to_chat(user, "<span class='warning'>\The [target]'s [affected] is broken!</span>") | ||
affected.brute_stage = max(1, affected.brute_stage) | ||
if(affected.burn_dam) | ||
to_chat(user, "<span class='notice'>\The muscle in [target]'s [affected] is notably charred.</span>") | ||
affected.burn_stage = max(1, affected.burn_stage) | ||
|
||
/datum/surgery_step/repairflesh/scan_injury/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
user.visible_message("<span class='warning'>[user]'s hand slips, dropping \the [tool] onto [target]'s [affected]!</span>" , \ | ||
"<span class='warning'>Your hand slips, dropping \the [tool] onto [target]'s [affected]!</span>" ) | ||
affected.createwound(BRUISE, 10) | ||
|
||
////////////////////////////////////////////////////////////////// | ||
// BURN STEP // | ||
////////////////////////////////////////////////////////////////// | ||
|
||
/datum/surgery_step/repairflesh/repair_burns | ||
allowed_tools = list( | ||
/obj/item/stack/medical/advanced/ointment = 100, | ||
/obj/item/weapon/surgical/FixOVein = 100, | ||
/obj/item/weapon/surgical/hemostat = 60, | ||
/obj/item/stack/medical/ointment = 50, | ||
/obj/item/weapon/tape_roll = 30, | ||
/obj/item/taperoll = 10 | ||
) | ||
|
||
priority = 3 | ||
|
||
min_duration = 90 | ||
max_duration = 120 | ||
|
||
/datum/surgery_step/repairflesh/repair_burns/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
if(..()) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
if(affected.burn_stage < 1 || !(affected.burn_dam)) | ||
return 0 | ||
if(affected.burn_dam < affected.brute_dam) | ||
return 0 | ||
return 1 | ||
return 0 | ||
|
||
/datum/surgery_step/repairflesh/repair_burns/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
if(istype(tool, /obj/item/weapon/tape_roll) || istype(tool, /obj/item/taperoll)) | ||
user.visible_message("<span class='warning'>[user] begins taping up [target]'s [affected] with \the [tool].</span>", \ | ||
"<span class='notice'>You begin taping up [target]'s [affected] with \the [tool].</span>") | ||
affected.jostle_bone(10) | ||
else if(istype(tool, /obj/item/weapon/surgical/hemostat) || istype(tool, /obj/item/weapon/surgical/FixOVein)) | ||
user.visible_message("<span class='notice'>[user] begins mending the charred blood vessels in [target]'s [affected] with \the [tool].</span>", \ | ||
"<span class='notice'>You begin mending the charred blood vessels in [target]'s [affected] with \the [tool].</span>") | ||
else | ||
user.visible_message("<span class='notice'>[user] begins coating the charred tissue in [target]'s [affected] with \the [tool].</span>", \ | ||
"<span class='notice'>You begin coating the charred tissue in [target]'s [affected] with \the [tool].</span>") | ||
..() | ||
|
||
/datum/surgery_step/repairflesh/repair_burns/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
if(istype(tool, /obj/item/weapon/tape_roll) || istype(tool, /obj/item/taperoll)) | ||
user.visible_message("<span class='notice'>[user] finishes taping up [target]'s [affected] with \the [tool].</span>", \ | ||
"<span class='notice'>You finish taping up [target]'s [affected] with \the [tool].</span>") | ||
affected.createwound(BRUISE, 10) | ||
affected.heal_damage(0, 25, 0, 0) | ||
if(!(affected.burn_dam)) | ||
affected.burn_stage = 0 | ||
if(istype(tool, /obj/item/stack)) | ||
var/obj/item/stack/T = tool | ||
T.use(1) | ||
..() | ||
|
||
/datum/surgery_step/repairflesh/repair_burns/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
user.visible_message("<span class='danger'>[user]'s hand slips, tearing up [target]'s [affected] with \the [tool].</span>", \ | ||
"<span class='danger'>Your hand slips, tearing up [target]'s [affected] with \the [tool].</span>") | ||
affected.createwound(BRUISE, 10) | ||
affected.createwound(CUT, 5) | ||
if(istype(tool, /obj/item/stack) && prob(30)) | ||
var/obj/item/stack/T = tool | ||
T.use(1) | ||
..() | ||
|
||
////////////////////////////////////////////////////////////////// | ||
// BRUTE STEP // | ||
////////////////////////////////////////////////////////////////// | ||
|
||
/datum/surgery_step/repairflesh/repair_brute | ||
allowed_tools = list( | ||
/obj/item/stack/medical/advanced/bruise_pack = 100, | ||
/obj/item/weapon/surgical/cautery = 100, | ||
/obj/item/weapon/surgical/bonesetter = 60, | ||
/obj/item/stack/medical/bruise_pack = 50, | ||
/obj/item/weapon/tape_roll = 40, | ||
/obj/item/taperoll = 10 | ||
) | ||
|
||
priority = 3 | ||
|
||
min_duration = 90 | ||
max_duration = 120 | ||
|
||
/datum/surgery_step/repairflesh/repair_brute/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
if(..()) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
if(affected.brute_stage < 1 || !(affected.brute_dam)) | ||
return 0 | ||
if(affected.brute_dam < affected.burn_dam) | ||
return 0 | ||
return 1 | ||
return 0 | ||
|
||
/datum/surgery_step/repairflesh/repair_brute/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
if(istype(tool, /obj/item/weapon/tape_roll) || istype(tool, /obj/item/taperoll)) | ||
user.visible_message("<span class='warning'>[user] begins taping up [target]'s [affected] with \the [tool].</span>", \ | ||
"<span class='notice'>You begin taping up [target]'s [affected] with \the [tool].</span>") | ||
affected.jostle_bone(10) | ||
else if(istype(tool, /obj/item/weapon/surgical/FixOVein) || istype(tool, /obj/item/weapon/surgical/bonesetter)) | ||
user.visible_message("<span class='notice'>[user] begins mending the torn tissue in [target]'s [affected] with \the [tool].</span>", \ | ||
"<span class='notice'>You begin mending the torn tissue in [target]'s [affected] with \the [tool].</span>") | ||
else | ||
user.visible_message("<span class='notice'>[user] begins coating the tissue in [target]'s [affected] with \the [tool].</span>", \ | ||
"<span class='notice'>You begin coating the tissue in [target]'s [affected] with \the [tool].</span>") | ||
..() | ||
|
||
/datum/surgery_step/repairflesh/repair_brute/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
if(istype(tool, /obj/item/weapon/tape_roll) || istype(tool, /obj/item/taperoll)) | ||
user.visible_message("<span class='notice'>[user] finishes taping up [target]'s [affected] with \the [tool].</span>", \ | ||
"<span class='notice'>You finish taping up [target]'s [affected] with \the [tool].</span>") | ||
affected.createwound(BRUISE, 10) | ||
affected.heal_damage(25, 0, 0, 0) | ||
if(!(affected.brute_dam)) | ||
affected.brute_stage = 0 | ||
if(istype(tool, /obj/item/stack)) | ||
var/obj/item/stack/T = tool | ||
T.use(1) | ||
..() | ||
|
||
/datum/surgery_step/repairflesh/repair_brute/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) | ||
var/obj/item/organ/external/affected = target.get_organ(target_zone) | ||
user.visible_message("<span class='danger'>[user]'s hand slips, tearing up [target]'s [affected] with \the [tool].</span>", \ | ||
"<span class='danger'>Your hand slips, tearing up [target]'s [affected] with \the [tool].</span>") | ||
affected.createwound(BRUISE, 10) | ||
affected.createwound(CUT, 5) | ||
if(istype(tool, /obj/item/stack) && prob(30)) | ||
var/obj/item/stack/T = tool | ||
T.use(1) | ||
..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
author: Mechoid | ||
|
||
delete-after: True | ||
|
||
changes: | ||
- rscadd: "Adds a new surgical procedure for fixing brute and burn on limbs." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"If they ARE on help intent, call the parent proc instead" == "If they AREN'T on help intent, actually perform the specific surgery applications of this tool
Afaik surgery is typically done explicitly on help intent, so is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surgery is done on help intent, yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are not on help, you will do the normal 'person is dead, do forensics scan'. Otherwise, it will attempt the living surgery for scanning internal damage. Help is required because the parent checks for help.