Updates AI branch to Master (#5591)

* Fixes 6 pAI faces

PAIs are no longer coded to only recognize 9 emotions. This enables the use of the neutral, silly, nose, smirk, exclamation points, and question mark faces as a pAI. Before, those buttons did nothing.

* Fixes the PDA Halogen Scanner's tendency to be number one.

* Unfolded pAIs can be picked up

Because who doesn't want a robotic cat on their head? Adds in the missing code to allow pAIs to actually be picked up, and held sprites for the newer 4 chassis options.

* Adds the Gigaphone, a suped-up Megaphone.

* Constant Chip has a sprite

* Fireaxe cabinets find their fireaxes in initialize(), rather than new()

* Speeds up alcohol

* fixed mining cloak not being in loadouts

* Admin Supermatter Setup now closes the monitoring room shutters (#5442)

* Admin Supermatter Setup now closes the monitoring room shutters

* Fixes a copy-paste error

* Begins work on lightning.

* Fixes #5447 (Deadspy submap not overwriting mapgen) (#5448)

* Map fix

* fixed deadspy.dmm

* Added Squid plushies of varying colours

I added a few Squid plushies in different colours, changing the files code/game/objects/items/toys.dm
and obj/toy.dmi

* Added hat functionality to Squid plushies

I added the ability to wear my Squid plushies as hats. They're damn good hats.

* Replaces Skrell namegen (#5453)

Created a first name list for Skrell, to replace the syllable assembler.

Created a surname list for Skrell to replace the syllable assembler.

Replaced the Skrell namegen with pre-written namelists, instead of the old syllable assembler.

* Mechoid makes mistakes. Fix telepathic gigaphones.

* Lets people be colorblind

Adds four types of colorblindness to the traits in the setup menu - protanopia, deuteranopia, tritanopia, and monochromacy. Previously, there were ones defined in the code, but not actually usable to players.

* Whoops, worded that wrong

* Adds beams to the Type var list for View Variables.

* Unfuck my Master

* Adds beams to the Type var selection in View Variables.

* Finishes thunderstorms.

* Adds logging.

* APC Sprite Change

- Port from Virgo recolored slightly to match closer to the old sprite
- Addition of directional sprites for the APCs

* Refactors supply controller.
Supply consoles now run nanoUI

* Missing '

* [Excitedly updates changelog]

* btw i use arc

* Removes supermatters from cave PoIs.

* Holomap Port

- Port of Holomaps from Virgo

* Changing species (via ling or admin button) should no longer ruin your HUD

* Converts most istype(thing,tool) procs into an appropriate thing.is_tool() format

* Removes empty file, gives the QM a control console again (Was replaced with an ordering console)

* Hopefully fixes some tool-conversion things

* Makes the Northern Star still compile

* Keeps NS up to date

* Taj and Unathi should have explorer mask sprites now

* Corgi rune now summons the corgi in a flash of harmless lightning

* Forces mech construction to work with the is_tool() procs

* Various things and floors no longer associate with dirt

* MultiZ falling tweaks

* Fixes the clusterbang grenade

* Added new hairstyles

* Added new hairstyles

* Fixes spelling of Strike in Lightning Strike admin verb

* I don't know how we keep breaking falling

* Hallucinations now use the old system again, but with the more modern components.

* Ambience Refactor (#5476)

* Refactors how ambience is assigned, removes bad ambience, ports good ambience from tg

* Apparently that file is still used, not worth the salt to remove it.

* Changelog

* The speed-related chem effects are no longer a one-or-none affair, oxy causes slowdown

* Corrects noted issues

* Add some missing sprites for xenoarch excavation.

* Become thwarted, thot.

* Fixes the Ultra AC2's burstfire bug.

* The Major Bill's shuttle is actually contagious now.

* penguins are from earth

capitalize this, anewbe, i dare you

* Mechoid's a butt

* Adds new job/department specific teshari clothing to the loadout (#5481)

* adding the new department specific teshari outfits

* Slightly cleans up hooded suit code (#5471)

* FBPs can have brute damage repaired externally again

* Windoors fix

* Cleans up some largecrate code

* Weather refactor.

* NanoUI makes me sad.

* Drinking more booze gets you drunk faster

* Ports the supermatter grenade, supporting code

* May or may not make movement seem smoother

* Fixes the Sleepy Ring

* Partially ports the GLOB system

* Fixes the bug(s) that allow meat bodies to have metal brains

* ports VOREStation/VOREStation#4165 - i forgot to check if advanced who was a thing here

* Optimizes supply UI

* Transfer shuttle grammar fixes

* Fixes borked E and W fish sprites

* Fixes incorrect ETA in crew transfer announcement

* Ports descriptors from Bay

* Add files via upload

* Removes Noble Defines

* Mech Mini 'Revamp'. Will need playtesting. (#5480)

* Exosuits are now capable of holding more equipment, of specific types.

* Tweaks regarding feedback in staffside thread, other concerns.

* Tweak to be more consistent. Why did the Odysseus have two universals. Tweak to weapon restriction on Med - > Odyss

* Weapons only fit in universal combat slots.

* Adds smart magazine, magazine functionality

* Adds a new subset of grenades that shoot projectiles

* Low alpha now makes HUDs and tooltips not show up on you

* Fixes a UI bug with emptying currently-open bags into smartfridges...hopefully. (#5515)

* Update smartfridge.dm

* actually indicates which line solves the bug

* Adds a whole bunch of Exosuit weapons and other miscellaneous parts.

* Minifrags now use the small fragments mainly as they should.

* Iced beer no longer freezes you to 3 degrees C, which is enough to seriously burn a Skrell. Seriously, that's weird.

* Touch stuff in reference to responses.

* NanoUI now processes again

* Initial Work: Manifest, Newsfeed

* Adds newscast viewing, manifest

* Cartridge devices

* Template progress

* Med records, Sec records, Emp records

* Cartridge work part 1

* Cartridge work: part 2

 * Power monitoring console
 * Cartridges have persistent, internal data
 * Code to load element-specific data upon request, instead of serving all relevant data at once
 * Janitorial Supply Locator

* Refactor crew manifest to a separate file

* GPS cartridge

* Reorganize GPS to proper organization, important comments

* Supply cartridge

* Status display access

* Merc blast door controller

* Appeases travis (Round 1)

* Appeases travis (Round 2)

* Headset sprites are now on the default ear, which is left

* Cleave changes, attack code cleanup

* Catching is no longer guaranteed, accuracy code is more general

* Adds a Neural implant for future implementation. Promethean brains have been updated to fit it.

* changelog

* Robots can attack things again

* Might help with air subsystem lag

* Ports the spinny throwing animation from Bay

* Cult heal modifier no longer does Shit-Tons of agony. Does mediocre agony on non-cultists.

* Defines.

* Headset sprite tweaks

* Shield Drone no longer auto-fails with Energy Relays.

* I'm an idiot.

* PoIs can be rotated in increments of 90 degrees

* Might fix the server startup error_handler runtime

* Cult Girders are back to being proper.

* Submaps can now be rotated to any cardinal direction (South is default)

* Should fix another runtime with tools

* Buffs the Vox

* Removes debug code (Yes, I'm an idiot)

* Ready for merge

* Fixes some bugs tangentially related to Vox code

* Ports /vg/ instrument frame work, adds client based sound pref

Also shifts sound files which is 98% of the bulk here.

* Helmets now show only certain hairstyles

* fixes the trailing tag, I think

* Scrubbers no longer automatically scrub phoron (#5512)

* adds manual changelog

* Adds new set of cyborg sprites for medical/science/default/security/combat (#5546)

* Refactor cargo trains, they're just normal trains now. Adds the Quad, and re-enables/fixes the Space Bike!

* communicator_header.tmpl now correctly includes Body

* Adds tails to Unathi rig suit sprites (#5551)

* supplycom/control drops the correct circuit

* Emags have an effect on cargo consoles

* The cybersuit is now a space suit.

* Map Bugfixes

-	Fix for mislabeled c_tag cameras, first deck
-	Fix for mislabeled c_tag cameras, second deck
-	Fix for poi crashed containment shuttle mapping issues (terrain generation)
-	Fixed wrong floor type on skipjack
-	Fix for scrubbers pipe, central substation
-	Fix for air supply pipe, chapel
-	Fixed scrubber pipe, Engineering Drone Fab
-	Fix for air supply pipe, Prison Wing
-	Removed redundant supply and scrubber pipe, Security Auxiliary Dock
-	Fix, Fore Aux Dock airlock pipe.
-	Fix air supply pipe, library
-	Fix, scrubber pipe, coffee shop
-	Pipe fix, Medical maint
-	Fix, supply pipe medical secondary storage
-	Removal, redundant supply pipe, cargo maint
-	Fix, virology scrubbers pipes
-	Fix Xenobio and Xenoflora missing atmos connection to the main outpost
-	Fix, missing atmos connections between Main outpost telecoms and main outpost atmos
-	Fix for missing power wires, HoS Office, Warden Office, Heads of Staff Meeting Room
-	New, random mouse spawner
-	New, random mouse spawners added throughout maintenance on the station (maybe too many, maus station 13)
-	New, 30 sheets of lead added to engineering
-	Fix, POIs should now be rad protected and characters won’t be affected by the radiation event

* Fixes Lead Walls (#5562)

A material's ``radiation_resistance`` was never considered for calculating a wall's cached resistance to radiation. This fixes it. There is another issue involving r-walls not being better at stopping radiation than their normal-wall counterparts made of the same material but fixing that involves a lot of number adjusting to avoid the SM engine from getting twice as protective.

* Yet Another Circuit Update (#5549)

* Circuit updates, adds new components, improves printer, new assemblies.

* Finishes powernet circuit.

* Adds wearable assemblies.

* Finialization before merging with GLOB port.

* Finishes circuit update, hopefully.

* Forgot to undo map.

* Removes debug output.

* Readds size traits

* Signal pistol can be reloaded (#5566)

* Makes Blobs more useful.

* Rig and Spacesuit additions

- Added the 'military' Rigsuit from Bay.
- Added 'pmc' rigsuits
- Added exploration and pilot voidsuits along with alternate sprites (alternate sprites done by Naidh)
- Addition of suit cyclers for exploration and pilot voidsuits

None of these suits are currently accessible in game outside of admin bus. Currently only the pilot voidsuits have other species sprites. Exploration suits are missing sprites for Teshari (Naidh made some for their alternates but I have to add them) and the rig suits are human only. This is to be fixed in the near future, just wanted to get the make workload actually in the game first.

* Dermal implant doesn't cover hair

* Fixes a couple of tool related oversight/runtimes

* Fixes hand and leg cuffs

* Update combat.dm

* Boot knives fit in boots

* Adds tails to Unathi rigsuits (again)

* PoI fix

* Fixes some more errors, makes it compile, fixes inability for simplemobs to attack windows.
This commit is contained in:
Neerti
2018-09-22 17:24:00 -05:00
committed by Anewbe
parent b01183ef0c
commit f98e9bf96c
677 changed files with 7904 additions and 3235 deletions
@@ -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,33 @@
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 +78,8 @@
HTML += "[total_parts]/[max_components] ([round((total_parts / max_components) * 100, 0.1)]%) space taken up in the assembly.<br>"
HTML += "[total_complexity]/[max_complexity] ([round((total_complexity / max_complexity) * 100, 0.1)]%) maximum complexity.<br>"
if(battery)
HTML += "[round(battery.charge, 0.1)]/[battery.maxcharge] ([round(battery.percent(), 0.1)]%) cell charge. <a href='?src=\ref[src];remove_cell=1'>\[Remove\]</a>"
HTML += "[round(battery.charge, 0.1)]/[battery.maxcharge] ([round(battery.percent(), 0.1)]%) cell charge. <a href='?src=\ref[src];remove_cell=1'>\[Remove\]</a><br>"
HTML += "Net energy: [format_SI(net_power / CELLRATE, "W")]."
else
HTML += "<span class='danger'>No powercell detected!</span>"
HTML += "<br><br>"
@@ -175,14 +147,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 +220,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 +237,17 @@
visible_message("<span class='notice'>\The [user] waves \the [src] around [target].</span>")
/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 +255,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, "<span class='notice'>You [opened ? "opened" : "closed"] \the [src].</span>")
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, "<span class='warning'>\The [src] isn't opened, so you can't fiddle with the internal components. \
Try using a crowbar.</span>")
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, "<span class='warning'>\The [src] isn't opened, so you can't put anything inside. Try using a crowbar.</span>")
@@ -291,6 +290,7 @@
to_chat(user, "<span class='notice'>You slot \the [cell] inside \the [src]'s power supplier.</span>")
interact(user)
return TRUE
else
return ..()
@@ -331,13 +331,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()
@@ -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 ..()
@@ -19,9 +19,6 @@
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
@@ -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, "<span class='warning'>You cannot place \the [src] on this spot!</span>")
return
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
user.visible_message("\The [user] attaches \the [src] to the wall.",
"<span class='notice'>You attach \the [src] to the wall.</span>",
"<span class='italics'>You hear clicking.</span>")
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
@@ -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
@@ -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()
@@ -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))
@@ -330,6 +330,7 @@ a creative player the means to solve many problems. Circuits are held inside an
to_chat(usr, "<span class='warning'>\The [src] seems to be permanently attached to the case.</span>")
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
@@ -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))
@@ -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, "<span class='warning'>\The [src] is too full to add more metal.</span>")
to_chat(user, span("warning", "\The [src] is too full to add more metal."))
return
if(stack.use(num))
to_chat(user, "<span class='notice'>You add [num] sheet\s to \the [src].</span>")
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, "<span class='notice'>You insert the circuit into \the [src]. </span>")
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, "<span class='warning'>\The [src] already has this upgrade. </span>")
to_chat(user, span("warning", "\The [src] already has this upgrade."))
return TRUE
to_chat(user, "<span class='notice'>You install \the [O] into \the [src]. </span>")
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, "<span class='warning'>\The [src] already has this upgrade. </span>")
to_chat(user, span("warning", "\The [src] already has this upgrade."))
return TRUE
to_chat(user, "<span class='notice'>You install \the [O] into \the [src]. </span>")
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 = "<center><h2>Integrated Circuit Printer</h2></center><br>"
HTML += "Metal: [metal/metal_per_sheet]/[max_metal/metal_per_sheet] sheets.<br>"
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.<br>"
else
HTML += "Metal: INFINITY.<br>"
HTML += "Circuits available: [upgraded ? "Advanced":"Regular"].<br>"
HTML += "Assembly Cloning: [can_clone ? "Available": "Unavailable"].<br>"
if(assembly_to_clone)
HTML += "Assembly '[assembly_to_clone.name]' loaded."
HTML += "Assembly '[assembly_to_clone.name]' loaded.<br>"
HTML += "Crossed out circuits mean that the printer is not sufficentally upgraded to create that circuit.<br>"
HTML += "<hr>"
HTML += "Categories:"
for(var/category in recipe_list)
for(var/category in SScircuit.circuit_fabricator_recipe_list)
if(category != current_category)
HTML += " <a href='?src=\ref[src];category=[category]'>\[[category]\]</a> "
else // Bold the button if it's already selected.
@@ -133,20 +102,22 @@
HTML += "<hr>"
HTML += "<center><h4>[current_category]</h4></center>"
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 += "<A href='?src=\ref[src];build=[O.type]'>\[[O.name]\]</A>: [O.desc]<br>"
HTML += "<A href='?src=\ref[src];build=[path]'>\[[initial(O.name)]\]</A>: [initial(O.desc)]<br>"
else
HTML += "<s>\[[O.name]\]: [O.desc]</s><br>"
HTML += "<s>\[[initial(O.name)]\]</s>: [initial(O.desc)]<br>"
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, "<span class='warning'>You need [cost] metal to build that!.</span>")
return 1
metal -= cost
new build_type(get_turf(loc))
if(!debug)
if(metal - cost < 0)
to_chat(usr, "<span class='warning'>You need [cost] metal to build that!.</span>")
return 1
metal -= cost
var/obj/item/built = new build_type(get_turf(loc))
usr.put_in_hands(built)
to_chat(usr, "<span class='notice'>[capitalize(built.name)] printed.</span>")
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
@@ -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, "<span class='notice'>You input a <font color='[new_data]'>new color</font> into the pin.</span>")
write_data_to_pin(new_data)
@@ -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