[MIRROR] Stock Part Datumization Complete [MDB IGNORE] (#18639)

* Stock Part Datumization Complete (#72559)

So i accidently reverted all my commits in #72511 when resolving a merge
conflict So ummm yeah fuck my bad anyway

Finishes what was started in #71693 and completes the
[initiative](https://github.com/tgstation/dev-cycles-initiative/issues/1)

Except for `obj/item/stock_parts/cell` and its subtypes. All machines
now use `datum/stock_part` for its requested components & component
parts

Not sure if i caught every machine & stuff in the game so merge with
caution
🆑
code: datum stock part for every obj stock part
refactor: all machines & dependent experiments to use datum stock parts
/🆑

* Fixes a teeny tiny Funce mistake :)

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
This commit is contained in:
SkyratBot
2023-01-19 23:09:19 +01:00
committed by GitHub
parent 666ec11b53
commit 902caab964
55 changed files with 534 additions and 407 deletions
+13 -13
View File
@@ -77,9 +77,9 @@
/obj/machinery/component_printer/proc/calculate_efficiency()
var/rating = 0
for(var/obj/item/stock_parts/manipulator/manipulator in component_parts)
for(var/datum/stock_part/manipulator/manipulator in component_parts)
///we do -1 because normal manipulators rating of 1 gives us 1-1=0 i.e no decrement in cost
rating += manipulator.rating-1
rating += manipulator.tier-1
///linear interpolation between full cost i.e 1 & 1/8th the cost i.e 0.125
///we do it in 6 steps because maximum rating of 2 manipulators is 8 but -1 gives us 6
@@ -89,8 +89,8 @@
if(materials)
var/total_storage = 0
for(var/obj/item/stock_parts/matter_bin/bin in component_parts)
total_storage += bin.rating * 75000
for(var/datum/stock_part/matter_bin/bin in component_parts)
total_storage += bin.tier * 75000
materials.set_local_size(total_storage)
@@ -223,8 +223,8 @@
greyscale_colors = CIRCUIT_COLOR_SCIENCE
build_path = /obj/machinery/component_printer
req_components = list(
/obj/item/stock_parts/matter_bin = 2,
/obj/item/stock_parts/manipulator = 2,
/datum/stock_part/matter_bin = 2,
/datum/stock_part/manipulator = 2,
)
/obj/machinery/debug_component_printer
@@ -350,20 +350,20 @@
if(materials)
var/total_storage = 0
for(var/obj/item/stock_parts/matter_bin/bin in component_parts)
total_storage += bin.rating * 75000
for(var/datum/stock_part/matter_bin/bin in component_parts)
total_storage += bin.tier * 75000
materials.set_local_size(total_storage)
var/rating = 0
for(var/obj/item/stock_parts/manipulator/manipulator in component_parts)
for(var/datum/stock_part/manipulator/manipulator in component_parts)
///we do -1 because normal manipulators rating of 1 gives us 1-1=0 i.e no decrement in cost
rating += manipulator.rating-1
rating += manipulator.tier - 1
///linear interpolation between full cost i.e 1 & 1/8th the cost i.e 0.125
///we do it in 6 steps because maximum rating of 2 manipulators is 8 but -1 gives us 6
var/coff=1.0+((0.125-1.0)*(rating/6))
var/coff = 1.0 + ((0.125 - 1.0) * (rating/6))
return coff
@@ -535,6 +535,6 @@
greyscale_colors = CIRCUIT_COLOR_SCIENCE
build_path = /obj/machinery/module_duplicator
req_components = list(
/obj/item/stock_parts/matter_bin = 2,
/obj/item/stock_parts/manipulator = 2,
/datum/stock_part/matter_bin = 2,
/datum/stock_part/manipulator = 2,
)