mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 11:38:12 +01:00
Axes do_mob and replaces with do_after (#18739)
* moooore do_afters * theese * Failsafe * Update human_attackhand.dm
This commit is contained in:
@@ -216,8 +216,10 @@
|
||||
|
||||
/datum/surgery_step/cavity/implant_removal/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
|
||||
|
||||
if (affected.implants.len)
|
||||
var/range = 1
|
||||
if(tool)
|
||||
range = tool.reach
|
||||
if(affected.implants.len)
|
||||
|
||||
var/obj/item/obj = tgui_input_list(user, "Which embedded item do you wish to remove?", "Surgery Select", affected.implants)
|
||||
if(isnull(obj)) //They clicked cancel.
|
||||
@@ -225,7 +227,7 @@
|
||||
span_notice("You take \the [tool] out of the incision on [target]'s [affected.name].") )
|
||||
user.balloon_alert_visible("Takes \the [tool] out of [target]'s [affected.name]", "\the [tool] taken out of the incison on \the [affected.name]")
|
||||
return
|
||||
if(!do_mob(user, target, 1)) //They moved away
|
||||
if(!do_after(user, 1, target, max_distance = range, hidden = TRUE))
|
||||
to_chat(user, span_warning("You must remain close to and keep focused on your patient to conduct surgery."))
|
||||
user.visible_message(span_notice("[user] fails to remove anything from [target]'s [affected.name] with \the [tool]!"), \
|
||||
span_notice("You fail to remove the [obj] from [target]'s [affected.name]s with \the [tool]!") )
|
||||
@@ -234,11 +236,11 @@
|
||||
|
||||
if(istype(obj,/obj/item/implant))
|
||||
var/obj/item/implant/imp = obj
|
||||
if (!imp.islegal()) //ILLEGAL IMPLANT ALERT!!!!!!!!!!
|
||||
if(!imp.islegal()) //ILLEGAL IMPLANT ALERT!!!!!!!!!!
|
||||
user.visible_message(span_notice("[user] seems to be intently working on something within [target]'s [affected.name] with \the [tool]!"), \
|
||||
span_notice("You intently begin to take [obj] out of the incision on [target]'s [affected.name]s with \the [tool]!") )
|
||||
user.balloon_alert_visible("intently works on something within [target]'s [affected.name]", "intently taking \the [obj] out of the incision in \the [affected.name]")
|
||||
if(!do_after(user, min_duration, target))
|
||||
if(!do_after(user, min_duration, target, max_distance = range))
|
||||
user.visible_message(span_notice("[user] fails to remove anything from [target]'s [affected.name] with \the [tool]!"), \
|
||||
span_notice("You fail to remove the [obj] from [target]'s [affected.name]s with \the [tool]!") )
|
||||
user.balloon_alert_visible("fails to remove anything from [target]'s [affected.name]", "failed to remove \the [obj] from \the [affected.name]")
|
||||
@@ -268,8 +270,10 @@
|
||||
if(istype(obj,/obj/item/implant))
|
||||
var/obj/item/implant/imp = obj
|
||||
imp.imp_in = null
|
||||
imp.implanted = 0
|
||||
else if(istype(tool,/obj/item/nif)){var/obj/item/nif/N = tool;N.unimplant(target)} //VOREStation Add - NIF support
|
||||
imp.implanted = FALSE
|
||||
else if(istype(tool,/obj/item/nif))
|
||||
var/obj/item/nif/N = tool
|
||||
N.unimplant(target)
|
||||
else
|
||||
user.visible_message(span_notice("[user] could not find anything inside [target]'s [affected.name], and pulls \the [tool] out."), \
|
||||
span_notice("You could not find anything inside [target]'s [affected.name].") )
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
// Not staying still fails you too.
|
||||
if(success)
|
||||
var/calc_duration = rand(selected_surgery.min_duration, selected_surgery.max_duration)
|
||||
if(!do_mob(user, M, calc_duration * toolspeed, zone, exclusive = TRUE))
|
||||
if(!do_after(user, calc_duration * toolspeed, M, target_zone = zone, max_distance = reach))
|
||||
success = FALSE
|
||||
to_chat(user, span_warning("You must remain close to and keep focused on your patient to conduct surgery."))
|
||||
user.balloon_alert(user, "you must stay focused on your patient!")
|
||||
|
||||
Reference in New Issue
Block a user