mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 03:27:46 +01:00
Merge pull request #5468 from Anewbe/is_tool
Hopefully Unnoticeable Tool Refactor
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/catwalk/attackby(obj/item/C as obj, mob/user as mob)
|
||||
if (istype(C, /obj/item/weapon/weldingtool))
|
||||
if(istype(C, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = C
|
||||
if(WT.isOn())
|
||||
if(WT.remove_fuel(0, user))
|
||||
@@ -76,7 +76,7 @@
|
||||
new /obj/item/stack/rods(src.loc)
|
||||
new /obj/structure/lattice(src.loc)
|
||||
qdel(src)
|
||||
if(istype(C, /obj/item/weapon/screwdriver))
|
||||
if(C.is_screwdriver())
|
||||
if(health < maxhealth)
|
||||
to_chat(user, "<span class='notice'>You begin repairing \the [src.name] with \the [C.name].</span>")
|
||||
if(do_after(user, 20, src))
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
src.update_icon()
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("<span class='warning'>[src] has been [welded?"welded shut":"unwelded"] by [user.name].</span>", 3, "You hear welding.", 2)
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
else if(W.is_wrench())
|
||||
if(welded)
|
||||
if(anchored)
|
||||
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
/obj/item/clothing/mask/breath,
|
||||
/obj/item/clothing/head/helmet/space/void,
|
||||
/obj/item/clothing/suit/space/void,
|
||||
/obj/item/weapon/crowbar,
|
||||
/obj/item/weapon/tool/crowbar,
|
||||
/obj/item/weapon/cell,
|
||||
/obj/item/device/multitool)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/obj/item/clothing/head/greenbandana,
|
||||
/obj/item/weapon/material/minihoe,
|
||||
/obj/item/weapon/material/knife/machete/hatchet,
|
||||
/obj/item/weapon/wirecutters/clippers,
|
||||
/obj/item/weapon/tool/wirecutters/clippers,
|
||||
/obj/item/weapon/reagent_containers/spray/plantbgone,
|
||||
/obj/item/clothing/suit/storage/hooded/wintercoat/hydro,
|
||||
/obj/item/clothing/shoes/boots/winter/hydro)
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
/obj/item/device/healthanalyzer,
|
||||
/obj/item/device/radio/off,
|
||||
/obj/random/medical,
|
||||
/obj/item/weapon/crowbar,
|
||||
/obj/item/weapon/tool/crowbar,
|
||||
/obj/item/weapon/extinguisher/mini,
|
||||
/obj/item/weapon/storage/box/freezer,
|
||||
/obj/item/clothing/accessory/storage/white_vest,
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
spark_system.start()
|
||||
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
playsound(src.loc, "sparks", 50, 1)
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
else if(W.is_wrench())
|
||||
if(welded)
|
||||
if(anchored)
|
||||
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
/obj/item/weapon/storage/box/holobadge/hos,
|
||||
/obj/item/clothing/accessory/badge/holo/hos,
|
||||
/obj/item/weapon/reagent_containers/spray/pepper,
|
||||
/obj/item/weapon/crowbar/red,
|
||||
/obj/item/weapon/tool/crowbar/red,
|
||||
/obj/item/weapon/storage/box/flashbangs,
|
||||
/obj/item/weapon/storage/belt/security,
|
||||
/obj/item/device/flash,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/obj/item/clothing/under/syndicate,
|
||||
/obj/item/clothing/head/helmet/space/void/merc,
|
||||
/obj/item/clothing/suit/space/void/merc,
|
||||
/obj/item/weapon/crowbar/red,
|
||||
/obj/item/weapon/tool/crowbar/red,
|
||||
/obj/item/weapon/cell/high,
|
||||
/obj/item/weapon/card/id/syndicate,
|
||||
/obj/item/device/multitool,
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
/obj/structure/closet/syndicate/suit
|
||||
desc = "It's a storage unit for voidsuits."
|
||||
|
||||
|
||||
starts_with = list(
|
||||
/obj/item/weapon/tank/jetpack/oxygen,
|
||||
/obj/item/clothing/shoes/magboots,
|
||||
|
||||
@@ -113,15 +113,15 @@
|
||||
if(prob(70))
|
||||
starts_with += /obj/item/device/flashlight
|
||||
if(prob(70))
|
||||
starts_with += /obj/item/weapon/screwdriver
|
||||
starts_with += /obj/item/weapon/tool/screwdriver
|
||||
if(prob(70))
|
||||
starts_with += /obj/item/weapon/wrench
|
||||
starts_with += /obj/item/weapon/tool/wrench
|
||||
if(prob(70))
|
||||
starts_with += /obj/item/weapon/weldingtool
|
||||
if(prob(70))
|
||||
starts_with += /obj/item/weapon/crowbar
|
||||
starts_with += /obj/item/weapon/tool/crowbar
|
||||
if(prob(70))
|
||||
starts_with += /obj/item/weapon/wirecutters
|
||||
starts_with += /obj/item/weapon/tool/wirecutters
|
||||
if(prob(70))
|
||||
starts_with += /obj/item/device/t_scanner
|
||||
if(prob(20))
|
||||
@@ -202,7 +202,7 @@
|
||||
icon_closed = "hydrant"
|
||||
icon_opened = "hydrant_open"
|
||||
plane = TURF_PLANE
|
||||
layer = ABOVE_TURF_LAYER
|
||||
layer = ABOVE_TURF_LAYER
|
||||
anchored = 1
|
||||
density = 0
|
||||
wall_mounted = 1
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/obj/structure/closet/walllocker/emerglocker
|
||||
name = "emergency locker"
|
||||
desc = "A wall mounted locker with emergency supplies."
|
||||
var/list/spawnitems = list(/obj/item/weapon/tank/emergency/oxygen,/obj/item/clothing/mask/breath,/obj/item/weapon/crowbar/red)
|
||||
var/list/spawnitems = list(/obj/item/weapon/tank/emergency/oxygen,/obj/item/clothing/mask/breath,/obj/item/weapon/tool/crowbar/red)
|
||||
var/amount = 2 // spawns each items X times.
|
||||
icon_state = "emerg"
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
user.drop_item()
|
||||
W.forceMove(src)
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/wirecutters))
|
||||
else if(W.is_wirecutter())
|
||||
if(rigged)
|
||||
user << "<span class='notice'>You cut away the wiring.</span>"
|
||||
playsound(src.loc, W.usesound, 100, 1)
|
||||
@@ -191,7 +191,7 @@
|
||||
src.toggle(user)
|
||||
|
||||
/obj/structure/closet/crate/secure/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(is_type_in_list(W, list(/obj/item/weapon/packageWrap, /obj/item/stack/cable_coil, /obj/item/device/radio/electropack, /obj/item/weapon/wirecutters)))
|
||||
if(is_type_in_list(W, list(/obj/item/weapon/packageWrap, /obj/item/stack/cable_coil, /obj/item/device/radio/electropack, /obj/item/weapon/tool/wirecutters)))
|
||||
return ..()
|
||||
if(istype(W, /obj/item/weapon/melee/energy/blade))
|
||||
emag_act(INFINITY, user)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/largecrate/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
if(W.is_crowbar())
|
||||
new /obj/item/stack/material/wood(src)
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/atom/movable/AM in contents)
|
||||
@@ -42,7 +42,7 @@
|
||||
icon_state = "mulecrate"
|
||||
|
||||
/obj/structure/largecrate/hoverpod/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
if(W.is_crowbar())
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME
|
||||
var/obj/mecha/working/hoverpod/H = new (loc)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
layer = OBJ_LAYER
|
||||
|
||||
/obj/structure/curtain/attackby(obj/item/P, mob/user)
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
if(P.is_wirecutter())
|
||||
playsound(src, P.usesound, 50, 1)
|
||||
user << "<span class='notice'>You start to cut the shower curtains.</span>"
|
||||
if(do_after(user, 10))
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
to_chat(user, "<span class='notice'>You need more welding fuel.</span>")
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench) && state == 0)
|
||||
else if(W.is_wrench() && state == 0)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
if(anchored)
|
||||
user.visible_message("[user] begins unsecuring the airlock assembly from the floor.", "You starts unsecuring the airlock assembly from the floor.")
|
||||
@@ -223,7 +223,7 @@
|
||||
src.state = 1
|
||||
to_chat(user, "<span class='notice'>You wire the airlock.</span>")
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wirecutters) && state == 1 )
|
||||
else if(W.is_wirecutter() && state == 1 )
|
||||
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.")
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
src.state = 2
|
||||
src.electronics = W
|
||||
|
||||
else if(istype(W, /obj/item/weapon/crowbar) && state == 2 )
|
||||
else if(W.is_crowbar() && state == 2 )
|
||||
//This should never happen, but just in case I guess
|
||||
if (!electronics)
|
||||
to_chat(user, "<span class='notice'>There was nothing to remove.</span>")
|
||||
@@ -287,7 +287,7 @@
|
||||
to_chat(user, "<span class='notice'>You installed [material_display_name(material_name)] plating into the airlock assembly.</span>")
|
||||
glass = material_name
|
||||
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 )
|
||||
else if(W.is_screwdriver() && state == 2 )
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now finishing the airlock.</span>")
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/bed/chair/e_chair/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(W.is_wrench())
|
||||
var/obj/structure/bed/chair/C = new /obj/structure/bed/chair(loc)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
C.set_dir(dir)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
user << "<span class='notice'>You place [O] in [src].</span>"
|
||||
else
|
||||
opened = !opened
|
||||
if(istype(O, /obj/item/weapon/wrench))
|
||||
if(O.is_wrench())
|
||||
if(!has_extinguisher)
|
||||
user << "<span class='notice'>You start to unwrench the extinguisher cabinet.</span>"
|
||||
playsound(src.loc, O.usesound, 50, 1)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
var/list/qualifiers = list("with ease", "without any trouble", "with great effort")
|
||||
|
||||
/obj/structure/fitness/weightlifter/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(W.is_wrench())
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 75, 1)
|
||||
weight = ((weight) % qualifiers.len) + 1
|
||||
to_chat(user, "You set the machine's weight level to [weight].")
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
reinforce_girder()
|
||||
|
||||
/obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench) && state == 0)
|
||||
if(W.is_wrench() && state == 0)
|
||||
if(anchored && !reinf_material)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now disassembling the girder...</span>")
|
||||
@@ -170,7 +170,7 @@
|
||||
to_chat(user, "<span class='notice'>You drill through the girder!</span>")
|
||||
dismantle()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
else if(W.is_screwdriver())
|
||||
if(state == 2)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now unsecuring support struts...</span>")
|
||||
@@ -183,7 +183,7 @@
|
||||
reinforcing = !reinforcing
|
||||
to_chat(user, "<span class='notice'>\The [src] can now be [reinforcing? "reinforced" : "constructed"]!</span>")
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wirecutters) && state == 1)
|
||||
else if(W.is_wirecutter() && state == 1)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now removing support struts...</span>")
|
||||
if(do_after(user,40 * W.toolspeed))
|
||||
@@ -193,7 +193,7 @@
|
||||
reinf_material = null
|
||||
reset_girder()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/crowbar) && state == 0 && anchored)
|
||||
else if(W.is_crowbar() && state == 0 && anchored)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now dislodging the girder...</span>")
|
||||
if(do_after(user, 40 * W.toolspeed))
|
||||
@@ -329,7 +329,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/girder/cult/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(W.is_wrench())
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now disassembling the girder...</span>")
|
||||
if(do_after(user,40 * W.toolspeed))
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
return 1
|
||||
|
||||
/obj/structure/gravemarker/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(W.is_screwdriver())
|
||||
var/carving_1 = sanitizeSafe(input(user, "Who is \the [src.name] for?", "Gravestone Naming", null) as text, MAX_NAME_LEN)
|
||||
if(carving_1)
|
||||
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
|
||||
@@ -72,7 +72,7 @@
|
||||
epitaph += carving_2
|
||||
update_icon()
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(W.is_wrench())
|
||||
user.visible_message("[user] starts taking down \the [src.name].", "You start taking down \the [src.name].")
|
||||
if(do_after(user, material.hardness * W.toolspeed))
|
||||
user.visible_message("[user] takes down \the [src.name].", "You take down \the [src.name].")
|
||||
|
||||
@@ -94,12 +94,12 @@
|
||||
spawn(0) healthcheck() //spawn to make sure we return properly if the grille is deleted
|
||||
|
||||
/obj/structure/grille/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(iswirecutter(W))
|
||||
if(W.is_wirecutter())
|
||||
if(!shock(user, 100))
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
new /obj/item/stack/rods(get_turf(src), destroyed ? 1 : 2)
|
||||
qdel(src)
|
||||
else if((isscrewdriver(W)) && (istype(loc, /turf/simulated) || anchored))
|
||||
else if((W.is_screwdriver()) && (istype(loc, /turf/simulated) || anchored))
|
||||
if(!shock(user, 90))
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
anchored = !anchored
|
||||
|
||||
@@ -365,9 +365,9 @@ Loot piles can be depleted, if loot_depleted is turned on. Note that players wh
|
||||
/obj/item/device/gps,
|
||||
/obj/item/device/geiger,
|
||||
/obj/item/device/mass_spectrometer,
|
||||
/obj/item/weapon/wrench,
|
||||
/obj/item/weapon/screwdriver,
|
||||
/obj/item/weapon/wirecutters,
|
||||
/obj/item/weapon/tool/wrench,
|
||||
/obj/item/weapon/tool/screwdriver,
|
||||
/obj/item/weapon/tool/wirecutters,
|
||||
/obj/item/device/multitool,
|
||||
/obj/item/mecha_parts/mecha_equipment/generator,
|
||||
/obj/item/mecha_parts/mecha_equipment/tool/cable_layer,
|
||||
@@ -450,11 +450,11 @@ Loot piles can be depleted, if loot_depleted is turned on. Note that players wh
|
||||
uncommon_loot = list(
|
||||
/obj/item/device/multitool/alien,
|
||||
/obj/item/stack/cable_coil/alien,
|
||||
/obj/item/weapon/crowbar/alien,
|
||||
/obj/item/weapon/screwdriver/alien,
|
||||
/obj/item/weapon/tool/crowbar/alien,
|
||||
/obj/item/weapon/tool/screwdriver/alien,
|
||||
/obj/item/weapon/weldingtool/alien,
|
||||
/obj/item/weapon/wirecutters/alien,
|
||||
/obj/item/weapon/wrench/alien
|
||||
/obj/item/weapon/tool/wirecutters/alien,
|
||||
/obj/item/weapon/tool/wrench/alien
|
||||
)
|
||||
rare_loot = list(
|
||||
/obj/item/weapon/storage/belt/utility/alien/full
|
||||
@@ -496,11 +496,11 @@ Loot piles can be depleted, if loot_depleted is turned on. Note that players wh
|
||||
common_loot = list(
|
||||
/obj/item/device/multitool/alien,
|
||||
/obj/item/stack/cable_coil/alien,
|
||||
/obj/item/weapon/crowbar/alien,
|
||||
/obj/item/weapon/screwdriver/alien,
|
||||
/obj/item/weapon/tool/crowbar/alien,
|
||||
/obj/item/weapon/tool/screwdriver/alien,
|
||||
/obj/item/weapon/weldingtool/alien,
|
||||
/obj/item/weapon/wirecutters/alien,
|
||||
/obj/item/weapon/wrench/alien,
|
||||
/obj/item/weapon/tool/wirecutters/alien,
|
||||
/obj/item/weapon/tool/wrench/alien,
|
||||
/obj/item/weapon/surgical/FixOVein/alien,
|
||||
/obj/item/weapon/surgical/bone_clamp/alien,
|
||||
/obj/item/weapon/surgical/cautery/alien,
|
||||
|
||||
@@ -49,24 +49,24 @@
|
||||
..()
|
||||
|
||||
/obj/structure/mirror/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/wrench))
|
||||
if(I.is_wrench())
|
||||
if(!glass)
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
if(do_after(user, 20 * I.toolspeed))
|
||||
user << "<span class='notice'>You unfasten the frame.</span>"
|
||||
to_chat(user, "<span class='notice'>You unfasten the frame.</span>")
|
||||
new /obj/item/frame/mirror( src.loc )
|
||||
qdel(src)
|
||||
return
|
||||
if(istype(I, /obj/item/weapon/crowbar))
|
||||
if(I.is_wrench())
|
||||
if(shattered && glass)
|
||||
user << "<span class='notice'>The broken glass falls out.</span>"
|
||||
to_chat(user, "<span class='notice'>The broken glass falls out.</span>")
|
||||
icon_state = "mirror_frame"
|
||||
glass = !glass
|
||||
new /obj/item/weapon/material/shard( src.loc )
|
||||
return
|
||||
if(!shattered && glass)
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
user << "<span class='notice'>You remove the glass.</span>"
|
||||
to_chat(user, "<span class='notice'>You remove the glass.</span>")
|
||||
glass = !glass
|
||||
icon_state = "mirror_frame"
|
||||
new /obj/item/stack/material/glass( src.loc, 2 )
|
||||
@@ -76,15 +76,15 @@
|
||||
if(!glass)
|
||||
var/obj/item/stack/material/glass/G = I
|
||||
if (G.get_amount() < 2)
|
||||
user << "<span class='warning'>You need two sheets of glass to add them to the frame.</span>"
|
||||
to_chat(user, "<span class='warning'>You need two sheets of glass to add them to the frame.</span>")
|
||||
return
|
||||
user << "<span class='notice'>You start to add the glass to the frame.</span>"
|
||||
to_chat(user, "<span class='notice'>You start to add the glass to the frame.</span>")
|
||||
if(do_after(user, 20))
|
||||
if (G.use(2))
|
||||
shattered = 0
|
||||
glass = 1
|
||||
icon_state = "mirror"
|
||||
user << "<span class='notice'>You add the glass to the frame.</span>"
|
||||
to_chat(user, "<span class='notice'>You add the glass to the frame.</span>")
|
||||
return
|
||||
|
||||
if(shattered && glass)
|
||||
|
||||
@@ -429,8 +429,8 @@
|
||||
return
|
||||
|
||||
/obj/structure/device/piano/attackby(obj/item/O as obj, mob/user as mob)
|
||||
if (istype(O, /obj/item/weapon/wrench))
|
||||
if (anchored)
|
||||
if(O.is_wrench())
|
||||
if(anchored)
|
||||
playsound(src.loc, O.usesound, 50, 1)
|
||||
user << "<span class='notice'>You begin to loosen \the [src]'s casters...</span>"
|
||||
if (do_after(user, 40 * O.toolspeed))
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
user << "<span class='notice'>You pin the paper to the noticeboard.</span>"
|
||||
else
|
||||
user << "<span class='notice'>You reach to pin your paper to the board but hesitate. You are certain your paper will not be seen among the many others already attached.</span>"
|
||||
if(istype(O, /obj/item/weapon/wrench))
|
||||
if(O.is_wrench())
|
||||
user << "<span class='notice'>You start to unwrench the noticeboard.</span>"
|
||||
playsound(src.loc, O.usesound, 50, 1)
|
||||
if(do_after(user, 15 * O.toolspeed))
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
)
|
||||
|
||||
/obj/structure/plasticflaps/attackby(obj/item/P, mob/user)
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
if(P.is_wirecutter())
|
||||
playsound(src, P.usesound, 50, 1)
|
||||
user << "<span class='notice'>You start to cut the plastic flaps.</span>"
|
||||
if(do_after(user, 10 * P.toolspeed))
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
|
||||
/obj/structure/railing/attackby(obj/item/W as obj, mob/user as mob)
|
||||
// Dismantle
|
||||
if(istype(W, /obj/item/weapon/wrench) && !anchored)
|
||||
if(W.is_wrench() && !anchored)
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
if(do_after(user, 20, src))
|
||||
user.visible_message("<span class='notice'>\The [user] dismantles \the [src].</span>", "<span class='notice'>You dismantle \the [src].</span>")
|
||||
@@ -217,7 +217,7 @@
|
||||
return
|
||||
|
||||
// Install
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(W.is_screwdriver())
|
||||
user.visible_message(anchored ? "<span class='notice'>\The [user] begins unscrewing \the [src].</span>" : "<span class='notice'>\The [user] begins fasten \the [src].</span>" )
|
||||
playsound(loc, W.usesound, 75, 1)
|
||||
if(do_after(user, 10, src))
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
return
|
||||
|
||||
/obj/structure/sign/attackby(obj/item/tool as obj, mob/user as mob) //deconstruction
|
||||
if(istype(tool, /obj/item/weapon/screwdriver) && !istype(src, /obj/structure/sign/double))
|
||||
if(tool.is_screwdriver() && !istype(src, /obj/structure/sign/double))
|
||||
playsound(src, tool.usesound, 50, 1)
|
||||
user << "You unfasten the sign with your [tool]."
|
||||
to_chat(user, "You unfasten the sign with your [tool].")
|
||||
var/obj/item/sign/S = new(src.loc)
|
||||
S.name = name
|
||||
S.desc = desc
|
||||
@@ -42,7 +42,7 @@
|
||||
var/sign_state = ""
|
||||
|
||||
/obj/item/sign/attackby(obj/item/tool as obj, mob/user as mob) //construction
|
||||
if(istype(tool, /obj/item/weapon/screwdriver) && isturf(user.loc))
|
||||
if(tool.is_screwdriver() && isturf(user.loc))
|
||||
var/direction = input("In which direction?", "Select direction.") in list("North", "East", "South", "West", "Cancel")
|
||||
if(direction == "Cancel") return
|
||||
var/obj/structure/sign/S = new(user.loc)
|
||||
@@ -59,7 +59,7 @@
|
||||
S.name = name
|
||||
S.desc = desc
|
||||
S.icon_state = sign_state
|
||||
user << "You fasten \the [S] with your [tool]."
|
||||
to_chat(user, "You fasten \the [S] with your [tool].")
|
||||
qdel(src)
|
||||
else ..()
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/bed/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(W.is_wrench())
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
dismantle()
|
||||
qdel(src)
|
||||
@@ -120,7 +120,7 @@
|
||||
add_padding(padding_type)
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weapon/wirecutters))
|
||||
else if(W.is_wirecutter())
|
||||
if(!padding_material)
|
||||
to_chat(user, "\The [src] has no padding to remove.")
|
||||
return
|
||||
@@ -213,7 +213,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/bed/roller/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench) || istype(W,/obj/item/stack) || istype(W, /obj/item/weapon/wirecutters))
|
||||
if(W.is_wrench() || istype(W,/obj/item/stack) || W.is_wirecutter())
|
||||
return
|
||||
else if(istype(W,/obj/item/roller_holder))
|
||||
if(has_buckled_mobs())
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/bed/chair/office/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/stack) || istype(W, /obj/item/weapon/wirecutters))
|
||||
if(istype(W,/obj/item/stack) || W.is_wirecutter())
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/bed/chair/wood/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/stack) || istype(W, /obj/item/weapon/wirecutters))
|
||||
if(istype(W,/obj/item/stack) || W.is_wirecutter())
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ var/global/list/stool_cache = list() //haha stool
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/stool/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(W.is_wrench())
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
dismantle()
|
||||
qdel(src)
|
||||
@@ -138,7 +138,7 @@ var/global/list/stool_cache = list() //haha stool
|
||||
user << "You add padding to \the [src]."
|
||||
add_padding(padding_type)
|
||||
return
|
||||
else if (istype(W, /obj/item/weapon/wirecutters))
|
||||
else if (W.is_wirecutter())
|
||||
if(!padding_material)
|
||||
user << "\The [src] has no padding to remove."
|
||||
return
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
L.set_dir(dir)
|
||||
|
||||
/obj/structure/bed/chair/wheelchair/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench) || istype(W,/obj/item/stack) || istype(W, /obj/item/weapon/wirecutters))
|
||||
if(W.is_wrench() || W.is_wirecutter() || istype(W,/obj/item/stack))
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
user << "<span class='notice'>[src] is full.</span>"
|
||||
updateUsrDialog()
|
||||
return
|
||||
if(istype(I, /obj/item/weapon/wrench))
|
||||
if(I.is_wrench())
|
||||
if(anchored)
|
||||
user << "<span class='notice'>You lean down and unwrench [src].</span>"
|
||||
anchored = 0
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
icon_state = "toilet[open][cistern]"
|
||||
|
||||
/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob)
|
||||
if(istype(I, /obj/item/weapon/crowbar))
|
||||
if(I.is_crowbar())
|
||||
to_chat(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))
|
||||
@@ -160,7 +160,7 @@
|
||||
/obj/machinery/shower/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(I.type == /obj/item/device/analyzer)
|
||||
to_chat(user, "<span class='notice'>The water temperature seems to be [watertemp].</span>")
|
||||
if(istype(I, /obj/item/weapon/wrench))
|
||||
if(I.is_wrench())
|
||||
var/newtemp = input(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve") in temperature_settings
|
||||
to_chat(user, "<span class='notice'>You begin to adjust the temperature valve with \the [I].</span>")
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
|
||||
@@ -108,7 +108,7 @@ obj/structure/windoor_assembly/Destroy()
|
||||
return
|
||||
|
||||
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
|
||||
if(istype(W, /obj/item/weapon/wrench) && !anchored)
|
||||
if(W.is_wrench() && !anchored)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor.")
|
||||
|
||||
@@ -119,7 +119,7 @@ obj/structure/windoor_assembly/Destroy()
|
||||
step = 0
|
||||
|
||||
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
|
||||
else if(istype(W, /obj/item/weapon/wrench) && anchored)
|
||||
else if(W.is_wrench() && anchored)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor.")
|
||||
|
||||
@@ -145,7 +145,7 @@ obj/structure/windoor_assembly/Destroy()
|
||||
if("02")
|
||||
|
||||
//Removing wire from the assembly. Step 5 undone.
|
||||
if(istype(W, /obj/item/weapon/wirecutters) && !src.electronics)
|
||||
if(W.is_wirecutter() && !src.electronics)
|
||||
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.")
|
||||
|
||||
@@ -174,7 +174,7 @@ obj/structure/windoor_assembly/Destroy()
|
||||
W.loc = src.loc
|
||||
|
||||
//Screwdriver to remove airlock electronics. Step 6 undone.
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && src.electronics)
|
||||
else if(W.is_screwdriver() && src.electronics)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly.")
|
||||
|
||||
@@ -187,7 +187,7 @@ obj/structure/windoor_assembly/Destroy()
|
||||
ae.loc = src.loc
|
||||
|
||||
//Crowbar to complete the assembly, Step 7 complete.
|
||||
else if(istype(W, /obj/item/weapon/crowbar))
|
||||
else if(W.is_crowbar())
|
||||
if(!src.electronics)
|
||||
to_chat(usr,"<span class='warning'>The assembly is missing electronics.</span>")
|
||||
return
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
|
||||
if(W.flags & NOBLUDGEON) return
|
||||
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(W.is_screwdriver())
|
||||
if(reinf && state >= 1)
|
||||
state = 3 - state
|
||||
update_nearby_icons()
|
||||
@@ -280,11 +280,11 @@
|
||||
update_verbs()
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
user << (anchored ? "<span class='notice'>You have fastened the window to the floor.</span>" : "<span class='notice'>You have unfastened the window.</span>")
|
||||
else if(istype(W, /obj/item/weapon/crowbar) && reinf && state <= 1)
|
||||
else if(W.is_crowbar() && reinf && state <= 1)
|
||||
state = 1 - state
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
user << (state ? "<span class='notice'>You have pried the window into the frame.</span>" : "<span class='notice'>You have pried the window out of the frame.</span>")
|
||||
else if(istype(W, /obj/item/weapon/wrench) && !anchored && (!state || !reinf))
|
||||
else if(W.is_wrench() && !anchored && (!state || !reinf))
|
||||
if(!glasstype)
|
||||
user << "<span class='notice'>You're not sure how to dismantle \the [src] properly.</span>"
|
||||
else
|
||||
@@ -294,7 +294,7 @@
|
||||
if(is_fulltile())
|
||||
mats.amount = 4
|
||||
qdel(src)
|
||||
else if(iscoil(W) && reinf && state == 0 && !istype(src, /obj/structure/window/reinforced/polarized))
|
||||
else if(istype(W, /obj/item/stack/cable_coil) && reinf && state == 0 && !istype(src, /obj/structure/window/reinforced/polarized))
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if (C.use(1))
|
||||
playsound(src.loc, 'sound/effects/sparks1.ogg', 75, 1)
|
||||
@@ -572,7 +572,7 @@
|
||||
maxhealth = 80
|
||||
|
||||
/obj/structure/window/reinforced/polarized/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(ismultitool(W) && !anchored) // Only allow programming if unanchored!
|
||||
if(istype(W, /obj/item/device/multitool) && !anchored) // Only allow programming if unanchored!
|
||||
var/obj/item/device/multitool/MT = W
|
||||
// First check if they have a windowtint button buffered
|
||||
if(istype(MT.connectable, /obj/machinery/button/windowtint))
|
||||
@@ -632,7 +632,7 @@
|
||||
icon_state = "light[active]"
|
||||
|
||||
/obj/machinery/button/windowtint/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(ismultitool(W))
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
var/obj/item/device/multitool/MT = W
|
||||
if(!id)
|
||||
// If no ID is set yet (newly built button?) let them select an ID for first-time use!
|
||||
|
||||
Reference in New Issue
Block a user