diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm
index 3c2db8e064..9a097030d5 100644
--- a/code/controllers/master_controller.dm
+++ b/code/controllers/master_controller.dm
@@ -300,7 +300,7 @@ datum/controller/game_controller/proc/process_machines_power()
if(M)
//check if the area has power for M's channel
//this will keep stat updated in case the machine is moved from one area to another.
- M.update_powered_status(A) //we've already made sure A is a master area, above.
+ M.power_change(A) //we've already made sure A is a master area, above.
if(!(M.stat & NOPOWER) && M.use_power)
M.auto_use_power()
diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm
index af1fe64a9f..d4450cbb78 100644
--- a/code/game/dna/dna_modifier.dm
+++ b/code/game/dna/dna_modifier.dm
@@ -276,15 +276,15 @@
del(src)
/obj/machinery/computer/scan_consolenew/power_change()
+ ..()
if(stat & BROKEN)
icon_state = "broken"
- else if(powered())
- icon_state = initial(icon_state)
- stat &= ~NOPOWER
else
- spawn(rand(0, 15))
- src.icon_state = "c_unpowered"
- stat |= NOPOWER
+ if (stat & NOPOWER)
+ spawn(rand(0, 15))
+ src.icon_state = "c_unpowered"
+ else
+ icon_state = initial(icon_state)
/obj/machinery/computer/scan_consolenew/New()
..()
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 119fd2bca0..00d5997814 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -142,9 +142,6 @@
return
-/obj/machinery/sleep_console/power_change()
- return
- // no change - sleeper works without power (you just can't inject more)
diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm
index 9196b61a04..9c9cd2b5ab 100644
--- a/code/game/machinery/adv_med.dm
+++ b/code/game/machinery/adv_med.dm
@@ -159,15 +159,15 @@
del(src)
/obj/machinery/body_scanconsole/power_change()
+ ..()
if(stat & BROKEN)
icon_state = "body_scannerconsole-p"
- else if(powered())
- icon_state = initial(icon_state)
- stat &= ~NOPOWER
else
- spawn(rand(0, 15))
- src.icon_state = "body_scannerconsole-p"
- stat |= NOPOWER
+ if (stat & NOPOWER)
+ spawn(rand(0, 15))
+ src.icon_state = "body_scannerconsole-p"
+ else
+ icon_state = initial(icon_state)
/obj/machinery/body_scanconsole
var/obj/machinery/bodyscanner/connected
diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm
index 4df9f2a5a8..ca51a51982 100644
--- a/code/game/machinery/ai_slipper.dm
+++ b/code/game/machinery/ai_slipper.dm
@@ -14,14 +14,14 @@
req_access = list(access_ai_upload)
/obj/machinery/ai_slipper/power_change()
+ ..()
if(stat & BROKEN)
return
else
- if( powered() )
- stat &= ~NOPOWER
- else
+ if (stat & NOPOWER)
icon_state = "motion0"
- stat |= NOPOWER
+ else
+ icon_state = initial(icon_state)
/obj/machinery/ai_slipper/proc/setState(var/enabled, var/uses)
src.disabled = disabled
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 1cc091ace9..1914e5206c 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -1156,10 +1156,7 @@ table tr:first-child th:first-child { border: none;}
return ..()
/obj/machinery/alarm/power_change()
- if(powered(power_channel))
- stat &= ~NOPOWER
- else
- stat |= NOPOWER
+ ..()
spawn(rand(0,15))
update_icon()
@@ -1367,13 +1364,9 @@ FIRE ALARM
return
/obj/machinery/firealarm/power_change()
- if(powered(ENVIRON))
- stat &= ~NOPOWER
+ ..()
+ spawn(rand(0,15))
update_icon()
- else
- spawn(rand(0,15))
- stat |= NOPOWER
- update_icon()
/obj/machinery/firealarm/attack_hand(mob/user as mob)
if(user.stat || stat & (NOPOWER|BROKEN))
diff --git a/code/game/machinery/computer/power.dm b/code/game/machinery/computer/power.dm
index b3b017565c..40b3783b60 100644
--- a/code/game/machinery/computer/power.dm
+++ b/code/game/machinery/computer/power.dm
@@ -127,15 +127,14 @@
/obj/machinery/power/monitor/power_change()
-
+ ..()
if(stat & BROKEN)
icon_state = "broken"
else
- if( powered() )
- icon_state = initial(icon_state)
- stat &= ~NOPOWER
- else
+ if (stat & NOPOWER)
spawn(rand(0, 15))
src.icon_state = "c_unpowered"
- stat |= NOPOWER
+ else
+ icon_state = initial(icon_state)
+
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 05a5fc1324..b02cffcee5 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -14,6 +14,10 @@
var/net_id
var/list/areas_added
var/list/users_to_open
+
+ power_channel = ENVIRON
+ use_power = 1
+ idle_power_usage = 5
/obj/machinery/door/firedoor/New()
. = ..()
@@ -66,15 +70,6 @@
attack_hand(M)
return 0
-
-/obj/machinery/door/firedoor/power_change()
- if(powered(ENVIRON))
- stat &= ~NOPOWER
- else
- stat |= NOPOWER
- return
-
-
/obj/machinery/door/firedoor/attack_hand(mob/user as mob)
add_fingerprint(user)
if(operating)
@@ -101,6 +96,9 @@
if(user.stat || user.stunned || user.weakened || user.paralysis || (!user.canmove && !isAI(user)) || (get_dist(src, user) > 1 && !isAI(user)))
user << "Sorry, you must remain able bodied and close to \the [src] in order to use it."
return
+ if(density && (stat & (BROKEN|NOPOWER))) //can still close without power
+ user << "\The [src] is not functioning, you'll have to force it open manually."
+ return
var/needs_to_close = 0
if(density)
@@ -163,10 +161,10 @@
else
user.visible_message("\red \The [user] forces \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \a [C]!",\
"You force \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \the [C]!",\
- "You hear metal strain and groan, and a door [density ? "open" : "close"].")
+ "You hear metal strain and groan, and a door [density ? "opening" : "closing"].")
if(density)
spawn(0)
- open()
+ open(1)
else
spawn(0)
close()
@@ -175,7 +173,7 @@
/obj/machinery/door/firedoor/proc/latetoggle()
- if(operating || stat & NOPOWER || !nextstate)
+ if(operating || !nextstate)
return
switch(nextstate)
if(OPEN)
@@ -190,7 +188,12 @@
latetoggle()
return ..()
-/obj/machinery/door/firedoor/open()
+/obj/machinery/door/firedoor/open(var/forced = 0)
+ if (!forced)
+ if (stat & BROKEN|NOPOWER)
+ return //needs power to open unless it was forced
+ else
+ use_power(360)
latetoggle()
return ..()
diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm
index 8648b33d82..c6744ef96a 100644
--- a/code/game/machinery/doppler_array.dm
+++ b/code/game/machinery/doppler_array.dm
@@ -44,12 +44,11 @@ var/list/doppler_arrays = list()
/obj/machinery/doppler_array/power_change()
+ ..()
if(stat & BROKEN)
icon_state = "[initial(icon_state)]-broken"
else
- if( powered() )
+ if( !(stat & NOPOWER) )
icon_state = initial(icon_state)
- stat &= ~NOPOWER
else
- icon_state = "[initial(icon_state)]-off"
- stat |= NOPOWER
\ No newline at end of file
+ icon_state = "[initial(icon_state)]-off"
\ No newline at end of file
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index 88c72ec198..cf05308e40 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -28,12 +28,11 @@
src.sd_SetLuminosity(2)
*/
/obj/machinery/flasher/power_change()
- if ( powered() )
- stat &= ~NOPOWER
+ ..()
+ if ( !(stat & NOPOWER) )
icon_state = "[base_state]1"
// src.sd_SetLuminosity(2)
else
- stat |= ~NOPOWER
icon_state = "[base_state]1-p"
// src.sd_SetLuminosity(0)
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index 56d71e1e0f..26172431f4 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -153,12 +153,6 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
active_power_usage = 100
var/obj/effect/overlay/hologram//The projection itself. If there is one, the instrument is on, off otherwise.
-/obj/machinery/hologram/power_change()
- if (powered())
- stat &= ~NOPOWER
- else
- stat |= ~NOPOWER
-
//Destruction procs.
/obj/machinery/hologram/ex_act(severity)
switch(severity)
diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm
index 2f443fdac1..dcc67a5af2 100755
--- a/code/game/machinery/igniter.dm
+++ b/code/game/machinery/igniter.dm
@@ -38,6 +38,7 @@
icon_state = "igniter[on]"
/obj/machinery/igniter/power_change()
+ ..()
if(!( stat & NOPOWER) )
icon_state = "igniter[src.on]"
else
@@ -60,12 +61,12 @@
..()
/obj/machinery/sparker/power_change()
- if ( powered() && disable == 0 )
- stat &= ~NOPOWER
+ ..()
+ if ( !(stat & NOPOWER) && disable == 0 )
+
icon_state = "[base_state]"
// src.sd_SetLuminosity(2)
else
- stat |= ~NOPOWER
icon_state = "[base_state]-p"
// src.sd_SetLuminosity(0)
diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm
index b3d3552565..d7db1df37e 100644
--- a/code/game/machinery/kitchen/smartfridge.dm
+++ b/code/game/machinery/kitchen/smartfridge.dm
@@ -118,17 +118,16 @@
src.throw_item()
/obj/machinery/smartfridge/power_change()
- if( powered() )
+ ..()
+ if( !(stat & NOPOWER) )
src.ispowered = 1
- stat &= ~NOPOWER
if(!isbroken)
icon_state = icon_on
else
spawn(rand(0, 15))
- src.ispowered = 0
- stat |= NOPOWER
- if(!isbroken)
- icon_state = icon_off
+ src.ispowered = 0
+ if(!isbroken)
+ icon_state = icon_off
/*******************
* Item Adding
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index fba4927947..114d24e57b 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -138,14 +138,13 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
/obj/machinery/newscaster/power_change()
if(isbroken) //Broken shit can't be powered.
return
- if( src.powered() )
+ ..()
+ if( !(stat & NOPOWER) )
src.ispowered = 1
- stat &= ~NOPOWER
src.update_icon()
else
spawn(rand(0, 15))
src.ispowered = 0
- stat |= NOPOWER
src.update_icon()
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 8107e23cc5..b7a9a781d8 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -264,10 +264,12 @@ Status: []
"},
if(!anchored)
icon_state = "turretCover"
return
+
+ ..()
if(stat & BROKEN)
icon_state = "[lasercolor]destroyed_target_prism"
else
- if( powered() )
+ if( !(stat & NOPOWER) )
if (on)
if (installation == /obj/item/weapon/gun/energy/laser || installation == /obj/item/weapon/gun/energy/pulse_rifle)
// laser guns and pulse rifles have an orange icon
@@ -277,11 +279,9 @@ Status: []
"},
icon_state = "[lasercolor]target_prism"
else
icon_state = "[lasercolor]grey_target_prism"
- stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = "[lasercolor]grey_target_prism"
- stat |= NOPOWER
diff --git a/code/game/machinery/records_scanner.dm b/code/game/machinery/records_scanner.dm
index 370e2f3843..af74c7c941 100644
--- a/code/game/machinery/records_scanner.dm
+++ b/code/game/machinery/records_scanner.dm
@@ -28,13 +28,12 @@ obj/machinery/scanner/New()
use_power(50)
/obj/machinery/scanner/power_change()
- if(!powered())
+ ..()
+ if(stat & NOPOWER)
spawn(rand(0, 15))
icon_state = "scanner_off"
- stat |= NOPOWER
else
icon_state = "scanner_idle"
- stat &= ~NOPOWER
obj/machinery/scanner/attack_hand(mob/living/carbon/human/user)
if(stat & NOPOWER)
diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm
index e7994763dd..bf02e31fdd 100644
--- a/code/game/machinery/robot_fabricator.dm
+++ b/code/game/machinery/robot_fabricator.dm
@@ -34,12 +34,6 @@
else
user << "The robot part maker is full. Please remove metal from the robot part maker in order to insert more."
-/obj/machinery/robotic_fabricator/power_change()
- if (powered())
- stat &= ~NOPOWER
- else
- stat |= NOPOWER
-
/obj/machinery/robotic_fabricator/attack_paw(user as mob)
return src.attack_hand(user)
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 2db29d4ab0..c21616811e 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -59,14 +59,13 @@
/obj/machinery/suit_storage_unit/power_change()
- if( powered() )
+ ..()
+ if( !(stat & NOPOWER) )
src.ispowered = 1
- stat &= ~NOPOWER
src.update_icon()
else
spawn(rand(0, 15))
src.ispowered = 0
- stat |= NOPOWER
src.islocked = 0
src.isopen = 1
src.dump_everything()
diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm
index 51ccee7fc5..98af795ca8 100644
--- a/code/game/machinery/turrets.dm
+++ b/code/game/machinery/turrets.dm
@@ -93,10 +93,11 @@
return (popping!=0)
/obj/machinery/turret/power_change()
+ ..()
if(stat & BROKEN)
icon_state = "grey_target_prism"
else
- if( powered() )
+ if( !(stat & NOPOWER) )
if (src.enabled)
if (src.lasers)
icon_state = "orange_target_prism"
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 8bcdd60309..1c18c33263 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -23,6 +23,7 @@
use_power = 1
idle_power_usage = 10
+ var/vend_power_usage = 150 //actuators and stuff
var/active = 1 //No sales pitches if off!
var/delay_product_spawn // If set, uses sleep() in product spawn proc (mostly for seeds to retrieve correct names).
@@ -511,7 +512,7 @@
src.speak(src.vend_reply)
src.last_reply = world.time
- use_power(150) //actuators and stuff
+ use_power(vend_power_usage) //actuators and stuff
if (src.icon_vend) //Show the vending animation if needed
flick(src.icon_vend,src)
spawn(src.vend_delay)
@@ -561,16 +562,15 @@
return
/obj/machinery/vending/power_change()
+ ..()
if(stat & BROKEN)
icon_state = "[initial(icon_state)]-broken"
else
- if( powered() )
+ if( !(stat & NOPOWER) )
icon_state = initial(icon_state)
- stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = "[initial(icon_state)]-off"
- stat |= NOPOWER
//Oh no we're malfunctioning! Dump out some product and break.
/obj/machinery/vending/proc/malfunction()
@@ -708,6 +708,7 @@
/obj/item/weapon/reagent_containers/food/drinks/bottle/absinthe = 2,/obj/item/weapon/reagent_containers/food/drinks/bottle/grenadine = 5)
contraband = list(/obj/item/weapon/reagent_containers/food/drinks/tea = 10)
vend_delay = 15
+ idle_power_usage = 211 //refrigerator - believe it or not, this is actually the average power consumption of a refrigerated vending machine according to NRCan.
product_slogans = "I hope nobody asks me for a bloody cup o' tea...;Alcohol is humanity's friend. Would you abandon a friend?;Quite delighted to serve you!;Is nobody thirsty on this station?"
product_ads = "Drink up!;Booze is good for you!;Alcohol is humanity's best friend.;Quite delighted to serve you!;Care for a nice, cold beer?;Nothing cures you like booze!;Have a sip!;Have a drink!;Have a beer!;Beer is good for you!;Only the finest alcohol!;Best quality booze since 2053!;Award-winning wine!;Maximum alcohol!;Man loves beer.;A toast for progress!"
req_access_txt = "25"
@@ -725,6 +726,8 @@
icon_state = "coffee"
icon_vend = "coffee-vend"
vend_delay = 34
+ idle_power_usage = 211 //refrigerator - believe it or not, this is actually the average power consumption of a refrigerated vending machine according to NRCan.
+ vend_power_usage = 85000 //85 kJ to heat a 250 mL cup of coffee
products = list(/obj/item/weapon/reagent_containers/food/drinks/coffee = 25,/obj/item/weapon/reagent_containers/food/drinks/tea = 25,/obj/item/weapon/reagent_containers/food/drinks/h_chocolate = 25)
contraband = list(/obj/item/weapon/reagent_containers/food/drinks/ice = 10)
prices = list(/obj/item/weapon/reagent_containers/food/drinks/coffee = 25, /obj/item/weapon/reagent_containers/food/drinks/tea = 25, /obj/item/weapon/reagent_containers/food/drinks/h_chocolate = 25)
@@ -763,6 +766,7 @@
/obj/item/weapon/reagent_containers/food/drinks/cans/dr_gibb = 1,/obj/item/weapon/reagent_containers/food/drinks/cans/starkist = 1,
/obj/item/weapon/reagent_containers/food/drinks/cans/waterbottle = 2,/obj/item/weapon/reagent_containers/food/drinks/cans/space_up = 1,
/obj/item/weapon/reagent_containers/food/drinks/cans/iced_tea = 1,/obj/item/weapon/reagent_containers/food/drinks/cans/grape_juice = 1)
+ idle_power_usage = 211 //refrigerator - believe it or not, this is actually the average power consumption of a refrigerated vending machine according to NRCan.
//This one's from bay12
/obj/machinery/vending/cart
@@ -802,6 +806,7 @@
/obj/item/device/healthanalyzer = 5,/obj/item/weapon/reagent_containers/glass/beaker = 4, /obj/item/weapon/reagent_containers/dropper = 2,
/obj/item/stack/medical/advanced/bruise_pack = 3, /obj/item/stack/medical/advanced/ointment = 3, /obj/item/stack/medical/splint = 2)
contraband = list(/obj/item/weapon/reagent_containers/pill/tox = 3,/obj/item/weapon/reagent_containers/pill/stox = 4,/obj/item/weapon/reagent_containers/pill/antitox = 6)
+ idle_power_usage = 211 //refrigerator - believe it or not, this is actually the average power consumption of a refrigerated vending machine according to NRCan.
//This one's from bay12
@@ -855,6 +860,7 @@
products = list(/obj/item/weapon/reagent_containers/glass/fertilizer/ez = 35,/obj/item/weapon/reagent_containers/glass/fertilizer/l4z = 25,/obj/item/weapon/reagent_containers/glass/fertilizer/rh = 15,/obj/item/weapon/plantspray/pests = 20,
/obj/item/weapon/reagent_containers/syringe = 5,/obj/item/weapon/storage/bag/plants = 5)
premium = list(/obj/item/weapon/reagent_containers/glass/bottle/ammonia = 10,/obj/item/weapon/reagent_containers/glass/bottle/diethylamine = 5)
+ idle_power_usage = 211 //refrigerator - believe it or not, this is actually the average power consumption of a refrigerated vending machine according to NRCan.
/obj/machinery/vending/hydroseeds
name = "MegaSeed Servitor"
@@ -901,6 +907,7 @@
product_ads = "For Tsar and Country.;Have you fulfilled your nutrition quota today?;Very nice!;We are simple people, for this is all we eat.;If there is a person, there is a problem. If there is no person, then there is no problem."
products = list(/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/soda = 30)
contraband = list(/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/cola = 20)
+ idle_power_usage = 211 //refrigerator - believe it or not, this is actually the average power consumption of a refrigerated vending machine according to NRCan.
/obj/machinery/vending/tool
name = "YouTool"
diff --git a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm
index 3ba05f6332..de504bcf02 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm
@@ -19,11 +19,9 @@
..()
/obj/machinery/drone_fabricator/power_change()
- if (powered())
- stat &= ~NOPOWER
- else
+ ..()
+ if (stat & NOPOWER)
icon_state = "drone_fab_nopower"
- stat |= NOPOWER
/obj/machinery/drone_fabricator/process()
diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm
index b1a9277e83..2fb3171104 100644
--- a/code/modules/power/power.dm
+++ b/code/modules/power/power.dm
@@ -68,25 +68,23 @@
log_power_update_request(A.master, src)
A.master.powerupdate = 2 // Decremented by 2 each GC tick, since it's not auto power change we're going to update power twice.
-/obj/machinery/proc/power_change() // called whenever the power settings of the containing area change
+//The master_area optional argument can be used to save on a lot of processing if the master area is already known. This is mainly intended for when this proc is called by the master controller.
+/obj/machinery/proc/power_change(var/area/master_area = null) // called whenever the power settings of the containing area change
// by default, check equipment channel & set flag
// can override if needed
- if(powered(power_channel))
+ var/has_power
+ if (master_area)
+ has_power = master_area.powered(power_channel)
+ else
+ has_power = powered(power_channel)
+
+ if(has_power)
stat &= ~NOPOWER
else
stat |= NOPOWER
return
-//This is used by the master controller to update the NOPOWER flag
-//This will allow machines to update NOPOWER if they are moved from one area to another.
-//Does the same thing as power_change() but is optimized for the master controller.
-/obj/machinery/proc/update_powered_status(var/area/master_area)
- if(master_area.powered(power_channel))
- stat &= ~NOPOWER
- else
- stat |= NOPOWER
-
// the powernet datum
// each contiguous network of cables & nodes
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index 6dff673e1e..1fd0c09008 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -488,12 +488,11 @@ var/list/solars_list = list()
/obj/machinery/power/solar_control/power_change()
- if(powered())
- stat &= ~NOPOWER
+ ..()
+ if(!(stat & NOPOWER))
update_icon()
else
spawn(rand(0, 15))
- stat |= NOPOWER
update_icon()
diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm
index a0d0ac4f6d..2b8f6ffacb 100644
--- a/code/modules/reagents/Chemistry-Machinery.dm
+++ b/code/modules/reagents/Chemistry-Machinery.dm
@@ -34,11 +34,7 @@
nanomanager.update_uis(src) // update all UIs attached to src
/obj/machinery/chem_dispenser/power_change()
- if(powered())
- stat &= ~NOPOWER
- else
- spawn(rand(0, 15))
- stat |= NOPOWER
+ ..()
nanomanager.update_uis(src) // update all UIs attached to src
/obj/machinery/chem_dispenser/process()
@@ -316,13 +312,6 @@
del(src)
return
-/obj/machinery/chem_master/power_change()
- if(powered())
- stat &= ~NOPOWER
- else
- spawn(rand(0, 15))
- stat |= NOPOWER
-
/obj/machinery/chem_master/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob)
if(istype(B, /obj/item/weapon/reagent_containers/glass))
@@ -614,18 +603,16 @@
/obj/machinery/computer/pandemic/power_change()
-
+ ..()
if(stat & BROKEN)
icon_state = (src.beaker?"mixer1_b":"mixer0_b")
- else if(powered())
+ else if(!(stat & NOPOWER))
icon_state = (src.beaker?"mixer1":"mixer0")
- stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = (src.beaker?"mixer1_nopower":"mixer0_nopower")
- stat |= NOPOWER
/obj/machinery/computer/pandemic/Topic(href, href_list)
diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm
index 3e9f1e437e..33f40e4193 100644
--- a/code/modules/security levels/keycard authentication.dm
+++ b/code/modules/security levels/keycard authentication.dm
@@ -45,11 +45,9 @@
broadcast_request() //This is the device making the initial event request. It needs to broadcast to other devices
/obj/machinery/keycard_auth/power_change()
- if(powered(ENVIRON))
- stat &= ~NOPOWER
+ ..()
+ if(stat &NOPOWER)
icon_state = "auth_off"
- else
- stat |= NOPOWER
/obj/machinery/keycard_auth/attack_hand(mob/user as mob)
if(user.stat || stat & (NOPOWER|BROKEN))