This commit is contained in:
timothyteakettle
2020-07-18 02:29:12 +01:00
parent 8bb9b11922
commit e8fade4f7f
35 changed files with 861 additions and 76 deletions
+23 -3
View File
@@ -166,6 +166,8 @@
var/target_loc = target.loc
LAZYADD(user.do_afters, target)
var/holding = user.get_active_held_item()
var/datum/progressbar/progbar
if (progress)
@@ -183,6 +185,9 @@
break
if(uninterruptible)
continue
if(!(target in user.do_afters))
. = FALSE
break
if(drifting && !user.inertia_dir)
drifting = 0
@@ -191,9 +196,10 @@
if((!drifting && user.loc != user_loc) || target.loc != target_loc || (!ignorehelditem && user.get_active_held_item() != holding) || user.incapacitated() || user.lying || (extra_checks && !extra_checks.Invoke()))
. = 0
break
if (progress)
if(progress)
qdel(progbar)
if(!QDELETED(target))
LAZYREMOVE(user.do_afters, target)
//some additional checks as a callback for for do_afters that want to break on losing health or on the mob taking action
/mob/proc/break_do_after_checks(list/checked_health, check_clicks)
@@ -216,6 +222,9 @@
if(target && !isturf(target))
Tloc = target.loc
if(target)
LAZYADD(user.do_afters, target)
var/atom/Uloc = user.loc
var/drifting = 0
@@ -260,6 +269,10 @@
. = 0
break
if(target && !(target in user.do_afters))
. = FALSE
break
if(needhand)
//This might seem like an odd check, but you can still need a hand even when it's empty
//i.e the hand is used to pull some item/tool out of the construction
@@ -270,8 +283,10 @@
if(user.get_active_held_item() != holding)
. = 0
break
if (progress)
if(progress)
qdel(progbar)
if(!QDELETED(target))
LAZYREMOVE(user.do_afters, target)
/mob/proc/do_after_coefficent() // This gets added to the delay on a do_after, default 1
. = 1
@@ -291,6 +306,7 @@
var/list/originalloc = list()
for(var/atom/target in targets)
originalloc[target] = target.loc
LAZYADD(user.do_afters, target)
var/holding = user.get_active_held_item()
var/datum/progressbar/progbar
@@ -321,3 +337,7 @@
break mainloop
if(progbar)
qdel(progbar)
for(var/thing in targets)
var/atom/target = thing
if(!QDELETED(target))
LAZYREMOVE(user.do_afters, target)