Merge pull request #2479 from CHOMPStationBot/upstream-merge-10980

[MIRROR] Expands do_after/do_mob exclusive var to affect target
This commit is contained in:
Nadyr
2021-07-10 01:30:52 -04:00
committed by GitHub
10 changed files with 58 additions and 36 deletions
+11 -11
View File
@@ -176,7 +176,7 @@
playsound(src, WT.usesound, 50, 1)
if(istext(glass))
user.visible_message("[user] welds the [glass] plating off the airlock assembly.", "You start to weld the [glass] plating off the airlock assembly.")
if(do_after(user, 40 * WT.toolspeed))
if(do_after(user, 4 SECONDS * WT.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(!src || !WT.isOn()) return
to_chat(user, "<span class='notice'>You welded the [glass] plating off!</span>")
var/M = text2path("/obj/item/stack/material/[glass]")
@@ -184,14 +184,14 @@
glass = 0
else if(glass == 1)
user.visible_message("[user] welds the glass panel out of the airlock assembly.", "You start to weld the glass panel out of the airlock assembly.")
if(do_after(user, 40 * WT.toolspeed))
if(do_after(user, 4 SECONDS * WT.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(!src || !WT.isOn()) return
to_chat(user, "<span class='notice'>You welded the glass panel out!</span>")
new /obj/item/stack/material/glass/reinforced(src.loc)
glass = 0
else if(!anchored)
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
if(do_after(user, 40 * WT.toolspeed))
if(do_after(user, 4 SECONDS * WT.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(!src || !WT.isOn()) return
to_chat(user, "<span class='notice'>You dissasembled the airlock assembly!</span>")
new /obj/item/stack/material/steel(src.loc, 4)
@@ -207,7 +207,7 @@
else
user.visible_message("[user] begins securing the airlock assembly to the floor.", "You starts securing the airlock assembly to the floor.")
if(do_after(user, 40 * W.toolspeed))
if(do_after(user, 4 SECONDS * W.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(!src) return
to_chat(user, "<span class='notice'>You [anchored? "un" : ""]secured the airlock assembly!</span>")
anchored = !anchored
@@ -218,7 +218,7 @@
to_chat(user, "<span class='warning'>You need one length of coil to wire the airlock assembly.</span>")
return
user.visible_message("[user] wires the airlock assembly.", "You start to wire the airlock assembly.")
if(do_after(user, 40) && state == 0 && anchored)
if(do_after(user, 4 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE) && state == 0 && anchored)
if (C.use(1))
src.state = 1
to_chat(user, "<span class='notice'>You wire the airlock.</span>")
@@ -227,7 +227,7 @@
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
if(do_after(user, 40 * W.toolspeed))
if(do_after(user, 4 SECONDS * W.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(!src) return
to_chat(user, "<span class='notice'>You cut the airlock wires.!</span>")
new/obj/item/stack/cable_coil(src.loc, 1)
@@ -237,7 +237,7 @@
playsound(src, W.usesound, 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.")
if(do_after(user, 40))
if(do_after(user, 4 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE))
if(!src) return
user.drop_item()
W.loc = src
@@ -255,7 +255,7 @@
playsound(src, W.usesound, 100, 1)
user.visible_message("\The [user] starts removing the electronics from the airlock assembly.", "You start removing the electronics from the airlock assembly.")
if(do_after(user, 40 * W.toolspeed))
if(do_after(user, 4 SECONDS * W.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(!src) return
to_chat(user, "<span class='notice'>You removed the airlock electronics!</span>")
src.state = 1
@@ -270,7 +270,7 @@
if(material_name == "rglass")
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
if(do_after(user, 40) && !glass)
if(do_after(user, 4 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE) && !glass)
if (S.use(1))
to_chat(user, "<span class='notice'>You installed reinforced glass windows into the airlock assembly.</span>")
glass = 1
@@ -282,7 +282,7 @@
if(S.get_amount() >= 2)
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
if(do_after(user, 40) && !glass)
if(do_after(user, 4 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE) && !glass)
if (S.use(2))
to_chat(user, "<span class='notice'>You installed [material_display_name(material_name)] plating into the airlock assembly.</span>")
glass = material_name
@@ -291,7 +291,7 @@
playsound(src, W.usesound, 100, 1)
to_chat(user, "<span class='notice'>Now finishing the airlock.</span>")
if(do_after(user, 40 * W.toolspeed))
if(do_after(user, 4 SECONDS * W.toolspeed, src, exclusive = TASK_ALL_EXCLUSIVE))
if(!src) return
to_chat(user, "<span class='notice'>You finish the airlock!</span>")
var/path