Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22458 from Kearel/importedCircuits
Adds TG Circuits
- Loading branch information
Showing
94 changed files
with
8,249 additions
and
3,983 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#define IC_INPUT "I" | ||
#define IC_OUTPUT "O" | ||
#define IC_ACTIVATOR "A" | ||
|
||
// Pin functionality. | ||
#define DATA_CHANNEL "data channel" | ||
#define PULSE_CHANNEL "pulse channel" | ||
|
||
// Methods of obtaining a circuit. | ||
#define IC_SPAWN_DEFAULT 1 // If the circuit comes in the default circuit box and able to be printed in the IC printer. | ||
#define IC_SPAWN_RESEARCH 2 // If the circuit design will be available in the IC printer after upgrading it. | ||
|
||
// Categories that help differentiate circuits that can do different tipes of actions | ||
#define IC_ACTION_MOVEMENT (1<<0) // If the circuit can move the assembly | ||
#define IC_ACTION_COMBAT (1<<1) // If the circuit can cause harm | ||
#define IC_ACTION_LONG_RANGE (1<<2) // If the circuit communicate with something outside of the assembly | ||
|
||
// Displayed along with the pin name to show what type of pin it is. | ||
#define IC_FORMAT_ANY "\<ANY\>" | ||
#define IC_FORMAT_STRING "\<TEXT\>" | ||
#define IC_FORMAT_CHAR "\<CHAR\>" | ||
#define IC_FORMAT_COLOR "\<COLOR\>" | ||
#define IC_FORMAT_NUMBER "\<NUM\>" | ||
#define IC_FORMAT_DIR "\<DIR\>" | ||
#define IC_FORMAT_BOOLEAN "\<BOOL\>" | ||
#define IC_FORMAT_REF "\<REF\>" | ||
#define IC_FORMAT_LIST "\<LIST\>" | ||
#define IC_FORMAT_INDEX "\<INDEX\>" | ||
|
||
#define IC_FORMAT_PULSE "\<PULSE\>" | ||
|
||
// Used inside input/output list to tell the constructor what pin to make. | ||
#define IC_PINTYPE_ANY /datum/integrated_io | ||
#define IC_PINTYPE_STRING /datum/integrated_io/string | ||
#define IC_PINTYPE_CHAR /datum/integrated_io/char | ||
#define IC_PINTYPE_COLOR /datum/integrated_io/color | ||
#define IC_PINTYPE_NUMBER /datum/integrated_io/number | ||
#define IC_PINTYPE_DIR /datum/integrated_io/dir | ||
#define IC_PINTYPE_BOOLEAN /datum/integrated_io/boolean | ||
#define IC_PINTYPE_REF /datum/integrated_io/ref | ||
#define IC_PINTYPE_LIST /datum/integrated_io/lists | ||
#define IC_PINTYPE_INDEX /datum/integrated_io/index | ||
|
||
#define IC_PINTYPE_PULSE_IN /datum/integrated_io/activate | ||
#define IC_PINTYPE_PULSE_OUT /datum/integrated_io/activate/out | ||
|
||
// Data limits. | ||
#define IC_MAX_LIST_LENGTH 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
//Additional helper procs found in /code/modules/integrated_electgronics/core/saved_circuits.dm | ||
|
||
PROCESSING_SUBSYSTEM_DEF(circuit) | ||
name = "Circuit" | ||
priority = SS_PRIORITY_CIRCUIT | ||
init_order = SS_INIT_CIRCUIT | ||
flags = SS_BACKGROUND | ||
|
||
var/cipherkey | ||
|
||
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 = SHEET_MATERIAL_AMOUNT / 10 // Each circuit cost unit is 200cm3 | ||
|
||
/datum/controller/subsystem/processing/circuit/Initialize() | ||
SScircuit.cipherkey = uppertext(generateRandomString(2000+rand(0,10))) | ||
circuits_init() | ||
. = ..() | ||
|
||
/datum/controller/subsystem/processing/circuit/proc/circuits_init() | ||
//Cached lists for free performance | ||
var/atom/def = /obj/item/integrated_circuit | ||
var/default_name = initial(def.name) | ||
for(var/path in typesof(/obj/item/integrated_circuit)) | ||
var/obj/item/integrated_circuit/IC = path | ||
var/name = initial(IC.name) | ||
if(name == default_name) | ||
continue | ||
all_components[name] = path // Populating the component lists | ||
cached_components[IC] = 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/path in typesof(/obj/item/device/electronic_assembly)) | ||
var/obj/item/device/electronic_assembly/A = path | ||
var/name = initial(A.name) | ||
all_assemblies[name] = path | ||
cached_assemblies[A] = new path | ||
|
||
circuit_fabricator_recipe_list["Assemblies"] = subtypesof(/obj/item/device/electronic_assembly) - list(/obj/item/device/electronic_assembly/medium, /obj/item/device/electronic_assembly/large, /obj/item/device/electronic_assembly/drone, /obj/item/device/electronic_assembly/wallmount) | ||
|
||
circuit_fabricator_recipe_list["Tools"] = list( | ||
/obj/item/device/integrated_electronics/wirer, | ||
/obj/item/device/integrated_electronics/debugger, | ||
/obj/item/device/integrated_electronics/analyzer, | ||
/obj/item/device/integrated_electronics/detailer, | ||
/obj/item/weapon/card/data | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.