mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-31 00:59:16 +01:00
What was supposed to be another straightforward major system overhaul that once again spiraled out of control (#8220)
* get_tool_quality has numerical meaning * Basic tools set tool quality * Toolspeed is replaced by tool quality checks * Addresses assorted results from live test * Extra cleanup
This commit is contained in:
@@ -91,7 +91,7 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(W.is_wrench())
|
||||
if(W.get_tool_quality(TOOL_WRENCH))
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
anchored = !anchored
|
||||
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
|
||||
|
||||
@@ -279,23 +279,12 @@
|
||||
add_fingerprint(usr)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!W.is_wrench())
|
||||
if (!W.get_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
if (unlocked)
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>")
|
||||
return 1
|
||||
if(!can_unwrench())
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (do_after(user, 40 * W.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear ratchet.")
|
||||
deconstruct()
|
||||
return TRUE
|
||||
return default_deconstruction_wrench(user, W)
|
||||
|
||||
#undef REGULATE_NONE
|
||||
#undef REGULATE_INPUT
|
||||
|
||||
@@ -240,20 +240,9 @@ Thus, the two variables affect pump operation are set in New():
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!W.is_wrench())
|
||||
if (!W.get_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && use_power)
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench this [src], turn it off first.</span>")
|
||||
return 1
|
||||
if(!can_unwrench())
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench this [src], it too exerted due to internal pressure.</span>")
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (do_after(user, 40 * W.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear ratchet.")
|
||||
deconstruct()
|
||||
return TRUE
|
||||
return default_deconstruction_wrench(user, W)
|
||||
|
||||
@@ -80,21 +80,9 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/omni/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if(!W.is_wrench())
|
||||
if(!W.get_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
|
||||
if(!can_unwrench())
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
if(do_after(user, 40 * W.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
deconstruct()
|
||||
return default_deconstruction_wrench(user, W)
|
||||
|
||||
/obj/machinery/atmospherics/omni/attack_hand(user as mob)
|
||||
if(..())
|
||||
|
||||
@@ -147,22 +147,11 @@
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!W.is_wrench())
|
||||
if(!W.get_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
if (connected_device)
|
||||
if(connected_device)
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], dettach \the [connected_device] first.</span>")
|
||||
return 1
|
||||
if (locate(/obj/machinery/portable_atmospherics, src.loc))
|
||||
return 1
|
||||
if(!can_unwrench())
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (do_after(user, 40 * W.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
deconstruct()
|
||||
return TRUE
|
||||
if(locate(/obj/machinery/portable_atmospherics, src.loc))
|
||||
return TRUE
|
||||
return default_deconstruction_wrench(user, W)
|
||||
|
||||
@@ -52,20 +52,9 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/trinary/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!W.is_wrench())
|
||||
if (!W.get_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
if(!can_unwrench())
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (do_after(user, 40 * W.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
deconstruct()
|
||||
return default_deconstruction_wrench(user, W)
|
||||
|
||||
// Housekeeping and pipe network stuff below
|
||||
/obj/machinery/atmospherics/trinary/get_neighbor_nodes_for_init()
|
||||
|
||||
@@ -327,23 +327,13 @@
|
||||
go_to_side()
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!W.is_wrench())
|
||||
if(!W.get_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
|
||||
if(istype(src, /obj/machinery/atmospherics/tvalve/digital))
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>")
|
||||
return 1
|
||||
if(!can_unwrench())
|
||||
to_chat(user, "<span class='warnng'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (do_after(user, 40 * W.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
deconstruct()
|
||||
return TRUE
|
||||
return default_deconstruction_wrench(user, W)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored
|
||||
icon_state = "map_tvalvem0"
|
||||
|
||||
@@ -67,21 +67,10 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/heat_exchanger/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!W.is_wrench())
|
||||
if (!W.get_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && !T.is_plating())
|
||||
to_chat(user, "<span class='warning'>You must remove the plating first.</span>")
|
||||
return 1
|
||||
if (!can_unwrench())
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (do_after(user, 40 * W.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
deconstruct()
|
||||
return TRUE
|
||||
return default_deconstruction_wrench(user, W)
|
||||
|
||||
@@ -161,14 +161,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!W.is_wrench())
|
||||
if (!W.get_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
return default_deconstruction_wrench(user, W)
|
||||
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (do_after(user, 40 * W.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
deconstruct()
|
||||
|
||||
@@ -381,7 +381,7 @@
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.remove_fuel(0,user))
|
||||
to_chat(user, "<span class='notice'>Now welding the vent.</span>")
|
||||
if(do_after(user, 20 * WT.toolspeed))
|
||||
if(do_after(user, 20 * WT.get_tool_speed(TOOL_WELDER)))
|
||||
if(!src || !WT.isOn()) return
|
||||
playsound(src, WT.usesound, 50, 1)
|
||||
if(!welded)
|
||||
@@ -416,27 +416,16 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!W.is_wrench())
|
||||
if (!W.get_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && use_power)
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
var/turf/T = src.loc
|
||||
if (node && node.level==1 && isturf(T) && !T.is_plating())
|
||||
to_chat(user, "<span class='warning'>You must remove the plating first.</span>")
|
||||
return 1
|
||||
if(!can_unwrench())
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (do_after(user, 40 * W.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
deconstruct()
|
||||
return TRUE
|
||||
return default_deconstruction_wrench(user, W)
|
||||
|
||||
#undef DEFAULT_PRESSURE_DELTA
|
||||
|
||||
|
||||
@@ -264,27 +264,17 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!W.is_wrench())
|
||||
if (!W.get_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && use_power)
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
var/turf/T = src.loc
|
||||
if (node && node.level==1 && isturf(T) && !T.is_plating())
|
||||
to_chat(user, "<span class='warning'>You must remove the plating first.</span>")
|
||||
return 1
|
||||
if(!can_unwrench())
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (do_after(user, 40 * W.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
deconstruct()
|
||||
return TRUE
|
||||
return default_deconstruction_wrench(user, W)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
var/datum/pipe_network/network_node2
|
||||
|
||||
/obj/machinery/atmospherics/valve/open
|
||||
open = 1
|
||||
open = TRUE
|
||||
icon_state = "map_valve1"
|
||||
|
||||
/obj/machinery/atmospherics/valve/update_icon(animation)
|
||||
@@ -61,7 +61,7 @@
|
||||
network_node1 = new_network
|
||||
|
||||
if(new_network.normal_members.Find(src))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
new_network.normal_members += src
|
||||
|
||||
@@ -89,9 +89,10 @@
|
||||
node2 = null
|
||||
|
||||
/obj/machinery/atmospherics/valve/proc/open()
|
||||
if(open) return 0
|
||||
if(open)
|
||||
return FALSE
|
||||
|
||||
open = 1
|
||||
open = TRUE
|
||||
update_icon()
|
||||
|
||||
if(network_node1&&network_node2)
|
||||
@@ -99,17 +100,17 @@
|
||||
network_node2 = network_node1
|
||||
|
||||
if(network_node1)
|
||||
network_node1.update = 1
|
||||
network_node1.update = TRUE
|
||||
else if(network_node2)
|
||||
network_node2.update = 1
|
||||
network_node2.update = TRUE
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/valve/proc/close()
|
||||
if(!open)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
open = 0
|
||||
open = FALSE
|
||||
update_icon()
|
||||
|
||||
if(network_node1)
|
||||
@@ -119,7 +120,7 @@
|
||||
|
||||
build_network()
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/valve/proc/normalize_dir()
|
||||
if(dir==3)
|
||||
@@ -141,9 +142,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/valve/process()
|
||||
..()
|
||||
. = PROCESS_KILL
|
||||
|
||||
return
|
||||
return PROCESS_KILL
|
||||
|
||||
/obj/machinery/atmospherics/valve/atmos_init()
|
||||
normalize_dir()
|
||||
@@ -199,7 +198,7 @@
|
||||
if(network_node2 == old_network)
|
||||
network_node2 = new_network
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/valve/return_network_air(datum/pipe_network/reference)
|
||||
return null
|
||||
@@ -229,7 +228,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/Destroy()
|
||||
unregister_radio(src, frequency)
|
||||
. = ..()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
@@ -240,20 +239,20 @@
|
||||
if(!src.allowed(user))
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
return
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/open
|
||||
open = 1
|
||||
open = TRUE
|
||||
icon_state = "map_valve1"
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
. = ..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/update_icon()
|
||||
..()
|
||||
. = ..()
|
||||
if(!powered())
|
||||
icon_state = "valve[open]nopower"
|
||||
|
||||
@@ -270,7 +269,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("valve_open")
|
||||
@@ -286,25 +285,16 @@
|
||||
close()
|
||||
else
|
||||
open()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/valve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!W.is_wrench())
|
||||
if (!W.get_tool_quality(TOOL_WRENCH))
|
||||
return ..()
|
||||
if (istype(src, /obj/machinery/atmospherics/valve/digital) && !src.allowed(user))
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
return 1
|
||||
if(!can_unwrench())
|
||||
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (do_after(user, 40 * W.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
||||
"<span class='notice'>You have unfastened \the [src].</span>", \
|
||||
"You hear a ratchet.")
|
||||
deconstruct()
|
||||
return TRUE
|
||||
return default_deconstruction_wrench(user, W)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/valve/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user