diff --git a/code/datums/material_container.dm b/code/datums/material_container.dm
deleted file mode 100644
index 5d651346fe1..00000000000
--- a/code/datums/material_container.dm
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- This datum should be used for handling mineral contents of machines and whatever else is supposed to hold minerals and make use of them.
-
- Variables:
- amount - raw amount of the mineral this container is holding, calculated by the defined value MINERAL_MATERIAL_AMOUNT=2000.
- max_amount - max raw amount of mineral this container can hold.
- sheet_type - type of the mineral sheet the container handles, used for output.
- owner - object that this container is being used by, used for output.
- MAX_STACK_SIZE - size of a stack of mineral sheets. Constant.
-*/
-
-/datum/material_container
- var/total_amount = 0
- var/max_amount
- var/sheet_type
- var/obj/owner
- var/list/materials = list()
- //MAX_STACK_SIZE = 50
- //MINERAL_MATERIAL_AMOUNT = 2000
-
-/datum/material_container/New(obj/O, list/mat_list, max_amt = 0)
- owner = O
- max_amount = max(0, max_amt)
-
- if(mat_list[MAT_METAL])
- materials[MAT_METAL] = new /datum/material/metal()
- if(mat_list[MAT_GLASS])
- materials[MAT_GLASS] = new /datum/material/glass()
- if(mat_list[MAT_SILVER])
- materials[MAT_SILVER] = new /datum/material/silver()
- if(mat_list[MAT_GOLD])
- materials[MAT_GOLD] = new /datum/material/gold()
- if(mat_list[MAT_DIAMOND])
- materials[MAT_DIAMOND] = new /datum/material/diamond()
- if(mat_list[MAT_URANIUM])
- materials[MAT_URANIUM] = new /datum/material/uranium()
- if(mat_list[MAT_PLASMA])
- materials[MAT_PLASMA] = new /datum/material/plasma()
- if(mat_list[MAT_BANANIUM])
- materials[MAT_BANANIUM] = new /datum/material/bananium()
- if(mat_list[MAT_TRANQUILLITE])
- materials[MAT_TRANQUILLITE] = new /datum/material/tranquillite()
- if(mat_list[MAT_TITANIUM])
- materials[MAT_TITANIUM] = new /datum/material/titanium()
-
-/datum/material_container/Destroy()
- QDEL_LIST_ASSOC_VAL(materials)
- owner = null
- return ..()
-
-//For inserting an amount of material
-/datum/material_container/proc/insert_amount(amt, material_type = null)
- if(amt > 0 && has_space(amt))
- var/total_amount_saved = total_amount
- if(material_type)
- var/datum/material/M = materials[material_type]
- if(M)
- M.amount += amt
- total_amount += amt
- else
- for(var/datum/material/M in materials)
- M.amount += amt
- total_amount += amt
- return (total_amount - total_amount_saved)
- return 0
-
-/datum/material_container/proc/insert_stack(obj/item/stack/S, amt = 0)
- if(amt <= 0)
- return 0
- if(amt > S.amount)
- amt = S.amount
- var/material_amt = get_item_material_amount(S)
- if(!material_amt)
- return 0
-
- amt = min(amt, round(((max_amount - total_amount) / material_amt)))
- if(!amt)
- return 0
-
- insert_materials(S,amt)
- S.use(amt)
- return amt
-
-/datum/material_container/proc/insert_item(obj/item/I, multiplier = 1)
- if(!I)
- return 0
- if(istype(I,/obj/item/stack))
- var/obj/item/stack/S = I
- return insert_stack(I, S.amount)
-
- var/material_amount = get_item_material_amount(I)
- if(!material_amount || !has_space(material_amount))
- return 0
-
- insert_materials(I, multiplier)
- return material_amount
-
-/datum/material_container/proc/insert_materials(obj/item/I, multiplier = 1) //for internal usage only
- var/datum/material/M
- for(var/MAT in materials)
- M = materials[MAT]
- M.amount += I.materials[MAT] * multiplier
- total_amount += I.materials[MAT] * multiplier
-
-//For consuming material
-//mats is a list of types of material to use and the corresponding amounts, example: list(MAT_METAL=100, MAT_GLASS=200)
-/datum/material_container/proc/use_amount(list/mats, multiplier=1)
- if(!mats || !mats.len)
- return 0
-
- var/datum/material/M
- for(var/MAT in materials)
- M = materials[MAT]
- if(M.amount < (mats[MAT] * multiplier))
- return 0
-
- var/total_amount_save = total_amount
- for(var/MAT in materials)
- M = materials[MAT]
- M.amount -= mats[MAT] * multiplier
- total_amount -= mats[MAT] * multiplier
-
- return total_amount_save - total_amount
-
-
-/datum/material_container/proc/use_amount_type(amt, material_type)
- var/datum/material/M
- M = materials[material_type]
- if(M)
- if(M.amount >= amt)
- M.amount -= amt
- total_amount -= amt
- return amt
- return 0
-
-//For spawning mineral sheets; internal use only
-/datum/material_container/proc/retrieve(sheet_amt, datum/material/M)
- if(!M.sheet_type)
- return 0
- if(sheet_amt > 0)
- if(M.amount < (sheet_amt * MINERAL_MATERIAL_AMOUNT))
- sheet_amt = round(M.amount / MINERAL_MATERIAL_AMOUNT)
- var/count = 0
-
- while(sheet_amt > MAX_STACK_SIZE)
- new M.sheet_type(get_turf(owner), MAX_STACK_SIZE)
- count += MAX_STACK_SIZE
- use_amount_type(sheet_amt * MINERAL_MATERIAL_AMOUNT, M.id)
- sheet_amt -= MAX_STACK_SIZE
-
- if(round(M.amount / MINERAL_MATERIAL_AMOUNT))
- new M.sheet_type(get_turf(owner), sheet_amt)
- count += sheet_amt
- use_amount_type(sheet_amt * MINERAL_MATERIAL_AMOUNT, M.id)
- return count
- return 0
-
-/datum/material_container/proc/retrieve_sheets(sheet_amt, material_type)
- if(materials[material_type])
- return retrieve(sheet_amt, materials[material_type])
- return 0
-
-/datum/material_container/proc/retrieve_amount(amt, material_type)
- return retrieve_sheets(amount2sheet(amt),material_type)
-
-/datum/material_container/proc/retrieve_all()
- var/result = 0
- var/datum/material/M
- for(var/MAT in materials)
- M = materials[MAT]
- result += retrieve_sheets(amount2sheet(M.amount), MAT)
- return result
-
-/datum/material_container/proc/has_space(amt = 0)
- return (total_amount + amt) <= max_amount
-
-/datum/material_container/proc/has_materials(list/mats, multiplier=1)
- if(!mats || !mats.len)
- return 0
-
- var/datum/material/M
- for(var/MAT in mats)
- M = materials[MAT]
- if(M.amount < (mats[MAT] * multiplier))
- return 0
- return 1
-
-/datum/material_container/proc/amount2sheet(amt)
- if(amt >= MINERAL_MATERIAL_AMOUNT)
- return round(amt / MINERAL_MATERIAL_AMOUNT)
- return 0
-
-/datum/material_container/proc/sheet2amount(sheet_amt)
- if(sheet_amt > 0)
- return sheet_amt * MINERAL_MATERIAL_AMOUNT
- return 0
-
-/datum/material_container/proc/amount(material_type)
- var/datum/material/M = materials[material_type]
- return M ? M.amount : 0
-
-//returns the amount of material relevant to this container;
-//if this container does not support glass, any glass in 'I' will not be taken into account
-/datum/material_container/proc/get_item_material_amount(obj/item/I)
- if(!istype(I))
- return 0
- var/material_amount = 0
- for(var/MAT in materials)
- material_amount += I.materials[MAT]
- return material_amount
\ No newline at end of file
diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm
index 1abc1c4020f..496e7e05eac 100644
--- a/code/datums/supplypacks.dm
+++ b/code/datums/supplypacks.dm
@@ -1236,8 +1236,8 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
/datum/supply_packs/materials/plastic30
name = "30 Plastic Sheets Crate"
contains = list(/obj/item/stack/sheet/plastic)
- amount = 30
- cost = 25
+ amount = 50
+ cost = 10
containername = "plastic sheets crate"
//////////////////////////////////////////////////////////////////////////////
diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm
index e52a3f12532..13a2ba49ddd 100644
--- a/code/game/machinery/recycler.dm
+++ b/code/game/machinery/recycler.dm
@@ -13,25 +13,20 @@ var/const/SAFETY_COOLDOWN = 100
var/blood = 0
var/eat_dir = WEST
var/amount_produced = 1
- var/datum/material_container/materials
var/crush_damage = 1000
var/eat_victim_items = 1
var/item_recycle_sound = 'sound/machines/recycler.ogg'
/obj/machinery/recycler/New()
+ AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_URANIUM, MAT_BANANIUM, MAT_TRANQUILLITE, MAT_TITANIUM, MAT_PLASTIC, MAT_BLUESPACE))
..()
component_parts = list()
component_parts += new /obj/item/circuitboard/recycler(null)
component_parts += new /obj/item/stock_parts/matter_bin(null)
component_parts += new /obj/item/stock_parts/manipulator(null)
- materials = new /datum/material_container(src, list(MAT_METAL=1, MAT_GLASS=1, MAT_SILVER=1, MAT_GOLD=1, MAT_DIAMOND=1, MAT_PLASMA=1, MAT_URANIUM=1, MAT_BANANIUM=1, MAT_TRANQUILLITE=1, MAT_TITANIUM=1))
RefreshParts()
update_icon()
-/obj/machinery/recycler/Destroy()
- QDEL_NULL(materials)
- return ..()
-
/obj/machinery/recycler/RefreshParts()
var/amt_made = 0
var/mat_mod = 0
@@ -40,6 +35,7 @@ var/const/SAFETY_COOLDOWN = 100
mat_mod *= 50000
for(var/obj/item/stock_parts/manipulator/M in component_parts)
amt_made = 25 * M.rating //% of materials salvaged
+ GET_COMPONENT(materials, /datum/component/material_container)
materials.max_amount = mat_mod
amount_produced = min(100, amt_made)
@@ -130,8 +126,9 @@ var/const/SAFETY_COOLDOWN = 100
playsound(loc, item_recycle_sound, 100, 0)
/obj/machinery/recycler/proc/recycle_item(obj/item/I)
- I.loc = loc
+ I.forceMove(loc)
+ GET_COMPONENT(materials, /datum/component/material_container)
var/material_amount = materials.get_item_material_amount(I)
if(!material_amount)
qdel(I)
diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm
index 0e01e2088b2..4412b547b19 100644
--- a/code/game/objects/items/stacks/sheets/sheet_types.dm
+++ b/code/game/objects/items/stacks/sheets/sheet_types.dm
@@ -364,24 +364,26 @@ var/global/list/datum/stack_recipe/brass_recipes = list ( \
throw_range = 3
origin_tech = "materials=2;biotech=2"
-var/global/list/datum/stack_recipe/plastic_recipes = list ( \
- new/datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, 5, one_per_turf = 1, on_floor = 1, time = 40), \
- new/datum/stack_recipe("plastic crate", /obj/structure/closet/crate/plastic, 10, one_per_turf = 1, on_floor = 1), \
- new/datum/stack_recipe("plastic ashtray", /obj/item/ashtray/plastic, 2, one_per_turf = 1, on_floor = 1), \
- new/datum/stack_recipe("plastic fork", /obj/item/kitchen/utensil/pfork, 1, on_floor = 1), \
- new/datum/stack_recipe("plastic spoon", /obj/item/kitchen/utensil/pspoon, 1, on_floor = 1), \
- new/datum/stack_recipe("plastic spork", /obj/item/kitchen/utensil/pspork, 1, on_floor = 1), \
- new/datum/stack_recipe("plastic knife", /obj/item/kitchen/knife/plastic, 1, on_floor = 1), \
- new/datum/stack_recipe("plastic bag", /obj/item/storage/bag/plasticbag, 3, on_floor = 1), \
- new/datum/stack_recipe("bear mould", /obj/item/kitchen/mould/bear, 1, on_floor = 1), \
- new/datum/stack_recipe("worm mould", /obj/item/kitchen/mould/worm, 1, on_floor = 1), \
- new/datum/stack_recipe("bean mould", /obj/item/kitchen/mould/bean, 1, on_floor = 1), \
- new/datum/stack_recipe("ball mould", /obj/item/kitchen/mould/ball, 1, on_floor = 1), \
- new/datum/stack_recipe("cane mould", /obj/item/kitchen/mould/cane, 1, on_floor = 1), \
- new/datum/stack_recipe("cash mould", /obj/item/kitchen/mould/cash, 1, on_floor = 1), \
- new/datum/stack_recipe("coin mould", /obj/item/kitchen/mould/coin, 1, on_floor = 1), \
- new/datum/stack_recipe("sucker mould", /obj/item/kitchen/mould/loli, 1, on_floor = 1), \
- )
+GLOBAL_LIST_INIT(plastic_recipes, list(
+ new /datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, 5, one_per_turf = 1, on_floor = 1, time = 40), \
+ new /datum/stack_recipe("wet floor sign", /obj/item/caution, 2), \
+ new /datum/stack_recipe("water bottle", /obj/item/reagent_containers/food/drinks/waterbottle/empty), \
+ new /datum/stack_recipe("large water bottle", /obj/item/reagent_containers/food/drinks/waterbottle/large/empty,3), \
+ new /datum/stack_recipe("plastic crate", /obj/structure/closet/crate/plastic, 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("plastic ashtray", /obj/item/ashtray/plastic, 2, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("plastic fork", /obj/item/kitchen/utensil/pfork, 1, on_floor = 1), \
+ new /datum/stack_recipe("plastic spoon", /obj/item/kitchen/utensil/pspoon, 1, on_floor = 1), \
+ new /datum/stack_recipe("plastic spork", /obj/item/kitchen/utensil/pspork, 1, on_floor = 1), \
+ new /datum/stack_recipe("plastic knife", /obj/item/kitchen/knife/plastic, 1, on_floor = 1), \
+ new /datum/stack_recipe("plastic bag", /obj/item/storage/bag/plasticbag, 3, on_floor = 1), \
+ new /datum/stack_recipe("bear mould", /obj/item/kitchen/mould/bear, 1, on_floor = 1), \
+ new /datum/stack_recipe("worm mould", /obj/item/kitchen/mould/worm, 1, on_floor = 1), \
+ new /datum/stack_recipe("bean mould", /obj/item/kitchen/mould/bean, 1, on_floor = 1), \
+ new /datum/stack_recipe("ball mould", /obj/item/kitchen/mould/ball, 1, on_floor = 1), \
+ new /datum/stack_recipe("cane mould", /obj/item/kitchen/mould/cane, 1, on_floor = 1), \
+ new /datum/stack_recipe("cash mould", /obj/item/kitchen/mould/cash, 1, on_floor = 1), \
+ new /datum/stack_recipe("coin mould", /obj/item/kitchen/mould/coin, 1, on_floor = 1), \
+ new /datum/stack_recipe("sucker mould", /obj/item/kitchen/mould/loli, 1, on_floor = 1)))
/obj/item/stack/sheet/plastic
name = "plastic"
@@ -390,10 +392,11 @@ var/global/list/datum/stack_recipe/plastic_recipes = list ( \
icon_state = "sheet-plastic"
throwforce = 7
origin_tech = "materials=1;biotech=1"
+ materials = list(MAT_PLASTIC = MINERAL_MATERIAL_AMOUNT)
merge_type = /obj/item/stack/sheet/plastic
/obj/item/stack/sheet/plastic/New()
- recipes = plastic_recipes
+ recipes = GLOB.plastic_recipes
. = ..()
/obj/item/stack/sheet/plastic/fifty
diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm
index 6bd8c37901e..a5aa4662c63 100644
--- a/code/modules/food_and_drinks/drinks/drinks.dm
+++ b/code/modules/food_and_drinks/drinks/drinks.dm
@@ -365,4 +365,29 @@
name = "Goon from a Blue Toolbox special edition"
desc = "Wine from the land down under, where the dingos roam and the roos do wander."
icon_state = "goonbag"
- list_reagents = list("wine" = 70)
\ No newline at end of file
+ list_reagents = list("wine" = 70)
+
+/obj/item/reagent_containers/food/drinks/waterbottle
+ name = "bottle of water"
+ desc = "A bottle of water filled at an old Earth bottling facility."
+ icon = 'icons/obj/drinks.dmi'
+ icon_state = "smallbottle"
+ item_state = "bottle"
+ list_reagents = list("water" = 49.5, "fluorine" = 0.5) //see desc, don't think about it too hard
+ materials = list(MAT_GLASS = 0)
+ volume = 50
+ amount_per_transfer_from_this = 10
+
+/obj/item/reagent_containers/food/drinks/waterbottle/empty
+ list_reagents = list()
+
+/obj/item/reagent_containers/food/drinks/waterbottle/large
+ desc = "A fresh commercial-sized bottle of water."
+ icon_state = "largebottle"
+ materials = list(MAT_GLASS = 0)
+ list_reagents = list("water" = 100)
+ volume = 100
+ amount_per_transfer_from_this = 20
+
+/obj/item/reagent_containers/food/drinks/waterbottle/large/empty
+ list_reagents = list()
\ No newline at end of file
diff --git a/code/modules/food_and_drinks/drinks/drinks/cans.dm b/code/modules/food_and_drinks/drinks/drinks/cans.dm
index e5f56b64311..282278c990e 100644
--- a/code/modules/food_and_drinks/drinks/drinks/cans.dm
+++ b/code/modules/food_and_drinks/drinks/drinks/cans.dm
@@ -64,13 +64,6 @@
icon_state = "cola"
list_reagents = list("cola" = 30)
-/obj/item/reagent_containers/food/drinks/cans/waterbottle
- name = "Bottled Water"
- desc = "Introduced to the vending machines by Skrellian request, this water comes straight from the Martian poles."
- icon_state = "waterbottle"
- is_plastic = 1
- list_reagents = list("water" = 30)
-
/obj/item/reagent_containers/food/drinks/cans/beer
name = "Space Beer"
desc = "Contains only water, malt and hops."
diff --git a/code/modules/reagents/chemistry/reagents/toxins.dm b/code/modules/reagents/chemistry/reagents/toxins.dm
index 72014dd1021..8cad5400c02 100644
--- a/code/modules/reagents/chemistry/reagents/toxins.dm
+++ b/code/modules/reagents/chemistry/reagents/toxins.dm
@@ -20,18 +20,6 @@
M.adjustToxLoss(1.5)
..()
-/datum/reagent/plasticide
- name = "Plasticide"
- id = "plasticide"
- description = "Liquid plastic, do not eat."
- reagent_state = LIQUID
- color = "#CF3600" // rgb: 207, 54, 0
-
-/datum/reagent/plasticide/on_mob_life(mob/living/M)
- M.adjustToxLoss(1.5)
- ..()
-
-
/datum/reagent/minttoxin
name = "Mint Toxin"
id = "minttoxin"
diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm
index b83de5f94d8..22fd75b5e21 100644
--- a/code/modules/reagents/chemistry/recipes/others.dm
+++ b/code/modules/reagents/chemistry/recipes/others.dm
@@ -93,17 +93,18 @@
result_amount = 2
mix_message = "The mixture gives off a sharp acidic tang."
-/datum/chemical_reaction/plastication
- name = "Plastic"
- id = "solidplastic"
+/datum/chemical_reaction/plastic_polymers
+ name = "plastic polymers"
+ id = "plastic_polymers"
result = null
- required_reagents = list("facid" = 10, "plasticide" = 20)
+ required_reagents = list("oil" = 5, "sacid" = 2, "ash" = 3)
+ min_temp = 374
result_amount = 1
/datum/chemical_reaction/plastication/on_reaction(datum/reagents/holder)
- var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/plastic
- M.amount = 10
- M.forceMove(get_turf(holder.my_atom))
+ var/obj/item/stack/sheet/plastic/P = new /obj/item/stack/sheet/plastic
+ P.amount = 10
+ P.forceMove(get_turf(holder.my_atom))
/datum/chemical_reaction/lube
name = "Space Lube"
diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm
index 369d667b9a2..e58c1bb6994 100644
--- a/code/modules/research/experimentor.dm
+++ b/code/modules/research/experimentor.dm
@@ -450,8 +450,9 @@
visible_message("[src]'s crushing mechanism slowly and smoothly descends, flattening the [exp_on]!")
new /obj/item/stack/sheet/plasteel(get_turf(pick(oview(1,src))))
if(linked_console.linked_lathe)
+ GET_COMPONENT_FROM(linked_materials, /datum/component/material_container, linked_console.linked_lathe)
for(var/material in exp_on.materials)
- linked_console.linked_lathe.materials.insert_amount( min((linked_console.linked_lathe.materials.max_amount - linked_console.linked_lathe.materials.total_amount), (exp_on.materials[material])), material)
+ linked_materials.insert_amount( min((linked_materials.max_amount - linked_materials.total_amount), (exp_on.materials[material])), material)
if(prob(EFFECT_PROB_VERYLOW-badThingCoeff))
visible_message("[src]'s crusher goes way too many levels too high, crushing right through space-time!")
playsound(src.loc, 'sound/effects/supermatter.ogg', 50, 1, -3)
diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm
index 0c6938406fb..d09e374792c 100644
--- a/code/modules/research/protolathe.dm
+++ b/code/modules/research/protolathe.dm
@@ -13,7 +13,6 @@ Note: Must be placed west/left of and R&D console to function.
icon_state = "protolathe"
flags = OPENCONTAINER
- var/datum/material_container/materials
var/efficiency_coeff
var/list/categories = list(
@@ -28,11 +27,15 @@ Note: Must be placed west/left of and R&D console to function.
"Stock Parts",
"Weapons"
)
-
+ var/datum/component/material_container/materials //Store for hyper speed!
reagents = new()
/obj/machinery/r_n_d/protolathe/New()
+ materials = AddComponent(/datum/component/material_container,
+ list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TRANQUILLITE, MAT_TITANIUM, MAT_BLUESPACE, MAT_PLASTIC), 0,
+ FALSE, list(/obj/item/stack, /obj/item/ore/bluespace_crystal), CALLBACK(src, .proc/is_insertion_ready), CALLBACK(src, .proc/AfterMaterialInsert))
+ materials.precise_insertion = TRUE
..()
component_parts = list()
component_parts += new /obj/item/circuitboard/protolathe(null)
@@ -42,7 +45,6 @@ Note: Must be placed west/left of and R&D console to function.
component_parts += new /obj/item/stock_parts/manipulator(null)
component_parts += new /obj/item/reagent_containers/glass/beaker/large(null)
component_parts += new /obj/item/reagent_containers/glass/beaker/large(null)
- materials = new(src, list(MAT_METAL=1, MAT_GLASS=1, MAT_SILVER=1, MAT_GOLD=1, MAT_DIAMOND=1, MAT_PLASMA=1, MAT_URANIUM=1, MAT_BANANIUM=1, MAT_TRANQUILLITE=1, MAT_TITANIUM=1))
RefreshParts()
reagents.my_atom = src
@@ -61,10 +63,6 @@ Note: Must be placed west/left of and R&D console to function.
reagents.my_atom = src
-/obj/machinery/r_n_d/protolathe/Destroy()
- QDEL_NULL(materials)
- return ..()
-
/obj/machinery/r_n_d/protolathe/RefreshParts()
var/T = 0
for(var/obj/item/reagent_containers/glass/G in component_parts)
@@ -88,7 +86,8 @@ Note: Must be placed west/left of and R&D console to function.
/obj/machinery/r_n_d/protolathe/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(shocked)
- shock(user,50)
+ if(shock(user,50))
+ return TRUE
if(default_deconstruction_screwdriver(user, "protolathe_t", "protolathe", O))
if(linked_console)
linked_console.linked_lathe = null
@@ -112,39 +111,41 @@ Note: Must be placed west/left of and R&D console to function.
else
to_chat(user, "You can't load the [src.name] while it's opened.")
return 1
- if(disabled)
- return
- if(!linked_console)
- to_chat(user, " The [src.name] must be linked to an R&D console first!")
- return 1
- if(busy)
- to_chat(user, "The [src.name] is busy. Please wait for completion of previous operation.")
- return 1
if(O.is_open_container())
- return
- if(stat)
- return 1
- if(!istype(O,/obj/item/stack/sheet))
- return 1
-
- if(!materials.has_space( materials.get_item_material_amount(O) ))
- to_chat(user, "The [src.name]'s material bin is full! Please remove material before adding more.")
- return 1
-
- var/obj/item/stack/sheet/stack = O
- var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
- if(!in_range(src, stack) || !user.Adjacent(src))
- return
- var/amount_inserted = materials.insert_stack(O,amount)
- if(!amount_inserted)
- return 1
+ return FALSE
else
- busy = 1
- use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount_inserted/10)))
- to_chat(user, "You add [amount_inserted] sheets to the [src.name].")
- var/stackname = stack.name
- src.overlays += "protolathe_[stackname]"
- sleep(10)
- src.overlays -= "protolathe_[stackname]"
- busy = 0
- updateUsrDialog()
\ No newline at end of file
+ return ..()
+
+//whether the machine can have an item inserted in its current state.
+/obj/machinery/r_n_d/protolathe/proc/is_insertion_ready(mob/user)
+ if(panel_open)
+ to_chat(user, "You can't load [src] while it's opened!")
+ return FALSE
+ if(disabled)
+ return FALSE
+ if(!linked_console)
+ to_chat(user, "[src] must be linked to an R&D console first!")
+ return FALSE
+ if(busy)
+ to_chat(user, "[src] is busy right now.")
+ return FALSE
+ if(stat & BROKEN)
+ to_chat(user, "[src] is broken.")
+ return FALSE
+ if(stat & NOPOWER)
+ to_chat(user, "[src] has no power.")
+ return FALSE
+ return TRUE
+
+/obj/machinery/r_n_d/protolathe/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted)
+ var/stack_name
+ if(ispath(type_inserted, /obj/item/ore/bluespace_crystal))
+ stack_name = "bluespace polycrystal"
+ use_power(MINERAL_MATERIAL_AMOUNT / 10)
+ else
+ var/obj/item/stack/S = type_inserted
+ stack_name = initial(S.name)
+ use_power(min(1000, (amount_inserted / 100)))
+ overlays += "protolathe_[stack_name]"
+ sleep(10)
+ overlays -= "protolathe_[stack_name]"
\ No newline at end of file
diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm
index edf4d68724a..152a1665cca 100644
--- a/code/modules/research/rdconsole.dm
+++ b/code/modules/research/rdconsole.dm
@@ -100,6 +100,10 @@ won't update every console in existence) but it's more of a hassle to do. Also,
return_name = "Tranquillite"
if("titanium")
return_name = "Titanium"
+ if("bluespace")
+ return_name = "Bluespace Mesh"
+ if("plastic")
+ return_name = "Plastic"
return return_name
else
for(var/R in subtypesof(/datum/reagent))
@@ -805,12 +809,14 @@ won't update every console in existence) but it's more of a hassle to do. Also,
materials_list[++materials_list.len] = list("name" = "Glass", "id" = MAT_GLASS, "amount" = linked_lathe.materials.amount(MAT_GLASS))
materials_list[++materials_list.len] = list("name" = "Gold", "id" = MAT_GOLD, "amount" = linked_lathe.materials.amount(MAT_GOLD))
materials_list[++materials_list.len] = list("name" = "Silver", "id" = MAT_SILVER, "amount" = linked_lathe.materials.amount(MAT_SILVER))
- materials_list[++materials_list.len] = list("name" = "Plasma", "id" = MAT_PLASMA, "amount" = linked_lathe.materials.amount(MAT_PLASMA))
+ materials_list[++materials_list.len] = list("name" = "Solid Plasma", "id" = MAT_PLASMA, "amount" = linked_lathe.materials.amount(MAT_PLASMA))
materials_list[++materials_list.len] = list("name" = "Uranium", "id" = MAT_URANIUM, "amount" = linked_lathe.materials.amount(MAT_URANIUM))
materials_list[++materials_list.len] = list("name" = "Diamond", "id" = MAT_DIAMOND, "amount" = linked_lathe.materials.amount(MAT_DIAMOND))
materials_list[++materials_list.len] = list("name" = "Bananium", "id" = MAT_BANANIUM, "amount" = linked_lathe.materials.amount(MAT_BANANIUM))
materials_list[++materials_list.len] = list("name" = "Tranquillite", "id" = MAT_TRANQUILLITE, "amount" = linked_lathe.materials.amount(MAT_TRANQUILLITE))
materials_list[++materials_list.len] = list("name" = "Titanium", "id" = MAT_TITANIUM, "amount" = linked_lathe.materials.amount(MAT_TITANIUM))
+ materials_list[++materials_list.len] = list("name" = "Plastic", "id" = MAT_PLASTIC, "amount" = linked_lathe.materials.amount(MAT_PLASTIC))
+ materials_list[++materials_list.len] = list("name" = "Bluespace Mesh", "id" = MAT_BLUESPACE, "amount" = linked_lathe.materials.amount(MAT_BLUESPACE))
if(submenu == 3)
var/list/loaded_chemicals = list()
data["loaded_chemicals"] = loaded_chemicals
diff --git a/code/modules/telesci/bscrystal.dm b/code/modules/telesci/bscrystal.dm
index 9d5ee1187c1..89c7153f018 100644
--- a/code/modules/telesci/bscrystal.dm
+++ b/code/modules/telesci/bscrystal.dm
@@ -5,6 +5,7 @@
icon = 'icons/obj/telescience.dmi'
icon_state = "bluespace_crystal"
w_class = WEIGHT_CLASS_TINY
+ materials = list(MAT_BLUESPACE = MINERAL_MATERIAL_AMOUNT)
origin_tech = "bluespace=6;materials=3"
points = 50
var/blink_range = 8 // The teleport range when crushed/thrown at someone.
@@ -45,6 +46,7 @@
name = "artificial bluespace crystal"
desc = "An artificially made bluespace crystal, it looks delicate."
origin_tech = "bluespace=3;plasmatech=4"
+ materials = list(MAT_BLUESPACE=MINERAL_MATERIAL_AMOUNT * 0.5)
blink_range = 4 // Not as good as the organic stuff!
points = 0 // nice try
refined_type = null
@@ -59,6 +61,7 @@ var/global/list/datum/stack_recipe/bluespace_crystal_recipes = list(new/datum/st
icon_state = "polycrystal"
desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off."
origin_tech = "bluespace=6;materials=3"
+ materials = list(MAT_BLUESPACE = MINERAL_MATERIAL_AMOUNT)
attack_verb = list("bluespace polybashed", "bluespace polybattered", "bluespace polybludgeoned", "bluespace polythrashed", "bluespace polysmashed")
toolspeed = 1
usesound = 'sound/items/Deconstruct.ogg'
diff --git a/icons/obj/drinks.dmi b/icons/obj/drinks.dmi
index e22e2ee072e..90c11b659b5 100644
Binary files a/icons/obj/drinks.dmi and b/icons/obj/drinks.dmi differ
diff --git a/icons/obj/machines/research.dmi b/icons/obj/machines/research.dmi
index b21738f2fed..c0f2dabd5b3 100644
Binary files a/icons/obj/machines/research.dmi and b/icons/obj/machines/research.dmi differ
diff --git a/paradise.dme b/paradise.dme
index f83ff1109bf..52d802252a6 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -225,7 +225,6 @@
#include "code\datums\datumvars.dm"
#include "code\datums\gas_mixture.dm"
#include "code\datums\hud.dm"
-#include "code\datums\material_container.dm"
#include "code\datums\mind.dm"
#include "code\datums\mixed.dm"
#include "code\datums\modules.dm"