mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 05:57:24 +01:00
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:
@@ -346,9 +346,8 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
|
||||
*/
|
||||
/obj/machinery/ai_powersupply
|
||||
name="\improper AI power supply"
|
||||
active_power_usage=1000
|
||||
use_power = ACTIVE_POWER_USE
|
||||
power_channel = EQUIP
|
||||
active_power_consumption = 1000
|
||||
power_state = ACTIVE_POWER_USE
|
||||
var/mob/living/silicon/ai/powered_ai = null
|
||||
invisibility = 100
|
||||
|
||||
@@ -369,9 +368,9 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
|
||||
return
|
||||
if(!powered_ai.anchored)
|
||||
loc = powered_ai.loc
|
||||
use_power = NO_POWER_USE
|
||||
change_power_mode(NO_POWER_USE)
|
||||
if(powered_ai.anchored)
|
||||
use_power = ACTIVE_POWER_USE
|
||||
change_power_mode(ACTIVE_POWER_USE)
|
||||
|
||||
/mob/living/silicon/ai/proc/pick_icon()
|
||||
set category = "AI Commands"
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
/mob/living/silicon/ai/proc/lacks_power()
|
||||
var/turf/T = get_turf(src)
|
||||
var/area/A = get_area(src)
|
||||
return ((!A.power_equip) && A.requires_power == 1 || isspaceturf(T)) && !isitem(src.loc)
|
||||
return (!A.powernet.equipment_powered && A.requires_power || isspaceturf(T)) && !isitem(loc)
|
||||
|
||||
/mob/living/silicon/ai/rejuvenate()
|
||||
..()
|
||||
|
||||
@@ -9,20 +9,22 @@
|
||||
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 20
|
||||
active_power_usage = 5000
|
||||
idle_power_consumption = 20
|
||||
active_power_consumption = 5000
|
||||
|
||||
var/produce_drones = TRUE
|
||||
var/drone_progress = 100
|
||||
var/time_last_drone = 0
|
||||
|
||||
/obj/machinery/drone_fabricator/power_change()
|
||||
if(powered())
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
/obj/machinery/drone_fabricator/update_icon_state()
|
||||
. = ..()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "drone_fab_nopower"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/drone_fabricator/power_change()
|
||||
if(!..())
|
||||
return
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/machinery/drone_fabricator/process()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user