mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-26 14:47:50 +01:00
[MIRROR] Refactors tool typechecks, refactors transforming tools, makes Altevian wrench into one (#7062)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Nadyr <41974248+Darlantanis@users.noreply.github.com>
This commit is contained in:
co-authored by
Heroman3003
Nadyr
parent
00a5f09ad4
commit
d2e66e6410
@@ -394,7 +394,7 @@
|
||||
frame_canvas(user, I)
|
||||
else if(current_canvas && current_canvas.painting_name == initial(current_canvas.painting_name) && istype(I,/obj/item/weapon/pen))
|
||||
try_rename(user)
|
||||
else if(current_canvas && I.is_wirecutter())
|
||||
else if(current_canvas && I.has_tool_quality(TOOL_WIRECUTTER))
|
||||
unframe_canvas(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -87,12 +87,12 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/catwalk/attackby(obj/item/C as obj, mob/user as mob)
|
||||
if(istype(C, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = C
|
||||
if(C.has_tool_quality(TOOL_WELDER))
|
||||
var/obj/item/weapon/weldingtool/WT = C.get_welder()
|
||||
if(WT.isOn() && WT.remove_fuel(0, user))
|
||||
deconstruct(user)
|
||||
return
|
||||
if(C.is_crowbar() && plated_tile)
|
||||
if(C.has_tool_quality(TOOL_CROWBAR) && plated_tile)
|
||||
hatch_open = !hatch_open
|
||||
if(hatch_open)
|
||||
playsound(src, 'sound/items/Crowbar.ogg', 100, 2)
|
||||
|
||||
@@ -271,7 +271,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
if(opened)
|
||||
if(anchored)
|
||||
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
||||
@@ -291,8 +291,8 @@
|
||||
return 0
|
||||
if(istype(W,/obj/item/tk_grab))
|
||||
return 0
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(W.has_tool_quality(TOOL_WELDER))
|
||||
var/obj/item/weapon/weldingtool/WT = W.get_welder()
|
||||
if(!WT.remove_fuel(0,user))
|
||||
if(!WT.isOn())
|
||||
return
|
||||
@@ -326,8 +326,8 @@
|
||||
else if(seal_tool)
|
||||
if(istype(W, seal_tool))
|
||||
var/obj/item/weapon/S = W
|
||||
if(istype(S, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = S
|
||||
if(S.has_tool_quality(TOOL_WELDER))
|
||||
var/obj/item/weapon/weldingtool/WT = S.get_welder()
|
||||
if(!WT.remove_fuel(0,user))
|
||||
if(!WT.isOn())
|
||||
return
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
icon_state = icon_closed
|
||||
|
||||
/obj/structure/closet/secure_closet/egg/attackby(obj/item/weapon/W, mob/user as mob) //This also prevents crew from welding the eggs and making them unable to be opened.
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
if(W.has_tool_quality(TOOL_WELDER))
|
||||
src.dump_contents()
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
to_chat(user, "<span class='notice'>Access Denied</span>")
|
||||
|
||||
/obj/structure/closet/secure_closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
if(opened)
|
||||
if(anchored)
|
||||
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
||||
@@ -91,7 +91,7 @@
|
||||
spark_system.start()
|
||||
playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
playsound(src, "sparks", 50, 1)
|
||||
else if(istype(W,/obj/item/weapon/packageWrap) || istype(W,/obj/item/weapon/weldingtool))
|
||||
else if(istype(W,/obj/item/weapon/packageWrap) || W.has_tool_quality(TOOL_WELDER))
|
||||
return ..(W,user)
|
||||
else
|
||||
togglelock(user)
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
src.set_dir(turn(src.dir, 90))
|
||||
|
||||
/obj/structure/closet/crate/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench() && istype(src,/obj/structure/closet/crate/bin))
|
||||
if(W.has_tool_quality(TOOL_WRENCH) && istype(src,/obj/structure/closet/crate/bin))
|
||||
return ..()
|
||||
else if(opened)
|
||||
if(isrobot(user))
|
||||
@@ -117,7 +117,7 @@
|
||||
user.drop_item()
|
||||
W.forceMove(src)
|
||||
return
|
||||
else if(W.is_wirecutter())
|
||||
else if(W.has_tool_quality(TOOL_WIRECUTTER))
|
||||
if(rigged)
|
||||
to_chat(user , "<span class='notice'>You cut away the wiring.</span>")
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
to_chat(user, "<span class='notice'>You can't open this here!</span>")
|
||||
if(W.is_crowbar())
|
||||
if(W.has_tool_quality(TOOL_CROWBAR))
|
||||
new /obj/item/stack/material/wood(src)
|
||||
|
||||
for(var/atom/movable/AM in contents)
|
||||
@@ -55,7 +55,7 @@
|
||||
icon_state = "vehiclecrate"
|
||||
|
||||
/obj/structure/largecrate/hoverpod/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_crowbar())
|
||||
if(W.has_tool_quality(TOOL_CROWBAR))
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME
|
||||
var/obj/mecha/working/hoverpod/H = new (loc)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
desc = "You hear chirping and cawing inside the crate. It sounds like there are a lot of birds in there..."
|
||||
|
||||
/obj/structure/largecrate/birds/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_crowbar())
|
||||
if(W.has_tool_quality(TOOL_CROWBAR))
|
||||
new /obj/item/stack/material/wood(src)
|
||||
new /mob/living/simple_mob/animal/passive/bird(src)
|
||||
new /mob/living/simple_mob/animal/passive/bird/parrot/kea(src)
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
to_chat(user, "<span class='notice'>You can't open this here!</span>")
|
||||
if(W.is_wrench() && do_after(user, 60 * W.toolspeed, src))
|
||||
if(W.has_tool_quality(TOOL_WRENCH) && do_after(user, 60 * W.toolspeed, src))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
disassemble(W, user)
|
||||
user.visible_message("<span class='notice'>[user] begins loosening \the [src]'s bolts.</span>")
|
||||
if(W.is_wirecutter() && do_after(user, 70 * W.toolspeed, src))
|
||||
if(W.has_tool_quality(TOOL_WIRECUTTER) && do_after(user, 70 * W.toolspeed, src))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
disassemble(W, user)
|
||||
user.visible_message("<span class='notice'>[user] begins cutting \the [src]'s bolts.</span>")
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
layer = OBJ_LAYER
|
||||
|
||||
/obj/structure/curtain/attackby(obj/item/P, mob/user)
|
||||
if(P.is_wirecutter())
|
||||
if(P.has_tool_quality(TOOL_WIRECUTTER))
|
||||
playsound(src, P.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You start to cut the shower curtains.</span>")
|
||||
if(do_after(user, 10))
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
anchored = TRUE
|
||||
|
||||
/obj/structure/dancepole/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(O.is_screwdriver())
|
||||
if(O.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
anchored = !anchored
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
if(anchored)
|
||||
to_chat(user, "<font color='blue'>You secure \the [src].</font>")
|
||||
else
|
||||
to_chat(user, "<font color='blue'>You unsecure \the [src].</font>")
|
||||
if(O.is_wrench())
|
||||
if(O.has_tool_quality(TOOL_WRENCH))
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>Now disassembling \the [src]...</span>")
|
||||
if(do_after(user, 30 * O.toolspeed))
|
||||
|
||||
@@ -170,8 +170,8 @@
|
||||
rename_door(user)
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/weldingtool) && ( (istext(glass)) || (glass == 1) || (!anchored) ))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(W.has_tool_quality(TOOL_WELDER) && ( (istext(glass)) || (glass == 1) || (!anchored) ))
|
||||
var/obj/item/weapon/weldingtool/WT = W.get_welder()
|
||||
if (WT.remove_fuel(0, user))
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
if(istext(glass))
|
||||
@@ -200,7 +200,7 @@
|
||||
to_chat(user, "<span class='notice'>You need more welding fuel.</span>")
|
||||
return
|
||||
|
||||
else if(W.is_wrench() && state == 0)
|
||||
else if(W.has_tool_quality(TOOL_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(W.is_wirecutter() && state == 1 )
|
||||
else if(W.has_tool_quality(TOOL_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(W.is_crowbar() && state == 2 )
|
||||
else if(W.has_tool_quality(TOOL_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(W.is_screwdriver() && state == 2 )
|
||||
else if(W.has_tool_quality(TOOL_SCREWDRIVER) && state == 2 )
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now finishing the airlock.</span>")
|
||||
|
||||
|
||||
@@ -27,15 +27,15 @@
|
||||
if(!T)
|
||||
warning("Drop pod wasn't spawned on a turf")
|
||||
return
|
||||
|
||||
|
||||
moveToNullspace()
|
||||
icon_state = "[initial(icon_state)]_falling"
|
||||
|
||||
|
||||
// Show warning on 3x3 area centred on our drop spot
|
||||
var/list/turfs_nearby = block(get_step(T, SOUTHWEST), get_step(T, NORTHEAST))
|
||||
for(var/turf/TN in turfs_nearby)
|
||||
new /obj/effect/temporary_effect/shuttle_landing(TN)
|
||||
|
||||
|
||||
// Wait a minute
|
||||
sleep(4 SECONDS)
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
T.hotspot_expose(900)
|
||||
sleep(1 SECOND)
|
||||
filters = null
|
||||
|
||||
|
||||
// CRONCH
|
||||
playsound(src, 'sound/effects/meteorimpact.ogg', 50, 1)
|
||||
if(!polite)
|
||||
@@ -65,7 +65,7 @@
|
||||
else
|
||||
for(var/turf/simulated/floor/F in view(1, T))
|
||||
F.burn_tile(900)
|
||||
|
||||
|
||||
for(var/obj/O in T)
|
||||
if(O == src)
|
||||
continue
|
||||
@@ -76,7 +76,7 @@
|
||||
// Landed! Simmer
|
||||
plane = initial(plane)
|
||||
icon_state = "[initial(icon_state)]"
|
||||
|
||||
|
||||
if(auto_open)
|
||||
sleep(2 SECONDS)
|
||||
open_pod()
|
||||
@@ -105,7 +105,7 @@
|
||||
user.visible_message("<b>[user]</b> opens \the [src]!","You open \the [src]!")
|
||||
|
||||
/obj/structure/drop_pod/attackby(obj/item/O, mob/user)
|
||||
if(O.is_wrench())
|
||||
if(O.has_tool_quality(TOOL_WRENCH))
|
||||
if(finished)
|
||||
to_chat(user, "<span class='notice'>You start breaking down \the [src].</span>")
|
||||
if(do_after(user, 10 SECONDS, src, exclusive = TASK_ALL_EXCLUSIVE))
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/bed/chair/e_chair/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
var/obj/structure/bed/chair/C = new /obj/structure/bed/chair(loc)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
C.set_dir(dir)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
to_chat(user, "<span class='notice'>You place [O] in [src].</span>")
|
||||
else
|
||||
opened = !opened
|
||||
if(O.is_wrench())
|
||||
if(O.has_tool_quality(TOOL_WRENCH))
|
||||
if(!has_extinguisher)
|
||||
to_chat(user, "<span class='notice'>You start to unwrench the extinguisher cabinet.</span>")
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/fence/attackby(obj/item/W, mob/user)
|
||||
if(W.is_wirecutter())
|
||||
if(W.has_tool_quality(TOOL_WIRECUTTER))
|
||||
if(!cuttable)
|
||||
to_chat(user, span("warning", "This section of the fence can't be cut."))
|
||||
return
|
||||
|
||||
@@ -34,7 +34,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(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 75, 1)
|
||||
weight = ((weight) % qualifiers.len) + 1
|
||||
to_chat(user, "You set the machine's weight level to [weight].")
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
reinforce_girder()
|
||||
|
||||
/obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(W.is_wrench() && state == 0)
|
||||
if(W.has_tool_quality(TOOL_WRENCH) && state == 0)
|
||||
if(anchored && !reinf_material)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now disassembling the girder...</span>")
|
||||
@@ -172,7 +172,7 @@
|
||||
to_chat(user, "<span class='notice'>You drill through the girder!</span>")
|
||||
dismantle()
|
||||
|
||||
else if(W.is_screwdriver())
|
||||
else if(W.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
if(state == 2)
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "<span class='notice'>Now unsecuring support struts...</span>")
|
||||
@@ -185,7 +185,7 @@
|
||||
reinforcing = !reinforcing
|
||||
to_chat(user, "<span class='notice'>\The [src] can now be [reinforcing? "reinforced" : "constructed"]!</span>")
|
||||
|
||||
else if(W.is_wirecutter() && state == 1)
|
||||
else if(W.has_tool_quality(TOOL_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))
|
||||
@@ -195,7 +195,7 @@
|
||||
reinf_material = null
|
||||
reset_girder()
|
||||
|
||||
else if(W.is_crowbar() && state == 0 && anchored)
|
||||
else if(W.has_tool_quality(TOOL_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))
|
||||
@@ -339,7 +339,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/girder/cult/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_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))
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/structure/gravemarker/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
if(W.is_screwdriver())
|
||||
if(W.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
var/carving_1 = sanitizeSafe(tgui_input_text(user, "Who is \the [src.name] for?", "Gravestone Naming", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(carving_1)
|
||||
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
|
||||
@@ -67,7 +67,7 @@
|
||||
epitaph += carving_2
|
||||
update_icon()
|
||||
return
|
||||
if(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_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 @@
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/rcd)) // To stop us from hitting the grille when building windows, because grilles don't let parent handle it properly.
|
||||
return FALSE
|
||||
else if(W.is_wirecutter())
|
||||
else if(W.has_tool_quality(TOOL_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((W.is_screwdriver()) && (istype(loc, /turf/simulated) || anchored))
|
||||
else if((W.has_tool_quality(TOOL_SCREWDRIVER)) && (istype(loc, /turf/simulated) || anchored))
|
||||
if(!shock(user, 90))
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
anchored = !anchored
|
||||
|
||||
@@ -176,7 +176,7 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart)
|
||||
//This prevents dumb stuff like splashing the cart with the contents of a container, after putting said container into trash
|
||||
|
||||
else if (!has_items)
|
||||
if (I.is_wrench())
|
||||
if (I.has_tool_quality(TOOL_WRENCH))
|
||||
if (do_after(user, 5 SECONDS, src))
|
||||
dismantle(user)
|
||||
return
|
||||
|
||||
@@ -55,19 +55,19 @@
|
||||
|
||||
/obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob)
|
||||
|
||||
if (istype(C, /obj/item/stack/tile/floor))
|
||||
if(istype(C, /obj/item/stack/tile/floor))
|
||||
var/turf/T = get_turf(src)
|
||||
T.attackby(C, user) //BubbleWrap - hand this off to the underlying turf instead
|
||||
return
|
||||
if (istype(C, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = C
|
||||
if(C.has_tool_quality(TOOL_WELDER))
|
||||
var/obj/item/weapon/weldingtool/WT = C.get_welder()
|
||||
if(WT.welding == 1)
|
||||
if(WT.remove_fuel(0, user))
|
||||
to_chat(user, "<span class='notice'>Slicing lattice joints ...</span>")
|
||||
new /obj/item/stack/rods(src.loc)
|
||||
qdel(src)
|
||||
return
|
||||
if (istype(C, /obj/item/stack/rods))
|
||||
if(istype(C, /obj/item/stack/rods))
|
||||
var/obj/item/stack/rods/R = C
|
||||
if(R.get_amount() < 2)
|
||||
to_chat(user, "<span class='notice'>You need at least two rods to form a catwalk here.</span>")
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
return
|
||||
|
||||
// Dismantling the half wall
|
||||
if(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
for(var/obj/structure/S in loc)
|
||||
if(istype(S, /obj/structure/window))
|
||||
to_chat(user, "<span class='notice'>There is still a window on the low wall!</span>")
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
to_chat(user, "<span class='warning'>Close the valve first.</span>")
|
||||
return
|
||||
if (tank)
|
||||
if(!W.is_wrench())
|
||||
if(!W.has_tool_quality(TOOL_WRENCH))
|
||||
return
|
||||
if (!is_loosen)
|
||||
is_loosen = TRUE
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
..()
|
||||
|
||||
/obj/structure/mirror/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(I.is_wrench())
|
||||
if(I.has_tool_quality(TOOL_WRENCH))
|
||||
if(!glass)
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
if(do_after(user, 20 * I.toolspeed))
|
||||
@@ -58,7 +58,7 @@
|
||||
new /obj/item/frame/mirror( src.loc )
|
||||
qdel(src)
|
||||
return
|
||||
if(I.is_wrench())
|
||||
if(I.has_tool_quality(TOOL_WRENCH))
|
||||
if(shattered && glass)
|
||||
to_chat(user, "<span class='notice'>The broken glass falls out.</span>")
|
||||
icon_state = "mirror_frame"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
)
|
||||
|
||||
/obj/structure/plasticflaps/attackby(obj/item/P, mob/user)
|
||||
if(P.is_wirecutter())
|
||||
if(P.has_tool_quality(TOOL_WIRECUTTER))
|
||||
playsound(src, P.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You start to cut the plastic flaps.</span>")
|
||||
if(do_after(user, 10 * P.toolspeed))
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
|
||||
/obj/structure/railing/attackby(obj/item/W as obj, mob/user as mob)
|
||||
// Dismantle
|
||||
if(W.is_wrench() && !anchored)
|
||||
if(W.has_tool_quality(TOOL_WRENCH) && !anchored)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
if(do_after(user, 20, src))
|
||||
user.visible_message("<b>\The [user]</b> dismantles \the [src].", "<span class='notice'>You dismantle \the [src].</span>")
|
||||
@@ -211,8 +211,8 @@
|
||||
return
|
||||
|
||||
// Repair
|
||||
if(health < maxhealth && istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/F = W
|
||||
if(health < maxhealth && W.has_tool_quality(TOOL_WELDER))
|
||||
var/obj/item/weapon/weldingtool/F = W.get_welder()
|
||||
if(F.welding)
|
||||
playsound(src, F.usesound, 50, 1)
|
||||
if(do_after(user, 20, src))
|
||||
@@ -221,7 +221,7 @@
|
||||
return
|
||||
|
||||
// Install
|
||||
if(W.is_screwdriver())
|
||||
if(W.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
user.visible_message(anchored ? "<b>\The [user]</b> begins unscrewing \the [src]." : "<b>\The [user]</b> begins fasten \the [src]." )
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
if(do_after(user, 10, src))
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/salvageable/attackby(obj/item/I, mob/user)
|
||||
if(I.is_crowbar())
|
||||
if(I.has_tool_quality(TOOL_CROWBAR))
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
var/actual_time = I.toolspeed * 170
|
||||
user.visible_message( \
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/sign/attackby(obj/item/tool, mob/user) //deconstruction
|
||||
if(tool.is_screwdriver() && !istype(src, /obj/structure/sign/scenery) && !istype(src, /obj/structure/sign/double))
|
||||
if(tool.has_tool_quality(TOOL_SCREWDRIVER) && !istype(src, /obj/structure/sign/scenery) && !istype(src, /obj/structure/sign/double))
|
||||
playsound(src, tool.usesound, 50, 1)
|
||||
unfasten(user)
|
||||
else ..()
|
||||
@@ -36,7 +36,7 @@
|
||||
var/original_type
|
||||
|
||||
/obj/item/sign/attackby(obj/item/tool as obj, mob/user as mob) //construction
|
||||
if(tool.is_screwdriver() && isturf(user.loc))
|
||||
if(tool.has_tool_quality(TOOL_SCREWDRIVER) && isturf(user.loc))
|
||||
var/direction = tgui_input_list(usr, "In which direction?", "Select direction.", list("North", "East", "South", "West", "Cancel"))
|
||||
if(direction == "Cancel") return
|
||||
var/target_type = original_type || /obj/structure/sign
|
||||
|
||||
@@ -183,8 +183,8 @@
|
||||
else
|
||||
playsound(src, 'sound/weapons/smash.ogg', 50, 1)
|
||||
CheckHardness()
|
||||
else if(istype(W,/obj/item/weapon/weldingtool) && breakable)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
else if(W.has_tool_quality(TOOL_WELDER) && breakable)
|
||||
var/obj/item/weapon/weldingtool/WT = W.get_welder()
|
||||
if(material.ignition_point && WT.remove_fuel(0, user))
|
||||
TemperatureAct(150)
|
||||
else
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/bed/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
dismantle()
|
||||
qdel(src)
|
||||
@@ -123,7 +123,7 @@
|
||||
add_padding(padding_type)
|
||||
return
|
||||
|
||||
else if(W.is_wirecutter())
|
||||
else if(W.has_tool_quality(TOOL_WIRECUTTER))
|
||||
if(!padding_material)
|
||||
to_chat(user, "\The [src] has no padding to remove.")
|
||||
return
|
||||
@@ -223,7 +223,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/bed/roller/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench() || istype(W,/obj/item/stack) || W.is_wirecutter())
|
||||
if(W.has_tool_quality(TOOL_WRENCH) || istype(W,/obj/item/stack) || W.has_tool_quality(TOOL_WIRECUTTER))
|
||||
return
|
||||
else if(istype(W,/obj/item/roller_holder))
|
||||
if(has_buckled_mobs())
|
||||
@@ -373,7 +373,7 @@
|
||||
buckle_lying = 1
|
||||
|
||||
/obj/structure/dirtybed/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
if(anchored)
|
||||
user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/bed/chair/office/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/stack) || W.is_wirecutter())
|
||||
if(istype(W,/obj/item/stack) || W.has_tool_quality(TOOL_WIRECUTTER))
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -273,7 +273,7 @@
|
||||
return
|
||||
|
||||
/obj/structure/bed/chair/wood/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/stack) || W.is_wirecutter())
|
||||
if(istype(W,/obj/item/stack) || W.has_tool_quality(TOOL_WIRECUTTER))
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
@@ -110,7 +110,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(W.is_wrench())
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
dismantle()
|
||||
qdel(src)
|
||||
@@ -144,7 +144,7 @@ var/global/list/stool_cache = list() //haha stool
|
||||
to_chat(user, "You add padding to \the [src].")
|
||||
add_padding(padding_type)
|
||||
return
|
||||
else if (W.is_wirecutter())
|
||||
else if (W.has_tool_quality(TOOL_WIRECUTTER))
|
||||
if(!padding_material)
|
||||
to_chat(user, "\The [src] has no padding to remove.")
|
||||
return
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
L.set_dir(dir)
|
||||
|
||||
/obj/structure/bed/chair/wheelchair/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench() || W.is_wirecutter() || istype(W,/obj/item/stack))
|
||||
if(W.has_tool_quality(TOOL_WRENCH) || W.has_tool_quality(TOOL_WIRECUTTER) || istype(W,/obj/item/stack))
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
phorontanks++
|
||||
else
|
||||
full = TRUE
|
||||
else if(I.is_wrench())
|
||||
else if(I.has_tool_quality(TOOL_WRENCH))
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='notice'>You lean down and unwrench [src].</span>")
|
||||
anchored = FALSE
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
icon_state = "[initial(icon_state)][open][cistern]"
|
||||
|
||||
/obj/structure/toilet/attackby(obj/item/I as obj, mob/living/user as mob)
|
||||
if(I.is_crowbar())
|
||||
if(I.has_tool_quality(TOOL_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(src, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
|
||||
if(do_after(user, 30))
|
||||
@@ -200,7 +200,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(I.is_wrench())
|
||||
if(I.has_tool_quality(TOOL_WRENCH))
|
||||
var/newtemp = tgui_input_list(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve", temperature_settings)
|
||||
to_chat(user, "<span class='notice'>You begin to adjust the temperature valve with \the [I].</span>")
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
|
||||
@@ -87,8 +87,8 @@
|
||||
|
||||
switch(state)
|
||||
if("01")
|
||||
if(istype(W, /obj/item/weapon/weldingtool) && !anchored )
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(W.has_tool_quality(TOOL_WELDER) && !anchored)
|
||||
var/obj/item/weapon/weldingtool/WT = W.get_welder()
|
||||
if (WT.remove_fuel(0,user))
|
||||
user.visible_message("[user] disassembles the windoor assembly.", "You start to disassemble the windoor assembly.")
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
@@ -106,7 +106,7 @@
|
||||
return
|
||||
|
||||
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
|
||||
if(W.is_wrench() && !anchored)
|
||||
if(W.has_tool_quality(TOOL_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.")
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
step = 0
|
||||
|
||||
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
|
||||
else if(W.is_wrench() && anchored)
|
||||
else if(W.has_tool_quality(TOOL_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.")
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
if("02")
|
||||
|
||||
//Removing wire from the assembly. Step 5 undone.
|
||||
if(W.is_wirecutter() && !src.electronics)
|
||||
if(W.has_tool_quality(TOOL_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.")
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
W.loc = src.loc
|
||||
|
||||
//Screwdriver to remove airlock electronics. Step 6 undone.
|
||||
else if(W.is_screwdriver() && src.electronics)
|
||||
else if(W.has_tool_quality(TOOL_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.")
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
ae.loc = src.loc
|
||||
|
||||
//Crowbar to complete the assembly, Step 7 complete.
|
||||
else if(W.is_crowbar())
|
||||
else if(W.has_tool_quality(TOOL_CROWBAR))
|
||||
if(!src.electronics)
|
||||
to_chat(usr,"<span class='warning'>The assembly is missing electronics.</span>")
|
||||
return
|
||||
|
||||
@@ -223,8 +223,8 @@
|
||||
if(!istype(W)) return//I really wish I did not need this
|
||||
|
||||
// Fixing.
|
||||
if(istype(W, /obj/item/weapon/weldingtool) && user.a_intent == I_HELP)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(W.has_tool_quality(TOOL_WELDER) && user.a_intent == I_HELP)
|
||||
var/obj/item/weapon/weldingtool/WT = W.get_welder()
|
||||
if(health < maxhealth)
|
||||
if(WT.remove_fuel(1 ,user))
|
||||
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
|
||||
@@ -265,7 +265,7 @@
|
||||
|
||||
if(W.flags & NOBLUDGEON) return
|
||||
|
||||
if(W.is_screwdriver())
|
||||
if(W.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
if(reinf && state >= 1)
|
||||
state = 3 - state
|
||||
update_nearby_icons()
|
||||
@@ -285,11 +285,11 @@
|
||||
update_verbs()
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
to_chat(user, "<span class='notice'>You have [anchored ? "" : "un"]fastened the window [anchored ? "to" : "from"] the floor.</span>")
|
||||
else if(W.is_crowbar() && reinf && state <= 1)
|
||||
else if(W.has_tool_quality(TOOL_CROWBAR) && reinf && state <= 1)
|
||||
state = 1 - state
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
to_chat(user, "<span class='notice'>You have pried the window [state ? "into" : "out of"] the frame.</span>")
|
||||
else if(W.is_wrench() && !anchored && (!state || !reinf))
|
||||
else if(W.has_tool_quality(TOOL_WRENCH) && !anchored && (!state || !reinf))
|
||||
if(!glasstype)
|
||||
to_chat(user, "<span class='notice'>You're not sure how to dismantle \the [src] properly.</span>")
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user