Skip to content

Commit

Permalink
Added technology and design disks that can hold more than one entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cruix committed Aug 25, 2016
1 parent e92908f commit 768a7da
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 82 deletions.
4 changes: 3 additions & 1 deletion code/game/machinery/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@
busy = 1
var/obj/item/weapon/disk/design_disk/D = O
if(do_after(user, 14.4, target = src))
files.AddDesign2Known(D.blueprint)
for(var/B in D.blueprints)
if(B)
files.AddDesign2Known(B)

busy = 0
return 1
Expand Down
18 changes: 12 additions & 6 deletions code/modules/cargo/exports/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@

/datum/export/tech/get_cost(obj/O)
var/obj/item/weapon/disk/tech_disk/D = O
if(!D.stored)
return 0
var/datum/tech/tech = D.stored
return ..() * tech.getCost(techLevels[tech.id])
var/cost = 0
for(var/V in D.tech_stored)
if(!V)
continue
var/datum/tech/tech = V
cost += tech.getCost(techLevels[tech.id])
return ..() * cost

/datum/export/tech/sell_object(obj/O)
..()
var/obj/item/weapon/disk/tech_disk/D = O
var/datum/tech/tech = D.stored
techLevels[tech.id] = tech.level
for(var/V in D.tech_stored)
if(!V)
continue
var/datum/tech/tech = V
techLevels[tech.id] = tech.level
4 changes: 3 additions & 1 deletion code/modules/hydroponics/biogenerator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@
processing = 1
var/obj/item/weapon/disk/design_disk/D = O
if(do_after(user, 10, target = src))
files.AddDesign2Known(D.blueprint)
for(var/B in D.blueprints)
if(B)
files.AddDesign2Known(B)
processing = 0
return 1
else
Expand Down
23 changes: 16 additions & 7 deletions code/modules/ninja/suit/suit_attackby.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,24 @@

else if(istype(I, /obj/item/weapon/disk/tech_disk))//If it's a data disk, we want to copy the research on to the suit.
var/obj/item/weapon/disk/tech_disk/TD = I
if(TD.stored)//If it has something on it.
var/has_research = 0
for(var/V in TD.tech_stored)
if(V)
has_research = 1
break
if(has_research)//If it has something on it.
U << "Research information detected, processing..."
if(do_after(U,s_delay, target = src))
for(var/datum/tech/current_data in stored_research)
if(current_data.id==TD.stored.id)
if(current_data.level<TD.stored.level)
current_data.level=TD.stored.level
break
TD.stored = null
for(var/V1 in 1 to TD.max_tech_stored)
var/datum/tech/new_data = TD.tech_stored[V1]
TD.tech_stored[V1] = null
if(!new_data)
continue
for(var/V2 in stored_research)
var/datum/tech/current_data = V2
if(current_data.id == new_data.id)
current_data.level = max(current_data.level, new_data.level)
break
U << "<span class='notice'>Data analyzed and updated. Disk erased.</span>"
else
U << "<span class='userdanger'>ERROR</span>: Procedure interrupted. Process terminated."
Expand Down
44 changes: 41 additions & 3 deletions code/modules/research/designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,24 @@ other types of metals and chemistry for reagents).
////////////////////////////////////////

/obj/item/weapon/disk/design_disk
name = "Component 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=100, MAT_GLASS=100)
var/datum/design/blueprint
materials = list(MAT_METAL=300, MAT_GLASS=100)
var/list/blueprints = list()
var/max_blueprints = 1

/obj/item/weapon/disk/design_disk/New()
src.pixel_x = rand(-5, 5)
src.pixel_y = rand(-5, 5)
for(var/i in 1 to max_blueprints)
blueprints += null

/obj/item/weapon/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

///////////////////////////////////
/////Non-Board Computer Stuff//////
Expand Down Expand Up @@ -94,6 +103,16 @@ other types of metals and chemistry for reagents).
build_path = /obj/item/weapon/disk/design_disk
category = list("Electronics")

/datum/design/design_disk_adv
name = "Advanced Design Storage Disk"
desc = "Produce additional disks for storing device designs."
id = "design_disk_adv"
req_tech = list("programming" = 3)
build_type = PROTOLATHE
materials = list(MAT_METAL = 300, MAT_GLASS = 100, MAT_SILVER=50)
build_path = /obj/item/weapon/disk/design_disk/adv
category = list("Electronics")

/datum/design/tech_disk
name = "Technology Data Storage Disk"
desc = "Produce additional disks for storing technology data."
Expand All @@ -104,6 +123,25 @@ other types of metals and chemistry for reagents).
build_path = /obj/item/weapon/disk/tech_disk
category = list("Electronics")

/datum/design/tech_disk_adv
name = "Advanced Technology Data Storage Disk"
desc = "Produce disks with extra storage capacity for storing technology data."
id = "tech_disk_adv"
req_tech = list("programming" = 3)
build_type = PROTOLATHE
materials = list(MAT_METAL = 300, MAT_GLASS = 100, MAT_SILVER=50)
build_path = /obj/item/weapon/disk/tech_disk/adv
category = list("Electronics")

/datum/design/tech_disk_super_adv
name = "Quantum Technology Data Storage Disk"
desc = "Produce disks with extremely large storage capacity for storing technology data."
id = "tech_disk_super_adv"
req_tech = list("programming" = 6)
build_type = PROTOLATHE
materials = list(MAT_METAL = 300, MAT_GLASS = 100, MAT_SILVER=100, MAT_GOLD=100)
build_path = /obj/item/weapon/disk/tech_disk/super_adv
category = list("Electronics")

/////////////////////////////////////////
/////////////////Mining//////////////////
Expand Down
Loading

0 comments on commit 768a7da

Please sign in to comment.