This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
designs.dm
90 lines (78 loc) · 4.49 KB
/
designs.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/***************************************************************
** 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
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: "id" = 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: "id" = 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 Comamnd so their techs can fix this ASAP(tm)"
/datum/design/Destroy()
SSresearch.techweb_designs -= id
return ..()
/datum/design/proc/InitializeMaterials()
var/list/temp_list = list()
for(var/i in materials) //Go through all of our materials, get the subsystem instance, and then replace the list.
var/amount = materials[i]
if(!istext(i)) //Not a category, so get the ref the normal way
var/datum/material/M = SSmaterials.GetMaterialRef(i)
temp_list[M] = amount
else
temp_list[i] = amount
materials = temp_list
/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"
custom_materials = list(/datum/material/iron =300, /datum/material/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."
custom_materials = list(/datum/material/iron =300, /datum/material/glass = 100, /datum/material/silver = 50)
max_blueprints = 5