diff --git a/code/__defines/color.dm b/code/__defines/color.dm new file mode 100644 index 0000000000..ba9efe20de --- /dev/null +++ b/code/__defines/color.dm @@ -0,0 +1,17 @@ +//Color defines used by the assembly detailer. +#define COLOR_ASSEMBLY_BLACK "#545454" +#define COLOR_ASSEMBLY_BGRAY "#9497AB" +#define COLOR_ASSEMBLY_WHITE "#E2E2E2" +#define COLOR_ASSEMBLY_RED "#CC4242" +#define COLOR_ASSEMBLY_ORANGE "#E39751" +#define COLOR_ASSEMBLY_BEIGE "#AF9366" +#define COLOR_ASSEMBLY_BROWN "#97670E" +#define COLOR_ASSEMBLY_GOLD "#AA9100" +#define COLOR_ASSEMBLY_YELLOW "#CECA2B" +#define COLOR_ASSEMBLY_GURKHA "#999875" +#define COLOR_ASSEMBLY_LGREEN "#789876" +#define COLOR_ASSEMBLY_GREEN "#44843C" +#define COLOR_ASSEMBLY_LBLUE "#5D99BE" +#define COLOR_ASSEMBLY_BLUE "#38559E" +#define COLOR_ASSEMBLY_PURPLE "#6F6192" +#define COLOR_ASSEMBLY_HOT_PINK "#FF69B4" \ No newline at end of file diff --git a/code/__defines/integrated_circuits.dm b/code/__defines/integrated_circuits.dm new file mode 100644 index 0000000000..b2859a232d --- /dev/null +++ b/code/__defines/integrated_circuits.dm @@ -0,0 +1,3 @@ +// 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. \ No newline at end of file diff --git a/code/__defines/subsystems.dm b/code/__defines/subsystems.dm index 17c3ab8923..94c233d752 100644 --- a/code/__defines/subsystems.dm +++ b/code/__defines/subsystems.dm @@ -58,6 +58,7 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G #define INIT_ORDER_HOLOMAPS -5 #define INIT_ORDER_OVERLAY -6 #define INIT_ORDER_XENOARCH -20 +#define INIT_ORDER_CIRCUIT -21 // Subsystem fire priority, from lowest to highest priority diff --git a/code/_helpers/icons.dm b/code/_helpers/icons.dm index da4385ef6f..c6cae7b464 100644 --- a/code/_helpers/icons.dm +++ b/code/_helpers/icons.dm @@ -634,7 +634,6 @@ as a single icon. Useful for when you want to manipulate an icon via the above a The _flatIcons list is a cache for generated icon files. */ -// Creates a single icon from a given /atom or /image. Only the first argument is required. /proc/getFlatIcon(image/A, defdir, deficon, defstate, defblend, start = TRUE, no_anim = FALSE) // We start with a blank canvas, otherwise some icon procs crash silently var/icon/flat = icon('icons/effects/effects.dmi', "nothing") // Final flattened icon @@ -677,7 +676,7 @@ The _flatIcons list is a cache for generated icon files. var/curdir var/base_icon_dir //We'll use this to get the icon state to display if not null BUT NOT pass it to overlays as the dir we have - + //These should use the parent's direction (most likely) if(!A.dir || A.dir == SOUTH) curdir = defdir @@ -686,7 +685,7 @@ The _flatIcons list is a cache for generated icon files. //Let's check if the icon actually contains any diagonals, just skip if it's south to save (lot of) time if(curdir != SOUTH) - var/icon/test_icon + var/icon/test_icon var/directionals_exist = FALSE var/list/dirs_to_check = cardinal - SOUTH outer: @@ -824,6 +823,9 @@ The _flatIcons list is a cache for generated icon files. else return icon(flat, "", SOUTH) + + + /proc/getIconMask(atom/A)//By yours truly. Creates a dynamic mask for a mob/whatever. /N var/icon/alpha_mask = new(A.icon,A.icon_state)//So we want the default icon and icon state of A. for(var/I in A.overlays)//For every image in overlays. var/image/I will not work, don't try it. @@ -874,9 +876,10 @@ The _flatIcons list is a cache for generated icon files. if(4) I.pixel_y++ overlays += I//And finally add the overlay. -/proc/getHologramIcon(icon/A, safety=1)//If safety is on, a new icon is not created. +/proc/getHologramIcon(icon/A, safety=1, no_color = FALSE)//If safety is on, a new icon is not created. var/icon/flat_icon = safety ? A : new(A)//Has to be a new icon to not constantly change the same icon. - flat_icon.ColorTone(rgb(125,180,225))//Let's make it bluish. + if(!no_color) + flat_icon.ColorTone(rgb(125,180,225))//Let's make it bluish. flat_icon.ChangeOpacity(0.5)//Make it half transparent. var/icon/alpha_mask = new('icons/effects/effects.dmi', "scanline")//Scanline effect. flat_icon.AddAlphaMask(alpha_mask)//Finally, let's mix in a distortion effect. diff --git a/code/controllers/subsystems/circuits.dm b/code/controllers/subsystems/circuits.dm new file mode 100644 index 0000000000..8fda048c60 --- /dev/null +++ b/code/controllers/subsystems/circuits.dm @@ -0,0 +1,96 @@ +// +// 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" + init_order = INIT_ORDER_CIRCUIT + flags = SS_NO_FIRE + 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(timeofday) + circuits_init() + return ..() + +/datum/controller/subsystem/circuit/proc/circuits_init() + //Cached lists for free performance + for(var/path in typesof(/obj/item/integrated_circuit)) + var/obj/item/integrated_circuit/IC = path + var/name = initial(IC.name) + 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"] = list( + /obj/item/device/electronic_assembly/default, + /obj/item/device/electronic_assembly/calc, + /obj/item/device/electronic_assembly/clam, + /obj/item/device/electronic_assembly/simple, + /obj/item/device/electronic_assembly/hook, + /obj/item/device/electronic_assembly/pda, + /obj/item/device/electronic_assembly/tiny/default, + /obj/item/device/electronic_assembly/tiny/cylinder, + /obj/item/device/electronic_assembly/tiny/scanner, + /obj/item/device/electronic_assembly/tiny/hook, + /obj/item/device/electronic_assembly/tiny/box, + /obj/item/device/electronic_assembly/medium/default, + /obj/item/device/electronic_assembly/medium/box, + /obj/item/device/electronic_assembly/medium/clam, + /obj/item/device/electronic_assembly/medium/medical, + /obj/item/device/electronic_assembly/medium/gun, + /obj/item/device/electronic_assembly/medium/radio, + /obj/item/device/electronic_assembly/large/default, + /obj/item/device/electronic_assembly/large/scope, + /obj/item/device/electronic_assembly/large/terminal, + /obj/item/device/electronic_assembly/large/arm, + /obj/item/device/electronic_assembly/large/tall, + /obj/item/device/electronic_assembly/large/industrial, + /obj/item/device/electronic_assembly/drone/default, + /obj/item/device/electronic_assembly/drone/arms, + /obj/item/device/electronic_assembly/drone/secbot, + /obj/item/device/electronic_assembly/drone/medbot, + /obj/item/device/electronic_assembly/drone/genbot, + /obj/item/device/electronic_assembly/drone/android, + /obj/item/device/electronic_assembly/wallmount/tiny, + /obj/item/device/electronic_assembly/wallmount/light, + /obj/item/device/electronic_assembly/wallmount, + /obj/item/device/electronic_assembly/wallmount/heavy, + /obj/item/weapon/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 + ) + + circuit_fabricator_recipe_list["Tools"] = list( + /obj/item/device/integrated_electronics/wirer, + /obj/item/device/integrated_electronics/debugger, + /obj/item/device/integrated_electronics/detailer + ) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 36ec5f00da..7f7bbaa3b3 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -16,6 +16,7 @@ var/mob/pulledby = null var/item_state = null // Used to specify the item state for the on-mob overlays. var/icon_scale = 1 // Used to scale icons up or down in update_transform(). + var/icon_rotation = 0 // Used to rotate icons in update_transform() var/old_x = 0 var/old_y = 0 var/does_spin = TRUE // Does the atom spin when thrown (of course it does :P) @@ -277,9 +278,14 @@ /atom/movable/proc/update_transform() var/matrix/M = matrix() M.Scale(icon_scale) + M.Turn(icon_rotation) src.transform = M // Use this to set the object's scale. /atom/movable/proc/adjust_scale(new_scale) icon_scale = new_scale update_transform() + +/atom/movable/proc/adjust_rotation(new_rotation) + icon_rotation = new_rotation + update_transform() \ No newline at end of file diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm index 9f4f0fa118..7504b6e65f 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -94,3 +94,8 @@ icon_state = "snowwall" plane = MOB_PLANE layer = ABOVE_MOB_LAYER + +/obj/effect/overlay/holographic + mouse_opacity = FALSE + anchored = TRUE + plane = ABOVE_PLANE diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 4a80379c16..6c4895e42b 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -200,6 +200,9 @@ /obj/item/attack_hand(mob/living/user as mob) if (!user) return + if(anchored) + to_chat(user, span("notice", "\The [src] won't budge, you can't pick it up!")) + return if (hasorgans(user)) var/mob/living/carbon/human/H = user var/obj/item/organ/external/temp = H.organs_by_name["r_hand"] diff --git a/code/game/objects/items/devices/text_to_speech.dm b/code/game/objects/items/devices/text_to_speech.dm index bc0c9d5304..47dfc256fc 100644 --- a/code/game/objects/items/devices/text_to_speech.dm +++ b/code/game/objects/items/devices/text_to_speech.dm @@ -1,7 +1,7 @@ /obj/item/device/text_to_speech name = "TTS device" desc = "A device that speaks an inputted message. Given to crew which can not speak properly or at all." - icon = 'icons/obj/electronic_assemblies.dmi' + icon = 'icons/obj/integrated_electronics/electronic_setups.dmi' icon_state = "setup_small" w_class = ITEMSIZE_SMALL var/named diff --git a/code/game/objects/items/weapons/implants/implantcircuits.dm b/code/game/objects/items/weapons/implants/implantcircuits.dm index 2b87e8fae5..7c9391c631 100644 --- a/code/game/objects/items/weapons/implants/implantcircuits.dm +++ b/code/game/objects/items/weapons/implants/implantcircuits.dm @@ -1,7 +1,7 @@ /obj/item/weapon/implant/integrated_circuit name = "electronic implant" desc = "It's a case, for building very tiny electronics with." - icon = 'icons/obj/electronic_assemblies.dmi' + icon = 'icons/obj/integrated_electronics/electronic_setups.dmi' icon_state = "setup_implant" var/obj/item/device/electronic_assembly/implant/IC = null diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 70cacfba2c..02c6d0d8dc 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -150,6 +150,11 @@ if(is_hot(W)) burn(is_hot(W)) + if(istype(W, /obj/item/device/electronic_assembly/wallmount)) + var/obj/item/device/electronic_assembly/wallmount/IC = W + IC.mount_assembly(src, user) + return + if(istype(W, /obj/item/stack/tile/roofing)) var/expended_tile = FALSE // To track the case. If a ceiling is built in a multiz zlevel, it also necessarily roofs it against weather var/turf/T = GetAbove(src) diff --git a/code/modules/client/preference_setup/loadout/loadout_ears.dm b/code/modules/client/preference_setup/loadout/loadout_ears.dm index 23e7c8e33b..d92b2358b4 100644 --- a/code/modules/client/preference_setup/loadout/loadout_ears.dm +++ b/code/modules/client/preference_setup/loadout/loadout_ears.dm @@ -7,4 +7,8 @@ /datum/gear/ears/headphones display_name = "headphones" - path = /obj/item/clothing/ears/earmuffs/headphones \ No newline at end of file + path = /obj/item/clothing/ears/earmuffs/headphones + +/datum/gear/ears/circuitry + display_name = "earwear, circuitry (empty)" + path = /obj/item/clothing/ears/circuitry \ No newline at end of file diff --git a/code/modules/client/preference_setup/loadout/loadout_eyes.dm b/code/modules/client/preference_setup/loadout/loadout_eyes.dm index 7a17b782ef..5981424753 100644 --- a/code/modules/client/preference_setup/loadout/loadout_eyes.dm +++ b/code/modules/client/preference_setup/loadout/loadout_eyes.dm @@ -121,3 +121,7 @@ /datum/gear/eyes/sun/prescriptionsun display_name = "sunglasses, presciption (Security/Command)" path = /obj/item/clothing/glasses/sunglasses/prescription + +/datum/gear/eyes/circuitry + display_name = "goggles, circuitry (empty)" + path = /obj/item/clothing/glasses/circuitry \ No newline at end of file diff --git a/code/modules/client/preference_setup/loadout/loadout_gloves.dm b/code/modules/client/preference_setup/loadout/loadout_gloves.dm index 18eb05f882..74fb11fcaa 100644 --- a/code/modules/client/preference_setup/loadout/loadout_gloves.dm +++ b/code/modules/client/preference_setup/loadout/loadout_gloves.dm @@ -98,4 +98,8 @@ ringtype["ring, glass"] = /obj/item/clothing/gloves/ring/material/glass ringtype["ring, wood"] = /obj/item/clothing/gloves/ring/material/wood ringtype["ring, plastic"] = /obj/item/clothing/gloves/ring/material/plastic - gear_tweaks += new/datum/gear_tweak/path(ringtype) \ No newline at end of file + gear_tweaks += new/datum/gear_tweak/path(ringtype) + +/datum/gear/gloves/circuitry + display_name = "gloves, circuitry (empty)" + path = /obj/item/clothing/gloves/circuitry \ No newline at end of file diff --git a/code/modules/client/preference_setup/loadout/loadout_head.dm b/code/modules/client/preference_setup/loadout/loadout_head.dm index 86850a1288..7e0ac15a34 100644 --- a/code/modules/client/preference_setup/loadout/loadout_head.dm +++ b/code/modules/client/preference_setup/loadout/loadout_head.dm @@ -372,3 +372,7 @@ /datum/gear/head/surgical/purple display_name = "surgical cap, purple" path = /obj/item/clothing/head/surgery/purple + +/datum/gear/head/circuitry + display_name = "headwear, circuitry (empty)" + path = /obj/item/clothing/head/circuitry \ No newline at end of file diff --git a/code/modules/client/preference_setup/loadout/loadout_shoes.dm b/code/modules/client/preference_setup/loadout/loadout_shoes.dm index 6cca1946fd..d3ad2b05d8 100644 --- a/code/modules/client/preference_setup/loadout/loadout_shoes.dm +++ b/code/modules/client/preference_setup/loadout/loadout_shoes.dm @@ -227,3 +227,7 @@ display_name = "hydroponics winter boots" path = /obj/item/clothing/shoes/boots/winter/hydro allowed_roles = list("Botanist", "Xenobiologist") + +/datum/gear/shoes/circuitry + display_name = "boots, circuitry (empty)" + path = /obj/item/clothing/shoes/circuitry diff --git a/code/modules/client/preference_setup/loadout/loadout_uniform.dm b/code/modules/client/preference_setup/loadout/loadout_uniform.dm index 591269f418..14fd22711b 100644 --- a/code/modules/client/preference_setup/loadout/loadout_uniform.dm +++ b/code/modules/client/preference_setup/loadout/loadout_uniform.dm @@ -456,4 +456,8 @@ /datum/gear/uniform/westernbustle display_name = "western bustle" - path = /obj/item/clothing/under/dress/westernbustle \ No newline at end of file + path = /obj/item/clothing/under/dress/westernbustle + +/datum/gear/uniform/circuitry + display_name = "jumpsuit, circuitry (empty)" + path = /obj/item/clothing/under/circuitry \ No newline at end of file diff --git a/code/modules/integrated_electronics/_defines.dm b/code/modules/integrated_electronics/_defines.dm index 104b867532..6361bfa32f 100644 --- a/code/modules/integrated_electronics/_defines.dm +++ b/code/modules/integrated_electronics/_defines.dm @@ -6,10 +6,6 @@ #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. - // Displayed along with the pin name to show what type of pin it is. #define IC_FORMAT_ANY "\" #define IC_FORMAT_STRING "\" @@ -49,7 +45,7 @@ var/list/all_integrated_circuits = list() /obj/item/integrated_circuit name = "integrated circuit" desc = "It's a tiny chip! This one doesn't seem to do much, however." - icon = 'icons/obj/electronic_assemblies.dmi' + icon = 'icons/obj/integrated_electronics/electronic_components.dmi' icon_state = "template" w_class = ITEMSIZE_TINY var/obj/item/device/electronic_assembly/assembly = null // Reference to the assembly holding this circuit, if any. diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index 90046fd269..d236dc9da7 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -1,56 +1,29 @@ #define IC_COMPONENTS_BASE 20 #define IC_COMPLEXITY_BASE 60 +// Here is where the base definition lives. +// Specific subtypes are in their own folder. + /obj/item/device/electronic_assembly name = "electronic assembly" desc = "It's a case, for building small electronics with." w_class = ITEMSIZE_SMALL - icon = 'icons/obj/electronic_assemblies.dmi' + icon = 'icons/obj/integrated_electronics/electronic_setups.dmi' icon_state = "setup_small" show_messages = TRUE var/max_components = IC_COMPONENTS_BASE var/max_complexity = IC_COMPLEXITY_BASE - var/opened = 0 + var/opened = FALSE + var/can_anchor = FALSE // If true, wrenching it will anchor it. var/obj/item/weapon/cell/device/battery = null // Internal cell which most circuits need to work. + var/net_power = 0 // Set every tick, to display how much power is being drawn in total. + var/detail_color = COLOR_ASSEMBLY_BLACK -/obj/item/device/electronic_assembly/medium - name = "electronic mechanism" - icon_state = "setup_medium" - desc = "It's a case, for building medium-sized electronics with." - w_class = ITEMSIZE_NORMAL - max_components = IC_COMPONENTS_BASE * 2 - max_complexity = IC_COMPLEXITY_BASE * 2 - -/obj/item/device/electronic_assembly/large - name = "electronic machine" - icon_state = "setup_large" - desc = "It's a case, for building large electronics with." - w_class = ITEMSIZE_LARGE - max_components = IC_COMPONENTS_BASE * 4 - max_complexity = IC_COMPLEXITY_BASE * 4 - -/obj/item/device/electronic_assembly/drone - name = "electronic drone" - icon_state = "setup_drone" - desc = "It's a case, for building mobile electronics with." - w_class = ITEMSIZE_NORMAL - max_components = IC_COMPONENTS_BASE * 1.5 - max_complexity = IC_COMPLEXITY_BASE * 1.5 - -/obj/item/device/electronic_assembly/implant - name = "electronic implant" - icon_state = "setup_implant" - desc = "It's a case, for building very tiny electronics with." - w_class = ITEMSIZE_TINY - max_components = IC_COMPONENTS_BASE / 2 - max_complexity = IC_COMPLEXITY_BASE / 2 - var/obj/item/weapon/implant/integrated_circuit/implant = null - -/obj/item/device/electronic_assembly/New() - ..() +/obj/item/device/electronic_assembly/initialize() battery = new(src) processing_objects |= src + return ..() /obj/item/device/electronic_assembly/Destroy() battery = null // It will be qdel'd by ..() if still in our contents @@ -61,35 +34,32 @@ handle_idle_power() /obj/item/device/electronic_assembly/proc/handle_idle_power() - // First we generate power. - for(var/obj/item/integrated_circuit/passive/power/P in contents) - P.make_energy() + net_power = 0 // Reset this. This gets increased/decreased with [give/draw]_power() outside of this loop. - // Now spend it. + // First we handle passive sources. Most of these make power so they go first. + for(var/obj/item/integrated_circuit/passive/power/P in contents) + P.handle_passive_energy() + + // Now we handle idle power draw. for(var/obj/item/integrated_circuit/IC in contents) if(IC.power_draw_idle) if(!draw_power(IC.power_draw_idle)) IC.power_fail() -/obj/item/device/electronic_assembly/implant/update_icon() - ..() - implant.icon_state = icon_state -/obj/item/device/electronic_assembly/implant/nano_host() - return implant /obj/item/device/electronic_assembly/proc/resolve_nano_host() return src -/obj/item/device/electronic_assembly/implant/resolve_nano_host() - return implant - /obj/item/device/electronic_assembly/proc/check_interactivity(mob/user) if(!CanInteract(user, physical_state)) return 0 return 1 +/obj/item/device/electronic_assembly/get_cell() + return battery + /obj/item/device/electronic_assembly/interact(mob/user) if(!check_interactivity(user)) return @@ -107,7 +77,8 @@ HTML += "[total_parts]/[max_components] ([round((total_parts / max_components) * 100, 0.1)]%) space taken up in the assembly.
" HTML += "[total_complexity]/[max_complexity] ([round((total_complexity / max_complexity) * 100, 0.1)]%) maximum complexity.
" if(battery) - HTML += "[round(battery.charge, 0.1)]/[battery.maxcharge] ([round(battery.percent(), 0.1)]%) cell charge. \[Remove\]" + HTML += "[round(battery.charge, 0.1)]/[battery.maxcharge] ([round(battery.percent(), 0.1)]%) cell charge. \[Remove\]
" + HTML += "Net energy: [format_SI(net_power / CELLRATE, "W")]." else HTML += "No powercell detected!" HTML += "

" @@ -175,14 +146,18 @@ /obj/item/device/electronic_assembly/proc/can_move() return FALSE -/obj/item/device/electronic_assembly/drone/can_move() - return TRUE - /obj/item/device/electronic_assembly/update_icon() if(opened) icon_state = initial(icon_state) + "-open" else icon_state = initial(icon_state) + cut_overlays() + if(detail_color == COLOR_ASSEMBLY_BLACK) //Black colored overlay looks almost but not exactly like the base sprite, so just cut the overlay and avoid it looking kinda off. + return + var/mutable_appearance/detail_overlay = mutable_appearance('icons/obj/integrated_electronics/electronic_setups.dmi', "[icon_state]-color") + detail_overlay.color = detail_color + add_overlay(detail_overlay) + /obj/item/device/electronic_assembly/GetAccess() . = list() @@ -244,6 +219,11 @@ return TRUE +// Non-interactive version of above that always succeeds, intended for build-in circuits that get added on assembly initialization. +/obj/item/device/electronic_assembly/proc/force_add_circuit(var/obj/item/integrated_circuit/IC) + IC.forceMove(src) + IC.assembly = src + /obj/item/device/electronic_assembly/afterattack(atom/target, mob/user, proximity) if(proximity) var/scanned = FALSE @@ -256,7 +236,17 @@ visible_message("\The [user] waves \the [src] around [target].") /obj/item/device/electronic_assembly/attackby(var/obj/item/I, var/mob/user) - if(istype(I, /obj/item/integrated_circuit)) + if(can_anchor && I.is_wrench()) + anchored = !anchored + to_chat(user, span("notice", "You've [anchored ? "" : "un"]secured \the [src] to \the [get_turf(src)].")) + if(anchored) + on_anchored() + else + on_unanchored() + playsound(src, I.usesound, 50, 1) + return TRUE + + else if(istype(I, /obj/item/integrated_circuit)) if(!user.unEquip(I)) return FALSE if(add_circuit(I, user)) @@ -264,18 +254,26 @@ playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1) interact(user) return TRUE + else if(I.is_crowbar()) playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1) opened = !opened to_chat(user, "You [opened ? "opened" : "closed"] \the [src].") update_icon() return TRUE + else if(istype(I, /obj/item/device/integrated_electronics/wirer) || istype(I, /obj/item/device/integrated_electronics/debugger) || I.is_screwdriver()) if(opened) interact(user) else to_chat(user, "\The [src] isn't opened, so you can't fiddle with the internal components. \ Try using a crowbar.") + + else if(istype(I, /obj/item/device/integrated_electronics/detailer)) + var/obj/item/device/integrated_electronics/detailer/D = I + detail_color = D.detail_color + update_icon() + else if(istype(I, /obj/item/weapon/cell/device)) if(!opened) to_chat(user, "\The [src] isn't opened, so you can't put anything inside. Try using a crowbar.") @@ -291,6 +289,7 @@ to_chat(user, "You slot \the [cell] inside \the [src]'s power supplier.") interact(user) return TRUE + else return ..() @@ -331,13 +330,32 @@ // Returns true if power was successfully drawn. /obj/item/device/electronic_assembly/proc/draw_power(amount) - if(battery && battery.checked_use(amount * CELLRATE)) + if(battery) + var/lost = battery.use(amount * CELLRATE) + net_power -= lost return TRUE return FALSE // Ditto for giving. /obj/item/device/electronic_assembly/proc/give_power(amount) - if(battery && battery.give(amount * CELLRATE)) + if(battery) + var/gained = battery.give(amount * CELLRATE) + net_power += gained return TRUE return FALSE +/obj/item/device/electronic_assembly/on_loc_moved(oldloc) + for(var/obj/O in contents) + O.on_loc_moved(oldloc) + +/obj/item/device/electronic_assembly/Moved(var/oldloc) + for(var/obj/O in contents) + O.on_loc_moved(oldloc) + +/obj/item/device/electronic_assembly/proc/on_anchored() + for(var/obj/item/integrated_circuit/IC in contents) + IC.on_anchored() + +/obj/item/device/electronic_assembly/proc/on_unanchored() + for(var/obj/item/integrated_circuit/IC in contents) + IC.on_unanchored() diff --git a/code/modules/integrated_electronics/core/assemblies/clothing.dm b/code/modules/integrated_electronics/core/assemblies/clothing.dm new file mode 100644 index 0000000000..f8a5b31f3f --- /dev/null +++ b/code/modules/integrated_electronics/core/assemblies/clothing.dm @@ -0,0 +1,187 @@ + +// The base subtype for assemblies that can be worn. Certain pieces will have more or less capabilities +// E.g. Glasses have less room than something worn over the chest. +// Note that the electronic assembly is INSIDE the object that actually gets worn, in a similar way to implants. + +/obj/item/device/electronic_assembly/clothing + name = "electronic clothing" + icon_state = "circuitry" // Needs to match the clothing's base icon_state. + desc = "It's a case, for building machines attached to clothing." + w_class = ITEMSIZE_SMALL + max_components = IC_COMPONENTS_BASE + max_complexity = IC_COMPLEXITY_BASE + var/obj/item/clothing/clothing = null + +/obj/item/device/electronic_assembly/clothing/nano_host() + return clothing + +/obj/item/device/electronic_assembly/clothing/resolve_nano_host() + return clothing + +/obj/item/device/electronic_assembly/clothing/update_icon() + ..() + clothing.icon_state = icon_state + // We don't need to update the mob sprite since it won't (and shouldn't) actually get changed. + +// This is 'small' relative to the size of regular clothing assemblies. +/obj/item/device/electronic_assembly/clothing/small + max_components = IC_COMPONENTS_BASE / 2 + max_complexity = IC_COMPLEXITY_BASE / 2 + w_class = ITEMSIZE_TINY + +// Ditto. +/obj/item/device/electronic_assembly/clothing/large + max_components = IC_COMPONENTS_BASE * 2 + max_complexity = IC_COMPLEXITY_BASE * 2 + w_class = ITEMSIZE_NORMAL + + +// This is defined higher up, in /clothing to avoid lots of copypasta. +/obj/item/clothing + var/obj/item/device/electronic_assembly/clothing/IC = null + var/obj/item/integrated_circuit/built_in/action_button/action_circuit = null // This gets pulsed when someone clicks the button on the hud. + +/obj/item/clothing/emp_act(severity) + if(IC) + IC.emp_act(severity) + ..() + +/obj/item/clothing/examine(mob/user) + if(IC) + IC.examine(user) + ..() + +/obj/item/clothing/attackby(obj/item/I, mob/user) + if(IC) + // This needs to be done in a better way... + if(I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/integrated_circuit) || istype(I, /obj/item/weapon/cell/device) || istype(I, /obj/item/device/integrated_electronics) ) + IC.attackby(I, user) + else + ..() + +/obj/item/clothing/attack_self(mob/user) + if(IC) + if(IC.opened) + IC.attack_self(user) + else + action_circuit.do_work() + else + ..() + +/obj/item/clothing/Moved(oldloc) + if(IC) + IC.on_loc_moved(oldloc) + else + ..() + +/obj/item/clothing/on_loc_moved(oldloc) + if(IC) + IC.on_loc_moved(oldloc) + else + ..() + +// Does most of the repeatative setup. +/obj/item/clothing/proc/setup_integrated_circuit(new_type) + // Set up the internal circuit holder. + IC = new new_type(src) + IC.clothing = src + IC.name = name + + // Clothing assemblies can be triggered by clicking on the HUD. This allows that to occur. + action_circuit = new(src.IC) + IC.force_add_circuit(action_circuit) + action_button_name = "Activate [name]" + +/obj/item/clothing/Destroy() + if(IC) + IC.clothing = null + action_circuit = null // Will get deleted by qdel-ing the IC assembly. + qdel(IC) + return ..() + +// Specific subtypes. + +// Jumpsuit. +/obj/item/clothing/under/circuitry + name = "electronic jumpsuit" + desc = "It's a wearable case for electronics. This on is a black jumpsuit with wiring weaved into the fabric." + icon_state = "circuitry" + worn_state = "circuitry" + +/obj/item/clothing/under/circuitry/initialize() + setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing) + return ..() + + +// Gloves. +/obj/item/clothing/gloves/circuitry + name = "electronic gloves" + desc = "It's a wearable case for electronics. This one is a pair of black gloves, with wires woven into them. A small \ + device with a screen is attached to the left glove." + icon_state = "circuitry" + item_state = "circuitry" + +/obj/item/clothing/gloves/circuitry/initialize() + setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/small) + return ..() + + +// Glasses. +/obj/item/clothing/glasses/circuitry + name = "electronic goggles" + desc = "It's a wearable case for electronics. This one is a pair of goggles, with wiring sticking out. \ + Could this augment your vision?" // Sadly it won't, or at least not yet. + icon_state = "circuitry" + item_state = "night" // The on-mob sprite would be identical anyways. + +/obj/item/clothing/glasses/circuitry/initialize() + setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/small) + return ..() + +// Shoes +/obj/item/clothing/shoes/circuitry + name = "electronic boots" + desc = "It's a wearable case for electronics. This one is a pair of boots, with wires attached to a small \ + cover." + icon_state = "circuitry" + item_state = "circuitry" + +/obj/item/clothing/shoes/circuitry/initialize() + setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/small) + return ..() + +// Head +/obj/item/clothing/head/circuitry + name = "electronic headwear" + desc = "It's a wearable case for electronics. This one appears to be a very technical-looking piece that \ + goes around the collar, with a heads-up-display attached on the right." + icon_state = "circuitry" + item_state = "circuitry" + +/obj/item/clothing/head/circuitry/initialize() + setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/small) + return ..() + +// Ear +/obj/item/clothing/ears/circuitry + name = "electronic earwear" + desc = "It's a wearable case for electronics. This one appears to be a technical-looking headset." + icon = 'icons/obj/clothing/ears.dmi' + icon_state = "circuitry" + item_state = "circuitry" + +/obj/item/clothing/ears/circuitry/initialize() + setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/small) + return ..() + +// Exo-slot +/obj/item/clothing/suit/circuitry + name = "electronic chestpiece" + desc = "It's a wearable case for electronics. This one appears to be a very technical-looking vest, that \ + almost looks professionally made, however the wiring popping out betrays that idea." + icon_state = "circuitry" + item_state = "circuitry" + +/obj/item/clothing/suit/circuitry/initialize() + setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/large) + return ..() \ No newline at end of file diff --git a/code/modules/integrated_electronics/core/device.dm b/code/modules/integrated_electronics/core/assemblies/device.dm similarity index 96% rename from code/modules/integrated_electronics/core/device.dm rename to code/modules/integrated_electronics/core/assemblies/device.dm index 1b298c7a36..63e0bef562 100644 --- a/code/modules/integrated_electronics/core/device.dm +++ b/code/modules/integrated_electronics/core/assemblies/device.dm @@ -1,87 +1,84 @@ -/obj/item/device/assembly/electronic_assembly - name = "electronic device" - desc = "It's a case for building electronics with. It can be attached to other small devices." - icon_state = "setup_device" - var/opened = 0 - - var/obj/item/device/electronic_assembly/device/EA - -/obj/item/device/assembly/electronic_assembly/New() - EA = new(src) - EA.holder = src - ..() - -/obj/item/device/assembly/electronic_assembly/attackby(obj/item/I as obj, mob/user as mob) - if (I.is_crowbar()) - toggle_open(user) - else if (opened) - EA.attackby(I, user) - else - ..() - -/obj/item/device/electronic_assembly/get_cell() - return battery - -/obj/item/device/assembly/electronic_assembly/proc/toggle_open(mob/user) - playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1) - opened = !opened - EA.opened = opened - to_chat(user, "You [opened ? "opened" : "closed"] \the [src].") - secured = 1 - update_icon() - -/obj/item/device/assembly/electronic_assembly/update_icon() - if(EA) - icon_state = initial(icon_state) - else - icon_state = initial(icon_state)+"0" - if(opened) - icon_state = icon_state + "-open" - -/obj/item/device/assembly/electronic_assembly/attack_self(mob/user as mob) - if(EA) - EA.attack_self(user) - -/obj/item/device/assembly/electronic_assembly/pulsed(var/radio = 0) //Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs - if(EA) - for(var/obj/item/integrated_circuit/built_in/device_input/I in EA.contents) - I.do_work() - return - -/obj/item/device/assembly/electronic_assembly/examine(mob/user) - .=..(user, 1) - if(EA) - for(var/obj/item/integrated_circuit/IC in EA.contents) - IC.external_examine(user) - -/obj/item/device/assembly/electronic_assembly/verb/toggle() - set src in usr - set category = "Object" - set name = "Open/Close Device Assembly" - set desc = "Open or close device assembly!" - - toggle_open(usr) - - -/obj/item/device/electronic_assembly/device - name = "electronic device" - icon_state = "setup_device" - desc = "It's a tiny electronic device with specific use for attaching to other devices." - var/obj/item/device/assembly/electronic_assembly/holder - w_class = ITEMSIZE_TINY - max_components = IC_COMPONENTS_BASE * 3/4 - max_complexity = IC_COMPLEXITY_BASE * 3/4 - - -/obj/item/device/electronic_assembly/device/New() - ..() - var/obj/item/integrated_circuit/built_in/device_input/input = new(src) - var/obj/item/integrated_circuit/built_in/device_output/output = new(src) - input.assembly = src - output.assembly = src - -/obj/item/device/electronic_assembly/device/check_interactivity(mob/user) - if(!CanInteract(user, state = deep_inventory_state)) - return 0 - return 1 - +/obj/item/device/assembly/electronic_assembly + name = "electronic device" + desc = "It's a case for building electronics with. It can be attached to other small devices." + icon_state = "setup_device" + var/opened = 0 + + var/obj/item/device/electronic_assembly/device/EA + +/obj/item/device/assembly/electronic_assembly/New() + EA = new(src) + EA.holder = src + ..() + +/obj/item/device/assembly/electronic_assembly/attackby(obj/item/I as obj, mob/user as mob) + if (I.is_crowbar()) + toggle_open(user) + else if (opened) + EA.attackby(I, user) + else + ..() + +/obj/item/device/assembly/electronic_assembly/proc/toggle_open(mob/user) + playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1) + opened = !opened + EA.opened = opened + to_chat(user, "You [opened ? "opened" : "closed"] \the [src].") + secured = 1 + update_icon() + +/obj/item/device/assembly/electronic_assembly/update_icon() + if(EA) + icon_state = initial(icon_state) + else + icon_state = initial(icon_state)+"0" + if(opened) + icon_state = icon_state + "-open" + +/obj/item/device/assembly/electronic_assembly/attack_self(mob/user as mob) + if(EA) + EA.attack_self(user) + +/obj/item/device/assembly/electronic_assembly/pulsed(var/radio = 0) //Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs + if(EA) + for(var/obj/item/integrated_circuit/built_in/device_input/I in EA.contents) + I.do_work() + return + +/obj/item/device/assembly/electronic_assembly/examine(mob/user) + .=..(user, 1) + if(EA) + for(var/obj/item/integrated_circuit/IC in EA.contents) + IC.external_examine(user) + +/obj/item/device/assembly/electronic_assembly/verb/toggle() + set src in usr + set category = "Object" + set name = "Open/Close Device Assembly" + set desc = "Open or close device assembly!" + + toggle_open(usr) + + +/obj/item/device/electronic_assembly/device + name = "electronic device" + icon_state = "setup_device" + desc = "It's a tiny electronic device with specific use for attaching to other devices." + var/obj/item/device/assembly/electronic_assembly/holder + w_class = ITEMSIZE_TINY + max_components = IC_COMPONENTS_BASE * 3/4 + max_complexity = IC_COMPLEXITY_BASE * 3/4 + + +/obj/item/device/electronic_assembly/device/New() + ..() + var/obj/item/integrated_circuit/built_in/device_input/input = new(src) + var/obj/item/integrated_circuit/built_in/device_output/output = new(src) + input.assembly = src + output.assembly = src + +/obj/item/device/electronic_assembly/device/check_interactivity(mob/user) + if(!CanInteract(user, state = deep_inventory_state)) + return 0 + return 1 + diff --git a/code/modules/integrated_electronics/core/assemblies/generic.dm b/code/modules/integrated_electronics/core/assemblies/generic.dm new file mode 100644 index 0000000000..8929b69d78 --- /dev/null +++ b/code/modules/integrated_electronics/core/assemblies/generic.dm @@ -0,0 +1,261 @@ +// Generic subtypes without a lot of special code. + +// Small assemblies. + +/obj/item/device/electronic_assembly/default + name = "type-a electronic assembly" + +/obj/item/device/electronic_assembly/calc + name = "type-b electronic assembly" + icon_state = "setup_small_calc" + desc = "It's a case, for building small electronics with. This one resembles a pocket calculator." + +/obj/item/device/electronic_assembly/clam + name = "type-c electronic assembly" + icon_state = "setup_small_clam" + desc = "It's a case, for building small electronics with. This one has a clamshell design." + +/obj/item/device/electronic_assembly/simple + name = "type-d electronic assembly" + icon_state = "setup_small_simple" + desc = "It's a case, for building small electronics with. This one has a simple design." + +/obj/item/device/electronic_assembly/hook + name = "type-e electronic assembly" + icon_state = "setup_small_hook" + desc = "It's a case, for building small electronics with. This one looks like it has a belt clip, but it's purely decorative." + +/obj/item/device/electronic_assembly/pda + name = "type-f electronic assembly" + icon_state = "setup_small_pda" + desc = "It's a case, for building small electronics with. This one resembles a PDA." + +// Tiny assemblies. + +/obj/item/device/electronic_assembly/tiny + name = "electronic device" + icon_state = "setup_device" + desc = "It's a case, for building tiny-sized electronics with." + w_class = ITEMSIZE_TINY + max_components = IC_COMPONENTS_BASE / 2 + max_complexity = IC_COMPLEXITY_BASE / 2 + +/obj/item/device/electronic_assembly/tiny/default + name = "type-a electronic device" + +/obj/item/device/electronic_assembly/tiny/cylinder + name = "type-b electronic device" + icon_state = "setup_device_cylinder" + desc = "It's a case, for building tiny-sized electronics with. This one has a cylindrical design." + +/obj/item/device/electronic_assembly/tiny/scanner + name = "type-c electronic device" + icon_state = "setup_device_scanner" + desc = "It's a case, for building tiny-sized electronics with. This one has a scanner-like design." + +/obj/item/device/electronic_assembly/tiny/hook + name = "type-d electronic device" + icon_state = "setup_device_hook" + desc = "It's a case, for building tiny-sized electronics with. This one looks like it has a belt clip, but it's purely decorative." + +/obj/item/device/electronic_assembly/tiny/box + name = "type-e electronic device" + icon_state = "setup_device_box" + desc = "It's a case, for building tiny-sized electronics with. This one has a boxy design." + +// Medium assemblies. + +/obj/item/device/electronic_assembly/medium + name = "electronic mechanism" + icon_state = "setup_medium" + desc = "It's a case, for building medium-sized electronics with." + w_class = ITEMSIZE_NORMAL + max_components = IC_COMPONENTS_BASE * 2 + max_complexity = IC_COMPLEXITY_BASE * 2 + +/obj/item/device/electronic_assembly/medium/default + name = "type-a electronic mechanism" + +/obj/item/device/electronic_assembly/medium/box + name = "type-b electronic mechanism" + icon_state = "setup_medium_box" + desc = "It's a case, for building medium-sized electronics with. This one has a boxy design." + +/obj/item/device/electronic_assembly/medium/clam + name = "type-c electronic mechanism" + icon_state = "setup_medium_clam" + desc = "It's a case, for building medium-sized electronics with. This one has a clamshell design." + +/obj/item/device/electronic_assembly/medium/medical + name = "type-d electronic mechanism" + icon_state = "setup_medium_med" + desc = "It's a case, for building medium-sized electronics with. This one resembles some type of medical apparatus." + +/obj/item/device/electronic_assembly/medium/gun + name = "type-e electronic mechanism" + icon_state = "setup_medium_gun" + item_state = "circuitgun" + desc = "It's a case, for building medium-sized electronics with. This one resembles a gun, or some type of tool, \ + if you're feeling optimistic." +// can_fire_equipped = TRUE + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_guns.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_guns.dmi', + ) + +/obj/item/device/electronic_assembly/medium/radio + name = "type-f electronic mechanism" + icon_state = "setup_medium_radio" + desc = "It's a case, for building medium-sized electronics with. This one resembles an old radio." + +// Large assemblies. + +/obj/item/device/electronic_assembly/large + name = "electronic machine" + icon_state = "setup_large" + desc = "It's a case, for building large electronics with." + w_class = ITEMSIZE_LARGE + max_components = IC_COMPONENTS_BASE * 4 + max_complexity = IC_COMPLEXITY_BASE * 4 + can_anchor = TRUE + +/obj/item/device/electronic_assembly/large/default + name = "type-a electronic machine" + +/obj/item/device/electronic_assembly/large/scope + name = "type-b electronic machine" + icon_state = "setup_large_scope" + desc = "It's a case, for building large electronics with. This one resembles an oscilloscope." + +/obj/item/device/electronic_assembly/large/terminal + name = "type-c electronic machine" + icon_state = "setup_large_terminal" + desc = "It's a case, for building large electronics with. This one resembles a computer terminal." + +/obj/item/device/electronic_assembly/large/arm + name = "type-d electronic machine" + icon_state = "setup_large_arm" + desc = "It's a case, for building large electronics with. This one resembles a robotic arm." + +/obj/item/device/electronic_assembly/large/tall + name = "type-e electronic machine" + icon_state = "setup_large_tall" + desc = "It's a case, for building large electronics with. This one has a tall design." + +/obj/item/device/electronic_assembly/large/industrial + name = "type-f electronic machine" + icon_state = "setup_large_industrial" + desc = "It's a case, for building large electronics with. This one resembles some kind of industrial machinery." + +// Drone assemblies, which can move with the locomotion circuit. + +/obj/item/device/electronic_assembly/drone + name = "electronic drone" + icon_state = "setup_drone" + desc = "It's a case, for building mobile electronics with." + w_class = ITEMSIZE_NORMAL + max_components = IC_COMPONENTS_BASE * 1.5 + max_complexity = IC_COMPLEXITY_BASE * 1.5 + can_anchor = FALSE + +/obj/item/device/electronic_assembly/drone/can_move() + return TRUE + +/obj/item/device/electronic_assembly/drone/default + name = "type-a electronic drone" + +/obj/item/device/electronic_assembly/drone/arms + name = "type-b electronic drone" + icon_state = "setup_drone_arms" + desc = "It's a case, for building mobile electronics with. This one is armed and dangerous." + +/obj/item/device/electronic_assembly/drone/secbot + name = "type-c electronic drone" + icon_state = "setup_drone_secbot" + desc = "It's a case, for building mobile electronics with. This one resembles a Securitron." + +/obj/item/device/electronic_assembly/drone/medbot + name = "type-d electronic drone" + icon_state = "setup_drone_medbot" + desc = "It's a case, for building mobile electronics with. This one resembles a Medibot." + +/obj/item/device/electronic_assembly/drone/genbot + name = "type-e electronic drone" + icon_state = "setup_drone_genbot" + desc = "It's a case, for building mobile electronics with. This one has a generic bot design." + +/obj/item/device/electronic_assembly/drone/android + name = "type-f electronic drone" + icon_state = "setup_drone_android" + desc = "It's a case, for building mobile electronics with. This one has a hominoid design." + +// Wall mounted assemblies. + +/obj/item/device/electronic_assembly/wallmount + name = "wall-mounted electronic assembly" + icon_state = "setup_wallmount_medium" + desc = "It's a case, for building medium-sized electronics with. It has a magnetized \ + backing to allow it to stick to walls." + w_class = ITEMSIZE_NORMAL + max_components = IC_COMPONENTS_BASE * 2 + max_complexity = IC_COMPLEXITY_BASE * 2 + can_anchor = TRUE + +/obj/item/device/electronic_assembly/wallmount/proc/mount_assembly(turf/on_wall, mob/user) + if(get_dist(on_wall,user) > 1) + return + var/ndir = get_dir(on_wall, user) + if(!(ndir in cardinal)) + return + var/turf/T = get_turf(user) + if(!istype(T, /turf/simulated/floor)) + to_chat(user, "You cannot place \the [src] on this spot!") + return + playsound(src.loc, 'sound/machines/click.ogg', 75, 1) + user.visible_message("\The [user] attaches \the [src] to the wall.", + "You attach \the [src] to the wall.", + "You hear clicking.") + user.drop_item(T) + anchored = TRUE + on_anchored() + switch(ndir) + if(NORTH) + pixel_y = -31 + if(SOUTH) + pixel_y = 31 + if(EAST) + pixel_x = -31 + if(WEST) + pixel_x = 31 + +/obj/item/device/electronic_assembly/wallmount/on_unanchored() + pixel_x = 0 + pixel_y = 0 + ..() + +/obj/item/device/electronic_assembly/wallmount/heavy + name = "heavy wall-mounted electronic assembly" + icon_state = "setup_wallmount_large" + desc = "It's a case, for building large electronics with. It has a magnetized backing \ + to allow it to stick to walls." + w_class = ITEMSIZE_LARGE + max_components = IC_COMPONENTS_BASE * 4 + max_complexity = IC_COMPLEXITY_BASE * 4 + +/obj/item/device/electronic_assembly/wallmount/light + name = "light wall-mounted electronic assembly" + icon_state = "setup_wallmount_small" + desc = "It's a case, for building small electronics with. It has a magnetized backing \ + to allow it to stick to walls." + w_class = ITEMSIZE_SMALL + max_components = IC_COMPONENTS_BASE + max_complexity = IC_COMPLEXITY_BASE + +/obj/item/device/electronic_assembly/wallmount/tiny + name = "tiny wall-mounted electronic assembly" + icon_state = "setup_wallmount_tiny" + desc = "It's a case, for building tiny electronics with. It has a magnetized backing \ + to allow it to stick to walls." + w_class = ITEMSIZE_TINY + max_components = IC_COMPONENTS_BASE / 2 + max_complexity = IC_COMPLEXITY_BASE / 2 \ No newline at end of file diff --git a/code/modules/integrated_electronics/core/assemblies/implant.dm b/code/modules/integrated_electronics/core/assemblies/implant.dm new file mode 100644 index 0000000000..11db537768 --- /dev/null +++ b/code/modules/integrated_electronics/core/assemblies/implant.dm @@ -0,0 +1,21 @@ +// Note that this is contained inside an actual implant subtype. +// See code/game/objects/items/weapons/implants/implantcircuits.dm for where this gets held. + +/obj/item/device/electronic_assembly/implant + name = "electronic implant" + icon_state = "setup_implant" + desc = "It's a case, for building very tiny electronics with." + w_class = ITEMSIZE_TINY + max_components = IC_COMPONENTS_BASE / 2 + max_complexity = IC_COMPLEXITY_BASE / 2 + var/obj/item/weapon/implant/integrated_circuit/implant = null + +/obj/item/device/electronic_assembly/implant/nano_host() + return implant + +/obj/item/device/electronic_assembly/implant/resolve_nano_host() + return implant + +/obj/item/device/electronic_assembly/implant/update_icon() + ..() + implant.icon_state = icon_state \ No newline at end of file diff --git a/code/modules/integrated_electronics/core/detailer.dm b/code/modules/integrated_electronics/core/detailer.dm new file mode 100644 index 0000000000..cd1696aecc --- /dev/null +++ b/code/modules/integrated_electronics/core/detailer.dm @@ -0,0 +1,45 @@ +/obj/item/device/integrated_electronics/detailer + name = "assembly detailer" + desc = "A combination autopainter and flash anodizer designed to give electronic assemblies a colorful, wear-resistant finish." + icon = 'icons/obj/integrated_electronics/electronic_tools.dmi' + icon_state = "detailer" + item_flags = NOBLUDGEON + w_class = ITEMSIZE_SMALL + var/detail_color = COLOR_ASSEMBLY_WHITE + var/list/color_list = list( + "black" = COLOR_ASSEMBLY_BLACK, + "machine gray" = COLOR_ASSEMBLY_BGRAY, + "white" = COLOR_ASSEMBLY_WHITE, + "red" = COLOR_ASSEMBLY_RED, + "orange" = COLOR_ASSEMBLY_ORANGE, + "beige" = COLOR_ASSEMBLY_BEIGE, + "brown" = COLOR_ASSEMBLY_BROWN, + "gold" = COLOR_ASSEMBLY_GOLD, + "yellow" = COLOR_ASSEMBLY_YELLOW, + "gurkha" = COLOR_ASSEMBLY_GURKHA, + "light green" = COLOR_ASSEMBLY_LGREEN, + "green" = COLOR_ASSEMBLY_GREEN, + "light blue" = COLOR_ASSEMBLY_LBLUE, + "blue" = COLOR_ASSEMBLY_BLUE, + "purple" = COLOR_ASSEMBLY_PURPLE, + "hot pink" = COLOR_ASSEMBLY_HOT_PINK + ) + +/obj/item/device/integrated_electronics/detailer/initialize() + update_icon() + return ..() + +/obj/item/device/integrated_electronics/detailer/update_icon() + cut_overlays() + var/mutable_appearance/detail_overlay = mutable_appearance('icons/obj/integrated_electronics/electronic_tools.dmi', "detailer-color") + detail_overlay.color = detail_color + add_overlay(detail_overlay) + +/obj/item/device/integrated_electronics/detailer/attack_self(mob/user) + var/color_choice = input(user, "Select color.", "Assembly Detailer", detail_color) as null|anything in color_list + if(!color_list[color_choice]) + return + if(!in_range(src, user)) + return + detail_color = color_list[color_choice] + update_icon() diff --git a/code/modules/integrated_electronics/core/helpers.dm b/code/modules/integrated_electronics/core/helpers.dm index e31b26fbb1..8af8f11fba 100644 --- a/code/modules/integrated_electronics/core/helpers.dm +++ b/code/modules/integrated_electronics/core/helpers.dm @@ -1,7 +1,8 @@ /obj/item/integrated_circuit/proc/setup_io(var/list/io_list, var/io_type, var/list/io_default_list) var/list/io_list_copy = io_list.Copy() io_list.Cut() - var/i = 0 + var/i = 1 + for(var/io_entry in io_list_copy) var/default_data = null var/io_type_override = null @@ -13,10 +14,10 @@ io_type_override = io_list_copy[io_entry] if(io_type_override) - // world << "io_type_override is now [io_type_override] on [src]." io_list.Add(new io_type_override(src, io_entry, default_data)) else io_list.Add(new io_type(src, io_entry, default_data)) + i++ /obj/item/integrated_circuit/proc/set_pin_data(var/pin_type, var/pin_number, datum/new_data) if (istype(new_data) && !isweakref(new_data)) diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm index 08a3152908..d612bd7211 100644 --- a/code/modules/integrated_electronics/core/integrated_circuit.dm +++ b/code/modules/integrated_electronics/core/integrated_circuit.dm @@ -330,6 +330,7 @@ a creative player the means to solve many problems. Circuits are held inside an to_chat(usr, "\The [src] seems to be permanently attached to the case.") return var/obj/item/device/electronic_assembly/ea = loc + power_fail() disconnect_all() var/turf/T = get_turf(src) forceMove(T) @@ -394,3 +395,9 @@ a creative player the means to solve many problems. Circuits are held inside an O.disconnect() for(var/datum/integrated_io/activate/A in activators) A.disconnect() + +/obj/item/integrated_circuit/proc/on_anchored() + return + +/obj/item/integrated_circuit/proc/on_unanchored() + return \ No newline at end of file diff --git a/code/modules/integrated_electronics/core/pins.dm b/code/modules/integrated_electronics/core/pins.dm index 8621e2b7ed..ef6f0a6dbc 100644 --- a/code/modules/integrated_electronics/core/pins.dm +++ b/code/modules/integrated_electronics/core/pins.dm @@ -28,7 +28,7 @@ D [1]/ || /datum/integrated_io/New(var/newloc, var/name, var/new_data) ..() src.name = name - if(new_data) + if(!isnull(new_data)) src.data = new_data holder = newloc if(!istype(holder)) diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm index 794755b02c..fb9bfb5095 100644 --- a/code/modules/integrated_electronics/core/printer.dm +++ b/code/modules/integrated_electronics/core/printer.dm @@ -2,16 +2,17 @@ /obj/item/device/integrated_circuit_printer name = "integrated circuit printer" desc = "A portable(ish) machine made to print tiny modular circuitry out of metal." - icon = 'icons/obj/electronic_assemblies.dmi' + icon = 'icons/obj/integrated_electronics/electronic_tools.dmi' icon_state = "circuit_printer" w_class = ITEMSIZE_LARGE var/metal = 0 var/max_metal = 100 var/metal_per_sheet = 10 // One sheet equals this much metal. + var/debug = FALSE // If true, metal is infinite. var/upgraded = FALSE // When hit with an upgrade disk, will turn true, allowing it to print the higher tier circuits. - var/can_clone = FALSE // Same for above, but will allow the printer to duplicate a specific assembly. - var/static/list/recipe_list = list() + var/can_clone = FALSE // Same for above, but will allow the printer to duplicate a specific assembly. (Not implemented) +// var/static/list/recipe_list = list() var/current_category = null var/obj/item/device/electronic_assembly/assembly_to_clone = null @@ -19,67 +20,32 @@ upgraded = TRUE can_clone = TRUE -/obj/item/device/integrated_circuit_printer/initialize() - . = ..() - if(!recipe_list.len) - // Unfortunately this needed a lot of loops, but it should only be run once at init. - - // First loop is to seperate the actual circuits from base circuits. - var/list/circuits_to_use = list() - for(var/obj/item/integrated_circuit/IC in all_integrated_circuits) - if((IC.spawn_flags & IC_SPAWN_DEFAULT) || (IC.spawn_flags & IC_SPAWN_RESEARCH)) - circuits_to_use.Add(IC) - - // Second loop is to find all categories. - var/list/found_categories = list() - for(var/obj/item/integrated_circuit/IC in circuits_to_use) - if(!(IC.category_text in found_categories)) - found_categories.Add(IC.category_text) - - // Third loop is to initialize lists by category names, then put circuits matching the category inside. - for(var/category in found_categories) - recipe_list[category] = list() - var/list/current_list = recipe_list[category] - for(var/obj/item/integrated_circuit/IC in circuits_to_use) - if(IC.category_text == category) - current_list.Add(IC) - - // Now for non-circuit things. - var/list/assembly_list = list() - assembly_list.Add( - new /obj/item/device/electronic_assembly(null), - new /obj/item/device/electronic_assembly/medium(null), - new /obj/item/device/electronic_assembly/large(null), - new /obj/item/device/electronic_assembly/drone(null), - new /obj/item/weapon/implant/integrated_circuit(null), - new /obj/item/device/assembly/electronic_assembly(null) - ) - recipe_list["Assemblies"] = assembly_list - - var/list/tools_list = list() - tools_list.Add( - new /obj/item/device/integrated_electronics/wirer(null), - new /obj/item/device/integrated_electronics/debugger(null) - ) - recipe_list["Tools"] = tools_list - +/obj/item/device/integrated_circuit_printer/debug + name = "fractal integrated circuit printer" + desc = "A portable(ish) machine that makes modular circuitry seemingly out of thin air." + upgraded = TRUE + can_clone = TRUE + debug = TRUE /obj/item/device/integrated_circuit_printer/attackby(var/obj/item/O, var/mob/user) if(istype(O,/obj/item/stack/material)) var/obj/item/stack/material/stack = O if(stack.material.name == DEFAULT_WALL_MATERIAL) + if(debug) + to_chat(user, span("warning", "\The [src] does not need any material.")) + return var/num = min((max_metal - metal) / metal_per_sheet, stack.amount) if(num < 1) - to_chat(user, "\The [src] is too full to add more metal.") + to_chat(user, span("warning", "\The [src] is too full to add more metal.")) return if(stack.use(num)) - to_chat(user, "You add [num] sheet\s to \the [src].") + to_chat(user, span("notice", "You add [num] sheet\s to \the [src].")) metal += num * metal_per_sheet interact(user) return TRUE if(istype(O,/obj/item/integrated_circuit)) - to_chat(user, "You insert the circuit into \the [src]. ") + to_chat(user, span("notice", "You insert the circuit into \the [src].")) user.unEquip(O) metal = min(metal + O.w_class, max_metal) qdel(O) @@ -88,18 +54,18 @@ if(istype(O,/obj/item/weapon/disk/integrated_circuit/upgrade/advanced)) if(upgraded) - to_chat(user, "\The [src] already has this upgrade. ") + to_chat(user, span("warning", "\The [src] already has this upgrade.")) return TRUE - to_chat(user, "You install \the [O] into \the [src]. ") + to_chat(user, span("notice", "You install \the [O] into \the [src].")) upgraded = TRUE interact(user) return TRUE if(istype(O,/obj/item/weapon/disk/integrated_circuit/upgrade/clone)) if(can_clone) - to_chat(user, "\The [src] already has this upgrade. ") + to_chat(user, span("warning", "\The [src] already has this upgrade.")) return TRUE - to_chat(user, "You install \the [O] into \the [src]. ") + to_chat(user, span("notice", "You install \the [O] into \the [src].")) can_clone = TRUE interact(user) return TRUE @@ -114,18 +80,21 @@ var/window_width = 500 if(isnull(current_category)) - current_category = recipe_list[1] + current_category = SScircuit.circuit_fabricator_recipe_list[1] var/HTML = "

Integrated Circuit Printer


" - HTML += "Metal: [metal/metal_per_sheet]/[max_metal/metal_per_sheet] sheets.
" - HTML += "Circuits available: [upgraded ? "Regular":"Advanced"]." - HTML += "Assembly Cloning: [can_clone ? "Available": "Unavailable"]." + if(!debug) + HTML += "Metal: [metal/metal_per_sheet]/[max_metal/metal_per_sheet] sheets.
" + else + HTML += "Metal: INFINITY.
" + HTML += "Circuits available: [upgraded ? "Advanced":"Regular"].
" + HTML += "Assembly Cloning: [can_clone ? "Available": "Unavailable"].
" if(assembly_to_clone) - HTML += "Assembly '[assembly_to_clone.name]' loaded." + HTML += "Assembly '[assembly_to_clone.name]' loaded.
" HTML += "Crossed out circuits mean that the printer is not sufficentally upgraded to create that circuit.
" HTML += "
" HTML += "Categories:" - for(var/category in recipe_list) + for(var/category in SScircuit.circuit_fabricator_recipe_list) if(category != current_category) HTML += " \[[category]\] " else // Bold the button if it's already selected. @@ -133,20 +102,22 @@ HTML += "
" HTML += "

[current_category]

" - var/list/current_list = recipe_list[current_category] - for(var/obj/O in current_list) + var/list/current_list = SScircuit.circuit_fabricator_recipe_list[current_category] + for(var/path in current_list) + var/obj/O = path var/can_build = TRUE - if(istype(O, /obj/item/integrated_circuit)) - var/obj/item/integrated_circuit/IC = O - if((IC.spawn_flags & IC_SPAWN_RESEARCH) && (!(IC.spawn_flags & IC_SPAWN_DEFAULT)) && !upgraded) + if(ispath(path, /obj/item/integrated_circuit)) + var/obj/item/integrated_circuit/IC = path + if((initial(IC.spawn_flags) & IC_SPAWN_RESEARCH) && (!(initial(IC.spawn_flags) & IC_SPAWN_DEFAULT)) && !upgraded) can_build = FALSE if(can_build) - HTML += "\[[O.name]\]: [O.desc]
" + HTML += "\[[initial(O.name)]\]: [initial(O.desc)]
" else - HTML += "\[[O.name]\]: [O.desc]
" + HTML += "\[[initial(O.name)]\]: [initial(O.desc)]
" user << browse(jointext(HTML, null), "window=integrated_printer;size=[window_width]x[window_height];border=1;can_resize=1;can_close=1;can_minimize=1") + /obj/item/device/integrated_circuit_printer/Topic(href, href_list) if(..()) return 1 @@ -162,31 +133,36 @@ return 1 var/cost = 1 - + if(isnull(current_category)) - current_category = recipe_list[1] + current_category = SScircuit.circuit_fabricator_recipe_list[1] if(ispath(build_type, /obj/item/device/electronic_assembly)) var/obj/item/device/electronic_assembly/E = build_type cost = round( (initial(E.max_complexity) + initial(E.max_components) ) / 4) else var/obj/item/I = build_type cost = initial(I.w_class) - if(!(locate(build_type) in recipe_list[current_category])) + if(!build_type in SScircuit.circuit_fabricator_recipe_list[current_category]) return - if(metal - cost < 0) - to_chat(usr, "You need [cost] metal to build that!.") - return 1 - metal -= cost - new build_type(get_turf(loc)) + if(!debug) + if(metal - cost < 0) + to_chat(usr, "You need [cost] metal to build that!.") + return 1 + metal -= cost + var/obj/item/built = new build_type(get_turf(loc)) + usr.put_in_hands(built) + to_chat(usr, "[capitalize(built.name)] printed.") + playsound(src, 'sound/items/jaws_pry.ogg', 50, TRUE) interact(usr) + // FUKKEN UPGRADE DISKS /obj/item/weapon/disk/integrated_circuit/upgrade name = "integrated circuit printer upgrade disk" desc = "Install this into your integrated circuit printer to enhance it." - icon = 'icons/obj/electronic_assemblies.dmi' + icon = 'icons/obj/integrated_electronics/electronic_tools.dmi' icon_state = "upgrade_disk" item_state = "card-id" w_class = ITEMSIZE_SMALL diff --git a/code/modules/integrated_electronics/core/special_pins/color_pin.dm b/code/modules/integrated_electronics/core/special_pins/color_pin.dm index 2d20560fb6..e58d2d8e75 100644 --- a/code/modules/integrated_electronics/core/special_pins/color_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/color_pin.dm @@ -3,7 +3,7 @@ name = "color pin" /datum/integrated_io/color/ask_for_pin_data(mob/user) - var/new_data = input("Please select a color.","[src] color writing") as null|color + var/new_data = input("Please select a color.","[src] color writing", data ? data : "#000000") as null|color if(holder.check_interactivity(user) ) to_chat(user, "You input a new color into the pin.") write_data_to_pin(new_data) diff --git a/code/modules/integrated_electronics/core/tools.dm b/code/modules/integrated_electronics/core/tools.dm index c9d1c89e2b..eb42d92dda 100644 --- a/code/modules/integrated_electronics/core/tools.dm +++ b/code/modules/integrated_electronics/core/tools.dm @@ -9,11 +9,11 @@ desc = "It's a small wiring tool, with a wire roll, electric soldering iron, wire cutter, and more in one package. \ The wires used are generally useful for small electronics, such as circuitboards and breadboards, as opposed to larger wires \ used for power or data transmission." - icon = 'icons/obj/electronic_assemblies.dmi' + icon = 'icons/obj/integrated_electronics/electronic_tools.dmi' icon_state = "wirer-wire" item_state = "wirer" flags = CONDUCT - w_class = 2 + w_class = ITEMSIZE_SMALL var/datum/integrated_io/selected_io = null var/mode = WIRE @@ -108,7 +108,7 @@ name = "circuit debugger" desc = "This small tool allows one working with custom machinery to directly set data to a specific pin, useful for writing \ settings to specific circuits, or for debugging purposes. It can also pulse activation pins." - icon = 'icons/obj/electronic_assemblies.dmi' + icon = 'icons/obj/integrated_electronics/electronic_tools.dmi' icon_state = "debugger" flags = CONDUCT w_class = 2 @@ -252,7 +252,7 @@ /obj/item/weapon/storage/bag/circuits name = "circuit kit" desc = "This kit's essential for any circuitry projects." - icon = 'icons/obj/electronic_assemblies.dmi' + icon = 'icons/obj/integrated_electronics/electronic_misc.dmi' icon_state = "circuit_kit" w_class = 3 display_contents_with_number = 0 diff --git a/code/modules/integrated_electronics/passive/power.dm b/code/modules/integrated_electronics/passive/power.dm index 0a516e360a..829027303c 100644 --- a/code/modules/integrated_electronics/passive/power.dm +++ b/code/modules/integrated_electronics/passive/power.dm @@ -6,7 +6,7 @@ origin_tech = list(TECH_POWER = 2, TECH_ENGINEERING = 2, TECH_DATA = 2) category_text = "Power - Passive" -/obj/item/integrated_circuit/passive/power/proc/make_energy() +/obj/item/integrated_circuit/passive/power/proc/handle_passive_energy() return // For calculators. @@ -20,7 +20,7 @@ spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH var/max_power = 1 -/obj/item/integrated_circuit/passive/power/solar_cell/make_energy() +/obj/item/integrated_circuit/passive/power/solar_cell/handle_passive_energy() var/turf/T = get_turf(src) var/light_amount = T ? T.get_lumcount() : 0 var/adjusted_power = max(max_power * light_amount, 0) @@ -39,7 +39,7 @@ spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH var/is_charge=0 -/obj/item/integrated_circuit/passive/power/starter/make_energy() +/obj/item/integrated_circuit/passive/power/starter/handle_passive_energy() if(assembly.battery) if(assembly.battery.charge) if(!is_charge) @@ -67,7 +67,7 @@ return FALSE // Robots and dead people don't have a metabolism. return TRUE -/obj/item/integrated_circuit/passive/power/metabolic_siphon/make_energy() +/obj/item/integrated_circuit/passive/power/metabolic_siphon/handle_passive_energy() var/mob/living/carbon/human/host = null if(assembly && istype(assembly, /obj/item/device/electronic_assembly/implant)) var/obj/item/device/electronic_assembly/implant/implant_assembly = assembly @@ -135,7 +135,7 @@ set_pin_data(IC_OUTPUT, 1, reagents.total_volume) push_data() -/obj/item/integrated_circuit/passive/power/chemical_cell/make_energy() +/obj/item/integrated_circuit/passive/power/chemical_cell/handle_passive_energy() if(assembly) for(var/I in fuel) if((assembly.battery.maxcharge-assembly.battery.charge) / CELLRATE > fuel[I]) @@ -156,7 +156,7 @@ spawn_flags = IC_SPAWN_RESEARCH power_amount = 2000 -/obj/item/integrated_circuit/passive/power/relay/make_energy() +/obj/item/integrated_circuit/passive/power/relay/handle_passive_energy() if(!assembly) return var/area/A = get_area(src) @@ -164,3 +164,78 @@ if(A.powered(EQUIP) && assembly.give_power(power_amount)) A.use_power(power_amount, EQUIP) // give_power() handles CELLRATE on its own. + +// Interacts with the powernet. +// Now you can make your own power generation (or poor man's powersink). + +/obj/item/integrated_circuit/passive/power/powernet + name = "power network interface" + desc = "Gives or takes power from a wire underneath the machine." + icon_state = "powernet" + extended_desc = "The assembly must be anchored, with a wrench, and a wire node must be avaiable directly underneath.
\ + The first pin determines if power is moved at all. The second pin, if true, will draw from the powernet to charge the assembly's \ + cell, otherwise it will give power from the cell to the powernet." + complexity = 20 + inputs = list( + "active" = IC_PINTYPE_BOOLEAN, + "draw power" = IC_PINTYPE_BOOLEAN + ) + outputs = list( + "power in grid" = IC_PINTYPE_NUMBER, + "surplus power" = IC_PINTYPE_NUMBER, + "load" = IC_PINTYPE_NUMBER + ) + activators = list() + spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH + origin_tech = list(TECH_ENGINEERING = 2, TECH_POWER = 2) + var/obj/machinery/power/circuit_io/IO = null // Dummy power machine to move energy in/out without a bunch of code duplication. + var/throughput = 10000 // Give/take up to 10kW. + +/obj/item/integrated_circuit/passive/power/powernet/initialize() + IO = new(src) + return ..() + +/obj/item/integrated_circuit/passive/power/powernet/Destroy() + qdel(IO) + return ..() + +/obj/item/integrated_circuit/passive/power/powernet/on_anchored() + IO.connect_to_network() + +/obj/item/integrated_circuit/passive/power/powernet/on_unanchored() + IO.disconnect_from_network() + +/obj/item/integrated_circuit/passive/power/powernet/handle_passive_energy() + if(assembly && assembly.anchored && assembly.battery) + var/should_act = get_pin_data(IC_INPUT, 1) // Even if this is false, we still need to update the output pins with powernet information. + var/drawing = get_pin_data(IC_INPUT, 2) + + if(should_act) // We're gonna give or take from the net. + if(drawing) + var/to_transfer = min(throughput, assembly.battery.amount_missing() / CELLRATE) // So we don't need to draw 10kW if the cell needs much less. + var/amount = IO.draw_power(to_transfer) + assembly.give_power(amount) + else + var/amount = assembly.draw_power(throughput) + IO.add_avail(amount) + + set_pin_data(IC_OUTPUT, 1, IO.avail()) + set_pin_data(IC_OUTPUT, 2, IO.surplus()) + set_pin_data(IC_OUTPUT, 3, IO.viewload()) + +// Internal power machine for interacting with the powernet. +// It needs a bit of special code since base /machinery/power assumes loc will be a tile. +/obj/machinery/power/circuit_io + name = "embedded electrical I/O" + +/obj/machinery/power/circuit_io/connect_to_network() + var/turf/T = get_turf(src) + if(!T || !istype(T)) + return FALSE + + var/obj/structure/cable/C = T.get_cable_node() + if(!C || !C.powernet) + return FALSE + + C.powernet.add_machine(src) + return TRUE diff --git a/code/modules/integrated_electronics/subtypes/built_in.dm b/code/modules/integrated_electronics/subtypes/built_in.dm index 24eac86802..afb804c797 100644 --- a/code/modules/integrated_electronics/subtypes/built_in.dm +++ b/code/modules/integrated_electronics/subtypes/built_in.dm @@ -1,7 +1,7 @@ /obj/item/integrated_circuit/built_in name = "integrated circuit" desc = "It's a tiny chip! This one doesn't seem to do much, however." - icon = 'icons/obj/electronic_assemblies.dmi' + icon = 'icons/obj/integrated_electronics/electronic_setups.dmi' icon_state = "template" size = -1 w_class = ITEMSIZE_TINY @@ -25,4 +25,15 @@ /obj/item/integrated_circuit/built_in/device_output/do_work() if(istype(assembly, /obj/item/device/electronic_assembly/device)) var/obj/item/device/electronic_assembly/device/device = assembly - device.holder.pulse() \ No newline at end of file + device.holder.pulse() + +// Triggered when clothing assembly's hud button is clicked (or used inhand). +/obj/item/integrated_circuit/built_in/action_button + name = "external trigger circuit" + desc = "A built in chip that outputs a pulse when an external control event occurs." + extended_desc = "This outputs a pulse if the assembly's HUD button is clicked while the assembly is closed." + complexity = 0 + activators = list("on activation" = IC_PINTYPE_PULSE_OUT) + +/obj/item/integrated_circuit/built_in/action_button/do_work() + activate_pin(1) \ No newline at end of file diff --git a/code/modules/integrated_electronics/subtypes/converters.dm b/code/modules/integrated_electronics/subtypes/converters.dm index b9f5c912d4..0ec00be317 100644 --- a/code/modules/integrated_electronics/subtypes/converters.dm +++ b/code/modules/integrated_electronics/subtypes/converters.dm @@ -318,5 +318,77 @@ set_pin_data(IC_OUTPUT, 1, x1 - x2) set_pin_data(IC_OUTPUT, 2, y1 - y2) + push_data() + activate_pin(2) + +/obj/item/integrated_circuit/converter/stringlength + name = "len circuit" + desc = "This circuit will return the number of characters in a string." + complexity = 1 + inputs = list( + "string" = IC_PINTYPE_STRING + ) + outputs = list( + "length" = IC_PINTYPE_NUMBER + ) + activators = list("get length" = IC_PINTYPE_PULSE_IN, "on acquisition" = IC_PINTYPE_PULSE_OUT) + spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH + +/obj/item/integrated_circuit/converter/stringlength/do_work() + set_pin_data(IC_OUTPUT, 1, length(get_pin_data(IC_INPUT, 1))) + push_data() + + activate_pin(2) + +/obj/item/integrated_circuit/converter/hsv2hex + name = "hsv to hexadecimal converter" + desc = "This circuit can convert a HSV (Hue, Saturation, and Value) color to a Hexadecimal RGB color." + extended_desc = "The first pin controls tint (0-359), the second pin controls how intense the tint is (0-255), \ + and the third controls how bright the tint is (0 for black, 127 for normal, 255 for white)." + icon_state = "hsv-hex" + inputs = list( + "hue" = IC_PINTYPE_NUMBER, + "saturation" = IC_PINTYPE_NUMBER, + "value" = IC_PINTYPE_NUMBER + ) + outputs = list("hexadecimal rgb" = IC_PINTYPE_COLOR) + spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH + +/obj/item/integrated_circuit/converter/hsv2hex/do_work() + var/result = null + pull_data() + var/hue = get_pin_data(IC_INPUT, 1) + var/saturation = get_pin_data(IC_INPUT, 2) + var/value = get_pin_data(IC_INPUT, 3) + if(isnum(hue) && isnum(saturation) && isnum(value)) + result = HSVtoRGB(hsv(AngleToHue(hue),saturation,value)) + + set_pin_data(IC_OUTPUT, 1, result) + push_data() + activate_pin(2) + +/obj/item/integrated_circuit/converter/rgb2hex + name = "rgb to hexadecimal converter" + desc = "This circuit can convert a RGB (Red, Green, Blue) color to a Hexadecimal RGB color." + extended_desc = "The first pin controls red amount, the second pin controls green amount, and the third controls blue amount. They all go from 0-255." + icon_state = "rgb-hex" + inputs = list( + "red" = IC_PINTYPE_NUMBER, + "green" = IC_PINTYPE_NUMBER, + "blue" = IC_PINTYPE_NUMBER + ) + outputs = list("hexadecimal rgb" = IC_PINTYPE_COLOR) + spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH + +/obj/item/integrated_circuit/converter/rgb2hex/do_work() + var/result = null + pull_data() + var/red = get_pin_data(IC_INPUT, 1) + var/green = get_pin_data(IC_INPUT, 2) + var/blue = get_pin_data(IC_INPUT, 3) + if(isnum(red) && isnum(green) && isnum(blue)) + result = rgb(red, green, blue) + + set_pin_data(IC_OUTPUT, 1, result) push_data() activate_pin(2) \ No newline at end of file diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm index ac9a0e13f9..c2e640403a 100644 --- a/code/modules/integrated_electronics/subtypes/input.dm +++ b/code/modules/integrated_electronics/subtypes/input.dm @@ -53,7 +53,7 @@ power_draw_per_use = 4 /obj/item/integrated_circuit/input/numberpad/ask_for_input(mob/user) - var/new_input = input(user, "Enter a number, please.","Number pad") as null|num + var/new_input = input(user, "Enter a number, please.","Number pad", get_pin_data(IC_OUTPUT, 1)) as null|num if(isnum(new_input) && CanInteract(user, physical_state)) set_pin_data(IC_OUTPUT, 1, new_input) push_data() @@ -72,18 +72,37 @@ power_draw_per_use = 4 /obj/item/integrated_circuit/input/textpad/ask_for_input(mob/user) - var/new_input = input(user, "Enter some words, please.","Number pad") as null|text + var/new_input = input(user, "Enter some words, please.","Number pad", get_pin_data(IC_OUTPUT, 1)) as null|text if(istext(new_input) && CanInteract(user, physical_state)) set_pin_data(IC_OUTPUT, 1, new_input) push_data() activate_pin(1) +/obj/item/integrated_circuit/input/colorpad + name = "color pad" + desc = "This small color pad allows someone to input a hexadecimal color into the system." + icon_state = "colorpad" + complexity = 2 + can_be_asked_input = 1 + inputs = list() + outputs = list("color entered" = IC_PINTYPE_COLOR) + activators = list("on entered" = IC_PINTYPE_PULSE_IN) + spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH + power_draw_per_use = 4 + +/obj/item/integrated_circuit/input/colorpad/ask_for_input(mob/user) + var/new_color = input(user, "Enter a color, please.", "Color pad", get_pin_data(IC_OUTPUT, 1)) as color|null + if(new_color && CanInteract(user, physical_state)) + set_pin_data(IC_OUTPUT, 1, new_color) + push_data() + activate_pin(1) + /obj/item/integrated_circuit/input/med_scanner name = "integrated medical analyser" desc = "A very small version of the common medical analyser. This allows the machine to know how healthy someone is." icon_state = "medscan" complexity = 4 - inputs = list("\ target") + inputs = list("target" = IC_PINTYPE_REF) outputs = list( "total health %" = IC_PINTYPE_NUMBER, "total missing health" = IC_PINTYPE_NUMBER @@ -117,7 +136,7 @@ This type is much more precise, allowing the machine to know much more about the target than a normal analyzer." icon_state = "medscan_adv" complexity = 12 - inputs = list("\ target") + inputs = list("target" = IC_PINTYPE_REF) outputs = list( "total health %" = IC_PINTYPE_NUMBER, "total missing health" = IC_PINTYPE_NUMBER, @@ -159,7 +178,7 @@ relative coordinates, total amount of reagents, and maximum amount of reagents of the referenced object." icon_state = "video_camera" complexity = 6 - inputs = list("\ target" = IC_PINTYPE_REF) + inputs = list("target" = IC_PINTYPE_REF) outputs = list( "name" = IC_PINTYPE_STRING, "description" = IC_PINTYPE_STRING, @@ -262,7 +281,7 @@ complexity = 6 name = "advanced locator" desc = "This is needed for certain devices that demand a reference for a target to act upon. This type locates something \ - that is standing in given radius of up to 8 meters" + that is standing in given radius of up to 7 meters" extended_desc = "The first pin requires a ref to a kind of object that you want the locator to acquire. This means that it will \ give refs to nearby objects that are similar to given sample. If this pin is a string, the locator will search for\ item by matching desired text in name + description. If more than one valid object is found nearby, it will choose one of them at \ @@ -277,7 +296,7 @@ /obj/item/integrated_circuit/input/advanced_locator/on_data_written() var/rad = get_pin_data(IC_INPUT, 2) if(isnum(rad)) - rad = Clamp(rad, 0, 8) + rad = Clamp(rad, 0, 7) radius = rad /obj/item/integrated_circuit/input/advanced_locator/do_work() diff --git a/code/modules/integrated_electronics/subtypes/output.dm b/code/modules/integrated_electronics/subtypes/output.dm index c0eb3d5338..99a6c247a9 100644 --- a/code/modules/integrated_electronics/subtypes/output.dm +++ b/code/modules/integrated_electronics/subtypes/output.dm @@ -78,7 +78,25 @@ else if(assembly) assembly.set_light(0) - power_draw_idle = light_toggled ? light_brightness * 2 : 0 + power_draw_idle = light_toggled ? light_brightness * light_brightness : 0 // Should be the same draw as regular lights. + +/obj/item/integrated_circuit/output/light/power_fail() // Turns off the flashlight if there's no power left. + light_toggled = FALSE + update_lighting() + +/obj/item/integrated_circuit/output/light/advanced + name = "advanced light" + desc = "This light can turn on and off on command, in any color, and in various brightness levels." + extended_desc = "The brightness is limited to values between 1 and 6." + icon_state = "light_adv" + complexity = 8 + inputs = list( + "color" = IC_PINTYPE_COLOR, + "brightness" = IC_PINTYPE_NUMBER + ) + outputs = list() + spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH + origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3) /obj/item/integrated_circuit/output/light/advanced/update_lighting() var/new_color = get_pin_data(IC_INPUT, 1) @@ -91,42 +109,9 @@ ..() -/obj/item/integrated_circuit/output/light/power_fail() // Turns off the flashlight if there's no power left. - light_toggled = FALSE - update_lighting() - -/obj/item/integrated_circuit/output/light/advanced - name = "advanced light" - desc = "This light can turn on and off on command, in any color, and in various brightness levels." - icon_state = "light_adv" - complexity = 8 - inputs = list( - "color" = IC_PINTYPE_COLOR, - "brightness" = IC_PINTYPE_NUMBER - ) - outputs = list() - spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH - origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3) - /obj/item/integrated_circuit/output/light/advanced/on_data_written() update_lighting() -/obj/item/integrated_circuit/output/sound - name = "speaker circuit" - desc = "A miniature speaker is attached to this component." - icon_state = "speaker" - complexity = 8 - cooldown_per_use = 4 SECONDS - inputs = list( - "sound ID" = IC_PINTYPE_STRING, - "volume" = IC_PINTYPE_NUMBER, - "frequency" = IC_PINTYPE_BOOLEAN - ) - outputs = list() - activators = list("play sound" = IC_PINTYPE_PULSE_IN) - power_draw_per_use = 20 - var/list/sounds = list() - /obj/item/integrated_circuit/output/text_to_speech name = "text-to-speech circuit" desc = "A miniature speaker is attached to this component." @@ -146,6 +131,22 @@ var/obj/O = assembly ? loc : assembly audible_message("\icon[O] \The [O.name] states, \"[text]\"") +/obj/item/integrated_circuit/output/sound + name = "speaker circuit" + desc = "A miniature speaker is attached to this component." + icon_state = "speaker" + complexity = 8 + cooldown_per_use = 4 SECONDS + inputs = list( + "sound ID" = IC_PINTYPE_STRING, + "volume" = IC_PINTYPE_NUMBER, + "frequency" = IC_PINTYPE_BOOLEAN + ) + outputs = list() + activators = list("play sound" = IC_PINTYPE_PULSE_IN) + power_draw_per_use = 20 + var/list/sounds = list() + /obj/item/integrated_circuit/output/sound/New() ..() extended_desc = list() @@ -337,3 +338,147 @@ /obj/item/integrated_circuit/output/led/pink name = "pink LED" led_color = COLOR_PINK + + + +/obj/item/integrated_circuit/output/holographic_projector + name = "holographic projector" + desc = "This projects a holographic copy of an object." + extended_desc = "If the assembly moves, the hologram will also move.
\ + Position coordinates are relative to the assembly, and are capped between -7 and 7.
\ + The assembly must be able to see the object to make a holographic copy of it.
\ + Scaling is capped between -2 and 2.
\ + The rotation pin uses degrees.
\ + Imitated object cannot be changed while projecting. Position, \ + scale, and rotation can be updated without restarting by pulsing the update hologram pin." + complexity = 40 + icon_state = "holo_projector" + inputs = list( + "project hologram" = IC_PINTYPE_BOOLEAN, + "object to copy" = IC_PINTYPE_REF, + "hologram color" = IC_PINTYPE_COLOR, + "hologram X pos" = IC_PINTYPE_NUMBER, + "hologram Y pos" = IC_PINTYPE_NUMBER, + "hologram scale" = IC_PINTYPE_NUMBER, + "hologram rotation" = IC_PINTYPE_NUMBER + ) + inputs_default = list( + "3" = "#7DB4E1", + "4" = 0, + "5" = 0, + "6" = 1, + "7" = 0 + ) + outputs = list() + activators = list( + "update hologram" = IC_PINTYPE_PULSE_IN, + "on drawn hologram" = IC_PINTYPE_PULSE_OUT + ) + power_draw_idle = 0 // Raises to 500 when active, like a regular holopad. + spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH + var/obj/effect/overlay/holographic/hologram = null // Reference to the hologram effect, and also used to see if component is active. + var/icon/holo_base = null // Uncolored holographic icon. +// var/datum/beam/holo_beam = null // A visual effect, to make it easy to know where a hologram is coming from. + // It is commented out due to picking up the assembly killing the beam. + +/obj/item/integrated_circuit/output/holographic_projector/Destroy() + destroy_hologram() + return ..() + +/obj/item/integrated_circuit/output/holographic_projector/do_work() + var/toggled = get_pin_data(IC_INPUT, 1) + + if(hologram) // Currently active. + if(!toggled) // Being turned off. + destroy_hologram() + + else // Updating position/dir/etc. + update_hologram() + + else // Currently not active. + if(toggled) // We're gonna turn on. + create_hologram() + + activate_pin(2) + +// Updates some changable aspects of the hologram like the size or position. +/obj/item/integrated_circuit/output/holographic_projector/proc/update_hologram() + if(!hologram) + return FALSE + + var/holo_scale = get_pin_data(IC_INPUT, 6) + var/holo_rotation = get_pin_data(IC_INPUT, 7) + + if(!isnum(holo_scale) || !isnum(holo_rotation) ) + return FALSE // Invalid. + + hologram.adjust_scale(between(-2, holo_scale, 2) ) + hologram.adjust_rotation(holo_rotation) + update_hologram_position() + + return TRUE + +// This is a seperate function because other things besides do_work() might warrant updating position, like movement, without bothering with other parts. +/obj/item/integrated_circuit/output/holographic_projector/proc/update_hologram_position() + var/holo_x = get_pin_data(IC_INPUT, 4) + var/holo_y = get_pin_data(IC_INPUT, 5) + if(!isnum(holo_x) || !isnum(holo_y) ) + return FALSE + + holo_x = between(-7, holo_x, 7) + holo_y = between(-7, holo_y, 7) + + var/turf/T = get_turf(src) + if(T) + // Absolute coordinates. + var/holo_abs_x = T.x + holo_x + var/holo_abs_y = T.y + holo_y + var/turf/W = locate(holo_abs_x, holo_abs_y, T.z) + if(W) // Make sure we're not out of bounds. + hologram.forceMove(W) + return TRUE + return FALSE + +/obj/item/integrated_circuit/output/holographic_projector/proc/create_hologram() + var/atom/movable/AM = get_pin_data_as_type(IC_INPUT, 2, /atom/movable) + var/holo_color = get_pin_data(IC_INPUT, 3) + + if(istype(AM) && assembly) + if(AM in view(get_turf(src))) // It must be able to 'see' the object it will copy. + hologram = new(src) + var/icon/holo_icon = getHologramIcon(getFlatIcon(AM), no_color = TRUE) + // holo_icon.GrayScale() // So it looks better colored. + if(holo_color) // The color pin should ensure that it is a valid hex. + holo_icon.ColorTone(holo_color) + hologram.icon = holo_icon + hologram.name = "[AM.name] (Hologram)" + update_hologram() + + // holo_beam = assembly.Beam(hologram, icon_state = "holo_beam", time = INFINITY, maxdistance = world.view) + power_draw_idle = 500 + return TRUE + return FALSE + + + +/obj/item/integrated_circuit/output/holographic_projector/proc/destroy_hologram() + hologram.forceMove(src) + qdel(hologram) + +// holo_beam.End() +// qdel_null(holo_beam) + + power_draw_idle = 0 + +/obj/item/integrated_circuit/output/holographic_projector/on_data_written() + if(hologram) + update_hologram() + +/obj/item/integrated_circuit/output/holographic_projector/on_loc_moved(atom/oldloc) + if(hologram) + update_hologram_position() + +/obj/item/integrated_circuit/output/holographic_projector/power_fail() + if(hologram) + destroy_hologram() + set_pin_data(IC_INPUT, 1, FALSE) diff --git a/code/modules/integrated_electronics/~defines/~defines.dm b/code/modules/integrated_electronics/~defines/~defines.dm index 90aa05acf1..a9c68b28af 100644 --- a/code/modules/integrated_electronics/~defines/~defines.dm +++ b/code/modules/integrated_electronics/~defines/~defines.dm @@ -5,9 +5,6 @@ #undef DATA_CHANNEL #undef PULSE_CHANNEL -#undef IC_SPAWN_DEFAULT -//#undef IC_SPAWN_RESEARCH // Research designs depend on this unfortunately. - #undef IC_FORMAT_ANY #undef IC_FORMAT_STRING #undef IC_FORMAT_CHAR diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index f9fca6222f..2a18becdc1 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -106,6 +106,10 @@ /obj/item/weapon/cell/proc/check_charge(var/amount) return (charge >= amount) +// Returns how much charge is missing from the cell, useful to make sure not overdraw from the grid when recharging. +/obj/item/weapon/cell/proc/amount_missing() + return max(maxcharge - charge, 0) + // use power from a cell, returns the amount actually used /obj/item/weapon/cell/proc/use(var/amount) if(rigged && amount > 0) diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 04e63379fc..20e11aa8a3 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -55,6 +55,12 @@ else return 0 +/obj/machinery/power/proc/viewload() + if(powernet) + return powernet.viewload + else + return 0 + /obj/machinery/power/proc/disconnect_terminal() // machines without a terminal will just return, no harm no fowl. return diff --git a/icons/effects/beam.dmi b/icons/effects/beam.dmi index e7f61d605d..4b7e714731 100644 Binary files a/icons/effects/beam.dmi and b/icons/effects/beam.dmi differ diff --git a/icons/mob/ears.dmi b/icons/mob/ears.dmi index a354004708..a8d55c2e92 100644 Binary files a/icons/mob/ears.dmi and b/icons/mob/ears.dmi differ diff --git a/icons/mob/feet.dmi b/icons/mob/feet.dmi index ba1c32c26a..f6df55b5a1 100644 Binary files a/icons/mob/feet.dmi and b/icons/mob/feet.dmi differ diff --git a/icons/mob/hands.dmi b/icons/mob/hands.dmi index cc467f5df7..f9334581ed 100644 Binary files a/icons/mob/hands.dmi and b/icons/mob/hands.dmi differ diff --git a/icons/mob/head.dmi b/icons/mob/head.dmi index a98cb6061c..c3a85e8a2f 100644 Binary files a/icons/mob/head.dmi and b/icons/mob/head.dmi differ diff --git a/icons/mob/items/lefthand_guns.dmi b/icons/mob/items/lefthand_guns.dmi index 3dce22596f..72e9c00465 100644 Binary files a/icons/mob/items/lefthand_guns.dmi and b/icons/mob/items/lefthand_guns.dmi differ diff --git a/icons/mob/items/righthand_guns.dmi b/icons/mob/items/righthand_guns.dmi index f13fb1c997..f3f75a86ea 100644 Binary files a/icons/mob/items/righthand_guns.dmi and b/icons/mob/items/righthand_guns.dmi differ diff --git a/icons/mob/suit.dmi b/icons/mob/suit.dmi index e45ec90933..5b2bfe8e4f 100644 Binary files a/icons/mob/suit.dmi and b/icons/mob/suit.dmi differ diff --git a/icons/mob/uniform.dmi b/icons/mob/uniform.dmi index a3daa966cf..aa6e8bfb81 100644 Binary files a/icons/mob/uniform.dmi and b/icons/mob/uniform.dmi differ diff --git a/icons/obj/clothing/ears.dmi b/icons/obj/clothing/ears.dmi index a2c81adfbe..77d0b44126 100644 Binary files a/icons/obj/clothing/ears.dmi and b/icons/obj/clothing/ears.dmi differ diff --git a/icons/obj/clothing/glasses.dmi b/icons/obj/clothing/glasses.dmi index 920880e155..8342982785 100644 Binary files a/icons/obj/clothing/glasses.dmi and b/icons/obj/clothing/glasses.dmi differ diff --git a/icons/obj/clothing/gloves.dmi b/icons/obj/clothing/gloves.dmi index 6fa2c8c23b..756eff96ef 100644 Binary files a/icons/obj/clothing/gloves.dmi and b/icons/obj/clothing/gloves.dmi differ diff --git a/icons/obj/clothing/hats.dmi b/icons/obj/clothing/hats.dmi index a369471b51..9928b3cd40 100644 Binary files a/icons/obj/clothing/hats.dmi and b/icons/obj/clothing/hats.dmi differ diff --git a/icons/obj/clothing/shoes.dmi b/icons/obj/clothing/shoes.dmi index c1e4545825..4842ab6240 100644 Binary files a/icons/obj/clothing/shoes.dmi and b/icons/obj/clothing/shoes.dmi differ diff --git a/icons/obj/clothing/suits.dmi b/icons/obj/clothing/suits.dmi index d45dac6e1f..38154ec14a 100644 Binary files a/icons/obj/clothing/suits.dmi and b/icons/obj/clothing/suits.dmi differ diff --git a/icons/obj/clothing/uniforms.dmi b/icons/obj/clothing/uniforms.dmi index 2d8e89049e..d0bb4a6b39 100644 Binary files a/icons/obj/clothing/uniforms.dmi and b/icons/obj/clothing/uniforms.dmi differ diff --git a/icons/obj/electronic_assemblies.dmi b/icons/obj/electronic_assemblies.dmi deleted file mode 100644 index 5799d85866..0000000000 Binary files a/icons/obj/electronic_assemblies.dmi and /dev/null differ diff --git a/icons/obj/integrated_electronics/electronic_components.dmi b/icons/obj/integrated_electronics/electronic_components.dmi new file mode 100644 index 0000000000..129491755e Binary files /dev/null and b/icons/obj/integrated_electronics/electronic_components.dmi differ diff --git a/icons/obj/integrated_electronics/electronic_misc.dmi b/icons/obj/integrated_electronics/electronic_misc.dmi new file mode 100644 index 0000000000..226b82e499 Binary files /dev/null and b/icons/obj/integrated_electronics/electronic_misc.dmi differ diff --git a/icons/obj/integrated_electronics/electronic_setups.dmi b/icons/obj/integrated_electronics/electronic_setups.dmi new file mode 100644 index 0000000000..58ef0903be Binary files /dev/null and b/icons/obj/integrated_electronics/electronic_setups.dmi differ diff --git a/icons/obj/integrated_electronics/electronic_tools.dmi b/icons/obj/integrated_electronics/electronic_tools.dmi new file mode 100644 index 0000000000..975f2fc9a8 Binary files /dev/null and b/icons/obj/integrated_electronics/electronic_tools.dmi differ diff --git a/polaris.dme b/polaris.dme index 96695fcba4..5962661c84 100644 --- a/polaris.dme +++ b/polaris.dme @@ -27,11 +27,13 @@ #include "code\__defines\atmos.dm" #include "code\__defines\callbacks.dm" #include "code\__defines\chemistry.dm" +#include "code\__defines\color.dm" #include "code\__defines\construction.dm" #include "code\__defines\damage_organs.dm" #include "code\__defines\dna.dm" #include "code\__defines\gamemode.dm" #include "code\__defines\holomap.dm" +#include "code\__defines\integrated_circuits.dm" #include "code\__defines\inventory_sizes.dm" #include "code\__defines\items_clothing.dm" #include "code\__defines\lighting.dm" @@ -191,6 +193,7 @@ #include "code\controllers\subsystems\air.dm" #include "code\controllers\subsystems\airflow.dm" #include "code\controllers\subsystems\atoms.dm" +#include "code\controllers\subsystems\circuits.dm" #include "code\controllers\subsystems\garbage.dm" #include "code\controllers\subsystems\holomaps.dm" #include "code\controllers\subsystems\lighting.dm" @@ -1612,12 +1615,16 @@ #include "code\modules\hydroponics\trays\tray_update_icons.dm" #include "code\modules\integrated_electronics\_defines.dm" #include "code\modules\integrated_electronics\core\assemblies.dm" -#include "code\modules\integrated_electronics\core\device.dm" +#include "code\modules\integrated_electronics\core\detailer.dm" #include "code\modules\integrated_electronics\core\helpers.dm" #include "code\modules\integrated_electronics\core\integrated_circuit.dm" #include "code\modules\integrated_electronics\core\pins.dm" #include "code\modules\integrated_electronics\core\printer.dm" #include "code\modules\integrated_electronics\core\tools.dm" +#include "code\modules\integrated_electronics\core\assemblies\clothing.dm" +#include "code\modules\integrated_electronics\core\assemblies\device.dm" +#include "code\modules\integrated_electronics\core\assemblies\generic.dm" +#include "code\modules\integrated_electronics\core\assemblies\implant.dm" #include "code\modules\integrated_electronics\core\special_pins\boolean_pin.dm" #include "code\modules\integrated_electronics\core\special_pins\char_pin.dm" #include "code\modules\integrated_electronics\core\special_pins\color_pin.dm" diff --git a/sound/items/electronic_assembly_empty.ogg b/sound/items/electronic_assembly_empty.ogg new file mode 100644 index 0000000000..9144b414df Binary files /dev/null and b/sound/items/electronic_assembly_empty.ogg differ diff --git a/sound/items/electronic_assembly_emptying.ogg b/sound/items/electronic_assembly_emptying.ogg new file mode 100644 index 0000000000..70e47e7f83 Binary files /dev/null and b/sound/items/electronic_assembly_emptying.ogg differ