mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +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:
@@ -41,11 +41,11 @@
|
||||
field_type = /obj/structure/atmospheric_retention_field/impassable
|
||||
|
||||
/obj/machinery/atmospheric_field_generator/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_crowbar() && isactive)
|
||||
if(W.has_tool_quality(TOOL_CROWBAR) && isactive)
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='warning'>You can't open the ARF-G whilst it's running!</span>")
|
||||
return
|
||||
if(W.is_crowbar() && !isactive)
|
||||
if(W.has_tool_quality(TOOL_CROWBAR) && !isactive)
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You [hatch_open? "close" : "open"] \the [src]'s access hatch.</span>")
|
||||
hatch_open = !hatch_open
|
||||
@@ -53,21 +53,21 @@
|
||||
if(alwaysactive && wires_intact)
|
||||
generate_field()
|
||||
return
|
||||
if(hatch_open && W.is_multitool())
|
||||
if(hatch_open && W.has_tool_quality(TOOL_MULTITOOL))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='notice'>You toggle \the [src]'s activation behavior to [alwaysactive? "emergency" : "always-on"].</span>")
|
||||
alwaysactive = !alwaysactive
|
||||
update_icon()
|
||||
return
|
||||
if(hatch_open && W.is_wirecutter())
|
||||
if(hatch_open && W.has_tool_quality(TOOL_WIRECUTTER))
|
||||
if(!src) return
|
||||
to_chat(user, "<span class='warning'>You [wires_intact? "cut" : "mend"] \the [src]'s wires!</span>")
|
||||
wires_intact = !wires_intact
|
||||
update_icon()
|
||||
return
|
||||
if(hatch_open && istype(W,/obj/item/weapon/weldingtool))
|
||||
if(hatch_open && W.has_tool_quality(TOOL_WELDER))
|
||||
if(!src) return
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
var/obj/item/weapon/weldingtool/WT = W.get_welder()
|
||||
if(!WT.isOn()) return
|
||||
if(WT.get_fuel() < 5) // uses up 5 fuel.
|
||||
to_chat(user, "<span class='warning'>You need more fuel to complete this task.</span>")
|
||||
|
||||
Reference in New Issue
Block a user