Merge pull request #265 from ReoDaProtovali/Conveyor-Fixes

Conveyor fixes and yuuuuuge tool refactor
This commit is contained in:
evilew
2024-09-11 16:37:29 +02:00
committed by GitHub
187 changed files with 627 additions and 612 deletions

View File

@@ -74,7 +74,7 @@ handles linking back and forth.
_MakeLocal()
/datum/component/remote_materials/proc/OnAttackBy(datum/source, obj/item/I, mob/user)
if (istype(I, /obj/item/multitool))
if (I.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/multitool/M = I
if (!QDELETED(M.buffer) && istype(M.buffer, /obj/machinery/ore_silo))
if (silo == M.buffer)

View File

@@ -901,10 +901,6 @@
. = chosen_langtype
/* End language procs */
/atom/movable/proc/ConveyorMove(movedir)
set waitfor = FALSE
if(!anchored && has_gravity())
step(src, movedir)
//Returns an atom's power cell, if it has one. Overload for individual items.
/atom/movable/proc/get_cell()

View File

@@ -77,7 +77,7 @@
O.add_fingerprint(user)
update_icon()
else if(istype(O, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
else if(O.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM)
if(stat & BROKEN)
if(!O.tool_start_check(user, amount=0))
return

View File

@@ -60,14 +60,14 @@ GLOBAL_LIST_EMPTY(announcement_systems)
update_icon()
/obj/machinery/announcement_system/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/screwdriver))
if(P.tool_behaviour == TOOL_SCREWDRIVER)
P.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, "<span class='notice'>You [panel_open ? "open" : "close"] the maintenance hatch of [src].</span>")
update_icon()
else if(default_deconstruction_crowbar(P))
return
else if(istype(P, /obj/item/multitool) && panel_open && (stat & BROKEN))
else if(P.tool_behaviour == TOOL_MULTITOOL && panel_open && (stat & BROKEN))
to_chat(user, "<span class='notice'>You reset [src]'s firmware.</span>")
stat &= ~BROKEN
update_icon()

View File

@@ -73,7 +73,7 @@
O.add_fingerprint(user)
update_icon()
else if(istype(O, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
else if(O.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM)
if(obj_integrity < max_integrity)
if(!O.tool_start_check(user, amount=0))
return

View File

@@ -56,7 +56,7 @@
. += "button-board"
/obj/machinery/button/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(panel_open || allowed(user))
default_deconstruction_screwdriver(user, "button-open", "[skin]",W)
update_icon()
@@ -84,7 +84,7 @@
req_access = board.accesses
to_chat(user, "<span class='notice'>You add [W] to the button.</span>")
if(!device && !board && istype(W, /obj/item/wrench))
if(!device && !board && W.tool_behaviour == TOOL_WRENCH)
to_chat(user, "<span class='notice'>You start unsecuring the button frame...</span>")
W.play_tool_sound(src)
if(W.use_tool(src, user, 40))

View File

@@ -39,7 +39,7 @@
switch(state)
if(1)
// State 1
if(istype(W, /obj/item/weldingtool))
if(W.tool_behaviour == TOOL_WELDER)
if(weld(W, user))
to_chat(user, "<span class='notice'>You weld the assembly securely into place.</span>")
setAnchored(TRUE)
@@ -57,7 +57,7 @@
return
return
else if(istype(W, /obj/item/weldingtool))
else if(W.tool_behaviour == TOOL_WELDER)
if(weld(W, user))
to_chat(user, "<span class='notice'>You unweld the assembly from its place.</span>")

View File

@@ -310,7 +310,9 @@
if(default_deconstruction_crowbar(W))
return
if(istype(W, /obj/item/multitool))
if(W.tool_behaviour == TOOL_MULTITOOL)
if(!multitool_check_buffer(user, W))
return
var/obj/item/multitool/P = W
if(istype(P.buffer, /obj/machinery/computer/cloning))

View File

@@ -9,8 +9,8 @@
icon_screen = "ai-fixer"
light_color = LIGHT_COLOR_PINK
/obj/machinery/computer/aifixer/attackby(obj/I, mob/user, params)
if(occupier && istype(I, /obj/item/screwdriver))
/obj/machinery/computer/aifixer/attackby(obj/item/I, mob/user, params)
if(occupier && I.tool_behaviour == TOOL_SCREWDRIVER)
if(stat & (NOPOWER|BROKEN))
to_chat(user, "<span class='warning'>The screws on [name]'s screen won't budge.</span>")
else

View File

@@ -7,14 +7,14 @@
add_fingerprint(user)
switch(state)
if(0)
if(istype(P, /obj/item/wrench))
if(P.tool_behaviour == TOOL_WRENCH)
to_chat(user, "<span class='notice'>You start wrenching the frame into place...</span>")
if(P.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You wrench the frame into place.</span>")
setAnchored(TRUE)
state = 1
return
if(istype(P, /obj/item/weldingtool))
if(P.tool_behaviour == TOOL_WELDER)
if(!P.tool_start_check(user, amount=0))
return
@@ -26,7 +26,7 @@
qdel(src)
return
if(1)
if(istype(P, /obj/item/wrench))
if(P.tool_behaviour == TOOL_WRENCH)
to_chat(user, "<span class='notice'>You start to unfasten the frame...</span>")
if(P.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You unfasten the frame.</span>")
@@ -46,13 +46,13 @@
else if(istype(P, /obj/item/circuitboard) && !circuit)
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
return
if(istype(P, /obj/item/screwdriver) && circuit)
if(P.tool_behaviour == TOOL_SCREWDRIVER && circuit)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You screw [circuit] into place.</span>")
state = 2
icon_state = "2"
return
if(istype(P, /obj/item/crowbar) && circuit)
if(P.tool_behaviour == TOOL_CROWBAR && circuit)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove [circuit].</span>")
state = 1
@@ -62,7 +62,7 @@
circuit = null
return
if(2)
if(istype(P, /obj/item/screwdriver) && circuit)
if(P.tool_behaviour == TOOL_SCREWDRIVER && circuit)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
state = 1
@@ -80,7 +80,7 @@
icon_state = "3"
return
if(3)
if(istype(P, /obj/item/wirecutters))
if(P.tool_behaviour == TOOL_WIRECUTTER)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the cables.</span>")
state = 2
@@ -102,7 +102,7 @@
src.icon_state = "4"
return
if(4)
if(istype(P, /obj/item/crowbar))
if(P.tool_behaviour == TOOL_CROWBAR)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the glass panel.</span>")
state = 3
@@ -110,7 +110,7 @@
var/obj/item/stack/sheet/glass/G = new(drop_location(), 2)
G.add_fingerprint(user)
return
if(istype(P, /obj/item/screwdriver))
if(P.tool_behaviour == TOOL_SCREWDRIVER)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
var/obj/B = new circuit.build_path (loc, circuit)

View File

@@ -132,7 +132,7 @@
to_chat(user, "<span class='notice'>You insert [W].</span>")
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0)
src.updateUsrDialog()
else if(istype(W, /obj/item/multitool))
else if(W.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/multitool/P = W
if(istype(P.buffer, /obj/machinery/clonepod))

View File

@@ -91,7 +91,7 @@
icon_state = "box_1"
return
if(istype(P, /obj/item/screwdriver) && !anchored)
if(P.tool_behaviour == TOOL_SCREWDRIVER && !anchored)
user.visible_message("<span class='warning'>[user] disassembles the frame.</span>", \
"<span class='notice'>You start to disassemble the frame...</span>", "You hear banging and clanking.")
if(P.use_tool(src, user, 40, volume=50))
@@ -101,7 +101,7 @@
M.add_fingerprint(user)
qdel(src)
return
if(istype(P, /obj/item/wrench))
if(P.tool_behaviour == TOOL_WRENCH)
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
if(P.use_tool(src, user, 40, volume=75))
if(state == 1)
@@ -110,7 +110,7 @@
return
if(2)
if(istype(P, /obj/item/wrench))
if(P.tool_behaviour == TOOL_WRENCH)
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
if(P.use_tool(src, user, 40, volume=75))
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>")
@@ -138,7 +138,7 @@
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
return
if(istype(P, /obj/item/wirecutters))
if(P.tool_behaviour == TOOL_WIRECUTTER)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the cables.</span>")
state = 1
@@ -147,7 +147,7 @@
return
if(3)
if(istype(P, /obj/item/crowbar))
if(P.tool_behaviour == TOOL_CROWBAR)
P.play_tool_sound(src)
state = 2
circuit.forceMove(drop_location())
@@ -165,14 +165,14 @@
icon_state = "box_1"
return
if(istype(P, /obj/item/wrench) && !circuit.needs_anchored)
if(P.tool_behaviour == TOOL_WRENCH && !circuit.needs_anchored)
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
if(P.use_tool(src, user, 40, volume=75))
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>")
setAnchored(!anchored)
return
if(istype(P, /obj/item/screwdriver))
if(P.tool_behaviour == TOOL_SCREWDRIVER)
var/component_check = 1
for(var/R in req_components)
if(req_components[R] > 0)

View File

@@ -34,7 +34,7 @@
/obj/machinery/jukebox/attackby(obj/item/O, mob/user, params)
if(!active && !(flags_1 & NODECONSTRUCT_1))
if(istype(O, /obj/item/wrench))
if(O.tool_behaviour == TOOL_WRENCH)
if(!anchored && !isinspace())
to_chat(user,"<span class='notice'>You secure [src] to the floor.</span>")
setAnchored(TRUE)

View File

@@ -26,7 +26,7 @@
return
/obj/structure/barricade/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weldingtool) && user.a_intent != INTENT_HARM && material == METAL)
if(I.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM && material == METAL)
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount=0))
return

View File

@@ -908,7 +908,7 @@
update_icon()
return
if(AIRLOCK_SECURITY_METAL)
if(istype(C, /obj/item/weldingtool))
if(C.tool_behaviour == TOOL_WELDER)
if(!C.tool_start_check(user, amount=2))
return
to_chat(user, "<span class='notice'>You begin cutting the panel's shielding...</span>")
@@ -923,7 +923,7 @@
update_icon()
return
if(AIRLOCK_SECURITY_PLASTEEL_I_S)
if(istype(C, /obj/item/crowbar))
if(C.tool_behaviour == TOOL_CROWBAR)
var/obj/item/crowbar/W = C
to_chat(user, "<span class='notice'>You start removing the inner layer of shielding...</span>")
if(W.use_tool(src, user, 40, volume=100))
@@ -940,7 +940,7 @@
update_icon()
return
if(AIRLOCK_SECURITY_PLASTEEL_I)
if(istype(C, /obj/item/weldingtool))
if(C.tool_behaviour == TOOL_WELDER)
if(!C.tool_start_check(user, amount=2))
return
to_chat(user, "<span class='notice'>You begin cutting the inner layer of shielding...</span>")
@@ -953,7 +953,7 @@
security_level = AIRLOCK_SECURITY_PLASTEEL_I_S
return
if(AIRLOCK_SECURITY_PLASTEEL_O_S)
if(istype(C, /obj/item/crowbar))
if(C.tool_behaviour == TOOL_CROWBAR)
to_chat(user, "<span class='notice'>You start removing outer layer of shielding...</span>")
if(C.use_tool(src, user, 40, volume=100))
if(!panel_open)
@@ -966,7 +966,7 @@
spawn_atom_to_turf(/obj/item/stack/sheet/plasteel, user.loc, 1)
return
if(AIRLOCK_SECURITY_PLASTEEL_O)
if(istype(C, /obj/item/weldingtool))
if(C.tool_behaviour == TOOL_WELDER)
if(!C.tool_start_check(user, amount=2))
return
to_chat(user, "<span class='notice'>You begin cutting the outer layer of shielding...</span>")
@@ -979,7 +979,7 @@
security_level = AIRLOCK_SECURITY_PLASTEEL_O_S
return
if(AIRLOCK_SECURITY_PLASTEEL)
if(istype(C, /obj/item/wirecutters))
if(C.tool_behaviour == TOOL_WIRECUTTER)
if(src.hasPower() && src.shock(user, 60)) // Protective grille of wiring is electrified
return
to_chat(user, "<span class='notice'>You start cutting through the outer grille.</span>")
@@ -990,7 +990,7 @@
"<span class='notice'>You cut through \the [src]'s outer grille.</span>")
security_level = AIRLOCK_SECURITY_PLASTEEL_O
return
if(istype(C, /obj/item/screwdriver))
if(C.tool_behaviour == TOOL_SCREWDRIVER)
if(panel_open && detonated)
to_chat(user, "<span class='warning'>[src] has no maintenance panel!</span>")
return
@@ -998,7 +998,7 @@
to_chat(user, "<span class='notice'>You [panel_open ? "open":"close"] the maintenance panel of the airlock.</span>")
C.play_tool_sound(src)
src.update_icon()
else if(istype(C, /obj/item/wirecutters) && note)
else if(C.tool_behaviour == TOOL_WIRECUTTER && note)
user.visible_message("<span class='notice'>[user] cuts down [note] from [src].</span>", "<span class='notice'>You remove [note] from [src].</span>")
C.play_tool_sound(src)
note.forceMove(get_turf(user))
@@ -1077,7 +1077,7 @@
/obj/machinery/door/airlock/try_to_crowbar(obj/item/I, mob/living/user)
var/beingcrowbarred = null
if(istype(I, /obj/item/crowbar) )
if(I.tool_behaviour == TOOL_CROWBAR )
beingcrowbarred = 1
else
beingcrowbarred = 0

View File

@@ -696,7 +696,7 @@
/obj/machinery/door/airlock/clockwork/proc/attempt_construction(obj/item/I, mob/living/user)
if(!I || !user || !user.canUseTopic(src))
return 0
else if(istype(I, /obj/item/wrench))
else if(I.tool_behaviour == TOOL_WRENCH)
if(construction_state == GEAR_SECURE)
user.visible_message("<span class='notice'>[user] begins loosening [src]'s cogwheel...</span>", "<span class='notice'>You begin loosening [src]'s cogwheel...</span>")
if(!I.use_tool(src, user, 75, volume=50) || construction_state != GEAR_SECURE)
@@ -712,7 +712,7 @@
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
construction_state = GEAR_SECURE
return 1
else if(istype(I, /obj/item/crowbar))
else if(I.tool_behaviour == TOOL_CROWBAR)
if(construction_state == GEAR_SECURE)
to_chat(user, "<span class='warning'>[src]'s cogwheel is too tightly secured! Your [I.name] can't reach under it!</span>")
return 1

View File

@@ -195,10 +195,10 @@
return
/obj/machinery/door/attackby(obj/item/I, mob/user, params)
if(user.a_intent != INTENT_HARM && (istype(I, /obj/item/crowbar) || istype(I, /obj/item/twohanded/fireaxe)))
if(user.a_intent != INTENT_HARM && (I.tool_behaviour == TOOL_CROWBAR || istype(I, /obj/item/twohanded/fireaxe)))
try_to_crowbar(I, user)
return 1
else if(istype(I, /obj/item/weldingtool))
else if(I.tool_behaviour == TOOL_WELDER)
try_to_weld(I, user)
return 1
else if(!(I.item_flags & NOBLUDGEON) && user.a_intent != INTENT_HARM)

View File

@@ -100,7 +100,7 @@
return
if(welded)
if(istype(C, /obj/item/wrench))
if(C.tool_behaviour == TOOL_WRENCH)
if(boltslocked)
to_chat(user, "<span class='notice'>There are screws locking the bolts in place!</span>")
return
@@ -114,7 +114,7 @@
"<span class='notice'>You undo [src]'s floor bolts.</span>")
deconstruct(TRUE)
return
if(istype(C, /obj/item/screwdriver))
if(C.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message("<span class='notice'>[user] [boltslocked ? "unlocks" : "locks"] [src]'s bolts.</span>", \
"<span class='notice'>You [boltslocked ? "unlock" : "lock"] [src]'s floor bolts.</span>")
C.play_tool_sound(src)
@@ -290,7 +290,7 @@
/obj/structure/firelock_frame/attackby(obj/item/C, mob/user)
switch(constructionStep)
if(CONSTRUCTION_PANEL_OPEN)
if(istype(C, /obj/item/crowbar))
if(C.tool_behaviour == TOOL_CROWBAR)
C.play_tool_sound(src)
user.visible_message("<span class='notice'>[user] starts prying something out from [src]...</span>", \
"<span class='notice'>You begin prying out the wire cover...</span>")
@@ -304,7 +304,7 @@
constructionStep = CONSTRUCTION_WIRES_EXPOSED
update_icon()
return
if(istype(C, /obj/item/wrench))
if(C.tool_behaviour == TOOL_WRENCH)
if(locate(/obj/machinery/door/firedoor) in get_turf(src))
to_chat(user, "<span class='warning'>There's already a firelock there.</span>")
return
@@ -346,7 +346,7 @@
return
if(CONSTRUCTION_WIRES_EXPOSED)
if(istype(C, /obj/item/wirecutters))
if(C.tool_behaviour == TOOL_WIRECUTTER)
C.play_tool_sound(src)
user.visible_message("<span class='notice'>[user] starts cutting the wires from [src]...</span>", \
"<span class='notice'>You begin removing [src]'s wires...</span>")
@@ -360,7 +360,7 @@
constructionStep = CONSTRUCTION_GUTTED
update_icon()
return
if(istype(C, /obj/item/crowbar))
if(C.tool_behaviour == TOOL_CROWBAR)
C.play_tool_sound(src)
user.visible_message("<span class='notice'>[user] starts prying a metal plate into [src]...</span>", \
"<span class='notice'>You begin prying the cover plate back onto [src]...</span>")
@@ -375,7 +375,7 @@
update_icon()
return
if(CONSTRUCTION_GUTTED)
if(istype(C, /obj/item/crowbar))
if(C.tool_behaviour == TOOL_CROWBAR)
user.visible_message("<span class='notice'>[user] begins removing the circuit board from [src]...</span>", \
"<span class='notice'>You begin prying out the circuit board from [src]...</span>")
if(!C.use_tool(src, user, 50, volume=50))
@@ -407,7 +407,7 @@
update_icon()
return
if(CONSTRUCTION_NOCIRCUIT)
if(istype(C, /obj/item/weldingtool))
if(C.tool_behaviour == TOOL_WELDER)
if(!C.tool_start_check(user, amount=1))
return
user.visible_message("<span class='notice'>[user] begins cutting apart [src]'s frame...</span>", \

View File

@@ -223,7 +223,7 @@
add_fingerprint(user)
if(!(flags_1&NODECONSTRUCT_1))
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(density || operating)
to_chat(user, "<span class='warning'>You need to open the door to access the maintenance panel!</span>")
return
@@ -232,7 +232,7 @@
to_chat(user, "<span class='notice'>You [panel_open ? "open":"close"] the maintenance panel of the [src.name].</span>")
return
if(istype(I, /obj/item/crowbar))
if(I.tool_behaviour == TOOL_CROWBAR)
if(panel_open && !density && !operating)
user.visible_message("[user] removes the electronics from the [src.name].", \
"<span class='notice'>You start to remove electronics from the [src.name]...</span>")

View File

@@ -29,7 +29,7 @@ GLOBAL_LIST_EMPTY(doppler_arrays)
return PROCESS_KILL
/obj/machinery/doppler_array/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench))
if(I.tool_behaviour == TOOL_WRENCH)
if(!anchored && !isinspace())
anchored = TRUE
power_change()

View File

@@ -210,13 +210,13 @@
icon_state = icon_on
/obj/machinery/droneDispenser/attackby(obj/item/I, mob/living/user)
if(istype(I, /obj/item/crowbar))
if(I.tool_behaviour == TOOL_CROWBAR)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.retrieve_all()
I.play_tool_sound(src)
to_chat(user, "<span class='notice'>You retrieve the materials from [src].</span>")
else if(istype(I, /obj/item/weldingtool))
else if(I.tool_behaviour == TOOL_WELDER)
if(!(stat & BROKEN))
to_chat(user, "<span class='warning'>[src] doesn't need repairs.</span>")
return

View File

@@ -143,7 +143,9 @@
LAZYREMOVE(pods, pod)
/obj/machinery/computer/prototype_cloning/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/multitool))
if(W.tool_behaviour == TOOL_MULTITOOL)
if(!multitool_check_buffer(user, W))
return
var/obj/item/multitool/P = W
if(istype(P.buffer, /obj/machinery/clonepod/experimental))

View File

@@ -157,7 +157,7 @@
/obj/machinery/firealarm/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if(istype(W, /obj/item/screwdriver) && buildstage == 2)
if(W.tool_behaviour == TOOL_SCREWDRIVER && buildstage == 2)
W.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, "<span class='notice'>The wires have been [panel_open ? "exposed" : "unexposed"].</span>")
@@ -166,7 +166,7 @@
if(panel_open)
if(istype(W, /obj/item/weldingtool) && user.a_intent == INTENT_HELP)
if(W.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP)
if(obj_integrity < max_integrity)
if(!W.tool_start_check(user, amount=0))
return
@@ -181,7 +181,7 @@
switch(buildstage)
if(2)
if(istype(W, /obj/item/multitool))
if(W.tool_behaviour == TOOL_MULTITOOL)
detecting = !detecting
if (src.detecting)
user.visible_message("[user] has reconnected [src]'s detecting unit!", "<span class='notice'>You reconnect [src]'s detecting unit.</span>")
@@ -189,7 +189,7 @@
user.visible_message("[user] has disconnected [src]'s detecting unit!", "<span class='notice'>You disconnect [src]'s detecting unit.</span>")
return
else if (istype(W, /obj/item/wirecutters))
else if (W.tool_behaviour == TOOL_WIRECUTTER)
buildstage = 1
W.play_tool_sound(src)
new /obj/item/stack/cable_coil(user.loc, 5)
@@ -214,7 +214,7 @@
update_icon()
return
else if(istype(W, /obj/item/crowbar))
else if(W.tool_behaviour == TOOL_CROWBAR)
user.visible_message("[user.name] removes the electronics from [src.name].", \
"<span class='notice'>You start prying out the circuit...</span>")
if(W.use_tool(src, user, 20, volume=50))
@@ -246,7 +246,7 @@
update_icon()
return
else if(istype(W, /obj/item/wrench))
else if(W.tool_behaviour == TOOL_WRENCH)
user.visible_message("[user] removes the fire alarm assembly from the wall.", \
"<span class='notice'>You remove the fire alarm assembly from the wall.</span>")
var/obj/item/wallframe/firealarm/frame = new /obj/item/wallframe/firealarm()

View File

@@ -52,7 +52,7 @@
//Don't want to render prison breaks impossible
/obj/machinery/flasher/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if (istype(W, /obj/item/wirecutters))
if (W.tool_behaviour == TOOL_WIRECUTTER)
if (bulb)
user.visible_message("[user] begins to disconnect [src]'s flashbulb.", "<span class='notice'>You begin to disconnect [src]'s flashbulb...</span>")
if(W.use_tool(src, user, 30, volume=50) && bulb)
@@ -71,7 +71,7 @@
else
to_chat(user, "<span class='warning'>A flashbulb is already installed in [src]!</span>")
else if (istype(W, /obj/item/wrench))
else if (W.tool_behaviour == TOOL_WRENCH)
if(!bulb)
to_chat(user, "<span class='notice'>You start unsecuring the flasher frame...</span>")
if(W.use_tool(src, user, 40, volume=50))
@@ -168,7 +168,7 @@
flash()
/obj/machinery/flasher/portable/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/wrench))
if (W.tool_behaviour == TOOL_WRENCH)
W.play_tool_sound(src, 100)
if (!anchored && !isinspace())

View File

@@ -91,7 +91,7 @@
// src.sd_SetLuminosity(0)
/obj/machinery/sparker/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/screwdriver))
if (W.tool_behaviour == TOOL_SCREWDRIVER)
add_fingerprint(user)
src.disable = !src.disable
if (src.disable)

View File

@@ -89,7 +89,7 @@
if(T.intact)
return // prevent intraction when T-scanner revealed
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
open = !open
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "<span class='notice'>You [open ? "open" : "close"] the beacon's cover.</span>")

View File

@@ -716,7 +716,7 @@ GLOBAL_LIST_EMPTY(allCasters)
updateUsrDialog()
/obj/machinery/newscaster/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/wrench))
if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 60))
@@ -730,7 +730,7 @@ GLOBAL_LIST_EMPTY(allCasters)
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>")
new /obj/item/wallframe/newscaster(loc)
qdel(src)
else if(istype(I, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
else if(I.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM)
if(stat & BROKEN)
if(!I.tool_start_check(user, amount=0))
return

View File

@@ -240,7 +240,7 @@
/obj/machinery/porta_turret/attackby(obj/item/I, mob/user, params)
if(stat & BROKEN)
if(istype(I, /obj/item/crowbar))
if(I.tool_behaviour == TOOL_CROWBAR)
//If the turret is destroyed, you can remove it with a crowbar to
//try and salvage its components
to_chat(user, "<span class='notice'>You begin prying the metal coverings off...</span>")
@@ -257,7 +257,7 @@
to_chat(user, "<span class='notice'>You remove the turret but did not manage to salvage anything.</span>")
qdel(src)
else if((istype(I, /obj/item/wrench)) && (!on))
else if((I.tool_behaviour == TOOL_WRENCH) && (!on))
if(raised)
return
@@ -284,7 +284,7 @@
to_chat(user, "<span class='notice'>Controls are now [locked ? "locked" : "unlocked"].</span>")
else
to_chat(user, "<span class='notice'>Access denied.</span>")
else if(istype(I, /obj/item/multitool) && !locked)
else if(I.tool_behaviour == TOOL_MULTITOOL && !locked)
var/obj/item/multitool/M = I
M.buffer = src
to_chat(user, "<span class='notice'>You add [src] to multitool buffer.</span>")
@@ -843,7 +843,7 @@
if(stat & BROKEN)
return
if (istype(I, /obj/item/multitool))
if (I.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/multitool/M = I
if(M.buffer && istype(M.buffer, /obj/machinery/porta_turret))
turrets |= M.buffer

View File

@@ -23,14 +23,14 @@
//this is a bit unwieldy but self-explanatory
switch(build_step)
if(PTURRET_UNSECURED) //first step
if(istype(I, /obj/item/wrench) && !anchored)
if(I.tool_behaviour == TOOL_WRENCH && !anchored)
I.play_tool_sound(src, 100)
to_chat(user, "<span class='notice'>You secure the external bolts.</span>")
setAnchored(TRUE)
build_step = PTURRET_BOLTED
return
else if(istype(I, /obj/item/crowbar) && !anchored)
else if(I.tool_behaviour == TOOL_CROWBAR && !anchored)
I.play_tool_sound(src, 75)
to_chat(user, "<span class='notice'>You dismantle the turret construction.</span>")
new /obj/item/stack/sheet/metal( loc, 5)
@@ -48,7 +48,7 @@
to_chat(user, "<span class='warning'>You need two sheets of metal to continue construction!</span>")
return
else if(istype(I, /obj/item/wrench))
else if(I.tool_behaviour == TOOL_WRENCH)
I.play_tool_sound(src, 75)
to_chat(user, "<span class='notice'>You unfasten the external bolts.</span>")
setAnchored(FALSE)
@@ -57,13 +57,13 @@
if(PTURRET_START_INTERNAL_ARMOUR)
if(istype(I, /obj/item/wrench))
if(I.tool_behaviour == TOOL_WRENCH)
I.play_tool_sound(src, 100)
to_chat(user, "<span class='notice'>You bolt the metal armor into place.</span>")
build_step = PTURRET_INTERNAL_ARMOUR_ON
return
else if(istype(I, /obj/item/weldingtool))
else if(I.tool_behaviour == TOOL_WELDER)
if(!I.tool_start_check(user, amount=5)) //uses up 5 fuel
return
@@ -86,7 +86,7 @@
build_step = PTURRET_GUN_EQUIPPED
return
else if(istype(I, /obj/item/wrench))
else if(I.tool_behaviour == TOOL_WRENCH)
I.play_tool_sound(src, 100)
to_chat(user, "<span class='notice'>You remove the turret's metal armor bolts.</span>")
build_step = PTURRET_START_INTERNAL_ARMOUR
@@ -103,7 +103,7 @@
if(PTURRET_SENSORS_ON)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
I.play_tool_sound(src, 100)
build_step = PTURRET_CLOSED
to_chat(user, "<span class='notice'>You close the internal access hatch.</span>")
@@ -120,14 +120,14 @@
to_chat(user, "<span class='warning'>You need two sheets of metal to continue construction!</span>")
return
else if(istype(I, /obj/item/screwdriver))
else if(I.tool_behaviour == TOOL_SCREWDRIVER)
I.play_tool_sound(src, 100)
build_step = PTURRET_SENSORS_ON
to_chat(user, "<span class='notice'>You open the internal access hatch.</span>")
return
if(PTURRET_START_EXTERNAL_ARMOUR)
if(istype(I, /obj/item/weldingtool))
if(I.tool_behaviour == TOOL_WELDER)
if(!I.tool_start_check(user, amount=5))
return
@@ -149,7 +149,7 @@
turret.setup(installed_gun)
qdel(src)
else if(istype(I, /obj/item/crowbar))
else if(I.tool_behaviour == TOOL_CROWBAR)
I.play_tool_sound(src, 75)
to_chat(user, "<span class='notice'>You pry off the turret's exterior armor.</span>")
new /obj/item/stack/sheet/metal(loc, 2)

View File

@@ -40,7 +40,7 @@
/obj/machinery/porta_turret_cover/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench) && !parent_turret.on)
if(I.tool_behaviour == TOOL_WRENCH && !parent_turret.on)
if(parent_turret.raised)
return
@@ -63,7 +63,7 @@
updateUsrDialog()
else
to_chat(user, "<span class='notice'>Access denied.</span>")
else if(istype(I, /obj/item/multitool) && !parent_turret.locked)
else if(I.tool_behaviour == TOOL_MULTITOOL && !parent_turret.locked)
var/obj/item/multitool/M = I
M.buffer = parent_turret
to_chat(user, "<span class='notice'>You add [parent_turret] to multitool buffer.</span>")

View File

@@ -25,7 +25,7 @@
switch(stat)
if(1)
// Stat 1
if(istype(W, /obj/item/weldingtool))
if(W.tool_behaviour == TOOL_WELDER)
if(weld(W, user))
to_chat(user, "<span class='notice'>You weld the fan assembly securely into place.</span>")
setAnchored(TRUE)
@@ -46,7 +46,7 @@
forceMove(F)
F.setDir(src.dir)
return
else if(istype(W, /obj/item/weldingtool))
else if(W.tool_behaviour == TOOL_WELDER)
if(weld(W, user))
to_chat(user, "<span class='notice'>You unweld the fan assembly from its place.</span>")
stat = 1

View File

@@ -55,12 +55,12 @@
return
if(panel_open)
if(istype(I, /obj/item/multitool))
if(I.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/multitool/M = I
M.buffer = src
to_chat(user, "<span class='notice'>You save the data in [I]'s buffer. It can now be saved to pads with closed panels.</span>")
return TRUE
else if(istype(I, /obj/item/multitool))
else if(I.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/multitool/M = I
if(istype(M.buffer, /obj/machinery/quantumpad))
if(M.buffer == src)

View File

@@ -36,7 +36,7 @@
update_icon()
/obj/machinery/recharger/attackby(obj/item/G, mob/user, params)
if(istype(G, /obj/item/wrench))
if(G.tool_behaviour == TOOL_WRENCH)
if(charging)
to_chat(user, "<span class='notice'>Remove the charging item first!</span>")
return
@@ -77,7 +77,7 @@
if(default_deconstruction_screwdriver(user, "rechargeropen", "recharger0", G))
return
if(panel_open && istype(G, /obj/item/crowbar))
if(panel_open && G.tool_behaviour == TOOL_CROWBAR)
default_deconstruction_crowbar(G)
return

View File

@@ -502,7 +502,7 @@ GLOBAL_LIST_EMPTY(allConsoles)
messages += "<b>From:</b> [linkedsender]<br>[message]"
/obj/machinery/requests_console/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/crowbar))
if(O.tool_behaviour == TOOL_CROWBAR)
if(open)
to_chat(user, "<span class='notice'>You close the maintenance panel.</span>")
open = FALSE
@@ -511,7 +511,7 @@ GLOBAL_LIST_EMPTY(allConsoles)
open = TRUE
update_icon()
return
if(istype(O, /obj/item/screwdriver))
if(O.tool_behaviour == TOOL_SCREWDRIVER)
if(open)
hackState = !hackState
if(hackState)

View File

@@ -147,7 +147,7 @@
return
/obj/machinery/shieldgen/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
W.play_tool_sound(src, 100)
panel_open = !panel_open
if(panel_open)
@@ -169,7 +169,7 @@
to_chat(user, "<span class='notice'>You repair \the [src].</span>")
update_icon()
else if(istype(W, /obj/item/wrench))
else if(W.tool_behaviour == TOOL_WRENCH)
if(locked)
to_chat(user, "<span class='warning'>The bolts are covered! Unlocking this would retract the covers.</span>")
return
@@ -345,7 +345,7 @@
return ..()
/obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench))
if(W.tool_behaviour == TOOL_WRENCH)
default_unfasten_wrench(user, W, 0)
else if(W.GetID())

View File

@@ -152,7 +152,7 @@
else
to_chat(user, "<span class='warning'>The hatch must be open to insert a power cell!</span>")
return
else if(istype(I, /obj/item/screwdriver))
else if(I.tool_behaviour == TOOL_SCREWDRIVER)
panel_open = !panel_open
user.visible_message("\The [user] [panel_open ? "opens" : "closes"] the hatch on \the [src].", "<span class='notice'>You [panel_open ? "open" : "close"] the hatch on \the [src].</span>")
update_icon()

View File

@@ -80,7 +80,7 @@ GLOBAL_VAR_INIT(singularity_counter, 0)
to_chat(user, "<span class='warning'>You need to screw the beacon to the floor first!</span>")
/obj/machinery/power/singularity_beacon/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(active)
to_chat(user, "<span class='warning'>You need to deactivate the beacon first!</span>")
return
@@ -164,4 +164,4 @@ GLOBAL_VAR_INIT(singularity_counter, 0)
desc = "A label on it reads: <i>Warning: Activating this device will send a silly explosive to your location</i>."
droptype = /obj/machinery/syndicatebomb/badmin/clown
#undef METEOR_DISASTER_MODIFIER
#undef METEOR_DISASTER_MODIFIER

View File

@@ -112,7 +112,7 @@
. = timer_set
/obj/machinery/syndicatebomb/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench) && can_unanchor)
if(I.tool_behaviour == TOOL_WRENCH && can_unanchor)
if(!anchored)
if(!isturf(loc) || isspaceturf(loc))
to_chat(user, "<span class='notice'>The bomb must be placed on solid ground to attach it.</span>")
@@ -130,7 +130,7 @@
else
to_chat(user, "<span class='warning'>The bolts are locked down!</span>")
else if(istype(I, /obj/item/screwdriver))
else if(I.tool_behaviour == TOOL_SCREWDRIVER)
open_panel = !open_panel
update_icon()
to_chat(user, "<span class='notice'>You [open_panel ? "open" : "close"] the wire panel.</span>")
@@ -138,7 +138,7 @@
else if(is_wire_tool(I) && open_panel)
wires.interact(user)
else if(istype(I, /obj/item/crowbar))
else if(I.tool_behaviour == TOOL_CROWBAR)
if(open_panel && wires.is_all_cut())
if(payload)
to_chat(user, "<span class='notice'>You carefully pry out [payload].</span>")
@@ -158,7 +158,7 @@
to_chat(user, "<span class='notice'>You place [payload] into [src].</span>")
else
to_chat(user, "<span class='warning'>[payload] is already loaded into [src]! You'll have to remove it first.</span>")
else if(istype(I, /obj/item/weldingtool))
else if(I.tool_behaviour == TOOL_WELDER)
if(payload || !wires.is_all_cut() || !open_panel)
return
@@ -436,7 +436,7 @@
qdel(src)
/obj/item/bombcore/chemical/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/crowbar) && beakers.len > 0)
if(I.tool_behaviour == TOOL_CROWBAR && beakers.len > 0)
I.play_tool_sound(src)
for (var/obj/item/B in beakers)
B.forceMove(drop_location())

View File

@@ -325,7 +325,7 @@
update_static_data(usr)
/obj/machinery/computer/message_monitor/attackby(obj/item/O, mob/living/user, params)
if(istype(O, /obj/item/screwdriver) && CHECK_BITFIELD(obj_flags, EMAGGED))
if(O.tool_behaviour == TOOL_SCREWDRIVER && CHECK_BITFIELD(obj_flags, EMAGGED))
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
//Why this though, you should make it emag to a board level. (i wont do it)
to_chat(user, "<span class='warning'>It is too hot to mess with!</span>")

View File

@@ -19,7 +19,7 @@
if(default_deconstruction_screwdriver(user, icon_open, icon_closed, P))
return
// Using a multitool lets you access the receiver's interface
else if(istype(P, /obj/item/multitool))
else if(P.tool_behaviour == TOOL_MULTITOOL)
attack_hand(user)
else if(default_deconstruction_crowbar(P))
@@ -244,7 +244,7 @@
// Check if the user can use it.
/obj/machinery/telecomms/proc/canInteract(mob/user)
if(issilicon(user) || istype(user.get_active_held_item(), /obj/item/multitool))
if(issilicon(user) || user.get_active_held_item().tool_behaviour == TOOL_MULTITOOL)
return TRUE
return FALSE
// Check if the user is nearby and has a multitool.
@@ -265,6 +265,6 @@
var/mob/living/silicon/ai/U = user
P = U.aiMulti
else if(iscyborg(user) && in_range(user, src))
if(istype(user.get_active_held_item(), /obj/item/multitool))
if(user.get_active_held_item().tool_behaviour == TOOL_MULTITOOL)
P = user.get_active_held_item()
return P

View File

@@ -38,5 +38,5 @@
signal.broadcast()
/obj/machinery/telecomms/allinone/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/multitool))
if(P.tool_behaviour == TOOL_MULTITOOL)
return attack_hand(user)

View File

@@ -156,7 +156,7 @@
return ..()
/obj/machinery/teleport/station/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/multitool))
if(W.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/multitool/M = W
if(panel_open)
M.buffer = src
@@ -177,7 +177,7 @@
else if(default_deconstruction_crowbar(W))
return
else if(istype(W, /obj/item/wirecutters))
else if(W.tool_behaviour == TOOL_WIRECUTTER)
if(panel_open)
link_console_and_hub()
to_chat(user, "<span class='caution'>You reconnect the station to nearby machinery.</span>")

View File

@@ -201,7 +201,7 @@
to_chat(user, "<span class='warning'>Invalid ID: Access denied.</span>")
else
to_chat(user, "<span class='warning'>Maintenance protocols disabled by operator.</span>")
else if(istype(W, /obj/item/wrench))
else if(W.tool_behaviour == TOOL_WRENCH)
if(construction_state==1)
construction_state = 2
to_chat(user, "<span class='notice'>You undo the securing bolts.</span>")
@@ -209,7 +209,7 @@
construction_state = 1
to_chat(user, "<span class='notice'>You tighten the securing bolts.</span>")
return
else if(istype(W, /obj/item/crowbar))
else if(W.tool_behaviour == TOOL_CROWBAR)
if(construction_state==2)
construction_state = 3
to_chat(user, "<span class='notice'>You open the hatch to the power unit.</span>")
@@ -226,7 +226,7 @@
else
to_chat(user, "<span class='warning'>You need two lengths of cable to fix this mech!</span>")
return
else if(istype(W, /obj/item/screwdriver) && user.a_intent != INTENT_HARM)
else if(W.tool_behaviour == TOOL_SCREWDRIVER && user.a_intent != INTENT_HARM)
if(internal_damage & MECHA_INT_TEMP_CONTROL)
clearInternalDamage(MECHA_INT_TEMP_CONTROL)
to_chat(user, "<span class='notice'>You repair the damaged temperature controller.</span>")
@@ -254,7 +254,7 @@
to_chat(user, "<span class='notice'>There's already a powercell installed.</span>")
return
else if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
else if(W.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM)
user.changeNext_move(CLICK_CD_MELEE)
if(obj_integrity < max_integrity)
if(W.use_tool(src, user, 0, volume=50, amount=1))

View File

@@ -35,7 +35,7 @@
. += "<span class='notice'>The AI recovery beacon is active.</span>"
/obj/structure/mecha_wreckage/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weldingtool))
if(I.tool_behaviour == TOOL_WELDER)
if(salvage_num <= 0 || !length(welder_salvage))
to_chat(user, "<span class='warning'>You don't see anything that can be cut with [I]!</span>")
return
@@ -54,7 +54,7 @@
to_chat(user, "<span class='warning'>You fail to salvage anything valuable from [src]!</span>")
return
else if(istype(I, /obj/item/wirecutters))
else if(I.tool_behaviour == TOOL_WIRECUTTER)
if(salvage_num <= 0)
to_chat(user, "<span class='warning'>You don't see anything that can be cut with [I]!</span>")
return
@@ -67,7 +67,7 @@
else
to_chat(user, "<span class='warning'>You fail to salvage anything valuable from [src]!</span>")
else if(istype(I, /obj/item/crowbar))
else if(I.tool_behaviour == TOOL_CROWBAR)
if(crowbar_salvage && crowbar_salvage.len)
var/obj/S = pick(crowbar_salvage)
if(S)

View File

@@ -87,7 +87,7 @@
/obj/structure/sign/poster/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wirecutters))
if(I.tool_behaviour == TOOL_WIRECUTTER)
I.play_tool_sound(src, 100)
if(ruined)
to_chat(user, "<span class='notice'>You remove the remnants of the poster.</span>")

View File

@@ -47,9 +47,6 @@
qdel(src)
return 0
/obj/effect/ConveyorMove()
return
/obj/effect/abstract/ex_act(severity, target)
return

View File

@@ -44,7 +44,7 @@
return
update_icon()
to_chat(user, "<span class='notice'>You add the cables to [src]. It now contains [loaded.amount].</span>")
else if(istype(W, /obj/item/screwdriver))
else if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(!loaded)
return
if(ghetto && prob(10)) //Is it a ghetto RCL? If so, give it a 10% chance to fall apart

View File

@@ -60,7 +60,7 @@
/obj/item/wallframe/attackby(obj/item/W, mob/user, params)
..()
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
// For camera-building borgs
var/turf/T = get_step(get_turf(user), user.dir)
if(iswallturf(T))
@@ -69,7 +69,7 @@
var/metal_amt = round(materials[MAT_METAL]/MINERAL_MATERIAL_AMOUNT)
var/glass_amt = round(materials[MAT_GLASS]/MINERAL_MATERIAL_AMOUNT)
if(istype(W, /obj/item/wrench) && (metal_amt || glass_amt))
if(W.tool_behaviour == TOOL_WRENCH && (metal_amt || glass_amt))
to_chat(user, "<span class='notice'>You dismantle [src].</span>")
if(metal_amt)
new /obj/item/stack/sheet/metal(get_turf(src), metal_amt)

View File

@@ -66,7 +66,7 @@
var/list/dept_list = list("Civilian","Security","Medical","Science","Engineering","Cargo")
/obj/item/circuitboard/computer/card/minor/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
target_dept = (target_dept == dept_list.len) ? 1 : (target_dept + 1)
to_chat(user, "<span class='notice'>You set the board to \"[dept_list[target_dept]]\".</span>")
else
@@ -181,7 +181,7 @@
build_path = /obj/machinery/computer/rdconsole/core
/obj/item/circuitboard/computer/rdconsole/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(build_path == /obj/machinery/computer/rdconsole/core)
name = "R&D Console - Robotics (Computer Board)"
build_path = /obj/machinery/computer/rdconsole/robotics
@@ -323,7 +323,7 @@
build_path = /obj/machinery/computer/libraryconsole
/obj/item/circuitboard/computer/libraryconsole/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(build_path == /obj/machinery/computer/libraryconsole/bookmanagement)
name = "Library Visitor Console (Computer Board)"
build_path = /obj/machinery/computer/libraryconsole

View File

@@ -279,7 +279,7 @@
/obj/machinery/vending/gato = "GATO Vending Machine")
/obj/item/circuitboard/machine/vendor/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
var/choice = show_radial_menu(user, src, GLOB.vending_m_choices, radius = 46, require_near = TRUE, tooltips = TRUE)
if(!choice)
return
@@ -353,7 +353,7 @@
build_path = PATH_HEATER
/obj/item/circuitboard/machine/thermomachine/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
var/obj/item/circuitboard/new_type
var/new_setting
switch(build_path)
@@ -422,7 +422,7 @@
needs_anchored = FALSE
/obj/item/circuitboard/machine/processor/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(build_path == /obj/machinery/processor)
name = "Slime Processor (Machine Board)"
build_path = /obj/machinery/processor/slime
@@ -458,7 +458,7 @@
return ..()
/obj/item/circuitboard/machine/smartfridge/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
var/position = fridges_name_paths.Find(build_path, fridges_name_paths)
position = (position == fridges_name_paths.len) ? 1 : (position + 1)
build_path = fridges_name_paths[position]
@@ -635,7 +635,7 @@
build_path = PATH_POWERCOIL
/obj/item/circuitboard/machine/tesla_coil/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
var/obj/item/circuitboard/new_type
var/new_setting
switch(build_path)
@@ -732,7 +732,7 @@
needs_anchored = FALSE
/obj/item/circuitboard/machine/chem_master/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
var/new_name = "ChemMaster"
var/new_path = /obj/machinery/chem_master

View File

@@ -124,7 +124,7 @@
to_chat(user, "<span class='notice'>You install a cell in [src].</span>")
update_icon()
else if(istype(W, /obj/item/screwdriver))
else if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(cell)
cell.update_icon()
cell.forceMove(get_turf(src))

View File

@@ -168,7 +168,7 @@
to_chat(user, "<span class='notice'>[icon2html(src, user)] Target is free of radioactive contamination.</span>")
/obj/item/geiger_counter/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver) && (obj_flags & EMAGGED))
if(I.tool_behaviour == TOOL_SCREWDRIVER && (obj_flags & EMAGGED))
if(scanning)
to_chat(user, "<span class='warning'>Turn off [src] before you perform this action!</span>")
return 0

View File

@@ -48,7 +48,7 @@
else
to_chat(user, "<span class='notice'>[src] already has a diode installed.</span>")
else if(istype(W, /obj/item/screwdriver))
else if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(diode)
to_chat(user, "<span class='notice'>You remove the [diode.name] from \the [src].</span>")
diode.forceMove(drop_location())

View File

@@ -57,7 +57,7 @@
set_light(0)
/obj/item/powersink/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(mode == DISCONNECTED)
var/turf/T = loc
if(isturf(T) && !T.intact)

View File

@@ -266,7 +266,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
/obj/item/radio/headset/attackby(obj/item/W, mob/user, params)
user.set_machine(src)
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(keyslot || keyslot2)
for(var/ch_name in channels)
SSradio.remove_object(src, GLOB.radiochannels[ch_name])

View File

@@ -22,7 +22,7 @@
freerange = TRUE
/obj/item/radio/intercom/ratvar/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, "<span class='danger'>[src] is fastened to the wall with [is_servant_of_ratvar(user) ? "replicant alloy" : "some material you've never seen"], and can't be removed.</span>")
return //no unfastening!
. = ..()
@@ -56,7 +56,7 @@
. += "<span class='notice'>It's <i>unscrewed</i> from the wall, and can be <b>detached</b>.</span>"
/obj/item/radio/intercom/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(unfastened)
user.visible_message("<span class='notice'>[user] starts tightening [src]'s screws...</span>", "<span class='notice'>You start screwing in [src]...</span>")
if(I.use_tool(src, user, 30, volume=50))
@@ -68,7 +68,7 @@
user.visible_message("<span class='notice'>[user] loosens [src]'s screws!</span>", "<span class='notice'>You unscrew [src], loosening it from the wall.</span>")
unfastened = TRUE
return
else if(istype(I, /obj/item/wrench))
else if(I.tool_behaviour == TOOL_WRENCH)
if(!unfastened)
to_chat(user, "<span class='warning'>You need to unscrew [src] from the wall first!</span>")
return

View File

@@ -335,7 +335,7 @@
/obj/item/radio/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
unscrewed = !unscrewed
if(unscrewed)
to_chat(user, "<span class='notice'>The radio can now be attached and modified!</span>")
@@ -386,7 +386,7 @@
/obj/item/radio/borg/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(keyslot)
for(var/ch_name in channels)
SSradio.remove_object(src, GLOB.radiochannels[ch_name])

View File

@@ -271,7 +271,7 @@
/obj/item/tape/attackby(obj/item/I, mob/user, params)
if(ruined && istype(I, /obj/item/screwdriver) || istype(I, /obj/item/pen))
if(ruined && I.tool_behaviour == TOOL_SCREWDRIVER || istype(I, /obj/item/pen))
to_chat(user, "<span class='notice'>You start winding the tape back in...</span>")
if(I.use_tool(src, user, 120))
to_chat(user, "<span class='notice'>You wound the tape back in.</span>")

View File

@@ -80,7 +80,7 @@
flame_turf(turflist)
/obj/item/flamethrower/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench) && !status)//Taking this apart
if(W.tool_behaviour == TOOL_WRENCH && !status)//Taking this apart
var/turf/T = get_turf(src)
if(weldtool)
weldtool.forceMove(T)
@@ -95,7 +95,7 @@
qdel(src)
return
else if(istype(W, /obj/item/screwdriver) && igniter && !lit)
else if(W.tool_behaviour == TOOL_SCREWDRIVER && igniter && !lit)
status = !status
to_chat(user, "<span class='notice'>[igniter] is now [status ? "secured" : "unsecured"]!</span>")
update_icon()

View File

@@ -51,7 +51,7 @@
/obj/item/grenade/chem_grenade/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(stage == WIRED)
if(beakers.len)
stage_change(READY)
@@ -106,11 +106,11 @@
to_chat(user, "<span class='warning'>You need one length of coil to wire the assembly!</span>")
return
else if(stage == READY && istype(I, /obj/item/wirecutters) && !active)
else if(stage == READY && I.tool_behaviour == TOOL_WIRECUTTER && !active)
stage_change(WIRED)
to_chat(user, "<span class='notice'>You unlock the [initial(name)] assembly.</span>")
else if(stage == WIRED && istype(I, /obj/item/wrench))
else if(stage == WIRED && I.tool_behaviour == TOOL_WRENCH)
if(beakers.len)
for(var/obj/O in beakers)
O.forceMove(drop_location())
@@ -274,7 +274,7 @@
var/unit_spread = 10 // Amount of units per repeat. Can be altered with a multitool.
/obj/item/grenade/chem_grenade/adv_release/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/multitool))
if(I.tool_behaviour == TOOL_MULTITOOL)
switch(unit_spread)
if(0 to 24)
unit_spread += 5

View File

@@ -95,7 +95,7 @@
/obj/item/grenade/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
switch(det_time)
if ("1")
det_time = 10

View File

@@ -46,7 +46,7 @@
playsound(src, 'sound/weapons/tap.ogg', 20, 1)
update_icon()
return
if(nadeassembly && istype(I, /obj/item/wirecutters))
if(nadeassembly && I.tool_behaviour == TOOL_WIRECUTTER)
I.play_tool_sound(src, 20)
nadeassembly.forceMove(get_turf(src))
nadeassembly.master = null
@@ -196,7 +196,7 @@
user.gib(1, 1)
/obj/item/grenade/plastic/c4/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
open_panel = !open_panel
to_chat(user, "<span class='notice'>You [open_panel ? "open" : "close"] the wire panel.</span>")
else if(is_wire_tool(I))

View File

@@ -62,7 +62,7 @@
/obj/item/inducer/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
W.play_tool_sound(src)
if(!opened)
to_chat(user, "<span class='notice'>You unscrew the battery compartment.</span>")

View File

@@ -179,7 +179,7 @@
possible_colors = list("purple" = LIGHT_COLOR_LAVENDER)
/obj/item/melee/transforming/energy/sword/saber/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/multitool))
if(W.tool_behaviour == TOOL_MULTITOOL)
if(!hacked)
hacked = TRUE
item_color = "rainbow"

View File

@@ -77,7 +77,7 @@
updateTank(W, 0, user)
else if(W.type == type)
to_chat(user, "<span class='warning'>You're fairly certain that putting a pneumatic cannon inside another pneumatic cannon would cause a spacetime disruption.</span>")
else if(istype(W, /obj/item/wrench))
else if(W.tool_behaviour == TOOL_WRENCH)
switch(pressureSetting)
if(1)
pressureSetting = 2
@@ -86,7 +86,7 @@
if(3)
pressureSetting = 1
to_chat(user, "<span class='notice'>You tweak \the [src]'s pressure output to [pressureSetting].</span>")
else if(istype(W, /obj/item/screwdriver))
else if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(tank)
updateTank(tank, 1, user)
else if(loadedWeightClass >= maxWeightClass)

View File

@@ -36,7 +36,7 @@
to_chat(user, "<span class='warning'>\The [IT] is too small for \the [src].</span>")
return
updateTank(W, 0, user)
else if(istype(W, /obj/item/wrench))
else if(W.tool_behaviour == TOOL_WRENCH)
switch(fisto_setting)
if(1)
fisto_setting = 2
@@ -46,7 +46,7 @@
fisto_setting = 1
W.play_tool_sound(src)
to_chat(user, "<span class='notice'>You tweak \the [src]'s piston valve to [fisto_setting].</span>")
else if(istype(W, /obj/item/screwdriver))
else if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(tank)
updateTank(tank, 1, user)

View File

@@ -226,7 +226,7 @@
else
to_chat(user, "<span class='warning'>You need to attach a flash to it first!</span>")
else if (istype(W, /obj/item/multitool))
else if (W.tool_behaviour == TOOL_MULTITOOL)
if(check_completion())
Interact(user)
else
@@ -382,7 +382,7 @@
var/mob/living/living_user = usr
var/obj/item/item_in_hand = living_user.get_active_held_item()
if(!istype(item_in_hand, /obj/item/multitool))
if(!item_in_hand.tool_behaviour == TOOL_MULTITOOL)
to_chat(living_user, "<span class='warning'>You need a multitool!</span>")
return

View File

@@ -146,7 +146,7 @@
/obj/item/stack/medical/gauze/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wirecutters) || I.is_sharp())
if(I.tool_behaviour == TOOL_WIRECUTTER || I.is_sharp())
if(get_amount() < 2)
to_chat(user, "<span class='warning'>You need at least two gauzes to do this!</span>")
return

View File

@@ -40,7 +40,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
icon_state = "rods"
/obj/item/stack/rods/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weldingtool))
if(W.tool_behaviour == TOOL_WELDER)
if(get_amount() < 2)
to_chat(user, "<span class='warning'>You need at least two rods to do this!</span>")
return

View File

@@ -20,7 +20,7 @@
state = 0 //fine
/obj/item/stack/tile/light/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/crowbar))
if(O.tool_behaviour == TOOL_CROWBAR)
new/obj/item/stack/sheet/metal(user.loc)
amount--
new/obj/item/stack/light_w(user.loc)

View File

@@ -20,7 +20,7 @@
/obj/item/stack/tile/attackby(obj/item/W, mob/user, params)
if (istype(W, /obj/item/weldingtool))
if (W.tool_behaviour == TOOL_WELDER)
if(get_amount() < 4)
to_chat(user, "<span class='warning'>You need at least four tiles to do this!</span>")
return

View File

@@ -36,14 +36,14 @@
/obj/item/storage/secure/attackby(obj/item/W, mob/user, params)
if(SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED))
if (istype(W, /obj/item/screwdriver))
if (W.tool_behaviour == TOOL_SCREWDRIVER)
if (W.use_tool(src, user, 20))
open =! open
to_chat(user, "<span class='notice'>You [open ? "open" : "close"] the service panel.</span>")
return
if (istype(W, /obj/item/wirecutters))
if (W.tool_behaviour == TOOL_WIRECUTTER)
to_chat(user, "<span class='danger'>[src] is protected from this sort of tampering, yet it appears the internal memory wires can still be <b>pulsed</b>.</span>")
if ((istype(W, /obj/item/multitool)) && (!l_hacking))
if ((W.tool_behaviour == TOOL_MULTITOOL) && (!l_hacking))
if(open == 1)
to_chat(user, "<span class='danger'>Now attempting to reset internal memory, please hold.</span>")
l_hacking = 1

View File

@@ -109,7 +109,7 @@
to_chat(user, "<span class='notice'>You install a cell in [src].</span>")
update_icon()
else if(istype(W, /obj/item/screwdriver))
else if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(cell)
cell.update_icon()
cell.forceMove(get_turf(src))

View File

@@ -90,7 +90,7 @@
/obj/item/weldingtool/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
flamethrower_screwdriver(I, user)
else if(istype(I, /obj/item/stack/rods))
flamethrower_rods(I, user)

View File

@@ -259,7 +259,7 @@
newSaber.item_color = "rainbow"
qdel(W)
qdel(src)
else if(istype(W, /obj/item/multitool))
else if(W.tool_behaviour == TOOL_MULTITOOL)
if(!hacked)
hacked = TRUE
item_color = "rainbow"

View File

@@ -452,7 +452,7 @@
possible_colors = list("purple")
/obj/item/twohanded/dualsaber/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/multitool))
if(W.tool_behaviour == TOOL_MULTITOOL)
if(!hacked)
hacked = TRUE
to_chat(user, "<span class='warning'>2XRNBW_ENGAGE</span>")
@@ -896,4 +896,4 @@
var/client/C = user.client
C.change_view(CONFIG_GET(string/default_view))
user.client.pixel_x = 0
user.client.pixel_y = 0
user.client.pixel_y = 0

View File

@@ -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_behaviour == 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_behaviour == TOOL_WRENCH)
return default_unfasten_wrench(user, P, 20)
if(!anchored)
if(istype(P, /obj/item/weldingtool) && can_deconstruct)
if(P.tool_behaviour == 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_behaviour == 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_behaviour == 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_behaviour == 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_behaviour == 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_behaviour == 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_behaviour == 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_behaviour == 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_behaviour == TOOL_SCREWDRIVER)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You disconnect the monitor.</span>")
state = GLASS_CORE

View File

@@ -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_behaviour == TOOL_SCREWDRIVER)
if(!allowed(user))
to_chat(user, "<span class='info'>Access denied.</span>")
return

View File

@@ -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_behaviour == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
W.play_tool_sound(src)
deconstruct(TRUE)
else if(istype(W, /obj/item/bedsheet))

View File

@@ -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_behaviour == TOOL_WRENCH && !(flags_1&NODECONSTRUCT_1))
W.play_tool_sound(src)
deconstruct()
else if(istype(W, /obj/item/assembly/shock_kit))

View File

@@ -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_behaviour == 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)

View File

@@ -343,7 +343,7 @@
. = TRUE
if(opened)
if(istype(W, cutting_tool))
if(istype(W, /obj/item/weldingtool))
if(W.tool_behaviour == 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_behaviour == TOOL_SCREWDRIVER)
handle_lock_removal(user, W)
else if(istype(W, /obj/item/weldingtool) && can_weld_shut)
else if(W.tool_behaviour == 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_behaviour == TOOL_WRENCH && anchorable)
if(isinspace() && !anchored)
return
setAnchored(!anchored)

View File

@@ -32,7 +32,7 @@
else
name = "body bag"
return
else if(istype(I, /obj/item/wirecutters))
else if(I.tool_behaviour == TOOL_WIRECUTTER)
to_chat(user, "<span class='notice'>You cut the tag off [src].</span>")
name = "body bag"
tagged = 0

View File

@@ -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_behaviour == 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.

View File

@@ -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_behaviour == 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_behaviour == 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))

View File

@@ -58,7 +58,7 @@
return
created_name = t
else if(istype(W, /obj/item/weldingtool) && (mineral || glass || !anchored ))
else if(W.tool_behaviour == 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_behaviour == 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_behaviour == 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_behaviour == 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_behaviour == TOOL_SCREWDRIVER && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
user.visible_message("[user] finishes the airlock.", \
"<span class='notice'>You start finishing the airlock...</span>")

View File

@@ -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)

View File

@@ -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_behaviour == TOOL_WRENCH)
var/obj/structure/chair/C = new /obj/structure/chair(loc)
W.play_tool_sound(src)
C.setDir(dir)

View File

@@ -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))

View File

@@ -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_behaviour == 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_behaviour == 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_behaviour == TOOL_WIRECUTTER)
dismantle(user, TRUE, tool)
/*

View File

@@ -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_behaviour == 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

View File

@@ -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_behaviour == TOOL_MULTITOOL)
toggle_lock(user)
else if(istype(I, /obj/item/weldingtool) && user.a_intent == INTENT_HELP && !broken)
else if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP && !broken)
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount=2))
return

View File

@@ -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))

View File

@@ -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_behaviour == 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_behaviour == 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>")

View File

@@ -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_behaviour == 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_behaviour == TOOL_SCREWDRIVER) && (isturf(loc) || anchored))
if(!shock(user, 90))
W.play_tool_sound(src, 100)
setAnchored(!anchored)

View File

@@ -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_behaviour == 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>")

View File

@@ -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_behaviour == 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

View File

@@ -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_behaviour == TOOL_WIRECUTTER)
to_chat(user, "<span class='notice'>Slicing [name] joints ...</span>")
deconstruct()
else

View File

@@ -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))

View File

@@ -21,7 +21,7 @@
anchored = TRUE
return TRUE
if(istype(item, /obj/item/crowbar))
if(item.tool_behaviour == TOOL_CROWBAR)
to_chat(user,"<span class='notice'>You pry the bricks from the floor.</span>")
anchored = FALSE
return TRUE

Some files were not shown because too many files have changed in this diff Show More