mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-17 05:31:53 +00:00
Allows Multiple Light Printing in Autolathe
Allows light tubes and light bulbs to be printed 5 or 10 at a time. Changes the is_stack var to be more general. Non-stack items with it will be able to produce 5 or 10 of said item at a time. This means it can be applied to other items if desired.
This commit is contained in:
@@ -8,9 +8,12 @@ var/datum/category_collection/autolathe/autolathe_recipes
|
|||||||
for(var/material in I.matter)
|
for(var/material in I.matter)
|
||||||
var/coeff = (no_scale ? 1 : 1.25) //most objects are more expensive to produce than to recycle
|
var/coeff = (no_scale ? 1 : 1.25) //most objects are more expensive to produce than to recycle
|
||||||
resources[material] = I.matter[material]*coeff // but if it's a sheet or RCD cartridge, it's 1:1
|
resources[material] = I.matter[material]*coeff // but if it's a sheet or RCD cartridge, it's 1:1
|
||||||
if(is_stack && istype(I, /obj/item/stack))
|
if(is_stack)
|
||||||
var/obj/item/stack/IS = I
|
if(istype(I, /obj/item/stack))
|
||||||
max_stack = IS.max_amount
|
var/obj/item/stack/IS = I
|
||||||
|
max_stack = IS.max_amount
|
||||||
|
else
|
||||||
|
max_stack = 10
|
||||||
qdel(I)
|
qdel(I)
|
||||||
|
|
||||||
/****************************
|
/****************************
|
||||||
@@ -65,7 +68,7 @@ var/datum/category_collection/autolathe/autolathe_recipes
|
|||||||
var/list/resources
|
var/list/resources
|
||||||
var/hidden
|
var/hidden
|
||||||
var/power_use = 0
|
var/power_use = 0
|
||||||
var/is_stack
|
var/is_stack // Creates multiple of an item if applied to non-stack items
|
||||||
var/max_stack
|
var/max_stack
|
||||||
var/no_scale
|
var/no_scale
|
||||||
|
|
||||||
|
|||||||
@@ -105,10 +105,12 @@
|
|||||||
/datum/category_item/autolathe/general/tube
|
/datum/category_item/autolathe/general/tube
|
||||||
name = "light tube"
|
name = "light tube"
|
||||||
path =/obj/item/weapon/light/tube
|
path =/obj/item/weapon/light/tube
|
||||||
|
is_stack = TRUE
|
||||||
|
|
||||||
/datum/category_item/autolathe/general/bulb
|
/datum/category_item/autolathe/general/bulb
|
||||||
name = "light bulb"
|
name = "light bulb"
|
||||||
path =/obj/item/weapon/light/bulb
|
path =/obj/item/weapon/light/bulb
|
||||||
|
is_stack = TRUE
|
||||||
|
|
||||||
/datum/category_item/autolathe/general/ashtray_glass
|
/datum/category_item/autolathe/general/ashtray_glass
|
||||||
name = "glass ashtray"
|
name = "glass ashtray"
|
||||||
|
|||||||
@@ -276,9 +276,13 @@
|
|||||||
|
|
||||||
//Create the desired item.
|
//Create the desired item.
|
||||||
var/obj/item/I = new making.path(src.loc)
|
var/obj/item/I = new making.path(src.loc)
|
||||||
if(multiplier > 1 && istype(I, /obj/item/stack))
|
if(multiplier > 1)
|
||||||
var/obj/item/stack/S = I
|
if(istype(I, /obj/item/stack))
|
||||||
S.amount = multiplier
|
var/obj/item/stack/S = I
|
||||||
|
S.amount = multiplier
|
||||||
|
else
|
||||||
|
for(multiplier; multiplier > 1; --multiplier) // Create multiple items if it's not a stack.
|
||||||
|
new making.path(src.loc)
|
||||||
|
|
||||||
updateUsrDialog()
|
updateUsrDialog()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user