From 8bfdd464d726c4e848207b00dacb4128b578107e Mon Sep 17 00:00:00 2001 From: Dwago <43487478+dragoslava@users.noreply.github.com> Date: Sat, 3 Nov 2018 11:43:33 -0700 Subject: [PATCH] Plastic Surgery 2.0 (#5455) Originaly I decided to just port from paracode but decided to just code it a more simple way with less hassle of porting it. "Added the ability to do plastic surgery to fix disfigured face's and for other purposes. Credit to MarinaGryphon for Assistance" --- aurorastation.dme | 1 + code/__defines/mobs.dm | 1 + code/modules/surgery/plastic_surgery.dm | 89 +++++++++++++++++++++++++ html/changelogs/plasticsurgery.yml | 38 +++++++++++ 4 files changed, 129 insertions(+) create mode 100644 code/modules/surgery/plastic_surgery.dm create mode 100644 html/changelogs/plasticsurgery.yml diff --git a/aurorastation.dme b/aurorastation.dme index 453a970c6eb..0500d5442a6 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -2336,6 +2336,7 @@ #include "code\modules\surgery\limb_reattach.dm" #include "code\modules\surgery\organs_internal.dm" #include "code\modules\surgery\other.dm" +#include "code\modules\surgery\plastic_surgery.dm" #include "code\modules\surgery\robotics.dm" #include "code\modules\surgery\slimes.dm" #include "code\modules\surgery\surgery.dm" diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index 995277fa476..29fa78c4dd1 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -84,6 +84,7 @@ #define APPEARANCE_EYE_COLOR 0x100 #define APPEARANCE_ALL_HAIR (APPEARANCE_HAIR|APPEARANCE_HAIR_COLOR|APPEARANCE_FACIAL_HAIR|APPEARANCE_FACIAL_HAIR_COLOR) #define APPEARANCE_ALL 0xFFFF +#define APPEARANCE_PLASTICSURGERY (APPEARANCE_HAIR|APPEARANCE_HAIR_COLOR|APPEARANCE_FACIAL_HAIR|APPEARANCE_FACIAL_HAIR_COLOR|APPEARANCE_GENDER) & ~APPEARANCE_RACE // Click cooldown #define DEFAULT_ATTACK_COOLDOWN 8 //Default timeout for aggressive actions diff --git a/code/modules/surgery/plastic_surgery.dm b/code/modules/surgery/plastic_surgery.dm new file mode 100644 index 00000000000..46fdb375b00 --- /dev/null +++ b/code/modules/surgery/plastic_surgery.dm @@ -0,0 +1,89 @@ + +////////////////////////////////////////////////////////////////// +// MEDIBOTS DREAM COME TRUE! // +// Plastic Surgery // +////////////////////////////////////////////////////////////////// + +/datum/surgery_step/face + priority = 2 + can_infect = 0 + can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + if (!hasorgans(target)) + return 0 + var/obj/item/organ/external/affected = target.get_organ(target_zone) + if (!affected || (affected.status & ORGAN_ROBOT)) + return 0 + return target_zone == "mouth" + + + +/datum/surgery_step/generic/prepare_face + allowed_tools = list( + /obj/item/weapon/retractor = 100, + /obj/item/weapon/material/hatchet/tacknife = 75 + ) + + min_duration = 90 + max_duration = 110 + + can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + return ..() && target_zone == "mouth" && target.op_stage.face == 1 + + begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message("[user] starts to retract [target]'s face with \the [tool].", \ + "You start to retract [target]'s face with \the [tool].") + ..() + + end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message("[user] has retracted [target]'s face with \the [tool] for his facial alteration." , \ + "You have retracted [target]'s face and neck with \the [tool] for plastic surgery.",) + target.op_stage.face = 2 + + 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("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!" , \ + "Your hand slips, slicing [target]'s throat wth \the [tool]!" ) + affected.createwound(CUT, 60) + target.losebreath += 10 + + +/datum/surgery_step/generic/alter_face + allowed_tools = list( + /obj/item/stack/medical/advanced/bruise_pack = 100, + /obj/item/weapon/material/hatchet/tacknife = 75 + ) + + min_duration = 40 + max_duration = 90 + + can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + return ..() && target_zone == "mouth" && target.op_stage.face == 2 + + begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + user.visible_message("[user] starts to alter [target]'s face with \the [tool].", \ + "You start to alter [target]'s face and neck with \the [tool].") + ..() + + end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) + var/obj/item/organ/external/head/head = target.get_organ(target_zone) + if(head.disfigured) + head.disfigured = FALSE + user.visible_message("[user] successfully restores [target]'s appearance!", "You successfully restore [target]'s appearance.") + + var/getName = sanitize(input(user, "What is your patient's new identity?", "Name change") as null|text, MAX_NAME_LEN) + if(getName) + target.real_name = getName + target.name = getName + target.dna.real_name = getName + if(target.mind) + target.mind.name = target.name + target.change_appearance(APPEARANCE_PLASTICSURGERY, usr, usr, check_species_whitelist = 1, state = z_state) + target.op_stage.face = 0 + + + 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("[user]'s hand slips, slicing [target]'s throat wth \the [tool]!" , \ + "Your hand slips, slicing [target]'s throat wth \the [tool]!" ) + affected.createwound(CUT, 60) + target.losebreath += 10 diff --git a/html/changelogs/plasticsurgery.yml b/html/changelogs/plasticsurgery.yml new file mode 100644 index 00000000000..eb0c7512f65 --- /dev/null +++ b/html/changelogs/plasticsurgery.yml @@ -0,0 +1,38 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +################################# + +# Your name. +author: Drago + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Added the ability to do plastic surgery to fix disfigured face's and for other purposes. Credit to MarinaGryphon for Assistance" +