mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
@@ -8,6 +8,7 @@
|
|||||||
idle_power_usage = 10
|
idle_power_usage = 10
|
||||||
active_power_usage = 100
|
active_power_usage = 100
|
||||||
|
|
||||||
|
var/list/machine_recipes
|
||||||
var/list/stored_material = list("metal" = 0, "glass" = 0)
|
var/list/stored_material = list("metal" = 0, "glass" = 0)
|
||||||
var/list/storage_capacity = list("metal" = 0, "glass" = 0)
|
var/list/storage_capacity = list("metal" = 0, "glass" = 0)
|
||||||
var/show_category = "All"
|
var/show_category = "All"
|
||||||
@@ -45,7 +46,7 @@
|
|||||||
dat += "<h2>Printable Designs</h2><h3>Showing: <a href='?src=\ref[src];change_category=1'>[show_category]</a>.</h3></center><table width = '100%'>"
|
dat += "<h2>Printable Designs</h2><h3>Showing: <a href='?src=\ref[src];change_category=1'>[show_category]</a>.</h3></center><table width = '100%'>"
|
||||||
|
|
||||||
var/index = 0
|
var/index = 0
|
||||||
for(var/datum/autolathe/recipe/R in autolathe_recipes)
|
for(var/datum/autolathe/recipe/R in machine_recipes)
|
||||||
index++
|
index++
|
||||||
if(R.hidden && !hacked || (show_category != "All" && show_category != R.category))
|
if(R.hidden && !hacked || (show_category != "All" && show_category != R.category))
|
||||||
continue
|
continue
|
||||||
@@ -206,14 +207,14 @@
|
|||||||
if(!choice) return
|
if(!choice) return
|
||||||
show_category = choice
|
show_category = choice
|
||||||
|
|
||||||
if(href_list["make"] && autolathe_recipes)
|
if(href_list["make"] && machine_recipes)
|
||||||
|
|
||||||
var/index = text2num(href_list["make"])
|
var/index = text2num(href_list["make"])
|
||||||
var/multiplier = text2num(href_list["multiplier"])
|
var/multiplier = text2num(href_list["multiplier"])
|
||||||
var/datum/autolathe/recipe/making
|
var/datum/autolathe/recipe/making
|
||||||
|
|
||||||
if(index > 0 && index <= autolathe_recipes.len)
|
if(index > 0 && index <= machine_recipes.len)
|
||||||
making = autolathe_recipes[index]
|
making = machine_recipes[index]
|
||||||
|
|
||||||
//Exploit detection, not sure if necessary after rewrite.
|
//Exploit detection, not sure if necessary after rewrite.
|
||||||
if(!making || multiplier < 0 || multiplier > 100)
|
if(!making || multiplier < 0 || multiplier > 100)
|
||||||
@@ -312,23 +313,6 @@
|
|||||||
|
|
||||||
..()
|
..()
|
||||||
|
|
||||||
//Create global autolathe recipe list if it hasn't been made already.
|
|
||||||
if(isnull(autolathe_recipes))
|
|
||||||
autolathe_recipes = list()
|
|
||||||
autolathe_categories = list()
|
|
||||||
for(var/R in typesof(/datum/autolathe/recipe)-/datum/autolathe/recipe)
|
|
||||||
var/datum/autolathe/recipe/recipe = new R
|
|
||||||
autolathe_recipes += recipe
|
|
||||||
autolathe_categories |= recipe.category
|
|
||||||
|
|
||||||
var/obj/item/I = new recipe.path
|
|
||||||
if(I.matter && !recipe.resources) //This can be overidden in the datums.
|
|
||||||
recipe.resources = list()
|
|
||||||
for(var/material in I.matter)
|
|
||||||
if(!isnull(storage_capacity[material]))
|
|
||||||
recipe.resources[material] = round(I.matter[material]*1.25) // More expensive to produce than they are to recycle.
|
|
||||||
del(I)
|
|
||||||
|
|
||||||
//Create parts for lathe.
|
//Create parts for lathe.
|
||||||
component_parts = list()
|
component_parts = list()
|
||||||
component_parts += new /obj/item/weapon/circuitboard/autolathe(src)
|
component_parts += new /obj/item/weapon/circuitboard/autolathe(src)
|
||||||
@@ -362,6 +346,10 @@
|
|||||||
disable_wire = pick(w)
|
disable_wire = pick(w)
|
||||||
w -= disable_wire
|
w -= disable_wire
|
||||||
|
|
||||||
|
/obj/machinery/autolathe/initialize()
|
||||||
|
..()
|
||||||
|
machine_recipes = autolathe_recipes
|
||||||
|
|
||||||
//Updates overall lathe storage size.
|
//Updates overall lathe storage size.
|
||||||
/obj/machinery/autolathe/RefreshParts()
|
/obj/machinery/autolathe/RefreshParts()
|
||||||
..()
|
..()
|
||||||
|
|||||||
@@ -1,6 +1,23 @@
|
|||||||
/var/global/list/autolathe_recipes
|
/var/global/list/autolathe_recipes
|
||||||
/var/global/list/autolathe_categories
|
/var/global/list/autolathe_categories
|
||||||
|
|
||||||
|
/proc/populate_lathe_recipes()
|
||||||
|
|
||||||
|
//Create global autolathe recipe list if it hasn't been made already.
|
||||||
|
autolathe_recipes = list()
|
||||||
|
autolathe_categories = list()
|
||||||
|
for(var/R in typesof(/datum/autolathe/recipe)-/datum/autolathe/recipe)
|
||||||
|
var/datum/autolathe/recipe/recipe = new R
|
||||||
|
autolathe_recipes += recipe
|
||||||
|
autolathe_categories |= recipe.category
|
||||||
|
|
||||||
|
var/obj/item/I = new recipe.path
|
||||||
|
if(I.matter && !recipe.resources) //This can be overidden in the datums.
|
||||||
|
recipe.resources = list()
|
||||||
|
for(var/material in I.matter)
|
||||||
|
recipe.resources[material] = round(I.matter[material]*1.25) // More expensive to produce than they are to recycle.
|
||||||
|
del(I)
|
||||||
|
|
||||||
/datum/autolathe/recipe
|
/datum/autolathe/recipe
|
||||||
var/name = "object"
|
var/name = "object"
|
||||||
var/path
|
var/path
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ var/global/datum/global_init/init = new ()
|
|||||||
// due to this list not being instantiated.
|
// due to this list not being instantiated.
|
||||||
populate_seed_list()
|
populate_seed_list()
|
||||||
|
|
||||||
|
// Create autolathe recipes, as above.
|
||||||
|
populate_lathe_recipes()
|
||||||
|
|
||||||
master_controller = new /datum/controller/game_controller()
|
master_controller = new /datum/controller/game_controller()
|
||||||
spawn(1)
|
spawn(1)
|
||||||
master_controller.setup()
|
master_controller.setup()
|
||||||
|
|||||||
Reference in New Issue
Block a user