This commit is contained in:
Zuhayr
2014-10-08 23:10:12 +10:30
parent 1249fb0592
commit 37cb78eefa
33 changed files with 185 additions and 122 deletions
+12 -3
View File
@@ -52,7 +52,10 @@
"\blue You have made a bloodless incision on [target]'s [affected.display_name] with \the [tool].",)
//Could be cleaner ...
affected.open = 1
affected.status |= ORGAN_BLEEDING
if(istype(target) && !(target.species.flags & NO_BLOOD))
affected.status |= ORGAN_BLEEDING
affected.createwound(CUT, 1)
affected.clamp()
spread_germs_to_organ(affected, user)
@@ -89,7 +92,10 @@
user.visible_message("\blue [user] has constructed a prepared incision on and within [target]'s [affected.display_name] with \the [tool].", \
"\blue You have constructed a prepared incision on and within [target]'s [affected.display_name] with \the [tool].",)
affected.open = 1
affected.status |= ORGAN_BLEEDING
if(istype(target) && !(target.species.flags & NO_BLOOD))
affected.status |= ORGAN_BLEEDING
affected.createwound(CUT, 1)
affected.clamp()
affected.open = 2
@@ -128,7 +134,10 @@
user.visible_message("\blue [user] has made an incision on [target]'s [affected.display_name] with \the [tool].", \
"\blue You have made an incision on [target]'s [affected.display_name] with \the [tool].",)
affected.open = 1
affected.status |= ORGAN_BLEEDING
if(istype(target) && !(target.species.flags & NO_BLOOD))
affected.status |= ORGAN_BLEEDING
affected.createwound(CUT, 1)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+9 -9
View File
@@ -327,7 +327,7 @@
O.organ_data.rejecting = null
// Transfer over some blood data, if the organ doesn't have data.
var/datum/reagent/blood/organ_blood = O.reagents.reagent_list["blood"]
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)
@@ -367,32 +367,32 @@
if(!target.species)
user << "\red You have no idea what species this person is. Report this on the bug tracker."
return 0
return 2
var/o_is = (O.gender == PLURAL) ? "are" : "is"
var/o_a = (O.gender == PLURAL) ? "" : " a"
var/o_a = (O.gender == PLURAL) ? "" : "a "
var/o_do = (O.gender == PLURAL) ? "don't" : "doesn't"
if(target.species.has_organ[O.organ_tag])
if(!O.health)
user << "\red \The [O.organ_tag] [o_is] in no state to be transplanted."
return 0
return 2
if(!target.internal_organs_by_name[O.organ_tag])
organ_missing = 1
else
user << "\red \The [target] already has [o_a][O.organ_tag]."
return 0
return 2
if(O.organ_data && affected.name == O.organ_data.parent_organ)
organ_compatible = 1
else
user << "\red \The [O.organ_tag] [o_do] normally go in \the [affected.display_name]."
return 0
return 2
else
user << "\red \A [target.species.name] doesn't normally have [o_a][O.organ_tag]."
return 0
user << "\red You're pretty sure [target.species.name_plural] don't normally have [o_a][O.organ_tag]."
return 2
return ..() && organ_missing && organ_compatible
@@ -412,7 +412,7 @@
if(istype(O))
var/datum/reagent/blood/transplant_blood = O.reagents.reagent_list["blood"]
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
+25 -12
View File
@@ -77,21 +77,34 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
E.germ_level = max(germ_level,E.germ_level) //as funny as scrubbing microbes out with clean gloves is - no.
proc/do_surgery(mob/living/M, mob/living/user, obj/item/tool)
if(!istype(M,/mob/living/carbon))
proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool)
if(!istype(M))
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."
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) && S.can_use(user, M, user.zone_sel.selecting, tool) && S.is_valid_target(M))
S.begin_step(user, M, user.zone_sel.selecting, 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~
return 1 //don't want to do weapony things after surgery
if(S.tool_quality(tool))
var/step_is_valid = S.can_use(user, M, user.zone_sel.selecting, 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
//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~
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.
return 1 //don't want to do weapony things after surgery
if (user.a_intent == "help")
user << "\red You can't see any useful way to use [tool] on [M]."
return 1
@@ -116,6 +129,6 @@ proc/sort_surgeries()
/datum/surgery_status/
var/eyes = 0
var/face = 0
var/appendix = 0
var/head_reattach = 0
var/current_organ
var/current_organ = "organ"
var/in_progress = 0