Files
VOREStation/code/controllers/subsystems/circuits.dm
Selis f4bf017921 Unit Test rework & Master/Ticker update (#17912)
* Unit Test rework & Master/Ticker update

* Fixes and working unit testing

* Fixes

* Test fixes and FA update

* Fixed runtimes

* Radio subsystem

* move that glob wherever later

* ident

* CIBUILDING compile option

* Fixed runtimes

* Some changes to the workflow

* CI Split

* More split

* Pathing

* Linters and Annotators

* ci dir fix

* Missing undef fixed

* Enable grep checks

* More test conversions

* More split

* Correct file

* Removes unneeded inputs

* oop

* More dependency changes

* More conversions

* Conversion fixes

* Fixes

* Some assert fixes

* Corrects start gate

* Converted some README.dms to README.mds

* Removes duplicate proc

* Removes unused defines

* Example configs

* fix dll access viol by double calling

* Post-rebase fixes

* Cleans up names global list

* Undef restart counter

* More code/game/ cleanup

* Statpanel update

* Skybox

* add

* Fix ticker

* Roundend fix

* Persistence dependency update

* Reordering

* Reordering

* Reordering

* Initstage fix

* .

* .

* Reorder

* Reorder

* Circle

* Mobs

* Air

* Test fix

* CI Script Fix

* Configs

* More ticker stuff

* This is now in 'reboot world'

* Restart world announcements

* no glob in PreInit

* to define

* Update

* Removed old include

* Make this file normal again

* moved

* test

* shared unit testing objects

* Updates batched_spritesheets and universal_icon

* .

* job data debug

* rm that

* init order

* show us

* .

* i wonder

* .

* .

* urg

* do we not have a job ID?

* .

* rm sleep for now

* updated rust-g linux binaries

* binaries update 2

* binaries update 3

* testing something

* change that

* test something

* .

* .

* .

* locavar

* test

* move that

* .

* debug

* don't run this test

* strack trace it

* cleaner

* .

* .

* cras again

* also comment this out

* return to official rust g

* Update robot_icons.dm

* monitor the generation

* .

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2025-08-10 01:37:23 +02:00

100 lines
4.1 KiB
Plaintext

//
// This is for custom circuits, mostly the initialization of global properties about them.
// Might make this also process them in the future if its better to do that than using the obj ticker.
//
SUBSYSTEM_DEF(circuit)
name = "Circuit"
flags = SS_NO_FIRE
dependencies = list(
/datum/controller/subsystem/atoms
)
var/list/all_components = list() // Associative list of [component_name]:[component_path] pairs
var/list/cached_components = list() // Associative list of [component_path]:[component] pairs
var/list/all_assemblies = list() // Associative list of [assembly_name]:[assembly_path] pairs
var/list/cached_assemblies = list() // Associative list of [assembly_path]:[assembly] pairs
var/list/all_circuits = list() // Associative list of [circuit_name]:[circuit_path] pairs
var/list/circuit_fabricator_recipe_list = list() // Associative list of [category_name]:[list_of_circuit_paths] pairs
// var/cost_multiplier = MINERAL_MATERIAL_AMOUNT / 10 // Each circuit cost unit is 200cm3
/datum/controller/subsystem/circuit/Recover()
flags |= SS_NO_INIT // Make extra sure we don't initialize twice.
/datum/controller/subsystem/circuit/Initialize()
circuits_init()
return SS_INIT_SUCCESS
/datum/controller/subsystem/circuit/proc/circuits_init()
//Cached lists for free performance
for(var/obj/item/integrated_circuit/IC as anything in typesof(/obj/item/integrated_circuit))
var/path = IC
all_components[initial(IC.name)] = path // Populating the component lists
cached_components[path] = new path
if(!(initial(IC.spawn_flags) & (IC_SPAWN_DEFAULT | IC_SPAWN_RESEARCH)))
continue
var/category = initial(IC.category_text)
if(!circuit_fabricator_recipe_list[category])
circuit_fabricator_recipe_list[category] = list()
var/list/category_list = circuit_fabricator_recipe_list[category]
category_list += IC // Populating the fabricator categories
for(var/obj/item/electronic_assembly/A as anything in typesof(/obj/item/electronic_assembly))
var/path = A
all_assemblies[initial(A.name)] = path
cached_assemblies[path] = new path
circuit_fabricator_recipe_list["Assemblies"] = list(
/obj/item/electronic_assembly/default,
/obj/item/electronic_assembly/calc,
/obj/item/electronic_assembly/clam,
/obj/item/electronic_assembly/simple,
/obj/item/electronic_assembly/hook,
/obj/item/electronic_assembly/pda,
/obj/item/electronic_assembly/tiny/default,
/obj/item/electronic_assembly/tiny/cylinder,
/obj/item/electronic_assembly/tiny/scanner,
/obj/item/electronic_assembly/tiny/hook,
/obj/item/electronic_assembly/tiny/box,
/obj/item/electronic_assembly/medium/default,
/obj/item/electronic_assembly/medium/box,
/obj/item/electronic_assembly/medium/clam,
/obj/item/electronic_assembly/medium/medical,
/obj/item/electronic_assembly/medium/gun,
/obj/item/electronic_assembly/medium/radio,
/obj/item/electronic_assembly/large/default,
/obj/item/electronic_assembly/large/scope,
/obj/item/electronic_assembly/large/terminal,
/obj/item/electronic_assembly/large/arm,
/obj/item/electronic_assembly/large/tall,
/obj/item/electronic_assembly/large/industrial,
/obj/item/electronic_assembly/drone/default,
/obj/item/electronic_assembly/drone/arms,
/obj/item/electronic_assembly/drone/secbot,
/obj/item/electronic_assembly/drone/medbot,
/obj/item/electronic_assembly/drone/genbot,
/obj/item/electronic_assembly/drone/android,
/obj/item/electronic_assembly/wallmount/tiny,
/obj/item/electronic_assembly/wallmount/light,
/obj/item/electronic_assembly/wallmount,
/obj/item/electronic_assembly/wallmount/heavy,
/obj/item/implant/integrated_circuit,
/obj/item/clothing/under/circuitry,
/obj/item/clothing/gloves/circuitry,
/obj/item/clothing/glasses/circuitry,
/obj/item/clothing/shoes/circuitry,
/obj/item/clothing/head/circuitry,
/obj/item/clothing/ears/circuitry,
/obj/item/clothing/suit/circuitry,
/obj/item/electronic_assembly/circuit_bug
)
circuit_fabricator_recipe_list["Tools"] = list(
/obj/item/integrated_electronics/wirer,
/obj/item/integrated_electronics/debugger,
/obj/item/integrated_electronics/detailer
)