Implement usesound/toolspeed

This commit is contained in:
Markolie
2017-03-07 16:46:28 +01:00
parent 3b73053bc4
commit 3aa1399995
179 changed files with 875 additions and 764 deletions
+2 -1
View File
@@ -129,12 +129,13 @@
var/obj/item/conveyor_construct/C = new/obj/item/conveyor_construct(src.loc)
C.id = id
transfer_fingerprints_to(C)
playsound(loc, I.usesound, 50, 1)
to_chat(usr,"<span class='notice'>You remove the conveyor belt.</span>")
qdel(src)
else if(istype(I, /obj/item/weapon/wrench))
if(!(stat & BROKEN))
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
playsound(loc, I.usesound, 50, 1)
dir = turn(dir,-45)
update_move_direction()
to_chat(user, "<span class='notice'>You rotate [src].</span>")
@@ -212,16 +212,16 @@
else
density = 1 // We don't want disposal bins or outlets to go density 0
to_chat(user, "You attach the [nicetype] to the underfloor.")
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
playsound(src.loc, I.usesound, 100, 1)
update()
else if(istype(I, /obj/item/weapon/weldingtool))
if(anchored)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
playsound(src.loc, W.usesound, 100, 1)
to_chat(user, "Welding the [nicetype] in place.")
if(do_after(user, 20, target = src))
if(do_after(user, 20 * W.toolspeed, target = src))
if(!src || !W.isOn()) return
to_chat(user, "The [nicetype] has been welded in place!")
update() // TODO: Make this neat
+16 -21
View File
@@ -74,12 +74,12 @@
return
if(mode==0) // It's off but still not unscrewed
mode=-1 // Set it to doubleoff l0l
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
playsound(src.loc, I.usesound, 50, 1)
to_chat(user, "You remove the screws around the power connection.")
return
else if(mode==-1)
mode=0
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
playsound(src.loc, I.usesound, 50, 1)
to_chat(user, "You attach the screws around the power connection.")
return
else if(istype(I,/obj/item/weapon/weldingtool) && mode==-1)
@@ -88,10 +88,10 @@
return
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
playsound(src.loc, W.usesound, 100, 1)
to_chat(user, "You start slicing the floorweld off the disposal unit.")
if(do_after(user,20, target = src))
if(do_after(user, 20 * W.toolspeed, target = src))
if(!src || !W.isOn()) return
to_chat(user, "You sliced the floorweld off the disposal unit.")
var/obj/structure/disposalconstruct/C = new (src.loc)
@@ -882,8 +882,8 @@
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0, user))
to_chat(user, "<span class='notice'>You begin slicing \the [src].</span>")
playsound(loc, 'sound/items/Welder2.ogg', 100, 1)
if(do_after(user, 30, target = src))
playsound(loc, W.usesound, 100, 1)
if(do_after(user, 30 * W.toolspeed, target = src))
to_chat(user, "<span class='notice'>You finish slicing \the [src].</span>")
welded()
else
@@ -1190,19 +1190,14 @@
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
// check if anything changed over 2 seconds
var/turf/uloc = user.loc
var/atom/wloc = W.loc
to_chat(user, "Slicing the disposal pipe.")
sleep(30)
if(!W.isOn()) return
if(user.loc == uloc && wloc == W.loc)
playsound(loc, W.usesound, 100, 1)
to_chat(user, "<span class='notice'>Slicing the disposal pipe.</span>")
if(do_after(user, 30 * W.toolspeed, target = src))
if(!W.isOn())
return
welded()
else
to_chat(user, "You must stay still while welding the pipe.")
else
to_chat(user, "You need more welding fuel to cut the pipe.")
to_chat(user, "<span class='warning'>You need more welding fuel to cut the pipe.</span>")
return
// would transfer to next pipe segment, but we are in a trunk
@@ -1308,20 +1303,20 @@
if(istype(I, /obj/item/weapon/screwdriver))
if(mode==0)
mode=1
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
playsound(src.loc, I.usesound, 50, 1)
to_chat(user, "You remove the screws around the power connection.")
return
else if(mode==1)
mode=0
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
playsound(src.loc, I.usesound, 50, 1)
to_chat(user, "You attach the screws around the power connection.")
return
else if(istype(I,/obj/item/weapon/weldingtool) && mode==1)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
playsound(src.loc, W.usesound, 100, 1)
to_chat(user, "You start slicing the floorweld off the disposal outlet.")
if(do_after(user,20, target = src))
if(do_after(user, 20 * W.toolspeed, target = src))
if(!src || !W.isOn()) return
to_chat(user, "You sliced the floorweld off the disposal outlet.")
var/obj/structure/disposalconstruct/C = new (src.loc)
+4 -4
View File
@@ -331,20 +331,20 @@
if(istype(I, /obj/item/weapon/screwdriver))
if(c_mode==0)
c_mode=1
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
playsound(src.loc, I.usesound, 50, 1)
to_chat(user, "You remove the screws around the power connection.")
return
else if(c_mode==1)
c_mode=0
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
playsound(src.loc, I.usesound, 50, 1)
to_chat(user, "You attach the screws around the power connection.")
return
else if(istype(I,/obj/item/weapon/weldingtool) && c_mode==1)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
playsound(src.loc, W.usesound, 100, 1)
to_chat(user, "You start slicing the floorweld off the delivery chute.")
if(do_after(user,20, target = src))
if(do_after(user, 20 * W.toolspeed, target = src))
if(!src || !W.isOn()) return
to_chat(user, "You sliced the floorweld off the delivery chute.")
var/obj/structure/disposalconstruct/C = new (src.loc)