mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge remote-tracking branch 'upstream/master' into dev-freeze
Conflicts: code/modules/mob/living/carbon/human/life.dm code/modules/nano/nanomanager.dm code/modules/surgery/surgery.dm
This commit is contained in:
@@ -82,27 +82,27 @@ 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
|
||||
S.end_step(user, M, zone, 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.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()
|
||||
@@ -134,4 +134,4 @@ proc/sort_surgeries()
|
||||
var/face = 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