From d038db3e15531e9f7052ae1fbc938c02c3ce9fa1 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Mon, 17 Jun 2024 00:44:06 +0900 Subject: [PATCH] . --- {PHI-EN => PHI-CL}/.editorconfig | 0 {PHI-EN => PHI-CL}/.luacheckrc | 0 {PHI-EN => PHI-CL}/changelog.txt | 0 PHI-CL/config.lua | 135 ++++++++++ PHI-CL/data-updates.lua | 253 ++++++++++++++++++ PHI-CL/data.lua | 251 +++++++++++++++++ {PHI-EN => PHI-CL}/graphics/accumulator-e.png | Bin .../graphics/accumulator-eh.png | Bin {PHI-EN => PHI-CL}/graphics/accumulator-i.png | Bin {PHI-EN => PHI-CL}/graphics/solar-panel-e.png | Bin .../graphics/solar-panel-eh.png | Bin {PHI-EN => PHI-CL}/graphics/solar-panel-i.png | Bin {PHI-EN => PHI-CL}/info.json | 10 +- {PHI-EN => PHI-CL}/locale/en/locale.cfg | 0 {PHI-EN => PHI-CL}/locale/ja/locale.cfg | 0 {PHI-EN => PHI-CL}/locale/zh-CN/locale.cfg | 0 {PHI-EN => PHI-CL}/locale/zh-TW/locale.cfg | 0 .../migrations/PHI-EN_1.1.9.json | 0 {PHI-EN => PHI-CL}/migrations/migrations.lua | 0 {PHI-EN => PHI-CL}/settings.lua | 16 +- {PHI-EN => PHI-CL}/thumbnail.png | Bin PHI-EN/config.lua | 120 --------- PHI-EN/data-updates.lua | 42 --- PHI-EN/data.lua | 192 ------------- 24 files changed, 656 insertions(+), 363 deletions(-) rename {PHI-EN => PHI-CL}/.editorconfig (100%) rename {PHI-EN => PHI-CL}/.luacheckrc (100%) rename {PHI-EN => PHI-CL}/changelog.txt (100%) create mode 100644 PHI-CL/config.lua create mode 100644 PHI-CL/data-updates.lua create mode 100644 PHI-CL/data.lua rename {PHI-EN => PHI-CL}/graphics/accumulator-e.png (100%) rename {PHI-EN => PHI-CL}/graphics/accumulator-eh.png (100%) rename {PHI-EN => PHI-CL}/graphics/accumulator-i.png (100%) rename {PHI-EN => PHI-CL}/graphics/solar-panel-e.png (100%) rename {PHI-EN => PHI-CL}/graphics/solar-panel-eh.png (100%) rename {PHI-EN => PHI-CL}/graphics/solar-panel-i.png (100%) rename {PHI-EN => PHI-CL}/info.json (51%) rename {PHI-EN => PHI-CL}/locale/en/locale.cfg (100%) rename {PHI-EN => PHI-CL}/locale/ja/locale.cfg (100%) rename {PHI-EN => PHI-CL}/locale/zh-CN/locale.cfg (100%) rename {PHI-EN => PHI-CL}/locale/zh-TW/locale.cfg (100%) rename {PHI-EN => PHI-CL}/migrations/PHI-EN_1.1.9.json (100%) rename {PHI-EN => PHI-CL}/migrations/migrations.lua (100%) rename {PHI-EN => PHI-CL}/settings.lua (73%) rename {PHI-EN => PHI-CL}/thumbnail.png (100%) delete mode 100644 PHI-EN/config.lua delete mode 100644 PHI-EN/data-updates.lua delete mode 100644 PHI-EN/data.lua diff --git a/PHI-EN/.editorconfig b/PHI-CL/.editorconfig similarity index 100% rename from PHI-EN/.editorconfig rename to PHI-CL/.editorconfig diff --git a/PHI-EN/.luacheckrc b/PHI-CL/.luacheckrc similarity index 100% rename from PHI-EN/.luacheckrc rename to PHI-CL/.luacheckrc diff --git a/PHI-EN/changelog.txt b/PHI-CL/changelog.txt similarity index 100% rename from PHI-EN/changelog.txt rename to PHI-CL/changelog.txt diff --git a/PHI-CL/config.lua b/PHI-CL/config.lua new file mode 100644 index 0000000..ead0122 --- /dev/null +++ b/PHI-CL/config.lua @@ -0,0 +1,135 @@ +local items = { + ['setting'] = { + ['PHI-EN'] = { + type = 'enabled', + effect = {'solar-panel', 'accumulator', 'boiler', 'steam-engine', 'nuclear-reactor', 'heat-pipe', 'heat-exchanger', 'steam-turbine'} + }, + ['PHI-EN-SOLAR-TIER'] = { + type = 'max', + effect = {'solar-panel', 'accumulator'} + }, + ['PHI-EN-STEAM-TIER'] = { + type = 'max', + effect = {'boiler', 'steam-engine'} + }, + ['PHI-EN-NUCLEAR-TIER'] = { + type = 'max', + effect = {'nuclear-reactor', 'heat-pipe', 'heat-exchanger', 'steam-turbine'} + } + }, + ['item'] = { + ['solar-panel'] = { + enabled = true, + stage = 1, + type = 'solar-panel', + name = 'solar-panel', + ref_name = 'solar-panel', + min = 2, + max = 8, + base = 60 + }, + ['accumulator'] = { + enabled = true, + stage = 1, + type = 'accumulator', + name = 'accumulator', + ref_name = 'accumulator', + min = 2, + max = 8, + base = 5 + }, + ['boiler'] = { + enabled = true, + stage = 1, + type = 'boiler', + name = 'boiler', + ref_name = 'boiler', + min = 2, + max = 5, + base = 1800, + temp = 150, + fluid = 1 + }, + ['steam-engine'] = { + enabled = true, + stage = 1, + type = 'generator', + name = 'steam-engine', + ref_name = 'steam-engine', + min = 2, + max = 5, + base = 150, + fluid = 1 / 2 + }, + ['nuclear-reactor'] = { + enabled = true, + stage = 1, + type = 'reactor', + name = 'nuclear-reactor', + ref_name = 'nuclear-reactor', + min = 2, + max = 5, + base = 40, + bonus = 1, + temp = 500 + }, + ['heat-pipe'] = { + enabled = true, + stage = 1, + type = 'heat-pipe', + name = 'heat-pipe', + ref_name = 'heat-pipe', + min = 2, + max = 5, + temp = 500 + }, + ['heat-exchanger'] = { + enabled = true, + stage = 1, + type = 'boiler', + name = 'heat-exchanger', + ref_name = 'heat-exchanger', + min = 2, + max = 5, + base = 10000, + temp = 485, + fluid = 103 / 60 + }, + ['steam-turbine'] = { + enabled = true, + stage = 1, + type = 'generator', + name = 'steam-turbine', + ref_name = 'steam-turbine', + min = 2, + max = 5, + base = 485, + fluid = 1 + } + } +} + +if mods ~= nil then + if mods['Krastorio2'] then + items['item']['solar-panel'].base = 100 + items['item']['accumulator'].base = 10 + items['item']['boiler'].base = 1500 + items['item']['boiler'].temp = 150 + items['item']['boiler'].fluid = 1 / 3 + items['item']['steam-engine'].fluid = 1 / 6 + items['item']['nuclear-reactor'].base = 250 + items['item']['nuclear-reactor'].bonus = 0.25 + items['item']['heat-exchanger'].base = 50000 + items['item']['heat-exchanger'].temp = 400 + items['item']['heat-exchanger'].fluid = 25 / 6 + items['item']['steam-turbine'].base = 400 + items['item']['steam-turbine'].fluid = 5 / 6 + items['item']['heat-pipe'].temp = 400 + + elseif mods['space-exploration'] then + items['item']['solar-panel'].base = 60 + items['item']['accumulator'].base = 5 + end +end + +return items \ No newline at end of file diff --git a/PHI-CL/data-updates.lua b/PHI-CL/data-updates.lua new file mode 100644 index 0000000..2f0ca0b --- /dev/null +++ b/PHI-CL/data-updates.lua @@ -0,0 +1,253 @@ +local items = require 'config' + +-- entity +local function EE(source, tier) + local item = table.deepcopy(data.raw[source.type][source.ref_name]) + + item.name = source.name .. '-' .. tier + item.minable.result = source.name .. '-' .. tier + item.max_health = item.max_health * (2 ^ (tier - source.min + 1)) + + if (source.type == 'accumulator') then + item.energy_source.buffer_capacity = (source.base * 4 ^ (tier - source.min + 1)) .. 'MJ' + item.energy_source.input_flow_limit = (source.base * 60 * (4 ^ (tier - source.min + 1))) .. 'kW' + item.energy_source.output_flow_limit = (source.base * 60 * (4 ^ (tier - source.min + 1))) .. 'kW' + + --[[ + item.charge_animation.layers[1].layers[1].filename = item.picture.layers[1].filename + item.charge_animation.layers[1].layers[1].tint = {r = 1, g = 1, b = 1, a = 1} + item.charge_animation.layers[1].layers[1].hr_version.filename = item.picture.layers[1].hr_version.filename + item.charge_animation.layers[1].layers[1].hr_version.tint = {r = 1, g = 1, b = 1, a = 1} + item.discharge_animation.layers[1].layers[1].filename = item.picture.layers[1].filename + item.discharge_animation.layers[1].layers[1].tint = {r = 1, g = 1, b = 1, a = 1} + item.discharge_animation.layers[1].layers[1].hr_version.filename = item.picture.layers[1].hr_version.filename + item.discharge_animation.layers[1].layers[1].hr_version.tint = {r = 1, g = 1, b = 1, a = 1} + ]] + + elseif (source.type == 'solar-panel') then + item.production = (source.base * (4 ^ (tier - source.min + 1))) .. 'kW' + + elseif (source.type == 'boiler') then + item.fluid_box.height = 4 + item.output_fluid_box.height = 4 + item.output_fluid_box.base_level = 5 + item.energy_consumption = source.base * tier .. 'kW' + item.target_temperature = 15 + (source.temp * tier) + item.fluid_usage_per_tick = source.fluid + + if (source.name == 'heat-exchanger') then + item.energy_source.min_working_temperature = 15 + (source.temp * tier) + item.energy_source.max_temperature = source.temp * (tier + 1) + item.energy_source.max_transfer = 2000 + (2000 * tier) .. 'MW' + end + + elseif (source.type == 'generator') then + item.fluid_box.height = 4 + item.maximum_temperature = 15 + (source.base * tier) + item.fluid_usage_per_tick = source.fluid + + elseif (source.type == 'reactor') then + item.consumption = source.base * tier .. 'MW' + item.neighbour_bonus = source.bonus + item.heat_buffer.max_temperature = source.temp * (tier + 1) + item.heat_buffer.max_transfer = source.temp * (tier + 1) * 0.02 .. 'GW' + + elseif (source.type == 'heat-pipe') then + item.heat_buffer.max_temperature = source.temp * (tier + 1) + item.heat_buffer.max_transfer = source.temp * (tier + 1) * 0.01 .. 'GW' + + elseif (source.type == 'lab') then + item.researching_speed = item.researching_speed * (2 ^ (tier - source.min + 1)) + + elseif (source.type == 'mining-drill') then + item.mining_speed = item.mining_speed * (2 ^ (tier - source.min + 1)) + + else + if item.crafting_speed then + item.crafting_speed = item.crafting_speed * (2 ^ (tier - source.min + 1)) + end + + if item.energy_source.emissions_per_minute then + item.energy_source.emissions_per_minute = item.energy_source.emissions_per_minute * (2 ^ (tier - source.min + 1)) + end + end + + if item.fluid_boxes then + for k, _ in pairs(item.fluid_boxes) do + if (item.fluid_boxes[k] and (not item.fluid_boxes[k])) then + if item.fluid_boxes[k].production_type then + item.fluid_boxes[k].height = 4 + + if item.fluid_boxes[k].base_level then + item.fluid_boxes[k].base_level = item.fluid_boxes[k].base_level * 4 + end + end + end + end + end + + if item.energy_usage then + item.energy_usage = tonumber(string.match(item.energy_usage, '%d+')) * (2 ^ (tier - source.min + 1)) .. 'kW' + end + + -- item.animation.layers[1].filename = graphics_location .. source .. '-e.png' + -- item.animation.layers[1].hr_version.filename = graphics_location .. source ..'-eh.png' + -- item.icon = graphics_location .. source .. '-i.png' + -- item.icon_size = 64 + -- item.icon_mipmaps = 4 + + if (tier < source.max) then + item.next_upgrade = source.name .. '-' .. (tier + 1) + end + + data:extend({item}) +end + +-- item +local function EI(source, tier) + local item = table.deepcopy(data.raw.item[source.ref_name]) + + item.name = source.name .. '-' .. tier + item.place_result = source.name .. '-' .. tier + + -- item.subgroup = 'energy' + -- item.icons = {{icon = graphics_location .. source.name .. '-i.png', icon_mipmaps = 4, icon_size = 64}} + + item.order = item.order .. tier + data:extend({item}) +end + +-- recipe +local function ER(source, tier) + local ingredient_name = source.name + + if tier > 2 then + ingredient_name = ingredient_name .. '-' .. (tier - 1) + end + + if (source.type == 'solar-panel') or (source.type == 'accumulator') then + data:extend({{ + type = 'recipe', + name = source.name .. '-' .. tier, + energy_required = 2, + enabled = false, + ingredients = {{ingredient_name, 4}}, + result = source.name .. '-' .. tier, + }}) + + else + if ((source.type == 'boiler') or (source.type == 'steam-engine') or (source.type == 'nuclear-reactor') or (source.type == 'heat-pipe') or (source.type == 'heat-exchanger') or (source.type == 'steam-turbine')) and (tier == 2) then + data:extend({{ + type = 'recipe', + name = source.name .. '-' .. tier, + energy_required = 2, + enabled = false, + ingredients = {{ingredient_name, 1}, {source.name, 1}}, + result = source.name .. '-' .. tier, + }}) + + else + data:extend({{ + type = 'recipe', + name = source.name .. '-' .. tier, + energy_required = 2, + enabled = false, + ingredients = {{ingredient_name, 2}}, + result = source.name .. '-' .. tier, + }}) + end + end +end + +-- technology +local function ET(source, tier) + if (source.type == 'solar-panel') or (source.type == 'accumulator') or (source.type == 'boiler') or (source.type == 'steam-engine') or (source.type == 'nuclear-reactor') or (source.type == 'heat-pipe') or (source.type == 'heat-exchanger') or (source.type == 'steam-turbine') then + if not data.raw.technology['compound-energy-' .. (tier - 1)] then + local prereq + + if (tier == 2) then + prereq = {'solar-energy', 'advanced-electronics', 'electric-energy-accumulators'} + + else + prereq = {'compound-energy-' .. (tier - 2)} + end + + local item = { + type = 'technology', + name = 'compound-energy-' .. (tier - 1), + icon_size = 256, + icon = '__base__/graphics/technology/solar-energy.png', + effects = { + {type='unlock-recipe', recipe=source.name .. '-' .. tier} + }, + prerequisites = prereq, + unit = { + count = 100, + ingredients = { + {'automation-science-pack', 2}, + {'logistic-science-pack', 2} + }, + time = 120 + }, + order = 'a-h-' .. alpha_order[tier + 1] + } + + data:extend({item}) + else + if tier <= source.max then + table.insert(data.raw.technology['compound-energy-' .. (tier - 1)].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier}) + end + end + + else + table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier}) + end +end + +-- fast replace group +local function EL(source) + if not data.raw[source.type][source.ref_name].fast_replaceable_group then + data.raw[source.type][source.ref_name].fast_replaceable_group = source.type + end + + if source.max > 2 then + data.raw[source.type][source.name .. '-' .. 2].fast_replaceable_group = data.raw[source.type][source.ref_name].fast_replaceable_group + end + + if source.max > source.min then + for j=source.min + 1, source.max do + data.raw[source.type][source.name .. '-' .. j].fast_replaceable_group = data.raw[source.type][source.name .. '-' .. (j - 1)].fast_replaceable_group + end + end +end + +for k, v in pairs(items['setting']) do + for k2=1, #v.effect do + if items[v.effect[k2]] ~= nil then + if settings.startup[k].value < items[v.effect[k2]].min then + items[v.effect[k2]].enabled = false + end + + items[v.effect[k2]][v.type] = settings.startup[k].value + end + end +end + +for _, v in pairs(items['item']) do + if v.enabled then + if v.stage == 2 then + for j=v.min, v.max, 1 do + EE(v, j) + EI(v, j) + ER(v, j) + ET(v, j) + end + + EL(v) + end + end +end + +if items['nuclear-reactor'].enabled then + data.raw['fluid']['steam'].max_temperature = 5000 +end diff --git a/PHI-CL/data.lua b/PHI-CL/data.lua new file mode 100644 index 0000000..540c45a --- /dev/null +++ b/PHI-CL/data.lua @@ -0,0 +1,251 @@ +local alpha_order = {'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'} +-- local graphics_location = '__PHI-EN__/graphics/' +local items = require 'config' + +-- entity +local function EE(source, tier) + local item = table.deepcopy(data.raw[source.type][source.ref_name]) + + item.name = source.name .. '-' .. tier + item.minable.result = source.name .. '-' .. tier + item.max_health = item.max_health * (2 ^ (tier - source.min + 1)) + + if (source.type == 'accumulator') then + item.energy_source.buffer_capacity = (source.base * 4 ^ (tier - source.min + 1)) .. 'MJ' + item.energy_source.input_flow_limit = (source.base * 60 * (4 ^ (tier - source.min + 1))) .. 'kW' + item.energy_source.output_flow_limit = (source.base * 60 * (4 ^ (tier - source.min + 1))) .. 'kW' + + --[[ + item.charge_animation.layers[1].layers[1].filename = item.picture.layers[1].filename + item.charge_animation.layers[1].layers[1].tint = {r = 1, g = 1, b = 1, a = 1} + item.charge_animation.layers[1].layers[1].hr_version.filename = item.picture.layers[1].hr_version.filename + item.charge_animation.layers[1].layers[1].hr_version.tint = {r = 1, g = 1, b = 1, a = 1} + item.discharge_animation.layers[1].layers[1].filename = item.picture.layers[1].filename + item.discharge_animation.layers[1].layers[1].tint = {r = 1, g = 1, b = 1, a = 1} + item.discharge_animation.layers[1].layers[1].hr_version.filename = item.picture.layers[1].hr_version.filename + item.discharge_animation.layers[1].layers[1].hr_version.tint = {r = 1, g = 1, b = 1, a = 1} + ]] + + elseif (source.type == 'solar-panel') then + item.production = (source.base * (4 ^ (tier - source.min + 1))) .. 'kW' + + elseif (source.type == 'boiler') then + item.fluid_box.height = 4 + item.output_fluid_box.height = 4 + item.output_fluid_box.base_level = 5 + item.energy_consumption = source.base * tier .. 'kW' + item.target_temperature = 15 + (source.temp * tier) + item.fluid_usage_per_tick = source.fluid + + if (source.name == 'heat-exchanger') then + item.energy_source.min_working_temperature = 15 + (source.temp * tier) + item.energy_source.max_temperature = source.temp * (tier + 1) + item.energy_source.max_transfer = 2000 + (2000 * tier) .. 'MW' + end + + elseif (source.type == 'generator') then + item.fluid_box.height = 4 + item.maximum_temperature = 15 + (source.base * tier) + item.fluid_usage_per_tick = source.fluid + + elseif (source.type == 'reactor') then + item.consumption = source.base * tier .. 'MW' + item.neighbour_bonus = source.bonus + item.heat_buffer.max_temperature = source.temp * (tier + 1) + item.heat_buffer.max_transfer = source.temp * (tier + 1) * 0.02 .. 'GW' + + elseif (source.type == 'heat-pipe') then + item.heat_buffer.max_temperature = source.temp * (tier + 1) + item.heat_buffer.max_transfer = source.temp * (tier + 1) * 0.01 .. 'GW' + + elseif (source.type == 'lab') then + item.researching_speed = item.researching_speed * (2 ^ (tier - source.min + 1)) + + elseif (source.type == 'mining-drill') then + item.mining_speed = item.mining_speed * (2 ^ (tier - source.min + 1)) + + else + if item.crafting_speed then + item.crafting_speed = item.crafting_speed * (2 ^ (tier - source.min + 1)) + end + + if item.energy_source.emissions_per_minute then + item.energy_source.emissions_per_minute = item.energy_source.emissions_per_minute * (2 ^ (tier - source.min + 1)) + end + end + + if item.fluid_boxes then + for k, _ in pairs(item.fluid_boxes) do + if (item.fluid_boxes[k] and (not item.fluid_boxes[k])) then + if item.fluid_boxes[k].production_type then + item.fluid_boxes[k].height = 4 + + if item.fluid_boxes[k].base_level then + item.fluid_boxes[k].base_level = item.fluid_boxes[k].base_level * 4 + end + end + end + end + end + + if item.energy_usage then + item.energy_usage = tonumber(string.match(item.energy_usage, '%d+')) * (2 ^ (tier - source.min + 1)) .. 'kW' + end + + -- item.animation.layers[1].filename = graphics_location .. source .. '-e.png' + -- item.animation.layers[1].hr_version.filename = graphics_location .. source ..'-eh.png' + -- item.icon = graphics_location .. source .. '-i.png' + -- item.icon_size = 64 + -- item.icon_mipmaps = 4 + + if (tier < source.max) then + item.next_upgrade = source.name .. '-' .. (tier + 1) + end + + data:extend({item}) +end + +-- item +local function EI(source, tier) + local item = table.deepcopy(data.raw.item[source.ref_name]) + + item.name = source.name .. '-' .. tier + item.place_result = source.name .. '-' .. tier + + -- item.subgroup = 'energy' + -- item.icons = {{icon = graphics_location .. source.name .. '-i.png', icon_mipmaps = 4, icon_size = 64}} + + item.order = item.order .. tier + data:extend({item}) +end + +-- recipe +local function ER(source, tier) + local ingredient_name = source.name + + if tier > 2 then + ingredient_name = ingredient_name .. '-' .. (tier - 1) + end + + if (source.type == 'solar-panel') or (source.type == 'accumulator') then + data:extend({{ + type = 'recipe', + name = source.name .. '-' .. tier, + energy_required = 2, + enabled = false, + ingredients = {{ingredient_name, 4}}, + result = source.name .. '-' .. tier, + }}) + + else + if ((source.type == 'boiler') or (source.type == 'steam-engine') or (source.type == 'nuclear-reactor') or (source.type == 'heat-pipe') or (source.type == 'heat-exchanger') or (source.type == 'steam-turbine')) and (tier == 2) then + data:extend({{ + type = 'recipe', + name = source.name .. '-' .. tier, + energy_required = 2, + enabled = false, + ingredients = {{ingredient_name, 1}, {source.name, 1}}, + result = source.name .. '-' .. tier, + }}) + + else + data:extend({{ + type = 'recipe', + name = source.name .. '-' .. tier, + energy_required = 2, + enabled = false, + ingredients = {{ingredient_name, 2}}, + result = source.name .. '-' .. tier, + }}) + end + end +end + +-- technology +local function ET(source, tier) + if (source.type == 'solar-panel') or (source.type == 'accumulator') or (source.type == 'boiler') or (source.type == 'steam-engine') or (source.type == 'nuclear-reactor') or (source.type == 'heat-pipe') or (source.type == 'heat-exchanger') or (source.type == 'steam-turbine') then + if not data.raw.technology['compound-energy-' .. (tier - 1)] then + local prereq + + if (tier == 2) then + prereq = {'solar-energy', 'advanced-electronics', 'electric-energy-accumulators'} + + else + prereq = {'compound-energy-' .. (tier - 2)} + end + + local item = { + type = 'technology', + name = 'compound-energy-' .. (tier - 1), + icon_size = 256, + icon = '__base__/graphics/technology/solar-energy.png', + effects = { + {type='unlock-recipe', recipe=source.name .. '-' .. tier} + }, + prerequisites = prereq, + unit = { + count = 100, + ingredients = { + {'automation-science-pack', 2}, + {'logistic-science-pack', 2} + }, + time = 120 + }, + order = 'a-h-' .. alpha_order[tier + 1] + } + + data:extend({item}) + else + if tier <= source.max then + table.insert(data.raw.technology['compound-energy-' .. (tier - 1)].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier}) + end + end + + else + table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier}) + end +end + +-- fast replace group +local function EL(source) + if not data.raw[source.type][source.ref_name].fast_replaceable_group then + data.raw[source.type][source.ref_name].fast_replaceable_group = source.type + end + + if source.max > 2 then + data.raw[source.type][source.name .. '-' .. 2].fast_replaceable_group = data.raw[source.type][source.ref_name].fast_replaceable_group + end + + if source.max > source.min then + for j=source.min + 1, source.max do + data.raw[source.type][source.name .. '-' .. j].fast_replaceable_group = data.raw[source.type][source.name .. '-' .. (j - 1)].fast_replaceable_group + end + end +end + +for k, v in pairs(items['setting']) do + for k2=1, #v.effect do + if items[v.effect[k2]] ~= nil then + if settings.startup[k].value < items[v.effect[k2]].min then + items[v.effect[k2]].enabled = false + end + + items[v.effect[k2]][v.type] = settings.startup[k].value + end + end +end + +for _, v in pairs(items['item']) do + if v.enabled then + if v.stage == 1 then + for j=v.min, v.max, 1 do + EE(v, j) + EI(v, j) + ER(v, j) + ET(v, j) + end + + EL(v) + end + end +end diff --git a/PHI-EN/graphics/accumulator-e.png b/PHI-CL/graphics/accumulator-e.png similarity index 100% rename from PHI-EN/graphics/accumulator-e.png rename to PHI-CL/graphics/accumulator-e.png diff --git a/PHI-EN/graphics/accumulator-eh.png b/PHI-CL/graphics/accumulator-eh.png similarity index 100% rename from PHI-EN/graphics/accumulator-eh.png rename to PHI-CL/graphics/accumulator-eh.png diff --git a/PHI-EN/graphics/accumulator-i.png b/PHI-CL/graphics/accumulator-i.png similarity index 100% rename from PHI-EN/graphics/accumulator-i.png rename to PHI-CL/graphics/accumulator-i.png diff --git a/PHI-EN/graphics/solar-panel-e.png b/PHI-CL/graphics/solar-panel-e.png similarity index 100% rename from PHI-EN/graphics/solar-panel-e.png rename to PHI-CL/graphics/solar-panel-e.png diff --git a/PHI-EN/graphics/solar-panel-eh.png b/PHI-CL/graphics/solar-panel-eh.png similarity index 100% rename from PHI-EN/graphics/solar-panel-eh.png rename to PHI-CL/graphics/solar-panel-eh.png diff --git a/PHI-EN/graphics/solar-panel-i.png b/PHI-CL/graphics/solar-panel-i.png similarity index 100% rename from PHI-EN/graphics/solar-panel-i.png rename to PHI-CL/graphics/solar-panel-i.png diff --git a/PHI-EN/info.json b/PHI-CL/info.json similarity index 51% rename from PHI-EN/info.json rename to PHI-CL/info.json index fdafb9f..3a97da3 100644 --- a/PHI-EN/info.json +++ b/PHI-CL/info.json @@ -1,13 +1,13 @@ { - "name": "PHI-EN", - "version": "1.3.7", + "name": "PHI-CL", + "version": "2.0.0", "factorio_version": "1.1", - "date": "2023-09-19", - "title": "Phidias Energy", + "date": "2024-07-01", + "title": "Phidias Collection", "author": "PHIDIAS0303", "contributers": "", "homepage": "", - "description": "Additional Compound Solars, Accumulator", + "description": "Additional compound entities and items. Including power item like solar panel, accumulator.", "dependencies": [ "base >= 1.1.0", "? Krastorio2 >= 1.3.0", diff --git a/PHI-EN/locale/en/locale.cfg b/PHI-CL/locale/en/locale.cfg similarity index 100% rename from PHI-EN/locale/en/locale.cfg rename to PHI-CL/locale/en/locale.cfg diff --git a/PHI-EN/locale/ja/locale.cfg b/PHI-CL/locale/ja/locale.cfg similarity index 100% rename from PHI-EN/locale/ja/locale.cfg rename to PHI-CL/locale/ja/locale.cfg diff --git a/PHI-EN/locale/zh-CN/locale.cfg b/PHI-CL/locale/zh-CN/locale.cfg similarity index 100% rename from PHI-EN/locale/zh-CN/locale.cfg rename to PHI-CL/locale/zh-CN/locale.cfg diff --git a/PHI-EN/locale/zh-TW/locale.cfg b/PHI-CL/locale/zh-TW/locale.cfg similarity index 100% rename from PHI-EN/locale/zh-TW/locale.cfg rename to PHI-CL/locale/zh-TW/locale.cfg diff --git a/PHI-EN/migrations/PHI-EN_1.1.9.json b/PHI-CL/migrations/PHI-EN_1.1.9.json similarity index 100% rename from PHI-EN/migrations/PHI-EN_1.1.9.json rename to PHI-CL/migrations/PHI-EN_1.1.9.json diff --git a/PHI-EN/migrations/migrations.lua b/PHI-CL/migrations/migrations.lua similarity index 100% rename from PHI-EN/migrations/migrations.lua rename to PHI-CL/migrations/migrations.lua diff --git a/PHI-EN/settings.lua b/PHI-CL/settings.lua similarity index 73% rename from PHI-EN/settings.lua rename to PHI-CL/settings.lua index 2d1e24c..b32ba05 100644 --- a/PHI-EN/settings.lua +++ b/PHI-CL/settings.lua @@ -1,22 +1,30 @@ -data:extend({{ +data:extend({ + { + type = 'bool-setting', + name = 'PHI-EN', + setting_type = 'startup', + default_value = true, + order = 'A1' + }, + { type = 'int-setting', name = 'PHI-EN-SOLAR-TIER', setting_type = 'startup', default_value = 8, allowed_values = {1, 2, 3, 4, 5, 6, 7, 8}, - order = 'A1' + order = 'B1' }, { type = 'int-setting', name = 'PHI-EN-STEAM-TIER', setting_type = 'startup', default_value = 5, allowed_values = {1, 2, 3, 4, 5}, - order = 'A2' + order = 'B2' }, { type = 'int-setting', name = 'PHI-EN-NUCLEAR-TIER', setting_type = 'startup', default_value = 5, allowed_values = {1, 2, 3, 4, 5}, - order = 'A3' + order = 'B3' }}) \ No newline at end of file diff --git a/PHI-EN/thumbnail.png b/PHI-CL/thumbnail.png similarity index 100% rename from PHI-EN/thumbnail.png rename to PHI-CL/thumbnail.png diff --git a/PHI-EN/config.lua b/PHI-EN/config.lua deleted file mode 100644 index 6e65b5b..0000000 --- a/PHI-EN/config.lua +++ /dev/null @@ -1,120 +0,0 @@ -local items = { - ['setting'] = { - ['PHI-EN-SOLAR-TIER'] = { - type = 'max', - effect = {'solar-panel', 'accumulator'} - }, - ['PHI-EN-STEAM-TIER'] = { - type = 'max', - effect = {'boiler', 'steam-engine'} - }, - ['PHI-EN-NUCLEAR-TIER'] = { - type = 'max', - effect = {'nuclear-reactor', 'heat-pipe', 'heat-exchanger', 'steam-turbine'} - } - }, - ['solar-panel'] = { - enabled = true, - type = 'solar-panel', - name = 'solar-panel', - ref_name = 'solar-panel', - min = 2, - max = 8, - base = 60 - }, - ['accumulator'] = { - enabled = true, - type = 'accumulator', - name = 'accumulator', - ref_name = 'accumulator', - min = 2, - max = 8, - base = 5 - }, - ['boiler'] = { - enabled = true, - type = 'boiler', - name = 'boiler', - ref_name = 'boiler', - min = 2, - max = 5, - base = 1800, - temp = 150, - fluid = 1 - }, - ['steam-engine'] = { - enabled = true, - type = 'generator', - name = 'steam-engine', - ref_name = 'steam-engine', - min = 2, - max = 5, - base = 150, - fluid = 1 / 2 - }, - ['nuclear-reactor'] = { - enabled = true, - type = 'reactor', - name = 'nuclear-reactor', - ref_name = 'nuclear-reactor', - min = 2, - max = 5, - base = 40, - bonus = 1, - temp = 500 - }, - ['heat-pipe'] = { - enabled = true, - type = 'heat-pipe', - name = 'heat-pipe', - ref_name = 'heat-pipe', - min = 2, - max = 5, - temp = 500 - }, - ['heat-exchanger'] = { - enabled = true, - type = 'boiler', - name = 'heat-exchanger', - ref_name = 'heat-exchanger', - min = 2, - max = 5, - base = 10000, - temp = 485, - fluid = 103 / 60 - }, - ['steam-turbine'] = { - enabled = true, - type = 'generator', - name = 'steam-turbine', - ref_name = 'steam-turbine', - min = 2, - max = 5, - base = 485, - fluid = 1 - } -} - -if mods ~= nil then - if mods['Krastorio2'] then - items['solar-panel'].base = 100 - items['accumulator'].base = 10 - items['boiler'].base = 1500 - items['boiler'].temp = 150 - items['boiler'].fluid = 1 / 3 - items['steam-engine'].fluid = 1 / 6 - items['nuclear-reactor'].base = 250 - items['nuclear-reactor'].bonus = 0.25 - items['heat-exchanger'].base = 50000 - items['heat-exchanger'].temp = 400 - items['heat-exchanger'].fluid = 25 / 6 - items['steam-turbine'].base = 400 - items['steam-turbine'].fluid = 5 / 6 - items['heat-pipe'].temp = 400 - elseif mods['space-exploration'] then - items['solar-panel'].base = 60 - items['accumulator'].base = 5 - end -end - -return items \ No newline at end of file diff --git a/PHI-EN/data-updates.lua b/PHI-EN/data-updates.lua deleted file mode 100644 index f12e642..0000000 --- a/PHI-EN/data-updates.lua +++ /dev/null @@ -1,42 +0,0 @@ -local items = require 'config' - --- fast replace group -local function EL(source) - if not data.raw[source.type][source.ref_name].fast_replaceable_group then - data.raw[source.type][source.ref_name].fast_replaceable_group = source.type - end - - if source.max > 2 then - data.raw[source.type][source.name .. '-' .. 2].fast_replaceable_group = data.raw[source.type][source.ref_name].fast_replaceable_group - end - - if source.max > source.min then - for j=source.min + 1, source.max do - data.raw[source.type][source.name .. '-' .. j].fast_replaceable_group = data.raw[source.type][source.name .. '-' .. (j - 1)].fast_replaceable_group - end - end -end - -for k, v in pairs(items['setting']) do - for k2=1, #v.effect do - if items[v.effect[k2]] ~= nil then - if settings.startup[k].value < items[v.effect[k2]].min then - items[v.effect[k2]].enabled = false - end - - items[v.effect[k2]][v.type] = settings.startup[k].value - end - end -end - -for k, v in pairs(items) do - if k ~= 'setting' then - if v.enabled then - EL(v) - end - end -end - -if items['nuclear-reactor'].enabled then - data.raw['fluid']['steam'].max_temperature = 5000 -end diff --git a/PHI-EN/data.lua b/PHI-EN/data.lua deleted file mode 100644 index 37d71ac..0000000 --- a/PHI-EN/data.lua +++ /dev/null @@ -1,192 +0,0 @@ -local alpha_order = {'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'} -local graphics_location = '__PHI-EN__/graphics/' -local items = require 'config' - --- entity -local function EE(source, tier) - local item = table.deepcopy(data.raw[source.type][source.name]) - item.name = source.name .. '-' .. tier - item.minable.result = source.name .. '-' .. tier - item.max_health = 200 * (2 ^ (tier - 1)) - - --[[ - item.picture.layers[1].filename = graphics_location .. source.name .. '-e.png' - item.picture.layers[1].hr_version.filename = graphics_location .. source.name ..'-eh.png' - item.icon = graphics_location .. source.type .. '-i.png' - item.icon_size = 64 - item.icon_mipmaps = 4 - ]] - - if (source.type == 'accumulator') then - item.energy_source.buffer_capacity = (source.base * 4 ^ (tier - 1)) .. 'MJ' - item.energy_source.input_flow_limit = (source.base * 60 * (4 ^ (tier - 1))) .. 'kW' - item.energy_source.output_flow_limit = (source.base * 60 * (4 ^ (tier - 1))) .. 'kW' - - --[[ - item.charge_animation.layers[1].layers[1].filename = item.picture.layers[1].filename - item.charge_animation.layers[1].layers[1].tint = {r = 1, g = 1, b = 1, a = 1} - item.charge_animation.layers[1].layers[1].hr_version.filename = item.picture.layers[1].hr_version.filename - item.charge_animation.layers[1].layers[1].hr_version.tint = {r = 1, g = 1, b = 1, a = 1} - item.discharge_animation.layers[1].layers[1].filename = item.picture.layers[1].filename - item.discharge_animation.layers[1].layers[1].tint = {r = 1, g = 1, b = 1, a = 1} - item.discharge_animation.layers[1].layers[1].hr_version.filename = item.picture.layers[1].hr_version.filename - item.discharge_animation.layers[1].layers[1].hr_version.tint = {r = 1, g = 1, b = 1, a = 1} - ]] - - elseif (source.type == 'solar-panel') then - item.production = (source.base * (4 ^ (tier - 1))) .. 'kW' - - elseif (source.type == 'boiler') then - item.fluid_box.height = 4 - item.output_fluid_box.height = 4 - item.output_fluid_box.base_level = 5 - item.energy_consumption = source.base * tier .. 'kW' - item.target_temperature = 15 + (source.temp * tier) - item.fluid_usage_per_tick = source.fluid - - if (source.name == 'heat-exchanger') then - item.energy_source.min_working_temperature = 15 + (source.temp * tier) - item.energy_source.max_temperature = source.temp * (tier + 1) - item.energy_source.max_transfer = 2000 + (2000 * tier) .. 'MW' - end - - elseif (source.type == 'generator') then - item.fluid_box.height = 4 - item.maximum_temperature = 15 + (source.base * tier) - item.fluid_usage_per_tick = source.fluid - - elseif (source.type == 'reactor') then - item.consumption = source.base * tier .. 'MW' - item.neighbour_bonus = source.bonus - item.heat_buffer.max_temperature = source.temp * (tier + 1) - item.heat_buffer.max_transfer = source.temp * (tier + 1) * 0.02 .. 'GW' - - elseif (source.type == 'heat-pipe') then - item.heat_buffer.max_temperature = source.temp * (tier + 1) - item.heat_buffer.max_transfer = source.temp * (tier + 1) * 0.01 .. 'GW' - end - - if (tier <= source.max - 1) then - item.next_upgrade = source.name .. '-' .. (tier + 1) - end - - data:extend({item}) -end - --- item -local function EI(source, tier) - local item = table.deepcopy(data.raw.item[source.ref_name]) - item.name = source.name .. '-' .. tier - item.place_result = source.name .. '-' .. tier - item.max_health = 200 * (2 ^ (tier - 1)) - -- item.subgroup = 'energy' - -- item.stack_size = 50 - -- item.default_request_amount = 50 - -- item.icons = {{icon = graphics_location .. source.name .. '-i.png', icon_mipmaps = 4, icon_size = 64}} - item.order = item.order .. tier - data:extend({item}) -end - --- recipe -local function ER(source, tier) - local na = source.name - - if tier > 2 then - na = na .. '-' .. (tier - 1) - end - - if source.type == 'solar-panel' or source.type == 'accumulator' then - data:extend({{ - type = 'recipe', - name = source.name .. '-' .. tier, - energy_required = 2, - enabled = false, - ingredients = {{na, 4}}, - result = source.name .. '-' .. tier, - }}) - else - if tier == 2 then - data:extend({{ - type = 'recipe', - name = source.name .. '-' .. tier, - energy_required = 2, - enabled = false, - ingredients = {{na, 2}}, - result = source.name .. '-' .. tier, - }}) - else - data:extend({{ - type = 'recipe', - name = source.name .. '-' .. tier, - energy_required = 2, - enabled = false, - ingredients = {{na, 1}, {source.name, 1}}, - result = source.name .. '-' .. tier, - }}) - end - end -end - --- technology -local function ET(source, tier) - if data.raw.technology['compound-energy-' .. (tier - 1)] == nil then - local prereq - if (tier == 2) then - prereq = {'solar-energy', 'advanced-electronics', 'electric-energy-accumulators'} - else - prereq = {'compound-energy-' .. (tier - 2)} - end - - local item = { - type = 'technology', - name = 'compound-energy-' .. (tier - 1), - icon_size = 256, - icon = '__base__/graphics/technology/solar-energy.png', - effects = { - {type='unlock-recipe', recipe=source.name .. '-' .. tier} - }, - prerequisites = prereq, - unit = { - count = 100, - ingredients = { - {'automation-science-pack', 2}, - {'logistic-science-pack', 2} - }, - time = 120 - }, - order = 'a-h-' .. alpha_order[tier + 1] - } - - data:extend({item}) - else - if tier <= source.max then - table.insert(data.raw.technology['compound-energy-' .. (tier - 1)].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier}) - end - end -end - -for k, v in pairs(items['setting']) do - for k2=1, #v.effect do - if items[v.effect[k2]] ~= nil then - if settings.startup[k].value < items[v.effect[k2]].min then - items[v.effect[k2]].enabled = false - end - - items[v.effect[k2]][v.type] = settings.startup[k].value - end - end -end - -for k, v in pairs(items) do - if k ~= 'setting' then - if v.enabled then - for j=v.min, v.max, 1 do - EE(v, j) - EI(v, j) - ER(v, j) - ET(v, j) - end - end - end -end -