Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fabricator recycling #12191

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions code/__HELPERS/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,22 @@
sub_keys |= assoc_list[primary_key]
return sub_keys

/proc/params2numberlist(params)
var/temp_list = list()
var/params_list = params2list(params)

for(var/key as anything in params_list)
volas marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for(var/key as anything in params_list)
for(var/key in params_list)

какой-же params неудобный кстати, что из коробки только текстовые параметры поддерживает

temp_list[key] = text2num(params_list[key])
return temp_list

/proc/numberlist2params(list/number_list)
volas marked this conversation as resolved.
Show resolved Hide resolved
var/temp_list = list()

for(var/key as anything in number_list)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for(var/key as anything in number_list)
for(var/key in number_list)

temp_list[key] = num2text(number_list[key])

return list2params(temp_list)

#define LAZYINITLIST(L) if (!L) L = list()
#define UNSETEMPTY(L) if (L && !L.len) L = null
#define LAZYADD(L, I) if(!L) { L = list(); } L += I;
Expand Down
5 changes: 2 additions & 3 deletions code/defines/obj/hydro.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
desc = "A hand-held scanner which reports condition of the plant."
icon = 'icons/obj/device.dmi'
w_class = SIZE_MINUSCULE
m_amt = 200
g_amt = 50
construction = MAT_METAL+"=200;"+MAT_GLASS+"=50"
volas marked this conversation as resolved.
Show resolved Hide resolved
origin_tech = "materials=1;biotech=1"
icon_state = "hydro"
item_state = "plantanalyzer"
Expand Down Expand Up @@ -1429,7 +1428,7 @@
force = 5.0
throwforce = 7.0
w_class = SIZE_TINY
m_amt = 2550
construction = MAT_METAL+"=2550"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@volas Точно не лучше было бы иметь отдельный список var/list/construction_materials и var/list/materials которые сейчас есть в штучке?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

у атомов он должен быть выпилен в пользу этого общего формата, эти списки непонятно как в билд занесло и они нигде не используются.

И текстовый формат лучше в том плане, что мы можем через init() его достать (ну и меньше памяти занимает). Он выглядит жутко, но лучше это хоть убейся сейчас не оформить.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в 515 через :: можно получать листы по типу объекта

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

докажи

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:: просто шорткат для init, он не поможет. Списки инициализируются вместе с объектом, на своём скрытом шаге инициализации (типо New), и до инициализации объекта не доступны.

Хорошие новости - Люммокс согласен, что это проблема, и рассматривает варианты как это можно решить https://www.byond.com/forum/post/2904278#comment26636169

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это позже случилось, я видел. Лучше на листы тогда переделать.

Но нужно будет еще замерить встроенным профайлером память до и после чисто из интереса.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тогда ПР ждет 515? если да отметьте там чтоб пр не закрывался там хз

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мы уже на 515, делай

Copy link
Contributor

@NinjaPikachuska NinjaPikachuska Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If A::B isn't a static var, then it's equivalent to initial(A:B). If A is a constant type path, the compiler will go even
further by compiling this expression as the actual initial value instead of doing a runtime lookup.

оказывается, это не работает так, как нужно 😔
image
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skill issue

origin_tech = "materials=1;biotech=1"
attack_verb = list("slashed", "sliced", "cut", "clawed")

Expand Down
99 changes: 38 additions & 61 deletions code/defines/obj/weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
force = 5.0
throwforce = 7.0
w_class = SIZE_TINY
m_amt = 50
construction = MAT_METAL+"=50"
attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed")

/obj/item/weapon/cane/atom_init()
Expand Down Expand Up @@ -100,7 +100,7 @@
icon = 'icons/obj/items.dmi'
icon_state = "rack_parts"
flags = CONDUCT
m_amt = 3750
construction = MAT_METAL+"=3750"

max_integrity = 100
resistance_flags = CAN_BE_HIT
Expand All @@ -119,7 +119,7 @@
force = 5.0
throwforce = 8.0
item_state = "shard-glass"
g_amt = 3750
construction = MAT_GLASS+"=3750"
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb = list("stabbed", "slashed", "sliced", "cut")
var/on_step_sound = 'sound/effects/glass_step.ogg'
Expand Down Expand Up @@ -279,7 +279,7 @@
w_class = SIZE_TINY
throw_speed = 4
throw_range = 20
m_amt = 100
construction = MAT_METAL+"=100"
origin_tech = "magnets=1"

/obj/item/weapon/staff
Expand Down Expand Up @@ -343,7 +343,7 @@
gender = PLURAL
icon = 'icons/obj/items.dmi'
icon_state = "table_parts"
m_amt = 3750
construction = MAT_METAL+"=3750"
flags = CONDUCT
attack_verb = list("slammed", "bashed", "battered", "bludgeoned", "thrashed", "whacked")
var/table_type = /obj/structure/table
Expand All @@ -357,7 +357,7 @@
desc = "Hard table parts. Well...harder..."
icon = 'icons/obj/items.dmi'
icon_state = "reinf_tableparts"
m_amt = 7500
construction = MAT_METAL+"=7500"
flags = CONDUCT
table_type = /obj/structure/table/reinforced
debris = list(/obj/item/stack/sheet/metal, /obj/item/stack/rods)
Expand All @@ -367,7 +367,7 @@
desc = "Stall table parts."
icon = 'icons/obj/items.dmi'
icon_state = "stall_tableparts"
m_amt = 15000
construction = MAT_METAL+"=15000"
flags = CONDUCT
table_type = /obj/structure/table/reinforced/stall
debris = list(/obj/item/stack/sheet/metal, /obj/item/stack/rods)
Expand Down Expand Up @@ -414,7 +414,7 @@
var/amount = 1.0
var/laying = 0.0
var/old_lay = null
m_amt = 40
construction = MAT_METAL+"=40"
attack_verb = list("whipped", "lashed", "disciplined", "tickled")

/obj/item/weapon/wire/suicide_act(mob/user)
Expand All @@ -439,8 +439,7 @@
name = "power control module"
icon_state = "power_mod"
desc = "Heavy-duty switching circuits for power control."
m_amt = 50
g_amt = 50
construction = MAT_METAL+"=50;"+MAT_GLASS+"=50"

/obj/item/weapon/module/id_auth
name = "ID authentication module"
Expand Down Expand Up @@ -480,7 +479,7 @@
throwforce = 15.0
throw_speed = 4
throw_range = 4
m_amt = 15000
construction = MAT_METAL+"=15000"
origin_tech = "materials=2;combat=1"
attack_verb = list("chopped", "torn", "cut")

Expand Down Expand Up @@ -627,46 +626,42 @@
desc = "Used in the construction of computers and other devices with a interactive console."
icon_state = "screen"
origin_tech = "materials=1"
g_amt = 200
construction = MAT_GLASS+"=200"

/obj/item/weapon/stock_parts/capacitor
name = "capacitor"
desc = "A basic capacitor used in the construction of a variety of devices."
icon_state = "capacitor"
origin_tech = "powerstorage=1"
m_amt = 150
g_amt = 150
construction = MAT_METAL+"=150;"+MAT_GLASS+"=150"

/obj/item/weapon/stock_parts/scanning_module
name = "scanning module"
desc = "A compact, high resolution scanning module used in the construction of certain devices."
icon_state = "scan_module"
origin_tech = "magnets=1"
m_amt = 100
g_amt = 120
construction = MAT_METAL+"=100;"+MAT_GLASS+"=120"

/obj/item/weapon/stock_parts/manipulator
name = "micro-manipulator"
desc = "A tiny little manipulator used in the construction of certain devices."
icon_state = "micro_mani"
origin_tech = "materials=1;programming=1"
m_amt = 100
g_amt = 80
construction = MAT_METAL+"=100;"+MAT_GLASS+"=80"

/obj/item/weapon/stock_parts/micro_laser
name = "micro-laser"
desc = "A tiny laser used in certain devices."
icon_state = "micro_laser"
origin_tech = "magnets=1"
m_amt = 100
g_amt = 120
construction = MAT_METAL+"=100;"+MAT_GLASS+"=120"

/obj/item/weapon/stock_parts/matter_bin
name = "matter bin"
desc = "A container for hold compressed matter awaiting re-construction."
icon_state = "matter_bin"
origin_tech = "materials=1"
m_amt = 300
construction = MAT_METAL+"=300"

//Rank 2

Expand All @@ -676,44 +671,39 @@
icon_state = "adv_capacitor"
origin_tech = "powerstorage=3"
rating = 2
m_amt = 250
g_amt = 250
construction = MAT_METAL+"=250;"+MAT_GLASS+"=250"

/obj/item/weapon/stock_parts/scanning_module/adv
name = "advanced scanning module"
desc = "A compact, high resolution scanning module used in the construction of certain devices."
icon_state = "adv_scan_module"
origin_tech = "magnets=3"
rating = 2
m_amt = 250
g_amt = 220
construction = MAT_METAL+"=250;"+MAT_GLASS+"=220"

/obj/item/weapon/stock_parts/manipulator/nano
name = "nano-manipulator"
desc = "A tiny little manipulator used in the construction of certain devices."
icon_state = "nano_mani"
origin_tech = "materials=3,programming=2"
rating = 2
m_amt = 230
g_amt = 220
construction = MAT_METAL+"=230;"+MAT_GLASS+"=220"

/obj/item/weapon/stock_parts/micro_laser/high
name = "high-power micro-laser"
desc = "A tiny laser used in certain devices."
icon_state = "high_micro_laser"
origin_tech = "magnets=3"
rating = 2
m_amt = 210
g_amt = 220
construction = MAT_METAL+"=210;"+MAT_GLASS+"=220"

/obj/item/weapon/stock_parts/matter_bin/adv
name = "advanced matter bin"
desc = "A container for hold compressed matter awaiting re-construction."
icon_state = "advanced_matter_bin"
origin_tech = "materials=3"
rating = 2
m_amt = 280
g_amt = 220
construction = MAT_METAL+"=280;"+MAT_GLASS+"=220"

//Rating 3

Expand All @@ -723,44 +713,39 @@
icon_state = "super_capacitor"
origin_tech = "powerstorage=5;materials=4"
rating = 3
m_amt = 350
g_amt = 350
construction = MAT_METAL+"=350;"+MAT_GLASS+"=350"

/obj/item/weapon/stock_parts/scanning_module/adv/phasic
name = "phasic scanning module"
desc = "A compact, high resolution phasic scanning module used in the construction of certain devices."
icon_state = "super_scan_module"
origin_tech = "magnets=5"
rating = 3
m_amt = 350
g_amt = 320
construction = MAT_METAL+"=350;"+MAT_GLASS+"=320"

/obj/item/weapon/stock_parts/manipulator/nano/pico
name = "pico-manipulator"
desc = "A tiny little manipulator used in the construction of certain devices."
icon_state = "pico_mani"
origin_tech = "materials=5,programming=2"
rating = 3
m_amt = 330
g_amt = 320
construction = MAT_METAL+"=330;"+MAT_GLASS+"=320"

/obj/item/weapon/stock_parts/micro_laser/high/ultra
name = "ultra-high-power micro-laser"
icon_state = "ultra_high_micro_laser"
desc = "A tiny laser used in certain devices."
origin_tech = "magnets=5"
rating = 3
m_amt = 310
g_amt = 320
construction = MAT_METAL+"=310;"+MAT_GLASS+"=320"

/obj/item/weapon/stock_parts/matter_bin/adv/super
name = "super matter bin"
desc = "A container for hold compressed matter awaiting re-construction."
icon_state = "super_matter_bin"
origin_tech = "materials=5"
rating = 3
m_amt = 380
g_amt = 320
construction = MAT_METAL+"=380;"+MAT_GLASS+"=320"

//Rating 4

Expand All @@ -770,42 +755,39 @@
icon_state = "quadratic_capacitor"
origin_tech = "powerstorage=6;materials=5"
rating = 4
m_amt = 350
g_amt = 350
construction = MAT_METAL+"=350;"+MAT_GLASS+"=350"

/obj/item/weapon/stock_parts/scanning_module/adv/phasic/triphasic
name = "triphasic scanning module"
desc = "A compact, ultra resolution triphasic scanning module used in the construction of certain devices."
icon_state = "triphasic_scan_module"
origin_tech = "magnets=6"
rating = 4
m_amt = 350
g_amt = 320
construction = MAT_METAL+"=350;"+MAT_GLASS+"=320"

/obj/item/weapon/stock_parts/manipulator/nano/pico/femto
name = "femto-manipulator"
desc = "A tiny little manipulator used in the construction of certain devices."
icon_state = "femto_mani"
origin_tech = "materials=6;programming=3"
rating = 4
m_amt = 330
construction = MAT_METAL+"=330"

/obj/item/weapon/stock_parts/micro_laser/high/ultra/quadultra
name = "quad-ultra micro-laser"
icon_state = "quadultra_micro_laser"
desc = "A tiny laser used in certain devices."
origin_tech = "magnets=6"
rating = 4
m_amt = 80
g_amt = 220
construction = MAT_METAL+"=80;"+MAT_GLASS+"=220"

/obj/item/weapon/stock_parts/matter_bin/adv/super/bluespace
name = "bluespace matter bin"
desc = "A container for hold compressed matter awaiting re-construction."
icon_state = "bluespace_matter_bin"
origin_tech = "materials=6"
rating = 4
m_amt = 380
construction = MAT_METAL+"=380"

// Subspace stock parts

Expand All @@ -814,54 +796,49 @@
icon_state = "subspace_ansible"
desc = "A compact module capable of sensing extradimensional activity."
origin_tech = "programming=3;magnets=5;materials=4;bluespace=2"
m_amt = 30
g_amt = 10
construction = MAT_METAL+"=30;"+MAT_GLASS+"=10"

/obj/item/weapon/stock_parts/subspace/filter
name = "hyperwave filter"
icon_state = "hyperwave_filter"
desc = "A tiny device capable of filtering and converting super-intense radiowaves."
origin_tech = "programming=4;magnets=2"
m_amt = 30
g_amt = 10
construction = MAT_METAL+"=30;"+MAT_GLASS+"=10"

/obj/item/weapon/stock_parts/subspace/amplifier
name = "subspace amplifier"
icon_state = "subspace_amplifier"
desc = "A compact micro-machine capable of amplifying weak subspace transmissions."
origin_tech = "programming=3;magnets=4;materials=4;bluespace=2"
m_amt = 30
g_amt = 10
construction = MAT_METAL+"=30;"+MAT_GLASS+"=10"

/obj/item/weapon/stock_parts/subspace/treatment
name = "subspace treatment disk"
icon_state = "treatment_disk"
desc = "A compact micro-machine capable of stretching out hyper-compressed radio waves."
origin_tech = "programming=3;magnets=2;materials=5;bluespace=2"
m_amt = 30
g_amt = 10
construction = MAT_METAL+"=30;"+MAT_GLASS+"=10"

/obj/item/weapon/stock_parts/subspace/analyzer
name = "subspace wavelength analyzer"
icon_state = "wavelength_analyzer"
desc = "A sophisticated analyzer capable of analyzing cryptic subspace wavelengths."
origin_tech = "programming=3;magnets=4;materials=4;bluespace=2"
m_amt = 30
g_amt = 10
construction = MAT_METAL+"=30;"+MAT_GLASS+"=10"

/obj/item/weapon/stock_parts/subspace/crystal
name = "ansible crystal"
icon_state = "ansible_crystal"
desc = "A crystal made from pure glass used to transmit laser databursts to subspace."
origin_tech = "magnets=4;materials=4;bluespace=2"
g_amt = 50
construction = MAT_GLASS+"=50"

/obj/item/weapon/stock_parts/subspace/transmitter
name = "subspace transmitter"
icon_state = "subspace_transmitter"
desc = "A large piece of equipment used to open a window into the subspace dimension."
origin_tech = "magnets=5;materials=5;bluespace=3"
m_amt = 50
construction = MAT_METAL+"=50"

/obj/item/weapon/research//Makes testing much less of a pain -Sieve
name = "research"
Expand Down
Loading
Loading