APC & Machinery Refactor + Local Powernets (#19991)

* local powernet and machine power refactor

* some fixes

* more tweaks + powerchange() refactor

* fixes var edited apcs on meatpackers.dmm

* fixes issue with power channels

* Reviews

* delta fix

* Update code/game/machinery/portable_turret.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* removed area power change proc

* damn morgues

* requested changes

* request changes

* deconfliction

* mapping fixes

* some fixes from TM

---------

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
This commit is contained in:
Ryan
2023-01-30 22:28:10 +00:00
committed by GitHub
co-authored by Henri215
parent caee0ec975
commit 7c3cd86f14
190 changed files with 2613 additions and 2556 deletions
@@ -75,10 +75,9 @@
var/area/A = get_area(src)
if(!isarea(A))
return
if(!A.powered(EQUIP))
if(!A.powernet.has_power(PW_CHANNEL_EQUIPMENT))
return
A.use_power(5000, EQUIP)
var/light = A.power_light
A.powernet.use_active_power(PW_CHANNEL_EQUIPMENT, 5000)
A.update_icon(UPDATE_ICON_STATE)
flick("echair_shock", src)
@@ -91,5 +90,3 @@
to_chat(buckled_mob, "<span class='danger'>You feel a deep shock course through your body!</span>")
spawn(1)
buckled_mob.electrocute_act(110, src, 1)
A.power_light = light
A.update_icon(UPDATE_ICON_STATE)
+5 -5
View File
@@ -542,10 +542,10 @@ GLOBAL_LIST_EMPTY(crematoriums)
icon = 'icons/obj/power.dmi'
icon_state = "crema_switch"
resistance_flags = INDESTRUCTIBLE // could use a more elegant solution like being able to be rebuilt, broken and repaired, or by directly attaching the switch to the crematorium
power_channel = EQUIP
use_power = IDLE_POWER_USE
idle_power_usage = 100
active_power_usage = 5000
power_channel = PW_CHANNEL_EQUIPMENT
power_state = IDLE_POWER_USE
idle_power_consumption = 100
active_power_consumption = 5000
anchored = TRUE
req_access = list(ACCESS_CREMATORIUM)
/// ID of the crematorium to hook into
@@ -556,7 +556,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
return attack_hand(user)
/obj/machinery/crema_switch/attack_hand(mob/user)
if(!powered(power_channel)) // Do we have power?
if(!has_power(power_channel)) // Do we have power?
return
if(!(allowed(usr) || user.can_advanced_admin_interact()))
+1 -1
View File
@@ -251,7 +251,7 @@
icon_state = "shower"
density = FALSE
anchored = TRUE
use_power = NO_POWER_USE
power_state = NO_POWER_USE
///Is the shower on or off?
var/on = FALSE
///What temperature the shower reagents are set to.
+3 -2
View File
@@ -599,8 +599,9 @@
D.toggle_polarization()
/obj/machinery/button/windowtint/power_change()
..()
if(active && !powered(power_channel))
if(!..())
return
if(active && (stat & NOPOWER))
toggle_tint()
/obj/machinery/button/windowtint/update_icon_state()