mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 21:48:39 +01:00
[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:
co-authored by
SyncIt21
GoldenAlpharex
parent
666ec11b53
commit
902caab964
@@ -92,14 +92,14 @@
|
||||
var/M = 0
|
||||
var/L = 0
|
||||
var/S = 0
|
||||
for(var/obj/item/stock_parts/capacitor/Cap in component_parts)
|
||||
C += ((Cap.rating - 1) * 0.1)
|
||||
for(var/datum/stock_part/capacitor/capacitor in component_parts)
|
||||
C += ((capacitor.tier - 1) * 0.1)
|
||||
power_saver = 1 - C
|
||||
for(var/obj/item/stock_parts/manipulator/Manip in component_parts)
|
||||
M += ((Manip.rating - 1) * PART_CASH_OFFSET_AMOUNT)
|
||||
for(var/datum/stock_part/manipulator/manipulator in component_parts)
|
||||
M += ((manipulator.tier - 1) * PART_CASH_OFFSET_AMOUNT)
|
||||
positive_cash_offset = M
|
||||
for(var/obj/item/stock_parts/micro_laser/Laser in component_parts)
|
||||
L += ((Laser.rating - 1) * PART_CASH_OFFSET_AMOUNT)
|
||||
for(var/datum/stock_part/micro_laser/Laser in component_parts)
|
||||
L += ((Laser.tier - 1) * PART_CASH_OFFSET_AMOUNT)
|
||||
negative_cash_offset = L
|
||||
for(var/datum/stock_part/scanning_module/scanning_module in component_parts)
|
||||
S += ((scanning_module.tier - 1) * 0.25)
|
||||
|
||||
@@ -16,8 +16,8 @@ Note: Must be placed within 3 tiles of the R&D Console
|
||||
/obj/machinery/rnd/destructive_analyzer/RefreshParts()
|
||||
. = ..()
|
||||
var/T = 0
|
||||
for(var/obj/item/stock_parts/S in component_parts)
|
||||
T += S.rating
|
||||
for(var/datum/stock_part/stock_part in component_parts)
|
||||
T += stock_part.tier
|
||||
decon_mod = T
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/proc/ConvertReqString2List(list/source_list)
|
||||
|
||||
@@ -110,12 +110,12 @@
|
||||
. = ..()
|
||||
malfunction_probability_coeff = malfunction_probability_coeff_modifier
|
||||
resetTime = initial(resetTime)
|
||||
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
||||
resetTime = max(1, resetTime - M.rating)
|
||||
for(var/datum/stock_part/manipulator/manipulator in component_parts)
|
||||
resetTime = max(1, resetTime - manipulator.tier)
|
||||
for(var/datum/stock_part/scanning_module/scanning_module in component_parts)
|
||||
malfunction_probability_coeff += scanning_module.tier * 2
|
||||
for(var/obj/item/stock_parts/micro_laser/M in component_parts)
|
||||
malfunction_probability_coeff += M.rating
|
||||
for(var/datum/stock_part/micro_laser/micro_laser in component_parts)
|
||||
malfunction_probability_coeff += micro_laser.tier
|
||||
|
||||
/obj/machinery/rnd/experimentor/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -200,15 +200,15 @@
|
||||
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/total_rating = 1.2
|
||||
|
||||
for(var/obj/item/stock_parts/manipulator/manipulator in component_parts)
|
||||
total_rating -= manipulator.rating * 0.1
|
||||
for(var/datum/stock_part/manipulator/manipulator in component_parts)
|
||||
total_rating -= manipulator.tier * 0.1
|
||||
|
||||
efficiency_coeff = max(total_rating, 0)
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
var/rating = 0
|
||||
|
||||
for(var/obj/item/stock_parts/manipulator/manipulator in component_parts)
|
||||
rating += manipulator.rating // There is only one.
|
||||
for(var/datum/stock_part/manipulator/manipulator in component_parts)
|
||||
rating += manipulator.tier // There is only one.
|
||||
|
||||
efficiency_coeff = 0.5 ** max(rating - 1, 0) // One sheet, half sheet, quarter sheet, eighth sheet.
|
||||
|
||||
|
||||
@@ -72,14 +72,129 @@ GLOBAL_LIST_INIT(stock_part_datums, generate_stock_part_datums())
|
||||
physical_object_type = /obj/item/stock_parts/scanning_module
|
||||
physical_object_base_type = /obj/item/stock_parts/scanning_module
|
||||
|
||||
/datum/stock_part/scanning_module/tier2
|
||||
/datum/stock_part/scanning_module/adv
|
||||
tier = 2
|
||||
physical_object_type = /obj/item/stock_parts/scanning_module/adv
|
||||
|
||||
/datum/stock_part/scanning_module/tier3
|
||||
/datum/stock_part/scanning_module/phasic
|
||||
tier = 3
|
||||
physical_object_type = /obj/item/stock_parts/scanning_module/phasic
|
||||
|
||||
/datum/stock_part/scanning_module/tier4
|
||||
/datum/stock_part/scanning_module/triphasic
|
||||
tier = 4
|
||||
physical_object_type = /obj/item/stock_parts/scanning_module/triphasic
|
||||
|
||||
/datum/stock_part/capacitor
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/capacitor
|
||||
physical_object_base_type = /obj/item/stock_parts/capacitor
|
||||
|
||||
/datum/stock_part/capacitor/adv
|
||||
tier = 2
|
||||
physical_object_type = /obj/item/stock_parts/capacitor/adv
|
||||
|
||||
/datum/stock_part/capacitor/super
|
||||
tier = 3
|
||||
physical_object_type = /obj/item/stock_parts/capacitor/super
|
||||
|
||||
/datum/stock_part/capacitor/quadratic
|
||||
tier = 4
|
||||
physical_object_type = /obj/item/stock_parts/capacitor/quadratic
|
||||
|
||||
/datum/stock_part/manipulator
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/manipulator
|
||||
physical_object_base_type = /obj/item/stock_parts/manipulator
|
||||
|
||||
/datum/stock_part/manipulator/nano
|
||||
tier = 2
|
||||
physical_object_type = /obj/item/stock_parts/manipulator/nano
|
||||
|
||||
/datum/stock_part/manipulator/pico
|
||||
tier = 3
|
||||
physical_object_type = /obj/item/stock_parts/manipulator/pico
|
||||
|
||||
/datum/stock_part/manipulator/femto
|
||||
tier = 4
|
||||
physical_object_type = /obj/item/stock_parts/manipulator/femto
|
||||
|
||||
/datum/stock_part/micro_laser
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/micro_laser
|
||||
physical_object_base_type = /obj/item/stock_parts/micro_laser
|
||||
|
||||
/datum/stock_part/micro_laser/high
|
||||
tier = 2
|
||||
physical_object_type = /obj/item/stock_parts/micro_laser/high
|
||||
|
||||
/datum/stock_part/micro_laser/ultra
|
||||
tier = 3
|
||||
physical_object_type = /obj/item/stock_parts/micro_laser/ultra
|
||||
|
||||
/datum/stock_part/micro_laser/quadultra
|
||||
tier = 4
|
||||
physical_object_type = /obj/item/stock_parts/micro_laser/quadultra
|
||||
|
||||
/datum/stock_part/matter_bin
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/matter_bin
|
||||
physical_object_base_type = /obj/item/stock_parts/matter_bin
|
||||
|
||||
/datum/stock_part/matter_bin/adv
|
||||
tier = 2
|
||||
physical_object_type = /obj/item/stock_parts/matter_bin/adv
|
||||
|
||||
/datum/stock_part/matter_bin/super
|
||||
tier = 3
|
||||
physical_object_type = /obj/item/stock_parts/matter_bin/super
|
||||
|
||||
/datum/stock_part/matter_bin/bluespace
|
||||
tier = 4
|
||||
physical_object_type = /obj/item/stock_parts/matter_bin/bluespace
|
||||
|
||||
/// Subspace stock parts
|
||||
|
||||
/datum/stock_part/ansible
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/subspace/ansible
|
||||
physical_object_base_type = /obj/item/stock_parts/subspace/ansible
|
||||
|
||||
/datum/stock_part/filter
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/subspace/filter
|
||||
physical_object_base_type = /obj/item/stock_parts/subspace/filter
|
||||
|
||||
/datum/stock_part/amplifier
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/subspace/amplifier
|
||||
physical_object_base_type = /obj/item/stock_parts/subspace/amplifier
|
||||
|
||||
/datum/stock_part/treatment
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/subspace/treatment
|
||||
physical_object_base_type = /obj/item/stock_parts/subspace/treatment
|
||||
|
||||
/datum/stock_part/analyzer
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/subspace/analyzer
|
||||
physical_object_base_type = /obj/item/stock_parts/subspace/analyzer
|
||||
|
||||
/datum/stock_part/crystal
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/subspace/crystal
|
||||
physical_object_base_type = /obj/item/stock_parts/subspace/crystal
|
||||
|
||||
/datum/stock_part/transmitter
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/subspace/transmitter
|
||||
physical_object_base_type = /obj/item/stock_parts/subspace/transmitter
|
||||
|
||||
/datum/stock_part/card_reader
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/card_reader
|
||||
physical_object_base_type = /obj/item/stock_parts/card_reader
|
||||
|
||||
/datum/stock_part/water_recycler
|
||||
tier = 1
|
||||
physical_object_type = /obj/item/stock_parts/water_recycler
|
||||
physical_object_base_type = /obj/item/stock_parts/water_recycler
|
||||
|
||||
Reference in New Issue
Block a user