Data disks now get a nice name and description when written to

This commit is contained in:
Crazylemon64
2016-09-14 16:29:27 -07:00
parent 0ce93c9706
commit 6bc84e0111
3 changed files with 59 additions and 20 deletions
+20 -11
View File
@@ -129,17 +129,26 @@
if(stat)
return 1
if(istype(O, /obj/item/weapon/disk/design_disk))
user.visible_message("[user] begins to load \the [O] in \the [src]...",
"You begin to load a design from \the [O]...",
"You hear the chatter of a floppy drive.")
busy = 1
var/obj/item/weapon/disk/design_disk/D = O
if(do_after(user, 14.4, target = src))
files.AddDesign2Known(D.blueprint)
busy = 0
return
// Disks in general
if(istype(O, /obj/item/weapon/disk))
if(istype(O, /obj/item/weapon/disk/design_disk))
var/obj/item/weapon/disk/design_disk/D = O
if(D.blueprint)
user.visible_message("[user] begins to load \the [O] in \the [src]...",
"You begin to load a design from \the [O]...",
"You hear the chatter of a floppy drive.")
playsound(get_turf(src), "sound/goonstation/machines/printer_dotmatrix.ogg", 50, 1)
busy = 1
if(do_after(user, 14.4, target = src))
files.AddDesign2Known(D.blueprint)
busy = 0
else
to_chat(user, "<span class='warning'>That disk does not have a design on it!</span>")
return 1
else
// So that people who are bad at computers don't shred their disks
to_chat(user, "<span class='warning'>This is not the correct type of disk for the autolathe!</span>")
return 1
var/material_amount = materials.get_item_material_amount(O)
if(!material_amount)
+4 -4
View File
@@ -234,7 +234,7 @@ proc/CallMaterialName(ID)
else if(href_list["clear_tech"]) //Erase data on the technology disk.
if(t_disk)
t_disk.stored = null
t_disk.wipe_tech()
else if(href_list["eject_tech"]) //Eject the technology disk.
if(t_disk)
@@ -246,7 +246,7 @@ proc/CallMaterialName(ID)
else if(href_list["copy_tech"]) //Copy some technology data from the research holder to the disk.
for(var/datum/tech/T in files.known_tech)
if(href_list["copy_tech_ID"] == T.id)
t_disk.stored = T
t_disk.load_tech(T)
break
menu = 2
submenu = 0
@@ -261,7 +261,7 @@ proc/CallMaterialName(ID)
else if(href_list["clear_design"]) //Erases data on the design disk.
if(d_disk)
d_disk.blueprint = null
d_disk.wipe_blueprint()
else if(href_list["eject_design"]) //Eject the design disk.
if(d_disk)
@@ -284,7 +284,7 @@ proc/CallMaterialName(ID)
if(D.build_type & (AUTOLATHE|PROTOLATHE|CRAFTLATHE)) // Specifically excludes circuit imprinter and mechfab
D.build_type = autolathe_friendly ? (D.build_type | AUTOLATHE) : D.build_type
D.category |= "Imported"
d_disk.blueprint = D
d_disk.load_blueprint(D)
break
menu = 2
submenu = 0
+35 -5
View File
@@ -187,7 +187,7 @@ datum/tech/materials
datum/tech/engineering
name = "Engineering Research"
desc = "Development of new and improved engineering parts and."
desc = "Development of new and improved engineering parts and methods."
id = "engineering"
max_level = 5
@@ -206,7 +206,7 @@ datum/tech/powerstorage
datum/tech/bluespace
name = "'Blue-space' Research"
desc = "Research into the sub-reality known as 'blue-space'"
desc = "Research into the sub-reality known as 'blue-space'."
id = "bluespace"
max_level = 6
rare = 2
@@ -293,7 +293,7 @@ datum/tech/robotics
return cost
/obj/item/weapon/disk/tech_disk
name = "Technology Disk"
name = "\improper Technology Disk"
desc = "A disk for storing technology data for further research."
icon = 'icons/obj/cloning.dmi'
icon_state = "datadisk2"
@@ -301,13 +301,27 @@ datum/tech/robotics
w_class = 1
materials = list(MAT_METAL=30, MAT_GLASS=10)
var/datum/tech/stored
var/default_name = "\improper Technology Disk"
var/default_desc = "A disk for storing technology data for further research."
/obj/item/weapon/disk/tech_disk/New()
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
/obj/item/weapon/disk/tech_disk/proc/load_tech(datum/tech/T)
name = "[default_name] \[[T]\]"
desc = T.desc + " Level: '[T.level]'"
// NOTE: This is just a reference to the tech on the system it grabbed it from
// This seems highly fragile
stored = T
/obj/item/weapon/disk/tech_disk/proc/wipe_tech()
name = default_name
desc = default_desc
stored = null
/obj/item/weapon/disk/design_disk
name = "Component Design Disk"
name = "\improper Component Design Disk"
desc = "A disk for storing device design data for construction in lathes."
icon = 'icons/obj/cloning.dmi'
icon_state = "datadisk2"
@@ -315,7 +329,23 @@ datum/tech/robotics
w_class = 1
materials = list(MAT_METAL=30, MAT_GLASS=10)
var/datum/design/blueprint
// I'm doing this so that disk paths with pre-loaded designs don't get weird names
// Otherwise, I'd use "initial()"
var/default_name = "\improper Component Design Disk"
var/default_desc = "A disk for storing device design data for construction in lathes."
/obj/item/weapon/disk/design_disk/New()
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
/obj/item/weapon/disk/design_disk/proc/load_blueprint(datum/design/D)
name = "[default_name] \[[D]\]"
desc = D.desc
// NOTE: This is just a reference to the design on the system it grabbed it from
// This seems highly fragile
blueprint = D
/obj/item/weapon/disk/design_disk/proc/wipe_blueprint()
name = default_name
desc = default_desc
blueprint = null