From 3b90cb703a47af2af8ae4caee888946ae584fede Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Mon, 8 Feb 2016 01:16:13 -0500 Subject: [PATCH] almost ready for review --- .../carbon/alien/humanoid/caste/sentinel.dm | 2 +- .../living/carbon/alien/humanoid/empress.dm | 6 +++--- .../mob/living/carbon/alien/humanoid/queen.dm | 4 ++-- .../living/carbon/human/human_attackhand.dm | 10 +++++++--- code/modules/surgery/bones.dm | 4 +++- code/modules/surgery/limb_reattach.dm | 2 +- code/modules/surgery/organs_internal.dm | 20 +++++++++---------- code/modules/surgery/other.dm | 18 +++++++++++++++++ code/modules/surgery/robotics.dm | 5 +++-- 9 files changed, 48 insertions(+), 23 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index 8a2e835e23a..342c8a530d3 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -45,7 +45,7 @@ internal_organs += new /obj/item/organ/internal/xenos/plasmavessel internal_organs += new /obj/item/organ/internal/xenos/acidgland internal_organs += new /obj/item/organ/internal/xenos/neurotoxin - //..() + ..() /mob/living/carbon/alien/humanoid/sentinel/handle_regular_hud_updates() ..() //-Yvarov diff --git a/code/modules/mob/living/carbon/alien/humanoid/empress.dm b/code/modules/mob/living/carbon/alien/humanoid/empress.dm index 3c1cadaae7d..ddd1350bdfd 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/empress.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/empress.dm @@ -50,7 +50,7 @@ internal_organs += new /obj/item/organ/internal/xenos/eggsac internal_organs += new /obj/item/organ/internal/xenos/resinspinner internal_organs += new /obj/item/organ/internal/xenos/neurotoxin -// ..() + ..() /mob/living/carbon/alien/humanoid/empress @@ -85,8 +85,8 @@ src << "There's already an egg here." return - if(powerc(75,1))//Can't plant eggs on spess tiles. That's silly. - adjustToxLoss(-75) + if(powerc(250,1))//Can't plant eggs on spess tiles. That's silly. + adjustPlasma(-250) for(var/mob/O in viewers(src, null)) O.show_message(text("\green [src] has laid an egg!"), 1) new /obj/structure/alien/egg(loc) diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index e84f74683b3..188d485d83f 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -28,7 +28,7 @@ internal_organs += new /obj/item/organ/internal/xenos/eggsac internal_organs += new /obj/item/organ/internal/xenos/resinspinner internal_organs += new /obj/item/organ/internal/xenos/neurotoxin -// ..() + ..() /mob/living/carbon/alien/humanoid/queen @@ -67,7 +67,7 @@ return if(powerc(75,1))//Can't plant eggs on spess tiles. That's silly. - adjustToxLoss(-75) + adjustPlasma(-75) for(var/mob/O in viewers(src, null)) O.show_message(text("[src] has laid an egg!"), 1) new /obj/structure/alien/egg(loc) diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 155e50eef28..fd0a685038e 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -60,9 +60,13 @@ switch(M.a_intent) if(I_HELP) if(health >= config.health_threshold_crit) - help_shake_act(M) - add_logs(src, M, "shaked") - return 1 + for(var/datum/surgery/S in M.surgeries) + if(istype(S.get_surgery_step(), /datum/surgery_step/cavity/place_item)) + return 1 + else + help_shake_act(M) + add_logs(src, M, "shaked") + return 1 if(!H.check_has_mouth()) H << "You don't have a mouth, you cannot perform CPR!" return diff --git a/code/modules/surgery/bones.dm b/code/modules/surgery/bones.dm index 29f7c1574f5..a6b47e90a1a 100644 --- a/code/modules/surgery/bones.dm +++ b/code/modules/surgery/bones.dm @@ -18,7 +18,9 @@ if(istype(target,/mob/living/carbon/human)) var/mob/living/carbon/human/H = target var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting) - if(affected.status & ORGAN_ROBOT) + if((affected.status & ORGAN_ROBOT)) + return 0 + if(target.get_species() == "Machine") return 0 if(!(affected.encased)) return 0 diff --git a/code/modules/surgery/limb_reattach.dm b/code/modules/surgery/limb_reattach.dm index 58399e84f84..f774953bc58 100644 --- a/code/modules/surgery/limb_reattach.dm +++ b/code/modules/surgery/limb_reattach.dm @@ -14,7 +14,7 @@ var/mob/living/carbon/human/H = target var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting) - if(affected) + if(!affected) return 0 return 1 diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index 8f6625be9a0..c0d1da13daf 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -167,7 +167,7 @@ //same as surgery step /datum/surgery_step/open_encased/close/ current_type = "finish" - if(affected.encased) + if(affected && affected.encased) var/msg = "[user] starts bending [target]'s [affected.encased] back into place with \the [tool]." var/self_msg = "You start bending [target]'s [affected.encased] back into place with \the [tool]." user.visible_message(msg, self_msg) @@ -375,19 +375,19 @@ max_duration = 70 -/datum/surgery_step/saw_carapace/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) +/datum/surgery_step/saw_carapace/begin_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) user.visible_message("[user] begins to cut through [target]'s [target_zone] with \the [tool].", \ "You begin to cut through [target]'s [target_zone] with \the [tool].") ..() -/datum/surgery_step/saw_carapace/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) +/datum/surgery_step/saw_carapace/end_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) user.visible_message(" [user] has cut [target]'s [target_zone] open with \the [tool].", \ " You have cut [target]'s [target_zone] open with \the [tool].") return 1 -/datum/surgery_step/saw_carapace/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) +/datum/surgery_step/saw_carapace/fail_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) user.visible_message(" [user]'s hand slips, cracking [target]'s [target_zone] with \the [tool]!" , \ " Your hand slips, cracking [target]'s [target_zone] with \the [tool]!" ) @@ -412,19 +412,19 @@ max_duration = 60 -/datum/surgery_step/cut_carapace/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) +/datum/surgery_step/cut_carapace/begin_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) user.visible_message("[user] starts the incision on [target]'s [target_zone] with \the [tool].", \ "You start the incision on [target]'s [target_zone] with \the [tool].") ..() -/datum/surgery_step/cut_carapace/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) +/datum/surgery_step/cut_carapace/end_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) user.visible_message(" [user] has made an incision on [target]'s [target_zone] with \the [tool].", \ " You have made an incision on [target]'s [target_zone] with \the [tool].",) return 1 -/datum/surgery_step/cut_carapace/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) +/datum/surgery_step/cut_carapace/fail_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) user.visible_message(" [user]'s hand slips, slicing open [target]'s [target_zone] in a wrong spot with \the [tool]!", \ " Your hand slips, slicing open [target]'s [target_zone] in a wrong spot with \the [tool]!") @@ -442,7 +442,7 @@ max_duration = 40 -/datum/surgery_step/retract_carapace/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) +/datum/surgery_step/retract_carapace/begin_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) var/msg = "[user] starts to pry open the incision on [target]'s [target_zone] with \the [tool]." var/self_msg = "You start to pry open the incision on [target]'s [target_zone] with \the [tool]." if (target_zone == "chest") @@ -454,7 +454,7 @@ user.visible_message(msg, self_msg) ..() -/datum/surgery_step/retract_carapace/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) +/datum/surgery_step/retract_carapace/end_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) var/msg = " [user] keeps the incision open on [target]'s [target_zone] with \the [tool]." var/self_msg = " You keep the incision open on [target]'s [target_zone] with \the [tool]." if (target_zone == "chest") @@ -466,7 +466,7 @@ user.visible_message(msg, self_msg) return 1 -/datum/surgery_step/generic/retract_carapace/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool,datum/surgery/surgery) +/datum/surgery_step/generic/retract_carapace/fail_step(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool,datum/surgery/surgery) var/msg = " [user]'s hand slips, tearing the edges of incision on [target]'s [target_zone] with \the [tool]!" var/self_msg = " Your hand slips, tearing the edges of incision on [target]'s [target_zone] with \the [tool]!" if (target_zone == "chest") diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index 920a5381f04..a821c8987e7 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -2,7 +2,25 @@ ////////////////////////////////////////////////////////////////// // INTERNAL WOUND PATCHING // ////////////////////////////////////////////////////////////////// +/datum/surgery/bleeding + name = "internal bleeding" + steps = list(/datum/surgery_step/generic/cut_open,/datum/surgery_step/generic/clamp_bleeders,/datum/surgery_step/generic/retract_skin,/datum/surgery_step/generic/retract_skin, /datum/surgery_step/open_encased/saw, + /datum/surgery_step/open_encased/retract,/datum/surgery_step/fix_vein,/datum/surgery_step/open_encased/close, /datum/surgery_step/glue_bone, /datum/surgery_step/set_bone,/datum/surgery_step/finish_bone,/datum/surgery_step/generic/cauterize) + possible_locs = list("chest","head","groin") +/datum/surgery/bleeding/can_start(mob/user, mob/living/carbon/target) + if(ishuman(target) + var/mob/living/carbon/human/H = target + var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting) + if(!affected) return 0 + + var/internal_bleeding = 0 + for(var/datum/wound/W in affected.wounds) if(W.internal) + internal_bleeding = 1 + break + if(internal_bleeding) + return 1 + return 0 /datum/surgery_step/fix_vein name = "mend internal bleeding" diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm index a1a957af02c..489309de35b 100644 --- a/code/modules/surgery/robotics.dm +++ b/code/modules/surgery/robotics.dm @@ -24,7 +24,7 @@ if(istype(target,/mob/living/carbon/human)) var/mob/living/carbon/human/H = target var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting) - if(affected.status & ORGAN_ORGANIC) + if(affected) return 0 return 1 @@ -289,7 +289,7 @@ user.visible_message("[user] begins reattaching [target]'s [off_tool] with \the [tool].", \ "You start reattaching [target]'s [off_tool] with \the [tool].") target.custom_pain("Someone's rooting around in your [affected.name]!",1) - else if(istype(tool,/obj/item/device/mmi/)) + else if(istype(tool,/obj/item/device/mmi)) current_type = "install" if(target_zone != "chest") @@ -400,6 +400,7 @@ if(I && istype(I)) I.status &= ~ORGAN_CUT_AWAY + qdel(off_tool) else if (current_type == "install") user.visible_message(" [user] has installed \the [tool] into [target]'s [affected.name].", \ " You have installed \the [tool] into [target]'s [affected.name].")