mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Machinery: Always use update_use_power()
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/obj/machinery/atmospherics/binary
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
|
||||
var/datum/gas_mixture/air1
|
||||
var/datum/gas_mixture/air2
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
level = 1
|
||||
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 7500 //7500 W ~ 10 HP
|
||||
|
||||
@@ -214,10 +214,10 @@
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
if(signal.data["power"])
|
||||
use_power = text2num(signal.data["power"])
|
||||
update_use_power(text2num(signal.data["power"]))
|
||||
|
||||
if(signal.data["power_toggle"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
if(signal.data["direction"])
|
||||
pump_direction = text2num(signal.data["direction"])
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
name = "pressure regulator"
|
||||
desc = "A one-way air valve that can be used to regulate input or output pressure, and flow rate. Does not require power."
|
||||
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
|
||||
var/unlocked = 0 //If 0, then the valve is locked closed, otherwise it is open(-able, it's a one-way valve so it closes if gas would flow backwards).
|
||||
var/target_pressure = ONE_ATMOSPHERE
|
||||
|
||||
@@ -26,7 +26,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
//var/max_volume_transfer = 10000
|
||||
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 7500 //7500 W ~ 10 HP
|
||||
|
||||
@@ -47,7 +47,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/on
|
||||
icon_state = "map_on"
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/update_icon()
|
||||
@@ -160,12 +160,12 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
if(signal.data["power"])
|
||||
if(text2num(signal.data["power"]))
|
||||
use_power = 1
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
else
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
if(signal.data["set_output_pressure"])
|
||||
target_pressure = between(
|
||||
@@ -199,7 +199,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
if(..()) return 1
|
||||
|
||||
if(href_list["power"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
switch(href_list["set_press"])
|
||||
if ("min")
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
power_rating = 15000 //15000 W ~ 20 HP
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/high_power/on
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
icon_state = "map_on"
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/high_power/update_icon()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
var/datum/omni_port/input
|
||||
var/datum/omni_port/output
|
||||
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 7500 //7500 W ~ 10 HP
|
||||
|
||||
@@ -161,13 +161,13 @@
|
||||
switch(href_list["command"])
|
||||
if("power")
|
||||
if(!configuring)
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
else
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
if("configure")
|
||||
configuring = !configuring
|
||||
if(configuring)
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
//only allows config changes when in configuring mode ~otherwise you'll get weird pressure stuff going on
|
||||
if(configuring && !use_power)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
icon_state = "map_mixer"
|
||||
pipe_state = "omni_mixer"
|
||||
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 3700 //3700 W ~ 5 HP
|
||||
|
||||
@@ -178,13 +178,13 @@
|
||||
switch(href_list["command"])
|
||||
if("power")
|
||||
if(!configuring)
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
else
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
if("configure")
|
||||
configuring = !configuring
|
||||
if(configuring)
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
//only allows config changes when in configuring mode ~otherwise you'll get weird pressure stuff going on
|
||||
if(configuring && !use_power)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
name = "omni device"
|
||||
icon = 'icons/atmos/omni_devices_vr.dmi' //VOREStation Edit - New Icon
|
||||
icon_state = "base"
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
initialize_directions = 0
|
||||
construction_type = /obj/item/pipe/quaternary
|
||||
level = 1
|
||||
@@ -67,7 +67,7 @@
|
||||
last_flow_rate = 0
|
||||
|
||||
if(error_check())
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
if((stat & (NOPOWER|BROKEN)) || !use_power)
|
||||
return 0
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
var/datum/pipe_network/network
|
||||
|
||||
var/on = 0
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
level = 1
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/init_dir()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
name = "Gas filter"
|
||||
desc = "Filters one type of gas from an input, and pushes it out the side."
|
||||
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 7500 //This also doubles as a measure of how powerful the filter is, in Watts. 7500 W ~ 10 HP
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
icon_state += use_power ? "on" : "off"
|
||||
else
|
||||
icon_state += "off"
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/atmos_filter/process()
|
||||
..()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
name = "Gas mixer"
|
||||
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 3700 //This also doubles as a measure of how powerful the mixer is, in Watts. 3700 W ~ 5 HP
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
icon_state += use_power ? "on" : "off"
|
||||
else
|
||||
icon_state += "off"
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/New()
|
||||
..()
|
||||
@@ -114,7 +114,7 @@
|
||||
/obj/machinery/atmospherics/trinary/mixer/Topic(href,href_list)
|
||||
if(..()) return 1
|
||||
if(href_list["power"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
if(href_list["set_press"])
|
||||
var/max_flow_rate = min(air1.volume, air2.volume)
|
||||
var/new_flow_rate = input(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",src.set_flow_rate) as num
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/obj/machinery/atmospherics/trinary
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH|WEST
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
pipe_flags = PIPING_DEFAULT_LAYER_ONLY|PIPING_ONE_PER_TURF
|
||||
|
||||
var/mirrored = FALSE
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
icon_state = "freezer_0"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 5 // 5 Watts for thermostat related circuitry
|
||||
circuit = /obj/item/weapon/circuitboard/unary_atmos/cooler
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["toggleStatus"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
icon_state = "heater_0"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 5 //5 Watts for thermostat related circuitry
|
||||
circuit = /obj/item/weapon/circuitboard/unary_atmos/heater
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["toggleStatus"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
name = "air injector"
|
||||
desc = "Passively injects air into its surroundings. Has a valve attached to it that can control flow rate."
|
||||
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 15000 //15000 W ~ 20 HP
|
||||
|
||||
@@ -132,10 +132,10 @@
|
||||
return 0
|
||||
|
||||
if(signal.data["power"])
|
||||
use_power = text2num(signal.data["power"])
|
||||
update_use_power(text2num(signal.data["power"]))
|
||||
|
||||
if(signal.data["power_toggle"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
if(signal.data["inject"])
|
||||
spawn inject()
|
||||
@@ -160,7 +160,7 @@
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/attack_hand(mob/user as mob)
|
||||
to_chat(user, "<span class='notice'>You toggle \the [src].</span>")
|
||||
injecting = !injecting
|
||||
use_power = injecting
|
||||
update_use_power(injecting ? USE_POWER_IDLE : USE_POWER_OFF)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
name = "Air Vent"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 30000 //7500 W ~ 10 HP //VOREStation Edit - 30000 W
|
||||
|
||||
@@ -50,18 +50,18 @@
|
||||
//var/datum/looping_sound/air_pump/soundloop //VOREStation Removal
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/on
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
icon_state = "map_vent_out"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/siphon
|
||||
pump_direction = 0
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/siphon/on
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
icon_state = "map_vent_in"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/siphon/on/atmos
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
icon_state = "map_vent_in"
|
||||
external_pressure_bound = 0
|
||||
external_pressure_bound_default = 0
|
||||
@@ -189,7 +189,7 @@
|
||||
return 1
|
||||
|
||||
if (!node)
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
if(!can_pump())
|
||||
return 0
|
||||
|
||||
@@ -311,10 +311,10 @@
|
||||
pump_direction = 1
|
||||
|
||||
if(signal.data["power"] != null)
|
||||
use_power = text2num(signal.data["power"])
|
||||
update_use_power(text2num(signal.data["power"]))
|
||||
|
||||
if(signal.data["power_toggle"] != null)
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
if(signal.data["checks"] != null)
|
||||
if (signal.data["checks"] == "default")
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
name = "Air Scrubber"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 7500 //7500 W ~ 10 HP
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
var/radio_filter_in
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/on
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
icon_state = "map_scrubber_on"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/New()
|
||||
@@ -135,7 +135,7 @@
|
||||
return 1
|
||||
|
||||
if (!node)
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
//broadcast_status()
|
||||
if(!use_power || (stat & (NOPOWER|BROKEN)))
|
||||
return 0
|
||||
@@ -180,21 +180,21 @@
|
||||
return 0
|
||||
|
||||
if(signal.data["power"] != null)
|
||||
use_power = text2num(signal.data["power"])
|
||||
update_use_power(text2num(signal.data["power"]))
|
||||
if(signal.data["power_toggle"] != null)
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
if(signal.data["panic_siphon"]) //must be before if("scrubbing" thing
|
||||
panic = text2num(signal.data["panic_siphon"])
|
||||
if(panic)
|
||||
use_power = 1
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
scrubbing = 0
|
||||
else
|
||||
scrubbing = 1
|
||||
if(signal.data["toggle_panic_siphon"] != null)
|
||||
panic = !panic
|
||||
if(panic)
|
||||
use_power = 1
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
scrubbing = 0
|
||||
else
|
||||
scrubbing = 1
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
var/leaking = FALSE // Do not set directly, use set_leaking(TRUE/FALSE)
|
||||
|
||||
layer = PIPES_LAYER
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
|
||||
pipe_flags = 0 // Does not have PIPING_DEFAULT_LAYER_ONLY flag.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user