diff --git a/baystation12.dme b/baystation12.dme index 889d36ae3f1..0ff2b2711b1 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -54,9 +54,6 @@ #define FILE_DIR "sound/voice/Serithi" #define FILE_DIR "sound/vox" #define FILE_DIR "sound/weapons" -#define FILE_DIR "tools" -#define FILE_DIR "tools/AddToChangelog" -#define FILE_DIR "tools/AddToChangelog/AddToChangelog" // END_FILE_DIR // BEGIN_PREFERENCES #define DEBUG diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index c76ff2511f6..3671b6ce08e 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -124,7 +124,6 @@ var/global/list/datum/stack_recipe/plasma_recipes = list ( \ throw_range = 3 origin_tech = "materials=3" perunit = 2000 - sheettype = "plastic" var/global/list/datum/stack_recipe/plastic_recipes = list ( \ new/datum/stack_recipe("plastic crate", /obj/structure/closet/pcrate, 10, one_per_turf = 1, on_floor = 1), \ diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 0dfabb85e12..767c6c69aab 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -13,10 +13,20 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \ new/datum/stack_recipe("stool", /obj/structure/stool, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("chair", /obj/structure/stool/bed/chair, one_per_turf = 1, on_floor = 1), \ - new/datum/stack_recipe("swivel chair", /obj/structure/stool/bed/chair/office/dark, 5, one_per_turf = 1, on_floor = 1), \ - new/datum/stack_recipe("comfy chair", /obj/structure/stool/bed/chair/comfy/beige, 2, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("bed", /obj/structure/stool/bed, 2, one_per_turf = 1, on_floor = 1), \ null, \ + new/datum/stack_recipe_list("office chairs",list( \ + new/datum/stack_recipe("dark office chair", /obj/structure/stool/bed/chair/office/dark, 5, one_per_turf = 1, on_floor = 1), \ + new/datum/stack_recipe("light office chair", /obj/structure/stool/bed/chair/office/light, 5, one_per_turf = 1, on_floor = 1), \ + ), 5), \ + new/datum/stack_recipe_list("comfy chairs", list( \ + new/datum/stack_recipe("beige comfy chair", /obj/structure/stool/bed/chair/comfy/beige, 2, one_per_turf = 1, on_floor = 1), \ + new/datum/stack_recipe("black comfy chair", /obj/structure/stool/bed/chair/comfy/black, 2, one_per_turf = 1, on_floor = 1), \ + new/datum/stack_recipe("brown comfy chair", /obj/structure/stool/bed/chair/comfy/brown, 2, one_per_turf = 1, on_floor = 1), \ + new/datum/stack_recipe("lime comfy chair", /obj/structure/stool/bed/chair/comfy/lime, 2, one_per_turf = 1, on_floor = 1), \ + new/datum/stack_recipe("teal comfy chair", /obj/structure/stool/bed/chair/comfy/teal, 2, one_per_turf = 1, on_floor = 1), \ + ), 2), \ + null, \ new/datum/stack_recipe("table parts", /obj/item/weapon/table_parts, 2), \ new/datum/stack_recipe("rack parts", /obj/item/weapon/rack_parts), \ new/datum/stack_recipe("closet", /obj/structure/closet, 2, time = 15, one_per_turf = 1, on_floor = 1), \ diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 3c8b694d288..43ea24b112e 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -1,7 +1,8 @@ /* Stack type objects! * Contains: * Stacks - * Recipe datum + * Recipe datum + * Recipe list datum */ /* @@ -32,51 +33,66 @@ return /obj/item/stack/attack_self(mob/user as mob) - interact(user) + list_recipes(user) -/obj/item/stack/interact(mob/user as mob) +/obj/item/stack/proc/list_recipes(mob/user as mob, recipes_sublist) if (!recipes) return if (!src || amount<=0) user << browse(null, "window=stack") user.set_machine(src) //for correct work of onclose + var/list/recipe_list = recipes + if (recipes_sublist && recipe_list[recipes_sublist] && istype(recipe_list[recipes_sublist], /datum/stack_recipe_list)) + var/datum/stack_recipe_list/srl = recipe_list[recipes_sublist] + recipe_list = srl.recipes var/t1 = text("Constructions from []Amount Left: []
", src, src.amount) - for(var/i=1;i<=recipes.len,i++) - var/datum/stack_recipe/R = recipes[i] - if (isnull(R)) + for(var/i=1;i<=recipe_list.len,i++) + var/E = recipe_list[i] + if (isnull(E)) t1 += "
" continue - if (i>1 && !isnull(recipes[i-1])) + + if (i>1 && !isnull(recipe_list[i-1])) t1+="
" - var/max_multiplier = round(src.amount / R.req_amount) - var/title as text - var/can_build = 1 - can_build = can_build && (max_multiplier>0) - /* - if (R.one_per_turf) - can_build = can_build && !(locate(R.result_type) in usr.loc) - if (R.on_floor) - can_build = can_build && istype(usr.loc, /turf/simulated/floor) - */ - if (R.res_amount>1) - title+= "[R.res_amount]x [R.title]\s" - else - title+= "[R.title]" - title+= " ([R.req_amount] [src.singular_name]\s)" - if (can_build) - t1 += text("[] ", src, i, title) - else - t1 += text("[]", title) - continue - if (R.max_res_amount>1 && max_multiplier>1) - max_multiplier = min(max_multiplier, round(R.max_res_amount/R.res_amount)) - t1 += " |" - var/list/multipliers = list(5,10,25) - for (var/n in multipliers) - if (max_multiplier>=n) - t1 += " [n*R.res_amount]x" - if (!(max_multiplier in multipliers)) - t1 += " [max_multiplier*R.res_amount]x" + + if (istype(E, /datum/stack_recipe_list)) + var/datum/stack_recipe_list/srl = E + if (src.amount >= srl.req_amount) + t1 += "[srl.title] ([srl.req_amount] [src.singular_name]\s)" + else + t1 += "[srl.title] ([srl.req_amount] [src.singular_name]\s
" + + if (istype(E, /datum/stack_recipe)) + var/datum/stack_recipe/R = E + var/max_multiplier = round(src.amount / R.req_amount) + var/title as text + var/can_build = 1 + can_build = can_build && (max_multiplier>0) + /* + if (R.one_per_turf) + can_build = can_build && !(locate(R.result_type) in usr.loc) + if (R.on_floor) + can_build = can_build && istype(usr.loc, /turf/simulated/floor) + */ + if (R.res_amount>1) + title+= "[R.res_amount]x [R.title]\s" + else + title+= "[R.title]" + title+= " ([R.req_amount] [src.singular_name]\s)" + if (can_build) + t1 += text("[title] ") + else + t1 += text("[]", title) + continue + if (R.max_res_amount>1 && max_multiplier>1) + max_multiplier = min(max_multiplier, round(R.max_res_amount/R.res_amount)) + t1 += " |" + var/list/multipliers = list(5,10,25) + for (var/n in multipliers) + if (max_multiplier>=n) + t1 += " [n*R.res_amount]x" + if (!(max_multiplier in multipliers)) + t1 += " [max_multiplier*R.res_amount]x" t1 += "
" user << browse(t1, "window=stack") @@ -87,10 +103,18 @@ ..() if ((usr.restrained() || usr.stat || usr.get_active_hand() != src)) return + + if (href_list["sublist"] && !href_list["make"]) + list_recipes(usr, text2num(href_list["sublist"])) + if (href_list["make"]) if (src.amount < 1) del(src) //Never should happen - var/datum/stack_recipe/R = recipes[text2num(href_list["make"])] + var/list/recipes_list = recipes + if (href_list["sublist"]) + var/datum/stack_recipe_list/srl = recipes_list[text2num(href_list["sublist"])] + recipes_list = srl.recipes + var/datum/stack_recipe/R = recipes_list[text2num(href_list["make"])] var/multiplier = text2num(href_list["multiplier"]) if (!multiplier) multiplier = 1 if (src.amount < R.req_amount*multiplier) @@ -222,4 +246,16 @@ src.max_res_amount = max_res_amount src.time = time src.one_per_turf = one_per_turf - src.on_floor = on_floor \ No newline at end of file + src.on_floor = on_floor + +/* + * Recipe list datum + */ +/datum/stack_recipe_list + var/title = "ERROR" + var/list/recipes = null + var/req_amount = 1 + New(title, recipes, req_amount = 1) + src.title = title + src.recipes = recipes + src.req_amount = req_amount \ No newline at end of file