This commit is contained in:
2025-01-09 23:32:21 +09:00
parent 397661728f
commit bd488aef76

View File

@@ -364,10 +364,34 @@ local function handle_input_interfaces()
for name, v in pairs(inventory.get_contents()) do for name, v in pairs(inventory.get_contents()) do
if config.allowed_items[name] then if config.allowed_items[name] then
--[[
TODO
there are no quality support currently.
so instead, using the stats projection value for higher quality.
]]
if v.quality.level > 1 and v.count >= 10 then
local batch_to_convert = math.floor(v.count / 10)
local count_projection = batch_to_convert * (7 + (v.quality.level * 3))
if config.allowed_items[name].modded then
if config.modded_auto_downgrade then
vlayer.insert_item(config.modded_items[name].base_game_equivalent, count_projection * config.modded_items[name].multiplier)
else
vlayer.insert_item(name, count_projection)
end
else
if vlayer_data.storage.power_items[name] then
vlayer_data.storage.power_items[name].count = vlayer_data.storage.power_items[name].count + count_projection
else
vlayer.insert_item(name, count_projection)
end
end
inventory.remove{ name = name, count = batch_to_convert * 10, quality = v.quality }
elseif v.quality.level == 1 then
if config.allowed_items[name].modded then if config.allowed_items[name].modded then
if config.modded_auto_downgrade then if config.modded_auto_downgrade then
-- TODO Quality Insert 7 + 3N items based on quailty level.
-- For example, level 1: 10 = 10, level 2: 10 = 13
vlayer.insert_item(config.modded_items[name].base_game_equivalent, v.count * config.modded_items[name].multiplier) vlayer.insert_item(config.modded_items[name].base_game_equivalent, v.count * config.modded_items[name].multiplier)
else else
vlayer.insert_item(name, v.count) vlayer.insert_item(name, v.count)
@@ -385,6 +409,7 @@ local function handle_input_interfaces()
end end
end end
end end
end
end end
--- Create a new storage output interface --- Create a new storage output interface