mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Update GUI Research Tracker (#390)
* Update research.lua * Update research.lua * Update research.lua * Format config and move pollution ageing * Update research.lua * Update research.lua * Update research.lua --------- Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
This commit is contained in:
@@ -7,21 +7,27 @@ return {
|
|||||||
queue_amount = 3,
|
queue_amount = 3,
|
||||||
mod_set = "base",
|
mod_set = "base",
|
||||||
mod_set_lookup = {
|
mod_set_lookup = {
|
||||||
"space-age"
|
"space-age",
|
||||||
},
|
},
|
||||||
-- this enable 20 more inventory for each mining productivity level up to 4
|
-- this enable 20 more inventory for each mining productivity level up to 4
|
||||||
bonus_inventory = {
|
bonus_inventory = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
res = {
|
log = {
|
||||||
-- Mining Productivity
|
|
||||||
["base"] = {
|
["base"] = {
|
||||||
["name"] = "mining-productivity-4",
|
["name"] = "mining-productivity-4",
|
||||||
["level"] = 4,
|
["level"] = 4
|
||||||
},
|
},
|
||||||
["space-age"] = {
|
["space-age"] = {
|
||||||
["name"] = "mining-productivity-3",
|
["name"] = "mining-productivity-3",
|
||||||
["level"] = 3,
|
["level"] = 3
|
||||||
}
|
},
|
||||||
|
},
|
||||||
|
res = {
|
||||||
|
-- Mining Productivity
|
||||||
|
["mining-productivity"] = true,
|
||||||
|
["mining-productivity-2"] = true,
|
||||||
|
["mining-productivity-3"] = true,
|
||||||
|
["mining-productivity-4"] = true,
|
||||||
},
|
},
|
||||||
name = "character_inventory_slots_bonus",
|
name = "character_inventory_slots_bonus",
|
||||||
rate = 5,
|
rate = 5,
|
||||||
@@ -73,20 +79,20 @@ return {
|
|||||||
["productivity-module-3"] = 300,
|
["productivity-module-3"] = 300,
|
||||||
["speed-module-3"] = 300,
|
["speed-module-3"] = 300,
|
||||||
["rocket-silo"] = 300,
|
["rocket-silo"] = 300,
|
||||||
["space-science-pack"] = 300
|
["space-science-pack"] = 300,
|
||||||
},
|
},
|
||||||
["space-age"] = {
|
["space-age"] = {
|
||||||
["logistic-science-pack"] = 3600,
|
["logistic-science-pack"] = 3600,
|
||||||
["military-science-pack"] = 3600,
|
["military-science-pack"] = 3600,
|
||||||
["chemical-science-pack"] = 4500,
|
["chemical-science-pack"] = 5400,
|
||||||
["utility-science-pack"] = 5400,
|
["utility-science-pack"] = 7200,
|
||||||
["production-science-pack"] = 5400,
|
["production-science-pack"] = 7200,
|
||||||
["space-science-pack"] = 5400,
|
["space-science-pack"] = 7200,
|
||||||
["metallurgic-science-pack"] = 6300,
|
["metallurgic-science-pack"] = 10800,
|
||||||
["electromagnetic-science-pack"] = 6300,
|
["electromagnetic-science-pack"] = 10800,
|
||||||
["agricultural-science-pack"] = 6300,
|
["agricultural-science-pack"] = 10800,
|
||||||
["cryogenic-science-pack"] = 6300,
|
["cryogenic-science-pack"] = 10800,
|
||||||
["promethium-science-pack"] = 7200
|
["promethium-science-pack"] = 14400,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
inf_res = {
|
inf_res = {
|
||||||
@@ -157,7 +163,7 @@ return {
|
|||||||
["rocket-part-productivity"] = 1,
|
["rocket-part-productivity"] = 1,
|
||||||
-- Follower Robot Count
|
-- Follower Robot Count
|
||||||
["follower-robot-count-5"] = 5,
|
["follower-robot-count-5"] = 5,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
-- prevent research up to a certain level
|
-- prevent research up to a certain level
|
||||||
limit_res = {
|
limit_res = {
|
||||||
|
|||||||
@@ -85,32 +85,25 @@ end
|
|||||||
|
|
||||||
local function research_notification(event)
|
local function research_notification(event)
|
||||||
if config.inf_res[config.mod_set][event.research.name] then
|
if config.inf_res[config.mod_set][event.research.name] then
|
||||||
if event.research.name == config.bonus_inventory.res[config.mod_set].name then
|
if event.research.name == config.bonus_inventory.log[config.mod_set].name
|
||||||
if event.research.level == config.bonus_inventory.res[config.mod_set].level + 1 then
|
and event.research.level == config.bonus_inventory.log[config.mod_set].level + 1 then
|
||||||
-- Add run result to log
|
-- Add run result to log
|
||||||
research_add_log()
|
research_add_log()
|
||||||
end
|
end
|
||||||
|
|
||||||
if config.bonus_inventory.enabled then
|
|
||||||
event.research.force[config.bonus_inventory.name] = math.max((event.research.level - 1) * config.bonus_inventory.rate, config.bonus_inventory.limit)
|
|
||||||
end
|
|
||||||
|
|
||||||
if config.pollution_ageing_by_research then
|
|
||||||
game.map_settings.pollution.ageing = math.min(10, event.research.level / 5)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not (event.by_script) then
|
if not (event.by_script) then
|
||||||
game.print{ "research.inf", research_time_format(game.tick), event.research.name, event.research.level - 1 }
|
game.print{ "research.inf", research_time_format(game.tick), event.research.name, event.research.level - 1 }
|
||||||
end
|
end
|
||||||
else
|
elseif not (event.by_script) then
|
||||||
if not (event.by_script) then
|
|
||||||
game.print{ "research.msg", research_time_format(game.tick), event.research.name }
|
game.print{ "research.msg", research_time_format(game.tick), event.research.name }
|
||||||
end
|
end
|
||||||
|
|
||||||
if config.bonus_inventory.enabled and (event.research.name == "mining-productivity-1" or event.research.name == "mining-productivity-2" or event.research.name == "mining-productivity-3") then
|
if config.bonus_inventory.enabled and config.bonus_inventory.res[event.research.name] then
|
||||||
event.research.force[config.bonus_inventory.name] = event.research.level * config.bonus_inventory.rate
|
event.research.force[config.bonus_inventory.name] = math.min((event.research.level - 1) * config.bonus_inventory.rate, config.bonus_inventory.limit)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if config.pollution_ageing_by_research and config.bonus_inventory.res[event.research.name] then
|
||||||
|
game.map_settings.pollution.ageing = math.min(10, event.research.level / 5)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ end)
|
|||||||
--- @param silent boolean True when no message should be printed
|
--- @param silent boolean True when no message should be printed
|
||||||
function module.res_queue(force, silent)
|
function module.res_queue(force, silent)
|
||||||
local res_q = force.research_queue
|
local res_q = force.research_queue
|
||||||
local res = force.technologies[config.bonus_inventory.res[config.mod_set].name]
|
local res = force.technologies[config.bonus_inventory.log[config.mod_set].name]
|
||||||
|
|
||||||
if #res_q < config.queue_amount then
|
if #res_q < config.queue_amount then
|
||||||
for i = #res_q, config.queue_amount - 1 do
|
for i = #res_q, config.queue_amount - 1 do
|
||||||
@@ -71,7 +71,7 @@ local function on_research_finished(event)
|
|||||||
if not research.res_queue_enable then return end
|
if not research.res_queue_enable then return end
|
||||||
|
|
||||||
local force = event.research.force
|
local force = event.research.force
|
||||||
local research = assert(config.bonus_inventory.res[config.mod_set], "Unknown mod set: " .. tostring(config.mod_set))
|
local research = assert(config.bonus_inventory.log[config.mod_set], "Unknown mod set: " .. tostring(config.mod_set))
|
||||||
local technology = assert(force.technologies[research.name], "Unknown technology: " .. tostring(research.name))
|
local technology = assert(force.technologies[research.name], "Unknown technology: " .. tostring(research.name))
|
||||||
if technology.level > research.level then
|
if technology.level > research.level then
|
||||||
module.res_queue(force, event.by_script)
|
module.res_queue(force, event.by_script)
|
||||||
|
|||||||
Reference in New Issue
Block a user