mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-13 08:57:01 +01:00
COMPLETELY FUCKING REFACTORS TOOL CHECKING CODE
dear FUCKING GOD why was it like this, it hurts soooo bad DDDD:
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/structure/AIcore/latejoin_inactive/attackby(obj/item/P, mob/user, params)
|
||||
if(istype(P, /obj/item/multitool))
|
||||
if(P.tool_behavior == TOOL_MULTITOOL)
|
||||
active = !active
|
||||
to_chat(user, "You [active? "activate" : "deactivate"] [src]'s transmitters.")
|
||||
return
|
||||
@@ -76,10 +76,10 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/AIcore/attackby(obj/item/P, mob/user, params)
|
||||
if(istype(P, /obj/item/wrench))
|
||||
if(P.tool_behavior == TOOL_WRENCH)
|
||||
return default_unfasten_wrench(user, P, 20)
|
||||
if(!anchored)
|
||||
if(istype(P, /obj/item/weldingtool) && can_deconstruct)
|
||||
if(P.tool_behavior == TOOL_WELDER && can_deconstruct)
|
||||
if(state != EMPTY_CORE)
|
||||
to_chat(user, "<span class='warning'>The core must be empty to deconstruct it!</span>")
|
||||
return
|
||||
@@ -105,13 +105,13 @@
|
||||
circuit = P
|
||||
return
|
||||
if(CIRCUIT_CORE)
|
||||
if(istype(P, /obj/item/screwdriver))
|
||||
if(P.tool_behavior == TOOL_SCREWDRIVER)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You screw the circuit board into place.</span>")
|
||||
state = SCREWED_CORE
|
||||
update_icon()
|
||||
return
|
||||
if(istype(P, /obj/item/crowbar))
|
||||
if(P.tool_behavior == TOOL_CROWBAR)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove the circuit board.</span>")
|
||||
state = EMPTY_CORE
|
||||
@@ -120,7 +120,7 @@
|
||||
circuit = null
|
||||
return
|
||||
if(SCREWED_CORE)
|
||||
if(istype(P, /obj/item/screwdriver) && circuit)
|
||||
if(P.tool_behavior == TOOL_SCREWDRIVER && circuit)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
|
||||
state = CIRCUIT_CORE
|
||||
@@ -139,7 +139,7 @@
|
||||
to_chat(user, "<span class='warning'>You need five lengths of cable to wire the AI core!</span>")
|
||||
return
|
||||
if(CABLED_CORE)
|
||||
if(istype(P, /obj/item/wirecutters))
|
||||
if(P.tool_behavior == TOOL_WIRECUTTER)
|
||||
if(brain)
|
||||
to_chat(user, "<span class='warning'>Get that [brain.name] out of there first!</span>")
|
||||
else
|
||||
@@ -201,7 +201,7 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(istype(P, /obj/item/crowbar) && brain)
|
||||
if(P.tool_behavior == TOOL_CROWBAR && brain)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove the brain.</span>")
|
||||
brain.forceMove(loc)
|
||||
@@ -210,7 +210,7 @@
|
||||
return
|
||||
|
||||
if(GLASS_CORE)
|
||||
if(istype(P, /obj/item/crowbar))
|
||||
if(P.tool_behavior == TOOL_CROWBAR)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You remove the glass panel.</span>")
|
||||
state = CABLED_CORE
|
||||
@@ -218,7 +218,7 @@
|
||||
new /obj/item/stack/sheet/rglass(loc, 2)
|
||||
return
|
||||
|
||||
if(istype(P, /obj/item/screwdriver))
|
||||
if(P.tool_behavior == TOOL_SCREWDRIVER)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
|
||||
if(brain)
|
||||
@@ -247,7 +247,7 @@
|
||||
P.transfer_ai("INACTIVE", "AICARD", src, user)
|
||||
return
|
||||
|
||||
if(istype(P, /obj/item/screwdriver))
|
||||
if(P.tool_behavior == TOOL_SCREWDRIVER)
|
||||
P.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You disconnect the monitor.</span>")
|
||||
state = GLASS_CORE
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
pick_sign(user)
|
||||
|
||||
/obj/structure/sign/barsign/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/screwdriver))
|
||||
if(I.tool_behavior == TOOL_SCREWDRIVER)
|
||||
if(!allowed(user))
|
||||
to_chat(user, "<span class='info'>Access denied.</span>")
|
||||
return
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/bed/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
|
||||
if(W.tool_behavior == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
|
||||
W.play_tool_sound(src)
|
||||
deconstruct(TRUE)
|
||||
else if(istype(W, /obj/item/bedsheet))
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/chair/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
|
||||
if(W.tool_behavior == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
|
||||
W.play_tool_sound(src)
|
||||
deconstruct()
|
||||
else if(istype(W, /obj/item/assembly/shock_kit))
|
||||
|
||||
@@ -45,7 +45,7 @@ LINEN BINS
|
||||
return
|
||||
|
||||
/obj/item/bedsheet/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/wirecutters) || I.is_sharp())
|
||||
if(I.tool_behavior == TOOL_WIRECUTTER || I.is_sharp())
|
||||
var/obj/item/stack/sheet/cloth/C = new (get_turf(src), 3)
|
||||
transfer_fingerprints_to(C)
|
||||
C.add_fingerprint(user)
|
||||
|
||||
@@ -343,7 +343,7 @@
|
||||
. = TRUE
|
||||
if(opened)
|
||||
if(istype(W, cutting_tool))
|
||||
if(istype(W, /obj/item/weldingtool))
|
||||
if(W.tool_behavior == TOOL_WELDER)
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
@@ -368,9 +368,9 @@
|
||||
return TRUE
|
||||
else if(istype(W, /obj/item/electronics/airlock))
|
||||
handle_lock_addition(user, W)
|
||||
else if(istype(W, /obj/item/screwdriver))
|
||||
else if(W.tool_behavior == TOOL_SCREWDRIVER)
|
||||
handle_lock_removal(user, W)
|
||||
else if(istype(W, /obj/item/weldingtool) && can_weld_shut)
|
||||
else if(W.tool_behavior == TOOL_WELDER && can_weld_shut)
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
@@ -387,7 +387,7 @@
|
||||
"<span class='notice'>You [welded ? "weld" : "unwelded"] \the [src] with \the [W].</span>",
|
||||
"<span class='italics'>You hear welding.</span>")
|
||||
update_icon()
|
||||
else if(istype(W, /obj/item/wrench) && anchorable)
|
||||
else if(W.tool_behavior == TOOL_WRENCH && anchorable)
|
||||
if(isinspace() && !anchored)
|
||||
return
|
||||
setAnchored(!anchored)
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
else
|
||||
name = "body bag"
|
||||
return
|
||||
else if(istype(I, /obj/item/wirecutters))
|
||||
else if(I.tool_behavior == TOOL_WIRECUTTER)
|
||||
to_chat(user, "<span class='notice'>You cut the tag off [src].</span>")
|
||||
name = "body bag"
|
||||
tagged = 0
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
to_chat(user, "<span class='warning'>You need a crowbar to pry this open!</span>")
|
||||
|
||||
/obj/structure/closet/crate/large/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/crowbar))
|
||||
if(W.tool_behavior == TOOL_CROWBAR)
|
||||
if(manifest)
|
||||
tear_manifest(user)
|
||||
|
||||
@@ -40,4 +40,4 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need a crowbar to pry this open!</span>")
|
||||
return FALSE //Just stop. Do nothing. Don't turn into an invisible sprite. Don't open like a locker.
|
||||
//The large crate has no non-attack interactions other than the crowbar, anyway.
|
||||
//The large crate has no non-attack interactions other than the crowbar, anyway.
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
toggle_lock(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
else if(istype(W, /obj/item/weldingtool) && user.a_intent == INTENT_HELP && !broken)
|
||||
else if(W.tool_behavior == TOOL_WELDER && user.a_intent == INTENT_HELP && !broken)
|
||||
if(obj_integrity < max_integrity)
|
||||
if(!W.tool_start_check(user, amount=5))
|
||||
return
|
||||
@@ -119,7 +119,7 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
|
||||
return
|
||||
else if(!alert && istype(W, /obj/item/crowbar) && openable) //Only applies to the lab cage and player made display cases
|
||||
else if(!alert && W.tool_behavior == TOOL_CROWBAR && openable) //Only applies to the lab cage and player made display cases
|
||||
if(broken)
|
||||
if(showpiece)
|
||||
to_chat(user, "<span class='notice'>Remove the displayed object first.</span>")
|
||||
@@ -189,7 +189,7 @@
|
||||
|
||||
|
||||
/obj/structure/displaycase_chassis/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/wrench)) //The player can only deconstruct the wooden frame
|
||||
if(I.tool_behaviour == TOOL_WRENCH) //The player can only deconstruct the wooden frame
|
||||
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 30))
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
return
|
||||
created_name = t
|
||||
|
||||
else if(istype(W, /obj/item/weldingtool) && (mineral || glass || !anchored ))
|
||||
else if(W.tool_behavior == TOOL_WELDER && (mineral || glass || !anchored ))
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
to_chat(user, "<span class='notice'>You disassemble the airlock assembly.</span>")
|
||||
deconstruct(TRUE)
|
||||
|
||||
else if(istype(W, /obj/item/wrench))
|
||||
else if(W.tool_behavior == TOOL_WRENCH)
|
||||
if(!anchored )
|
||||
var/door_check = 1
|
||||
for(var/obj/machinery/door/D in loc)
|
||||
@@ -134,7 +134,7 @@
|
||||
to_chat(user, "<span class='notice'>You wire the airlock assembly.</span>")
|
||||
name = "wired airlock assembly"
|
||||
|
||||
else if(istype(W, /obj/item/wirecutters) && state == AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS )
|
||||
else if(W.tool_behavior == TOOL_WIRECUTTER && state == AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS )
|
||||
user.visible_message("[user] cuts the wires from the airlock assembly.", \
|
||||
"<span class='notice'>You start to cut the wires from the airlock assembly...</span>")
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
electronics = W
|
||||
|
||||
|
||||
else if(istype(W, /obj/item/crowbar) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
|
||||
else if(W.tool_behavior == TOOL_CROWBAR && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
|
||||
user.visible_message("[user] removes the electronics from the airlock assembly.", \
|
||||
"<span class='notice'>You start to remove electronics from the airlock assembly...</span>")
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You cannot add [G] to [src]!</span>")
|
||||
|
||||
else if(istype(W, /obj/item/screwdriver) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
|
||||
else if(W.tool_behavior == TOOL_SCREWDRIVER && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
|
||||
user.visible_message("[user] finishes the airlock.", \
|
||||
"<span class='notice'>You start finishing the airlock...</span>")
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
anchored = TRUE
|
||||
|
||||
/obj/structure/dresser/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/wrench))
|
||||
if(I.tool_behaviour == TOOL_WRENCH)
|
||||
to_chat(user, "<span class='notice'>You begin to [anchored ? "unwrench" : "wrench"] [src].</span>")
|
||||
if(I.use_tool(src, user, 20, volume=50))
|
||||
to_chat(user, "<span class='notice'>You successfully [anchored ? "unwrench" : "wrench"] [src].</span>")
|
||||
@@ -90,7 +90,7 @@
|
||||
anchored = TRUE
|
||||
|
||||
/obj/structure/gmushroomdresser/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/wrench))
|
||||
if(I.tool_behaviour == TOOL_WRENCH)
|
||||
to_chat(user, "<span class='notice'>You begin to [anchored ? "unwrench" : "wrench"] [src].</span>")
|
||||
if(I.use_tool(src, user, 20, volume=50))
|
||||
to_chat(user, "<span class='notice'>You successfully [anchored ? "unwrench" : "wrench"] [src].</span>")
|
||||
@@ -173,7 +173,7 @@
|
||||
anchored = TRUE
|
||||
|
||||
/obj/structure/plaswooddresser/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/wrench))
|
||||
if(I.tool_behaviour == TOOL_WRENCH)
|
||||
to_chat(user, "<span class='notice'>You begin to [anchored ? "unwrench" : "wrench"] [src].</span>")
|
||||
if(I.use_tool(src, user, 20, volume=50))
|
||||
to_chat(user, "<span class='notice'>You successfully [anchored ? "unwrench" : "wrench"] [src].</span>")
|
||||
@@ -256,7 +256,7 @@
|
||||
anchored = TRUE
|
||||
|
||||
/obj/structure/shadowwdresser/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/wrench))
|
||||
if(I.tool_behaviour == TOOL_WRENCH)
|
||||
to_chat(user, "<span class='notice'>You begin to [anchored ? "unwrench" : "wrench"] [src].</span>")
|
||||
if(I.use_tool(src, user, 20, volume=50))
|
||||
to_chat(user, "<span class='notice'>You successfully [anchored ? "unwrench" : "wrench"] [src].</span>")
|
||||
@@ -328,4 +328,4 @@
|
||||
var/n_color = input(H, "Choose your [garment_type]'\s color.", "Character Preference", default_color) as color|null
|
||||
if(!n_color || !H.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
|
||||
return default_color
|
||||
return sanitize_hexcolor(n_color)
|
||||
return sanitize_hexcolor(n_color)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
add_overlay(mutable_appearance('icons/obj/chairs.dmi', "echair_over", MOB_LAYER + 1))
|
||||
|
||||
/obj/structure/chair/e_chair/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/wrench))
|
||||
if(W.tool_behavior == TOOL_WRENCH)
|
||||
var/obj/structure/chair/C = new /obj/structure/chair(loc)
|
||||
W.play_tool_sound(src)
|
||||
C.setDir(dir)
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/wrench) && !stored_extinguisher)
|
||||
if(I.tool_behaviour == TOOL_WRENCH && !stored_extinguisher)
|
||||
to_chat(user, "<span class='notice'>You start unsecuring [name]...</span>")
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 60))
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
to_chat(user, "<span class='warning'>You must wait until the door has stopped moving!</span>")
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
if(W.tool_behavior == TOOL_SCREWDRIVER)
|
||||
if(density)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T.density)
|
||||
@@ -106,7 +106,7 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You can't reach, close it first!</span>")
|
||||
|
||||
else if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
|
||||
else if(W.tool_behavior == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter))
|
||||
if(W.use_tool(src, user, 0, volume=50))
|
||||
dismantle(user, TRUE)
|
||||
else if(istype(W, /obj/item/pickaxe/drill/jackhammer))
|
||||
@@ -157,7 +157,7 @@
|
||||
|
||||
/obj/structure/falsewall/reinforced/attackby(obj/item/tool, mob/user)
|
||||
..()
|
||||
if(istype(tool, /obj/item/wirecutters))
|
||||
if(tool.tool_behavior == TOOL_WIRECUTTER)
|
||||
dismantle(user, TRUE, tool)
|
||||
|
||||
/*
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
hole_size = LARGE_HOLE
|
||||
|
||||
/obj/structure/fence/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/wirecutters))
|
||||
if(W.tool_behavior == TOOL_WIRECUTTER)
|
||||
if(!cuttable)
|
||||
to_chat(user, "<span class='notice'>This section of the fence can't be cut.</span>")
|
||||
return
|
||||
@@ -156,4 +156,4 @@
|
||||
#undef NO_HOLE
|
||||
#undef MEDIUM_HOLE
|
||||
#undef LARGE_HOLE
|
||||
#undef MAX_HOLE_SIZE
|
||||
#undef MAX_HOLE_SIZE
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/fireaxecabinet/attackby(obj/item/I, mob/user, params)
|
||||
if(iscyborg(user) || istype(I, /obj/item/multitool))
|
||||
if(iscyborg(user) || I.tool_behavior == TOOL_MULTITOOL)
|
||||
toggle_lock(user)
|
||||
else if(istype(I, /obj/item/weldingtool) && user.a_intent == INTENT_HELP && !broken)
|
||||
else if(I.tool_behavior == TOOL_WELDER && user.a_intent == INTENT_HELP && !broken)
|
||||
if(obj_integrity < max_integrity)
|
||||
if(!I.tool_start_check(user, amount=2))
|
||||
return
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
var/deconstructible = TRUE
|
||||
|
||||
/obj/structure/fluff/attackby(obj/item/I, mob/living/user, params)
|
||||
if(istype(I, /obj/item/wrench) && deconstructible)
|
||||
if(I.tool_behaviour == TOOL_WRENCH && deconstructible)
|
||||
user.visible_message("<span class='notice'>[user] starts disassembling [src]...</span>", "<span class='notice'>You start disassembling [src]...</span>")
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 50))
|
||||
|
||||
@@ -349,7 +349,7 @@
|
||||
new /obj/item/stack/sheet/runed_metal(drop_location(), 1)
|
||||
qdel(src)
|
||||
|
||||
else if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
|
||||
else if(W.tool_behavior == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter))
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
@@ -424,7 +424,7 @@
|
||||
|
||||
/obj/structure/girder/bronze/attackby(obj/item/W, mob/living/user, params)
|
||||
add_fingerprint(user)
|
||||
if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
|
||||
if(W.tool_behavior == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter))
|
||||
if(!W.tool_start_check(user, amount = 0))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start slicing apart [src]...</span>")
|
||||
|
||||
@@ -136,11 +136,11 @@
|
||||
/obj/structure/grille/attackby(obj/item/W, mob/user, params)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
add_fingerprint(user)
|
||||
if(istype(W, /obj/item/wirecutters))
|
||||
if(W.tool_behavior == TOOL_WIRECUTTER)
|
||||
if(!shock(user, 100))
|
||||
W.play_tool_sound(src, 100)
|
||||
deconstruct()
|
||||
else if((istype(W, /obj/item/screwdriver)) && (isturf(loc) || anchored))
|
||||
else if((W.tool_behavior == TOOL_SCREWDRIVER) && (isturf(loc) || anchored))
|
||||
if(!shock(user, 90))
|
||||
W.play_tool_sound(src, 100)
|
||||
setAnchored(!anchored)
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
to_chat(user, "<span class='warning'>[src] can't hold any more signs!</span>")
|
||||
else if(mybag)
|
||||
mybag.attackby(I, user)
|
||||
else if(istype(I, /obj/item/crowbar))
|
||||
else if(I.tool_behavior == TOOL_CROWBAR)
|
||||
user.visible_message("[user] begins to empty the contents of [src].", "<span class='notice'>You begin to empty the contents of [src]...</span>")
|
||||
if(I.use_tool(src, user, 30))
|
||||
to_chat(usr, "<span class='notice'>You empty the contents of [src]'s bucket onto the floor.</span>")
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
var/obj/F = new /obj/structure/kitchenspike(src.loc)
|
||||
transfer_fingerprints_to(F)
|
||||
qdel(src)
|
||||
else if(istype(I, /obj/item/weldingtool))
|
||||
else if(I.tool_behavior == TOOL_WELDER)
|
||||
if(!I.tool_start_check(user, amount=0))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
|
||||
@@ -240,4 +240,4 @@
|
||||
untie_mob(L)
|
||||
return ..()
|
||||
|
||||
#undef VIABLE_MOB_CHECK
|
||||
#undef VIABLE_MOB_CHECK
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
/obj/structure/lattice/attackby(obj/item/C, mob/user, params)
|
||||
if(resistance_flags & INDESTRUCTIBLE)
|
||||
return
|
||||
if(istype(C, /obj/item/wirecutters))
|
||||
if(C.tool_behavior == TOOL_WIRECUTTER)
|
||||
to_chat(user, "<span class='notice'>Slicing [name] joints ...</span>")
|
||||
deconstruct()
|
||||
else
|
||||
|
||||
@@ -47,7 +47,7 @@ obj/structure/medkit_cabinet/contents_explosion(severity, target)
|
||||
|
||||
//disassembly code
|
||||
/obj/structure/medkit_cabinet/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/wrench) && !stored_medkit)
|
||||
if(I.tool_behaviour == TOOL_WRENCH && !stored_medkit)
|
||||
to_chat(user, "<span class='notice'>You start unsecuring [name]...</span>")
|
||||
I.play_tool_sound(src)
|
||||
if(I.use_tool(src, user, 60))
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
anchored = TRUE
|
||||
return TRUE
|
||||
|
||||
if(istype(item, /obj/item/crowbar))
|
||||
if(item.tool_behavior == TOOL_CROWBAR)
|
||||
to_chat(user,"<span class='notice'>You pry the bricks from the floor.</span>")
|
||||
anchored = FALSE
|
||||
return TRUE
|
||||
|
||||
@@ -79,13 +79,13 @@
|
||||
if(admin)
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
if(W.tool_behavior == TOOL_SCREWDRIVER)
|
||||
can_rotate = !can_rotate
|
||||
to_chat(user, "<span class='notice'>You [can_rotate ? "unlock" : "lock"] [src]'s rotation.</span>")
|
||||
W.play_tool_sound(src)
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/wrench))
|
||||
if(W.tool_behavior == TOOL_WRENCH)
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='warning'>Unweld [src] from the floor first!</span>")
|
||||
return
|
||||
@@ -96,7 +96,7 @@
|
||||
if(buildstackamount)
|
||||
new buildstacktype(drop_location(), buildstackamount)
|
||||
qdel(src)
|
||||
else if(istype(W, /obj/item/weldingtool))
|
||||
else if(W.tool_behavior == TOOL_WELDER)
|
||||
if(obj_integrity < max_integrity)
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
//However if a player wants to move an existing showcase or remove one, this is for that.
|
||||
|
||||
/obj/structure/showcase/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/screwdriver) && !anchored)
|
||||
if(W.tool_behavior == TOOL_SCREWDRIVER && !anchored)
|
||||
if(deconstruction_state == SHOWCASE_SCREWDRIVERED)
|
||||
to_chat(user, "<span class='notice'>You screw the screws back into the showcase.</span>")
|
||||
W.play_tool_sound(src, 100)
|
||||
@@ -119,7 +119,7 @@
|
||||
W.play_tool_sound(src, 100)
|
||||
deconstruction_state = SHOWCASE_SCREWDRIVERED
|
||||
|
||||
if(istype(W, /obj/item/crowbar) && deconstruction_state == SHOWCASE_SCREWDRIVERED)
|
||||
if(W.tool_behavior == TOOL_CROWBAR && deconstruction_state == SHOWCASE_SCREWDRIVERED)
|
||||
if(W.use_tool(src, user, 20, volume=100))
|
||||
to_chat(user, "<span class='notice'>You start to crowbar the showcase apart...</span>")
|
||||
new /obj/item/stack/sheet/metal(drop_location(), 4)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
playsound(loc, 'sound/items/welder.ogg', 80, 1)
|
||||
|
||||
/obj/structure/sign/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/wrench) && buildable_sign)
|
||||
if(I.tool_behaviour == TOOL_WRENCH && buildable_sign)
|
||||
user.visible_message("<span class='notice'>[user] starts removing [src]...</span>", \
|
||||
"<span class='notice'>You start unfastening [src].</span>")
|
||||
I.play_tool_sound(src)
|
||||
@@ -165,4 +165,4 @@
|
||||
/obj/structure/sign/carts
|
||||
name = "CARTS"
|
||||
desc = "You are entering a motorized cart area."
|
||||
icon_state = "carts"
|
||||
icon_state = "carts"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(default_unfasten_wrench(user, W))
|
||||
return
|
||||
if(istype(W, /obj/item/weldingtool) || istype(W, /obj/item/gun/energy/plasmacutter))
|
||||
if(W.tool_behavior == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter))
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -148,13 +148,13 @@
|
||||
|
||||
/obj/structure/table/attackby(obj/item/I, mob/user, params)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(istype(I, /obj/item/screwdriver) && deconstruction_ready)
|
||||
if(I.tool_behavior == TOOL_SCREWDRIVER && deconstruction_ready)
|
||||
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
|
||||
if(I.use_tool(src, user, 20, volume=50))
|
||||
deconstruct(TRUE)
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/wrench) && deconstruction_ready)
|
||||
if(I.tool_behaviour == TOOL_WRENCH && deconstruction_ready)
|
||||
to_chat(user, "<span class='notice'>You start deconstructing [src]...</span>")
|
||||
if(I.use_tool(src, user, 40, volume=50))
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
@@ -495,7 +495,7 @@
|
||||
to_chat(user, "<span class='notice'>The top cover is firmly <b>welded</b> on.</span>")
|
||||
|
||||
/obj/structure/table/reinforced/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weldingtool))
|
||||
if(W.tool_behavior == TOOL_WELDER)
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
@@ -647,7 +647,7 @@
|
||||
step(O, get_dir(O, src))
|
||||
|
||||
/obj/structure/rack/attackby(obj/item/W, mob/user, params)
|
||||
if (istype(W, /obj/item/wrench) && !(flags_1&NODECONSTRUCT_1))
|
||||
if (W.tool_behavior == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
|
||||
W.play_tool_sound(src)
|
||||
deconstruct(TRUE)
|
||||
return
|
||||
@@ -706,7 +706,7 @@
|
||||
var/building = FALSE
|
||||
|
||||
/obj/item/rack_parts/attackby(obj/item/W, mob/user, params)
|
||||
if (istype(W, /obj/item/wrench))
|
||||
if (W.tool_behavior == TOOL_WRENCH)
|
||||
new /obj/item/stack/sheet/metal(user.loc)
|
||||
qdel(src)
|
||||
else
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
oxygentanks++
|
||||
else
|
||||
full = TRUE
|
||||
else if(istype(I, /obj/item/wrench))
|
||||
else if(I.tool_behaviour == TOOL_WRENCH)
|
||||
default_unfasten_wrench(user, I, time = 20)
|
||||
return
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/crowbar))
|
||||
if(W.tool_behavior == TOOL_CROWBAR)
|
||||
for(var/obj/structure/transit_tube_pod/P in loc)
|
||||
P.deconstruct(FALSE, user)
|
||||
else
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
deconstruct(FALSE)
|
||||
|
||||
/obj/structure/transit_tube/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/wrench))
|
||||
if(W.tool_behavior == TOOL_WRENCH)
|
||||
if(tube_construction)
|
||||
for(var/obj/structure/transit_tube_pod/pod in src.loc)
|
||||
to_chat(user, "<span class='warning'>Remove the pod first!</span>")
|
||||
@@ -50,7 +50,7 @@
|
||||
transfer_fingerprints_to(R)
|
||||
R.add_fingerprint(user)
|
||||
qdel(src)
|
||||
else if(istype(W, /obj/item/crowbar))
|
||||
else if(W.tool_behavior == TOOL_CROWBAR)
|
||||
for(var/obj/structure/transit_tube_pod/pod in src.loc)
|
||||
pod.attackby(W, user)
|
||||
else
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
icon_state = "pod"
|
||||
|
||||
/obj/structure/transit_tube_pod/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/crowbar))
|
||||
if(I.tool_behavior == TOOL_CROWBAR)
|
||||
if(!moving)
|
||||
I.play_tool_sound(src)
|
||||
if(contents.len)
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
|
||||
/obj/structure/toilet/attackby(obj/item/I, mob/living/user, params)
|
||||
if(istype(I, /obj/item/crowbar))
|
||||
if(I.tool_behavior == 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(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
|
||||
if(I.use_tool(src, user, 30))
|
||||
@@ -596,7 +596,7 @@
|
||||
to_chat(user, "<span class='warning'>Someone's already washing here.</span>")
|
||||
return
|
||||
|
||||
if (istype(O, /obj/item/wrench) && user.a_intent == INTENT_HELP)
|
||||
if (O.tool_behavior == TOOL_WRENCH && user.a_intent == INTENT_HELP)
|
||||
to_chat(user, "<span class='notice'>You start deconstructing [src]...</span>")
|
||||
O.play_tool_sound(src)
|
||||
|
||||
@@ -774,4 +774,4 @@
|
||||
else
|
||||
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
|
||||
if(BURN)
|
||||
playsound(loc, 'sound/items/welder.ogg', 80, 1)
|
||||
playsound(loc, 'sound/items/welder.ogg', 80, 1)
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
add_fingerprint(user)
|
||||
switch(state)
|
||||
if("01")
|
||||
if(istype(W, /obj/item/weldingtool) && !anchored)
|
||||
if(W.tool_behavior == TOOL_WELDER && !anchored)
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
return
|
||||
|
||||
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
|
||||
if(istype(W, /obj/item/wrench) && !anchored)
|
||||
if(W.tool_behavior == TOOL_WRENCH && !anchored)
|
||||
for(var/obj/machinery/door/window/WD in loc)
|
||||
if(WD.dir == dir)
|
||||
to_chat(user, "<span class='warning'>There is already a windoor in that location!</span>")
|
||||
@@ -128,7 +128,7 @@
|
||||
name = "anchored windoor assembly"
|
||||
|
||||
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
|
||||
else if(istype(W, /obj/item/wrench) && anchored)
|
||||
else if(W.tool_behavior == TOOL_WRENCH && anchored)
|
||||
user.visible_message("[user] unsecures the windoor assembly to the floor.",
|
||||
"<span class='notice'>You start to unsecure the windoor assembly to the floor...</span>")
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
if("02")
|
||||
|
||||
//Removing wire from the assembly. Step 5 undone.
|
||||
if(istype(W, /obj/item/wirecutters))
|
||||
if(W.tool_behavior == TOOL_WIRECUTTER)
|
||||
user.visible_message("[user] cuts the wires from the airlock assembly.", "<span class='notice'>You start to cut the wires from airlock assembly...</span>")
|
||||
|
||||
if(W.use_tool(src, user, 40, volume=100))
|
||||
@@ -219,7 +219,7 @@
|
||||
W.forceMove(drop_location())
|
||||
|
||||
//Screwdriver to remove airlock electronics. Step 6 undone.
|
||||
else if(istype(W, /obj/item/screwdriver))
|
||||
else if(W.tool_behavior == TOOL_SCREWDRIVER)
|
||||
if(!electronics)
|
||||
return
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
|
||||
|
||||
//Crowbar to complete the assembly, Step 7 complete.
|
||||
else if(istype(W, /obj/item/crowbar))
|
||||
else if(W.tool_behavior == TOOL_CROWBAR)
|
||||
if(!electronics)
|
||||
to_chat(usr, "<span class='warning'>The assembly is missing electronics!</span>")
|
||||
return
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
add_fingerprint(user)
|
||||
|
||||
if(istype(I, /obj/item/weldingtool) && user.a_intent == INTENT_HELP)
|
||||
if(I.tool_behavior == TOOL_WELDER && user.a_intent == INTENT_HELP)
|
||||
if(obj_integrity < max_integrity)
|
||||
if(!I.tool_start_check(user, amount=0))
|
||||
return
|
||||
@@ -181,7 +181,7 @@
|
||||
return
|
||||
|
||||
if(!(flags_1&NODECONSTRUCT_1))
|
||||
if(istype(I, /obj/item/screwdriver))
|
||||
if(I.tool_behavior == TOOL_SCREWDRIVER)
|
||||
I.play_tool_sound(src, 75)
|
||||
if(reinf)
|
||||
if(state == WINDOW_SCREWED_TO_FRAME || state == WINDOW_IN_FRAME)
|
||||
@@ -202,7 +202,7 @@
|
||||
return
|
||||
|
||||
|
||||
else if (istype(I, /obj/item/crowbar) && reinf && (state == WINDOW_OUT_OF_FRAME || state == WINDOW_IN_FRAME))
|
||||
else if (I.tool_behavior == TOOL_CROWBAR && reinf && (state == WINDOW_OUT_OF_FRAME || state == WINDOW_IN_FRAME))
|
||||
to_chat(user, "<span class='notice'>You begin to lever the window [state == WINDOW_OUT_OF_FRAME ? "into":"out of"] the frame...</span>")
|
||||
I.play_tool_sound(src, 75)
|
||||
if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src,PROC_REF(check_state_and_anchored), state, anchored)))
|
||||
@@ -210,7 +210,7 @@
|
||||
to_chat(user, "<span class='notice'>You pry the window [state == WINDOW_IN_FRAME ? "into":"out of"] the frame.</span>")
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/wrench) && !anchored)
|
||||
else if(I.tool_behaviour == TOOL_WRENCH && !anchored)
|
||||
I.play_tool_sound(src, 75)
|
||||
to_chat(user, "<span class='notice'> You begin to disassemble [src]...</span>")
|
||||
if(I.use_tool(src, user, decon_speed, extra_checks = CALLBACK(src,PROC_REF(check_state_and_anchored), state, anchored)))
|
||||
|
||||
Reference in New Issue
Block a user