COMPLETELY FUCKING REFACTORS TOOL CHECKING CODE

dear FUCKING GOD why was it like this, it hurts soooo bad DDDD:
This commit is contained in:
ReoDaProtovali
2024-09-11 01:32:03 -05:00
parent a9ddce1dce
commit e503b7e267
185 changed files with 416 additions and 423 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
light_color = LIGHT_COLOR_PINK
/obj/machinery/computer/aifixer/attackby(obj/I, mob/user, params)
if(occupier && istype(I, /obj/item/screwdriver))
if(occupier && I.tool_behavior == TOOL_SCREWDRIVER)
if(stat & (NOPOWER|BROKEN))
to_chat(user, "<span class='warning'>The screws on [name]'s screen won't budge.</span>")
else
@@ -7,14 +7,14 @@
add_fingerprint(user)
switch(state)
if(0)
if(istype(P, /obj/item/wrench))
if(P.tool_behavior == 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_behavior == 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_behavior == 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_behavior == 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_behavior == 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_behavior == 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_behavior == 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_behavior == 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_behavior == 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)
+1 -1
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_behavior == TOOL_MULTITOOL)
var/obj/item/multitool/P = W
if(istype(P.buffer, /obj/machinery/clonepod))