Progress bars + Wall Rationalization

This commit does the following:
 - Ports progress bars from -tg- (tgstation/-tg-station#9921)
 - Refactors wall attackby code to make it 100% less insane; Instead of
   manually checking every little thing, it uses do_after,
   consequentially, making the new progress bars affect dealing with walls
   as well.

Wall code makes a tiger sad.
This commit is contained in:
Tigercat2000
2015-08-31 13:38:51 -07:00
parent 18bf116b86
commit 7f4ac72910
139 changed files with 458 additions and 464 deletions
+1 -1
View File
@@ -85,7 +85,7 @@
else if(graffiti.Find(drawtype))
temp = "graffiti"
user << "You start drawing a [temp] on the [target.name]."
if(instant || do_after(user, 50))
if(instant || do_after(user, 50, target = target))
new /obj/effect/decal/cleanable/crayon(target,colour,drawtype,temp)
user << "You finish drawing [temp]."
if(uses)
@@ -84,7 +84,7 @@
user << "<span class='warning'>You can't see the box well enough to cut the wires out.</span>"
return
user.visible_message("<span class='notice'>[user] starts removing the payload and wires from \the [src].</span>")
if(do_after(user, 40))
if(do_after(user, 40, target = src))
playsound(src, 'sound/items/Wirecutter.ogg', 50, 1, 1)
user.unEquip(src)
user.visible_message("<span class='notice'>[user] removes the insides of \the [src]!</span>")
@@ -76,7 +76,7 @@
if(iswirecutter(W) && b_stat && wires.IsAllCut())
user << "<span class='notice'>You cut out the intercoms wiring and disconnect its electronics.</span>"
playsound(get_turf(src), 'sound/items/Wirecutter.ogg', 50, 1)
if(do_after(user, 10))
if(do_after(user, 10, target = src))
new /obj/item/stack/cable_coil(get_turf(src),5)
on = 0
b_stat = 1
@@ -88,7 +88,7 @@
if(2)
if(isscrewdriver(W))
playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 10))
if(do_after(user, 10, target = src))
update_icon()
on = 1
b_stat = 0
@@ -105,7 +105,7 @@
if(coil.amount < 5)
user << "<span class='warning'>You need more cable for this!</span>"
return
if(do_after(user, 10))
if(do_after(user, 10, target = src))
coil.use(5)
user << "<span class='notice'>You wire \the [src]!</span>"
buildstage = 2
@@ -113,7 +113,7 @@
if(iscrowbar(W))
user << "<span class='notice'>You begin removing the electronics...</span>"
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 10))
if(do_after(user, 10, target = src))
new /obj/item/weapon/intercom_electronics(get_turf(src))
user << "<span class='notice'>The circuitboard pops out!</span>"
buildstage = 0
@@ -121,7 +121,7 @@
if(0)
if(istype(W,/obj/item/weapon/intercom_electronics))
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 10))
if(do_after(user, 10, target = src))
qdel(W)
user << "<span class='notice'>You insert \the [W] into \the [src]!</span>"
buildstage = 1
@@ -132,7 +132,7 @@
if(!WT.remove_fuel(3, user))
user << "<span class='warning'>You're out of welding fuel.</span>"
return 1
if(do_after(user, 10))
if(do_after(user, 10, target = src))
user << "<span class='notice'>You cut the intercom frame from the wall!</span>"
new /obj/item/mounted/frame/intercom(get_turf(src))
qdel(src)
@@ -292,7 +292,7 @@
/obj/item/device/tape/attackby(obj/item/I, mob/user)
if(ruined && istype(I, /obj/item/weapon/screwdriver))
user << "<span class='notice'>You start winding the tape back in.</span>"
if(do_after(user, 120))
if(do_after(user, 120, target = src))
user << "<span class='notice'>You wound the tape back in!</span>"
fix()
@@ -11,7 +11,7 @@
playsound(get_turf(src), 'sound/machines/click.ogg', 75, 1)
var/constrdir = user.dir
var/constrloc = get_turf(user)
if (!do_after(user, 30))
if (!do_after(user, 30, target = src))
return
var/obj/machinery/light_construct/newlight
switch(fixture_type)
+1 -1
View File
@@ -246,7 +246,7 @@
user << "\red You can't apply a splint to the arm you're using!"
return
user.visible_message("\red [user] starts to apply \the [src] to their [limb].", "\red You start to apply \the [src] to your [limb].", "\red You hear something being wrapped.")
if(do_after(user, 50))
if(do_after(user, 50, target = M))
if (M != user)
user.visible_message("\red [user] finishes applying \the [src] to [M]'s [limb].", "\red You finish applying \the [src] to [M]'s [limb].", "\red You hear something being wrapped.")
else
+1 -1
View File
@@ -72,7 +72,7 @@
return
usr << "\blue Assembling grille..."
if (!do_after(usr, 10))
if (!do_after(usr, 10, target = src))
return
var /obj/structure/grille/F = new /obj/structure/grille/ ( usr.loc )
@@ -98,7 +98,7 @@
//visible message on mobs is defined as visible_message(var/message, var/self_message, var/blind_message)
usr.visible_message("\blue \the [usr] starts cutting hair off \the [src]", "\blue You start cutting the hair off \the [src]", "You hear the sound of a knife rubbing against flesh")
if(do_after(user,50))
if(do_after(user,50, target = src))
usr << "\blue You cut the hair from this [src.singular_name]"
//Try locating an exisitng stack on the tile and add to there if possible
for(var/obj/item/stack/sheet/hairlesshide/HS in usr.loc)
+1 -1
View File
@@ -131,7 +131,7 @@
return
if (R.time)
usr << "\blue Building [R.title] ..."
if (!do_after(usr, R.time))
if (!do_after(usr, R.time, target = src))
return
if (src.amount < R.req_amount*multiplier)
return
+1 -1
View File
@@ -1309,7 +1309,7 @@ obj/item/toy/cards/deck/syndicate/black
/obj/item/toy/minigibber/attackby(var/obj/O, var/mob/user, params)
if(istype(O,/obj/item/toy/character) && O.loc == user)
user << "<span class='notice'>You start feeding \the [O] \icon[O] into \the [src]'s mini-input.</span>"
if(do_after(user,10))
if(do_after(user,10, target = src))
if(O.loc != user)
user << "<span class='alert'>\The [O] is too far away to feed into \the [src]!</span>"
else
+7 -7
View File
@@ -34,12 +34,12 @@ RCD
spark_system.attach(src)
rcd_list += src
return
Destroy()
qdel(spark_system)
spark_system = null
rcd_list -= src
return ..()
return ..()
attackby(obj/item/weapon/W, mob/user, params)
..()
@@ -105,7 +105,7 @@ RCD
if(checkResource(3, user))
user << "Building Wall ..."
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 20))
if(do_after(user, 20, target = A))
if(!useResource(3, user)) return 0
activate()
A:ChangeTurf(/turf/simulated/wall)
@@ -117,7 +117,7 @@ RCD
if(checkResource(10, user))
user << "Building Airlock..."
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 50))
if(do_after(user, 50, target = A))
if(!useResource(10, user)) return 0
activate()
var/obj/machinery/door/airlock/T = new /obj/machinery/door/airlock( A )
@@ -133,7 +133,7 @@ RCD
if(checkResource(5, user))
user << "Deconstructing Wall..."
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 40))
if(do_after(user, 40, target = A))
if(!useResource(5, user)) return 0
activate()
A:ChangeTurf(/turf/simulated/floor/plating)
@@ -144,7 +144,7 @@ RCD
if(checkResource(5, user))
user << "Deconstructing Floor..."
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 50))
if(do_after(user, 50, target = A))
if(!useResource(5, user)) return 0
activate()
A:ChangeTurf(/turf/space)
@@ -155,7 +155,7 @@ RCD
if(checkResource(20, user))
user << "Deconstructing Airlock..."
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 50))
if(do_after(user, 50, target = A))
if(!useResource(20, user)) return 0
activate()
qdel(A)
@@ -61,12 +61,12 @@
user << "<span class='notice'>You need to take that [target.name] off before cleaning it.</span>"
else if(istype(target,/obj/effect/decal/cleanable))
user.visible_message("<span class='warning'>[user] begins to scrub \the [target.name] out with [src].</span>")
if(do_after(user, src.cleanspeed) && target)
if(do_after(user, src.cleanspeed, target = target) && target)
user << "<span class='notice'>You scrub \the [target.name] out.</span>"
qdel(target)
else
user.visible_message("<span class='warning'>[user] begins to clean \the [target.name] with [src].</span>")
if(do_after(user, src.cleanspeed))
if(do_after(user, src.cleanspeed, target = target))
user << "<span class='notice'>You clean \the [target.name].</span>"
var/obj/effect/decal/cleanable/C = locate() in target
qdel(C)
+5 -5
View File
@@ -59,7 +59,7 @@
else
user.visible_message("<span class='warning'>[user] begins to do [H]'s lips with \the [src].</span>", \
"<span class='notice'>You begin to apply \the [src].</span>")
if(do_after(user, 20) && do_after(H, 20, 5, 0)) //user needs to keep their active hand, H does not.
if(do_after(user, 20, target = H) && do_after(H, 20, 5, 0)) //user needs to keep their active hand, H does not.
user.visible_message("<span class='notice'>[user] does [H]'s lips with \the [src].</span>", \
"<span class='notice'>You apply \the [src].</span>")
H.lip_style = "lipstick"
@@ -89,7 +89,7 @@
if(H == user) //shaving yourself
user.visible_message("<span class='notice'>[user] starts to shave their facial hair with \the [src].</span>", \
"<span class='notice'>You take a moment shave your facial hair with \the [src].</span>")
if(do_after(user, 50))
if(do_after(user, 50, target = H))
user.visible_message("<span class='notice'>[user] shaves his facial hair clean with the [src].</span>", \
"<span class='notice'>You finish shaving with the [src]. Fast and clean!</span>")
H.f_style = "Shaved"
@@ -100,7 +100,7 @@
var/turf/H_loc = H.loc
user.visible_message("<span class='danger'>[user] tries to shave [H]'s facial hair with \the [src].</span>", \
"<span class='warning'>You start shaving [H]'s facial hair.</span>")
if(do_after(user, 50))
if(do_after(user, 50, target = H))
if(user_loc == user.loc && H_loc == H.loc)
user.visible_message("<span class='danger'>[user] shaves off [H]'s facial hair with \the [src].</span>", \
"<span class='notice'>You shave [H]'s facial hair clean off.</span>")
@@ -117,7 +117,7 @@
if(H == user) //shaving yourself
user.visible_message("<span class='warning'>[user] starts to shave their head with \the [src].</span>", \
"<span class='warning'>You start to shave your head with \the [src].</span>")
if(do_after(user, 50))
if(do_after(user, 50, target = H))
user.visible_message("<span class='notice'>[user] shaves his head with the [src].</span>", \
"<span class='notice'>You finish shaving with the [src].</span>")
H.h_style = "Skinhead"
@@ -128,7 +128,7 @@
var/turf/H_loc = H.loc
user.visible_message("<span class='danger'>[user] tries to shave [H]'s head with \the [src]!</span>", \
"<span class='warning'>You start shaving [H]'s head.</span>")
if(do_after(user, 50))
if(do_after(user, 50, target = H))
if(user_loc == user.loc && H_loc == H.loc)
user.visible_message("<span class='danger'>[user] shaves [H]'s head bald with \the [src]!</span>", \
"<span class='warning'>You shave [H]'s head bald.</span>")
+4 -4
View File
@@ -340,7 +340,7 @@
user.visible_message("<span class='warning'>[user] begins to place [src] on [M.name]'s chest.</span>", "<span class='warning'>You begin to place [src] on [M.name]'s chest.</span>")
busy = 1
update_icon()
if(do_after(user, 30)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process
if(do_after(user, 30, target = M)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process
user.visible_message("<span class='notice'>[user] places [src] on [M.name]'s chest.</span>", "<span class='warning'>You place [src] on [M.name]'s chest.</span>")
playsound(get_turf(src), 'sound/machines/defib_charge.ogg', 50, 0)
var/mob/dead/observer/ghost = H.get_ghost()
@@ -349,7 +349,7 @@
var/tloss = 3000 //brain damage starts setting in on the patient after some time left rotting
var/total_burn = 0
var/total_brute = 0
if(do_after(user, 20)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total
if(do_after(user, 20, target = M)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total
for(var/obj/item/carried_item in H.contents)
if(istype(carried_item, /obj/item/clothing/suit/space))
if(!defib.combat)
@@ -459,7 +459,7 @@
user.visible_message("<span class='warning'>[user] begins to place [src] on [M.name]'s chest.</span>", "<span class='warning'>You begin to place [src] on [M.name]'s chest.</span>")
busy = 1
update_icon()
if(do_after(user, 30)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process
if(do_after(user, 30, target = M)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process
user.visible_message("<span class='notice'>[user] places [src] on [M.name]'s chest.</span>", "<span class='warning'>You place [src] on [M.name]'s chest.</span>")
playsound(get_turf(src), 'sound/machines/defib_charge.ogg', 50, 0)
var/mob/dead/observer/ghost = H.get_ghost()
@@ -468,7 +468,7 @@
var/tloss = 3000 //brain damage starts setting in on the patient after some time left rotting
var/total_burn = 0
var/total_brute = 0
if(do_after(user, 20)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total
if(do_after(user, 20, target = M)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total
if(H.stat == 2)
var/health = H.health
M.visible_message("<span class='warning'>[M]'s body convulses a bit.")
@@ -72,7 +72,7 @@
return
user << "Planting explosives..."
if(do_after(user, 50) && in_range(user, target))
if(do_after(user, 50, target = target) && in_range(user, target))
user.drop_item()
src.target = target
loc = null
@@ -27,7 +27,7 @@
O.show_message("\red [user] is attemping to implant [M].", 1)
var/turf/T1 = get_turf(M)
if (T1 && ((M == user) || do_after(user, 50)))
if (T1 && ((M == user) || do_after(user, 50, target = M)))
if(user && M && (get_turf(M) == T1) && src && src.imp)
for (var/mob/O in viewers(M, null))
O.show_message("\red [M] has been implanted by [user].", 1)
+1 -1
View File
@@ -44,7 +44,7 @@
if(istype(turf))
user.visible_message("<span class='warning'>[user] begins to clean \the [turf] with [src].</span>")
if(do_after(user, mopspeed))
if(do_after(user, mopspeed, target = src))
clean(turf)
user << "<span class='notice'>You have finished mopping!</span>"
@@ -454,7 +454,7 @@
user.visible_message("\red [user.name] is trying to strap a belt to [target.name]!")
if(do_after(user, 50) && in_range(user, target))
if(do_after(user, 50, target = target) && in_range(user, target))
user.drop_item()
target = target
loc = null
@@ -38,14 +38,14 @@
emag_act(user, W)
if (istype(W, /obj/item/weapon/screwdriver))
if (do_after(user, 20))
if (do_after(user, 20, target = src))
src.open =! src.open
user.show_message(text("\blue You [] the service panel.", (src.open ? "open" : "close")))
return
if ((istype(W, /obj/item/device/multitool)) && (src.open == 1)&& (!src.l_hacking))
user.show_message(text("\red Now attempting to reset internal memory, please hold."), 1)
src.l_hacking = 1
if (do_after(usr, 100))
if (do_after(usr, 100, target = src))
if (prob(40))
src.l_setshort = 1
src.l_set = 0
+1 -1
View File
@@ -72,7 +72,7 @@
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
climber = user
if(!do_after(user,50))
if(!do_after(user,50, target = src))
climber = null
return
@@ -25,7 +25,7 @@
if(istype(O, /obj/item/device/multitool))
user << "\red Resetting circuitry..."
playsound(user, 'sound/machines/lockreset.ogg', 50, 1)
if(do_after(user, 20))
if(do_after(user, 20, target = src))
src.locked = 0
user << "<span class = 'caution'> You disable the locking modules.</span>"
update_icon()
@@ -89,7 +89,7 @@
src.locked = 1
user << "\blue You re-enable the locking modules."
playsound(user, 'sound/machines/lockenable.ogg', 50, 1)
if(do_after(user,20))
if(do_after(user,20, target = src))
src.locked = 1
user << "<span class = 'caution'> You re-enable the locking modules.</span>"
return
+11 -11
View File
@@ -155,7 +155,7 @@ obj/structure/door_assembly
playsound(src.loc, 'sound/items/Welder2.ogg', 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))
if(do_after(user, 40, target = src))
if(!src || !WT.isOn()) return
user << "\blue You welded the [glass] plating off!"
var/M = text2path("/obj/item/stack/sheet/mineral/[glass]")
@@ -163,14 +163,14 @@ obj/structure/door_assembly
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))
if(do_after(user, 40, target = src))
if(!src || !WT.isOn()) return
user << "\blue You welded the glass panel out!"
new /obj/item/stack/sheet/rglass(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))
if(do_after(user, 40, target = src))
if(!src || !WT.isOn()) return
user << "\blue You dissasembled the airlock assembly!"
new /obj/item/stack/sheet/metal(src.loc, 4)
@@ -186,7 +186,7 @@ obj/structure/door_assembly
else
user.visible_message("[user] secures the airlock assembly to the floor.", "You start to secure the airlock assembly to the floor.")
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src) return
user << "\blue You [anchored? "un" : ""]secured the airlock assembly!"
anchored = !anchored
@@ -194,7 +194,7 @@ obj/structure/door_assembly
else if(istype(W, /obj/item/stack/cable_coil) && state == 0 && anchored )
var/obj/item/stack/cable_coil/coil = W
user.visible_message("[user] wires the airlock assembly.", "You start to wire the airlock assembly.")
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src) return
coil.use(1)
src.state = 1
@@ -204,7 +204,7 @@ obj/structure/door_assembly
playsound(src.loc, 'sound/items/Wirecutter.ogg', 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))
if(do_after(user, 40, target = src))
if(!src) return
user << "\blue You cut the airlock wires.!"
new/obj/item/stack/cable_coil(src.loc, 1)
@@ -216,7 +216,7 @@ obj/structure/door_assembly
user.drop_item()
W.loc = src
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src) return
user << "\blue You installed the airlock electronics!"
src.state = 2
@@ -229,7 +229,7 @@ obj/structure/door_assembly
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to install electronics into the airlock assembly.")
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src) return
user << "\blue You removed the airlock electronics!"
src.state = 1
@@ -249,7 +249,7 @@ obj/structure/door_assembly
if(istype(S, /obj/item/stack/sheet/rglass))
playsound(src.loc, '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))
if(do_after(user, 40, target = src))
user << "\blue You installed reinforced glass windows into the airlock assembly!"
S.use(1)
glass = 1
@@ -258,7 +258,7 @@ obj/structure/door_assembly
if(S.amount>=2)
playsound(src.loc, '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))
if(do_after(user, 40, target = src))
user << "\blue You installed [M] plating into the airlock assembly!"
S.use(2)
glass = "[M]"
@@ -267,7 +267,7 @@ obj/structure/door_assembly
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user << "\blue Now finishing the airlock."
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src) return
user << "\blue You finish the airlock!"
var/path
+11 -11
View File
@@ -11,7 +11,7 @@
if(anchored && !istype(src,/obj/structure/girder/displaced))
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user << "\blue Now disassembling the girder"
if(do_after(user,40))
if(do_after(user,40, target = src))
if(!src) return
user << "\blue You dissasembled the girder!"
new /obj/item/stack/sheet/metal(get_turf(src))
@@ -26,7 +26,7 @@
else if(istype(W, /obj/item/weapon/gun/energy/plasmacutter))
user << "\blue Now slicing apart the girder"
if(do_after(user,30))
if(do_after(user,30, target = src))
if(!src) return
user << "\blue You slice apart the girder!"
new /obj/item/stack/sheet/metal(get_turf(src))
@@ -40,7 +40,7 @@
else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 && istype(src,/obj/structure/girder/reinforced))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user << "\blue Now unsecuring support struts"
if(do_after(user,40))
if(do_after(user,40, target = src))
if(!src) return
user << "\blue You unsecured the support struts!"
state = 1
@@ -48,7 +48,7 @@
else if(istype(W, /obj/item/weapon/wirecutters) && istype(src,/obj/structure/girder/reinforced) && state == 1)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user << "\blue Now removing support struts"
if(do_after(user,40))
if(do_after(user,40, target = src))
if(!src) return
user << "\blue You removed the support struts!"
new/obj/structure/girder( src.loc )
@@ -57,7 +57,7 @@
else if(istype(W, /obj/item/weapon/crowbar) && state == 0 && anchored )
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user << "\blue Now dislodging the girder"
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src) return
user << "\blue You dislodged the girder!"
new/obj/structure/girder/displaced( src.loc )
@@ -78,7 +78,7 @@
else
if(S.amount < 2) return ..()
user << "\blue Now adding plating..."
if (do_after(user,40))
if (do_after(user,40, target = src))
if(!src || !S || S.amount < 2) return
S.use(2)
user << "\blue You added the plating!"
@@ -100,7 +100,7 @@
if (src.icon_state == "reinforced") //I cant believe someone would actually write this line of code...
if(S.amount < 1) return ..()
user << "\blue Now finalising reinforced wall."
if(do_after(user, 50))
if(do_after(user, 50, target = src))
if(!src || !S || S.amount < 1) return
S.use(1)
user << "\blue Wall fully reinforced!"
@@ -113,7 +113,7 @@
else
if(S.amount < 1) return ..()
user << "\blue Now reinforcing girders"
if (do_after(user,60))
if (do_after(user,60, target = src))
if(!src || !S || S.amount < 1) return
S.use(1)
user << "\blue Girders reinforced!"
@@ -133,7 +133,7 @@
else
if(S.amount < 2) return ..()
user << "\blue Now adding plating..."
if (do_after(user,40))
if (do_after(user,40, target = src))
if(!src || !S || S.amount < 2) return
S.use(2)
user << "\blue You added the plating!"
@@ -214,13 +214,13 @@
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user << "\blue Now disassembling the girder"
if(do_after(user,40))
if(do_after(user,40, target = src))
user << "\blue You dissasembled the girder!"
dismantle()
else if(istype(W, /obj/item/weapon/gun/energy/plasmacutter))
user << "\blue Now slicing apart the girder"
if(do_after(user,30))
if(do_after(user,30, target = src))
user << "\blue You slice apart the girder!"
dismantle()
+1 -1
View File
@@ -174,7 +174,7 @@
user << "<span class='notice'>There is already a window facing this way there.</span>"
return
user << "<span class='notice'>You start placing the window.</span>"
if(do_after(user,20))
if(do_after(user,20, target = src))
if(!src) return //Grille destroyed while waiting
for(var/obj/structure/window/WINDOW in loc)
if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
+1 -1
View File
@@ -484,7 +484,7 @@
user << "<span class='notice'>[src] can't hold any more signs.</span>"
else if(istype(I, /obj/item/weapon/crowbar))
user.visible_message("<span class='warning'>[user] begins to empty the contents of [src].</span>")
if(do_after(user, 30))
if(do_after(user, 30, target = src))
usr << "<span class='notice'>You empty the contents of [src]'s bucket onto the floor.</span>"
reagents.reaction(src.loc)
src.reagents.clear_reagents()
@@ -112,7 +112,7 @@
if(istype(W,/obj/item/weapon/pickaxe))
var/obj/item/weapon/pickaxe/digTool = W
user << "You start digging the [name]."
if(do_after(user,digTool.digspeed*hardness) && src)
if(do_after(user,digTool.digspeed*hardness, target = src) && src)
user << "You finished digging."
Dismantle()
else if(istype(W,/obj/item/weapon)) //not sure, can't not just weapons get passed to this proc?
+2 -2
View File
@@ -337,7 +337,7 @@
if (!anchored && !isinspace())
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "<span class='notice'> You begin to tighten \the [src] to the floor...</span>"
if (do_after(user, 20))
if (do_after(user, 20, target = src))
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
"<span class='notice'> You have tightened \the [src]'s casters. Now it can be played again.</span>", \
@@ -346,7 +346,7 @@
else if(anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "<span class='notice'> You begin to loosen \the [src]'s casters...</span>"
if (do_after(user, 40))
if (do_after(user, 40, target = src))
user.visible_message( \
"[user] loosens \the [src]'s casters.", \
"<span class='notice'> You have loosened \the [src]. Now it can be pulled somewhere else.</span>", \
+5 -5
View File
@@ -420,7 +420,7 @@
if (istype(W, /obj/item/weapon/wrench))
user << "\blue Now disassembling table"
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user,50))
if(do_after(user,50, target = src))
destroy()
return
@@ -696,7 +696,7 @@
var/obj/item/stack/sheet/glass/G = I
if(G.amount >= 2)
user << "<span class='notice'>You start to add the glass to \the [src].</span>"
if(do_after(user, 10))
if(do_after(user, 10, target = src))
G.use(2)
user << "<span class='notice'>You add the glass to \the [src].</span>"
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
@@ -709,7 +709,7 @@
if(iswrench(I))
user << "<span class='notice'>You start to deconstruct \the [src].</span>"
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
if(do_after(user, 10))
if(do_after(user, 10, target = src))
playsound(src.loc, 'sound/items/Deconstruct.ogg', 75, 1)
user << "<span class='notice'>You dismantle \the [src].</span>"
new /obj/item/stack/sheet/metal(loc)
@@ -816,14 +816,14 @@
if(src.status == 2)
user << "\blue Now weakening the reinforced table"
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
if (do_after(user, 50))
if (do_after(user, 50, target = src))
if(!src || !WT.isOn()) return
user << "\blue Table weakened"
src.status = 1
else
user << "\blue Now strengthening the reinforced table"
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
if (do_after(user, 50))
if (do_after(user, 50, target = src))
if(!src || !WT.isOn()) return
user << "\blue Table strengthened"
src.status = 2
@@ -53,7 +53,7 @@
else if(icon_state == "open")
if(pod.contents.len && user.loc != pod)
user.visible_message("<span class='warning'>[user] starts emptying [pod]'s contents onto the floor!</span>")
if(do_after(user, 40)) //So it doesn't default to close_animation() on fail
if(do_after(user, 40, target = src)) //So it doesn't default to close_animation() on fail
if(pod.loc == loc)
for(var/atom/movable/AM in pod)
AM.loc = get_turf(user)
@@ -73,7 +73,7 @@
var/mob/GM = G.affecting
for(var/obj/structure/transit_tube_pod/pod in loc)
pod.visible_message("<span class='warning'>[user] starts putting [GM] into the [pod]!</span>")
if(do_after(user, 60) && GM && G && G.affecting == GM)
if(do_after(user, 60, target = GM) && GM && G && G.affecting == GM)
GM.Weaken(5)
src.Bumped(GM)
qdel(G)
+3 -3
View File
@@ -46,7 +46,7 @@
if(istype(I, /obj/item/weapon/crowbar))
user << "<span class='notice'>You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"].</span>"
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
if(do_after(user, 30))
if(do_after(user, 30, target = src))
user.visible_message("<span class='notice'>[user] [cistern ? "replaces the lid on the cistern" : "lifts the lid off the cistern"]!</span>", "<span class='notice'>You [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]!</span>", "You hear grinding porcelain.")
cistern = !cistern
update_icon()
@@ -65,7 +65,7 @@
if(open && !swirlie)
user.visible_message("<span class='danger'>[user] starts to give [GM.name] a swirlie!</span>", "<span class='notice'>You start to give [GM.name] a swirlie!</span>")
swirlie = GM
if(do_after(user, 30, 5, 0))
if(do_after(user, 30, 5, 0, target = src))
user.visible_message("<span class='danger'>[user] gives [GM.name] a swirlie!</span>", "<span class='notice'>You give [GM.name] a swirlie!</span>", "You hear a toilet flushing.")
if(!GM.internal)
GM.adjustOxyLoss(5)
@@ -156,7 +156,7 @@
user << "<span class='notice'>The water temperature seems to be [watertemp].</span>"
if(istype(I, /obj/item/weapon/wrench))
user << "<span class='notice'>You begin to adjust the temperature valve with the [I].</span>"
if(do_after(user, 50))
if(do_after(user, 50, target = src))
switch(watertemp)
if("normal")
watertemp = "freezing"
@@ -80,7 +80,7 @@ obj/structure/windoor_assembly/Destroy()
user.visible_message("<span class='warning'>[user] dissassembles the windoor assembly.</span>", "<span class='notice'>You start to dissassemble the windoor assembly.</span>")
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src || !WT.isOn()) return
user << "<span class='notice'>You dissasembled the windoor assembly!</span>"
var/obj/item/stack/sheet/rglass/RG = new (get_turf(src), 5)
@@ -101,7 +101,7 @@ obj/structure/windoor_assembly/Destroy()
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor.")
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src || src.anchored)
return
for(var/obj/machinery/door/window/WD in src.loc)
@@ -120,7 +120,7 @@ obj/structure/windoor_assembly/Destroy()
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor.")
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src || !src.anchored)
return
user << "<span class='notice'>You've unsecured the windoor assembly!</span>"
@@ -138,7 +138,7 @@ obj/structure/windoor_assembly/Destroy()
return
user << "<span class='notice'>You start to reinforce the windoor with plasteel.</span>"
if(do_after(user,40))
if(do_after(user,40, target = src))
if(!src || secure)
return
@@ -154,7 +154,7 @@ obj/structure/windoor_assembly/Destroy()
else if(istype(W, /obj/item/stack/cable_coil) && anchored)
user.visible_message("[user] wires the windoor assembly.", "You start to wire the windoor assembly.")
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src || !src.anchored || src.state != "01")
return
var/obj/item/stack/cable_coil/CC = W
@@ -175,7 +175,7 @@ obj/structure/windoor_assembly/Destroy()
playsound(src.loc, 'sound/items/Wirecutter.ogg', 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))
if(do_after(user, 40, target = src))
if(!src || src.state != "02")
return
@@ -194,7 +194,7 @@ obj/structure/windoor_assembly/Destroy()
user.drop_item()
W.loc = src
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src || src.electronics)
W.loc = src.loc
return
@@ -212,7 +212,7 @@ obj/structure/windoor_assembly/Destroy()
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly.")
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(!src || !electronics)
return
user << "<span class='notice'>You've removed the airlock electronics!</span>"
@@ -242,7 +242,7 @@ obj/structure/windoor_assembly/Destroy()
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] pries the windoor into the frame.", "You start prying the windoor into the frame.")
if(do_after(user, 40))
if(do_after(user, 40, target = src))
if(src.loc && src.electronics)