Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into tg-40046
This commit is contained in:
@@ -1,88 +1,88 @@
|
||||
/***************************************************************
|
||||
** Design Datums **
|
||||
** All the data for building stuff. **
|
||||
***************************************************************/
|
||||
/*
|
||||
For the materials datum, it assumes you need reagents unless specified otherwise. To designate a material that isn't a reagent,
|
||||
you use one of the material IDs below. These are NOT ids in the usual sense (they aren't defined in the object or part of a datum),
|
||||
they are simply references used as part of a "has materials?" type proc. They all start with a $ to denote that they aren't reagents.
|
||||
The currently supporting non-reagent materials. All material amounts are set as the define MINERAL_MATERIAL_AMOUNT, which defaults to 2000
|
||||
- MAT_METAL (/obj/item/stack/metal).
|
||||
- MAT_GLASS (/obj/item/stack/glass).
|
||||
- MAT_PLASMA (/obj/item/stack/plasma).
|
||||
- MAT_SILVER (/obj/item/stack/silver).
|
||||
- MAT_GOLD (/obj/item/stack/gold).
|
||||
- MAT_URANIUM (/obj/item/stack/uranium).
|
||||
- MAT_DIAMOND (/obj/item/stack/diamond).
|
||||
- MAT_BANANIUM (/obj/item/stack/bananium).
|
||||
(Insert new ones here)
|
||||
|
||||
Don't add new keyword/IDs if they are made from an existing one (such as rods which are made from metal). Only add raw materials.
|
||||
|
||||
Design Guidelines
|
||||
- When adding new designs, check rdreadme.dm to see what kind of things have already been made and where new stuff is needed.
|
||||
- A single sheet of anything is 2000 units of material. Materials besides metal/glass require help from other jobs (mining for
|
||||
other types of metals and chemistry for reagents).
|
||||
- Add the AUTOLATHE tag to
|
||||
*/
|
||||
|
||||
//DESIGNS ARE GLOBAL. DO NOT CREATE OR DESTROY THEM AT RUNTIME OUTSIDE OF INIT, JUST REFERENCE THEM TO WHATEVER YOU'RE DOING! //why are you yelling?
|
||||
//DO NOT REFERENCE OUTSIDE OF SSRESEARCH. USE THE PROCS IN SSRESEARCH TO OBTAIN A REFERENCE.
|
||||
|
||||
/datum/design //Datum for object designs, used in construction
|
||||
var/name = "Name" //Name of the created object.
|
||||
var/desc = "Desc" //Description of the created object.
|
||||
var/id = DESIGN_ID_IGNORE //ID of the created object for easy refernece. Alphanumeric, lower-case, no symbols
|
||||
var/build_type = null //Flag as to what kind machine the design is built in. See defines.
|
||||
var/list/materials = list() //List of materials. Format: "id" = amount.
|
||||
var/construction_time //Amount of time required for building the object
|
||||
var/build_path = null //The file path of the object that gets created
|
||||
var/list/make_reagents = list() //Reagents produced. Format: type = amount. Currently only supported by the biogenerator.
|
||||
var/list/category = null //Primarily used for Mech Fabricators, but can be used for anything
|
||||
var/list/reagents_list = list() //List of reagents. Format: type = amount.
|
||||
var/maxstack = 1
|
||||
var/lathe_time_factor = 1 //How many times faster than normal is this to build on the protolathe
|
||||
var/dangerous_construction = FALSE //notify and log for admin investigations if this is printed.
|
||||
var/departmental_flags = ALL //bitflags for deplathes.
|
||||
var/list/datum/techweb_node/unlocked_by = list()
|
||||
var/research_icon //Replaces the item icon in the research console
|
||||
var/research_icon_state
|
||||
var/icon_cache
|
||||
|
||||
/datum/design/error_design
|
||||
name = "ERROR"
|
||||
desc = "This usually means something in the database has corrupted. If this doesn't go away automatically, inform Central Command so their techs can fix this ASAP(tm)"
|
||||
|
||||
/datum/design/Destroy()
|
||||
SSresearch.techweb_designs -= id
|
||||
return ..()
|
||||
|
||||
/datum/design/proc/icon_html(client/user)
|
||||
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/research_designs)
|
||||
sheet.send(user)
|
||||
return sheet.icon_tag(id)
|
||||
|
||||
////////////////////////////////////////
|
||||
//Disks for transporting design datums//
|
||||
////////////////////////////////////////
|
||||
|
||||
/obj/item/disk/design_disk
|
||||
name = "Component Design Disk"
|
||||
desc = "A disk for storing device design data for construction in lathes."
|
||||
icon_state = "datadisk1"
|
||||
materials = list(MAT_METAL=300, MAT_GLASS=100)
|
||||
var/list/blueprints = list()
|
||||
var/max_blueprints = 1
|
||||
|
||||
/obj/item/disk/design_disk/Initialize()
|
||||
. = ..()
|
||||
pixel_x = rand(-5, 5)
|
||||
pixel_y = rand(-5, 5)
|
||||
for(var/i in 1 to max_blueprints)
|
||||
blueprints += null
|
||||
|
||||
/obj/item/disk/design_disk/adv
|
||||
name = "Advanced Component Design Disk"
|
||||
desc = "A disk for storing device design data for construction in lathes. This one has extra storage space."
|
||||
materials = list(MAT_METAL=300, MAT_GLASS=100, MAT_SILVER = 50)
|
||||
max_blueprints = 5
|
||||
/***************************************************************
|
||||
** Design Datums **
|
||||
** All the data for building stuff. **
|
||||
***************************************************************/
|
||||
/*
|
||||
For the materials datum, it assumes you need reagents unless specified otherwise. To designate a material that isn't a reagent,
|
||||
you use one of the material IDs below. These are NOT ids in the usual sense (they aren't defined in the object or part of a datum),
|
||||
they are simply references used as part of a "has materials?" type proc. They all start with a $ to denote that they aren't reagents.
|
||||
The currently supporting non-reagent materials. All material amounts are set as the define MINERAL_MATERIAL_AMOUNT, which defaults to 2000
|
||||
- MAT_METAL (/obj/item/stack/metal).
|
||||
- MAT_GLASS (/obj/item/stack/glass).
|
||||
- MAT_PLASMA (/obj/item/stack/plasma).
|
||||
- MAT_SILVER (/obj/item/stack/silver).
|
||||
- MAT_GOLD (/obj/item/stack/gold).
|
||||
- MAT_URANIUM (/obj/item/stack/uranium).
|
||||
- MAT_DIAMOND (/obj/item/stack/diamond).
|
||||
- MAT_BANANIUM (/obj/item/stack/bananium).
|
||||
(Insert new ones here)
|
||||
|
||||
Don't add new keyword/IDs if they are made from an existing one (such as rods which are made from metal). Only add raw materials.
|
||||
|
||||
Design Guidelines
|
||||
- When adding new designs, check rdreadme.dm to see what kind of things have already been made and where new stuff is needed.
|
||||
- A single sheet of anything is 2000 units of material. Materials besides metal/glass require help from other jobs (mining for
|
||||
other types of metals and chemistry for reagents).
|
||||
- Add the AUTOLATHE tag to
|
||||
*/
|
||||
|
||||
//DESIGNS ARE GLOBAL. DO NOT CREATE OR DESTROY THEM AT RUNTIME OUTSIDE OF INIT, JUST REFERENCE THEM TO WHATEVER YOU'RE DOING! //why are you yelling?
|
||||
//DO NOT REFERENCE OUTSIDE OF SSRESEARCH. USE THE PROCS IN SSRESEARCH TO OBTAIN A REFERENCE.
|
||||
|
||||
/datum/design //Datum for object designs, used in construction
|
||||
var/name = "Name" //Name of the created object.
|
||||
var/desc = "Desc" //Description of the created object.
|
||||
var/id = DESIGN_ID_IGNORE //ID of the created object for easy refernece. Alphanumeric, lower-case, no symbols
|
||||
var/build_type = null //Flag as to what kind machine the design is built in. See defines.
|
||||
var/list/materials = list() //List of materials. Format: "id" = amount.
|
||||
var/construction_time //Amount of time required for building the object
|
||||
var/build_path = null //The file path of the object that gets created
|
||||
var/list/make_reagents = list() //Reagents produced. Format: type = amount. Currently only supported by the biogenerator.
|
||||
var/list/category = null //Primarily used for Mech Fabricators, but can be used for anything
|
||||
var/list/reagents_list = list() //List of reagents. Format: type = amount.
|
||||
var/maxstack = 1
|
||||
var/lathe_time_factor = 1 //How many times faster than normal is this to build on the protolathe
|
||||
var/dangerous_construction = FALSE //notify and log for admin investigations if this is printed.
|
||||
var/departmental_flags = ALL //bitflags for deplathes.
|
||||
var/list/datum/techweb_node/unlocked_by = list()
|
||||
var/research_icon //Replaces the item icon in the research console
|
||||
var/research_icon_state
|
||||
var/icon_cache
|
||||
|
||||
/datum/design/error_design
|
||||
name = "ERROR"
|
||||
desc = "This usually means something in the database has corrupted. If this doesn't go away automatically, inform Central Command so their techs can fix this ASAP(tm)"
|
||||
|
||||
/datum/design/Destroy()
|
||||
SSresearch.techweb_designs -= id
|
||||
return ..()
|
||||
|
||||
/datum/design/proc/icon_html(client/user)
|
||||
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/research_designs)
|
||||
sheet.send(user)
|
||||
return sheet.icon_tag(id)
|
||||
|
||||
////////////////////////////////////////
|
||||
//Disks for transporting design datums//
|
||||
////////////////////////////////////////
|
||||
|
||||
/obj/item/disk/design_disk
|
||||
name = "Component Design Disk"
|
||||
desc = "A disk for storing device design data for construction in lathes."
|
||||
icon_state = "datadisk1"
|
||||
materials = list(MAT_METAL=300, MAT_GLASS=100)
|
||||
var/list/blueprints = list()
|
||||
var/max_blueprints = 1
|
||||
|
||||
/obj/item/disk/design_disk/Initialize()
|
||||
. = ..()
|
||||
pixel_x = rand(-5, 5)
|
||||
pixel_y = rand(-5, 5)
|
||||
for(var/i in 1 to max_blueprints)
|
||||
blueprints += null
|
||||
|
||||
/obj/item/disk/design_disk/adv
|
||||
name = "Advanced Component Design Disk"
|
||||
desc = "A disk for storing device design data for construction in lathes. This one has extra storage space."
|
||||
materials = list(MAT_METAL=300, MAT_GLASS=100, MAT_SILVER = 50)
|
||||
max_blueprints = 5
|
||||
|
||||
@@ -1,86 +1,86 @@
|
||||
|
||||
/////////////////////////////////////////
|
||||
//////////////Blue Space/////////////////
|
||||
/////////////////////////////////////////
|
||||
|
||||
/datum/design/beacon
|
||||
name = "Tracking Beacon"
|
||||
desc = "A blue space tracking beacon."
|
||||
id = "beacon"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 150, MAT_GLASS = 100)
|
||||
build_path = /obj/item/beacon
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_CARGO | DEPARTMENTAL_FLAG_SECURITY
|
||||
|
||||
/datum/design/bag_holding
|
||||
name = "Bag of Holding"
|
||||
desc = "A backpack that opens into a localized pocket of bluespace."
|
||||
id = "bag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 3000, MAT_DIAMOND = 1500, MAT_URANIUM = 250, MAT_BLUESPACE = 2000)
|
||||
build_path = /obj/item/storage/backpack/holding
|
||||
category = list("Bluespace Designs")
|
||||
dangerous_construction = TRUE
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/satchel_holding
|
||||
name = "Satchel of Holding"
|
||||
desc = "A satchel that opens into a localized pocket of bluespace."
|
||||
id = "satchel_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 3000, MAT_DIAMOND = 1500, MAT_URANIUM = 250, MAT_BLUESPACE = 2000)
|
||||
build_path = /obj/item/storage/backpack/holding/satchel
|
||||
category = list("Bluespace Designs")
|
||||
dangerous_construction = TRUE
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/biobag_holding
|
||||
name = "Bio Bag of Holding"
|
||||
desc = "A chemical holding thingy. Mostly used for xenobiology."
|
||||
id = "biobag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 1500, MAT_DIAMOND = 750, MAT_URANIUM = 250, MAT_BLUESPACE = 1000)
|
||||
build_path = /obj/item/storage/bag/bio/holding
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/bluespace_crystal
|
||||
name = "Artificial Bluespace Crystal"
|
||||
desc = "A small blue crystal with mystical properties."
|
||||
id = "bluespace_crystal"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_DIAMOND = 1500, MAT_PLASMA = 1500)
|
||||
build_path = /obj/item/stack/ore/bluespace_crystal/artificial
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING
|
||||
|
||||
/datum/design/telesci_gps
|
||||
name = "GPS Device"
|
||||
desc = "Little thingie that can track its position at all times."
|
||||
id = "telesci_gps"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 500, MAT_GLASS = 1000)
|
||||
build_path = /obj/item/gps
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/desynchronizer
|
||||
name = "Desynchronizer"
|
||||
desc = "A device that can desynchronize the user from spacetime."
|
||||
id = "desynchronizer"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 1000, MAT_GLASS = 500, MAT_SILVER = 1500, MAT_BLUESPACE = 1000)
|
||||
build_path = /obj/item/desynchronizer
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/miningsatchel_holding
|
||||
name = "Mining Satchel of Holding"
|
||||
desc = "A mining satchel that can hold an infinite amount of ores."
|
||||
id = "minerbag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 250, MAT_URANIUM = 500) //quite cheap, for more convenience
|
||||
build_path = /obj/item/storage/bag/ore/holding
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/////////////////////////////////////////
|
||||
//////////////Blue Space/////////////////
|
||||
/////////////////////////////////////////
|
||||
|
||||
/datum/design/beacon
|
||||
name = "Tracking Beacon"
|
||||
desc = "A blue space tracking beacon."
|
||||
id = "beacon"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 150, MAT_GLASS = 100)
|
||||
build_path = /obj/item/beacon
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_CARGO | DEPARTMENTAL_FLAG_SECURITY
|
||||
|
||||
/datum/design/bag_holding
|
||||
name = "Bag of Holding"
|
||||
desc = "A backpack that opens into a localized pocket of bluespace."
|
||||
id = "bag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 3000, MAT_DIAMOND = 1500, MAT_URANIUM = 250, MAT_BLUESPACE = 2000)
|
||||
build_path = /obj/item/storage/backpack/holding
|
||||
category = list("Bluespace Designs")
|
||||
dangerous_construction = TRUE
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/satchel_holding
|
||||
name = "Satchel of Holding"
|
||||
desc = "A satchel that opens into a localized pocket of bluespace."
|
||||
id = "satchel_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 3000, MAT_DIAMOND = 1500, MAT_URANIUM = 250, MAT_BLUESPACE = 2000)
|
||||
build_path = /obj/item/storage/backpack/holding/satchel
|
||||
category = list("Bluespace Designs")
|
||||
dangerous_construction = TRUE
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/biobag_holding
|
||||
name = "Bio Bag of Holding"
|
||||
desc = "A chemical holding thingy. Mostly used for xenobiology."
|
||||
id = "biobag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 1500, MAT_DIAMOND = 750, MAT_URANIUM = 250, MAT_BLUESPACE = 1000)
|
||||
build_path = /obj/item/storage/bag/bio/holding
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/bluespace_crystal
|
||||
name = "Artificial Bluespace Crystal"
|
||||
desc = "A small blue crystal with mystical properties."
|
||||
id = "bluespace_crystal"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_DIAMOND = 1500, MAT_PLASMA = 1500)
|
||||
build_path = /obj/item/stack/ore/bluespace_crystal/artificial
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING
|
||||
|
||||
/datum/design/telesci_gps
|
||||
name = "GPS Device"
|
||||
desc = "Little thingie that can track its position at all times."
|
||||
id = "telesci_gps"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 500, MAT_GLASS = 1000)
|
||||
build_path = /obj/item/gps
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/desynchronizer
|
||||
name = "Desynchronizer"
|
||||
desc = "A device that can desynchronize the user from spacetime."
|
||||
id = "desynchronizer"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 1000, MAT_GLASS = 500, MAT_SILVER = 1500, MAT_BLUESPACE = 1000)
|
||||
build_path = /obj/item/desynchronizer
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/miningsatchel_holding
|
||||
name = "Mining Satchel of Holding"
|
||||
desc = "A mining satchel that can hold an infinite amount of ores."
|
||||
id = "minerbag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 250, MAT_URANIUM = 500) //quite cheap, for more convenience
|
||||
build_path = /obj/item/storage/bag/ore/holding
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
+1
-1
@@ -40,4 +40,4 @@
|
||||
id = "miningshuttle"
|
||||
build_path = /obj/item/circuitboard/computer/mining_shuttle
|
||||
category = list("Computer Boards")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
@@ -1,170 +1,170 @@
|
||||
|
||||
///////////////////////////////////
|
||||
/////Non-Board Computer Stuff//////
|
||||
///////////////////////////////////
|
||||
|
||||
/datum/design/intellicard
|
||||
name = "Intellicard AI Transportation System"
|
||||
desc = "Allows for the construction of an intellicard."
|
||||
id = "intellicard"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 1000, MAT_GOLD = 200)
|
||||
build_path = /obj/item/aicard
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/paicard
|
||||
name = "Personal Artificial Intelligence Card"
|
||||
desc = "Allows for the construction of a pAI Card."
|
||||
id = "paicard"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 500, MAT_METAL = 500)
|
||||
build_path = /obj/item/paicard
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ALL
|
||||
|
||||
/datum/design/ai_cam_upgrade
|
||||
name = "AI Surveillance Software Update"
|
||||
desc = "A software package that will allow an artificial intelligence to 'hear' from its cameras via lip reading."
|
||||
id = "ai_cam_upgrade"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 5000, MAT_GLASS = 5000, MAT_GOLD = 15000, MAT_SILVER = 15000, MAT_DIAMOND = 20000, MAT_PLASMA = 10000)
|
||||
build_path = /obj/item/surveillance_upgrade
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
///////////////////////////////////
|
||||
//////////Nanite Devices///////////
|
||||
///////////////////////////////////
|
||||
/datum/design/nanite_remote
|
||||
name = "Nanite Remote"
|
||||
desc = "Allows for the construction of a nanite remote."
|
||||
id = "nanite_remote"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 500, MAT_METAL = 500)
|
||||
build_path = /obj/item/nanite_remote
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/nanite_scanner
|
||||
name = "Nanite Scanner"
|
||||
desc = "Allows for the construction of a nanite scanner."
|
||||
id = "nanite_scanner"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 500, MAT_METAL = 500)
|
||||
build_path = /obj/item/nanite_scanner
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
////////////////////////////////////////
|
||||
//////////Disk Construction Disks///////
|
||||
////////////////////////////////////////
|
||||
/datum/design/design_disk
|
||||
name = "Design Storage Disk"
|
||||
desc = "Produce additional disks for storing device designs."
|
||||
id = "design_disk"
|
||||
build_type = PROTOLATHE | AUTOLATHE
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 100)
|
||||
build_path = /obj/item/disk/design_disk
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/design_disk_adv
|
||||
name = "Advanced Design Storage Disk"
|
||||
desc = "Produce additional disks for storing device designs."
|
||||
id = "design_disk_adv"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 100, MAT_SILVER=50)
|
||||
build_path = /obj/item/disk/design_disk/adv
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/tech_disk
|
||||
name = "Technology Data Storage Disk"
|
||||
desc = "Produce additional disks for storing technology data."
|
||||
id = "tech_disk"
|
||||
build_type = PROTOLATHE | AUTOLATHE
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 100)
|
||||
build_path = /obj/item/disk/tech_disk
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/nanite_disk
|
||||
name = "Nanite Program Disk"
|
||||
desc = "Stores nanite programs."
|
||||
id = "nanite_disk"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 100)
|
||||
build_path = /obj/item/disk/nanite_program
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/integrated_printer
|
||||
name = "Integrated circuit printer"
|
||||
desc = "This machine provides all necessary things for circuitry."
|
||||
id = "icprinter"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 5000, MAT_METAL = 10000)
|
||||
build_path = /obj/item/integrated_circuit_printer
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/IC_printer_upgrade_advanced
|
||||
name = "Integrated circuit printer upgrade: Advanced Designs"
|
||||
desc = "This disk allows for integrated circuit printers to print advanced circuitry designs."
|
||||
id = "icupgadv"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 10000, MAT_METAL = 10000)
|
||||
build_path = /obj/item/disk/integrated_circuit/upgrade/advanced
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/IC_printer_upgrade_clone
|
||||
name = "Integrated circuit printer upgrade: Instant Cloning"
|
||||
desc = "This disk allows for integrated circuit printers to clone designs instantaneously."
|
||||
id = "icupgclo"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 10000, MAT_METAL = 10000)
|
||||
build_path = /obj/item/disk/integrated_circuit/upgrade/clone
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
//CIT ADDITIONS
|
||||
/datum/design/drone_shell
|
||||
name = "Drone Shell"
|
||||
desc = "A shell of a maintenance drone, an expendable robot built to perform station repairs."
|
||||
id = "drone_shell"
|
||||
build_type = MECHFAB | PROTOLATHE
|
||||
materials = list(MAT_METAL = 800, MAT_GLASS = 350)
|
||||
construction_time = 150
|
||||
build_path = /obj/item/drone_shell
|
||||
category = list("Misc")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/xenobio_upgrade
|
||||
name = "owo"
|
||||
desc = "someone's bussin"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 100)
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/xenobio_upgrade/xenobiomonkeys
|
||||
name = "Xenobiology console monkey upgrade disk"
|
||||
desc = "This disk will add the ability to remotely recycle monkeys via the Xenobiology console."
|
||||
id = "xenobio_monkeys"
|
||||
build_path = /obj/item/disk/xenobio_console_upgrade/monkey
|
||||
|
||||
/datum/design/xenobio_upgrade/xenobioslimebasic
|
||||
name = "Xenobiology console basic slime upgrade disk"
|
||||
desc = "This disk will add the ability to remotely manipulate slimes via the Xenobiology console."
|
||||
id = "xenobio_slimebasic"
|
||||
build_path = /obj/item/disk/xenobio_console_upgrade/slimebasic
|
||||
|
||||
/datum/design/xenobio_upgrade/xenobioslimeadv
|
||||
name = "Xenobiology console advanced slime upgrade disk"
|
||||
desc = "This disk will add the ability to remotely feed slimes potions via the Xenobiology console, and lift the restrictions on the number of slimes that can be stored inside the Xenobiology console. This includes the contents of the basic slime upgrade disk."
|
||||
id = "xenobio_slimeadv"
|
||||
build_path = /obj/item/disk/xenobio_console_upgrade/slimeadv
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////
|
||||
/////Non-Board Computer Stuff//////
|
||||
///////////////////////////////////
|
||||
|
||||
/datum/design/intellicard
|
||||
name = "Intellicard AI Transportation System"
|
||||
desc = "Allows for the construction of an intellicard."
|
||||
id = "intellicard"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 1000, MAT_GOLD = 200)
|
||||
build_path = /obj/item/aicard
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/paicard
|
||||
name = "Personal Artificial Intelligence Card"
|
||||
desc = "Allows for the construction of a pAI Card."
|
||||
id = "paicard"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 500, MAT_METAL = 500)
|
||||
build_path = /obj/item/paicard
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ALL
|
||||
|
||||
/datum/design/ai_cam_upgrade
|
||||
name = "AI Surveillance Software Update"
|
||||
desc = "A software package that will allow an artificial intelligence to 'hear' from its cameras via lip reading."
|
||||
id = "ai_cam_upgrade"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 5000, MAT_GLASS = 5000, MAT_GOLD = 15000, MAT_SILVER = 15000, MAT_DIAMOND = 20000, MAT_PLASMA = 10000)
|
||||
build_path = /obj/item/surveillance_upgrade
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
///////////////////////////////////
|
||||
//////////Nanite Devices///////////
|
||||
///////////////////////////////////
|
||||
/datum/design/nanite_remote
|
||||
name = "Nanite Remote"
|
||||
desc = "Allows for the construction of a nanite remote."
|
||||
id = "nanite_remote"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 500, MAT_METAL = 500)
|
||||
build_path = /obj/item/nanite_remote
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/nanite_scanner
|
||||
name = "Nanite Scanner"
|
||||
desc = "Allows for the construction of a nanite scanner."
|
||||
id = "nanite_scanner"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 500, MAT_METAL = 500)
|
||||
build_path = /obj/item/nanite_scanner
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
////////////////////////////////////////
|
||||
//////////Disk Construction Disks///////
|
||||
////////////////////////////////////////
|
||||
/datum/design/design_disk
|
||||
name = "Design Storage Disk"
|
||||
desc = "Produce additional disks for storing device designs."
|
||||
id = "design_disk"
|
||||
build_type = PROTOLATHE | AUTOLATHE
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 100)
|
||||
build_path = /obj/item/disk/design_disk
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/design_disk_adv
|
||||
name = "Advanced Design Storage Disk"
|
||||
desc = "Produce additional disks for storing device designs."
|
||||
id = "design_disk_adv"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 100, MAT_SILVER=50)
|
||||
build_path = /obj/item/disk/design_disk/adv
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/tech_disk
|
||||
name = "Technology Data Storage Disk"
|
||||
desc = "Produce additional disks for storing technology data."
|
||||
id = "tech_disk"
|
||||
build_type = PROTOLATHE | AUTOLATHE
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 100)
|
||||
build_path = /obj/item/disk/tech_disk
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/nanite_disk
|
||||
name = "Nanite Program Disk"
|
||||
desc = "Stores nanite programs."
|
||||
id = "nanite_disk"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 100)
|
||||
build_path = /obj/item/disk/nanite_program
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/integrated_printer
|
||||
name = "Integrated circuit printer"
|
||||
desc = "This machine provides all necessary things for circuitry."
|
||||
id = "icprinter"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 5000, MAT_METAL = 10000)
|
||||
build_path = /obj/item/integrated_circuit_printer
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/IC_printer_upgrade_advanced
|
||||
name = "Integrated circuit printer upgrade: Advanced Designs"
|
||||
desc = "This disk allows for integrated circuit printers to print advanced circuitry designs."
|
||||
id = "icupgadv"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 10000, MAT_METAL = 10000)
|
||||
build_path = /obj/item/disk/integrated_circuit/upgrade/advanced
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/IC_printer_upgrade_clone
|
||||
name = "Integrated circuit printer upgrade: Instant Cloning"
|
||||
desc = "This disk allows for integrated circuit printers to clone designs instantaneously."
|
||||
id = "icupgclo"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 10000, MAT_METAL = 10000)
|
||||
build_path = /obj/item/disk/integrated_circuit/upgrade/clone
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
//CIT ADDITIONS
|
||||
/datum/design/drone_shell
|
||||
name = "Drone Shell"
|
||||
desc = "A shell of a maintenance drone, an expendable robot built to perform station repairs."
|
||||
id = "drone_shell"
|
||||
build_type = MECHFAB | PROTOLATHE
|
||||
materials = list(MAT_METAL = 800, MAT_GLASS = 350)
|
||||
construction_time = 150
|
||||
build_path = /obj/item/drone_shell
|
||||
category = list("Misc")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/xenobio_upgrade
|
||||
name = "owo"
|
||||
desc = "someone's bussin"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 100)
|
||||
category = list("Electronics")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/xenobio_upgrade/xenobiomonkeys
|
||||
name = "Xenobiology console monkey upgrade disk"
|
||||
desc = "This disk will add the ability to remotely recycle monkeys via the Xenobiology console."
|
||||
id = "xenobio_monkeys"
|
||||
build_path = /obj/item/disk/xenobio_console_upgrade/monkey
|
||||
|
||||
/datum/design/xenobio_upgrade/xenobioslimebasic
|
||||
name = "Xenobiology console basic slime upgrade disk"
|
||||
desc = "This disk will add the ability to remotely manipulate slimes via the Xenobiology console."
|
||||
id = "xenobio_slimebasic"
|
||||
build_path = /obj/item/disk/xenobio_console_upgrade/slimebasic
|
||||
|
||||
/datum/design/xenobio_upgrade/xenobioslimeadv
|
||||
name = "Xenobiology console advanced slime upgrade disk"
|
||||
desc = "This disk will add the ability to remotely feed slimes potions via the Xenobiology console, and lift the restrictions on the number of slimes that can be stored inside the Xenobiology console. This includes the contents of the basic slime upgrade disk."
|
||||
id = "xenobio_slimeadv"
|
||||
build_path = /obj/item/disk/xenobio_console_upgrade/slimeadv
|
||||
|
||||
|
||||
|
||||
@@ -1,55 +1,55 @@
|
||||
/*
|
||||
/datum/design/flightsuit
|
||||
name = "Flight Suit"
|
||||
desc = "A specialized hardsuit that is able to attach a flightpack and accessories.."
|
||||
id = "flightsuit"
|
||||
build_type = PROTOLATHE
|
||||
build_path = /obj/item/clothing/suit/space/hardsuit/flightsuit
|
||||
materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_DIAMOND = 200, MAT_GOLD = 3000, MAT_SILVER = 3000, MAT_TITANIUM = 16000) //This expensive enough for you?
|
||||
construction_time = 250
|
||||
category = list("Misc")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
|
||||
|
||||
/datum/design/flightpack
|
||||
name = "Flight Pack"
|
||||
desc = "An advanced back-worn system that has dual ion engines powerful enough to grant a humanoid flight. Contains an internal self-recharging high-current capacitor for short, powerful boosts."
|
||||
id = "flightpack"
|
||||
build_type = PROTOLATHE
|
||||
build_path = /obj/item/flightpack
|
||||
materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_DIAMOND = 4000, MAT_GOLD = 12000, MAT_SILVER = 12000, MAT_URANIUM = 20000, MAT_PLASMA = 16000, MAT_TITANIUM = 16000) //This expensive enough for you?
|
||||
construction_time = 250
|
||||
category = list("Misc")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
|
||||
|
||||
/datum/design/flightshoes
|
||||
name = "Flight Shoes"
|
||||
desc = "Flight shoes, attachable to a flight suit to provide additional functions."
|
||||
id = "flightshoes"
|
||||
build_type = PROTOLATHE
|
||||
build_path = /obj/item/clothing/shoes/flightshoes
|
||||
materials = list(MAT_METAL = 5000, MAT_GLASS = 5000, MAT_GOLD = 1500, MAT_SILVER = 1500, MAT_PLASMA = 2000, MAT_TITANIUM = 2000)
|
||||
construction_time = 100
|
||||
category = list("Misc")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING */
|
||||
|
||||
/datum/design/constructionhardsuit
|
||||
name = "Construction Hardsuit"
|
||||
desc = "A hardsuit, designed for EVA construction and hazardous material transportation"
|
||||
id = "chardsuit"
|
||||
build_type = PROTOLATHE
|
||||
build_path = /obj/item/clothing/suit/space/hardsuit/engine
|
||||
materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_DIAMOND = 200, MAT_GOLD = 3000, MAT_SILVER = 3000, MAT_TITANIUM = 16000)
|
||||
construction_time = 100
|
||||
category = list("Misc")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
|
||||
|
||||
/datum/design/integratedjpack
|
||||
name = "Hardsuit Jetpack Upgrade"
|
||||
desc = "A modular upgrade for any hardsuit, giving it an integrated jetpack."
|
||||
id = "hardsuitjpack"
|
||||
build_type = PROTOLATHE
|
||||
build_path = /obj/item/tank/jetpack/suit
|
||||
materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_DIAMOND = 2000, MAT_GOLD = 6000, MAT_SILVER = 6000, MAT_URANIUM = 10000, MAT_PLASMA = 8000, MAT_TITANIUM = 16000)
|
||||
construction_time = 100
|
||||
category = list("Misc")
|
||||
/*
|
||||
/datum/design/flightsuit
|
||||
name = "Flight Suit"
|
||||
desc = "A specialized hardsuit that is able to attach a flightpack and accessories.."
|
||||
id = "flightsuit"
|
||||
build_type = PROTOLATHE
|
||||
build_path = /obj/item/clothing/suit/space/hardsuit/flightsuit
|
||||
materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_DIAMOND = 200, MAT_GOLD = 3000, MAT_SILVER = 3000, MAT_TITANIUM = 16000) //This expensive enough for you?
|
||||
construction_time = 250
|
||||
category = list("Misc")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
|
||||
|
||||
/datum/design/flightpack
|
||||
name = "Flight Pack"
|
||||
desc = "An advanced back-worn system that has dual ion engines powerful enough to grant a humanoid flight. Contains an internal self-recharging high-current capacitor for short, powerful boosts."
|
||||
id = "flightpack"
|
||||
build_type = PROTOLATHE
|
||||
build_path = /obj/item/flightpack
|
||||
materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_DIAMOND = 4000, MAT_GOLD = 12000, MAT_SILVER = 12000, MAT_URANIUM = 20000, MAT_PLASMA = 16000, MAT_TITANIUM = 16000) //This expensive enough for you?
|
||||
construction_time = 250
|
||||
category = list("Misc")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
|
||||
|
||||
/datum/design/flightshoes
|
||||
name = "Flight Shoes"
|
||||
desc = "Flight shoes, attachable to a flight suit to provide additional functions."
|
||||
id = "flightshoes"
|
||||
build_type = PROTOLATHE
|
||||
build_path = /obj/item/clothing/shoes/flightshoes
|
||||
materials = list(MAT_METAL = 5000, MAT_GLASS = 5000, MAT_GOLD = 1500, MAT_SILVER = 1500, MAT_PLASMA = 2000, MAT_TITANIUM = 2000)
|
||||
construction_time = 100
|
||||
category = list("Misc")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING */
|
||||
|
||||
/datum/design/constructionhardsuit
|
||||
name = "Construction Hardsuit"
|
||||
desc = "A hardsuit, designed for EVA construction and hazardous material transportation"
|
||||
id = "chardsuit"
|
||||
build_type = PROTOLATHE
|
||||
build_path = /obj/item/clothing/suit/space/hardsuit/engine
|
||||
materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_DIAMOND = 200, MAT_GOLD = 3000, MAT_SILVER = 3000, MAT_TITANIUM = 16000)
|
||||
construction_time = 100
|
||||
category = list("Misc")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
|
||||
|
||||
/datum/design/integratedjpack
|
||||
name = "Hardsuit Jetpack Upgrade"
|
||||
desc = "A modular upgrade for any hardsuit, giving it an integrated jetpack."
|
||||
id = "hardsuitjpack"
|
||||
build_type = PROTOLATHE
|
||||
build_path = /obj/item/tank/jetpack/suit
|
||||
materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_DIAMOND = 2000, MAT_GOLD = 6000, MAT_SILVER = 6000, MAT_URANIUM = 10000, MAT_PLASMA = 8000, MAT_TITANIUM = 16000)
|
||||
construction_time = 100
|
||||
category = list("Misc")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING
|
||||
@@ -1,133 +1,133 @@
|
||||
|
||||
/////////////////////////////////////////
|
||||
/////////////////Mining//////////////////
|
||||
/////////////////////////////////////////
|
||||
/datum/design/cargo_express
|
||||
name = "Computer Design (Express Supply Console)"//shes beautiful
|
||||
desc = "Allows for the construction of circuit boards used to build an Express Supply Console."//who?
|
||||
id = "cargoexpress"//the coder reading this
|
||||
build_type = IMPRINTER
|
||||
materials = list(MAT_GLASS = 1000)
|
||||
build_path = /obj/item/circuitboard/computer/cargo/express
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/bluespace_pod
|
||||
name = "Supply Drop Pod Upgrade Disk"
|
||||
desc = "Allows the Cargo Express Console to call down the Bluespace Drop Pod, greatly increasing user safety."//who?
|
||||
id = "bluespace_pod"//the coder reading this
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 1000)
|
||||
build_path = /obj/item/disk/cargo/bluespace_pod
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/drill
|
||||
name = "Mining Drill"
|
||||
desc = "Yours is the drill that will pierce through the rock walls."
|
||||
id = "drill"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 6000, MAT_GLASS = 1000) //expensive, but no need for miners.
|
||||
build_path = /obj/item/pickaxe/drill
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/drill_diamond
|
||||
name = "Diamond-Tipped Mining Drill"
|
||||
desc = "Yours is the drill that will pierce the heavens!"
|
||||
id = "drill_diamond"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 6000, MAT_GLASS = 1000, MAT_DIAMOND = 2000) //Yes, a whole diamond is needed.
|
||||
build_path = /obj/item/pickaxe/drill/diamonddrill
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/plasmacutter
|
||||
name = "Plasma Cutter"
|
||||
desc = "You could use it to cut limbs off of xenos! Or, you know, mine stuff."
|
||||
id = "plasmacutter"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 1500, MAT_GLASS = 500, MAT_PLASMA = 400)
|
||||
build_path = /obj/item/gun/energy/plasmacutter
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/plasmacutter_adv
|
||||
name = "Advanced Plasma Cutter"
|
||||
desc = "It's an advanced plasma cutter, oh my god."
|
||||
id = "plasmacutter_adv"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 3000, MAT_GLASS = 1000, MAT_PLASMA = 2000, MAT_GOLD = 500)
|
||||
build_path = /obj/item/gun/energy/plasmacutter/adv
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/jackhammer
|
||||
name = "Sonic Jackhammer"
|
||||
desc = "Essentially a handheld planet-cracker. Can drill through walls with ease as well."
|
||||
id = "jackhammer"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 6000, MAT_GLASS = 2000, MAT_SILVER = 2000, MAT_DIAMOND = 6000)
|
||||
build_path = /obj/item/pickaxe/drill/jackhammer
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/superresonator
|
||||
name = "Upgraded Resonator"
|
||||
desc = "An upgraded version of the resonator that allows more fields to be active at once."
|
||||
id = "superresonator"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 4000, MAT_GLASS = 1500, MAT_SILVER = 1000, MAT_URANIUM = 1000)
|
||||
build_path = /obj/item/resonator/upgraded
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/trigger_guard_mod
|
||||
name = "Kinetic Accelerator Trigger Guard Mod"
|
||||
desc = "A device which allows kinetic accelerators to be wielded by any organism."
|
||||
id = "triggermod"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 2000, MAT_GLASS = 1500, MAT_GOLD = 1500, MAT_URANIUM = 1000)
|
||||
build_path = /obj/item/borg/upgrade/modkit/trigger_guard
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/damage_mod
|
||||
name = "Kinetic Accelerator Damage Mod"
|
||||
desc = "A device which allows kinetic accelerators to deal more damage."
|
||||
id = "damagemod"
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
materials = list(MAT_METAL = 2000, MAT_GLASS = 1500, MAT_GOLD = 1500, MAT_URANIUM = 1000)
|
||||
build_path = /obj/item/borg/upgrade/modkit/damage
|
||||
category = list("Mining Designs", "Cyborg Upgrade Modules")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/cooldown_mod
|
||||
name = "Kinetic Accelerator Cooldown Mod"
|
||||
desc = "A device which decreases the cooldown of a Kinetic Accelerator."
|
||||
id = "cooldownmod"
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
materials = list(MAT_METAL = 2000, MAT_GLASS = 1500, MAT_GOLD = 1500, MAT_URANIUM = 1000)
|
||||
build_path = /obj/item/borg/upgrade/modkit/cooldown
|
||||
category = list("Mining Designs", "Cyborg Upgrade Modules")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/range_mod
|
||||
name = "Kinetic Accelerator Range Mod"
|
||||
desc = "A device which allows kinetic accelerators to fire at a further range."
|
||||
id = "rangemod"
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
materials = list(MAT_METAL = 2000, MAT_GLASS = 1500, MAT_GOLD = 1500, MAT_URANIUM = 1000)
|
||||
build_path = /obj/item/borg/upgrade/modkit/range
|
||||
category = list("Mining Designs", "Cyborg Upgrade Modules")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/hyperaccelerator
|
||||
name = "Kinetic Accelerator Mining AoE Mod"
|
||||
desc = "A modification kit for Kinetic Accelerators which causes it to fire AoE blasts that destroy rock."
|
||||
id = "hypermod"
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
materials = list(MAT_METAL = 8000, MAT_GLASS = 1500, MAT_SILVER = 2000, MAT_GOLD = 2000, MAT_DIAMOND = 2000)
|
||||
build_path = /obj/item/borg/upgrade/modkit/aoe/turfs
|
||||
category = list("Mining Designs", "Cyborg Upgrade Modules")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/////////////////////////////////////////
|
||||
/////////////////Mining//////////////////
|
||||
/////////////////////////////////////////
|
||||
/datum/design/cargo_express
|
||||
name = "Computer Design (Express Supply Console)"//shes beautiful
|
||||
desc = "Allows for the construction of circuit boards used to build an Express Supply Console."//who?
|
||||
id = "cargoexpress"//the coder reading this
|
||||
build_type = IMPRINTER
|
||||
materials = list(MAT_GLASS = 1000)
|
||||
build_path = /obj/item/circuitboard/computer/cargo/express
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/bluespace_pod
|
||||
name = "Supply Drop Pod Upgrade Disk"
|
||||
desc = "Allows the Cargo Express Console to call down the Bluespace Drop Pod, greatly increasing user safety."//who?
|
||||
id = "bluespace_pod"//the coder reading this
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GLASS = 1000)
|
||||
build_path = /obj/item/disk/cargo/bluespace_pod
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/drill
|
||||
name = "Mining Drill"
|
||||
desc = "Yours is the drill that will pierce through the rock walls."
|
||||
id = "drill"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 6000, MAT_GLASS = 1000) //expensive, but no need for miners.
|
||||
build_path = /obj/item/pickaxe/drill
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/drill_diamond
|
||||
name = "Diamond-Tipped Mining Drill"
|
||||
desc = "Yours is the drill that will pierce the heavens!"
|
||||
id = "drill_diamond"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 6000, MAT_GLASS = 1000, MAT_DIAMOND = 2000) //Yes, a whole diamond is needed.
|
||||
build_path = /obj/item/pickaxe/drill/diamonddrill
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/plasmacutter
|
||||
name = "Plasma Cutter"
|
||||
desc = "You could use it to cut limbs off of xenos! Or, you know, mine stuff."
|
||||
id = "plasmacutter"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 1500, MAT_GLASS = 500, MAT_PLASMA = 400)
|
||||
build_path = /obj/item/gun/energy/plasmacutter
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/plasmacutter_adv
|
||||
name = "Advanced Plasma Cutter"
|
||||
desc = "It's an advanced plasma cutter, oh my god."
|
||||
id = "plasmacutter_adv"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 3000, MAT_GLASS = 1000, MAT_PLASMA = 2000, MAT_GOLD = 500)
|
||||
build_path = /obj/item/gun/energy/plasmacutter/adv
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/jackhammer
|
||||
name = "Sonic Jackhammer"
|
||||
desc = "Essentially a handheld planet-cracker. Can drill through walls with ease as well."
|
||||
id = "jackhammer"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 6000, MAT_GLASS = 2000, MAT_SILVER = 2000, MAT_DIAMOND = 6000)
|
||||
build_path = /obj/item/pickaxe/drill/jackhammer
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/superresonator
|
||||
name = "Upgraded Resonator"
|
||||
desc = "An upgraded version of the resonator that allows more fields to be active at once."
|
||||
id = "superresonator"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 4000, MAT_GLASS = 1500, MAT_SILVER = 1000, MAT_URANIUM = 1000)
|
||||
build_path = /obj/item/resonator/upgraded
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/trigger_guard_mod
|
||||
name = "Kinetic Accelerator Trigger Guard Mod"
|
||||
desc = "A device which allows kinetic accelerators to be wielded by any organism."
|
||||
id = "triggermod"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 2000, MAT_GLASS = 1500, MAT_GOLD = 1500, MAT_URANIUM = 1000)
|
||||
build_path = /obj/item/borg/upgrade/modkit/trigger_guard
|
||||
category = list("Mining Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/damage_mod
|
||||
name = "Kinetic Accelerator Damage Mod"
|
||||
desc = "A device which allows kinetic accelerators to deal more damage."
|
||||
id = "damagemod"
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
materials = list(MAT_METAL = 2000, MAT_GLASS = 1500, MAT_GOLD = 1500, MAT_URANIUM = 1000)
|
||||
build_path = /obj/item/borg/upgrade/modkit/damage
|
||||
category = list("Mining Designs", "Cyborg Upgrade Modules")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/cooldown_mod
|
||||
name = "Kinetic Accelerator Cooldown Mod"
|
||||
desc = "A device which decreases the cooldown of a Kinetic Accelerator."
|
||||
id = "cooldownmod"
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
materials = list(MAT_METAL = 2000, MAT_GLASS = 1500, MAT_GOLD = 1500, MAT_URANIUM = 1000)
|
||||
build_path = /obj/item/borg/upgrade/modkit/cooldown
|
||||
category = list("Mining Designs", "Cyborg Upgrade Modules")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/range_mod
|
||||
name = "Kinetic Accelerator Range Mod"
|
||||
desc = "A device which allows kinetic accelerators to fire at a further range."
|
||||
id = "rangemod"
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
materials = list(MAT_METAL = 2000, MAT_GLASS = 1500, MAT_GOLD = 1500, MAT_URANIUM = 1000)
|
||||
build_path = /obj/item/borg/upgrade/modkit/range
|
||||
category = list("Mining Designs", "Cyborg Upgrade Modules")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/hyperaccelerator
|
||||
name = "Kinetic Accelerator Mining AoE Mod"
|
||||
desc = "A modification kit for Kinetic Accelerators which causes it to fire AoE blasts that destroy rock."
|
||||
id = "hypermod"
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
materials = list(MAT_METAL = 8000, MAT_GLASS = 1500, MAT_SILVER = 2000, MAT_GOLD = 2000, MAT_DIAMOND = 2000)
|
||||
build_path = /obj/item/borg/upgrade/modkit/aoe/turfs
|
||||
category = list("Mining Designs", "Cyborg Upgrade Modules")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
@@ -1,154 +1,154 @@
|
||||
|
||||
|
||||
/*
|
||||
Destructive Analyzer
|
||||
|
||||
It is used to destroy hand-held objects and advance technological research. Controls are in the linked R&D console.
|
||||
|
||||
Note: Must be placed within 3 tiles of the R&D Console
|
||||
*/
|
||||
/obj/machinery/rnd/destructive_analyzer
|
||||
name = "destructive analyzer"
|
||||
desc = "Learn science by destroying things!"
|
||||
icon_state = "d_analyzer"
|
||||
circuit = /obj/item/circuitboard/machine/destructive_analyzer
|
||||
var/decon_mod = 0
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/stock_parts/S in component_parts)
|
||||
T += S.rating
|
||||
decon_mod = T
|
||||
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/ConvertReqString2List(list/source_list)
|
||||
var/list/temp_list = params2list(source_list)
|
||||
for(var/O in temp_list)
|
||||
temp_list[O] = text2num(temp_list[O])
|
||||
return temp_list
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/disconnect_console()
|
||||
linked_console.linked_destroy = null
|
||||
..()
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/Insert_Item(obj/item/O, mob/user)
|
||||
if(user.a_intent != INTENT_HARM)
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
if(!user.transferItemToLoc(O, src))
|
||||
to_chat(user, "<span class='warning'>\The [O] is stuck to your hand, you cannot put it in the [src.name]!</span>")
|
||||
return
|
||||
busy = TRUE
|
||||
loaded_item = O
|
||||
to_chat(user, "<span class='notice'>You add the [O.name] to the [src.name]!</span>")
|
||||
flick("d_analyzer_la", src)
|
||||
addtimer(CALLBACK(src, .proc/finish_loading), 10)
|
||||
if (linked_console)
|
||||
linked_console.updateUsrDialog()
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/finish_loading()
|
||||
update_icon()
|
||||
reset_busy()
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/update_icon()
|
||||
if(loaded_item)
|
||||
icon_state = "d_analyzer_l"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/reclaim_materials_from(obj/item/thing)
|
||||
. = 0
|
||||
var/datum/component/material_container/storage = linked_console?.linked_lathe?.materials.mat_container
|
||||
if(storage) //Also sends salvaged materials to a linked protolathe, if any.
|
||||
for(var/material in thing.materials)
|
||||
var/can_insert = min((storage.max_amount - storage.total_amount), (max(thing.materials[material]*(decon_mod/10), thing.materials[material])))
|
||||
storage.insert_amount(can_insert, material)
|
||||
. += can_insert
|
||||
if (.)
|
||||
linked_console.linked_lathe.materials.silo_log(src, "reclaimed", 1, "[thing.name]", thing.materials)
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/destroy_item(obj/item/thing, innermode = FALSE)
|
||||
if(QDELETED(thing) || QDELETED(src) || QDELETED(linked_console))
|
||||
return FALSE
|
||||
if(!innermode)
|
||||
flick("d_analyzer_process", src)
|
||||
busy = TRUE
|
||||
addtimer(CALLBACK(src, .proc/reset_busy), 24)
|
||||
use_power(250)
|
||||
if(thing == loaded_item)
|
||||
loaded_item = null
|
||||
var/list/food = thing.GetDeconstructableContents()
|
||||
for(var/obj/item/innerthing in food)
|
||||
destroy_item(innerthing, TRUE)
|
||||
reclaim_materials_from(thing)
|
||||
for(var/mob/M in thing)
|
||||
M.death()
|
||||
if(istype(thing, /obj/item/stack/sheet))
|
||||
var/obj/item/stack/sheet/S = thing
|
||||
if(S.amount > 1 && !innermode)
|
||||
S.amount--
|
||||
loaded_item = S
|
||||
else
|
||||
qdel(S)
|
||||
else
|
||||
qdel(thing)
|
||||
if (!innermode)
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/user_try_decon_id(id, mob/user)
|
||||
if(!istype(loaded_item) || !istype(linked_console))
|
||||
return FALSE
|
||||
|
||||
if (id && id != RESEARCH_MATERIAL_RECLAMATION_ID)
|
||||
var/datum/techweb_node/TN = SSresearch.techweb_node_by_id(id)
|
||||
if(!istype(TN))
|
||||
return FALSE
|
||||
var/dpath = loaded_item.type
|
||||
var/list/worths = TN.boost_item_paths[dpath]
|
||||
var/list/differences = list()
|
||||
var/list/already_boosted = linked_console.stored_research.boosted_nodes[TN.id]
|
||||
for(var/i in worths)
|
||||
var/used = already_boosted? already_boosted[i] : 0
|
||||
var/value = min(worths[i], TN.research_costs[i]) - used
|
||||
if(value > 0)
|
||||
differences[i] = value
|
||||
if(length(worths) && !length(differences))
|
||||
return FALSE
|
||||
var/choice = input("Are you sure you want to destroy [loaded_item] to [!length(worths) ? "reveal [TN.display_name]" : "boost [TN.display_name] by [json_encode(differences)] point\s"]?") in list("Proceed", "Cancel")
|
||||
if(choice == "Cancel")
|
||||
return FALSE
|
||||
if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src))
|
||||
return FALSE
|
||||
SSblackbox.record_feedback("nested tally", "item_deconstructed", 1, list("[TN.id]", "[loaded_item.type]"))
|
||||
if(destroy_item(loaded_item))
|
||||
linked_console.stored_research.boost_with_path(SSresearch.techweb_node_by_id(TN.id), dpath)
|
||||
|
||||
else
|
||||
var/list/point_value = techweb_item_point_check(loaded_item)
|
||||
if(linked_console.stored_research.deconstructed_items[loaded_item.type])
|
||||
point_value = list()
|
||||
var/user_mode_string = ""
|
||||
if(length(point_value))
|
||||
user_mode_string = " for [json_encode(point_value)] points"
|
||||
else if(loaded_item.materials.len)
|
||||
user_mode_string = " for material reclamation"
|
||||
var/choice = input("Are you sure you want to destroy [loaded_item][user_mode_string]?") in list("Proceed", "Cancel")
|
||||
if(choice == "Cancel")
|
||||
return FALSE
|
||||
if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src))
|
||||
return FALSE
|
||||
var/loaded_type = loaded_item.type
|
||||
if(destroy_item(loaded_item))
|
||||
linked_console.stored_research.add_point_list(point_value)
|
||||
linked_console.stored_research.deconstructed_items[loaded_type] = point_value
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/unload_item()
|
||||
if(!loaded_item)
|
||||
return FALSE
|
||||
loaded_item.forceMove(get_turf(src))
|
||||
loaded_item = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
|
||||
/*
|
||||
Destructive Analyzer
|
||||
|
||||
It is used to destroy hand-held objects and advance technological research. Controls are in the linked R&D console.
|
||||
|
||||
Note: Must be placed within 3 tiles of the R&D Console
|
||||
*/
|
||||
/obj/machinery/rnd/destructive_analyzer
|
||||
name = "destructive analyzer"
|
||||
desc = "Learn science by destroying things!"
|
||||
icon_state = "d_analyzer"
|
||||
circuit = /obj/item/circuitboard/machine/destructive_analyzer
|
||||
var/decon_mod = 0
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/stock_parts/S in component_parts)
|
||||
T += S.rating
|
||||
decon_mod = T
|
||||
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/ConvertReqString2List(list/source_list)
|
||||
var/list/temp_list = params2list(source_list)
|
||||
for(var/O in temp_list)
|
||||
temp_list[O] = text2num(temp_list[O])
|
||||
return temp_list
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/disconnect_console()
|
||||
linked_console.linked_destroy = null
|
||||
..()
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/Insert_Item(obj/item/O, mob/user)
|
||||
if(user.a_intent != INTENT_HARM)
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
if(!user.transferItemToLoc(O, src))
|
||||
to_chat(user, "<span class='warning'>\The [O] is stuck to your hand, you cannot put it in the [src.name]!</span>")
|
||||
return
|
||||
busy = TRUE
|
||||
loaded_item = O
|
||||
to_chat(user, "<span class='notice'>You add the [O.name] to the [src.name]!</span>")
|
||||
flick("d_analyzer_la", src)
|
||||
addtimer(CALLBACK(src, .proc/finish_loading), 10)
|
||||
if (linked_console)
|
||||
linked_console.updateUsrDialog()
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/finish_loading()
|
||||
update_icon()
|
||||
reset_busy()
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/update_icon()
|
||||
if(loaded_item)
|
||||
icon_state = "d_analyzer_l"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/reclaim_materials_from(obj/item/thing)
|
||||
. = 0
|
||||
var/datum/component/material_container/storage = linked_console?.linked_lathe?.materials.mat_container
|
||||
if(storage) //Also sends salvaged materials to a linked protolathe, if any.
|
||||
for(var/material in thing.materials)
|
||||
var/can_insert = min((storage.max_amount - storage.total_amount), (max(thing.materials[material]*(decon_mod/10), thing.materials[material])))
|
||||
storage.insert_amount(can_insert, material)
|
||||
. += can_insert
|
||||
if (.)
|
||||
linked_console.linked_lathe.materials.silo_log(src, "reclaimed", 1, "[thing.name]", thing.materials)
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/destroy_item(obj/item/thing, innermode = FALSE)
|
||||
if(QDELETED(thing) || QDELETED(src) || QDELETED(linked_console))
|
||||
return FALSE
|
||||
if(!innermode)
|
||||
flick("d_analyzer_process", src)
|
||||
busy = TRUE
|
||||
addtimer(CALLBACK(src, .proc/reset_busy), 24)
|
||||
use_power(250)
|
||||
if(thing == loaded_item)
|
||||
loaded_item = null
|
||||
var/list/food = thing.GetDeconstructableContents()
|
||||
for(var/obj/item/innerthing in food)
|
||||
destroy_item(innerthing, TRUE)
|
||||
reclaim_materials_from(thing)
|
||||
for(var/mob/M in thing)
|
||||
M.death()
|
||||
if(istype(thing, /obj/item/stack/sheet))
|
||||
var/obj/item/stack/sheet/S = thing
|
||||
if(S.amount > 1 && !innermode)
|
||||
S.amount--
|
||||
loaded_item = S
|
||||
else
|
||||
qdel(S)
|
||||
else
|
||||
qdel(thing)
|
||||
if (!innermode)
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/user_try_decon_id(id, mob/user)
|
||||
if(!istype(loaded_item) || !istype(linked_console))
|
||||
return FALSE
|
||||
|
||||
if (id && id != RESEARCH_MATERIAL_RECLAMATION_ID)
|
||||
var/datum/techweb_node/TN = SSresearch.techweb_node_by_id(id)
|
||||
if(!istype(TN))
|
||||
return FALSE
|
||||
var/dpath = loaded_item.type
|
||||
var/list/worths = TN.boost_item_paths[dpath]
|
||||
var/list/differences = list()
|
||||
var/list/already_boosted = linked_console.stored_research.boosted_nodes[TN.id]
|
||||
for(var/i in worths)
|
||||
var/used = already_boosted? already_boosted[i] : 0
|
||||
var/value = min(worths[i], TN.research_costs[i]) - used
|
||||
if(value > 0)
|
||||
differences[i] = value
|
||||
if(length(worths) && !length(differences))
|
||||
return FALSE
|
||||
var/choice = input("Are you sure you want to destroy [loaded_item] to [!length(worths) ? "reveal [TN.display_name]" : "boost [TN.display_name] by [json_encode(differences)] point\s"]?") in list("Proceed", "Cancel")
|
||||
if(choice == "Cancel")
|
||||
return FALSE
|
||||
if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src))
|
||||
return FALSE
|
||||
SSblackbox.record_feedback("nested tally", "item_deconstructed", 1, list("[TN.id]", "[loaded_item.type]"))
|
||||
if(destroy_item(loaded_item))
|
||||
linked_console.stored_research.boost_with_path(SSresearch.techweb_node_by_id(TN.id), dpath)
|
||||
|
||||
else
|
||||
var/list/point_value = techweb_item_point_check(loaded_item)
|
||||
if(linked_console.stored_research.deconstructed_items[loaded_item.type])
|
||||
point_value = list()
|
||||
var/user_mode_string = ""
|
||||
if(length(point_value))
|
||||
user_mode_string = " for [json_encode(point_value)] points"
|
||||
else if(loaded_item.materials.len)
|
||||
user_mode_string = " for material reclamation"
|
||||
var/choice = input("Are you sure you want to destroy [loaded_item][user_mode_string]?") in list("Proceed", "Cancel")
|
||||
if(choice == "Cancel")
|
||||
return FALSE
|
||||
if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src))
|
||||
return FALSE
|
||||
var/loaded_type = loaded_item.type
|
||||
if(destroy_item(loaded_item))
|
||||
linked_console.stored_research.add_point_list(point_value)
|
||||
linked_console.stored_research.deconstructed_items[loaded_type] = point_value
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/unload_item()
|
||||
if(!loaded_item)
|
||||
return FALSE
|
||||
loaded_item.forceMove(get_turf(src))
|
||||
loaded_item = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,365 +1,365 @@
|
||||
/obj/machinery/rnd/production
|
||||
name = "technology fabricator"
|
||||
desc = "Makes researched and prototype items with materials and energy."
|
||||
layer = BELOW_OBJ_LAYER
|
||||
var/consoleless_interface = FALSE //Whether it can be used without a console.
|
||||
var/efficiency_coeff = 1 //Materials needed / coeff = actual.
|
||||
var/list/categories = list()
|
||||
var/datum/component/remote_materials/materials
|
||||
var/allowed_department_flags = ALL
|
||||
var/production_animation //What's flick()'d on print.
|
||||
var/allowed_buildtypes = NONE
|
||||
var/list/datum/design/cached_designs
|
||||
var/list/datum/design/matching_designs
|
||||
var/department_tag = "Unidentified" //used for material distribution among other things.
|
||||
var/datum/techweb/stored_research
|
||||
var/datum/techweb/host_research
|
||||
|
||||
var/screen = RESEARCH_FABRICATOR_SCREEN_MAIN
|
||||
var/selected_category
|
||||
|
||||
/obj/machinery/rnd/production/Initialize(mapload)
|
||||
. = ..()
|
||||
create_reagents(0, OPENCONTAINER)
|
||||
matching_designs = list()
|
||||
cached_designs = list()
|
||||
stored_research = new
|
||||
host_research = SSresearch.science_tech
|
||||
update_research()
|
||||
materials = AddComponent(/datum/component/remote_materials, "lathe", mapload)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/rnd/production/proc/update_research()
|
||||
host_research.copy_research_to(stored_research, TRUE)
|
||||
update_designs()
|
||||
|
||||
/obj/machinery/rnd/production/proc/update_designs()
|
||||
cached_designs.Cut()
|
||||
for(var/i in stored_research.researched_designs)
|
||||
var/datum/design/d = SSresearch.techweb_design_by_id(i)
|
||||
if((isnull(allowed_department_flags) || (d.departmental_flags & allowed_department_flags)) && (d.build_type & allowed_buildtypes))
|
||||
cached_designs |= d
|
||||
|
||||
/obj/machinery/rnd/production/RefreshParts()
|
||||
calculate_efficiency()
|
||||
|
||||
/obj/machinery/rnd/production/ui_interact(mob/user)
|
||||
if(!consoleless_interface)
|
||||
return ..()
|
||||
user.set_machine(src)
|
||||
var/datum/browser/popup = new(user, "rndconsole", name, 460, 550)
|
||||
popup.set_content(generate_ui())
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/rnd/production/Destroy()
|
||||
QDEL_NULL(stored_research)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/rnd/production/proc/calculate_efficiency()
|
||||
efficiency_coeff = 1
|
||||
if(reagents) //If reagents/materials aren't initialized, don't bother, we'll be doing this again after reagents init anyways.
|
||||
reagents.maximum_volume = 0
|
||||
for(var/obj/item/reagent_containers/glass/G in component_parts)
|
||||
reagents.maximum_volume += G.volume
|
||||
G.reagents.trans_to(src, G.reagents.total_volume)
|
||||
if(materials)
|
||||
var/total_storage = 0
|
||||
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
|
||||
total_storage += M.rating * 75000
|
||||
materials.set_local_size(total_storage)
|
||||
var/total_rating = 0
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
total_rating += M.rating
|
||||
total_rating = max(1, total_rating)
|
||||
efficiency_coeff = total_rating
|
||||
|
||||
//we eject the materials upon deconstruction.
|
||||
/obj/machinery/rnd/production/on_deconstruction()
|
||||
for(var/obj/item/reagent_containers/glass/G in component_parts)
|
||||
reagents.trans_to(G, G.reagents.maximum_volume)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/rnd/production/proc/do_print(path, amount, list/matlist, notify_admins, mob/user)
|
||||
if(notify_admins)
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] has built [amount] of [path] at a [src]([type]).")
|
||||
for(var/i in 1 to amount)
|
||||
var/obj/O = new path(get_turf(src))
|
||||
if(efficient_with(O.type) && isitem(O))
|
||||
var/obj/item/I = O
|
||||
I.materials = matlist.Copy()
|
||||
SSblackbox.record_feedback("nested tally", "item_printed", amount, list("[type]", "[path]"))
|
||||
investigate_log("[key_name(user)] built [amount] of [path] at [src]([type]).", INVESTIGATE_RESEARCH)
|
||||
|
||||
/obj/machinery/rnd/production/proc/check_mat(datum/design/being_built, M) // now returns how many times the item can be built with the material
|
||||
if (!materials.mat_container) // no connected silo
|
||||
return 0
|
||||
var/list/all_materials = being_built.reagents_list + being_built.materials
|
||||
|
||||
var/A = materials.mat_container.amount(M)
|
||||
if(!A)
|
||||
A = reagents.get_reagent_amount(M)
|
||||
|
||||
// these types don't have their .materials set in do_print, so don't allow
|
||||
// them to be constructed efficiently
|
||||
var/ef = efficient_with(being_built.build_path) ? efficiency_coeff : 1
|
||||
return round(A / max(1, all_materials[M] / ef))
|
||||
|
||||
/obj/machinery/rnd/production/proc/efficient_with(path)
|
||||
return !ispath(path, /obj/item/stack/sheet) && !ispath(path, /obj/item/stack/ore/bluespace_crystal)
|
||||
|
||||
/obj/machinery/rnd/production/proc/user_try_print_id(id, amount)
|
||||
if((!istype(linked_console) && requires_console) || !id)
|
||||
return FALSE
|
||||
if(istext(amount))
|
||||
amount = text2num(amount)
|
||||
if(isnull(amount))
|
||||
amount = 1
|
||||
var/datum/design/D = (linked_console || requires_console)? (linked_console.stored_research.researched_designs[id]? SSresearch.techweb_design_by_id(id) : null) : SSresearch.techweb_design_by_id(id)
|
||||
if(!istype(D))
|
||||
return FALSE
|
||||
if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
|
||||
say("Warning: Printing failed: This fabricator does not have the necessary keys to decrypt design schematics. Please update the research data with the on-screen button and contact Nanotrasen Support!")
|
||||
return FALSE
|
||||
if(D.build_type && !(D.build_type & allowed_buildtypes))
|
||||
say("This machine does not have the necessary manipulation systems for this design. Please contact Nanotrasen Support!")
|
||||
return FALSE
|
||||
if(!materials.mat_container)
|
||||
say("No connection to material storage, please contact the quartermaster.")
|
||||
return FALSE
|
||||
if(materials.on_hold())
|
||||
say("Mineral access is on hold, please contact the quartermaster.")
|
||||
return FALSE
|
||||
var/power = 1000
|
||||
amount = CLAMP(amount, 1, 50)
|
||||
for(var/M in D.materials)
|
||||
power += round(D.materials[M] * amount / 35)
|
||||
power = min(3000, power)
|
||||
use_power(power)
|
||||
var/coeff = efficient_with(D.build_path) ? efficiency_coeff : 1
|
||||
var/list/efficient_mats = list()
|
||||
for(var/MAT in D.materials)
|
||||
efficient_mats[MAT] = D.materials[MAT]/coeff
|
||||
if(!materials.mat_container.has_materials(efficient_mats, amount))
|
||||
say("Not enough materials to complete prototype[amount > 1? "s" : ""].")
|
||||
return FALSE
|
||||
for(var/R in D.reagents_list)
|
||||
if(!reagents.has_reagent(R, D.reagents_list[R]*amount/coeff))
|
||||
say("Not enough reagents to complete prototype[amount > 1? "s" : ""].")
|
||||
return FALSE
|
||||
materials.mat_container.use_amount(efficient_mats, amount)
|
||||
materials.silo_log(src, "built", -amount, "[D.name]", efficient_mats)
|
||||
for(var/R in D.reagents_list)
|
||||
reagents.remove_reagent(R, D.reagents_list[R]*amount/coeff)
|
||||
busy = TRUE
|
||||
if(production_animation)
|
||||
flick(production_animation, src)
|
||||
var/timecoeff = D.lathe_time_factor / efficiency_coeff
|
||||
addtimer(CALLBACK(src, .proc/reset_busy), (30 * timecoeff * amount) ** 0.5)
|
||||
addtimer(CALLBACK(src, .proc/do_print, D.build_path, amount, efficient_mats, D.dangerous_construction, usr), (32 * timecoeff * amount) ** 0.8)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/rnd/production/proc/search(string)
|
||||
matching_designs.Cut()
|
||||
for(var/v in stored_research.researched_designs)
|
||||
var/datum/design/D = SSresearch.techweb_design_by_id(v)
|
||||
if(!(D.build_type & allowed_buildtypes) || !(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
|
||||
continue
|
||||
if(findtext(D.name,string))
|
||||
matching_designs.Add(D)
|
||||
|
||||
/obj/machinery/rnd/production/proc/generate_ui()
|
||||
var/list/ui = list()
|
||||
ui += ui_header()
|
||||
switch(screen)
|
||||
if(RESEARCH_FABRICATOR_SCREEN_MATERIALS)
|
||||
ui += ui_screen_materials()
|
||||
if(RESEARCH_FABRICATOR_SCREEN_CHEMICALS)
|
||||
ui += ui_screen_chemicals()
|
||||
if(RESEARCH_FABRICATOR_SCREEN_SEARCH)
|
||||
ui += ui_screen_search()
|
||||
if(RESEARCH_FABRICATOR_SCREEN_CATEGORYVIEW)
|
||||
ui += ui_screen_category_view()
|
||||
else
|
||||
ui += ui_screen_main()
|
||||
for(var/i in 1 to length(ui))
|
||||
if(!findtextEx(ui[i], RDSCREEN_NOBREAK))
|
||||
ui[i] += "<br>"
|
||||
ui[i] = replacetextEx(ui[i], RDSCREEN_NOBREAK, "")
|
||||
return ui.Join("")
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_header()
|
||||
var/list/l = list()
|
||||
l += "<div class='statusDisplay'><b>[host_research.organization] [department_tag] Department Lathe</b>"
|
||||
l += "Security protocols: [(obj_flags & EMAGGED)? "<font color='red'>Disabled</font>" : "<font color='green'>Enabled</font>"]"
|
||||
if (materials.mat_container)
|
||||
l += "<A href='?src=[REF(src)];switch_screen=[RESEARCH_FABRICATOR_SCREEN_MATERIALS]'><B>Material Amount:</B> [materials.format_amount()]</A>"
|
||||
else
|
||||
l += "<font color='red'>No material storage connected, please contact the quartermaster.</font>"
|
||||
l += "<A href='?src=[REF(src)];switch_screen=[RESEARCH_FABRICATOR_SCREEN_CHEMICALS]'><B>Chemical volume:</B> [reagents.total_volume] / [reagents.maximum_volume]</A>"
|
||||
l += "<a href='?src=[REF(src)];sync_research=1'>Synchronize Research</a>"
|
||||
l += "<a href='?src=[REF(src)];switch_screen=[RESEARCH_FABRICATOR_SCREEN_MAIN]'>Main Screen</a></div>[RDSCREEN_NOBREAK]"
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_screen_materials()
|
||||
if (!materials.mat_container)
|
||||
screen = RESEARCH_FABRICATOR_SCREEN_MAIN
|
||||
return ui_screen_main()
|
||||
var/list/l = list()
|
||||
l += "<div class='statusDisplay'><h3>Material Storage:</h3>"
|
||||
for(var/mat_id in materials.mat_container.materials)
|
||||
var/datum/material/M = materials.mat_container.materials[mat_id]
|
||||
l += "* [M.amount] of [M.name]: "
|
||||
if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];ejectsheet=[M.id];eject_amt=1'>Eject</A> [RDSCREEN_NOBREAK]"
|
||||
if(M.amount >= MINERAL_MATERIAL_AMOUNT*5) l += "<A href='?src=[REF(src)];ejectsheet=[M.id];eject_amt=5'>5x</A> [RDSCREEN_NOBREAK]"
|
||||
if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];ejectsheet=[M.id];eject_amt=50'>All</A>[RDSCREEN_NOBREAK]"
|
||||
l += ""
|
||||
l += "</div>[RDSCREEN_NOBREAK]"
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_screen_chemicals()
|
||||
var/list/l = list()
|
||||
l += "<div class='statusDisplay'><A href='?src=[REF(src)];disposeall=1'>Disposal All Chemicals in Storage</A>"
|
||||
l += "<h3>Chemical Storage:</h3>"
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
l += "[R.name]: [R.volume]"
|
||||
l += "<A href='?src=[REF(src)];dispose=[R.type]'>Purge</A>"
|
||||
l += "</div>"
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_screen_search()
|
||||
var/list/l = list()
|
||||
var/coeff = efficiency_coeff
|
||||
l += "<h2>Search Results:</h2>"
|
||||
l += "<form name='search' action='?src=[REF(src)]'>\
|
||||
<input type='hidden' name='src' value='[REF(src)]'>\
|
||||
<input type='hidden' name='search' value='to_search'>\
|
||||
<input type='text' name='to_search'>\
|
||||
<input type='submit' value='Search'>\
|
||||
</form><HR>"
|
||||
for(var/datum/design/D in matching_designs)
|
||||
l += design_menu_entry(D, coeff)
|
||||
l += "</div>"
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/design_menu_entry(datum/design/D, coeff)
|
||||
if(!istype(D))
|
||||
return
|
||||
if(!coeff)
|
||||
coeff = efficiency_coeff
|
||||
if(!efficient_with(D.build_path))
|
||||
coeff = 1
|
||||
var/list/l = list()
|
||||
var/temp_material
|
||||
var/c = 50
|
||||
var/t
|
||||
var/all_materials = D.materials + D.reagents_list
|
||||
for(var/M in all_materials)
|
||||
t = check_mat(D, M)
|
||||
temp_material += " | "
|
||||
if (t < 1)
|
||||
temp_material += "<span class='bad'>[all_materials[M]/coeff] [CallMaterialName(M)]</span>"
|
||||
else
|
||||
temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]"
|
||||
c = min(c,t)
|
||||
|
||||
if (c >= 1)
|
||||
l += "<A href='?src=[REF(src)];build=[D.id];amount=1'>[D.name]</A>[RDSCREEN_NOBREAK]"
|
||||
if(c >= 5)
|
||||
l += "<A href='?src=[REF(src)];build=[D.id];amount=5'>x5</A>[RDSCREEN_NOBREAK]"
|
||||
if(c >= 10)
|
||||
l += "<A href='?src=[REF(src)];build=[D.id];amount=10'>x10</A>[RDSCREEN_NOBREAK]"
|
||||
l += "[temp_material][RDSCREEN_NOBREAK]"
|
||||
else
|
||||
l += "<span class='linkOff'>[D.name]</span>[temp_material][RDSCREEN_NOBREAK]"
|
||||
l += ""
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/Topic(raw, ls)
|
||||
if(..())
|
||||
return
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
if(ls["switch_screen"])
|
||||
screen = text2num(ls["switch_screen"])
|
||||
if(ls["build"]) //Causes the Protolathe to build something.
|
||||
if(busy)
|
||||
say("Warning: Fabricators busy!")
|
||||
else
|
||||
user_try_print_id(ls["build"], ls["amount"])
|
||||
if(ls["search"]) //Search for designs with name matching pattern
|
||||
search(ls["to_search"])
|
||||
screen = RESEARCH_FABRICATOR_SCREEN_SEARCH
|
||||
if(ls["sync_research"])
|
||||
update_research()
|
||||
say("Synchronizing research with host technology database.")
|
||||
if(ls["category"])
|
||||
selected_category = ls["category"]
|
||||
if(ls["dispose"]) //Causes the protolathe to dispose of a single reagent (all of it)
|
||||
reagents.del_reagent(ls["dispose"])
|
||||
if(ls["disposeall"]) //Causes the protolathe to dispose of all it's reagents.
|
||||
reagents.clear_reagents()
|
||||
if(ls["ejectsheet"]) //Causes the protolathe to eject a sheet of material
|
||||
eject_sheets(ls["ejectsheet"], ls["eject_amt"])
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/rnd/production/proc/eject_sheets(eject_sheet, eject_amt)
|
||||
var/datum/component/material_container/mat_container = materials.mat_container
|
||||
if (!mat_container)
|
||||
say("No access to material storage, please contact the quartermaster.")
|
||||
return 0
|
||||
if (materials.on_hold())
|
||||
say("Mineral access is on hold, please contact the quartermaster.")
|
||||
return 0
|
||||
var/count = mat_container.retrieve_sheets(text2num(eject_amt), eject_sheet, drop_location())
|
||||
var/list/matlist = list()
|
||||
matlist[eject_sheet] = MINERAL_MATERIAL_AMOUNT
|
||||
materials.silo_log(src, "ejected", -count, "sheets", matlist)
|
||||
return count
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_screen_main()
|
||||
var/list/l = list()
|
||||
l += "<form name='search' action='?src=[REF(src)]'>\
|
||||
<input type='hidden' name='src' value='[REF(src)]'>\
|
||||
<input type='hidden' name='search' value='to_search'>\
|
||||
<input type='hidden' name='type' value='proto'>\
|
||||
<input type='text' name='to_search'>\
|
||||
<input type='submit' value='Search'>\
|
||||
</form><HR>"
|
||||
|
||||
l += list_categories(categories, RESEARCH_FABRICATOR_SCREEN_CATEGORYVIEW)
|
||||
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_screen_category_view()
|
||||
if(!selected_category)
|
||||
return ui_screen_main()
|
||||
var/list/l = list()
|
||||
l += "<div class='statusDisplay'><h3>Browsing [selected_category]:</h3>"
|
||||
var/coeff = efficiency_coeff
|
||||
for(var/v in stored_research.researched_designs)
|
||||
var/datum/design/D = SSresearch.techweb_design_by_id(v)
|
||||
if(!(selected_category in D.category)|| !(D.build_type & allowed_buildtypes))
|
||||
continue
|
||||
if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
|
||||
continue
|
||||
l += design_menu_entry(D, coeff)
|
||||
l += "</div>"
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/list_categories(list/categories, menu_num)
|
||||
if(!categories)
|
||||
return
|
||||
|
||||
var/line_length = 1
|
||||
var/list/l = "<table style='width:100%' align='center'><tr>"
|
||||
|
||||
for(var/C in categories)
|
||||
if(line_length > 2)
|
||||
l += "</tr><tr>"
|
||||
line_length = 1
|
||||
|
||||
l += "<td><A href='?src=[REF(src)];category=[C];switch_screen=[menu_num]'>[C]</A></td>"
|
||||
line_length++
|
||||
|
||||
l += "</tr></table></div>"
|
||||
return l
|
||||
/obj/machinery/rnd/production
|
||||
name = "technology fabricator"
|
||||
desc = "Makes researched and prototype items with materials and energy."
|
||||
layer = BELOW_OBJ_LAYER
|
||||
var/consoleless_interface = FALSE //Whether it can be used without a console.
|
||||
var/efficiency_coeff = 1 //Materials needed / coeff = actual.
|
||||
var/list/categories = list()
|
||||
var/datum/component/remote_materials/materials
|
||||
var/allowed_department_flags = ALL
|
||||
var/production_animation //What's flick()'d on print.
|
||||
var/allowed_buildtypes = NONE
|
||||
var/list/datum/design/cached_designs
|
||||
var/list/datum/design/matching_designs
|
||||
var/department_tag = "Unidentified" //used for material distribution among other things.
|
||||
var/datum/techweb/stored_research
|
||||
var/datum/techweb/host_research
|
||||
|
||||
var/screen = RESEARCH_FABRICATOR_SCREEN_MAIN
|
||||
var/selected_category
|
||||
|
||||
/obj/machinery/rnd/production/Initialize(mapload)
|
||||
. = ..()
|
||||
create_reagents(0, OPENCONTAINER)
|
||||
matching_designs = list()
|
||||
cached_designs = list()
|
||||
stored_research = new
|
||||
host_research = SSresearch.science_tech
|
||||
update_research()
|
||||
materials = AddComponent(/datum/component/remote_materials, "lathe", mapload)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/rnd/production/proc/update_research()
|
||||
host_research.copy_research_to(stored_research, TRUE)
|
||||
update_designs()
|
||||
|
||||
/obj/machinery/rnd/production/proc/update_designs()
|
||||
cached_designs.Cut()
|
||||
for(var/i in stored_research.researched_designs)
|
||||
var/datum/design/d = SSresearch.techweb_design_by_id(i)
|
||||
if((isnull(allowed_department_flags) || (d.departmental_flags & allowed_department_flags)) && (d.build_type & allowed_buildtypes))
|
||||
cached_designs |= d
|
||||
|
||||
/obj/machinery/rnd/production/RefreshParts()
|
||||
calculate_efficiency()
|
||||
|
||||
/obj/machinery/rnd/production/ui_interact(mob/user)
|
||||
if(!consoleless_interface)
|
||||
return ..()
|
||||
user.set_machine(src)
|
||||
var/datum/browser/popup = new(user, "rndconsole", name, 460, 550)
|
||||
popup.set_content(generate_ui())
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/rnd/production/Destroy()
|
||||
QDEL_NULL(stored_research)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/rnd/production/proc/calculate_efficiency()
|
||||
efficiency_coeff = 1
|
||||
if(reagents) //If reagents/materials aren't initialized, don't bother, we'll be doing this again after reagents init anyways.
|
||||
reagents.maximum_volume = 0
|
||||
for(var/obj/item/reagent_containers/glass/G in component_parts)
|
||||
reagents.maximum_volume += G.volume
|
||||
G.reagents.trans_to(src, G.reagents.total_volume)
|
||||
if(materials)
|
||||
var/total_storage = 0
|
||||
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
|
||||
total_storage += M.rating * 75000
|
||||
materials.set_local_size(total_storage)
|
||||
var/total_rating = 0
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
total_rating += M.rating
|
||||
total_rating = max(1, total_rating)
|
||||
efficiency_coeff = total_rating
|
||||
|
||||
//we eject the materials upon deconstruction.
|
||||
/obj/machinery/rnd/production/on_deconstruction()
|
||||
for(var/obj/item/reagent_containers/glass/G in component_parts)
|
||||
reagents.trans_to(G, G.reagents.maximum_volume)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/rnd/production/proc/do_print(path, amount, list/matlist, notify_admins, mob/user)
|
||||
if(notify_admins)
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] has built [amount] of [path] at a [src]([type]).")
|
||||
for(var/i in 1 to amount)
|
||||
var/obj/O = new path(get_turf(src))
|
||||
if(efficient_with(O.type) && isitem(O))
|
||||
var/obj/item/I = O
|
||||
I.materials = matlist.Copy()
|
||||
SSblackbox.record_feedback("nested tally", "item_printed", amount, list("[type]", "[path]"))
|
||||
investigate_log("[key_name(user)] built [amount] of [path] at [src]([type]).", INVESTIGATE_RESEARCH)
|
||||
|
||||
/obj/machinery/rnd/production/proc/check_mat(datum/design/being_built, M) // now returns how many times the item can be built with the material
|
||||
if (!materials.mat_container) // no connected silo
|
||||
return 0
|
||||
var/list/all_materials = being_built.reagents_list + being_built.materials
|
||||
|
||||
var/A = materials.mat_container.amount(M)
|
||||
if(!A)
|
||||
A = reagents.get_reagent_amount(M)
|
||||
|
||||
// these types don't have their .materials set in do_print, so don't allow
|
||||
// them to be constructed efficiently
|
||||
var/ef = efficient_with(being_built.build_path) ? efficiency_coeff : 1
|
||||
return round(A / max(1, all_materials[M] / ef))
|
||||
|
||||
/obj/machinery/rnd/production/proc/efficient_with(path)
|
||||
return !ispath(path, /obj/item/stack/sheet) && !ispath(path, /obj/item/stack/ore/bluespace_crystal)
|
||||
|
||||
/obj/machinery/rnd/production/proc/user_try_print_id(id, amount)
|
||||
if((!istype(linked_console) && requires_console) || !id)
|
||||
return FALSE
|
||||
if(istext(amount))
|
||||
amount = text2num(amount)
|
||||
if(isnull(amount))
|
||||
amount = 1
|
||||
var/datum/design/D = (linked_console || requires_console)? (linked_console.stored_research.researched_designs[id]? SSresearch.techweb_design_by_id(id) : null) : SSresearch.techweb_design_by_id(id)
|
||||
if(!istype(D))
|
||||
return FALSE
|
||||
if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
|
||||
say("Warning: Printing failed: This fabricator does not have the necessary keys to decrypt design schematics. Please update the research data with the on-screen button and contact Nanotrasen Support!")
|
||||
return FALSE
|
||||
if(D.build_type && !(D.build_type & allowed_buildtypes))
|
||||
say("This machine does not have the necessary manipulation systems for this design. Please contact Nanotrasen Support!")
|
||||
return FALSE
|
||||
if(!materials.mat_container)
|
||||
say("No connection to material storage, please contact the quartermaster.")
|
||||
return FALSE
|
||||
if(materials.on_hold())
|
||||
say("Mineral access is on hold, please contact the quartermaster.")
|
||||
return FALSE
|
||||
var/power = 1000
|
||||
amount = CLAMP(amount, 1, 50)
|
||||
for(var/M in D.materials)
|
||||
power += round(D.materials[M] * amount / 35)
|
||||
power = min(3000, power)
|
||||
use_power(power)
|
||||
var/coeff = efficient_with(D.build_path) ? efficiency_coeff : 1
|
||||
var/list/efficient_mats = list()
|
||||
for(var/MAT in D.materials)
|
||||
efficient_mats[MAT] = D.materials[MAT]/coeff
|
||||
if(!materials.mat_container.has_materials(efficient_mats, amount))
|
||||
say("Not enough materials to complete prototype[amount > 1? "s" : ""].")
|
||||
return FALSE
|
||||
for(var/R in D.reagents_list)
|
||||
if(!reagents.has_reagent(R, D.reagents_list[R]*amount/coeff))
|
||||
say("Not enough reagents to complete prototype[amount > 1? "s" : ""].")
|
||||
return FALSE
|
||||
materials.mat_container.use_amount(efficient_mats, amount)
|
||||
materials.silo_log(src, "built", -amount, "[D.name]", efficient_mats)
|
||||
for(var/R in D.reagents_list)
|
||||
reagents.remove_reagent(R, D.reagents_list[R]*amount/coeff)
|
||||
busy = TRUE
|
||||
if(production_animation)
|
||||
flick(production_animation, src)
|
||||
var/timecoeff = D.lathe_time_factor / efficiency_coeff
|
||||
addtimer(CALLBACK(src, .proc/reset_busy), (30 * timecoeff * amount) ** 0.5)
|
||||
addtimer(CALLBACK(src, .proc/do_print, D.build_path, amount, efficient_mats, D.dangerous_construction, usr), (32 * timecoeff * amount) ** 0.8)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/rnd/production/proc/search(string)
|
||||
matching_designs.Cut()
|
||||
for(var/v in stored_research.researched_designs)
|
||||
var/datum/design/D = SSresearch.techweb_design_by_id(v)
|
||||
if(!(D.build_type & allowed_buildtypes) || !(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
|
||||
continue
|
||||
if(findtext(D.name,string))
|
||||
matching_designs.Add(D)
|
||||
|
||||
/obj/machinery/rnd/production/proc/generate_ui()
|
||||
var/list/ui = list()
|
||||
ui += ui_header()
|
||||
switch(screen)
|
||||
if(RESEARCH_FABRICATOR_SCREEN_MATERIALS)
|
||||
ui += ui_screen_materials()
|
||||
if(RESEARCH_FABRICATOR_SCREEN_CHEMICALS)
|
||||
ui += ui_screen_chemicals()
|
||||
if(RESEARCH_FABRICATOR_SCREEN_SEARCH)
|
||||
ui += ui_screen_search()
|
||||
if(RESEARCH_FABRICATOR_SCREEN_CATEGORYVIEW)
|
||||
ui += ui_screen_category_view()
|
||||
else
|
||||
ui += ui_screen_main()
|
||||
for(var/i in 1 to length(ui))
|
||||
if(!findtextEx(ui[i], RDSCREEN_NOBREAK))
|
||||
ui[i] += "<br>"
|
||||
ui[i] = replacetextEx(ui[i], RDSCREEN_NOBREAK, "")
|
||||
return ui.Join("")
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_header()
|
||||
var/list/l = list()
|
||||
l += "<div class='statusDisplay'><b>[host_research.organization] [department_tag] Department Lathe</b>"
|
||||
l += "Security protocols: [(obj_flags & EMAGGED)? "<font color='red'>Disabled</font>" : "<font color='green'>Enabled</font>"]"
|
||||
if (materials.mat_container)
|
||||
l += "<A href='?src=[REF(src)];switch_screen=[RESEARCH_FABRICATOR_SCREEN_MATERIALS]'><B>Material Amount:</B> [materials.format_amount()]</A>"
|
||||
else
|
||||
l += "<font color='red'>No material storage connected, please contact the quartermaster.</font>"
|
||||
l += "<A href='?src=[REF(src)];switch_screen=[RESEARCH_FABRICATOR_SCREEN_CHEMICALS]'><B>Chemical volume:</B> [reagents.total_volume] / [reagents.maximum_volume]</A>"
|
||||
l += "<a href='?src=[REF(src)];sync_research=1'>Synchronize Research</a>"
|
||||
l += "<a href='?src=[REF(src)];switch_screen=[RESEARCH_FABRICATOR_SCREEN_MAIN]'>Main Screen</a></div>[RDSCREEN_NOBREAK]"
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_screen_materials()
|
||||
if (!materials.mat_container)
|
||||
screen = RESEARCH_FABRICATOR_SCREEN_MAIN
|
||||
return ui_screen_main()
|
||||
var/list/l = list()
|
||||
l += "<div class='statusDisplay'><h3>Material Storage:</h3>"
|
||||
for(var/mat_id in materials.mat_container.materials)
|
||||
var/datum/material/M = materials.mat_container.materials[mat_id]
|
||||
l += "* [M.amount] of [M.name]: "
|
||||
if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];ejectsheet=[M.id];eject_amt=1'>Eject</A> [RDSCREEN_NOBREAK]"
|
||||
if(M.amount >= MINERAL_MATERIAL_AMOUNT*5) l += "<A href='?src=[REF(src)];ejectsheet=[M.id];eject_amt=5'>5x</A> [RDSCREEN_NOBREAK]"
|
||||
if(M.amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];ejectsheet=[M.id];eject_amt=50'>All</A>[RDSCREEN_NOBREAK]"
|
||||
l += ""
|
||||
l += "</div>[RDSCREEN_NOBREAK]"
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_screen_chemicals()
|
||||
var/list/l = list()
|
||||
l += "<div class='statusDisplay'><A href='?src=[REF(src)];disposeall=1'>Disposal All Chemicals in Storage</A>"
|
||||
l += "<h3>Chemical Storage:</h3>"
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
l += "[R.name]: [R.volume]"
|
||||
l += "<A href='?src=[REF(src)];dispose=[R.type]'>Purge</A>"
|
||||
l += "</div>"
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_screen_search()
|
||||
var/list/l = list()
|
||||
var/coeff = efficiency_coeff
|
||||
l += "<h2>Search Results:</h2>"
|
||||
l += "<form name='search' action='?src=[REF(src)]'>\
|
||||
<input type='hidden' name='src' value='[REF(src)]'>\
|
||||
<input type='hidden' name='search' value='to_search'>\
|
||||
<input type='text' name='to_search'>\
|
||||
<input type='submit' value='Search'>\
|
||||
</form><HR>"
|
||||
for(var/datum/design/D in matching_designs)
|
||||
l += design_menu_entry(D, coeff)
|
||||
l += "</div>"
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/design_menu_entry(datum/design/D, coeff)
|
||||
if(!istype(D))
|
||||
return
|
||||
if(!coeff)
|
||||
coeff = efficiency_coeff
|
||||
if(!efficient_with(D.build_path))
|
||||
coeff = 1
|
||||
var/list/l = list()
|
||||
var/temp_material
|
||||
var/c = 50
|
||||
var/t
|
||||
var/all_materials = D.materials + D.reagents_list
|
||||
for(var/M in all_materials)
|
||||
t = check_mat(D, M)
|
||||
temp_material += " | "
|
||||
if (t < 1)
|
||||
temp_material += "<span class='bad'>[all_materials[M]/coeff] [CallMaterialName(M)]</span>"
|
||||
else
|
||||
temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]"
|
||||
c = min(c,t)
|
||||
|
||||
if (c >= 1)
|
||||
l += "<A href='?src=[REF(src)];build=[D.id];amount=1'>[D.name]</A>[RDSCREEN_NOBREAK]"
|
||||
if(c >= 5)
|
||||
l += "<A href='?src=[REF(src)];build=[D.id];amount=5'>x5</A>[RDSCREEN_NOBREAK]"
|
||||
if(c >= 10)
|
||||
l += "<A href='?src=[REF(src)];build=[D.id];amount=10'>x10</A>[RDSCREEN_NOBREAK]"
|
||||
l += "[temp_material][RDSCREEN_NOBREAK]"
|
||||
else
|
||||
l += "<span class='linkOff'>[D.name]</span>[temp_material][RDSCREEN_NOBREAK]"
|
||||
l += ""
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/Topic(raw, ls)
|
||||
if(..())
|
||||
return
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
if(ls["switch_screen"])
|
||||
screen = text2num(ls["switch_screen"])
|
||||
if(ls["build"]) //Causes the Protolathe to build something.
|
||||
if(busy)
|
||||
say("Warning: Fabricators busy!")
|
||||
else
|
||||
user_try_print_id(ls["build"], ls["amount"])
|
||||
if(ls["search"]) //Search for designs with name matching pattern
|
||||
search(ls["to_search"])
|
||||
screen = RESEARCH_FABRICATOR_SCREEN_SEARCH
|
||||
if(ls["sync_research"])
|
||||
update_research()
|
||||
say("Synchronizing research with host technology database.")
|
||||
if(ls["category"])
|
||||
selected_category = ls["category"]
|
||||
if(ls["dispose"]) //Causes the protolathe to dispose of a single reagent (all of it)
|
||||
reagents.del_reagent(ls["dispose"])
|
||||
if(ls["disposeall"]) //Causes the protolathe to dispose of all it's reagents.
|
||||
reagents.clear_reagents()
|
||||
if(ls["ejectsheet"]) //Causes the protolathe to eject a sheet of material
|
||||
eject_sheets(ls["ejectsheet"], ls["eject_amt"])
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/rnd/production/proc/eject_sheets(eject_sheet, eject_amt)
|
||||
var/datum/component/material_container/mat_container = materials.mat_container
|
||||
if (!mat_container)
|
||||
say("No access to material storage, please contact the quartermaster.")
|
||||
return 0
|
||||
if (materials.on_hold())
|
||||
say("Mineral access is on hold, please contact the quartermaster.")
|
||||
return 0
|
||||
var/count = mat_container.retrieve_sheets(text2num(eject_amt), eject_sheet, drop_location())
|
||||
var/list/matlist = list()
|
||||
matlist[eject_sheet] = MINERAL_MATERIAL_AMOUNT
|
||||
materials.silo_log(src, "ejected", -count, "sheets", matlist)
|
||||
return count
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_screen_main()
|
||||
var/list/l = list()
|
||||
l += "<form name='search' action='?src=[REF(src)]'>\
|
||||
<input type='hidden' name='src' value='[REF(src)]'>\
|
||||
<input type='hidden' name='search' value='to_search'>\
|
||||
<input type='hidden' name='type' value='proto'>\
|
||||
<input type='text' name='to_search'>\
|
||||
<input type='submit' value='Search'>\
|
||||
</form><HR>"
|
||||
|
||||
l += list_categories(categories, RESEARCH_FABRICATOR_SCREEN_CATEGORYVIEW)
|
||||
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/ui_screen_category_view()
|
||||
if(!selected_category)
|
||||
return ui_screen_main()
|
||||
var/list/l = list()
|
||||
l += "<div class='statusDisplay'><h3>Browsing [selected_category]:</h3>"
|
||||
var/coeff = efficiency_coeff
|
||||
for(var/v in stored_research.researched_designs)
|
||||
var/datum/design/D = SSresearch.techweb_design_by_id(v)
|
||||
if(!(selected_category in D.category)|| !(D.build_type & allowed_buildtypes))
|
||||
continue
|
||||
if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
|
||||
continue
|
||||
l += design_menu_entry(D, coeff)
|
||||
l += "</div>"
|
||||
return l
|
||||
|
||||
/obj/machinery/rnd/production/proc/list_categories(list/categories, menu_num)
|
||||
if(!categories)
|
||||
return
|
||||
|
||||
var/line_length = 1
|
||||
var/list/l = "<table style='width:100%' align='center'><tr>"
|
||||
|
||||
for(var/C in categories)
|
||||
if(line_length > 2)
|
||||
l += "</tr><tr>"
|
||||
line_length = 1
|
||||
|
||||
l += "<td><A href='?src=[REF(src)];category=[C];switch_screen=[menu_num]'>[C]</A></td>"
|
||||
line_length++
|
||||
|
||||
l += "</tr></table></div>"
|
||||
return l
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
/obj/machinery/rnd/production/circuit_imprinter
|
||||
name = "circuit imprinter"
|
||||
desc = "Manufactures circuit boards for the construction of machines."
|
||||
icon_state = "circuit_imprinter"
|
||||
circuit = /obj/item/circuitboard/machine/circuit_imprinter
|
||||
categories = list(
|
||||
"AI Modules",
|
||||
"Computer Boards",
|
||||
"Teleportation Machinery",
|
||||
"Medical Machinery",
|
||||
"Engineering Machinery",
|
||||
"Exosuit Modules",
|
||||
"Hydroponics Machinery",
|
||||
"Subspace Telecomms",
|
||||
"Research Machinery",
|
||||
"Misc. Machinery",
|
||||
"Computer Parts"
|
||||
)
|
||||
production_animation = "circuit_imprinter_ani"
|
||||
allowed_buildtypes = IMPRINTER
|
||||
|
||||
/obj/machinery/rnd/production/circuit_imprinter/disconnect_console()
|
||||
linked_console.linked_imprinter = null
|
||||
..()
|
||||
|
||||
/obj/machinery/rnd/production/circuit_imprinter/calculate_efficiency()
|
||||
. = ..()
|
||||
var/total_rating = 0
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
total_rating += M.rating * 2 //There is only one.
|
||||
total_rating = max(1, total_rating)
|
||||
efficiency_coeff = total_rating
|
||||
/obj/machinery/rnd/production/circuit_imprinter
|
||||
name = "circuit imprinter"
|
||||
desc = "Manufactures circuit boards for the construction of machines."
|
||||
icon_state = "circuit_imprinter"
|
||||
circuit = /obj/item/circuitboard/machine/circuit_imprinter
|
||||
categories = list(
|
||||
"AI Modules",
|
||||
"Computer Boards",
|
||||
"Teleportation Machinery",
|
||||
"Medical Machinery",
|
||||
"Engineering Machinery",
|
||||
"Exosuit Modules",
|
||||
"Hydroponics Machinery",
|
||||
"Subspace Telecomms",
|
||||
"Research Machinery",
|
||||
"Misc. Machinery",
|
||||
"Computer Parts"
|
||||
)
|
||||
production_animation = "circuit_imprinter_ani"
|
||||
allowed_buildtypes = IMPRINTER
|
||||
|
||||
/obj/machinery/rnd/production/circuit_imprinter/disconnect_console()
|
||||
linked_console.linked_imprinter = null
|
||||
..()
|
||||
|
||||
/obj/machinery/rnd/production/circuit_imprinter/calculate_efficiency()
|
||||
. = ..()
|
||||
var/total_rating = 0
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
total_rating += M.rating * 2 //There is only one.
|
||||
total_rating = max(1, total_rating)
|
||||
efficiency_coeff = total_rating
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/obj/machinery/rnd/production/circuit_imprinter/department
|
||||
name = "department circuit imprinter"
|
||||
desc = "A special circuit imprinter with a built in interface meant for departmental usage, with built in ExoSync receivers allowing it to print designs researched that match its ROM-encoded department type."
|
||||
icon_state = "circuit_imprinter"
|
||||
circuit = /obj/item/circuitboard/machine/circuit_imprinter/department
|
||||
requires_console = FALSE
|
||||
consoleless_interface = TRUE
|
||||
|
||||
/obj/machinery/rnd/production/circuit_imprinter/department/science
|
||||
name = "department circuit imprinter (Science)"
|
||||
circuit = /obj/item/circuitboard/machine/circuit_imprinter/department/science
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SCIENCE
|
||||
/obj/machinery/rnd/production/circuit_imprinter/department
|
||||
name = "department circuit imprinter"
|
||||
desc = "A special circuit imprinter with a built in interface meant for departmental usage, with built in ExoSync receivers allowing it to print designs researched that match its ROM-encoded department type."
|
||||
icon_state = "circuit_imprinter"
|
||||
circuit = /obj/item/circuitboard/machine/circuit_imprinter/department
|
||||
requires_console = FALSE
|
||||
consoleless_interface = TRUE
|
||||
|
||||
/obj/machinery/rnd/production/circuit_imprinter/department/science
|
||||
name = "department circuit imprinter (Science)"
|
||||
circuit = /obj/item/circuitboard/machine/circuit_imprinter/department/science
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SCIENCE
|
||||
department_tag = "Science"
|
||||
@@ -1,43 +1,43 @@
|
||||
/obj/machinery/rnd/production/protolathe/department
|
||||
name = "department protolathe"
|
||||
desc = "A special protolathe with a built in interface meant for departmental usage, with built in ExoSync receivers allowing it to print designs researched that match its ROM-encoded department type."
|
||||
icon_state = "protolathe"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department
|
||||
requires_console = FALSE
|
||||
consoleless_interface = TRUE
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/engineering
|
||||
name = "department protolathe (Engineering)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_ENGINEERING
|
||||
department_tag = "Engineering"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department/engineering
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/service
|
||||
name = "department protolathe (Service)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SERVICE
|
||||
department_tag = "Service"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department/service
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/medical
|
||||
name = "department protolathe (Medical)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_MEDICAL
|
||||
department_tag = "Medical"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department/medical
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/cargo
|
||||
name = "department protolathe (Cargo)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_CARGO
|
||||
department_tag = "Cargo"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department/cargo
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/science
|
||||
name = "department protolathe (Science)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SCIENCE
|
||||
department_tag = "Science"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department/science
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/security
|
||||
name = "department protolathe (Security)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SECURITY
|
||||
department_tag = "Security"
|
||||
/obj/machinery/rnd/production/protolathe/department
|
||||
name = "department protolathe"
|
||||
desc = "A special protolathe with a built in interface meant for departmental usage, with built in ExoSync receivers allowing it to print designs researched that match its ROM-encoded department type."
|
||||
icon_state = "protolathe"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department
|
||||
requires_console = FALSE
|
||||
consoleless_interface = TRUE
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/engineering
|
||||
name = "department protolathe (Engineering)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_ENGINEERING
|
||||
department_tag = "Engineering"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department/engineering
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/service
|
||||
name = "department protolathe (Service)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SERVICE
|
||||
department_tag = "Service"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department/service
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/medical
|
||||
name = "department protolathe (Medical)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_MEDICAL
|
||||
department_tag = "Medical"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department/medical
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/cargo
|
||||
name = "department protolathe (Cargo)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_CARGO
|
||||
department_tag = "Cargo"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department/cargo
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/science
|
||||
name = "department protolathe (Science)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SCIENCE
|
||||
department_tag = "Science"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department/science
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/department/security
|
||||
name = "department protolathe (Security)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SECURITY
|
||||
department_tag = "Security"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe/department/security
|
||||
@@ -1,41 +1,41 @@
|
||||
/obj/machinery/rnd/production/techfab/department
|
||||
name = "department techfab"
|
||||
desc = "An advanced fabricator designed to print out the latest prototypes and circuits researched from Science. Contains hardware to sync to research networks. This one is department-locked and only possesses a limited set of decryption keys."
|
||||
icon_state = "protolathe"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/engineering
|
||||
name = "department techfab (Engineering)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_ENGINEERING
|
||||
department_tag = "Engineering"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department/engineering
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/service
|
||||
name = "department techfab (Service)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SERVICE
|
||||
department_tag = "Service"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department/service
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/medical
|
||||
name = "department techfab (Medical)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_MEDICAL
|
||||
department_tag = "Medical"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department/medical
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/cargo
|
||||
name = "department techfab (Cargo)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_CARGO
|
||||
department_tag = "Cargo"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department/cargo
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/science
|
||||
name = "department techfab (Science)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SCIENCE
|
||||
department_tag = "Science"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department/science
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/security
|
||||
name = "department techfab (Security)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SECURITY
|
||||
department_tag = "Security"
|
||||
/obj/machinery/rnd/production/techfab/department
|
||||
name = "department techfab"
|
||||
desc = "An advanced fabricator designed to print out the latest prototypes and circuits researched from Science. Contains hardware to sync to research networks. This one is department-locked and only possesses a limited set of decryption keys."
|
||||
icon_state = "protolathe"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/engineering
|
||||
name = "department techfab (Engineering)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_ENGINEERING
|
||||
department_tag = "Engineering"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department/engineering
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/service
|
||||
name = "department techfab (Service)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SERVICE
|
||||
department_tag = "Service"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department/service
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/medical
|
||||
name = "department techfab (Medical)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_MEDICAL
|
||||
department_tag = "Medical"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department/medical
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/cargo
|
||||
name = "department techfab (Cargo)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_CARGO
|
||||
department_tag = "Cargo"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department/cargo
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/science
|
||||
name = "department techfab (Science)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SCIENCE
|
||||
department_tag = "Science"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department/science
|
||||
|
||||
/obj/machinery/rnd/production/techfab/department/security
|
||||
name = "department techfab (Security)"
|
||||
allowed_department_flags = DEPARTMENTAL_FLAG_ALL|DEPARTMENTAL_FLAG_SECURITY
|
||||
department_tag = "Security"
|
||||
circuit = /obj/item/circuitboard/machine/techfab/department/security
|
||||
@@ -1,25 +1,25 @@
|
||||
/obj/machinery/rnd/production/protolathe
|
||||
name = "protolathe"
|
||||
desc = "Converts raw materials into useful objects."
|
||||
icon_state = "protolathe"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe
|
||||
categories = list(
|
||||
"Power Designs",
|
||||
"Medical Designs",
|
||||
"Bluespace Designs",
|
||||
"Stock Parts",
|
||||
"Equipment",
|
||||
"Tool Designs",
|
||||
"Mining Designs",
|
||||
"Electronics",
|
||||
"Weapons",
|
||||
"Ammo",
|
||||
"Firing Pins",
|
||||
"Computer Parts"
|
||||
)
|
||||
production_animation = "protolathe_n"
|
||||
allowed_buildtypes = PROTOLATHE
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/disconnect_console()
|
||||
linked_console.linked_lathe = null
|
||||
..()
|
||||
/obj/machinery/rnd/production/protolathe
|
||||
name = "protolathe"
|
||||
desc = "Converts raw materials into useful objects."
|
||||
icon_state = "protolathe"
|
||||
circuit = /obj/item/circuitboard/machine/protolathe
|
||||
categories = list(
|
||||
"Power Designs",
|
||||
"Medical Designs",
|
||||
"Bluespace Designs",
|
||||
"Stock Parts",
|
||||
"Equipment",
|
||||
"Tool Designs",
|
||||
"Mining Designs",
|
||||
"Electronics",
|
||||
"Weapons",
|
||||
"Ammo",
|
||||
"Firing Pins",
|
||||
"Computer Parts"
|
||||
)
|
||||
production_animation = "protolathe_n"
|
||||
allowed_buildtypes = PROTOLATHE
|
||||
|
||||
/obj/machinery/rnd/production/protolathe/disconnect_console()
|
||||
linked_console.linked_lathe = null
|
||||
..()
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
/obj/machinery/rnd/production/techfab
|
||||
name = "technology fabricator"
|
||||
desc = "Produces researched prototypes with raw materials and energy."
|
||||
icon_state = "protolathe"
|
||||
circuit = /obj/item/circuitboard/machine/techfab
|
||||
categories = list(
|
||||
"Power Designs",
|
||||
"Medical Designs",
|
||||
"Bluespace Designs",
|
||||
"Stock Parts",
|
||||
"Equipment",
|
||||
"Tool Designs",
|
||||
"Mining Designs",
|
||||
"Electronics",
|
||||
"Weapons",
|
||||
"Ammo",
|
||||
"Firing Pins",
|
||||
"Computer Parts",
|
||||
"AI Modules",
|
||||
"Computer Boards",
|
||||
"Teleportation Machinery",
|
||||
"Medical Machinery",
|
||||
"Engineering Machinery",
|
||||
"Exosuit Modules",
|
||||
"Hydroponics Machinery",
|
||||
"Subspace Telecomms",
|
||||
"Research Machinery",
|
||||
"Misc. Machinery",
|
||||
"Computer Parts"
|
||||
)
|
||||
console_link = FALSE
|
||||
production_animation = "protolathe_n"
|
||||
requires_console = FALSE
|
||||
consoleless_interface = TRUE
|
||||
allowed_buildtypes = PROTOLATHE | IMPRINTER
|
||||
/obj/machinery/rnd/production/techfab
|
||||
name = "technology fabricator"
|
||||
desc = "Produces researched prototypes with raw materials and energy."
|
||||
icon_state = "protolathe"
|
||||
circuit = /obj/item/circuitboard/machine/techfab
|
||||
categories = list(
|
||||
"Power Designs",
|
||||
"Medical Designs",
|
||||
"Bluespace Designs",
|
||||
"Stock Parts",
|
||||
"Equipment",
|
||||
"Tool Designs",
|
||||
"Mining Designs",
|
||||
"Electronics",
|
||||
"Weapons",
|
||||
"Ammo",
|
||||
"Firing Pins",
|
||||
"Computer Parts",
|
||||
"AI Modules",
|
||||
"Computer Boards",
|
||||
"Teleportation Machinery",
|
||||
"Medical Machinery",
|
||||
"Engineering Machinery",
|
||||
"Exosuit Modules",
|
||||
"Hydroponics Machinery",
|
||||
"Subspace Telecomms",
|
||||
"Research Machinery",
|
||||
"Misc. Machinery",
|
||||
"Computer Parts"
|
||||
)
|
||||
console_link = FALSE
|
||||
production_animation = "protolathe_n"
|
||||
requires_console = FALSE
|
||||
consoleless_interface = TRUE
|
||||
allowed_buildtypes = PROTOLATHE | IMPRINTER
|
||||
|
||||
+1135
-1135
File diff suppressed because it is too large
Load Diff
+106
-106
@@ -1,106 +1,106 @@
|
||||
|
||||
//All devices that link into the R&D console fall into thise type for easy identification and some shared procs.
|
||||
|
||||
|
||||
/obj/machinery/rnd
|
||||
name = "R&D Device"
|
||||
icon = 'icons/obj/machines/research.dmi'
|
||||
density = TRUE
|
||||
use_power = IDLE_POWER_USE
|
||||
var/busy = FALSE
|
||||
var/hacked = FALSE
|
||||
var/console_link = TRUE //allow console link.
|
||||
var/requires_console = TRUE
|
||||
var/disabled = FALSE
|
||||
var/obj/machinery/computer/rdconsole/linked_console
|
||||
var/obj/item/loaded_item = null //the item loaded inside the machine (currently only used by experimentor and destructive analyzer)
|
||||
|
||||
/obj/machinery/rnd/proc/reset_busy()
|
||||
busy = FALSE
|
||||
|
||||
/obj/machinery/rnd/Initialize()
|
||||
. = ..()
|
||||
wires = new /datum/wires/rnd(src)
|
||||
|
||||
/obj/machinery/rnd/Destroy()
|
||||
QDEL_NULL(wires)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/rnd/proc/shock(mob/user, prb)
|
||||
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
|
||||
return FALSE
|
||||
if(!prob(prb))
|
||||
return FALSE
|
||||
do_sparks(5, TRUE, src)
|
||||
if (electrocute_mob(user, get_area(src), src, 0.7, TRUE))
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/rnd/attackby(obj/item/O, mob/user, params)
|
||||
if (default_deconstruction_screwdriver(user, "[initial(icon_state)]_t", initial(icon_state), O))
|
||||
if(linked_console)
|
||||
disconnect_console()
|
||||
return
|
||||
if(default_deconstruction_crowbar(O))
|
||||
return
|
||||
if(panel_open && is_wire_tool(O))
|
||||
wires.interact(user)
|
||||
return TRUE
|
||||
if(is_refillable() && O.is_drainable())
|
||||
return FALSE //inserting reagents into the machine
|
||||
if(Insert_Item(O, user))
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
|
||||
//to disconnect the machine from the r&d console it's linked to
|
||||
/obj/machinery/rnd/proc/disconnect_console()
|
||||
linked_console = null
|
||||
|
||||
//proc used to handle inserting items or reagents into rnd machines
|
||||
/obj/machinery/rnd/proc/Insert_Item(obj/item/I, mob/user)
|
||||
return
|
||||
|
||||
//whether the machine can have an item inserted in its current state.
|
||||
/obj/machinery/rnd/proc/is_insertion_ready(mob/user)
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='warning'>You can't load [src] while it's opened!</span>")
|
||||
return FALSE
|
||||
if(disabled)
|
||||
to_chat(user, "<span class='warning'>The insertion belts of [src] won't engage!</span>")
|
||||
return FALSE
|
||||
if(requires_console && !linked_console)
|
||||
to_chat(user, "<span class='warning'>[src] must be linked to an R&D console first!</span>")
|
||||
return FALSE
|
||||
if(busy)
|
||||
to_chat(user, "<span class='warning'>[src] is busy right now.</span>")
|
||||
return FALSE
|
||||
if(stat & BROKEN)
|
||||
to_chat(user, "<span class='warning'>[src] is broken.</span>")
|
||||
return FALSE
|
||||
if(stat & NOPOWER)
|
||||
to_chat(user, "<span class='warning'>[src] has no power.</span>")
|
||||
return FALSE
|
||||
if(loaded_item)
|
||||
to_chat(user, "<span class='warning'>[src] is already loaded.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//we eject the loaded item when deconstructing the machine
|
||||
/obj/machinery/rnd/on_deconstruction()
|
||||
if(loaded_item)
|
||||
loaded_item.forceMove(loc)
|
||||
..()
|
||||
|
||||
/obj/machinery/rnd/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted)
|
||||
var/stack_name
|
||||
if(ispath(type_inserted, /obj/item/stack/ore/bluespace_crystal))
|
||||
stack_name = "bluespace"
|
||||
use_power(MINERAL_MATERIAL_AMOUNT / 10)
|
||||
else
|
||||
var/obj/item/stack/S = type_inserted
|
||||
stack_name = initial(S.name)
|
||||
use_power(min(1000, (amount_inserted / 100)))
|
||||
add_overlay("protolathe_[stack_name]")
|
||||
addtimer(CALLBACK(src, /atom/proc/cut_overlay, "protolathe_[stack_name]"), 10)
|
||||
|
||||
//All devices that link into the R&D console fall into thise type for easy identification and some shared procs.
|
||||
|
||||
|
||||
/obj/machinery/rnd
|
||||
name = "R&D Device"
|
||||
icon = 'icons/obj/machines/research.dmi'
|
||||
density = TRUE
|
||||
use_power = IDLE_POWER_USE
|
||||
var/busy = FALSE
|
||||
var/hacked = FALSE
|
||||
var/console_link = TRUE //allow console link.
|
||||
var/requires_console = TRUE
|
||||
var/disabled = FALSE
|
||||
var/obj/machinery/computer/rdconsole/linked_console
|
||||
var/obj/item/loaded_item = null //the item loaded inside the machine (currently only used by experimentor and destructive analyzer)
|
||||
|
||||
/obj/machinery/rnd/proc/reset_busy()
|
||||
busy = FALSE
|
||||
|
||||
/obj/machinery/rnd/Initialize()
|
||||
. = ..()
|
||||
wires = new /datum/wires/rnd(src)
|
||||
|
||||
/obj/machinery/rnd/Destroy()
|
||||
QDEL_NULL(wires)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/rnd/proc/shock(mob/user, prb)
|
||||
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
|
||||
return FALSE
|
||||
if(!prob(prb))
|
||||
return FALSE
|
||||
do_sparks(5, TRUE, src)
|
||||
if (electrocute_mob(user, get_area(src), src, 0.7, TRUE))
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/rnd/attackby(obj/item/O, mob/user, params)
|
||||
if (default_deconstruction_screwdriver(user, "[initial(icon_state)]_t", initial(icon_state), O))
|
||||
if(linked_console)
|
||||
disconnect_console()
|
||||
return
|
||||
if(default_deconstruction_crowbar(O))
|
||||
return
|
||||
if(panel_open && is_wire_tool(O))
|
||||
wires.interact(user)
|
||||
return TRUE
|
||||
if(is_refillable() && O.is_drainable())
|
||||
return FALSE //inserting reagents into the machine
|
||||
if(Insert_Item(O, user))
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
|
||||
//to disconnect the machine from the r&d console it's linked to
|
||||
/obj/machinery/rnd/proc/disconnect_console()
|
||||
linked_console = null
|
||||
|
||||
//proc used to handle inserting items or reagents into rnd machines
|
||||
/obj/machinery/rnd/proc/Insert_Item(obj/item/I, mob/user)
|
||||
return
|
||||
|
||||
//whether the machine can have an item inserted in its current state.
|
||||
/obj/machinery/rnd/proc/is_insertion_ready(mob/user)
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='warning'>You can't load [src] while it's opened!</span>")
|
||||
return FALSE
|
||||
if(disabled)
|
||||
to_chat(user, "<span class='warning'>The insertion belts of [src] won't engage!</span>")
|
||||
return FALSE
|
||||
if(requires_console && !linked_console)
|
||||
to_chat(user, "<span class='warning'>[src] must be linked to an R&D console first!</span>")
|
||||
return FALSE
|
||||
if(busy)
|
||||
to_chat(user, "<span class='warning'>[src] is busy right now.</span>")
|
||||
return FALSE
|
||||
if(stat & BROKEN)
|
||||
to_chat(user, "<span class='warning'>[src] is broken.</span>")
|
||||
return FALSE
|
||||
if(stat & NOPOWER)
|
||||
to_chat(user, "<span class='warning'>[src] has no power.</span>")
|
||||
return FALSE
|
||||
if(loaded_item)
|
||||
to_chat(user, "<span class='warning'>[src] is already loaded.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//we eject the loaded item when deconstructing the machine
|
||||
/obj/machinery/rnd/on_deconstruction()
|
||||
if(loaded_item)
|
||||
loaded_item.forceMove(loc)
|
||||
..()
|
||||
|
||||
/obj/machinery/rnd/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted)
|
||||
var/stack_name
|
||||
if(ispath(type_inserted, /obj/item/stack/ore/bluespace_crystal))
|
||||
stack_name = "bluespace"
|
||||
use_power(MINERAL_MATERIAL_AMOUNT / 10)
|
||||
else
|
||||
var/obj/item/stack/S = type_inserted
|
||||
stack_name = initial(S.name)
|
||||
use_power(min(1000, (amount_inserted / 100)))
|
||||
add_overlay("protolathe_[stack_name]")
|
||||
addtimer(CALLBACK(src, /atom/proc/cut_overlay, "protolathe_[stack_name]"), 10)
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
|
||||
/obj/item/disk/tech_disk
|
||||
name = "technology disk"
|
||||
desc = "A disk for storing technology data for further research."
|
||||
icon_state = "datadisk0"
|
||||
materials = list(MAT_METAL=300, MAT_GLASS=100)
|
||||
var/datum/techweb/stored_research
|
||||
|
||||
/obj/item/disk/tech_disk/Initialize()
|
||||
. = ..()
|
||||
pixel_x = rand(-5, 5)
|
||||
pixel_y = rand(-5, 5)
|
||||
stored_research = new /datum/techweb
|
||||
|
||||
/obj/item/disk/tech_disk/debug
|
||||
name = "\improper CentCom technology disk"
|
||||
desc = "A debug item for research"
|
||||
materials = list()
|
||||
|
||||
/obj/item/disk/tech_disk/debug/Initialize()
|
||||
. = ..()
|
||||
stored_research = new /datum/techweb/admin
|
||||
|
||||
/obj/item/disk/tech_disk/illegal
|
||||
name = "Illegal technology disk"
|
||||
desc = "A technology disk containing schematics for syndicate inspired equipment."
|
||||
materials = list()
|
||||
|
||||
/obj/item/disk/tech_disk/illegal/Initialize()
|
||||
. = ..()
|
||||
stored_research = new /datum/techweb/syndicate
|
||||
|
||||
/obj/item/disk/tech_disk/abductor
|
||||
name = "Gray technology disk"
|
||||
desc = "You feel like it's not Gray because of its color."
|
||||
materials = list()
|
||||
|
||||
/obj/item/disk/tech_disk/abductor/Initialize()
|
||||
. = ..()
|
||||
stored_research = new /datum/techweb/abductor
|
||||
|
||||
/obj/item/disk/tech_disk
|
||||
name = "technology disk"
|
||||
desc = "A disk for storing technology data for further research."
|
||||
icon_state = "datadisk0"
|
||||
materials = list(MAT_METAL=300, MAT_GLASS=100)
|
||||
var/datum/techweb/stored_research
|
||||
|
||||
/obj/item/disk/tech_disk/Initialize()
|
||||
. = ..()
|
||||
pixel_x = rand(-5, 5)
|
||||
pixel_y = rand(-5, 5)
|
||||
stored_research = new /datum/techweb
|
||||
|
||||
/obj/item/disk/tech_disk/debug
|
||||
name = "\improper CentCom technology disk"
|
||||
desc = "A debug item for research"
|
||||
materials = list()
|
||||
|
||||
/obj/item/disk/tech_disk/debug/Initialize()
|
||||
. = ..()
|
||||
stored_research = new /datum/techweb/admin
|
||||
|
||||
/obj/item/disk/tech_disk/illegal
|
||||
name = "Illegal technology disk"
|
||||
desc = "A technology disk containing schematics for syndicate inspired equipment."
|
||||
materials = list()
|
||||
|
||||
/obj/item/disk/tech_disk/illegal/Initialize()
|
||||
. = ..()
|
||||
stored_research = new /datum/techweb/syndicate
|
||||
|
||||
/obj/item/disk/tech_disk/abductor
|
||||
name = "Gray technology disk"
|
||||
desc = "You feel like it's not Gray because of its color."
|
||||
materials = list()
|
||||
|
||||
/obj/item/disk/tech_disk/abductor/Initialize()
|
||||
. = ..()
|
||||
stored_research = new /datum/techweb/abductor
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
/proc/count_unique_techweb_nodes()
|
||||
var/static/list/L = typesof(/datum/techweb_node)
|
||||
return L.len
|
||||
|
||||
/proc/count_unique_techweb_designs()
|
||||
var/static/list/L = typesof(/datum/design)
|
||||
return L.len
|
||||
|
||||
/proc/node_boost_error(id, message)
|
||||
WARNING("Invalid boost information for node \[[id]\]: [message]")
|
||||
SSresearch.invalid_node_boost[id] = message
|
||||
|
||||
/proc/techweb_item_boost_check(obj/item/I) //Returns an associative list of techweb node datums with values of the boost it gives. var/list/returned = list()
|
||||
if(SSresearch.techweb_boost_items[I.type])
|
||||
return SSresearch.techweb_boost_items[I.type] //It should already be formatted in node datum = list(point type = value)
|
||||
|
||||
/proc/techweb_item_point_check(obj/item/I)
|
||||
if(SSresearch.techweb_point_items[I.type])
|
||||
return SSresearch.techweb_point_items[I.type]
|
||||
|
||||
/proc/techweb_point_display_generic(pointlist)
|
||||
var/list/ret = list()
|
||||
for(var/i in pointlist)
|
||||
if(SSresearch.point_types[i])
|
||||
ret += "[SSresearch.point_types[i]]: [pointlist[i]]"
|
||||
else
|
||||
ret += "ERRORED POINT TYPE: [pointlist[i]]"
|
||||
return ret.Join("<BR>")
|
||||
|
||||
/proc/techweb_point_display_rdconsole(pointlist, last_pointlist)
|
||||
var/list/ret = list()
|
||||
for(var/i in pointlist)
|
||||
ret += "[SSresearch.point_types[i] || "ERRORED POINT TYPE"]: [pointlist[i]] (+[(last_pointlist[i]) * ((SSresearch.flags & SS_TICKER)? (600 / (world.tick_lag * SSresearch.wait)) : (600 / SSresearch.wait))]/ minute)"
|
||||
return ret.Join("<BR>")
|
||||
/proc/count_unique_techweb_nodes()
|
||||
var/static/list/L = typesof(/datum/techweb_node)
|
||||
return L.len
|
||||
|
||||
/proc/count_unique_techweb_designs()
|
||||
var/static/list/L = typesof(/datum/design)
|
||||
return L.len
|
||||
|
||||
/proc/node_boost_error(id, message)
|
||||
WARNING("Invalid boost information for node \[[id]\]: [message]")
|
||||
SSresearch.invalid_node_boost[id] = message
|
||||
|
||||
/proc/techweb_item_boost_check(obj/item/I) //Returns an associative list of techweb node datums with values of the boost it gives. var/list/returned = list()
|
||||
if(SSresearch.techweb_boost_items[I.type])
|
||||
return SSresearch.techweb_boost_items[I.type] //It should already be formatted in node datum = list(point type = value)
|
||||
|
||||
/proc/techweb_item_point_check(obj/item/I)
|
||||
if(SSresearch.techweb_point_items[I.type])
|
||||
return SSresearch.techweb_point_items[I.type]
|
||||
|
||||
/proc/techweb_point_display_generic(pointlist)
|
||||
var/list/ret = list()
|
||||
for(var/i in pointlist)
|
||||
if(SSresearch.point_types[i])
|
||||
ret += "[SSresearch.point_types[i]]: [pointlist[i]]"
|
||||
else
|
||||
ret += "ERRORED POINT TYPE: [pointlist[i]]"
|
||||
return ret.Join("<BR>")
|
||||
|
||||
/proc/techweb_point_display_rdconsole(pointlist, last_pointlist)
|
||||
var/list/ret = list()
|
||||
for(var/i in pointlist)
|
||||
ret += "[SSresearch.point_types[i] || "ERRORED POINT TYPE"]: [pointlist[i]] (+[(last_pointlist[i]) * ((SSresearch.flags & SS_TICKER)? (600 / (world.tick_lag * SSresearch.wait)) : (600 / SSresearch.wait))]/ minute)"
|
||||
return ret.Join("<BR>")
|
||||
|
||||
@@ -1,389 +1,389 @@
|
||||
|
||||
//Used \n[\s]*origin_tech[\s]*=[\s]*"[\S]+" to delete all origin techs.
|
||||
//Or \n[\s]*origin_tech[\s]*=[\s]list\([A-Z_\s=0-9,]*\)
|
||||
//Used \n[\s]*req_tech[\s]*=[\s]*list\(["a-z\s=0-9,]*\) to delete all req_techs.
|
||||
|
||||
//Techweb datums are meant to store unlocked research, being able to be stored on research consoles, servers, and disks. They are NOT global.
|
||||
/datum/techweb
|
||||
var/list/researched_nodes = list() //Already unlocked and all designs are now available. Assoc list, id = TRUE
|
||||
var/list/visible_nodes = list() //Visible nodes, doesn't mean it can be researched. Assoc list, id = TRUE
|
||||
var/list/available_nodes = list() //Nodes that can immediately be researched, all reqs met. assoc list, id = TRUE
|
||||
var/list/researched_designs = list() //Designs that are available for use. Assoc list, id = TRUE
|
||||
var/list/custom_designs = list() //Custom inserted designs like from disks that should survive recalculation.
|
||||
var/list/boosted_nodes = list() //Already boosted nodes that can't be boosted again. node id = path of boost object.
|
||||
var/list/hidden_nodes = list() //Hidden nodes. id = TRUE. Used for unhiding nodes when requirements are met by removing the entry of the node.
|
||||
var/list/deconstructed_items = list() //items already deconstructed for a generic point boost. path = list(point_type = points)
|
||||
var/list/research_points = list() //Available research points. type = number
|
||||
var/list/obj/machinery/computer/rdconsole/consoles_accessing = list()
|
||||
var/id = "generic"
|
||||
var/list/research_logs = list() //IC logs.
|
||||
var/largest_bomb_value = 0
|
||||
var/organization = "Third-Party" //Organization name, used for display.
|
||||
var/list/last_bitcoins = list() //Current per-second production, used for display only.
|
||||
var/list/tiers = list() //Assoc list, id = number, 1 is available, 2 is all reqs are 1, so on
|
||||
|
||||
/datum/techweb/New()
|
||||
for(var/i in SSresearch.techweb_nodes_starting)
|
||||
var/datum/techweb_node/DN = SSresearch.techweb_node_by_id(i)
|
||||
research_node(DN, TRUE, FALSE)
|
||||
hidden_nodes = SSresearch.techweb_nodes_hidden.Copy()
|
||||
return ..()
|
||||
|
||||
/datum/techweb/admin
|
||||
id = "ADMIN"
|
||||
organization = "CentCom"
|
||||
|
||||
/datum/techweb/admin/New() //All unlocked.
|
||||
. = ..()
|
||||
for(var/i in SSresearch.techweb_nodes)
|
||||
var/datum/techweb_node/TN = SSresearch.techweb_nodes[i]
|
||||
research_node(TN, TRUE)
|
||||
for(var/i in SSresearch.point_types)
|
||||
research_points[i] = INFINITY
|
||||
hidden_nodes = list()
|
||||
|
||||
/datum/techweb/syndicate
|
||||
id = "SYNDICATE"
|
||||
organization = "Syndicate"
|
||||
|
||||
/datum/techweb/syndicate/New()
|
||||
var/datum/techweb_node/syndicate_basic/Node = new()
|
||||
research_node(Node, TRUE)
|
||||
|
||||
/datum/techweb/abductor
|
||||
id = "ABDUCTOR"
|
||||
organization = "Aliens"
|
||||
|
||||
/datum/techweb/abductor/New()
|
||||
var/datum/techweb_node/alientech/Node = new()
|
||||
research_node(Node, TRUE)
|
||||
|
||||
/datum/techweb/science //Global science techweb for RND consoles.
|
||||
id = "SCIENCE"
|
||||
organization = "Nanotrasen"
|
||||
|
||||
/datum/techweb/Destroy()
|
||||
researched_nodes = null
|
||||
researched_designs = null
|
||||
available_nodes = null
|
||||
visible_nodes = null
|
||||
custom_designs = null
|
||||
SSresearch.techwebs -= src
|
||||
return ..()
|
||||
|
||||
/datum/techweb/proc/recalculate_nodes(recalculate_designs = FALSE, wipe_custom_designs = FALSE)
|
||||
var/list/datum/techweb_node/processing = list()
|
||||
for(var/id in researched_nodes)
|
||||
processing[id] = TRUE
|
||||
for(var/id in visible_nodes)
|
||||
processing[id] = TRUE
|
||||
for(var/id in available_nodes)
|
||||
processing[id] = TRUE
|
||||
if(recalculate_designs)
|
||||
researched_designs = custom_designs.Copy()
|
||||
if(wipe_custom_designs)
|
||||
custom_designs = list()
|
||||
for(var/id in processing)
|
||||
update_node_status(SSresearch.techweb_node_by_id(id), FALSE)
|
||||
CHECK_TICK
|
||||
for(var/v in consoles_accessing)
|
||||
var/obj/machinery/computer/rdconsole/V = v
|
||||
V.rescan_views()
|
||||
V.updateUsrDialog()
|
||||
|
||||
/datum/techweb/proc/add_point_list(list/pointlist)
|
||||
for(var/i in pointlist)
|
||||
if(SSresearch.point_types[i] && pointlist[i] > 0)
|
||||
research_points[i] += pointlist[i]
|
||||
|
||||
/datum/techweb/proc/add_points_all(amount)
|
||||
var/list/l = SSresearch.point_types.Copy()
|
||||
for(var/i in l)
|
||||
l[i] = amount
|
||||
add_point_list(l)
|
||||
|
||||
/datum/techweb/proc/remove_point_list(list/pointlist)
|
||||
for(var/i in pointlist)
|
||||
if(SSresearch.point_types[i] && pointlist[i] > 0)
|
||||
research_points[i] = max(0, research_points[i] - pointlist[i])
|
||||
|
||||
/datum/techweb/proc/remove_points_all(amount)
|
||||
var/list/l = SSresearch.point_types.Copy()
|
||||
for(var/i in l)
|
||||
l[i] = amount
|
||||
remove_point_list(l)
|
||||
|
||||
/datum/techweb/proc/modify_point_list(list/pointlist)
|
||||
for(var/i in pointlist)
|
||||
if(SSresearch.point_types[i] && pointlist[i] != 0)
|
||||
research_points[i] = max(0, research_points[i] + pointlist[i])
|
||||
|
||||
/datum/techweb/proc/modify_points_all(amount)
|
||||
var/list/l = SSresearch.point_types.Copy()
|
||||
for(var/i in l)
|
||||
l[i] = amount
|
||||
modify_point_list(l)
|
||||
|
||||
/datum/techweb/proc/copy_research_to(datum/techweb/receiver, unlock_hidden = TRUE) //Adds any missing research to theirs.
|
||||
for(var/i in researched_nodes)
|
||||
CHECK_TICK
|
||||
receiver.research_node_id(i, TRUE, FALSE)
|
||||
for(var/i in researched_designs)
|
||||
CHECK_TICK
|
||||
receiver.add_design_by_id(i)
|
||||
if(unlock_hidden)
|
||||
for(var/i in receiver.hidden_nodes)
|
||||
CHECK_TICK
|
||||
if(!hidden_nodes[i])
|
||||
receiver.hidden_nodes -= i //We can see it so let them see it too.
|
||||
receiver.recalculate_nodes()
|
||||
|
||||
/datum/techweb/proc/copy()
|
||||
var/datum/techweb/returned = new()
|
||||
returned.researched_nodes = researched_nodes.Copy()
|
||||
returned.visible_nodes = visible_nodes.Copy()
|
||||
returned.available_nodes = available_nodes.Copy()
|
||||
returned.researched_designs = researched_designs.Copy()
|
||||
returned.hidden_nodes = hidden_nodes.Copy()
|
||||
return returned
|
||||
|
||||
/datum/techweb/proc/get_visible_nodes() //The way this is set up is shit but whatever.
|
||||
return visible_nodes - hidden_nodes
|
||||
|
||||
/datum/techweb/proc/get_available_nodes()
|
||||
return available_nodes - hidden_nodes
|
||||
|
||||
/datum/techweb/proc/get_researched_nodes()
|
||||
return researched_nodes - hidden_nodes
|
||||
|
||||
/datum/techweb/proc/add_point_type(type, amount)
|
||||
if(!SSresearch.point_types[type] || (amount <= 0))
|
||||
return FALSE
|
||||
research_points[type] += amount
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/modify_point_type(type, amount)
|
||||
if(!SSresearch.point_types[type])
|
||||
return FALSE
|
||||
research_points[type] = max(0, research_points[type] + amount)
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/remove_point_type(type, amount)
|
||||
if(!SSresearch.point_types[type] || (amount <= 0))
|
||||
return FALSE
|
||||
research_points[type] = max(0, research_points[type] - amount)
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/add_design_by_id(id, custom = FALSE)
|
||||
return add_design(SSresearch.techweb_design_by_id(id), custom)
|
||||
|
||||
/datum/techweb/proc/add_design(datum/design/design, custom = FALSE)
|
||||
if(!istype(design))
|
||||
return FALSE
|
||||
researched_designs[design.id] = design
|
||||
researched_designs[design.id] = TRUE
|
||||
if(custom)
|
||||
custom_designs[design.id] = TRUE
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/remove_design_by_id(id, custom = FALSE)
|
||||
return remove_design(SSresearch.techweb_design_by_id(id), custom)
|
||||
|
||||
/datum/techweb/proc/remove_design(datum/design/design, custom = FALSE)
|
||||
if(!istype(design))
|
||||
return FALSE
|
||||
if(custom_designs[design.id] && !custom)
|
||||
return FALSE
|
||||
custom_designs -= design.id
|
||||
researched_designs -= design.id
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/can_afford(list/pointlist)
|
||||
for(var/i in pointlist)
|
||||
if(research_points[i] < pointlist[i])
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/printout_points()
|
||||
return techweb_point_display_generic(research_points)
|
||||
|
||||
/datum/techweb/proc/research_node_id(id, force, auto_update_points)
|
||||
return research_node(SSresearch.techweb_node_by_id(id), force, auto_update_points)
|
||||
|
||||
/datum/techweb/proc/research_node(datum/techweb_node/node, force = FALSE, auto_adjust_cost = TRUE)
|
||||
if(!istype(node))
|
||||
return FALSE
|
||||
update_node_status(node)
|
||||
if(!force)
|
||||
if(!available_nodes[node.id] || (auto_adjust_cost && (!can_afford(node.get_price(src)))))
|
||||
return FALSE
|
||||
if(auto_adjust_cost)
|
||||
remove_point_list(node.get_price(src))
|
||||
researched_nodes[node.id] = TRUE //Add to our researched list
|
||||
for(var/id in node.unlock_ids)
|
||||
visible_nodes[id] = TRUE
|
||||
update_node_status(SSresearch.techweb_node_by_id(id))
|
||||
for(var/id in node.design_ids)
|
||||
add_design_by_id(id)
|
||||
update_node_status(node)
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/unresearch_node_id(id)
|
||||
return unresearch_node(SSresearch.techweb_node_by_id(id))
|
||||
|
||||
/datum/techweb/proc/unresearch_node(datum/techweb_node/node)
|
||||
if(!istype(node))
|
||||
return FALSE
|
||||
researched_nodes -= node.id
|
||||
recalculate_nodes(TRUE) //Fully rebuild the tree.
|
||||
|
||||
/datum/techweb/proc/boost_with_path(datum/techweb_node/N, itempath)
|
||||
if(!istype(N) || !ispath(itempath))
|
||||
return FALSE
|
||||
LAZYINITLIST(boosted_nodes[N.id])
|
||||
for(var/i in N.boost_item_paths[itempath])
|
||||
boosted_nodes[N.id][i] = max(boosted_nodes[N.id][i], N.boost_item_paths[itempath][i])
|
||||
if(N.autounlock_by_boost)
|
||||
hidden_nodes -= N.id
|
||||
update_node_status(N)
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/update_tiers(datum/techweb_node/base)
|
||||
var/list/current = list(base)
|
||||
while (current.len)
|
||||
var/list/next = list()
|
||||
for (var/node_ in current)
|
||||
var/datum/techweb_node/node = node_
|
||||
var/tier = 0
|
||||
if (!researched_nodes[node.id]) // researched is tier 0
|
||||
for (var/id in node.prereq_ids)
|
||||
var/prereq_tier = tiers[id]
|
||||
tier = max(tier, prereq_tier + 1)
|
||||
|
||||
if (tier != tiers[node.id])
|
||||
tiers[node.id] = tier
|
||||
for (var/id in node.unlock_ids)
|
||||
next += SSresearch.techweb_node_by_id(id)
|
||||
current = next
|
||||
|
||||
/datum/techweb/proc/update_node_status(datum/techweb_node/node, autoupdate_consoles = TRUE)
|
||||
var/researched = FALSE
|
||||
var/available = FALSE
|
||||
var/visible = FALSE
|
||||
if(researched_nodes[node.id])
|
||||
researched = TRUE
|
||||
var/needed = node.prereq_ids.len
|
||||
for(var/id in node.prereq_ids)
|
||||
if(researched_nodes[id])
|
||||
visible = TRUE
|
||||
needed--
|
||||
if(!needed)
|
||||
available = TRUE
|
||||
researched_nodes -= node.id
|
||||
available_nodes -= node.id
|
||||
visible_nodes -= node.id
|
||||
if(hidden_nodes[node.id]) //Hidden.
|
||||
return
|
||||
if(researched)
|
||||
researched_nodes[node.id] = TRUE
|
||||
for(var/id in node.design_ids)
|
||||
add_design(SSresearch.techweb_design_by_id(id))
|
||||
else
|
||||
if(available)
|
||||
available_nodes[node.id] = TRUE
|
||||
else
|
||||
if(visible)
|
||||
visible_nodes[node.id] = TRUE
|
||||
update_tiers(node)
|
||||
if(autoupdate_consoles)
|
||||
for(var/v in consoles_accessing)
|
||||
var/obj/machinery/computer/rdconsole/V = v
|
||||
V.rescan_views()
|
||||
V.updateUsrDialog()
|
||||
|
||||
//Laggy procs to do specific checks, just in case. Don't use them if you can just use the vars that already store all this!
|
||||
/datum/techweb/proc/designHasReqs(datum/design/D)
|
||||
for(var/i in researched_nodes)
|
||||
var/datum/techweb_node/N = SSresearch.techweb_node_by_id(i)
|
||||
if(N.design_ids[D.id])
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/techweb/proc/isDesignResearched(datum/design/D)
|
||||
return isDesignResearchedID(D.id)
|
||||
|
||||
/datum/techweb/proc/isDesignResearchedID(id)
|
||||
return researched_designs[id]? SSresearch.techweb_design_by_id(id) : FALSE
|
||||
|
||||
/datum/techweb/proc/isNodeResearched(datum/techweb_node/N)
|
||||
return isNodeResearchedID(N.id)
|
||||
|
||||
/datum/techweb/proc/isNodeResearchedID(id)
|
||||
return researched_nodes[id]? SSresearch.techweb_node_by_id(id) : FALSE
|
||||
|
||||
/datum/techweb/proc/isNodeVisible(datum/techweb_node/N)
|
||||
return isNodeResearchedID(N.id)
|
||||
|
||||
/datum/techweb/proc/isNodeVisibleID(id)
|
||||
return visible_nodes[id]? SSresearch.techweb_node_by_id(id) : FALSE
|
||||
|
||||
/datum/techweb/proc/isNodeAvailable(datum/techweb_node/N)
|
||||
return isNodeAvailableID(N.id)
|
||||
|
||||
/datum/techweb/proc/isNodeAvailableID(id)
|
||||
return available_nodes[id]? SSresearch.techweb_node_by_id(id) : FALSE
|
||||
|
||||
/datum/techweb/specialized
|
||||
var/allowed_buildtypes = ALL
|
||||
|
||||
/datum/techweb/specialized/add_design(datum/design/D)
|
||||
if(!(D.build_type & allowed_buildtypes))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/techweb/specialized/autounlocking
|
||||
var/design_autounlock_buildtypes = NONE
|
||||
var/design_autounlock_categories = list("initial") //if a design has a buildtype that matches the abovea and either has a category in this or this is null, unlock it.
|
||||
var/node_autounlock_ids = list() //autounlock nodes of this type.
|
||||
|
||||
/datum/techweb/specialized/autounlocking/New()
|
||||
..()
|
||||
autounlock()
|
||||
|
||||
/datum/techweb/specialized/autounlocking/proc/autounlock()
|
||||
for(var/id in node_autounlock_ids)
|
||||
research_node_id(id, TRUE, FALSE)
|
||||
for(var/id in SSresearch.techweb_designs)
|
||||
var/datum/design/D = SSresearch.techweb_design_by_id(id)
|
||||
if(D.build_type & design_autounlock_buildtypes)
|
||||
for(var/i in D.category)
|
||||
if(i in design_autounlock_categories)
|
||||
add_design_by_id(D.id)
|
||||
break
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autolathe
|
||||
design_autounlock_buildtypes = AUTOLATHE
|
||||
allowed_buildtypes = AUTOLATHE
|
||||
|
||||
/datum/techweb/specialized/autounlocking/limbgrower
|
||||
design_autounlock_buildtypes = LIMBGROWER
|
||||
allowed_buildtypes = LIMBGROWER
|
||||
|
||||
/datum/techweb/specialized/autounlocking/biogenerator
|
||||
design_autounlock_buildtypes = BIOGENERATOR
|
||||
allowed_buildtypes = BIOGENERATOR
|
||||
|
||||
/datum/techweb/specialized/autounlocking/smelter
|
||||
design_autounlock_buildtypes = SMELTER
|
||||
allowed_buildtypes = SMELTER
|
||||
|
||||
/datum/techweb/specialized/autounlocking/exofab
|
||||
allowed_buildtypes = MECHFAB
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autoylathe
|
||||
design_autounlock_buildtypes = AUTOYLATHE
|
||||
allowed_buildtypes = AUTOYLATHE
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autobottler
|
||||
design_autounlock_buildtypes = AUTOBOTTLER
|
||||
|
||||
//Used \n[\s]*origin_tech[\s]*=[\s]*"[\S]+" to delete all origin techs.
|
||||
//Or \n[\s]*origin_tech[\s]*=[\s]list\([A-Z_\s=0-9,]*\)
|
||||
//Used \n[\s]*req_tech[\s]*=[\s]*list\(["a-z\s=0-9,]*\) to delete all req_techs.
|
||||
|
||||
//Techweb datums are meant to store unlocked research, being able to be stored on research consoles, servers, and disks. They are NOT global.
|
||||
/datum/techweb
|
||||
var/list/researched_nodes = list() //Already unlocked and all designs are now available. Assoc list, id = TRUE
|
||||
var/list/visible_nodes = list() //Visible nodes, doesn't mean it can be researched. Assoc list, id = TRUE
|
||||
var/list/available_nodes = list() //Nodes that can immediately be researched, all reqs met. assoc list, id = TRUE
|
||||
var/list/researched_designs = list() //Designs that are available for use. Assoc list, id = TRUE
|
||||
var/list/custom_designs = list() //Custom inserted designs like from disks that should survive recalculation.
|
||||
var/list/boosted_nodes = list() //Already boosted nodes that can't be boosted again. node id = path of boost object.
|
||||
var/list/hidden_nodes = list() //Hidden nodes. id = TRUE. Used for unhiding nodes when requirements are met by removing the entry of the node.
|
||||
var/list/deconstructed_items = list() //items already deconstructed for a generic point boost. path = list(point_type = points)
|
||||
var/list/research_points = list() //Available research points. type = number
|
||||
var/list/obj/machinery/computer/rdconsole/consoles_accessing = list()
|
||||
var/id = "generic"
|
||||
var/list/research_logs = list() //IC logs.
|
||||
var/largest_bomb_value = 0
|
||||
var/organization = "Third-Party" //Organization name, used for display.
|
||||
var/list/last_bitcoins = list() //Current per-second production, used for display only.
|
||||
var/list/tiers = list() //Assoc list, id = number, 1 is available, 2 is all reqs are 1, so on
|
||||
|
||||
/datum/techweb/New()
|
||||
for(var/i in SSresearch.techweb_nodes_starting)
|
||||
var/datum/techweb_node/DN = SSresearch.techweb_node_by_id(i)
|
||||
research_node(DN, TRUE, FALSE)
|
||||
hidden_nodes = SSresearch.techweb_nodes_hidden.Copy()
|
||||
return ..()
|
||||
|
||||
/datum/techweb/admin
|
||||
id = "ADMIN"
|
||||
organization = "CentCom"
|
||||
|
||||
/datum/techweb/admin/New() //All unlocked.
|
||||
. = ..()
|
||||
for(var/i in SSresearch.techweb_nodes)
|
||||
var/datum/techweb_node/TN = SSresearch.techweb_nodes[i]
|
||||
research_node(TN, TRUE)
|
||||
for(var/i in SSresearch.point_types)
|
||||
research_points[i] = INFINITY
|
||||
hidden_nodes = list()
|
||||
|
||||
/datum/techweb/syndicate
|
||||
id = "SYNDICATE"
|
||||
organization = "Syndicate"
|
||||
|
||||
/datum/techweb/syndicate/New()
|
||||
var/datum/techweb_node/syndicate_basic/Node = new()
|
||||
research_node(Node, TRUE)
|
||||
|
||||
/datum/techweb/abductor
|
||||
id = "ABDUCTOR"
|
||||
organization = "Aliens"
|
||||
|
||||
/datum/techweb/abductor/New()
|
||||
var/datum/techweb_node/alientech/Node = new()
|
||||
research_node(Node, TRUE)
|
||||
|
||||
/datum/techweb/science //Global science techweb for RND consoles.
|
||||
id = "SCIENCE"
|
||||
organization = "Nanotrasen"
|
||||
|
||||
/datum/techweb/Destroy()
|
||||
researched_nodes = null
|
||||
researched_designs = null
|
||||
available_nodes = null
|
||||
visible_nodes = null
|
||||
custom_designs = null
|
||||
SSresearch.techwebs -= src
|
||||
return ..()
|
||||
|
||||
/datum/techweb/proc/recalculate_nodes(recalculate_designs = FALSE, wipe_custom_designs = FALSE)
|
||||
var/list/datum/techweb_node/processing = list()
|
||||
for(var/id in researched_nodes)
|
||||
processing[id] = TRUE
|
||||
for(var/id in visible_nodes)
|
||||
processing[id] = TRUE
|
||||
for(var/id in available_nodes)
|
||||
processing[id] = TRUE
|
||||
if(recalculate_designs)
|
||||
researched_designs = custom_designs.Copy()
|
||||
if(wipe_custom_designs)
|
||||
custom_designs = list()
|
||||
for(var/id in processing)
|
||||
update_node_status(SSresearch.techweb_node_by_id(id), FALSE)
|
||||
CHECK_TICK
|
||||
for(var/v in consoles_accessing)
|
||||
var/obj/machinery/computer/rdconsole/V = v
|
||||
V.rescan_views()
|
||||
V.updateUsrDialog()
|
||||
|
||||
/datum/techweb/proc/add_point_list(list/pointlist)
|
||||
for(var/i in pointlist)
|
||||
if(SSresearch.point_types[i] && pointlist[i] > 0)
|
||||
research_points[i] += pointlist[i]
|
||||
|
||||
/datum/techweb/proc/add_points_all(amount)
|
||||
var/list/l = SSresearch.point_types.Copy()
|
||||
for(var/i in l)
|
||||
l[i] = amount
|
||||
add_point_list(l)
|
||||
|
||||
/datum/techweb/proc/remove_point_list(list/pointlist)
|
||||
for(var/i in pointlist)
|
||||
if(SSresearch.point_types[i] && pointlist[i] > 0)
|
||||
research_points[i] = max(0, research_points[i] - pointlist[i])
|
||||
|
||||
/datum/techweb/proc/remove_points_all(amount)
|
||||
var/list/l = SSresearch.point_types.Copy()
|
||||
for(var/i in l)
|
||||
l[i] = amount
|
||||
remove_point_list(l)
|
||||
|
||||
/datum/techweb/proc/modify_point_list(list/pointlist)
|
||||
for(var/i in pointlist)
|
||||
if(SSresearch.point_types[i] && pointlist[i] != 0)
|
||||
research_points[i] = max(0, research_points[i] + pointlist[i])
|
||||
|
||||
/datum/techweb/proc/modify_points_all(amount)
|
||||
var/list/l = SSresearch.point_types.Copy()
|
||||
for(var/i in l)
|
||||
l[i] = amount
|
||||
modify_point_list(l)
|
||||
|
||||
/datum/techweb/proc/copy_research_to(datum/techweb/receiver, unlock_hidden = TRUE) //Adds any missing research to theirs.
|
||||
for(var/i in researched_nodes)
|
||||
CHECK_TICK
|
||||
receiver.research_node_id(i, TRUE, FALSE)
|
||||
for(var/i in researched_designs)
|
||||
CHECK_TICK
|
||||
receiver.add_design_by_id(i)
|
||||
if(unlock_hidden)
|
||||
for(var/i in receiver.hidden_nodes)
|
||||
CHECK_TICK
|
||||
if(!hidden_nodes[i])
|
||||
receiver.hidden_nodes -= i //We can see it so let them see it too.
|
||||
receiver.recalculate_nodes()
|
||||
|
||||
/datum/techweb/proc/copy()
|
||||
var/datum/techweb/returned = new()
|
||||
returned.researched_nodes = researched_nodes.Copy()
|
||||
returned.visible_nodes = visible_nodes.Copy()
|
||||
returned.available_nodes = available_nodes.Copy()
|
||||
returned.researched_designs = researched_designs.Copy()
|
||||
returned.hidden_nodes = hidden_nodes.Copy()
|
||||
return returned
|
||||
|
||||
/datum/techweb/proc/get_visible_nodes() //The way this is set up is shit but whatever.
|
||||
return visible_nodes - hidden_nodes
|
||||
|
||||
/datum/techweb/proc/get_available_nodes()
|
||||
return available_nodes - hidden_nodes
|
||||
|
||||
/datum/techweb/proc/get_researched_nodes()
|
||||
return researched_nodes - hidden_nodes
|
||||
|
||||
/datum/techweb/proc/add_point_type(type, amount)
|
||||
if(!SSresearch.point_types[type] || (amount <= 0))
|
||||
return FALSE
|
||||
research_points[type] += amount
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/modify_point_type(type, amount)
|
||||
if(!SSresearch.point_types[type])
|
||||
return FALSE
|
||||
research_points[type] = max(0, research_points[type] + amount)
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/remove_point_type(type, amount)
|
||||
if(!SSresearch.point_types[type] || (amount <= 0))
|
||||
return FALSE
|
||||
research_points[type] = max(0, research_points[type] - amount)
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/add_design_by_id(id, custom = FALSE)
|
||||
return add_design(SSresearch.techweb_design_by_id(id), custom)
|
||||
|
||||
/datum/techweb/proc/add_design(datum/design/design, custom = FALSE)
|
||||
if(!istype(design))
|
||||
return FALSE
|
||||
researched_designs[design.id] = design
|
||||
researched_designs[design.id] = TRUE
|
||||
if(custom)
|
||||
custom_designs[design.id] = TRUE
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/remove_design_by_id(id, custom = FALSE)
|
||||
return remove_design(SSresearch.techweb_design_by_id(id), custom)
|
||||
|
||||
/datum/techweb/proc/remove_design(datum/design/design, custom = FALSE)
|
||||
if(!istype(design))
|
||||
return FALSE
|
||||
if(custom_designs[design.id] && !custom)
|
||||
return FALSE
|
||||
custom_designs -= design.id
|
||||
researched_designs -= design.id
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/can_afford(list/pointlist)
|
||||
for(var/i in pointlist)
|
||||
if(research_points[i] < pointlist[i])
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/printout_points()
|
||||
return techweb_point_display_generic(research_points)
|
||||
|
||||
/datum/techweb/proc/research_node_id(id, force, auto_update_points)
|
||||
return research_node(SSresearch.techweb_node_by_id(id), force, auto_update_points)
|
||||
|
||||
/datum/techweb/proc/research_node(datum/techweb_node/node, force = FALSE, auto_adjust_cost = TRUE)
|
||||
if(!istype(node))
|
||||
return FALSE
|
||||
update_node_status(node)
|
||||
if(!force)
|
||||
if(!available_nodes[node.id] || (auto_adjust_cost && (!can_afford(node.get_price(src)))))
|
||||
return FALSE
|
||||
if(auto_adjust_cost)
|
||||
remove_point_list(node.get_price(src))
|
||||
researched_nodes[node.id] = TRUE //Add to our researched list
|
||||
for(var/id in node.unlock_ids)
|
||||
visible_nodes[id] = TRUE
|
||||
update_node_status(SSresearch.techweb_node_by_id(id))
|
||||
for(var/id in node.design_ids)
|
||||
add_design_by_id(id)
|
||||
update_node_status(node)
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/unresearch_node_id(id)
|
||||
return unresearch_node(SSresearch.techweb_node_by_id(id))
|
||||
|
||||
/datum/techweb/proc/unresearch_node(datum/techweb_node/node)
|
||||
if(!istype(node))
|
||||
return FALSE
|
||||
researched_nodes -= node.id
|
||||
recalculate_nodes(TRUE) //Fully rebuild the tree.
|
||||
|
||||
/datum/techweb/proc/boost_with_path(datum/techweb_node/N, itempath)
|
||||
if(!istype(N) || !ispath(itempath))
|
||||
return FALSE
|
||||
LAZYINITLIST(boosted_nodes[N.id])
|
||||
for(var/i in N.boost_item_paths[itempath])
|
||||
boosted_nodes[N.id][i] = max(boosted_nodes[N.id][i], N.boost_item_paths[itempath][i])
|
||||
if(N.autounlock_by_boost)
|
||||
hidden_nodes -= N.id
|
||||
update_node_status(N)
|
||||
return TRUE
|
||||
|
||||
/datum/techweb/proc/update_tiers(datum/techweb_node/base)
|
||||
var/list/current = list(base)
|
||||
while (current.len)
|
||||
var/list/next = list()
|
||||
for (var/node_ in current)
|
||||
var/datum/techweb_node/node = node_
|
||||
var/tier = 0
|
||||
if (!researched_nodes[node.id]) // researched is tier 0
|
||||
for (var/id in node.prereq_ids)
|
||||
var/prereq_tier = tiers[id]
|
||||
tier = max(tier, prereq_tier + 1)
|
||||
|
||||
if (tier != tiers[node.id])
|
||||
tiers[node.id] = tier
|
||||
for (var/id in node.unlock_ids)
|
||||
next += SSresearch.techweb_node_by_id(id)
|
||||
current = next
|
||||
|
||||
/datum/techweb/proc/update_node_status(datum/techweb_node/node, autoupdate_consoles = TRUE)
|
||||
var/researched = FALSE
|
||||
var/available = FALSE
|
||||
var/visible = FALSE
|
||||
if(researched_nodes[node.id])
|
||||
researched = TRUE
|
||||
var/needed = node.prereq_ids.len
|
||||
for(var/id in node.prereq_ids)
|
||||
if(researched_nodes[id])
|
||||
visible = TRUE
|
||||
needed--
|
||||
if(!needed)
|
||||
available = TRUE
|
||||
researched_nodes -= node.id
|
||||
available_nodes -= node.id
|
||||
visible_nodes -= node.id
|
||||
if(hidden_nodes[node.id]) //Hidden.
|
||||
return
|
||||
if(researched)
|
||||
researched_nodes[node.id] = TRUE
|
||||
for(var/id in node.design_ids)
|
||||
add_design(SSresearch.techweb_design_by_id(id))
|
||||
else
|
||||
if(available)
|
||||
available_nodes[node.id] = TRUE
|
||||
else
|
||||
if(visible)
|
||||
visible_nodes[node.id] = TRUE
|
||||
update_tiers(node)
|
||||
if(autoupdate_consoles)
|
||||
for(var/v in consoles_accessing)
|
||||
var/obj/machinery/computer/rdconsole/V = v
|
||||
V.rescan_views()
|
||||
V.updateUsrDialog()
|
||||
|
||||
//Laggy procs to do specific checks, just in case. Don't use them if you can just use the vars that already store all this!
|
||||
/datum/techweb/proc/designHasReqs(datum/design/D)
|
||||
for(var/i in researched_nodes)
|
||||
var/datum/techweb_node/N = SSresearch.techweb_node_by_id(i)
|
||||
if(N.design_ids[D.id])
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/techweb/proc/isDesignResearched(datum/design/D)
|
||||
return isDesignResearchedID(D.id)
|
||||
|
||||
/datum/techweb/proc/isDesignResearchedID(id)
|
||||
return researched_designs[id]? SSresearch.techweb_design_by_id(id) : FALSE
|
||||
|
||||
/datum/techweb/proc/isNodeResearched(datum/techweb_node/N)
|
||||
return isNodeResearchedID(N.id)
|
||||
|
||||
/datum/techweb/proc/isNodeResearchedID(id)
|
||||
return researched_nodes[id]? SSresearch.techweb_node_by_id(id) : FALSE
|
||||
|
||||
/datum/techweb/proc/isNodeVisible(datum/techweb_node/N)
|
||||
return isNodeResearchedID(N.id)
|
||||
|
||||
/datum/techweb/proc/isNodeVisibleID(id)
|
||||
return visible_nodes[id]? SSresearch.techweb_node_by_id(id) : FALSE
|
||||
|
||||
/datum/techweb/proc/isNodeAvailable(datum/techweb_node/N)
|
||||
return isNodeAvailableID(N.id)
|
||||
|
||||
/datum/techweb/proc/isNodeAvailableID(id)
|
||||
return available_nodes[id]? SSresearch.techweb_node_by_id(id) : FALSE
|
||||
|
||||
/datum/techweb/specialized
|
||||
var/allowed_buildtypes = ALL
|
||||
|
||||
/datum/techweb/specialized/add_design(datum/design/D)
|
||||
if(!(D.build_type & allowed_buildtypes))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/techweb/specialized/autounlocking
|
||||
var/design_autounlock_buildtypes = NONE
|
||||
var/design_autounlock_categories = list("initial") //if a design has a buildtype that matches the abovea and either has a category in this or this is null, unlock it.
|
||||
var/node_autounlock_ids = list() //autounlock nodes of this type.
|
||||
|
||||
/datum/techweb/specialized/autounlocking/New()
|
||||
..()
|
||||
autounlock()
|
||||
|
||||
/datum/techweb/specialized/autounlocking/proc/autounlock()
|
||||
for(var/id in node_autounlock_ids)
|
||||
research_node_id(id, TRUE, FALSE)
|
||||
for(var/id in SSresearch.techweb_designs)
|
||||
var/datum/design/D = SSresearch.techweb_design_by_id(id)
|
||||
if(D.build_type & design_autounlock_buildtypes)
|
||||
for(var/i in D.category)
|
||||
if(i in design_autounlock_categories)
|
||||
add_design_by_id(D.id)
|
||||
break
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autolathe
|
||||
design_autounlock_buildtypes = AUTOLATHE
|
||||
allowed_buildtypes = AUTOLATHE
|
||||
|
||||
/datum/techweb/specialized/autounlocking/limbgrower
|
||||
design_autounlock_buildtypes = LIMBGROWER
|
||||
allowed_buildtypes = LIMBGROWER
|
||||
|
||||
/datum/techweb/specialized/autounlocking/biogenerator
|
||||
design_autounlock_buildtypes = BIOGENERATOR
|
||||
allowed_buildtypes = BIOGENERATOR
|
||||
|
||||
/datum/techweb/specialized/autounlocking/smelter
|
||||
design_autounlock_buildtypes = SMELTER
|
||||
allowed_buildtypes = SMELTER
|
||||
|
||||
/datum/techweb/specialized/autounlocking/exofab
|
||||
allowed_buildtypes = MECHFAB
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autoylathe
|
||||
design_autounlock_buildtypes = AUTOYLATHE
|
||||
allowed_buildtypes = AUTOYLATHE
|
||||
|
||||
/datum/techweb/specialized/autounlocking/autobottler
|
||||
design_autounlock_buildtypes = AUTOBOTTLER
|
||||
allowed_buildtypes = AUTOBOTTLER
|
||||
@@ -1,97 +1,97 @@
|
||||
|
||||
//Techweb nodes are GLOBAL, there should only be one instance of them in the game. Persistant changes should never be made to them in-game.
|
||||
//USE SSRESEARCH PROCS TO OBTAIN REFERENCES. DO NOT REFERENCE OUTSIDE OF SSRESEARCH OR YOU WILL FUCK UP GC.
|
||||
|
||||
/datum/techweb_node
|
||||
var/id
|
||||
var/display_name = "Errored Node"
|
||||
var/description = "Why are you seeing this?"
|
||||
var/hidden = FALSE //Whether it starts off hidden.
|
||||
var/starting_node = FALSE //Whether it's available without any research.
|
||||
var/list/prereq_ids = list()
|
||||
var/list/design_ids = list()
|
||||
var/list/unlock_ids = list() //CALCULATED FROM OTHER NODE'S PREREQUISITES. Assoc list id = TRUE.
|
||||
var/list/boost_item_paths = list() //Associative list, path = list(point type = point_value).
|
||||
var/autounlock_by_boost = TRUE //boosting this will autounlock this node.
|
||||
var/export_price = 0 //Cargo export price.
|
||||
var/list/research_costs = list() //Point cost to research. type = amount
|
||||
var/category = "Misc" //Category
|
||||
|
||||
/datum/techweb_node/error_node
|
||||
id = "ERROR"
|
||||
display_name = "ERROR"
|
||||
description = "This usually means something in the database has corrupted. If it doesn't go away automatically, inform Central Command for their techs to fix it ASAP(tm)"
|
||||
|
||||
/datum/techweb_node/proc/Initialize()
|
||||
//Make lists associative for lookup
|
||||
for(var/id in prereq_ids)
|
||||
prereq_ids[id] = TRUE
|
||||
for(var/id in design_ids)
|
||||
design_ids[id] = TRUE
|
||||
for(var/id in unlock_ids)
|
||||
unlock_ids[id] = TRUE
|
||||
|
||||
/datum/techweb_node/Destroy()
|
||||
SSresearch.techweb_nodes -= id
|
||||
return ..()
|
||||
|
||||
/datum/techweb_node/serialize_list(list/options)
|
||||
. = list()
|
||||
VARSET_TO_LIST(., id)
|
||||
VARSET_TO_LIST(., display_name)
|
||||
VARSET_TO_LIST(., hidden)
|
||||
VARSET_TO_LIST(., starting_node)
|
||||
VARSET_TO_LIST(., assoc_list_strip_value(prereq_ids))
|
||||
VARSET_TO_LIST(., assoc_list_strip_value(design_ids))
|
||||
VARSET_TO_LIST(., assoc_list_strip_value(unlock_ids))
|
||||
VARSET_TO_LIST(., boost_item_paths)
|
||||
VARSET_TO_LIST(., autounlock_by_boost)
|
||||
VARSET_TO_LIST(., export_price)
|
||||
VARSET_TO_LIST(., research_costs)
|
||||
VARSET_TO_LIST(., category)
|
||||
|
||||
/datum/techweb_node/deserialize_list(list/input, list/options)
|
||||
if(!input["id"])
|
||||
return
|
||||
VARSET_FROM_LIST(input, id)
|
||||
VARSET_FROM_LIST(input, display_name)
|
||||
VARSET_FROM_LIST(input, hidden)
|
||||
VARSET_FROM_LIST(input, starting_node)
|
||||
VARSET_FROM_LIST(input, prereq_ids)
|
||||
VARSET_FROM_LIST(input, design_ids)
|
||||
VARSET_FROM_LIST(input, unlock_ids)
|
||||
VARSET_FROM_LIST(input, boost_item_paths)
|
||||
VARSET_FROM_LIST(input, autounlock_by_boost)
|
||||
VARSET_FROM_LIST(input, export_price)
|
||||
VARSET_FROM_LIST(input, research_costs)
|
||||
VARSET_FROM_LIST(input, category)
|
||||
Initialize()
|
||||
return src
|
||||
|
||||
/datum/techweb_node/proc/on_design_deletion(datum/design/D)
|
||||
prune_design_id(D.id)
|
||||
|
||||
/datum/techweb_node/proc/on_node_deletion(datum/techweb_node/TN)
|
||||
prune_node_id(TN.id)
|
||||
|
||||
/datum/techweb_node/proc/prune_design_id(design_id)
|
||||
design_ids -= design_id
|
||||
|
||||
/datum/techweb_node/proc/prune_node_id(node_id)
|
||||
prereq_ids -= node_id
|
||||
unlock_ids -= node_id
|
||||
|
||||
/datum/techweb_node/proc/get_price(datum/techweb/host)
|
||||
if(host)
|
||||
var/list/actual_costs = research_costs
|
||||
if(host.boosted_nodes[id])
|
||||
var/list/L = host.boosted_nodes[id]
|
||||
for(var/i in L)
|
||||
if(actual_costs[i])
|
||||
actual_costs[i] -= L[i]
|
||||
return actual_costs
|
||||
else
|
||||
return research_costs
|
||||
|
||||
/datum/techweb_node/proc/price_display(datum/techweb/TN)
|
||||
return techweb_point_display_generic(get_price(TN))
|
||||
|
||||
//Techweb nodes are GLOBAL, there should only be one instance of them in the game. Persistant changes should never be made to them in-game.
|
||||
//USE SSRESEARCH PROCS TO OBTAIN REFERENCES. DO NOT REFERENCE OUTSIDE OF SSRESEARCH OR YOU WILL FUCK UP GC.
|
||||
|
||||
/datum/techweb_node
|
||||
var/id
|
||||
var/display_name = "Errored Node"
|
||||
var/description = "Why are you seeing this?"
|
||||
var/hidden = FALSE //Whether it starts off hidden.
|
||||
var/starting_node = FALSE //Whether it's available without any research.
|
||||
var/list/prereq_ids = list()
|
||||
var/list/design_ids = list()
|
||||
var/list/unlock_ids = list() //CALCULATED FROM OTHER NODE'S PREREQUISITES. Assoc list id = TRUE.
|
||||
var/list/boost_item_paths = list() //Associative list, path = list(point type = point_value).
|
||||
var/autounlock_by_boost = TRUE //boosting this will autounlock this node.
|
||||
var/export_price = 0 //Cargo export price.
|
||||
var/list/research_costs = list() //Point cost to research. type = amount
|
||||
var/category = "Misc" //Category
|
||||
|
||||
/datum/techweb_node/error_node
|
||||
id = "ERROR"
|
||||
display_name = "ERROR"
|
||||
description = "This usually means something in the database has corrupted. If it doesn't go away automatically, inform Central Command for their techs to fix it ASAP(tm)"
|
||||
|
||||
/datum/techweb_node/proc/Initialize()
|
||||
//Make lists associative for lookup
|
||||
for(var/id in prereq_ids)
|
||||
prereq_ids[id] = TRUE
|
||||
for(var/id in design_ids)
|
||||
design_ids[id] = TRUE
|
||||
for(var/id in unlock_ids)
|
||||
unlock_ids[id] = TRUE
|
||||
|
||||
/datum/techweb_node/Destroy()
|
||||
SSresearch.techweb_nodes -= id
|
||||
return ..()
|
||||
|
||||
/datum/techweb_node/serialize_list(list/options)
|
||||
. = list()
|
||||
VARSET_TO_LIST(., id)
|
||||
VARSET_TO_LIST(., display_name)
|
||||
VARSET_TO_LIST(., hidden)
|
||||
VARSET_TO_LIST(., starting_node)
|
||||
VARSET_TO_LIST(., assoc_list_strip_value(prereq_ids))
|
||||
VARSET_TO_LIST(., assoc_list_strip_value(design_ids))
|
||||
VARSET_TO_LIST(., assoc_list_strip_value(unlock_ids))
|
||||
VARSET_TO_LIST(., boost_item_paths)
|
||||
VARSET_TO_LIST(., autounlock_by_boost)
|
||||
VARSET_TO_LIST(., export_price)
|
||||
VARSET_TO_LIST(., research_costs)
|
||||
VARSET_TO_LIST(., category)
|
||||
|
||||
/datum/techweb_node/deserialize_list(list/input, list/options)
|
||||
if(!input["id"])
|
||||
return
|
||||
VARSET_FROM_LIST(input, id)
|
||||
VARSET_FROM_LIST(input, display_name)
|
||||
VARSET_FROM_LIST(input, hidden)
|
||||
VARSET_FROM_LIST(input, starting_node)
|
||||
VARSET_FROM_LIST(input, prereq_ids)
|
||||
VARSET_FROM_LIST(input, design_ids)
|
||||
VARSET_FROM_LIST(input, unlock_ids)
|
||||
VARSET_FROM_LIST(input, boost_item_paths)
|
||||
VARSET_FROM_LIST(input, autounlock_by_boost)
|
||||
VARSET_FROM_LIST(input, export_price)
|
||||
VARSET_FROM_LIST(input, research_costs)
|
||||
VARSET_FROM_LIST(input, category)
|
||||
Initialize()
|
||||
return src
|
||||
|
||||
/datum/techweb_node/proc/on_design_deletion(datum/design/D)
|
||||
prune_design_id(D.id)
|
||||
|
||||
/datum/techweb_node/proc/on_node_deletion(datum/techweb_node/TN)
|
||||
prune_node_id(TN.id)
|
||||
|
||||
/datum/techweb_node/proc/prune_design_id(design_id)
|
||||
design_ids -= design_id
|
||||
|
||||
/datum/techweb_node/proc/prune_node_id(node_id)
|
||||
prereq_ids -= node_id
|
||||
unlock_ids -= node_id
|
||||
|
||||
/datum/techweb_node/proc/get_price(datum/techweb/host)
|
||||
if(host)
|
||||
var/list/actual_costs = research_costs
|
||||
if(host.boosted_nodes[id])
|
||||
var/list/L = host.boosted_nodes[id]
|
||||
for(var/i in L)
|
||||
if(actual_costs[i])
|
||||
actual_costs[i] -= L[i]
|
||||
return actual_costs
|
||||
else
|
||||
return research_costs
|
||||
|
||||
/datum/techweb_node/proc/price_display(datum/techweb/TN)
|
||||
return techweb_point_display_generic(get_price(TN))
|
||||
|
||||
Reference in New Issue
Block a user