mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
[READY] Floydmats (Datum materials) & custom toolboxes (#45118)
* Initial work * more * ass * wsedfwedff * asss * test * stuff * fuck * sss a * kms * asdadwedwdfwefwef * start * test * dwwdew * ewefwfef * Redemption machine (#8) * Redemption machine * Removes debug messages * changes * fuckmyshitup * coin mint works with new material shenanigans (#10) * Auto stash before merge of "materials" and "origin/materials" * woops * furnace (#11) * autolathe manufacturing of toolboxes * eggs in a basket * some small changes * matcolors * documentation * more documentation and effects * done * Color man bad (#12) * fixes designs * ass * more fixes * fuck me * firestacks adder * epic fixes * fixes designs * DONE DIDDILY DOO * removes category macro * ch-ch-ch-changes * fixes some stuff * Fixes display of ore values (#9) * Redemption machine * Removes debug messages * Re-adds value display * Replaces the fire stacking component with an element instead (#13) * fixes examine * fixes ligma bugs * double ligma boofus * fix * misses some defines * fixes ORM * Update code/datums/components/material_container.dm Co-Authored-By: Emmett Gaines <ninjanomnom@gmail.com> * fixes * Makes glass objects weaker (#14) * Makes glass objects weaker * uses correct proc * fixes shit * honk honk * better * oh shit oh fuck * fixes * fuck ORMs * fixes the biogen * documentation * ass (#15) * component * changes * ass * ass * doc * Auto stash before merge of "materials-plasmacomponent" and "origin/materials-plasmacomponent" * fixes rounding * fixed
This commit is contained in:
committed by
Emmett Gaines
co-authored by
Emmett Gaines
parent
1ffc9f032b
commit
b33d1c49a3
@@ -17,7 +17,7 @@
|
||||
var/points = 0
|
||||
var/ore_pickup_rate = 15
|
||||
var/sheet_per_ore = 1
|
||||
var/list/ore_values = list(MAT_GLASS = 1, MAT_METAL = 1, MAT_PLASMA = 15, MAT_SILVER = 16, MAT_GOLD = 18, MAT_TITANIUM = 30, MAT_URANIUM = 30, MAT_DIAMOND = 50, MAT_BLUESPACE = 50, MAT_BANANIUM = 60)
|
||||
var/list/ore_values = list(/datum/material/iron = 1, /datum/material/glass = 1, /datum/material/plasma = 15, /datum/material/silver = 16, /datum/material/gold = 18, /datum/material/titanium = 30, /datum/material/uranium = 30, /datum/material/diamond = 50, /datum/material/bluespace = 50, /datum/material/bananium = 60)
|
||||
var/message_sent = FALSE
|
||||
var/list/ore_buffer = list()
|
||||
var/datum/techweb/stored_research
|
||||
@@ -44,7 +44,7 @@
|
||||
ore_pickup_rate_temp = 15 * M.rating
|
||||
|
||||
ore_pickup_rate = ore_pickup_rate_temp
|
||||
sheet_per_ore = sheet_per_ore_temp
|
||||
sheet_per_ore = round(sheet_per_ore_temp, 0.01)
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -89,14 +89,14 @@
|
||||
|
||||
var/build_amount = 0
|
||||
|
||||
for(var/mat_id in D.materials)
|
||||
var/M = D.materials[mat_id]
|
||||
var/datum/material/redemption_mat = mat_container.materials[mat_id]
|
||||
for(var/mat in D.materials)
|
||||
var/amount = D.materials[mat]
|
||||
var/datum/material/redemption_mat_amount = mat_container.materials[mat]
|
||||
|
||||
if(!M || !redemption_mat)
|
||||
if(!amount || !redemption_mat_amount)
|
||||
return FALSE
|
||||
|
||||
var/smeltable_sheets = FLOOR(redemption_mat.amount / M, 1)
|
||||
var/smeltable_sheets = FLOOR(redemption_mat_amount / amount, 1)
|
||||
|
||||
if(!smeltable_sheets)
|
||||
return FALSE
|
||||
@@ -126,9 +126,9 @@
|
||||
|
||||
var/has_minerals = FALSE
|
||||
|
||||
for(var/mat_id in mat_container.materials)
|
||||
var/datum/material/M = mat_container.materials[mat_id]
|
||||
var/mineral_amount = M.amount / MINERAL_MATERIAL_AMOUNT
|
||||
for(var/mat in mat_container.materials)
|
||||
var/datum/material/M = mat
|
||||
var/mineral_amount = mat_container.materials[mat] / MINERAL_MATERIAL_AMOUNT
|
||||
if(mineral_amount)
|
||||
has_minerals = TRUE
|
||||
msg += "[capitalize(M.name)]: [mineral_amount] sheets<br>"
|
||||
@@ -223,10 +223,12 @@
|
||||
data["materials"] = list()
|
||||
var/datum/component/material_container/mat_container = materials.mat_container
|
||||
if (mat_container)
|
||||
for(var/mat_id in mat_container.materials)
|
||||
var/datum/material/M = mat_container.materials[mat_id]
|
||||
var/sheet_amount = M.amount ? M.amount / MINERAL_MATERIAL_AMOUNT : "0"
|
||||
data["materials"] += list(list("name" = M.name, "id" = M.id, "amount" = sheet_amount, "value" = ore_values[M.id]))
|
||||
for(var/mat in mat_container.materials)
|
||||
var/datum/material/M = mat
|
||||
var/amount = mat_container.materials[M]
|
||||
var/sheet_amount = amount / MINERAL_MATERIAL_AMOUNT
|
||||
var/ref = REF(M)
|
||||
data["materials"] += list(list("name" = M.name, "id" = ref, "amount" = sheet_amount, "value" = ore_values[M.type]))
|
||||
|
||||
data["alloys"] = list()
|
||||
for(var/v in stored_research.researched_designs)
|
||||
@@ -278,16 +280,19 @@
|
||||
if("Release")
|
||||
if(!mat_container)
|
||||
return
|
||||
|
||||
if(materials.on_hold())
|
||||
to_chat(usr, "<span class='warning'>Mineral access is on hold, please contact the quartermaster.</span>")
|
||||
else if(!check_access(inserted_id) && !allowed(usr)) //Check the ID inside, otherwise check the user
|
||||
to_chat(usr, "<span class='warning'>Required access not found.</span>")
|
||||
else
|
||||
var/mat_id = params["id"]
|
||||
if(!mat_container.materials[mat_id])
|
||||
var/datum/material/mat = locate(params["id"])
|
||||
|
||||
var/amount = mat_container.materials[mat]
|
||||
if(!amount)
|
||||
return
|
||||
var/datum/material/mat = mat_container.materials[mat_id]
|
||||
var/stored_amount = mat.amount / MINERAL_MATERIAL_AMOUNT
|
||||
|
||||
var/stored_amount = CEILING(amount / MINERAL_MATERIAL_AMOUNT, 0.1)
|
||||
|
||||
if(!stored_amount)
|
||||
return
|
||||
@@ -299,10 +304,12 @@
|
||||
desired = input("How many sheets?", "How many sheets would you like to smelt?", 1) as null|num
|
||||
|
||||
var/sheets_to_remove = round(min(desired,50,stored_amount))
|
||||
var/count = mat_container.retrieve_sheets(sheets_to_remove, mat_id, get_step(src, output_dir))
|
||||
|
||||
var/count = mat_container.retrieve_sheets(sheets_to_remove, mat, get_step(src, output_dir))
|
||||
var/list/mats = list()
|
||||
mats[mat_id] = MINERAL_MATERIAL_AMOUNT
|
||||
mats[mat] = MINERAL_MATERIAL_AMOUNT
|
||||
materials.silo_log(src, "released", -count, "sheets", mats)
|
||||
//Logging deleted for quick coding
|
||||
return TRUE
|
||||
if("diskInsert")
|
||||
var/obj/item/disk/design_disk/disk = usr.get_active_held_item()
|
||||
@@ -339,7 +346,7 @@
|
||||
else
|
||||
desired = input("How many sheets?", "How many sheets would you like to smelt?", 1) as null|num
|
||||
var/amount = round(min(desired,50,smelt_amount))
|
||||
mat_container.use_amount(alloy.materials, amount)
|
||||
mat_container.use_materials(alloy.materials, amount)
|
||||
materials.silo_log(src, "released", -amount, "sheets", alloy.materials)
|
||||
var/output
|
||||
if(ispath(alloy.build_path, /obj/item/stack/sheet))
|
||||
|
||||
Reference in New Issue
Block a user