mirror of
https://github.com/Aurorastation/Aurora-Old.git
synced 2026-08-27 14:46:16 +01:00
Surgery Code
Updates the surgery code to match latest Baystation. Includes modifications to overlays and a new DMI.
This commit is contained in:
@@ -59,8 +59,6 @@
|
||||
affected.createwound(CUT, 1)
|
||||
affected.clamp()
|
||||
spread_germs_to_organ(affected, user)
|
||||
// if (target_zone == "head")
|
||||
// target.brain_op_stage = 1
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -101,8 +99,6 @@
|
||||
affected.createwound(CUT, 1)
|
||||
affected.clamp()
|
||||
affected.open = 2
|
||||
// if (target_zone == "head")
|
||||
// target.brain_op_stage = 1
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -143,8 +139,6 @@
|
||||
affected.status |= ORGAN_BLEEDING
|
||||
|
||||
affected.createwound(CUT, 1)
|
||||
// if (target_zone == "head")
|
||||
// target.brain_op_stage = 1
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -311,7 +305,7 @@
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
user.visible_message("\blue [user] cuts off [target]'s [affected.display_name] with \the [tool].", \
|
||||
"\blue You cut off [target]'s [affected.display_name] with \the [tool].")
|
||||
affected.droplimb(1,0)
|
||||
affected.droplimb(1,1,1)
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
@@ -181,11 +181,11 @@
|
||||
target.update_body()
|
||||
target.updatehealth()
|
||||
target.UpdateDamageIcon()
|
||||
var/obj/item/weapon/organ/head/B = tool
|
||||
if (B.brainmob.mind)
|
||||
B.brainmob.mind.transfer_to(target)
|
||||
del(B)
|
||||
|
||||
for(var/obj/item/organ/replacing_organ in tool)
|
||||
replacing_organ.loc = get_turf(tool)
|
||||
replacing_organ.replaced(target,affected)
|
||||
del(replacing_organ) //Just in case.
|
||||
del(tool)
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if(..())
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
return !affected.hidden && affected.cavity && tool.w_class <= get_max_wclass(affected)
|
||||
return !istype(user,/mob/living/silicon/robot) && !affected.hidden && affected.cavity && tool.w_class <= get_max_wclass(affected)
|
||||
|
||||
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
@@ -198,12 +198,13 @@
|
||||
if(worm.controlling)
|
||||
target.release_control()
|
||||
worm.detatch()
|
||||
|
||||
obj.loc = get_turf(target)
|
||||
if(istype(obj,/obj/item/weapon/implant))
|
||||
var/obj/item/weapon/implant/imp = obj
|
||||
imp.imp_in = null
|
||||
imp.implanted = 0
|
||||
worm.leave_host()
|
||||
else
|
||||
obj.loc = get_turf(target)
|
||||
if(istype(obj,/obj/item/weapon/implant))
|
||||
var/obj/item/weapon/implant/imp = obj
|
||||
imp.imp_in = null
|
||||
imp.implanted = 0
|
||||
else
|
||||
user.visible_message("\blue [user] removes \the [tool] from [target]'s [affected.display_name].", \
|
||||
"\blue There's something inside [target]'s [affected.display_name], but you just missed it this time." )
|
||||
|
||||
@@ -58,8 +58,7 @@
|
||||
/datum/surgery_step/internal/fix_organ
|
||||
allowed_tools = list(
|
||||
/obj/item/stack/medical/advanced/bruise_pack= 100, \
|
||||
/obj/item/stack/medical/bruise_pack = 20, \
|
||||
/obj/item/stack/medical/bruise_pack/tajaran = 70, \
|
||||
/obj/item/stack/medical/bruise_pack = 20
|
||||
)
|
||||
|
||||
min_duration = 70
|
||||
@@ -82,11 +81,8 @@
|
||||
var/tool_name = "\the [tool]"
|
||||
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
|
||||
tool_name = "regenerative membrane"
|
||||
if (istype(tool, /obj/item/stack/medical/bruise_pack))
|
||||
if (istype(tool, /obj/item/stack/medical/bruise_pack/tajaran))
|
||||
tool_name = "the poultice"
|
||||
else
|
||||
tool_name = "the bandaid"
|
||||
else if (istype(tool, /obj/item/stack/medical/bruise_pack))
|
||||
tool_name = "the bandaid"
|
||||
|
||||
if (!hasorgans(target))
|
||||
return
|
||||
@@ -106,10 +102,7 @@
|
||||
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
|
||||
tool_name = "regenerative membrane"
|
||||
if (istype(tool, /obj/item/stack/medical/bruise_pack))
|
||||
if (istype(tool, /obj/item/stack/medical/bruise_pack/tajaran))
|
||||
tool_name = "the poultice"
|
||||
else
|
||||
tool_name = "the bandaid"
|
||||
tool_name = "the bandaid"
|
||||
|
||||
if (!hasorgans(target))
|
||||
return
|
||||
@@ -136,12 +129,9 @@
|
||||
target.adjustToxLoss(5)
|
||||
|
||||
else if (istype(tool, /obj/item/stack/medical/bruise_pack))
|
||||
if (istype(tool, /obj/item/stack/medical/bruise_pack/tajaran))
|
||||
target.adjustToxLoss(7)
|
||||
else
|
||||
dam_amt = 5
|
||||
target.adjustToxLoss(10)
|
||||
affected.createwound(CUT, 5)
|
||||
dam_amt = 5
|
||||
target.adjustToxLoss(10)
|
||||
affected.createwound(CUT, 5)
|
||||
|
||||
for(var/datum/organ/internal/I in affected.internal_organs)
|
||||
if(I && I.damage > 0)
|
||||
@@ -314,30 +304,12 @@
|
||||
|
||||
// Extract the organ!
|
||||
if(target.op_stage.current_organ)
|
||||
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
var/datum/organ/internal/I = target.internal_organs_by_name[target.op_stage.current_organ]
|
||||
|
||||
var/obj/item/organ/O
|
||||
if(I && istype(I))
|
||||
O = I.remove(user)
|
||||
if(O && istype(O))
|
||||
|
||||
// Stop the organ from continuing to reject.
|
||||
O.organ_data.rejecting = null
|
||||
|
||||
// Transfer over some blood data, if the organ doesn't have data.
|
||||
var/datum/reagent/blood/organ_blood = locate(/datum/reagent/blood) in O.reagents.reagent_list
|
||||
if(!organ_blood || !organ_blood.data["blood_DNA"])
|
||||
target.vessel.trans_to(O, 5, 1, 1)
|
||||
|
||||
// Kinda redundant, but I'm getting some buggy behavior.
|
||||
target.internal_organs_by_name[target.op_stage.current_organ] = null
|
||||
target.internal_organs_by_name -= target.op_stage.current_organ
|
||||
target.internal_organs -= O.organ_data
|
||||
affected.internal_organs -= O.organ_data
|
||||
O.removed(target,user)
|
||||
|
||||
target.op_stage.current_organ = null
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
@@ -409,30 +381,8 @@
|
||||
"\blue You have transplanted \the [tool] into [target]'s [affected.display_name].")
|
||||
user.drop_item(tool)
|
||||
var/obj/item/organ/O = tool
|
||||
|
||||
if(istype(O))
|
||||
|
||||
var/datum/reagent/blood/transplant_blood = locate(/datum/reagent/blood) in O.reagents.reagent_list
|
||||
if(!transplant_blood)
|
||||
O.organ_data.transplant_data = list()
|
||||
O.organ_data.transplant_data["species"] = target.species.name
|
||||
O.organ_data.transplant_data["blood_type"] = target.dna.b_type
|
||||
O.organ_data.transplant_data["blood_DNA"] = target.dna.unique_enzymes
|
||||
else
|
||||
O.organ_data.transplant_data = list()
|
||||
O.organ_data.transplant_data["species"] = transplant_blood.data["species"]
|
||||
O.organ_data.transplant_data["blood_type"] = transplant_blood.data["blood_type"]
|
||||
O.organ_data.transplant_data["blood_DNA"] = transplant_blood.data["blood_DNA"]
|
||||
|
||||
O.organ_data.organ_holder = null
|
||||
O.organ_data.owner = target
|
||||
target.internal_organs |= O.organ_data
|
||||
affected.internal_organs |= O.organ_data
|
||||
target.internal_organs_by_name[O.organ_tag] = O.organ_data
|
||||
O.organ_data.status |= ORGAN_CUT_AWAY
|
||||
O.replaced(target)
|
||||
|
||||
del(O)
|
||||
O.replaced(target,affected)
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("\red [user]'s hand slips, damaging \the [tool]!", \
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
/obj/item/weapon/kitchenknife = 75, \
|
||||
/obj/item/weapon/shard = 50, \
|
||||
)
|
||||
|
||||
|
||||
can_infect = 1
|
||||
blood_level = 1
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
if (target_zone == "mouth" || target_zone == "eyes")
|
||||
return 0
|
||||
|
||||
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
return affected.open >= 2 && (affected.status & ORGAN_DEAD)
|
||||
@@ -105,7 +105,7 @@
|
||||
/obj/item/weapon/reagent_containers/spray = 50,
|
||||
/obj/item/weapon/reagent_containers/glass/bucket = 50,
|
||||
)
|
||||
|
||||
|
||||
can_infect = 0
|
||||
blood_level = 0
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
if (!istype(tool, /obj/item/weapon/reagent_containers))
|
||||
return 0
|
||||
|
||||
|
||||
var/obj/item/weapon/reagent_containers/container = tool
|
||||
if(!container.reagents.has_reagent("peridaxon"))
|
||||
return 0
|
||||
@@ -125,7 +125,7 @@
|
||||
|
||||
if (target_zone == "mouth" || target_zone == "eyes")
|
||||
return 0
|
||||
|
||||
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected.open == 3 && (affected.status & ORGAN_DEAD)
|
||||
|
||||
@@ -138,34 +138,34 @@
|
||||
|
||||
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
|
||||
if (!istype(tool, /obj/item/weapon/reagent_containers))
|
||||
return
|
||||
|
||||
|
||||
var/obj/item/weapon/reagent_containers/container = tool
|
||||
|
||||
|
||||
var/trans = container.reagents.trans_to(target, container.amount_per_transfer_from_this)
|
||||
if (trans > 0)
|
||||
container.reagents.reaction(target, INGEST) //technically it's contact, but the reagents are being applied to internal tissue
|
||||
|
||||
|
||||
if(container.reagents.has_reagent("peridaxon"))
|
||||
affected.status &= ~ORGAN_DEAD
|
||||
|
||||
|
||||
user.visible_message("\blue [user] applies [trans] units of the solution to affected tissue in [target]'s [affected.display_name]", \
|
||||
"\blue You apply [trans] units of the solution to affected tissue in [target]'s [affected.display_name] with \the [tool].")
|
||||
|
||||
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/datum/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
|
||||
if (!istype(tool, /obj/item/weapon/reagent_containers))
|
||||
return
|
||||
|
||||
|
||||
var/obj/item/weapon/reagent_containers/container = tool
|
||||
|
||||
|
||||
var/trans = container.reagents.trans_to(target, container.amount_per_transfer_from_this)
|
||||
container.reagents.reaction(target, INGEST) //technically it's contact, but the reagents are being applied to internal tissue
|
||||
|
||||
|
||||
user.visible_message("\red [user]'s hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.display_name] with the [tool]!" , \
|
||||
"\red Your hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.display_name] with the [tool]!")
|
||||
|
||||
|
||||
//no damage or anything, just wastes medicine
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
// type path referencing tools that can be used for this step, and how well are they suited for it
|
||||
var/list/allowed_tools = null
|
||||
// type paths referencing mutantraces that this step applies to.
|
||||
// type paths referencing races that this step applies to.
|
||||
var/list/allowed_species = null
|
||||
var/list/disallowed_species = null
|
||||
|
||||
@@ -82,27 +82,30 @@ proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool)
|
||||
return 0
|
||||
if (user.a_intent == "harm") //check for Hippocratic Oath
|
||||
return 0
|
||||
if(M.op_stage.in_progress) //Can't operate on someone repeatedly.
|
||||
user << "\red You can't operate on the patient while surgery is already in progress."
|
||||
var/zone = user.zone_sel.selecting
|
||||
if(zone in M.op_stage.in_progress) //Can't operate on someone repeatedly.
|
||||
user << "\red You can't operate on this area while surgery is already in progress."
|
||||
return 1
|
||||
|
||||
for(var/datum/surgery_step/S in surgery_steps)
|
||||
//check if tool is right or close enough and if this step is possible
|
||||
if(S.tool_quality(tool))
|
||||
var/step_is_valid = S.can_use(user, M, user.zone_sel.selecting, tool)
|
||||
var/step_is_valid = S.can_use(user, M, zone, tool)
|
||||
if(step_is_valid && S.is_valid_target(M))
|
||||
if(step_is_valid == 2) // This is a failure that already has a message for failing.
|
||||
return 1
|
||||
M.op_stage.in_progress = 1
|
||||
S.begin_step(user, M, user.zone_sel.selecting, tool) //start on it
|
||||
M.op_stage.in_progress += zone
|
||||
S.begin_step(user, M, zone, tool) //start on it
|
||||
//We had proper tools! (or RNG smiled.) and user did not move or change hands.
|
||||
if(prob(S.tool_quality(tool)) && do_mob(user, M, rand(S.min_duration, S.max_duration)))
|
||||
S.end_step(user, M, user.zone_sel.selecting, tool) //finish successfully
|
||||
else if (tool in user.contents && user.Adjacent(M)) //or
|
||||
S.fail_step(user, M, user.zone_sel.selecting, tool) //malpractice~
|
||||
S.end_step(user, M, zone, tool) //finish successfully
|
||||
else if ((tool in user.contents) && user.Adjacent(M)) //or
|
||||
S.fail_step(user, M, zone, tool) //malpractice~
|
||||
else // This failing silently was a pain.
|
||||
user << "\red You must remain close to your patient to conduct surgery."
|
||||
M.op_stage.in_progress = 0 // Clear the in-progress flag.
|
||||
M.op_stage.in_progress -= zone // Clear the in-progress flag.
|
||||
if (ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.update_surgery()
|
||||
return 1 //don't want to do weapony things after surgery
|
||||
|
||||
if (user.a_intent == "help")
|
||||
@@ -129,8 +132,6 @@ proc/sort_surgeries()
|
||||
/datum/surgery_status/
|
||||
var/eyes = 0
|
||||
var/face = 0
|
||||
// var/appendix = 0
|
||||
// var/ribcage = 0
|
||||
var/head_reattach = 0
|
||||
var/current_organ = "organ"
|
||||
var/in_progress = 0
|
||||
var/list/in_progress = list()
|
||||
Reference in New Issue
Block a user