diff --git a/__DEFINES/setup.dm b/__DEFINES/setup.dm
index cc32e3ae5fb..2830a2c1f19 100644
--- a/__DEFINES/setup.dm
+++ b/__DEFINES/setup.dm
@@ -1095,7 +1095,8 @@ var/default_colour_matrix = list(1,0,0,0,\
#define RECYK_BIOLOGICAL 3
#define RECYK_METAL 4
#define RECYK_ELECTRONIC 5
-#define RECYK_WOOD 6
+#define RECYK_WOOD 6
+#define RECYK_PLASTIC 7
////////////////
// job.info_flags
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index de8d591588f..fbbbdb9d009 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -851,11 +851,13 @@
body_parts_covered = HEAD
w_class = W_CLASS_LARGE
slot_flags = SLOT_HEAD
+ starting_materials = list(MAT_PLASTIC = 2*CC_PER_SHEET_MISC) //Recipe calls for 2 sheets
+ w_type = RECYK_PLASTIC
/obj/item/weapon/caution/attackby(obj/item/I as obj, mob/user as mob)
if(I.is_wirecutter(user))
to_chat(user, "You cut apart the cone into plastic.")
- drop_stack(/obj/item/stack/sheet/mineral/plastic, user.loc, 2, user)
+ drop_stack(/obj/item/stack/sheet/mineral/plastic, user.loc, starting_materials[MAT_PLASTIC]/CC_PER_SHEET_PLASTIC, user)
qdel(src)
return
return ..()
diff --git a/code/game/objects/items/ashtray.dm b/code/game/objects/items/ashtray.dm
index 59e43189e0b..78d111ae578 100644
--- a/code/game/objects/items/ashtray.dm
+++ b/code/game/objects/items/ashtray.dm
@@ -89,7 +89,7 @@
max_butts = 14
health = 24
starting_materials = list(MAT_PLASTIC = 50)
- w_type = RECYK_MISC
+ w_type = RECYK_PLASTIC
empty_desc = "Cheap plastic ashtray."
throwforce = 3
diff --git a/code/game/objects/items/misc_items.dm b/code/game/objects/items/misc_items.dm
index c392c8fdd38..50565f02a68 100644
--- a/code/game/objects/items/misc_items.dm
+++ b/code/game/objects/items/misc_items.dm
@@ -64,6 +64,8 @@
desc = "A neatly folded-up plastic bag, making it easier to store."
icon_state = "folded_bag"
w_class = W_CLASS_TINY
+ starting_materials = list(MAT_PLASTIC = 3*CC_PER_SHEET_PLASTIC)//Same as plastic bag
+ w_type = RECYK_PLASTIC
/obj/item/folded_bag/attack_self(mob/user)
to_chat(user, "You unfold \the [src].")
@@ -106,3 +108,5 @@
icon = 'icons/obj/weaponsmithing.dmi'
icon_state = "spring"
desc = "A piece of woven metal capable of high elasticity."
+ w_type = RECYK_METAL
+ starting_materials = list(MAT_IRON = 1 * CC_PER_SHEET_METAL)
diff --git a/code/game/objects/items/stacks/misc.dm b/code/game/objects/items/stacks/misc.dm
index 0a1a670d63c..6677f71f438 100644
--- a/code/game/objects/items/stacks/misc.dm
+++ b/code/game/objects/items/stacks/misc.dm
@@ -152,6 +152,7 @@
singular_name = "chain"
irregular_plural = "chains"
max_amount = 20
+ w_type = RECYK_METAL
/obj/item/stack/chains/can_stack_with(var/obj/item/other_stack)
if(!ispath(other_stack) && istype(other_stack) && other_stack.material_type == material_type)
diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm
index e823cd8ddf5..3dc96506f92 100644
--- a/code/game/objects/items/stacks/sheets/mineral.dm
+++ b/code/game/objects/items/stacks/sheets/mineral.dm
@@ -18,14 +18,6 @@ Mineral Sheets
/obj/item/stack/sheet/mineral
w_type = RECYK_METAL
- var/recyck_mat
-
-/obj/item/stack/sheet/mineral/recycle(var/datum/materials/rec)
- if(!recyck_mat)
- return 0
-
- rec.addAmount(recyck_mat, amount * get_material_cc_per_sheet(recyck_mat))
- . = 1
/*
* Sandstone
@@ -40,7 +32,9 @@ Mineral Sheets
origin_tech = Tc_MATERIALS + "=1"
sheettype = "sandstone"
melt_temperature = MELTPOINT_GLASS
- recyck_mat = MAT_GLASS
+ mat_type = MAT_GLASS
+ perunit = CC_PER_SHEET_GLASS
+ starting_materials = list(MAT_GLASS = CC_PER_SHEET_GLASS)
var/list/datum/stack_recipe/sandstone_recipes = list ( \
new/datum/stack_recipe("pile of dirt", /obj/machinery/portable_atmospherics/hydroponics/soil, 3, time = 10, one_per_turf = 1, on_floor = 1), \
@@ -68,6 +62,7 @@ var/list/datum/stack_recipe/sandstone_recipes = list ( \
w_class = W_CLASS_MEDIUM
melt_temperature = 2473.15
sheettype = "brick"
+ starting_materials = list(MAT_IRON = CC_PER_SHEET_METAL, MAT_GLASS = CC_PER_SHEET_GLASS)
var/list/datum/stack_recipe/brick_recipes = list ( \
new/datum/stack_recipe("fireplace", /obj/machinery/space_heater/campfire/stove/fireplace, 15, time = 10 SECONDS, one_per_turf = 1, on_floor = 1)
@@ -89,11 +84,11 @@ var/list/datum/stack_recipe/brick_recipes = list ( \
w_class = W_CLASS_MEDIUM
throw_range = 3
origin_tech = Tc_MATERIALS + "=6"
- perunit = CC_PER_SHEET_DIAMOND
sheettype = "diamond"
melt_temperature = 3820 // In a vacuum, but fuck dat
- recyck_mat = MAT_DIAMOND
+ perunit = CC_PER_SHEET_DIAMOND
mat_type = MAT_DIAMOND
+ starting_materials = list(MAT_DIAMOND = CC_PER_SHEET_DIAMOND)
var/list/datum/stack_recipe/diamond_recipes = list ( \
new/datum/stack_recipe("diamond floor tile", /obj/item/stack/tile/mineral/diamond, 1, 4, 20), \
@@ -119,11 +114,11 @@ var/list/datum/stack_recipe/diamond_recipes = list ( \
throw_speed = 3
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
- perunit = CC_PER_SHEET_URANIUM
sheettype = "uranium"
melt_temperature = 1132+T0C
- recyck_mat = MAT_URANIUM
+ perunit = CC_PER_SHEET_URANIUM
mat_type = MAT_URANIUM
+ starting_materials = list(MAT_URANIUM = CC_PER_SHEET_URANIUM)
var/list/datum/stack_recipe/uranium_recipes = list ( \
new/datum/stack_recipe("uranium floor tile", /obj/item/stack/tile/mineral/uranium, 1, 4, 20), \
@@ -151,11 +146,11 @@ var/list/datum/stack_recipe/uranium_recipes = list ( \
throw_speed = 3
throw_range = 3
origin_tech = Tc_PLASMATECH + "=2;" + Tc_MATERIALS + "=2"
- perunit = CC_PER_SHEET_PLASMA
sheettype = "plasma"
melt_temperature = MELTPOINT_STEEL + 500
- recyck_mat = MAT_PLASMA
+ perunit = CC_PER_SHEET_PLASMA
mat_type = MAT_PLASMA
+ starting_materials = list(MAT_PLASMA = CC_PER_SHEET_PLASMA)
var/list/datum/stack_recipe/plasma_recipes = list ( \
new/datum/stack_recipe("plasma floor tile", /obj/item/stack/tile/mineral/plasma, 1, 4, 20), \
@@ -181,11 +176,12 @@ var/list/datum/stack_recipe/plasma_recipes = list ( \
throw_speed = 3
throw_range = 3
origin_tech = Tc_MATERIALS + "=3"
- perunit = CC_PER_SHEET_PLASTIC
melt_temperature = MELTPOINT_PLASTIC
sheettype = "plastic"
- recyck_mat = MAT_PLASTIC
+ perunit = CC_PER_SHEET_PLASTIC
mat_type = MAT_PLASTIC
+ w_type = RECYK_PLASTIC
+ starting_materials = list(MAT_PLASTIC = CC_PER_SHEET_PLASTIC)
var/list/datum/stack_recipe/plastic_recipes = list ( \
new/datum/stack_recipe("plastic floor tile", /obj/item/stack/tile/mineral/plastic, 1, 4, 20), \
@@ -232,11 +228,11 @@ var/list/datum/stack_recipe/plastic_recipes = list ( \
throw_speed = 3
throw_range = 3
origin_tech = Tc_MATERIALS + "=4"
- perunit = CC_PER_SHEET_GOLD
melt_temperature = 1064+T0C
sheettype = "gold"
- recyck_mat = MAT_GOLD
+ perunit = CC_PER_SHEET_GOLD
mat_type = MAT_GOLD
+ starting_materials = list(MAT_GOLD = CC_PER_SHEET_GOLD)
var/list/datum/stack_recipe/gold_recipes = list ( \
new/datum/stack_recipe("golden floor tile", /obj/item/stack/tile/mineral/gold, 1, 4, 20), \
@@ -272,14 +268,14 @@ var/list/datum/stack_recipe/phazon_recipes = list( \
icon_state = "sheet-phazon"
item_state = "sheet-phazon"
sheettype = "phazon"
- perunit = CC_PER_SHEET_PHAZON
melt_temperature = MELTPOINT_PLASTIC
throwforce = 15.0
flags = FPRINT
siemens_coefficient = 1
origin_tech = Tc_MATERIALS + "=9"
- recyck_mat = MAT_PHAZON
+ perunit = CC_PER_SHEET_PHAZON
mat_type = MAT_PHAZON
+ starting_materials = list(MAT_PHAZON = CC_PER_SHEET_PHAZON)
/obj/item/stack/sheet/mineral/phazon/New(var/loc, var/amount=null)
recipes = phazon_recipes
@@ -298,10 +294,10 @@ var/list/datum/stack_recipe/phazon_recipes = list( \
throw_speed = 3
throw_range = 3
origin_tech = Tc_MATERIALS + "=3"
- perunit = CC_PER_SHEET_SILVER
sheettype = "silver"
- recyck_mat = MAT_SILVER
+ perunit = CC_PER_SHEET_SILVER
mat_type = MAT_SILVER
+ starting_materials = list(MAT_SILVER = CC_PER_SHEET_SILVER)
var/list/datum/stack_recipe/silver_recipes = list ( \
new/datum/stack_recipe("silver floor tile", /obj/item/stack/tile/mineral/silver, 1, 4, 20), \
@@ -330,10 +326,10 @@ var/list/datum/stack_recipe/silver_recipes = list ( \
throw_speed = 3
throw_range = 3
origin_tech = Tc_MATERIALS + "=4"
- perunit = CC_PER_SHEET_CLOWN
sheettype = "clown"
- recyck_mat = MAT_CLOWN
+ perunit = CC_PER_SHEET_CLOWN
mat_type = MAT_CLOWN
+ starting_materials = list(MAT_CLOWN = CC_PER_SHEET_CLOWN)
var/list/datum/stack_recipe/clown_recipes = list ( \
new/datum/stack_recipe("bananium floor tile", /obj/item/stack/tile/mineral/clown, 1, 40, 20), \
@@ -377,8 +373,8 @@ var/list/datum/stack_recipe/clown_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=4"
perunit = CC_PER_SHEET_MYTHRIL
- recyck_mat = MAT_MYTHRIL
mat_type = MAT_MYTHRIL
+ starting_materials = list(MAT_MYTHRIL = CC_PER_SHEET_MYTHRIL)
var/list/datum/stack_recipe/mythril_recipes = list ( \
blacksmithing_recipes,
@@ -399,6 +395,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_PHAROSIUM
+ mat_type = MAT_PHAROSIUM
+ starting_materials = list(MAT_PHAROSIUM = CC_PER_SHEET_PHAROSIUM)
/obj/item/stack/sheet/mineral/char
name = "char"
@@ -410,6 +408,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_CHAR
+ mat_type = MAT_CHAR
+ starting_materials = list(MAT_CHAR = CC_PER_SHEET_CHAR)
/obj/item/stack/sheet/mineral/claretine
@@ -422,6 +422,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_CLARETINE
+ mat_type = MAT_CLARETINE
+ starting_materials = list(MAT_CLARETINE = CC_PER_SHEET_CLARETINE)
/obj/item/stack/sheet/mineral/cobryl
@@ -434,6 +436,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_COBRYL
+ mat_type = MAT_COBRYL
+ starting_materials = list(MAT_COBRYL = CC_PER_SHEET_COBRYL)
/obj/item/stack/sheet/mineral/bohrum
@@ -446,6 +450,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_BOHRUM
+ mat_type = MAT_BOHRUM
+ starting_materials = list(MAT_BOHRUM = CC_PER_SHEET_BOHRUM)
/obj/item/stack/sheet/mineral/syreline
@@ -458,6 +464,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_SYRELINE
+ mat_type = MAT_SYRELINE
+ starting_materials = list(MAT_SYRELINE = CC_PER_SHEET_SYRELINE)
/obj/item/stack/sheet/mineral/erebite
@@ -470,6 +478,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_EREBITE
+ mat_type = MAT_EREBITE
+ starting_materials = list(MAT_EREBITE = CC_PER_SHEET_EREBITE)
/obj/item/stack/sheet/mineral/cerenkite
@@ -482,6 +492,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_CERENKITE
+ mat_type = MAT_CERENKITE
+ starting_materials = list(MAT_CERENKITE = CC_PER_SHEET_CERENKITE)
/obj/item/stack/sheet/mineral/cytine
@@ -494,6 +506,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_CYTINE
+ mat_type = MAT_CYTINE
+ starting_materials = list(MAT_CYTINE = CC_PER_SHEET_CYTINE)
/obj/item/stack/sheet/mineral/uqill
@@ -506,6 +520,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_UQILL
+ mat_type = MAT_UQILL
+ starting_materials = list(MAT_UQILL = CC_PER_SHEET_UQILL)
/obj/item/stack/sheet/mineral/telecrystal
@@ -518,6 +534,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_TELECRYSTAL
+ mat_type = MAT_TELECRYSTAL
+ starting_materials = list(MAT_TELECRYSTAL = CC_PER_SHEET_TELECRYSTAL)
/obj/item/stack/sheet/mineral/mauxite
name = "mauxite"
@@ -529,6 +547,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_MAUXITE
+ mat_type = MAT_MAUXITE
+ starting_materials = list(MAT_MAUXITE = CC_PER_SHEET_MAUXITE)
/obj/item/stack/sheet/mineral/molitz
@@ -541,6 +561,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_MOLITZ
+ mat_type = MAT_MOLITZ
+ starting_materials = list(MAT_MOLITZ = CC_PER_SHEET_MOLITZ)
/obj/item/stack/sheet/mineral/gingerbread
name = "gingerbread"
@@ -552,6 +574,8 @@ var/list/datum/stack_recipe/mythril_recipes = list ( \
throw_range = 3
origin_tech = Tc_MATERIALS + "=5"
perunit = CC_PER_SHEET_GINGERBREAD
+ mat_type = MAT_GINGERBREAD
+ starting_materials = list(MAT_GINGERBREAD = CC_PER_SHEET_GINGERBREAD)
var/list/datum/stack_recipe/gingerbread_recipes = list ( \
new/datum/stack_recipe("gingerbread floor tile", /obj/item/stack/tile/mineral/gingerbread, 1, 4, 20), \
@@ -564,5 +588,4 @@ var/list/datum/stack_recipe/gingerbread_recipes = list ( \
/obj/item/stack/sheet/mineral/gingerbread/New(var/loc, var/amount=null)
recipes = gingerbread_recipes
-
..()
diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm
index df8491ce88a..98ca1a7355d 100644
--- a/code/game/objects/items/stacks/sheets/sheet_types.dm
+++ b/code/game/objects/items/stacks/sheets/sheet_types.dm
@@ -94,8 +94,9 @@
autoignition_temperature = AUTOIGNITION_WOOD
fire_fuel = 1 //Not used here the same way as elsewhere; see burnFireFuel() below.
sheettype = "wood"
- w_type = RECYK_WOOD
siemens_coefficient = 0 //no conduct
+ w_type = RECYK_WOOD
+ starting_materials = list(MAT_WOOD = CC_PER_SHEET_WOOD)
mat_type = MAT_WOOD
perunit = CC_PER_SHEET_WOOD
diff --git a/code/game/objects/items/stacks/stack_recipes.dm b/code/game/objects/items/stacks/stack_recipes.dm
index cbced587cee..cb5c770f7be 100644
--- a/code/game/objects/items/stacks/stack_recipes.dm
+++ b/code/game/objects/items/stacks/stack_recipes.dm
@@ -172,11 +172,30 @@
if(inherit_material)
var/datum/material/mat
var/datum/materials/materials_list = new
+
+ //Figure out the material
if(istype(S, /obj/item/stack/sheet/))
var/obj/item/stack/sheet/SS = S
mat = materials_list.getMaterial(SS.mat_type)
else if(S.material_type)
mat = S.material_type
+
+ // Make it recyclable back into the materials it's made out of
+ // Initialize materials list if doesn't exist already
+ if (R.materials == null)
+ R.materials = new /datum/materials(src)
+
+ // Add main materials off the stack
+ R.materials.addRatioFrom(S.materials, req_amount/(S.amount * res_amount))
+
+ // Add extra materials off additional recipe requisites
+ for (var/req in other_reqs)
+ // other_reqs contains typepaths, so create an instance and use it's materials as base
+ // TODO: pull the materials from the actual object that was used to fulfill the other_req
+ var/atom/movable/A = new req
+ if (A.materials)
+ R.materials.addRatioFrom(A.materials, other_reqs[req]/res_amount)
+
R.dorfify(mat)
return 1
@@ -189,8 +208,33 @@
src.req_strikes = required_strikes
/datum/stack_recipe/blacksmithing/finish_building(mob/usr, var/obj/item/stack/S, var/obj/R)
+ // Figure out main material from stack
+ if(istype(S, /obj/item/stack/sheet/))
+ var/obj/item/stack/sheet/SS = S
+ var/datum/materials/materials_list = new
+ R.material_type = materials_list.getMaterial(SS.mat_type)
+ qdel(materials_list)
+ else if(S.material_type)
+ R.material_type = S.material_type
+
+ // Apply material info to end product for recycling
+ // Initialize materials list if doesn't exist already
+ if (R.materials == null)
+ R.materials = new /datum/materials(src)
+
+ // Add main materials off the stack
+ R.materials.addRatioFrom(S.materials, req_amount/(S.amount * res_amount))
+
+ // Add extra materials off additional recipe requisites
+ for (var/req in other_reqs)
+ // other_reqs contains typepaths, so create an instance and use it's materials as base
+ // TODO: pull the materials from the actual object that was used to fulfill the other_req
+ var/atom/movable/A = new req
+ if (A.materials)
+ R.materials.addRatioFrom(A.materials, other_reqs[req]/res_amount)
+
//Yeah nah let's put you in a blacksmith_placeholder
- var/obj/item/I = new /obj/item/smithing_placeholder(usr.loc,S, R, req_strikes)
+ var/obj/item/I = new /obj/item/smithing_placeholder(usr.loc, S, R, req_strikes)
I.name = "unforged [R.name]"
return 0
diff --git a/code/game/objects/items/stacks/teeth.dm b/code/game/objects/items/stacks/teeth.dm
index 565401a808f..76f4997bfbf 100644
--- a/code/game/objects/items/stacks/teeth.dm
+++ b/code/game/objects/items/stacks/teeth.dm
@@ -90,4 +90,6 @@
max_amount = 50
w_class = W_CLASS_TINY
throw_speed = 4
- throw_range = 10
\ No newline at end of file
+ throw_range = 10
+ starting_materials = list(MAT_GOLD = CC_PER_SHEET_GOLD) // Recipe requires 1 sheet. Could probably stand to be less though
+ w_type = RECYK_METAL
diff --git a/code/game/objects/items/stacks/tiles/mineral.dm b/code/game/objects/items/stacks/tiles/mineral.dm
index 3a294a009e7..bf1eee4b91b 100644
--- a/code/game/objects/items/stacks/tiles/mineral.dm
+++ b/code/game/objects/items/stacks/tiles/mineral.dm
@@ -13,6 +13,8 @@
max_amount = 60
material = "plasma"
+ starting_materials = list(MAT_PLASMA = CC_PER_SHEET_PLASMA / 4) // Recipe requires 1 sheet for 4 tiles
+ w_type = RECYK_METAL
/obj/item/stack/tile/mineral/uranium
name = "uranium tile"
@@ -27,6 +29,8 @@
max_amount = 60
material = "uranium"
+ starting_materials = list(MAT_URANIUM = CC_PER_SHEET_URANIUM / 4) // Recipe requires 1 sheet for 4 tiles
+ w_type = RECYK_METAL
/obj/item/stack/tile/mineral/uranium/safe
name = "isolated uranium tile"
@@ -35,6 +39,11 @@
icon_state = "tile_uraniumsafe"
material = "uranium_safe"
+ starting_materials = list(// Recipe requires 1 uranium sheet per 4 tiles, and 1 reinforced glass sheet per tile
+ MAT_URANIUM = CC_PER_SHEET_URANIUM / 4,
+ MAT_GLASS = CC_PER_SHEET_GLASS,
+ MAT_METAL = CC_PER_SHEET_METAL / 2)
+ w_type = RECYK_METAL
/obj/item/stack/tile/mineral/uranium/safe/attackby(obj/item/W as obj, mob/user as mob)
if(iscrowbar(W))
@@ -67,6 +76,8 @@
max_amount = 60
material = "gold"
+ starting_materials = list(MAT_GOLD = CC_PER_SHEET_GOLD / 4) // Recipe requires 1 sheet for 4 tiles
+ w_type = RECYK_METAL
/obj/item/stack/tile/mineral/silver
name = "silver tile"
@@ -81,6 +92,8 @@
max_amount = 60
material = "silver"
+ starting_materials = list(MAT_SILVER = CC_PER_SHEET_SILVER / 4) // Recipe requires 1 sheet for 4 tiles
+ w_type = RECYK_METAL
/obj/item/stack/tile/mineral/diamond
name = "diamond tile"
@@ -95,6 +108,8 @@
max_amount = 60
material = "diamond"
+ starting_materials = list(MAT_DIAMOND = CC_PER_SHEET_DIAMOND / 4) // Recipe requires 1 sheet for 4 tiles
+ w_type = RECYK_METAL
/obj/item/stack/tile/mineral/clown
name = "bananium tile"
@@ -109,6 +124,8 @@
max_amount = 60
material = "bananium"
+ starting_materials = list(MAT_CLOWN = CC_PER_SHEET_CLOWN / 4) // Recipe requires 1 sheet for 4 tiles
+ w_type = RECYK_METAL
var/spam_flag = 0
/obj/item/stack/tile/mineral/plastic
@@ -122,6 +139,8 @@
throw_speed = 3
throw_range = 7
max_amount = 60
+ starting_materials = list(MAT_PLASTIC = CC_PER_SHEET_PLASTIC / 4) // Recipe requires 1 sheet for 4 tiles
+ w_type = RECYK_PLASTIC
material = "plastic"
@@ -138,6 +157,8 @@
origin_tech = Tc_MATERIALS + "=9"
material = "phazon"
+ starting_materials = list(MAT_PHAZON = CC_PER_SHEET_PHAZON / 4) // Recipe requires 1 sheet for 4 tiles
+ w_type = RECYK_METAL
/obj/item/stack/tile/mineral/phazon/adjust_slowdown(mob/living/L, current_slowdown)
current_slowdown *= 0.75
@@ -156,6 +177,8 @@
max_amount = 60
material = "brass"
+ starting_materials = list(MAT_BRASS = CC_PER_SHEET_BRASS / 4) // Recipe requires 1 sheet for 4 tiles
+ w_type = RECYK_METAL
/obj/item/stack/tile/mineral/gingerbread
name = "gingerbread tile"
diff --git a/code/game/objects/items/weapons/boomerang.dm b/code/game/objects/items/weapons/boomerang.dm
index 8ddc855dee8..235209a08af 100644
--- a/code/game/objects/items/weapons/boomerang.dm
+++ b/code/game/objects/items/weapons/boomerang.dm
@@ -13,6 +13,8 @@
autoignition_temperature = AUTOIGNITION_WOOD
fire_fuel = 3
+ starting_materials = list(MAT_WOOD = CC_PER_SHEET_WOOD * 6)
+ w_type = RECYK_WOOD
/obj/item/weapon/boomerang/Destroy()
..()
@@ -32,6 +34,7 @@
starting_materials = list(MAT_PLASTIC = 1200)
melt_temperature = MELTPOINT_PLASTIC
+ w_type = RECYK_PLASTIC
/obj/item/weapon/boomerang/throw_at(atom/target, range, speed, override = 1)
if(!usr)
diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm
index 6482058d780..334d1d1b64f 100644
--- a/code/game/objects/items/weapons/kitchen.dm
+++ b/code/game/objects/items/weapons/kitchen.dm
@@ -176,6 +176,8 @@
icon_state = "pspoon"
melt_temperature = MELTPOINT_PLASTIC
bendable = FALSE
+ starting_materials = list(MAT_PLASTIC = 1*CC_PER_SHEET_MISC) //Recipe calls for 1 sheet
+ w_type = RECYK_PLASTIC
/*
* Forks
@@ -254,6 +256,8 @@
desc = "Yay, no washing up to do."
icon_state = "pfork"
melt_temperature = MELTPOINT_PLASTIC
+ starting_materials = list(MAT_PLASTIC = 1*CC_PER_SHEET_MISC) //Recipe calls for 1 sheet
+ w_type = RECYK_PLASTIC
/obj/item/weapon/kitchen/utensil/fork/teflon
name = "teflon fork"
@@ -295,6 +299,8 @@
throwforce = 1
sharpness = 0.8
melt_temperature = MELTPOINT_PLASTIC
+ starting_materials = list(MAT_PLASTIC = 1*CC_PER_SHEET_MISC) //Recipe calls for 1 sheet
+ w_type = RECYK_PLASTIC
/obj/item/weapon/kitchen/utensil/knife/nazi
name = "nazi knife"
diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm
index ad47e1de81a..67015554470 100644
--- a/code/game/objects/items/weapons/shields.dm
+++ b/code/game/objects/items/weapons/shields.dm
@@ -257,6 +257,7 @@
inhand_states = list("left_hand" = 'icons/mob/in-hand/left/shields.dmi', "right_hand" = 'icons/mob/in-hand/right/shields.dmi')
flags = FPRINT | SLOWDOWN_WHEN_CARRIED
slowdown = 4
+ w_type = RECYK_METAL
/obj/item/weapon/shield/riot/rune
name = "rune kiteshield"
diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm
index 7a96d84cee6..a8b18844a6e 100644
--- a/code/game/objects/items/weapons/storage/bags.dm
+++ b/code/game/objects/items/weapons/storage/bags.dm
@@ -107,6 +107,8 @@
clothing_flags = BLOCK_BREATHING | BLOCK_GAS_SMOKE_EFFECT
no_storage_slot = list(slot_head)
foldable = /obj/item/folded_bag
+ starting_materials = list(MAT_PLASTIC = 3*CC_PER_SHEET_MISC) //Recipe calls for 3 sheets
+ w_type = RECYK_PLASTIC
/obj/item/weapon/storage/bag/plasticbag/can_quick_store(var/obj/item/I)
return can_be_inserted(I,1)
diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm
index b4b880a956c..2d7a8c35b7e 100644
--- a/code/game/objects/items/weapons/storage/fancy.dm
+++ b/code/game/objects/items/weapons/storage/fancy.dm
@@ -773,6 +773,9 @@
storage_slots = 10
can_only_hold = list("/obj/item/weapon/spacecash", "/obj/item/weapon/coin")
+ starting_materials = list(MAT_GOLD = 2*CC_PER_SHEET_GOLD) // Recipe requires 2 sheets
+ w_type = RECYK_METAL
+
/*
* Beer Box
*/
diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm
index 1fae619cf04..dc649683bb4 100644
--- a/code/game/objects/items/weapons/swords_axes_etc.dm
+++ b/code/game/objects/items/weapons/swords_axes_etc.dm
@@ -292,6 +292,7 @@
inhand_states = list("left_hand" = 'icons/mob/in-hand/left/swords_axes.dmi', "right_hand" = 'icons/mob/in-hand/right/swords_axes.dmi')
item_state = "grey_sword"
force = 4
+ w_type = RECYK_METAL
/obj/item/weapon/rsscimmy
name = "rune scimitar"
diff --git a/code/game/objects/items/weapons/table_rack_parts.dm b/code/game/objects/items/weapons/table_rack_parts.dm
index 79e33a1f7e8..873222a59f1 100644
--- a/code/game/objects/items/weapons/table_rack_parts.dm
+++ b/code/game/objects/items/weapons/table_rack_parts.dm
@@ -194,6 +194,7 @@
desc = "Parts for a plastic table for your space patio."
icon_state = "plastic_tableparts"
starting_materials = list(MAT_PLASTIC = 3750)
+ w_type = RECYK_PLASTIC
table_type = /obj/structure/table/plastic
sheet_type = /obj/item/stack/sheet/mineral/plastic
sheet_amount = 5
diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm
index 54c8bb19a87..3fce2bfa0ec 100644
--- a/code/game/objects/items/weapons/weaponry.dm
+++ b/code/game/objects/items/weapons/weaponry.dm
@@ -456,6 +456,7 @@
inhand_states = list("left_hand" = 'icons/mob/in-hand/left/hammer_left.dmi', "right_hand" = 'icons/mob/in-hand/right/hammer_right.dmi')
force = 8
hitsound = 'sound/weapons/toolbox.ogg'
+ w_type = RECYK_METAL
/obj/item/weapon/pitchfork
name = "pitchfork"
@@ -467,6 +468,7 @@
sharpness = 2
sharpness = SHARP_TIP
hitsound = 'sound/weapons/bladeslice.ogg'
+ w_type = RECYK_METAL
/obj/item/weapon/baseball_bat
name = "baseball bat"
@@ -482,6 +484,7 @@
throw_speed = 1
throw_range = 7
w_class = W_CLASS_LARGE
+ w_type = RECYK_WOOD
/obj/item/weapon/baseball_bat/update_wield(mob/user)
..()
@@ -552,6 +555,7 @@
throw_speed = 1
throw_range = 7
w_class = W_CLASS_LARGE
+ w_type = RECYK_WOOD
/obj/item/weapon/spiked_bat/update_wield(mob/user)
..()
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index c8c7c76b2b6..24c5b4f17cb 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -30,6 +30,8 @@
req_access = null
opened = 0
flags = FPRINT
+ w_type = RECYK_PLASTIC //This one's plastic, not metal!
+
// mouse_drag_pointer = MOUSE_ACTIVE_POINTER //???
var/rigged = 0
var/sound_effect_open = 'sound/machines/click.ogg'
diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm
index c57b1efe566..98b6891bfb1 100644
--- a/code/game/objects/structures/inflatable.dm
+++ b/code/game/objects/structures/inflatable.dm
@@ -2,7 +2,7 @@
name = "inflatable"
w_class = W_CLASS_MEDIUM
icon = 'icons/obj/inflatable.dmi'
- w_type = RECYK_METAL
+ w_type = RECYK_PLASTIC
melt_temperature = MELTPOINT_PLASTIC
starting_materials = list(MAT_PLASTIC = 1.5*CC_PER_SHEET_MISC)
diff --git a/code/modules/Economy/debit_card.dm b/code/modules/Economy/debit_card.dm
index 7cb408dbf14..e0672f31e91 100644
--- a/code/modules/Economy/debit_card.dm
+++ b/code/modules/Economy/debit_card.dm
@@ -9,7 +9,7 @@
melt_temperature = MELTPOINT_PLASTIC
w_class = W_CLASS_TINY
starting_materials = list(MAT_PLASTIC = 10)
- w_type = RECYK_MISC
+ w_type = RECYK_PLASTIC
var/to_cut = 0.8
var/authorized_name = "" // The name of the card. Edited at any ATM.
diff --git a/code/modules/blacksmithing/blacksmithing.dm b/code/modules/blacksmithing/blacksmithing.dm
index b041e352d11..05b51de5154 100644
--- a/code/modules/blacksmithing/blacksmithing.dm
+++ b/code/modules/blacksmithing/blacksmithing.dm
@@ -9,6 +9,8 @@
/obj/item/smithing_placeholder
name = "placeholder"
desc = "An incomplete object, that requires forging and striking."
+ w_type = RECYK_METAL
+ starting_materials = list()
var/obj/result
var/malleable = FALSE
var/strikes_required
@@ -16,19 +18,20 @@
/obj/item/smithing_placeholder/Destroy()
result = null
+ materials = null
..()
/obj/item/smithing_placeholder/New(loc, var/obj/item/stack/S, var/obj/R, var/required_strikes)
..()
- if(istype(S, /obj/item/stack/sheet/))
- var/obj/item/stack/sheet/SS = S
- var/datum/materials/materials_list = new
- material_type = materials_list.getMaterial(SS.mat_type)
- qdel(materials_list)
- else if(S.material_type)
- material_type = S.material_type
+ // Copy materials from result
+ material_type = R.material_type
+ materials.addFrom(R.materials)
+
+ //Stores recipe result in...
result = R
- R.forceMove(null)
+ R.forceMove(null) //...nullspace?
+
+ // Makes it look like a metal sheet
var/obj/item/stack/sheet/mineral/M = material_type.sheettype
appearance = initial(M.appearance)
desc = initial(desc)
diff --git a/code/modules/blacksmithing/misc_components.dm b/code/modules/blacksmithing/misc_components.dm
index 85b7ff0cf82..c0a256f615b 100644
--- a/code/modules/blacksmithing/misc_components.dm
+++ b/code/modules/blacksmithing/misc_components.dm
@@ -1,5 +1,6 @@
/obj/item/item_head
icon = 'icons/obj/misc_components.dmi'
+ w_type = RECYK_METAL
var/obj/item/result
var/list/finishing_requirements = list(/obj/item/item_handle) //Things required to finish this object.
@@ -17,11 +18,18 @@
if(do_after(user, src, 4 SECONDS))
if(istype(I, /obj/item/stack))
var/obj/item/stack/S = I
+ var/datum/material/stack_material = S.materials
if(!S.use(1))
return
+ else
+ if (stack_material) // Not all sheets have a material type
+ materials.addAmount(stack_material.id, S.perunit)
else
if(!user.drop_item(I))
return
+ else
+ materials.addFrom(I.materials)
+
finishing_requirements.Remove(I.type)
gen_quality(quality-I.quality, quality, I.material_type)
if(!istype(I, /obj/item/stack))
@@ -30,6 +38,8 @@
if(!finishing_requirements.len) //We're done
user.drop_item(src)
result = new result
+ result.materials = new /datum/materials(result)
+ result.materials.addFrom(materials)
var/datum/material/mat = material_type
if(mat)
result.dorfify(mat, 0, quality)
@@ -61,18 +71,23 @@
icon = 'icons/obj/misc_components.dmi'
icon_state = "item_handle"
desc = "a generic handle, with no purpose."
+ starting_materials = list(MAT_WOOD = 0.5 * CC_PER_SHEET_WOOD)
+ w_type = RECYK_WOOD
/obj/item/sword_handle
name = "sword handle"
icon = 'icons/obj/misc_components.dmi'
icon_state = "sword_handle"
desc = "A generic sword handle."
+ starting_materials = list(MAT_WOOD = 0.5 * CC_PER_SHEET_WOOD, MAT_IRON = 0.5 * CC_PER_SHEET_METAL)
+ w_type = RECYK_METAL
/obj/item/cross_guard
name = "sword crossguard"
icon = 'icons/obj/misc_components.dmi'
icon_state = "crossguard"
desc = "Used to make sure what you're stabbing doesn't slide all the way to your hand, or your hand slide to the stabby bit."
+ w_type = RECYK_METAL
/obj/item/item_head/sword
name = "sword blade"
@@ -106,3 +121,4 @@
icon_state = "large_plate"
finishing_requirements = list(/obj/item/stack/leather_strip)
result = /obj/item/weapon/shield/riot/tower
+ w_type = RECYK_METAL
diff --git a/code/modules/clothing/accessories/accessory.dm b/code/modules/clothing/accessories/accessory.dm
index aeff47d9474..4be8db05c0d 100644
--- a/code/modules/clothing/accessories/accessory.dm
+++ b/code/modules/clothing/accessories/accessory.dm
@@ -312,7 +312,7 @@
slot_flags = SLOT_BELT
var/stored_name = null
starting_materials = list(MAT_PLASTIC = 50)
- w_type = RECYK_MISC
+ w_type = RECYK_PLASTIC
/obj/item/clothing/accessory/assistantcard/attack_self(mob/user as mob)
if(!stored_name)
diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm
index ec4f22561b9..a536df6dfa4 100644
--- a/code/modules/clothing/suits/miscellaneous.dm
+++ b/code/modules/clothing/suits/miscellaneous.dm
@@ -657,6 +657,8 @@ var/list/tag_suits_list = list()
body_parts_covered = ARMS|LEGS|FULL_TORSO|IGNORE_INV //transparent
allowed = list (/obj/item/weapon/fireaxe)
sterility = 100
+ starting_materials = list(MAT_PLASTIC = 5*CC_PER_SHEET_MISC) //Recipe calls for 5 sheets
+ w_type = RECYK_PLASTIC
/obj/item/clothing/suit/kefkarobe
name = "Crazed Jester's Robe"
diff --git a/code/modules/mining/materials.dm b/code/modules/mining/materials.dm
index 19cd758ef61..fd89a1ad4b8 100644
--- a/code/modules/mining/materials.dm
+++ b/code/modules/mining/materials.dm
@@ -88,6 +88,13 @@ var/global/list/initial_materials //Stores all the matids = 0 in helping New
if(zero_after)
mats.storage[mat_id] = 0
+/datum/materials/proc/addRatioFrom(var/datum/materials/mats, var/ratio)
+ if(mats == null)
+ return
+ for(var/mat_id in storage)
+ if(mats.storage[mat_id]>0)
+ storage[mat_id] += mats.storage[mat_id] * abs(ratio)
+
//Used to remove all materials from a given materials datum, and transfer it to ours
/datum/materials/proc/removeFrom(var/datum/materials/mats)
src.addFrom(mats,zero_after=1)
diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm
index 4066166a543..138e0e4cf28 100644
--- a/code/modules/mining/mine_items.dm
+++ b/code/modules/mining/mine_items.dm
@@ -196,7 +196,7 @@ proc/move_mining_shuttle()
w_class = W_CLASS_LARGE
sharpness = 0.6
sharpness_flags = SHARP_TIP
- starting_materials = list(MAT_IRON = 3750) //one sheet, but where can you make them?
+ starting_materials = list(MAT_IRON = CC_PER_SHEET_METAL * 4, MAT_WOOD = CC_PER_SHEET_WOOD * 0.5) // Blacksmithing recipe
w_type = RECYK_METAL
toolspeed = 0.4 //moving the delay to an item var so R&D can make improved picks. --NEO
origin_tech = Tc_MATERIALS + "=1;" + Tc_ENGINEERING + "=1"
@@ -226,6 +226,7 @@ proc/move_mining_shuttle()
toolspeed = 0.3
origin_tech = Tc_MATERIALS + "=3"
desc = "This makes no metallurgic sense."
+ starting_materials = list(MAT_SILVER = CC_PER_SHEET_SILVER * 4, MAT_WOOD = CC_PER_SHEET_WOOD * 0.5)
/obj/item/weapon/pickaxe/jackhammer
name = "sonic jackhammer"
@@ -256,6 +257,7 @@ proc/move_mining_shuttle()
toolspeed = 0.2
origin_tech = Tc_MATERIALS + "=4"
desc = "This makes no metallurgic sense."
+ starting_materials = list(MAT_GOLD = CC_PER_SHEET_GOLD * 4, MAT_WOOD = CC_PER_SHEET_WOOD * 0.5)
/obj/item/weapon/pickaxe/plasmacutter
name = "plasma torch"
@@ -344,7 +346,8 @@ proc/move_mining_shuttle()
toolspeed = 0.1
sharpness = 1.2
origin_tech = Tc_MATERIALS + "=6;" + Tc_ENGINEERING + "=4"
- desc = "A pickaxe with a diamond pick head, this is just like minecraft."
+ desc = "A pickaxe with a diamond coated pick head, this is just like minecraft."
+ starting_materials = list(MAT_IRON = CC_PER_SHEET_METAL * 3.9, MAT_DIAMOND = CC_PER_SHEET_DIAMOND * 0.1, MAT_WOOD = CC_PER_SHEET_WOOD * 0.5) // Letting miners recycle their diamond pickaxes into 4 diamond sheets would be a tad bit much, so let's make it mostly iron with diamond bits
/obj/item/weapon/pickaxe/drill
name = "mining drill" // Can dig sand as well!
diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm
index 92421a14bd9..d7abe4c6002 100644
--- a/code/modules/mining/ores_coins.dm
+++ b/code/modules/mining/ores_coins.dm
@@ -388,6 +388,7 @@
force = 1
throwforce = 1
w_class = W_CLASS_TINY
+ w_type = RECYK_METAL
var/string_attached
var/material=MAT_IRON // Ore ID, used with coinbags.
var/credits = 0 // How many credits is this coin worth?
diff --git a/code/modules/projectiles/guns/projectile/constructable/swords.dm b/code/modules/projectiles/guns/projectile/constructable/swords.dm
index 7b08fc458af..56084e7cb24 100644
--- a/code/modules/projectiles/guns/projectile/constructable/swords.dm
+++ b/code/modules/projectiles/guns/projectile/constructable/swords.dm
@@ -5,6 +5,7 @@
inhand_states = list("left_hand" = 'icons/mob/in-hand/left/swords_axes.dmi', "right_hand" = 'icons/mob/in-hand/right/swords_axes.dmi')
icon_state = "sword"
w_class = W_CLASS_MEDIUM
+ w_type = RECYK_METAL
hitsound = "sound/weapons/bloodyslice.ogg"
flags = FPRINT
siemens_coefficient = 1
diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm
index 789f67fe363..07337fe7ef1 100644
--- a/code/modules/reagents/reagent_containers/blood_pack.dm
+++ b/code/modules/reagents/reagent_containers/blood_pack.dm
@@ -12,6 +12,9 @@
var/holes = 0
var/mode = BLOODPACK_NORMAL
+ starting_materials = list(MAT_PLASTIC = 3*CC_PER_SHEET_MISC) //Recipe calls for 3 sheets
+ w_type = RECYK_PLASTIC
+
/obj/item/weapon/reagent_containers/blood/New()
..()
if(blood_type != null)
diff --git a/code/modules/reagents/reagent_containers/food/drinks.dm b/code/modules/reagents/reagent_containers/food/drinks.dm
index cddc42fcde5..96596e24017 100644
--- a/code/modules/reagents/reagent_containers/food/drinks.dm
+++ b/code/modules/reagents/reagent_containers/food/drinks.dm
@@ -1220,6 +1220,7 @@
origin_tech = Tc_MATERIALS + "=1"
melt_temperature = MELTPOINT_PLASTIC
starting_materials = list(MAT_PLASTIC = 500)
+ w_type = RECYK_PLASTIC
volume = 100
amount_per_transfer_from_this = 10
diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm
index cbbe3e0f48b..c0bc54c8ec3 100644
--- a/code/modules/reagents/reagent_containers/food/snacks.dm
+++ b/code/modules/reagents/reagent_containers/food/snacks.dm
@@ -5230,7 +5230,7 @@
slot_flags = SLOT_MASK
throwforce = 1
autoignition_temperature = 0
- w_type = RECYK_MISC
+ w_type = RECYK_PLASTIC
starting_materials = list(MAT_PLASTIC = 100)
/obj/item/weapon/reagent_containers/food/snacks/chococoin/wrapped
diff --git a/code/modules/reagents/reagent_containers/glass/bottle.dm b/code/modules/reagents/reagent_containers/glass/bottle.dm
index d6aa0e9c16c..dccdc5da3ee 100644
--- a/code/modules/reagents/reagent_containers/glass/bottle.dm
+++ b/code/modules/reagents/reagent_containers/glass/bottle.dm
@@ -613,7 +613,7 @@ var/datum/disease2/disease/wizarditis = null
icon = 'icons/obj/chemical.dmi'
icon_state = "bleachbottle"
starting_materials = list(MAT_PLASTIC = 1000)
- w_type = RECYK_MISC
+ w_type = RECYK_PLASTIC
melt_temperature = MELTPOINT_PLASTIC
/obj/item/weapon/reagent_containers/glass/bottle/bleach/update_icon()
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index 1bad57600e5..bf91d7690a3 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -302,6 +302,9 @@
var/items_moved = 0
for(var/atom/movable/A in affecting)
+ if(items_moved >= max_items_moved)
+ break
+
if(A.anchored)
continue
@@ -311,8 +314,6 @@
A.forceMove(out_T)
items_moved++
- if(items_moved >= max_items_moved)
- break
/obj/machinery/sorting_machine/attack_ai(mob/user)
interact(user)
@@ -375,7 +376,7 @@
return MT_UPDATE
//Honestly I didn't expect that to fit in, what, 10 lines of code?
-//Return 1 if the atom is to be filtered of the line.
+//Return 1 if the atom is to be filtered off the line.
/obj/machinery/sorting_machine/proc/sort(var/atom/movable/A)
return prob(50) //Henk because the base sorting machine shouldn't ever exist anyways.
@@ -384,8 +385,8 @@
/obj/machinery/sorting_machine/recycling
name = "Recycling Sorting Machine"
- var/list/selected_types = list("Glasses", "Metals/Minerals", "Electronics")
- var/list/types[6]
+ var/list/selected_types = list("Glasses", "Metals/Minerals", "Electronics", "Plastic")
+ var/list/types[7]
/obj/machinery/sorting_machine/recycling/New()
. = ..()
@@ -405,8 +406,45 @@
types[RECYK_ELECTRONIC] = "Electronics"
types[RECYK_GLASS] = "Glasses"
types[RECYK_METAL] = "Metals/Minerals"
+ types[RECYK_PLASTIC] = "Plastic"
types[RECYK_MISC] = "Miscellaneous"
+/obj/machinery/sorting_machine/recycling/process()
+ //Before sorting, we'll try and open any box and crate we find
+ if(stat & (BROKEN | NOPOWER))
+ return
+
+ var/turf/in_T = get_step(src, input_dir)
+ var/items_moved = 0
+
+ //Open any closets/crates
+ for(var/obj/structure/closet/C in in_T.contents)
+ //Only open a limited number of closets
+ if(items_moved >= max_items_moved)
+ break
+
+ if(C.open())
+ C.dump_contents()
+ items_moved++
+
+ //Open any storage items (including those that were in closets/cages)
+ for(var/obj/item/weapon/storage/S in in_T.contents)
+ //Only open a limited number of boxes
+ if(items_moved >= max_items_moved)
+ break
+
+ if(S.contents.len > 0)
+ var/S_old_contents = S.contents.len
+ S.mass_remove(in_T)
+
+ //If you just can't empty it out, treat it as normal rubbish
+ if(S.contents.len < S_old_contents)
+ items_moved++
+
+ //We can't start sorting items until we've made sure we've emptied every box and closet
+ if(items_moved == 0)
+ ..()
+
/obj/machinery/sorting_machine/recycling/Topic(href, href_list)
. = ..()
if(.)
@@ -426,6 +464,13 @@
return 1
/obj/machinery/sorting_machine/recycling/sort(atom/movable/A)
+ // A closet or crate that can't be opened can't be recycled, regardless of recycle type and selected types
+ if (istype(A, /obj/structure/closet))
+ var/obj/structure/closet/C = A
+ if (!C.can_open())
+ return FALSE
+
+ // Check atom recycle type is in selected types
return A.w_type && (types[A.w_type] in selected_types)
/obj/machinery/sorting_machine/recycling/interact(mob/user)