mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
[MIRROR] Refactors tool typechecks, refactors transforming tools, makes Altevian wrench into one (#7062)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Nadyr <41974248+Darlantanis@users.noreply.github.com>
This commit is contained in:
@@ -289,9 +289,9 @@
|
||||
if(default_deconstruction_screwdriver(user, I))
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
if(I.has_tool_quality(TOOL_WELDER))
|
||||
if(panel_open)
|
||||
var/obj/item/weapon/weldingtool/WT = I
|
||||
var/obj/item/weapon/weldingtool/WT = I.get_welder()
|
||||
if(!WT.remove_fuel(0, user))
|
||||
to_chat(user, "The welding tool must be on to complete this task.")
|
||||
return
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
var/obj/structure/disposalpipe/CP = locate() in T
|
||||
|
||||
// wrench: (un)anchor
|
||||
if(I.is_wrench())
|
||||
if(I.has_tool_quality(TOOL_WRENCH))
|
||||
if(anchored)
|
||||
anchored = FALSE
|
||||
if(ispipe)
|
||||
@@ -285,9 +285,9 @@
|
||||
update()
|
||||
|
||||
// weldingtool: convert to real pipe
|
||||
else if(istype(I, /obj/item/weapon/weldingtool))
|
||||
else if(I.has_tool_quality(TOOL_WELDER))
|
||||
if(anchored)
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
var/obj/item/weapon/weldingtool/W = I.get_welder()
|
||||
if(W.remove_fuel(0,user))
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "Welding the [nicetype] in place.")
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
src.add_fingerprint(user)
|
||||
if(mode<=0) // It's off
|
||||
if(I.is_screwdriver())
|
||||
if(I.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
if(contents.len > 0)
|
||||
to_chat(user, "Eject the items first!")
|
||||
return
|
||||
@@ -70,11 +70,11 @@
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
to_chat(user, "You attach the screws around the power connection.")
|
||||
return
|
||||
else if(istype(I, /obj/item/weapon/weldingtool) && mode==-1)
|
||||
else if(I.has_tool_quality(TOOL_WELDER) && mode==-1)
|
||||
if(contents.len > 0)
|
||||
to_chat(user, "Eject the items first!")
|
||||
return
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
var/obj/item/weapon/weldingtool/W = I.get_welder()
|
||||
if(W.remove_fuel(0,user))
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "You start slicing the floorweld off the disposal unit.")
|
||||
@@ -985,8 +985,8 @@
|
||||
if(!T.is_plating())
|
||||
return // prevent interaction with T-scanner revealed pipes
|
||||
src.add_fingerprint(user)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(I.has_tool_quality(TOOL_WELDER))
|
||||
var/obj/item/weapon/weldingtool/W = I.get_welder()
|
||||
|
||||
if(W.remove_fuel(0,user))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
@@ -1460,8 +1460,8 @@
|
||||
if(!T.is_plating())
|
||||
return // prevent interaction with T-scanner revealed pipes
|
||||
src.add_fingerprint(user)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(I.has_tool_quality(TOOL_WELDER))
|
||||
var/obj/item/weapon/weldingtool/W = I.get_welder()
|
||||
|
||||
if(W.remove_fuel(0,user))
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
@@ -1582,7 +1582,7 @@
|
||||
if(!I || !user)
|
||||
return
|
||||
src.add_fingerprint(user)
|
||||
if(I.is_screwdriver())
|
||||
if(I.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
if(mode==0)
|
||||
mode=1
|
||||
to_chat(user, "You remove the screws around the power connection.")
|
||||
@@ -1593,8 +1593,8 @@
|
||||
to_chat(user, "You attach the screws around the power connection.")
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
return
|
||||
else if(istype(I, /obj/item/weapon/weldingtool) && mode==1)
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
else if(I.has_tool_quality(TOOL_WELDER) && mode==1)
|
||||
var/obj/item/weapon/weldingtool/W = I.get_welder()
|
||||
if(W.remove_fuel(0,user))
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
to_chat(user, "You start slicing the floorweld off the disposal outlet.")
|
||||
|
||||
@@ -437,13 +437,13 @@
|
||||
if(!I || !user)
|
||||
return
|
||||
|
||||
if(I.is_screwdriver())
|
||||
if(I.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
c_mode = !c_mode
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
to_chat(user, "You [c_mode ? "remove" : "attach"] the screws around the power connection.")
|
||||
return
|
||||
if(istype(I, /obj/item/weapon/weldingtool) && c_mode==1)
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(I.has_tool_quality(TOOL_WELDER) && c_mode==1)
|
||||
var/obj/item/weapon/weldingtool/W = I.get_welder()
|
||||
if(!W.remove_fuel(0,user))
|
||||
to_chat(user, "You need more welding fuel to complete this task.")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user