From 2571ea8862edeea899ab8f9f826b551e8ce817a0 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Sat, 22 Apr 2023 17:38:09 +0900 Subject: [PATCH] Update --- PHI-MB/info.json | 4 +- PHI-MB/locale/en/locale.cfg | 8 +-- PHI-MB/locale/ja/locale.cfg | 8 +-- PHI-MB/locale/zh-CN/locale.cfg | 8 +-- PHI-MB/locale/zh-TW/locale.cfg | 8 +-- PHI-MB/migrations/migrations.lua | 67 ++++++++++++++++++++++--- PHI-WE/data-updates.lua | 4 ++ PHI-WE/data.lua | 84 ++++++++++++++++++++++++++++++++ PHI-WE/info.json | 2 +- PHI-WE/locale/en/locale.cfg | 11 +++++ PHI-WE/locale/ja/locale.cfg | 11 +++++ PHI-WE/locale/zh-CN/locale.cfg | 11 +++++ PHI-WE/locale/zh-TW/locale.cfg | 11 +++++ 13 files changed, 210 insertions(+), 27 deletions(-) diff --git a/PHI-MB/info.json b/PHI-MB/info.json index 3fdf4d1..c8c2f97 100644 --- a/PHI-MB/info.json +++ b/PHI-MB/info.json @@ -1,8 +1,8 @@ { "name": "PHI-MB", - "version": "1.0.6", + "version": "1.0.7", "factorio_version": "1.1", - "date": "2023-04-21", + "date": "2023-04-22", "title": "Phidias Megabase", "author": "PHIDIAS0303", "contributers": "", diff --git a/PHI-MB/locale/en/locale.cfg b/PHI-MB/locale/en/locale.cfg index d61662f..d683cdc 100644 --- a/PHI-MB/locale/en/locale.cfg +++ b/PHI-MB/locale/en/locale.cfg @@ -59,10 +59,10 @@ se-fuel-refinery-2=Fuel refinery 2 se-fuel-refinery-3=Fuel refinery 3 [entity-description] -assembling-machine-4=Assembling machine 4 -assembling-machine-5=Assembling machine 5 -electric-furnace-2=Electric furnace 2 -electric-furnace-3=Electric furnace 3 +assembling-machine-4=Assembling machines capable of processing fluid ingredients, with additional speed and module slots. +assembling-machine-5=Assembling machines capable of processing fluid ingredients, with additional speed and module slots. +electric-furnace-2=Faster and more flexible furnaces. +electric-furnace-3=Faster and more flexible furnaces. chemical-plant-2=Chemical plant 2 chemical-plant-3=Chemical plant 3 oil-refinery-2=Oil refinery 2 diff --git a/PHI-MB/locale/ja/locale.cfg b/PHI-MB/locale/ja/locale.cfg index c9f1632..9e32deb 100644 --- a/PHI-MB/locale/ja/locale.cfg +++ b/PHI-MB/locale/ja/locale.cfg @@ -59,10 +59,10 @@ se-fuel-refinery-2=燃料精製所 2 se-fuel-refinery-3=燃料精製所 3 [entity-description] -assembling-machine-4=組立機 4 -assembling-machine-5=組立機 5 -electric-furnace-2=電気炉 2 -electric-furnace-3=電気炉 3 +assembling-machine-4=流体素材の処理が可能で、更なる工作速度とモジュールスロットを持つ組立機です。 +assembling-machine-5=流体素材の処理が可能で、更なる工作速度とモジュールスロットを持つ組立機です。 +electric-furnace-2=より高速で便利な炉です。 +electric-furnace-3=より高速で便利な炉です。 chemical-plant-2=化学プラント 2 chemical-plant-3=化学プラント 3 oil-refinery-2=原油精製所 2 diff --git a/PHI-MB/locale/zh-CN/locale.cfg b/PHI-MB/locale/zh-CN/locale.cfg index cfff3f2..249496f 100644 --- a/PHI-MB/locale/zh-CN/locale.cfg +++ b/PHI-MB/locale/zh-CN/locale.cfg @@ -59,10 +59,10 @@ se-fuel-refinery-2=燃料精煉廠 2 se-fuel-refinery-3=燃料精煉廠 3 [entity-description] -assembling-machine-4=組裝機 4 -assembling-machine-5=組裝機 5 -electric-furnace-2=電爐 2 -electric-furnace-3=電爐 3 +assembling-machine-4=可加工流體原料的組裝機,而且還具備更快的組裝速度和組件插槽。 +assembling-machine-5=可加工流體原料的組裝機,而且還具備更快的組裝速度和組件插槽。 +electric-furnace-2=更快速、更方便的熔爐。 +electric-furnace-3=更快速、更方便的熔爐。 chemical-plant-2=化工廠 2 chemical-plant-3=化工廠 3 oil-refinery-2=煉油廠 2 diff --git a/PHI-MB/locale/zh-TW/locale.cfg b/PHI-MB/locale/zh-TW/locale.cfg index cfff3f2..249496f 100644 --- a/PHI-MB/locale/zh-TW/locale.cfg +++ b/PHI-MB/locale/zh-TW/locale.cfg @@ -59,10 +59,10 @@ se-fuel-refinery-2=燃料精煉廠 2 se-fuel-refinery-3=燃料精煉廠 3 [entity-description] -assembling-machine-4=組裝機 4 -assembling-machine-5=組裝機 5 -electric-furnace-2=電爐 2 -electric-furnace-3=電爐 3 +assembling-machine-4=可加工流體原料的組裝機,而且還具備更快的組裝速度和組件插槽。 +assembling-machine-5=可加工流體原料的組裝機,而且還具備更快的組裝速度和組件插槽。 +electric-furnace-2=更快速、更方便的熔爐。 +electric-furnace-3=更快速、更方便的熔爐。 chemical-plant-2=化工廠 2 chemical-plant-3=化工廠 3 oil-refinery-2=煉油廠 2 diff --git a/PHI-MB/migrations/migrations.lua b/PHI-MB/migrations/migrations.lua index 84cbf28..4dd983a 100644 --- a/PHI-MB/migrations/migrations.lua +++ b/PHI-MB/migrations/migrations.lua @@ -2,12 +2,69 @@ for index, force in pairs(game.forces) do local technologies = force.technologies local recipes = force.recipes - if technologies['automation-3'].researched then + if technologies['automation'].researched then + recipes['lab-2'].enabled = true + recipes['lab-2'].reload() + recipes['lab-3'].enabled = true + recipes['lab-3'].reload() + + if mods['aai-industry'] then + recipes['fuel-processor-2'].enabled = true + recipes['fuel-processor-2'].reload() + recipes['fuel-processor-3'].enabled = true + recipes['fuel-processor-3'].reload() + end + + if mods['space-exploration'] then + recipes['se-fuel-refinery-2'].enabled = true + recipes['se-fuel-refinery-2'].reload() + recipes['se-fuel-refinery-3'].enabled = true + recipes['se-fuel-refinery-3'].reload() + end + + elseif technologies['automation-2'].researched then + if mods['space-exploration'] then + recipes['se-pulveriser-2'].enabled = true + recipes['se-pulveriser-2'].reload() + recipes['se-pulveriser-3'].enabled = true + recipes['se-pulveriser-3'].reload() + + recipes['se-lifesupport-facility-2'].enabled = true + recipes['se-lifesupport-facility-2'].reload() + recipes['se-lifesupport-facility-3'].enabled = true + recipes['se-lifesupport-facility-3'].reload() + end + + elseif technologies['automation-3'].researched then recipes['assembling-machine-4'].enabled = true recipes['assembling-machine-4'].reload() recipes['assembling-machine-5'].enabled = true recipes['assembling-machine-5'].reload() + if mods['aai-industry'] then + recipes['industrial-furnace-2'].enabled = true + recipes['industrial-furnace-2'].reload() + recipes['industrial-furnace-3'].enabled = true + recipes['industrial-furnace-3'].reload() + end + + if mods['space-exploration'] then + recipes['se-space-assembling-machine-2'].enabled = true + recipes['se-space-assembling-machine-2'].reload() + recipes['se-space-assembling-machine-3'].enabled = true + recipes['se-space-assembling-machine-3'].reload() + + recipes['se-space-manufactory-2'].enabled = true + recipes['se-space-manufactory-2'].reload() + recipes['se-space-manufactory-3'].enabled = true + recipes['se-space-manufactory-3'].reload() + + recipes['se-casting-machine-2'].enabled = true + recipes['se-casting-machine-2'].reload() + recipes['se-casting-machine-3'].enabled = true + recipes['se-casting-machine-3'].reload() + end + elseif technologies['advanced-material-processing-2'].researched then recipes['electric-furnace-2'].enabled = true recipes['electric-furnace-2'].reload() @@ -19,6 +76,7 @@ for index, force in pairs(game.forces) do recipes['oil-refinery-2'].reload() recipes['oil-refinery-3'].enabled = true recipes['oil-refinery-3'].reload() + recipes['chemical-plant-2'].enabled = true recipes['chemical-plant-2'].reload() recipes['chemical-plant-3'].enabled = true @@ -29,12 +87,5 @@ for index, force in pairs(game.forces) do recipes['centrifuge-2'].reload() recipes['centrifuge-3'].enabled = true recipes['centrifuge-3'].reload() - - elseif technologies['automation'].researched then - recipes['lab-2'].enabled = true - recipes['lab-2'].reload() - recipes['lab-3'].enabled = true - recipes['lab-3'].reload() - end end diff --git a/PHI-WE/data-updates.lua b/PHI-WE/data-updates.lua index e69de29..ace441f 100644 --- a/PHI-WE/data-updates.lua +++ b/PHI-WE/data-updates.lua @@ -0,0 +1,4 @@ +-- laser turret +data.raw['electric-turret']['laser-turret'].fast_replaceable_group = 'laser-turret' +data.raw['electric-turret']['laser-turret-2'].fast_replaceable_group = data.raw['electric-turret']['laser-turret'].fast_replaceable_group +data.raw['electric-turret']['laser-turret-3'].fast_replaceable_group = data.raw['electric-turret']['laser-turret-2'].fast_replaceable_group diff --git a/PHI-WE/data.lua b/PHI-WE/data.lua index e69de29..3fbd683 100644 --- a/PHI-WE/data.lua +++ b/PHI-WE/data.lua @@ -0,0 +1,84 @@ +local items = { + ['laser-turret'] = { + enabled = true, + type = 'electric-turret', + name = 'laser-turret', + ref_name = 'laser-turret', + tech = 'laser-turret', + min = 2, + max = 3 + } +} + +-- 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 * tier + item.attack_parameters.damage_modifier = 2 * (2 ^ (tier - source.min + 1)) + + if source.type == 'electric-turret' then + item.energy_source.input_flow_limit = tonumber(string.match(item.energy_source.input_flow_limit, '%d+')) * (2 ^ (tier - source.min + 1)) .. 'kW' + item.energy_source.buffer_capacity = tonumber(string.match(item.energy_source.buffer_capacity, '%d+')) * (2 ^ (tier - source.min + 1)) .. 'kW' + item.glow_light_intensity = 1 + 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 - 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.icons = {{icon = graphics_location .. source .. '-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 + + data:extend({{ + type = 'recipe', + name = source.name .. '-' .. tier, + energy_required = 2, + enabled = false, + ingredients = {{na, 2}}, + result = source.name .. '-' .. tier, + }}) +end + +-- tech +local function ET(source, tier) + table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier}) +end + +for _, v in pairs(items) do + 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 diff --git a/PHI-WE/info.json b/PHI-WE/info.json index 9443b8a..fbe207d 100644 --- a/PHI-WE/info.json +++ b/PHI-WE/info.json @@ -2,7 +2,7 @@ "name": "PHI-WE", "version": "1.0.0", "factorio_version": "1.1", - "date": "2023-03-17", + "date": "2023-04-21", "title": "Phidias Warfare Equipment", "author": "PHIDIAS0303", "contributers": "", diff --git a/PHI-WE/locale/en/locale.cfg b/PHI-WE/locale/en/locale.cfg index e69de29..c59019c 100644 --- a/PHI-WE/locale/en/locale.cfg +++ b/PHI-WE/locale/en/locale.cfg @@ -0,0 +1,11 @@ +[item-name] +laser-turret-2=Laser turret 2 +laser-turret-3=Laser turret 3 + +[entity-name] +laser-turret-2=Laser turret 2 +laser-turret-3=Laser turret 3 + +[entity-description] +laser-turret-2=Advanced defensive buildings that only require electricity. +laser-turret-3=Advanced defensive buildings that only require electricity. diff --git a/PHI-WE/locale/ja/locale.cfg b/PHI-WE/locale/ja/locale.cfg index e69de29..ca6448e 100644 --- a/PHI-WE/locale/ja/locale.cfg +++ b/PHI-WE/locale/ja/locale.cfg @@ -0,0 +1,11 @@ +[item-name] +laser-turret-2=レーザータレット 2 +laser-turret-3=レーザータレット 3 + +[entity-name] +laser-turret-2=レーザータレット 2 +laser-turret-3=レーザータレット 3 + +[entity-description] +laser-turret-2=電気のみで稼動する高度な防衛施設。 +laser-turret-3=電気のみで稼動する高度な防衛施設。 diff --git a/PHI-WE/locale/zh-CN/locale.cfg b/PHI-WE/locale/zh-CN/locale.cfg index e69de29..0657e8f 100644 --- a/PHI-WE/locale/zh-CN/locale.cfg +++ b/PHI-WE/locale/zh-CN/locale.cfg @@ -0,0 +1,11 @@ +[item-name] +laser-turret-2=雷射炮塔 2 +laser-turret-3=雷射炮塔 3 + +[entity-name] +laser-turret-2=雷射炮塔 2 +laser-turret-3=雷射炮塔 3 + +[entity-description] +laser-turret-2=僅需電力即可運轉的先進防禦工事。 +laser-turret-3=僅需電力即可運轉的先進防禦工事。 diff --git a/PHI-WE/locale/zh-TW/locale.cfg b/PHI-WE/locale/zh-TW/locale.cfg index e69de29..0657e8f 100644 --- a/PHI-WE/locale/zh-TW/locale.cfg +++ b/PHI-WE/locale/zh-TW/locale.cfg @@ -0,0 +1,11 @@ +[item-name] +laser-turret-2=雷射炮塔 2 +laser-turret-3=雷射炮塔 3 + +[entity-name] +laser-turret-2=雷射炮塔 2 +laser-turret-3=雷射炮塔 3 + +[entity-description] +laser-turret-2=僅需電力即可運轉的先進防禦工事。 +laser-turret-3=僅需電力即可運轉的先進防禦工事。