mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-16 13:12:22 +00:00
Always call update_use_power() instead of directly setting the use_power var.
- This will let us react to the change appropriately. - While we're here, lets define some constants so we can stop using bare numbers. - Always use those constants when calling update_use_power()
This commit is contained in:
@@ -214,10 +214,10 @@
|
|||||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||||
return 0
|
return 0
|
||||||
if(signal.data["power"])
|
if(signal.data["power"])
|
||||||
use_power = text2num(signal.data["power"])
|
update_use_power(text2num(signal.data["power"]))
|
||||||
|
|
||||||
if(signal.data["power_toggle"])
|
if(signal.data["power_toggle"])
|
||||||
use_power = !use_power
|
update_use_power(!use_power)
|
||||||
|
|
||||||
if(signal.data["direction"])
|
if(signal.data["direction"])
|
||||||
pump_direction = text2num(signal.data["direction"])
|
pump_direction = text2num(signal.data["direction"])
|
||||||
|
|||||||
@@ -160,12 +160,12 @@ Thus, the two variables affect pump operation are set in New():
|
|||||||
|
|
||||||
if(signal.data["power"])
|
if(signal.data["power"])
|
||||||
if(text2num(signal.data["power"]))
|
if(text2num(signal.data["power"]))
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
else
|
else
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
|
|
||||||
if("power_toggle" in signal.data)
|
if("power_toggle" in signal.data)
|
||||||
use_power = !use_power
|
update_use_power(!use_power)
|
||||||
|
|
||||||
if(signal.data["set_output_pressure"])
|
if(signal.data["set_output_pressure"])
|
||||||
target_pressure = between(
|
target_pressure = between(
|
||||||
@@ -199,7 +199,7 @@ Thus, the two variables affect pump operation are set in New():
|
|||||||
if(..()) return 1
|
if(..()) return 1
|
||||||
|
|
||||||
if(href_list["power"])
|
if(href_list["power"])
|
||||||
use_power = !use_power
|
update_use_power(!use_power)
|
||||||
|
|
||||||
switch(href_list["set_press"])
|
switch(href_list["set_press"])
|
||||||
if ("min")
|
if ("min")
|
||||||
|
|||||||
@@ -161,13 +161,13 @@
|
|||||||
switch(href_list["command"])
|
switch(href_list["command"])
|
||||||
if("power")
|
if("power")
|
||||||
if(!configuring)
|
if(!configuring)
|
||||||
use_power = !use_power
|
update_use_power(!use_power)
|
||||||
else
|
else
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
if("configure")
|
if("configure")
|
||||||
configuring = !configuring
|
configuring = !configuring
|
||||||
if(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
|
//only allows config changes when in configuring mode ~otherwise you'll get weird pressure stuff going on
|
||||||
if(configuring && !use_power)
|
if(configuring && !use_power)
|
||||||
|
|||||||
@@ -178,13 +178,13 @@
|
|||||||
switch(href_list["command"])
|
switch(href_list["command"])
|
||||||
if("power")
|
if("power")
|
||||||
if(!configuring)
|
if(!configuring)
|
||||||
use_power = !use_power
|
update_use_power(!use_power)
|
||||||
else
|
else
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
if("configure")
|
if("configure")
|
||||||
configuring = !configuring
|
configuring = !configuring
|
||||||
if(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
|
//only allows config changes when in configuring mode ~otherwise you'll get weird pressure stuff going on
|
||||||
if(configuring && !use_power)
|
if(configuring && !use_power)
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
last_flow_rate = 0
|
last_flow_rate = 0
|
||||||
|
|
||||||
if(error_check())
|
if(error_check())
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
|
|
||||||
if((stat & (NOPOWER|BROKEN)) || !use_power)
|
if((stat & (NOPOWER|BROKEN)) || !use_power)
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
icon_state += use_power ? "on" : "off"
|
icon_state += use_power ? "on" : "off"
|
||||||
else
|
else
|
||||||
icon_state += "off"
|
icon_state += "off"
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
|
|
||||||
/obj/machinery/atmospherics/trinary/atmos_filter/process()
|
/obj/machinery/atmospherics/trinary/atmos_filter/process()
|
||||||
..()
|
..()
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
icon_state += use_power ? "on" : "off"
|
icon_state += use_power ? "on" : "off"
|
||||||
else
|
else
|
||||||
icon_state += "off"
|
icon_state += "off"
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
|
|
||||||
/obj/machinery/atmospherics/trinary/mixer/New()
|
/obj/machinery/atmospherics/trinary/mixer/New()
|
||||||
..()
|
..()
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
/obj/machinery/atmospherics/trinary/mixer/Topic(href,href_list)
|
/obj/machinery/atmospherics/trinary/mixer/Topic(href,href_list)
|
||||||
if(..()) return 1
|
if(..()) return 1
|
||||||
if(href_list["power"])
|
if(href_list["power"])
|
||||||
use_power = !use_power
|
update_use_power(!use_power)
|
||||||
if(href_list["set_press"])
|
if(href_list["set_press"])
|
||||||
var/max_flow_rate = min(air1.volume, air2.volume)
|
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
|
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
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
if(..())
|
if(..())
|
||||||
return 1
|
return 1
|
||||||
if(href_list["toggleStatus"])
|
if(href_list["toggleStatus"])
|
||||||
use_power = !use_power
|
update_use_power(!use_power)
|
||||||
update_icon()
|
update_icon()
|
||||||
if(href_list["temp"])
|
if(href_list["temp"])
|
||||||
var/amount = text2num(href_list["temp"])
|
var/amount = text2num(href_list["temp"])
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
if(..())
|
if(..())
|
||||||
return 1
|
return 1
|
||||||
if(href_list["toggleStatus"])
|
if(href_list["toggleStatus"])
|
||||||
use_power = !use_power
|
update_use_power(!use_power)
|
||||||
update_icon()
|
update_icon()
|
||||||
if(href_list["temp"])
|
if(href_list["temp"])
|
||||||
var/amount = text2num(href_list["temp"])
|
var/amount = text2num(href_list["temp"])
|
||||||
|
|||||||
@@ -132,10 +132,10 @@
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
if(signal.data["power"])
|
if(signal.data["power"])
|
||||||
use_power = text2num(signal.data["power"])
|
update_use_power(text2num(signal.data["power"]))
|
||||||
|
|
||||||
if(signal.data["power_toggle"])
|
if(signal.data["power_toggle"])
|
||||||
use_power = !use_power
|
update_use_power(!use_power)
|
||||||
|
|
||||||
if(signal.data["inject"])
|
if(signal.data["inject"])
|
||||||
spawn inject()
|
spawn inject()
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
/obj/machinery/atmospherics/unary/outlet_injector/attack_hand(mob/user as mob)
|
/obj/machinery/atmospherics/unary/outlet_injector/attack_hand(mob/user as mob)
|
||||||
to_chat(user, "<span class='notice'>You toggle \the [src].</span>")
|
to_chat(user, "<span class='notice'>You toggle \the [src].</span>")
|
||||||
injecting = !injecting
|
injecting = !injecting
|
||||||
use_power = injecting
|
update_use_power(injecting ? USE_POWER_IDLE : USE_POWER_OFF)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/machinery/atmospherics/unary/outlet_injector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
/obj/machinery/atmospherics/unary/outlet_injector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||||
|
|||||||
@@ -173,7 +173,7 @@
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
if (!node)
|
if (!node)
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
if(!can_pump())
|
if(!can_pump())
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -295,10 +295,10 @@
|
|||||||
pump_direction = 1
|
pump_direction = 1
|
||||||
|
|
||||||
if(signal.data["power"] != null)
|
if(signal.data["power"] != null)
|
||||||
use_power = text2num(signal.data["power"])
|
update_use_power(text2num(signal.data["power"]))
|
||||||
|
|
||||||
if(signal.data["power_toggle"] != null)
|
if(signal.data["power_toggle"] != null)
|
||||||
use_power = !use_power
|
update_use_power(!use_power)
|
||||||
|
|
||||||
if(signal.data["checks"] != null)
|
if(signal.data["checks"] != null)
|
||||||
if (signal.data["checks"] == "default")
|
if (signal.data["checks"] == "default")
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
if (!node)
|
if (!node)
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
//broadcast_status()
|
//broadcast_status()
|
||||||
if(!use_power || (stat & (NOPOWER|BROKEN)))
|
if(!use_power || (stat & (NOPOWER|BROKEN)))
|
||||||
return 0
|
return 0
|
||||||
@@ -180,21 +180,21 @@
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
if(signal.data["power"] != null)
|
if(signal.data["power"] != null)
|
||||||
use_power = text2num(signal.data["power"])
|
update_use_power(text2num(signal.data["power"]))
|
||||||
if(signal.data["power_toggle"] != null)
|
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
|
if(signal.data["panic_siphon"]) //must be before if("scrubbing" thing
|
||||||
panic = text2num(signal.data["panic_siphon"])
|
panic = text2num(signal.data["panic_siphon"])
|
||||||
if(panic)
|
if(panic)
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
scrubbing = 0
|
scrubbing = 0
|
||||||
else
|
else
|
||||||
scrubbing = 1
|
scrubbing = 1
|
||||||
if(signal.data["toggle_panic_siphon"] != null)
|
if(signal.data["toggle_panic_siphon"] != null)
|
||||||
panic = !panic
|
panic = !panic
|
||||||
if(panic)
|
if(panic)
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
scrubbing = 0
|
scrubbing = 0
|
||||||
else
|
else
|
||||||
scrubbing = 1
|
scrubbing = 1
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ var/global/defer_powernet_rebuild = 0 // True if net rebuild will be called
|
|||||||
#define DOOR_CRUSH_DAMAGE 20
|
#define DOOR_CRUSH_DAMAGE 20
|
||||||
#define ALIEN_SELECT_AFK_BUFFER 1 // How many minutes that a person can be AFK before not being allowed to be an alien.
|
#define ALIEN_SELECT_AFK_BUFFER 1 // How many minutes that a person can be AFK before not being allowed to be an alien.
|
||||||
|
|
||||||
|
// Constants for machine's use_power
|
||||||
|
#define USE_POWER_OFF 0 // No continuous power use
|
||||||
|
#define USE_POWER_IDLE 1 // Machine is using power at its idle power level
|
||||||
|
#define USE_POWER_ACTIVE 2 // Machine is using power at its active power level
|
||||||
|
|
||||||
// Channel numbers for power.
|
// Channel numbers for power.
|
||||||
#define EQUIP 1
|
#define EQUIP 1
|
||||||
#define LIGHT 2
|
#define LIGHT 2
|
||||||
|
|||||||
@@ -386,7 +386,7 @@
|
|||||||
M.client.perspective = EYE_PERSPECTIVE
|
M.client.perspective = EYE_PERSPECTIVE
|
||||||
M.client.eye = src
|
M.client.eye = src
|
||||||
M.loc = src
|
M.loc = src
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
occupant = M
|
occupant = M
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
@@ -406,7 +406,7 @@
|
|||||||
if(A in component_parts)
|
if(A in component_parts)
|
||||||
continue
|
continue
|
||||||
A.loc = src.loc
|
A.loc = src.loc
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
update_icon()
|
update_icon()
|
||||||
toggle_filter()
|
toggle_filter()
|
||||||
toggle_pump()
|
toggle_pump()
|
||||||
|
|||||||
@@ -192,7 +192,7 @@
|
|||||||
if(!regulating_temperature)
|
if(!regulating_temperature)
|
||||||
//check for when we should start adjusting temperature
|
//check for when we should start adjusting temperature
|
||||||
if(!get_danger_level(target_temperature, TLV["temperature"]) && abs(environment.temperature - target_temperature) > 2.0)
|
if(!get_danger_level(target_temperature, TLV["temperature"]) && abs(environment.temperature - target_temperature) > 2.0)
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
regulating_temperature = 1
|
regulating_temperature = 1
|
||||||
audible_message("\The [src] clicks as it starts [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\
|
audible_message("\The [src] clicks as it starts [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\
|
||||||
"You hear a click and a faint electronic hum.")
|
"You hear a click and a faint electronic hum.")
|
||||||
@@ -200,7 +200,7 @@
|
|||||||
else
|
else
|
||||||
//check for when we should stop adjusting temperature
|
//check for when we should stop adjusting temperature
|
||||||
if(get_danger_level(target_temperature, TLV["temperature"]) || abs(environment.temperature - target_temperature) <= 0.5)
|
if(get_danger_level(target_temperature, TLV["temperature"]) || abs(environment.temperature - target_temperature) <= 0.5)
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
regulating_temperature = 0
|
regulating_temperature = 0
|
||||||
audible_message("\The [src] clicks quietly as it stops [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\
|
audible_message("\The [src] clicks quietly as it stops [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\
|
||||||
"You hear a click as a faint electronic humming stops.")
|
"You hear a click as a faint electronic humming stops.")
|
||||||
|
|||||||
@@ -246,7 +246,7 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
busy = 1
|
busy = 1
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
|
|
||||||
//Check if we still have the materials.
|
//Check if we still have the materials.
|
||||||
var/coeff = (making.no_scale ? 1 : mat_efficiency) //stacks are unaffected by production coefficient
|
var/coeff = (making.no_scale ? 1 : mat_efficiency) //stacks are unaffected by production coefficient
|
||||||
@@ -265,7 +265,7 @@
|
|||||||
sleep(build_time)
|
sleep(build_time)
|
||||||
|
|
||||||
busy = 0
|
busy = 0
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
update_icon() // So lid opens
|
update_icon() // So lid opens
|
||||||
|
|
||||||
//Sanity check.
|
//Sanity check.
|
||||||
|
|||||||
@@ -118,16 +118,16 @@
|
|||||||
/obj/machinery/cell_charger/process()
|
/obj/machinery/cell_charger/process()
|
||||||
//to_world("ccpt [charging] [stat]")
|
//to_world("ccpt [charging] [stat]")
|
||||||
if((stat & (BROKEN|NOPOWER)) || !anchored)
|
if((stat & (BROKEN|NOPOWER)) || !anchored)
|
||||||
update_use_power(0)
|
update_use_power(USE_POWER_OFF)
|
||||||
return
|
return
|
||||||
|
|
||||||
if(charging && !charging.fully_charged())
|
if(charging && !charging.fully_charged())
|
||||||
charging.give(efficiency*CELLRATE)
|
charging.give(efficiency*CELLRATE)
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
|
|
||||||
update_icon()
|
update_icon()
|
||||||
else
|
else
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
|
|
||||||
/obj/machinery/cell_charger/RefreshParts()
|
/obj/machinery/cell_charger/RefreshParts()
|
||||||
var/E = 0
|
var/E = 0
|
||||||
|
|||||||
@@ -170,7 +170,7 @@
|
|||||||
src.current_camera = C
|
src.current_camera = C
|
||||||
if(current_camera)
|
if(current_camera)
|
||||||
current_camera.camera_computers_using_this.Add(src)
|
current_camera.camera_computers_using_this.Add(src)
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
var/mob/living/L = current_camera.loc
|
var/mob/living/L = current_camera.loc
|
||||||
if(istype(L))
|
if(istype(L))
|
||||||
L.tracking_initiated()
|
L.tracking_initiated()
|
||||||
|
|||||||
@@ -291,7 +291,7 @@
|
|||||||
unbuckle_mob(occupant, force = TRUE)
|
unbuckle_mob(occupant, force = TRUE)
|
||||||
occupant = null
|
occupant = null
|
||||||
current_heat_capacity = initial(current_heat_capacity)
|
current_heat_capacity = initial(current_heat_capacity)
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
return
|
return
|
||||||
/obj/machinery/atmospherics/unary/cryo_cell/proc/put_mob(mob/living/carbon/M as mob)
|
/obj/machinery/atmospherics/unary/cryo_cell/proc/put_mob(mob/living/carbon/M as mob)
|
||||||
if(stat & (NOPOWER|BROKEN))
|
if(stat & (NOPOWER|BROKEN))
|
||||||
@@ -322,7 +322,7 @@
|
|||||||
vis_contents |= occupant
|
vis_contents |= occupant
|
||||||
occupant.pixel_y += 19
|
occupant.pixel_y += 19
|
||||||
current_heat_capacity = HEAT_CAPACITY_HUMAN
|
current_heat_capacity = HEAT_CAPACITY_HUMAN
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
// M.metabslow = 1
|
// M.metabslow = 1
|
||||||
add_fingerprint(usr)
|
add_fingerprint(usr)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ var/list/floor_light_cache = list()
|
|||||||
return
|
return
|
||||||
|
|
||||||
on = !on
|
on = !on
|
||||||
if(on) use_power = 2
|
if(on) update_use_power(USE_POWER_ACTIVE)
|
||||||
visible_message("<span class='notice'>\The [user] turns \the [src] [on ? "on" : "off"].</span>")
|
visible_message("<span class='notice'>\The [user] turns \the [src] [on ? "on" : "off"].</span>")
|
||||||
update_brightness()
|
update_brightness()
|
||||||
return
|
return
|
||||||
@@ -81,11 +81,11 @@ var/list/floor_light_cache = list()
|
|||||||
..()
|
..()
|
||||||
var/need_update
|
var/need_update
|
||||||
if((!anchored || broken()) && on)
|
if((!anchored || broken()) && on)
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
on = 0
|
on = 0
|
||||||
need_update = 1
|
need_update = 1
|
||||||
else if(use_power && !on)
|
else if(use_power && !on)
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
need_update = 1
|
need_update = 1
|
||||||
if(need_update)
|
if(need_update)
|
||||||
update_brightness()
|
update_brightness()
|
||||||
@@ -95,7 +95,7 @@ var/list/floor_light_cache = list()
|
|||||||
if(light_range != default_light_range || light_power != default_light_power || light_color != default_light_colour)
|
if(light_range != default_light_range || light_power != default_light_power || light_color != default_light_colour)
|
||||||
set_light(default_light_range, default_light_power, default_light_colour)
|
set_light(default_light_range, default_light_power, default_light_colour)
|
||||||
else
|
else
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
if(light_range || light_power)
|
if(light_range || light_power)
|
||||||
set_light(0)
|
set_light(0)
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
if(stat & (BROKEN|NOPOWER))
|
if(stat & (BROKEN|NOPOWER))
|
||||||
return
|
return
|
||||||
lit = !lit
|
lit = !lit
|
||||||
use_power = lit ? 2 : 1
|
update_use_power(lit ? USE_POWER_ACTIVE : USE_POWER_IDLE)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/machinery/holosign/update_icon()
|
/obj/machinery/holosign/update_icon()
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
..()
|
..()
|
||||||
if(stat & NOPOWER)
|
if(stat & NOPOWER)
|
||||||
lit = 0
|
lit = 0
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
|
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ datum/track/New(var/title_name, var/audio)
|
|||||||
|
|
||||||
main_area.forced_ambience = null
|
main_area.forced_ambience = null
|
||||||
playing = 0
|
playing = 0
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ datum/track/New(var/title_name, var/audio)
|
|||||||
main_area.play_ambience(M)
|
main_area.play_ambience(M)
|
||||||
|
|
||||||
playing = 1
|
playing = 1
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
// Advance to the next track - Don't start playing it unless we were already playing
|
// Advance to the next track - Don't start playing it unless we were already playing
|
||||||
|
|||||||
@@ -142,10 +142,10 @@
|
|||||||
|
|
||||||
// Update power usage:
|
// Update power usage:
|
||||||
if(on)
|
if(on)
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
active_power_usage = electricity_level*15
|
active_power_usage = electricity_level*15
|
||||||
else
|
else
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
|
|
||||||
// Overload conditions:
|
// Overload conditions:
|
||||||
/* // Eeeehhh kinda stupid
|
/* // Eeeehhh kinda stupid
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
if(stat & (BROKEN|NOPOWER))
|
if(stat & (BROKEN|NOPOWER))
|
||||||
return
|
return
|
||||||
lit = !lit
|
lit = !lit
|
||||||
use_power = lit ? 2 : 1
|
update_use_power(lit ? USE_POWER_ACTIVE : USE_POWER_IDLE)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/machinery/neonsign/update_icon()
|
/obj/machinery/neonsign/update_icon()
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
..()
|
..()
|
||||||
if(stat & NOPOWER)
|
if(stat & NOPOWER)
|
||||||
lit = 0
|
lit = 0
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
|
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
if(breather.internals)
|
if(breather.internals)
|
||||||
breather.internals.icon_state = "internal0"
|
breather.internals.icon_state = "internal0"
|
||||||
breather = null
|
breather = null
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
|
|
||||||
/obj/machinery/oxygen_pump/attack_ai(mob/user as mob)
|
/obj/machinery/oxygen_pump/attack_ai(mob/user as mob)
|
||||||
ui_interact(user)
|
ui_interact(user)
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
breather.internal = tank
|
breather.internal = tank
|
||||||
if(breather.internals)
|
if(breather.internals)
|
||||||
breather.internals.icon_state = "internal1"
|
breather.internals.icon_state = "internal1"
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
|
|
||||||
/obj/machinery/oxygen_pump/proc/can_apply_to_target(var/mob/living/carbon/human/target, mob/user as mob)
|
/obj/machinery/oxygen_pump/proc/can_apply_to_target(var/mob/living/carbon/human/target, mob/user as mob)
|
||||||
if(!user)
|
if(!user)
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
contained.forceMove(src)
|
contained.forceMove(src)
|
||||||
src.visible_message("<span class='notice'>\The [contained] rapidly retracts back into \the [src]!</span>")
|
src.visible_message("<span class='notice'>\The [contained] rapidly retracts back into \the [src]!</span>")
|
||||||
breather = null
|
breather = null
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
else if(!breather.internal && tank)
|
else if(!breather.internal && tank)
|
||||||
breather.internal = tank
|
breather.internal = tank
|
||||||
if(breather.internals)
|
if(breather.internals)
|
||||||
@@ -287,7 +287,7 @@
|
|||||||
contained.forceMove(src)
|
contained.forceMove(src)
|
||||||
src.visible_message("<span class='notice'>\The [contained] rapidly retracts back into \the [src]!</span>")
|
src.visible_message("<span class='notice'>\The [contained] rapidly retracts back into \the [src]!</span>")
|
||||||
breather = null
|
breather = null
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
else if(!breather.internal && tank)
|
else if(!breather.internal && tank)
|
||||||
breather.internal = tank
|
breather.internal = tank
|
||||||
if(breather.internals)
|
if(breather.internals)
|
||||||
|
|||||||
@@ -117,12 +117,12 @@
|
|||||||
|
|
||||||
/obj/machinery/recharger/process()
|
/obj/machinery/recharger/process()
|
||||||
if(stat & (NOPOWER|BROKEN) || !anchored)
|
if(stat & (NOPOWER|BROKEN) || !anchored)
|
||||||
update_use_power(0)
|
update_use_power(USE_POWER_OFF)
|
||||||
icon_state = icon_state_idle
|
icon_state = icon_state_idle
|
||||||
return
|
return
|
||||||
|
|
||||||
if(!charging)
|
if(!charging)
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
icon_state = icon_state_idle
|
icon_state = icon_state_idle
|
||||||
else
|
else
|
||||||
var/obj/item/weapon/cell/C = charging.get_cell()
|
var/obj/item/weapon/cell/C = charging.get_cell()
|
||||||
@@ -130,10 +130,10 @@
|
|||||||
if(!C.fully_charged())
|
if(!C.fully_charged())
|
||||||
icon_state = icon_state_charging
|
icon_state = icon_state_charging
|
||||||
C.give(CELLRATE*efficiency)
|
C.give(CELLRATE*efficiency)
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
else
|
else
|
||||||
icon_state = icon_state_charged
|
icon_state = icon_state_charged
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
|
|
||||||
/obj/machinery/recharger/emp_act(severity)
|
/obj/machinery/recharger/emp_act(severity)
|
||||||
if(stat & (NOPOWER|BROKEN) || !anchored)
|
if(stat & (NOPOWER|BROKEN) || !anchored)
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ Please wait until completion...</TT><BR>
|
|||||||
if(!isnull(building))
|
if(!isnull(building))
|
||||||
if(metal_amount >= build_cost)
|
if(metal_amount >= build_cost)
|
||||||
operating = 1
|
operating = 1
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
|
|
||||||
metal_amount = max(0, metal_amount - build_cost)
|
metal_amount = max(0, metal_amount - build_cost)
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ Please wait until completion...</TT><BR>
|
|||||||
if(!isnull(being_built))
|
if(!isnull(being_built))
|
||||||
being_built.loc = get_turf(src)
|
being_built.loc = get_turf(src)
|
||||||
being_built = null
|
being_built = null
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
operating = 0
|
operating = 0
|
||||||
overlays -= "fab-active"
|
overlays -= "fab-active"
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
/obj/machinery/power/supply_beacon/attack_hand(var/mob/user)
|
/obj/machinery/power/supply_beacon/attack_hand(var/mob/user)
|
||||||
|
|
||||||
if(expended)
|
if(expended)
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
to_chat (user, "<span class='warning'>\The [src] has used up its charge.</span>")
|
to_chat (user, "<span class='warning'>\The [src] has used up its charge.</span>")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -356,8 +356,8 @@
|
|||||||
if(com)
|
if(com)
|
||||||
com.icon_state = "tele1"
|
com.icon_state = "tele1"
|
||||||
use_power(5000)
|
use_power(5000)
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
com.update_use_power(2)
|
com.update_use_power(USE_POWER_ACTIVE)
|
||||||
for(var/mob/O in hearers(src, null))
|
for(var/mob/O in hearers(src, null))
|
||||||
O.show_message("<span class='notice'>Teleporter engaged!</span>", 2)
|
O.show_message("<span class='notice'>Teleporter engaged!</span>", 2)
|
||||||
add_fingerprint(usr)
|
add_fingerprint(usr)
|
||||||
@@ -371,8 +371,8 @@
|
|||||||
if(com)
|
if(com)
|
||||||
com.icon_state = "tele0"
|
com.icon_state = "tele0"
|
||||||
com.accurate = 0
|
com.accurate = 0
|
||||||
com.update_use_power(1)
|
com.update_use_power(USE_POWER_IDLE)
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
for(var/mob/O in hearers(src, null))
|
for(var/mob/O in hearers(src, null))
|
||||||
O.show_message("<span class='notice'>Teleporter disengaged!</span>", 2)
|
O.show_message("<span class='notice'>Teleporter disengaged!</span>", 2)
|
||||||
add_fingerprint(usr)
|
add_fingerprint(usr)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
if(A in component_parts)
|
if(A in component_parts)
|
||||||
continue
|
continue
|
||||||
A.loc = src.loc
|
A.loc = src.loc
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/machinery/vr_sleeper/alien/enter_vr()
|
/obj/machinery/vr_sleeper/alien/enter_vr()
|
||||||
|
|||||||
@@ -174,7 +174,7 @@
|
|||||||
M.client.perspective = EYE_PERSPECTIVE
|
M.client.perspective = EYE_PERSPECTIVE
|
||||||
M.client.eye = src
|
M.client.eye = src
|
||||||
M.loc = src
|
M.loc = src
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
occupant = M
|
occupant = M
|
||||||
|
|
||||||
update_icon()
|
update_icon()
|
||||||
@@ -203,7 +203,7 @@
|
|||||||
if(A in component_parts)
|
if(A in component_parts)
|
||||||
continue
|
continue
|
||||||
A.loc = src.loc
|
A.loc = src.loc
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/machinery/vr_sleeper/proc/enter_vr()
|
/obj/machinery/vr_sleeper/proc/enter_vr()
|
||||||
|
|||||||
@@ -48,11 +48,11 @@
|
|||||||
if(stat)
|
if(stat)
|
||||||
return
|
return
|
||||||
if(busy)
|
if(busy)
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
progress += speed
|
progress += speed
|
||||||
check_build()
|
check_build()
|
||||||
else
|
else
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/machinery/mecha_part_fabricator/update_icon()
|
/obj/machinery/mecha_part_fabricator/update_icon()
|
||||||
|
|||||||
@@ -52,11 +52,11 @@
|
|||||||
if(stat)
|
if(stat)
|
||||||
return
|
return
|
||||||
if(busy)
|
if(busy)
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
progress += speed
|
progress += speed
|
||||||
check_build()
|
check_build()
|
||||||
else
|
else
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/machinery/pros_fabricator/update_icon()
|
/obj/machinery/pros_fabricator/update_icon()
|
||||||
|
|||||||
@@ -539,7 +539,7 @@
|
|||||||
Pump.air2.gas["nitrogen"] = 3750 //The contents of 2 canisters.
|
Pump.air2.gas["nitrogen"] = 3750 //The contents of 2 canisters.
|
||||||
Pump.air2.temperature = 50
|
Pump.air2.temperature = 50
|
||||||
Pump.air2.update_values()
|
Pump.air2.update_values()
|
||||||
Pump.use_power=1
|
Pump.update_use_power(USE_POWER_IDLE)
|
||||||
Pump.target_pressure = 4500
|
Pump.target_pressure = 4500
|
||||||
Pump.update_icon()
|
Pump.update_icon()
|
||||||
|
|
||||||
|
|||||||
@@ -224,7 +224,7 @@
|
|||||||
damaged = 1
|
damaged = 1
|
||||||
loadProgram(powerdown_program, 0)
|
loadProgram(powerdown_program, 0)
|
||||||
active = 0
|
active = 0
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
for(var/mob/M in range(10,src))
|
for(var/mob/M in range(10,src))
|
||||||
M.show_message("The holodeck overloads!")
|
M.show_message("The holodeck overloads!")
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@
|
|||||||
linkedholodeck.gravitychange(1)
|
linkedholodeck.gravitychange(1)
|
||||||
|
|
||||||
active = 0
|
active = 0
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/computer/HolodeckControl/proc/loadProgram(var/prog, var/check_delay = 1)
|
/obj/machinery/computer/HolodeckControl/proc/loadProgram(var/prog, var/check_delay = 1)
|
||||||
|
|||||||
@@ -126,7 +126,7 @@
|
|||||||
GLOB.moved_event.register(watching_mob, src, /obj/machinery/station_map/proc/checkPosition)
|
GLOB.moved_event.register(watching_mob, src, /obj/machinery/station_map/proc/checkPosition)
|
||||||
GLOB.dir_set_event.register(watching_mob, src, /obj/machinery/station_map/proc/checkPosition)
|
GLOB.dir_set_event.register(watching_mob, src, /obj/machinery/station_map/proc/checkPosition)
|
||||||
GLOB.destroyed_event.register(watching_mob, src, /obj/machinery/station_map/proc/stopWatching)
|
GLOB.destroyed_event.register(watching_mob, src, /obj/machinery/station_map/proc/stopWatching)
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
|
|
||||||
if(bogus)
|
if(bogus)
|
||||||
to_chat(user, "<span class='warning'>The holomap failed to initialize. This area of space cannot be mapped.</span>")
|
to_chat(user, "<span class='warning'>The holomap failed to initialize. This area of space cannot be mapped.</span>")
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
GLOB.dir_set_event.unregister(watching_mob, src)
|
GLOB.dir_set_event.unregister(watching_mob, src)
|
||||||
GLOB.destroyed_event.unregister(watching_mob, src)
|
GLOB.destroyed_event.unregister(watching_mob, src)
|
||||||
watching_mob = null
|
watching_mob = null
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
|
|
||||||
/obj/machinery/station_map/power_change()
|
/obj/machinery/station_map/power_change()
|
||||||
. = ..()
|
. = ..()
|
||||||
|
|||||||
@@ -319,14 +319,14 @@ var/list/ai_verbs_default = list(
|
|||||||
qdel(src)
|
qdel(src)
|
||||||
return
|
return
|
||||||
if(powered_ai.APU_power)
|
if(powered_ai.APU_power)
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
return
|
return
|
||||||
if(!powered_ai.anchored)
|
if(!powered_ai.anchored)
|
||||||
loc = powered_ai.loc
|
loc = powered_ai.loc
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
use_power(50000) // Less optimalised but only called if AI is unwrenched. This prevents usage of wrenching as method to keep AI operational without power. Intellicard is for that.
|
use_power(50000) // Less optimalised but only called if AI is unwrenched. This prevents usage of wrenching as method to keep AI operational without power. Intellicard is for that.
|
||||||
if(powered_ai.anchored)
|
if(powered_ai.anchored)
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
|
|
||||||
/mob/living/silicon/ai/proc/pick_icon()
|
/mob/living/silicon/ai/proc/pick_icon()
|
||||||
set category = "AI Settings"
|
set category = "AI Settings"
|
||||||
|
|||||||
@@ -38,9 +38,9 @@
|
|||||||
|
|
||||||
/obj/machinery/ntnet_relay/process()
|
/obj/machinery/ntnet_relay/process()
|
||||||
if(operable())
|
if(operable())
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
else
|
else
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
|
|
||||||
if(dos_overload)
|
if(dos_overload)
|
||||||
dos_overload = max(0, dos_overload - dos_dissipate)
|
dos_overload = max(0, dos_overload - dos_dissipate)
|
||||||
|
|||||||
@@ -211,10 +211,10 @@
|
|||||||
/obj/machinery/power/am_control_unit/proc/toggle_power()
|
/obj/machinery/power/am_control_unit/proc/toggle_power()
|
||||||
active = !active
|
active = !active
|
||||||
if(active)
|
if(active)
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
visible_message("The [src.name] starts up.")
|
visible_message("The [src.name] starts up.")
|
||||||
else
|
else
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
visible_message("The [src.name] shuts down.")
|
visible_message("The [src.name] shuts down.")
|
||||||
update_icon()
|
update_icon()
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ var/list/fusion_cores = list()
|
|||||||
owned_field = new(loc, src)
|
owned_field = new(loc, src)
|
||||||
owned_field.ChangeFieldStrength(field_strength)
|
owned_field.ChangeFieldStrength(field_strength)
|
||||||
icon_state = "core1"
|
icon_state = "core1"
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
. = 1
|
. = 1
|
||||||
|
|
||||||
/obj/machinery/power/fusion_core/proc/Shutdown(var/force_rupture)
|
/obj/machinery/power/fusion_core/proc/Shutdown(var/force_rupture)
|
||||||
@@ -82,7 +82,7 @@ var/list/fusion_cores = list()
|
|||||||
owned_field.RadiateAll()
|
owned_field.RadiateAll()
|
||||||
qdel(owned_field)
|
qdel(owned_field)
|
||||||
owned_field = null
|
owned_field = null
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
|
|
||||||
/obj/machinery/power/fusion_core/proc/AddParticles(var/name, var/quantity = 1)
|
/obj/machinery/power/fusion_core/proc/AddParticles(var/name, var/quantity = 1)
|
||||||
if(owned_field)
|
if(owned_field)
|
||||||
|
|||||||
@@ -103,13 +103,13 @@ var/list/fuel_injectors = list()
|
|||||||
if(!injecting && cur_assembly)
|
if(!injecting && cur_assembly)
|
||||||
icon_state = "injector1"
|
icon_state = "injector1"
|
||||||
injecting = 1
|
injecting = 1
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
|
|
||||||
/obj/machinery/fusion_fuel_injector/proc/StopInjecting()
|
/obj/machinery/fusion_fuel_injector/proc/StopInjecting()
|
||||||
if(injecting)
|
if(injecting)
|
||||||
injecting = 0
|
injecting = 0
|
||||||
icon_state = "injector0"
|
icon_state = "injector0"
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
|
|
||||||
/obj/machinery/fusion_fuel_injector/proc/Inject()
|
/obj/machinery/fusion_fuel_injector/proc/Inject()
|
||||||
if(!injecting)
|
if(!injecting)
|
||||||
|
|||||||
@@ -156,7 +156,7 @@
|
|||||||
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
|
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
|
||||||
"You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \
|
"You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \
|
||||||
"You hear a ratchet.")
|
"You hear a ratchet.")
|
||||||
use_power = anchored
|
update_use_power(anchored ? USE_POWER_IDLE : USE_POWER_ACTIVE)
|
||||||
if(anchored) // Powernet connection stuff.
|
if(anchored) // Powernet connection stuff.
|
||||||
connect_to_network()
|
connect_to_network()
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -320,10 +320,10 @@ var/global/list/light_type_cache = list()
|
|||||||
on = 0
|
on = 0
|
||||||
set_light(0)
|
set_light(0)
|
||||||
else
|
else
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
set_light(brightness_range, brightness_power, brightness_color)
|
set_light(brightness_range, brightness_power, brightness_color)
|
||||||
else
|
else
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
set_light(0)
|
set_light(0)
|
||||||
|
|
||||||
active_power_usage = ((light_range * light_power) * LIGHTING_POWER_FACTOR)
|
active_power_usage = ((light_range * light_power) * LIGHTING_POWER_FACTOR)
|
||||||
|
|||||||
@@ -383,10 +383,10 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
|
|||||||
if(src.construction_state < 3)//Was taken apart, update state
|
if(src.construction_state < 3)//Was taken apart, update state
|
||||||
update_state()
|
update_state()
|
||||||
if(use_power)
|
if(use_power)
|
||||||
use_power = 0
|
update_use_power(USE_POWER_OFF)
|
||||||
src.construction_state = temp_state
|
src.construction_state = temp_state
|
||||||
if(src.construction_state >= 3)
|
if(src.construction_state >= 3)
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
update_icon()
|
update_icon()
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
/obj/machinery/particle_accelerator/control_box/update_state()
|
/obj/machinery/particle_accelerator/control_box/update_state()
|
||||||
if(construction_state < 3)
|
if(construction_state < 3)
|
||||||
update_use_power(0)
|
update_use_power(USE_POWER_OFF)
|
||||||
assembled = 0
|
assembled = 0
|
||||||
active = 0
|
active = 0
|
||||||
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
connected_parts = list()
|
connected_parts = list()
|
||||||
return
|
return
|
||||||
if(!part_scan())
|
if(!part_scan())
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
active = 0
|
active = 0
|
||||||
connected_parts = list()
|
connected_parts = list()
|
||||||
|
|
||||||
@@ -138,9 +138,9 @@
|
|||||||
..()
|
..()
|
||||||
if(stat & NOPOWER)
|
if(stat & NOPOWER)
|
||||||
active = 0
|
active = 0
|
||||||
update_use_power(0)
|
update_use_power(USE_POWER_OFF)
|
||||||
else if(!stat && construction_state == 3)
|
else if(!stat && construction_state == 3)
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/particle_accelerator/control_box/process()
|
/obj/machinery/particle_accelerator/control_box/process()
|
||||||
@@ -212,13 +212,13 @@
|
|||||||
message_admins("PA Control Computer turned [active ?"ON":"OFF"] by [key_name(usr, usr.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
message_admins("PA Control Computer turned [active ?"ON":"OFF"] by [key_name(usr, usr.client)](<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
||||||
log_game("PACCEL([x],[y],[z]) [key_name(usr)] turned [active?"ON":"OFF"].")
|
log_game("PACCEL([x],[y],[z]) [key_name(usr)] turned [active?"ON":"OFF"].")
|
||||||
if(active)
|
if(active)
|
||||||
update_use_power(2)
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
||||||
part.strength = src.strength
|
part.strength = src.strength
|
||||||
part.powered = 1
|
part.powered = 1
|
||||||
part.update_icon()
|
part.update_icon()
|
||||||
else
|
else
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
for(var/obj/structure/particle_accelerator/part in connected_parts)
|
||||||
part.strength = null
|
part.strength = null
|
||||||
part.powered = 0
|
part.powered = 0
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ GLOBAL_LIST_BOILERPLATE(all_engine_setup_markers, /obj/effect/engine_setup)
|
|||||||
log_and_message_admins("## WARNING: Unable to locate pump at [x] [y] [z]!")
|
log_and_message_admins("## WARNING: Unable to locate pump at [x] [y] [z]!")
|
||||||
return SETUP_WARNING
|
return SETUP_WARNING
|
||||||
P.target_pressure = P.max_pressure_setting
|
P.target_pressure = P.max_pressure_setting
|
||||||
P.use_power = 1
|
P.update_use_power(USE_POWER_IDLE)
|
||||||
P.update_icon()
|
P.update_icon()
|
||||||
return SETUP_OK
|
return SETUP_OK
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ GLOBAL_LIST_BOILERPLATE(all_engine_setup_markers, /obj/effect/engine_setup)
|
|||||||
return SETUP_WARNING
|
return SETUP_WARNING
|
||||||
F.rebuild_filtering_list()
|
F.rebuild_filtering_list()
|
||||||
|
|
||||||
F.use_power = 1
|
F.update_use_power(USE_POWER_IDLE)
|
||||||
F.update_icon()
|
F.update_icon()
|
||||||
return SETUP_OK
|
return SETUP_OK
|
||||||
|
|
||||||
|
|||||||
@@ -359,7 +359,7 @@
|
|||||||
// charge the gas reservoir and perform flush if ready
|
// charge the gas reservoir and perform flush if ready
|
||||||
/obj/machinery/disposal/process()
|
/obj/machinery/disposal/process()
|
||||||
if(!air_contents || (stat & BROKEN)) // nothing can happen if broken
|
if(!air_contents || (stat & BROKEN)) // nothing can happen if broken
|
||||||
update_use_power(0)
|
update_use_power(USE_POWER_OFF)
|
||||||
return
|
return
|
||||||
|
|
||||||
flush_count++
|
flush_count++
|
||||||
@@ -377,7 +377,7 @@
|
|||||||
flush()
|
flush()
|
||||||
|
|
||||||
if(mode != 1) //if off or ready, no need to charge
|
if(mode != 1) //if off or ready, no need to charge
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
else if(air_contents.return_pressure() >= SEND_PRESSURE)
|
else if(air_contents.return_pressure() >= SEND_PRESSURE)
|
||||||
mode = 2 //if full enough, switch to ready mode
|
mode = 2 //if full enough, switch to ready mode
|
||||||
update()
|
update()
|
||||||
@@ -386,7 +386,7 @@
|
|||||||
|
|
||||||
/obj/machinery/disposal/proc/pressurize()
|
/obj/machinery/disposal/proc/pressurize()
|
||||||
if(stat & NOPOWER) // won't charge if no power
|
if(stat & NOPOWER) // won't charge if no power
|
||||||
update_use_power(0)
|
update_use_power(USE_POWER_OFF)
|
||||||
return
|
return
|
||||||
|
|
||||||
var/atom/L = loc // recharging from loc turf
|
var/atom/L = loc // recharging from loc turf
|
||||||
|
|||||||
@@ -156,7 +156,7 @@
|
|||||||
idle_power_usage = 0
|
idle_power_usage = 0
|
||||||
for(var/obj/machinery/shield/shield_tile in deployed_shields)
|
for(var/obj/machinery/shield/shield_tile in deployed_shields)
|
||||||
idle_power_usage += shield_tile.shield_idle_power
|
idle_power_usage += shield_tile.shield_idle_power
|
||||||
update_use_power(1)
|
update_use_power(USE_POWER_IDLE)
|
||||||
|
|
||||||
/obj/machinery/shieldgen/proc/shields_down()
|
/obj/machinery/shieldgen/proc/shields_down()
|
||||||
if(!active) return 0 //If it's already off, how did this get called?
|
if(!active) return 0 //If it's already off, how did this get called?
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
|
|
||||||
collapse_shields()
|
collapse_shields()
|
||||||
|
|
||||||
update_use_power(0)
|
update_use_power(USE_POWER_OFF)
|
||||||
|
|
||||||
/obj/machinery/shieldgen/proc/create_shields()
|
/obj/machinery/shieldgen/proc/create_shields()
|
||||||
for(var/turf/target_tile in range(2, src))
|
for(var/turf/target_tile in range(2, src))
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
update_icon()
|
update_icon()
|
||||||
return
|
return
|
||||||
enabled = !enabled
|
enabled = !enabled
|
||||||
use_power = enabled + 1
|
update_use_power(enabled ? USE_POWER_ACTIVE : USE_POWER_IDLE)
|
||||||
update_icon()
|
update_icon()
|
||||||
to_chat(usr, "You turn \the [src] [enabled ? "on" : "off"].")
|
to_chat(usr, "You turn \the [src] [enabled ? "on" : "off"].")
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
//if we've finished growing...
|
//if we've finished growing...
|
||||||
if(time_spent_spawning >= time_per_spawn)
|
if(time_spent_spawning >= time_per_spawn)
|
||||||
time_spent_spawning = 0
|
time_spent_spawning = 0
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
src.visible_message("<span class='notice'>\icon[src] [src] pings!</span>")
|
src.visible_message("<span class='notice'>\icon[src] [src] pings!</span>")
|
||||||
icon_state = "cellold1"
|
icon_state = "cellold1"
|
||||||
desc = "It's full of a bubbling viscous liquid, and is lit by a mysterious glow."
|
desc = "It's full of a bubbling viscous liquid, and is lit by a mysterious glow."
|
||||||
@@ -63,11 +63,11 @@
|
|||||||
|
|
||||||
//if we're getting close to finished, kick into overdrive power usage
|
//if we're getting close to finished, kick into overdrive power usage
|
||||||
if(time_spent_spawning / time_per_spawn > 0.75)
|
if(time_spent_spawning / time_per_spawn > 0.75)
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
icon_state = "cellold2"
|
icon_state = "cellold2"
|
||||||
desc = "It's full of a bubbling viscous liquid, and is lit by a mysterious glow. A dark shape appears to be forming inside..."
|
desc = "It's full of a bubbling viscous liquid, and is lit by a mysterious glow. A dark shape appears to be forming inside..."
|
||||||
else
|
else
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
icon_state = "cellold1"
|
icon_state = "cellold1"
|
||||||
desc = "It's full of a bubbling viscous liquid, and is lit by a mysterious glow."
|
desc = "It's full of a bubbling viscous liquid, and is lit by a mysterious glow."
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
max_spawn_time = rand(30,100)
|
max_spawn_time = rand(30,100)
|
||||||
|
|
||||||
if(!spawning_types.len || !stored_materials.len)
|
if(!spawning_types.len || !stored_materials.len)
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
icon_state = "borgcharger0(old)"
|
icon_state = "borgcharger0(old)"
|
||||||
|
|
||||||
else if(prob(5))
|
else if(prob(5))
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
|
|
||||||
spawning_types.Add(construction[construction[index]])
|
spawning_types.Add(construction[construction[index]])
|
||||||
spawn_progress_time = 0
|
spawn_progress_time = 0
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
icon_state = "borgcharger1(old)"
|
icon_state = "borgcharger1(old)"
|
||||||
else
|
else
|
||||||
src.visible_message(fail_message)
|
src.visible_message(fail_message)
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
|
|
||||||
//check if we've finished
|
//check if we've finished
|
||||||
if(inserted_battery.stored_charge >= inserted_battery.capacity)
|
if(inserted_battery.stored_charge >= inserted_battery.capacity)
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
harvesting = 0
|
harvesting = 0
|
||||||
cur_artifact.anchored = 0
|
cur_artifact.anchored = 0
|
||||||
cur_artifact.being_used = 0
|
cur_artifact.being_used = 0
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
//if there's no charge left, finish
|
//if there's no charge left, finish
|
||||||
if(inserted_battery.stored_charge <= 0)
|
if(inserted_battery.stored_charge <= 0)
|
||||||
use_power = 1
|
update_use_power(USE_POWER_IDLE)
|
||||||
inserted_battery.stored_charge = 0
|
inserted_battery.stored_charge = 0
|
||||||
harvesting = 0
|
harvesting = 0
|
||||||
if(inserted_battery.battery_effect && inserted_battery.battery_effect.activated)
|
if(inserted_battery.battery_effect && inserted_battery.battery_effect.activated)
|
||||||
@@ -191,7 +191,7 @@
|
|||||||
|
|
||||||
if(source_effect)
|
if(source_effect)
|
||||||
harvesting = 1
|
harvesting = 1
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
cur_artifact.anchored = 1
|
cur_artifact.anchored = 1
|
||||||
cur_artifact.being_used = 1
|
cur_artifact.being_used = 1
|
||||||
icon_state = "incubator_on"
|
icon_state = "incubator_on"
|
||||||
@@ -235,7 +235,7 @@
|
|||||||
inserted_battery.battery_effect.ToggleActivate(1)
|
inserted_battery.battery_effect.ToggleActivate(1)
|
||||||
last_process = world.time
|
last_process = world.time
|
||||||
harvesting = -1
|
harvesting = -1
|
||||||
use_power = 2
|
update_use_power(USE_POWER_ACTIVE)
|
||||||
icon_state = "incubator_on"
|
icon_state = "incubator_on"
|
||||||
var/message = "<b>[src]</b> states, \"Warning, battery charge dump commencing.\""
|
var/message = "<b>[src]</b> states, \"Warning, battery charge dump commencing.\""
|
||||||
src.visible_message(message)
|
src.visible_message(message)
|
||||||
|
|||||||
Reference in New Issue
Block a user