From eb6d63cc07a214c1a589335dd7dbdb0fe1984fdb Mon Sep 17 00:00:00 2001 From: Chinsky Date: Mon, 15 Oct 2012 15:13:34 +0400 Subject: [PATCH] Should be everything for surgery for now. -Fixed some more messages. -Added that if you try to set not broken bone with bone setter, you won't like the result -Moved code for fracturing bones to the separate proc. --- code/WorkInProgress/surgery.dm | 36 ++++++++++++---------------- code/datums/organs/organ_external.dm | 16 ++++++++----- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/code/WorkInProgress/surgery.dm b/code/WorkInProgress/surgery.dm index e6069de4606..ee99b6a0217 100644 --- a/code/WorkInProgress/surgery.dm +++ b/code/WorkInProgress/surgery.dm @@ -69,7 +69,7 @@ proc/build_surgery_steps_list() affected = target.get_organ(target_zone) if (affected == null) return 0 - return 1 + return target_zone != "eyes" //there are specific steps for eye surgery /datum/surgery_step/generic/cut_open required_tool = /obj/item/weapon/scalpel @@ -78,7 +78,7 @@ proc/build_surgery_steps_list() max_duration = 110 can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - return ..() && affected.open == 0 && target_zone != "eyes" && target_zone != "mouth" + return ..() && affected.open == 0 && target_zone != "mouth" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) @@ -181,12 +181,12 @@ proc/build_surgery_steps_list() max_duration = 100 can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - return ..() && affected.open + return ..() && affected.open && target_zone != "mouth" begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] is beginning to cauterize the incision on [target]'s [affected.display_name] with \the [tool]." , \ - "You are beginning to cauterize the incision on [user]'s [affected.display_name] with \the [tool].") + "You are beginning to cauterize the incision on [target]'s [affected.display_name] with \the [tool].") end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) @@ -194,17 +194,6 @@ proc/build_surgery_steps_list() "\blue You cauterize the incision on [target]'s [affected.display_name] with \the [tool].") affected.open = 0 affected.status &= ~ORGAN_BLEEDING - if (affected.name == "head") - target.op_stage.eyes = 0 - target.op_stage.face = 0 - if (target_zone == "eyes" && target.op_stage.eyes > 0) - if (target.op_stage.eyes == 3) - target.sdisabilities &= ~BLIND - target.eye_stat = 0 - if (target_zone == "mouth" && target.op_stage.face > 0) - if (target.op_stage.face == 2) - var/datum/organ/external/head/h = affected - h.disfigured = 0 fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) @@ -333,9 +322,14 @@ proc/build_surgery_steps_list() end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] sets the bone in [target]'s [affected.display_name] in place with \the [tool].", \ - "\blue You set the bone in [target]'s [affected.display_name] n place with \the [tool].") - affected.stage = 2 + if (affected.status & ORGAN_BROKEN) + user.visible_message("\blue [user] sets the bone in [target]'s [affected.display_name] in place with \the [tool].", \ + "\blue You set the bone in [target]'s [affected.display_name] in place with \the [tool].") + affected.stage = 2 + else + user.visible_message("\blue [user] sets the bone in [target]'s [affected.display_name]\red in the WRONG place with \the [tool].", \ + "\blue You set the bone in [target]'s [affected.display_name]\red in the WRONG place with \the [tool].") + affected.fracture() fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) @@ -355,7 +349,7 @@ proc/build_surgery_steps_list() begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message("[user] is beginning piece together [target]'s skull with \the [tool]." , \ - "You are beginning piece together [user]'s skull with \the [tool].") + "You are beginning piece together [target]'s skull with \the [tool].") end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) @@ -496,7 +490,7 @@ proc/build_surgery_steps_list() begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message("[user] is beginning to cauterize the incision around [target]'s eyes with \the [tool]." , \ - "You are beginning to cauterize the incision around [user]'s eyes with \the [tool].") + "You are beginning to cauterize the incision around [target]'s eyes with \the [tool].") end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message("\blue [user] cauterizes the incision around [target]'s eyes with \the [tool].", \ @@ -609,7 +603,7 @@ proc/build_surgery_steps_list() begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) user.visible_message("[user] is beginning to cauterize the incision on [target]'s face and neck with \the [tool]." , \ - "You are beginning to cauterize the incision on [user]'s face and neck with \the [tool].") + "You are beginning to cauterize the incision on [target]'s face and neck with \the [tool].") end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) diff --git a/code/datums/organs/organ_external.dm b/code/datums/organs/organ_external.dm index f76e32af0f7..00b9a54a471 100644 --- a/code/datums/organs/organ_external.dm +++ b/code/datums/organs/organ_external.dm @@ -232,14 +232,18 @@ owner.update_body(1) return if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT)) - if(!(status & ORGAN_BROKEN)) - owner.visible_message("\red You hear a loud cracking sound coming from \the [owner].","\red Something feels like it shattered in your [display_name]!","You hear a sickening crack.") - owner.emote("scream") - status |= ORGAN_BROKEN - broken_description = pick("broken","fracture","hairline fracture") - perma_injury = brute_dam + src.fracture() return + proc/fracture() + if(status & ORGAN_BROKEN) + return + owner.visible_message("\red You hear a loud cracking sound coming from \the [owner].","\red Something feels like it shattered in your [display_name]!","You hear a sickening crack.") + owner.emote("scream") + status |= ORGAN_BROKEN + broken_description = pick("broken","fracture","hairline fracture") + perma_injury = brute_dam + // new damage icon system // returns just the brute/burn damage code proc/damage_state_text()