Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a bunch of custom design disks, sorts some design files #2081

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/astraeus.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
pixel_x = -5;
pixel_y = 7
},
/obj/item/disk/design_disk/ammo_1911,
/obj/item/disk/design_disk/ammunition/mag_1911,
/turf/open/floor/plasteel,
/area/ruin/space/has_grav/astraeus/munitions)
"ph" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/bigderelict1.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@
name = "gelatinous floor"
},
/mob/living/simple_animal/hostile/netherworld{
loot = list(/obj/item/disk/design_disk/ammo_1911);
loot = list(/obj/item/disk/design_disk/ammunition/mag_1911);
name = "Miss Tiggles"
},
/turf/open/floor/plasteel,
Expand Down
1 change: 0 additions & 1 deletion _maps/deprecated/Ships/minutemen_carina.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,6 @@
/obj/item/stamp/captain{
name = "bridge officer's rubber stamp"
},
/obj/item/disk/design_disk/ammo_n762,
/obj/item/ammo_box/n762_clip,
/obj/item/ammo_box/n762_clip,
/obj/item/gun/ballistic/revolver/nagant,
Expand Down
4 changes: 2 additions & 2 deletions _maps/shuttles/roumain/srm_glaive.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2838,8 +2838,8 @@
},
/obj/item/circuitboard/machine/rdserver,
/obj/item/circuitboard/machine/autolathe,
/obj/item/disk/design_disk/ammo_n762,
/obj/item/disk/design_disk/ammo_1911,
/obj/item/disk/design_disk/ammunition/n762,
/obj/item/disk/design_disk/ammunition/mag_1911,
/obj/item/circuitboard/machine/protolathe/department/ballistics,
/obj/item/circuitboard/computer/rdconsole,
/turf/open/floor/wood/maple,
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/storage/concrete/rped.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
click_gather = TRUE
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 100
max_items = 50
max_items = 100
display_numerical_stacking = TRUE

/datum/component/storage/concrete/rped/can_be_inserted(obj/item/I, stop_messages, mob/M)
Expand Down
21 changes: 16 additions & 5 deletions code/game/machinery/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
var/hack_wire
var/disable_wire
var/shock_wire
var/obj/item/disk/design_disk/d_disk //Stores the design disk.
//Stores the design disk.
var/obj/item/disk/design_disk/d_disk

var/busy = FALSE

Expand All @@ -49,7 +50,7 @@
)

/obj/machinery/autolathe/Initialize()
AddComponent(/datum/component/material_container,list(/datum/material/iron, /datum/material/glass, /datum/material/plastic, /datum/material/silver, /datum/material/gold, /datum/material/plasma, /datum/material/uranium, /datum/material/titanium), 0, TRUE, null, null, CALLBACK(src, PROC_REF(AfterMaterialInsert)))
AddComponent(/datum/component/material_container,list(/datum/material/iron, /datum/material/glass, /datum/material/plastic, /datum/material/silver, /datum/material/gold, /datum/material/plasma, /datum/material/uranium, /datum/material/titanium, /datum/material/diamond, /datum/material/bluespace), 0, TRUE, null, null, CALLBACK(src, PROC_REF(AfterMaterialInsert)))
. = ..()

wires = new /datum/wires/autolathe(src)
Expand Down Expand Up @@ -266,7 +267,7 @@
materials.retrieve_all()

/obj/machinery/autolathe/attackby(obj/item/O, mob/living/user, params)
if (busy)
if(busy)
to_chat(user, "<span class=\"alert\">The autolathe is busy. Please wait for completion of previous operation.</span>")
return TRUE

Expand Down Expand Up @@ -304,12 +305,20 @@
/obj/machinery/autolathe/proc/eject(mob/living/user)
if(!d_disk)
return
if(busy)
to_chat(user, "<span class=\"alert\">The autolathe is busy. Please wait for completion of previous operation.</span>")
return TRUE
if(!istype(user) || !Adjacent(user) || !user.put_in_active_hand(d_disk))
d_disk.forceMove(drop_location())
categories -= d_disk.name
d_disk = null

/obj/machinery/autolathe/AltClick(mob/user)
if(!d_disk)
return
if(busy)
to_chat(user, "<span class=\"alert\">The autolathe is busy. Please wait for completion of previous operation.</span>")
return TRUE
if(d_disk && user.canUseTopic(src, !issilicon(user)))
to_chat(user, "<span class='notice'>You take out [d_disk] from [src].</span>")
playsound(src, 'sound/machines/click.ogg', 50, FALSE)
Expand Down Expand Up @@ -342,15 +351,17 @@
for(var/i=1, i<=multiplier, i++)
var/obj/item/new_item = new being_built.build_path(A)
new_item.autolathe_crafted(src)

if(d_disk)
if(locate(being_built.type) in d_disk.blueprints)
d_disk.used_charges += 1
d_disk.check_charges()
if(length(picked_materials))
new_item.set_custom_materials(picked_materials, 1 / multiplier) //Ensure we get the non multiplied amount
for(var/x in picked_materials)
var/datum/material/M = x
if(!istype(M, /datum/material/glass) && !istype(M, /datum/material/iron))
user.client.give_award(/datum/award/achievement/misc/getting_an_upgrade, user)


icon_state = "autolathe"
busy = FALSE

Expand Down
1 change: 1 addition & 0 deletions code/game/mecha/mech_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"Phazon",
"Exosuit Equipment",
"Exosuit Ammunition",
"Prosthetics",
"Cyborg Upgrade Modules",
"IPC Components",
"Misc"
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/storage/bags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
STR.allow_quick_empty = TRUE
STR.set_holdable(list(/obj/item/stack/ore))
STR.max_w_class = WEIGHT_CLASS_HUGE
STR.max_combined_stack_amount = 50
STR.max_combined_stack_amount = 150

/obj/item/storage/bag/ore/equipped(mob/user)
. = ..()
Expand Down
161 changes: 161 additions & 0 deletions code/modules/research/design_disks/_design_disk.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
//Disks for transporting design datums to be used in autolathes.

/*Available illustrations - use with illustration var on disks.
nt_old Nanotrasen logo, single N
nt Nanotrasen logo, NT
nt_n Nanotrasen logo, modern N
dna_words text, DNA
nuke_useless some squiggles
nuke_useless_alt triangle thing?
syndicate Syndicate S
generic 3 horizontal lines
solgov small solgov circle logo
solgov_old terragov, TG
rd_major 2px dithered line
beaker Chemistry beaker
sci text, SCI
med text, MED
sec text, SEC
cargo text, CAR
engineering text, ENG
service text, SER
civilian text, CIV
liberator text, LIB
bepis text, BEP
sword Small sword graphic
sword_thin Thin small sword graphic
sus amogus
moth little moth face
shiptest text, ST
poyo little face
accel PKA small icon
target box with a smaller box inside
ammo small bullet icon
cybersun Cybersun logo
gun small gun icon
holo Holopad design, animated
dna DNA disk design, animated
o2 text, o2
hammer its a hammer
depleted This is used for limited disks with no charges left
nuke_retro old nukedisk, alternating lines like a sine wave
nuke_new sine wave, more detailed
nanite black and green lines, animated
design default, animated scrolling design
*/

/*
To add a new disk:
1. Navigate to the respective file in this folder:
/design_disks/engineering.dm
/design_disks/firearms.dm
/design_disks/medical.dm
/design_disks/science.dm (more tba)
2. Create a new subtype of the disk in the file you are choosing.
3. Set the max_blueprints variable, and the max_charges variable.
4. Add an Initialize() proc of your subtype directly below your subtype definition.
5. Add design datums to the blueprints list - see the existing ones for an example.

WARNING! If your item is NOT showing on the "Imported" category on the autolathe with
the disk inserted, you need to navigate to the design datum's code, and make sure it has:
build_type = AUTOLATHE
category = list("Imported")
If it does, it will show up in the autolathe Imported category when the disk is interted.
*/
/obj/item/disk/design_disk
name = "Component Design Disk"
desc = "A disk for storing device design data for construction in lathes."
random_color = FALSE
color = "#8b70ff"
illustration = "design"
var/list/blueprints = list() // List of blueprints downloaded to the disk
var/max_blueprints = 1 // Max amount of blueprints a disk can have
var/max_charges = 0 // Max amount of prints a disk is allowed
var/used_charges = 0 // Number of prints the disk has made
var/modifiable = FALSE // If the disk can have designs added/removed
custom_materials = list(
/datum/material/iron = 300,
/datum/material/glass = 100,
)

/obj/item/disk/design_disk/Initialize()
. = ..()
pixel_x = base_pixel_x + rand(-5, 5)
pixel_y = base_pixel_y + rand(-5, 5)
blueprints = new/list(max_blueprints)

/obj/item/disk/design_disk/examine(user)
. = ..()
var/readout = list("")
if(!max_charges)
readout += "[span_notice("It has [span_warning("infinite")] charges.")]"
else
readout += "[span_notice("It has [span_warning("[max_charges - used_charges]")] charges out of [span_warning("[max_charges]")] remaining.")]"
if(modifiable)
readout += "[span_notice("It's modifiable with a research console.")]"
else
readout += "[span_notice("It's [span_warning("not")] modifiable with a research console.")]"
. += readout

/obj/item/disk/design_disk/proc/check_charges()
if(!max_charges)
return
if(max_charges == used_charges) // Check if it's been used as many time as maximum
for(var/i in 1 to max_blueprints)
blueprints[i] = null // Remove all of the designs, and change the icon
illustration = "depleted"
update_icon()

/obj/item/disk/design_disk/basic
name = "design disk - low capacity"
desc = "A disk for storing device design data for construction in lathes. This one has a little bit of extra storage space."
color = "#2ab44f"
max_blueprints = 2
modifiable = TRUE

/obj/item/disk/design_disk/adv
name = "design disk - medium capacity"
desc = "A disk for storing device design data for construction in lathes. This one has a little bit of extra storage space."
color = "#bed876"
max_blueprints = 3
modifiable = TRUE
custom_materials = list(
/datum/material/iron = 300,
/datum/material/glass = 100,
/datum/material/silver = 50,
)

/obj/item/disk/design_disk/super
name = "design disk - high capacity"
desc = "A disk for storing device design data for construction in lathes. This one has more extra storage space."
color = "#c25454"
max_blueprints = 5
modifiable = TRUE
custom_materials = list(
/datum/material/iron = 300,
/datum/material/glass = 100,
/datum/material/silver = 50,
/datum/material/gold = 50,
)

/obj/item/disk/design_disk/elite
name = "design disk - super capacity"
color = "#333333"
desc = "A disk for storing device design data for construction in lathes. This one has absurd amounts of extra storage space."
max_blueprints = 10
modifiable = TRUE
custom_materials = list(
/datum/material/iron = 300,
/datum/material/glass = 100,
/datum/material/silver = 100,
/datum/material/gold = 100,
/datum/material/bluespace = 50,
)

// Limited use design disk basetype

/obj/item/disk/design_disk/limited //basetype, don't use this
name = "Limited Design Disk"
color = "#333333"
desc = "A disk with limited charges"
max_charges = 10 //Default for limited disks is 10 charges.
Loading