From c6e07de4feaeedefaaf8e984c2bded1a7364f7c8 Mon Sep 17 00:00:00 2001 From: Salex08 <33989683+Salex08@users.noreply.github.com> Date: Wed, 29 Jun 2022 19:06:32 +0200 Subject: [PATCH] Adds Material tab for the autolathe to dispense the desired mats one put in and fixes a condition (#67848) In the Autolathe, moves all the matts from construction to the new tab Material which allows you to dispense all the mats you put in Also fixes missing "=" operator which wouldnt let you print 10 or 25 stack immiadetly once you reached it --- code/game/machinery/autolathe.dm | 5 +- .../research/designs/autolathe_designs.dm | 112 ++++++++++++++---- 2 files changed, 95 insertions(+), 22 deletions(-) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 8fdde994953..609b39ecc34 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -33,6 +33,7 @@ "Tools", "Electronics", "Construction", + "Material", "T-Comm", "Security", "Machinery", @@ -111,9 +112,9 @@ var/datum/component/material_container/mats = GetComponent(/datum/component/material_container) for(var/datum/material/mat in D.materials) max_multiplier = min(D.maxstack, round(mats.get_material_amount(mat)/D.materials[mat])) - if (max_multiplier>10 && !disabled) + if (max_multiplier >= 10 && !disabled) m10 = TRUE - if (max_multiplier>25 && !disabled) + if (max_multiplier >= 25 && !disabled) m25 = TRUE else if(!unbuildable) diff --git a/code/modules/research/designs/autolathe_designs.dm b/code/modules/research/designs/autolathe_designs.dm index 3c04f5a7972..23209fd7c86 100644 --- a/code/modules/research/designs/autolathe_designs.dm +++ b/code/modules/research/designs/autolathe_designs.dm @@ -324,25 +324,7 @@ build_type = AUTOLATHE materials = list(/datum/material/iron = MINERAL_MATERIAL_AMOUNT) build_path = /obj/item/stack/sheet/iron - category = list("initial","Construction") - maxstack = 50 - -/datum/design/glass - name = "Glass" - id = "glass" - build_type = AUTOLATHE - materials = list(/datum/material/glass = MINERAL_MATERIAL_AMOUNT) - build_path = /obj/item/stack/sheet/glass - category = list("initial","Construction") - maxstack = 50 - -/datum/design/rglass - name = "Reinforced Glass" - id = "rglass" - build_type = AUTOLATHE | SMELTER | PROTOLATHE | AWAY_LATHE - materials = list(/datum/material/iron = 1000, /datum/material/glass = MINERAL_MATERIAL_AMOUNT) - build_path = /obj/item/stack/sheet/rglass - category = list("initial","Construction","Stock Parts") + category = list("initial","Material") maxstack = 50 /datum/design/rods @@ -351,7 +333,97 @@ build_type = AUTOLATHE materials = list(/datum/material/iron = 1000) build_path = /obj/item/stack/rods - category = list("initial","Construction") + category = list("initial","Material") + maxstack = 50 + +/datum/design/glass + name = "Glass" + id = "glass" + build_type = AUTOLATHE + materials = list(/datum/material/glass = MINERAL_MATERIAL_AMOUNT) + build_path = /obj/item/stack/sheet/glass + category = list("initial","Material") + maxstack = 50 + +/datum/design/rglass + name = "Reinforced Glass" + id = "rglass" + build_type = AUTOLATHE | SMELTER | PROTOLATHE | AWAY_LATHE + materials = list(/datum/material/iron = 1000, /datum/material/glass = MINERAL_MATERIAL_AMOUNT) + build_path = /obj/item/stack/sheet/rglass + category = list("initial","Material","Stock Parts") + maxstack = 50 + +/datum/design/silver + name = "Silver" + id = "silver" + build_type = AUTOLATHE + materials = list(/datum/material/silver = MINERAL_MATERIAL_AMOUNT) + build_path = /obj/item/stack/sheet/mineral/silver + category = list("initial","Material") + maxstack = 50 + +/datum/design/gold + name = "Gold" + id = "gold" + build_type = AUTOLATHE + materials = list(/datum/material/gold = MINERAL_MATERIAL_AMOUNT) + build_path = /obj/item/stack/sheet/mineral/gold + category = list("initial","Material") + maxstack = 50 + +/datum/design/diamond + name = "Diamond" + id = "diamond" + build_type = AUTOLATHE + materials = list(/datum/material/diamond = MINERAL_MATERIAL_AMOUNT) + build_path = /obj/item/stack/sheet/mineral/diamond + category = list("initial","Material") + maxstack = 50 + +/datum/design/plasma + name = "Plasma" + id = "plasma" + build_type = AUTOLATHE + materials = list(/datum/material/plasma = MINERAL_MATERIAL_AMOUNT) + build_path = /obj/item/stack/sheet/mineral/plasma + category = list("initial","Material") + maxstack = 50 + +/datum/design/uranium + name = "Uranium" + id = "uranium" + build_type = AUTOLATHE + materials = list(/datum/material/uranium = MINERAL_MATERIAL_AMOUNT) + build_path = /obj/item/stack/sheet/mineral/uranium + category = list("initial","Material") + maxstack = 50 + +/datum/design/bananium + name = "Bananium" + id = "bananium" + build_type = AUTOLATHE + materials = list(/datum/material/bananium = MINERAL_MATERIAL_AMOUNT) + build_path = /obj/item/stack/sheet/mineral/bananium + category = list("initial","Material") + maxstack = 50 + +/datum/design/titanium + name = "Titanium" + id = "titanium" + build_type = AUTOLATHE + materials = list(/datum/material/titanium = MINERAL_MATERIAL_AMOUNT) + build_path = /obj/item/stack/sheet/mineral/titanium + category = list("initial","Material") + maxstack = 50 + +/datum/design/plastic + name = "Plastic" + id = "plastic" + build_type = AUTOLATHE + materials = list(/datum/material/plastic= MINERAL_MATERIAL_AMOUNT) + build_path = /obj/item/stack/sheet/plastic + category = list("initial","Material") maxstack = 50 /datum/design/rcd_ammo