This commit is contained in:
2025-04-27 13:49:47 +09:00
parent 3eb4c7589a
commit 79e210b483
3 changed files with 18 additions and 18 deletions

View File

@@ -1,3 +1,10 @@
---------------------------------------------------------------------------------------------------
Version: 3.0.98
Date: 2025-04-30
Changes:
- [CL] Some clean up of code.
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 3.0.97 Version: 3.0.97
Date: 2025-04-29 Date: 2025-04-29

View File

@@ -1,8 +1,8 @@
{ {
"name": "PHI-CL", "name": "PHI-CL",
"version": "3.0.97", "version": "3.0.98",
"factorio_version": "2.0", "factorio_version": "2.0",
"date": "2025-04-29", "date": "2025-04-30",
"title": "Phidias Collection", "title": "Phidias Collection",
"author": "PHIDIAS0303", "author": "PHIDIAS0303",
"contributers": "", "contributers": "",

View File

@@ -26,7 +26,6 @@ end
-- entity -- entity
function main.EEE(source, tier) function main.EEE(source, tier)
local item = table.deepcopy(data.raw[source.type][source.ref_name]) local item = table.deepcopy(data.raw[source.type][source.ref_name])
item.name = source.name .. '-' .. tier item.name = source.name .. '-' .. tier
item.minable.result = item.name item.minable.result = item.name
item.max_health = item.max_health * (tier - source.min + 2) item.max_health = item.max_health * (tier - source.min + 2)
@@ -218,9 +217,8 @@ end
-- equipment -- equipment
function main.EEQ(source, tier) function main.EEQ(source, tier)
local item = table.deepcopy(data.raw[source.type][source.ref_name]) local item = table.deepcopy(data.raw[source.type][source.ref_name])
item.name = source.name .. '-mk' .. tier .. '-equipment' item.name = source.name .. '-mk' .. tier .. '-equipment'
item.take_result = source.name .. '-mk' .. tier .. '-equipment' item.take_result = item.name
for _, v in pairs({'power', 'energy_consumption', 'energy_input', 'charging_energy'}) do for _, v in pairs({'power', 'energy_consumption', 'energy_input', 'charging_energy'}) do
item[v] = (item[v] and tostring(tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item[v], '%a+')) or nil item[v] = (item[v] and tostring(tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item[v], '%a+')) or nil
@@ -280,11 +278,11 @@ function main.EI(source, tier)
if source.category == 'equipment' then if source.category == 'equipment' then
item.name = source.name .. '-mk' .. tier .. '-equipment' item.name = source.name .. '-mk' .. tier .. '-equipment'
item.place_as_equipment_result = source.name .. '-mk' .. tier .. '-equipment' item.place_as_equipment_result = item.name
else else
item.name = source.name .. ((tier > 1 and '-' .. tier) or '') item.name = source.name .. ((tier > 1 and '-' .. tier) or '')
item.place_result = source.name .. ((tier > 1 and '-' .. tier) or '') item.place_result = item.name
end end
if item.icons and item.icons[1] then if item.icons and item.icons[1] then
@@ -315,9 +313,6 @@ end
-- recipe -- recipe
function main.ER(source, tier) function main.ER(source, tier)
local new_name = source.name
local ingredient_name = source.name
local result_name = source.name
local icons = { local icons = {
{ {
icon = data.raw.item[source.ref_name].icon, icon = data.raw.item[source.ref_name].icon,
@@ -325,21 +320,20 @@ function main.ER(source, tier)
} }
} }
ingredient_name = ((source.category == 'equipment' and (((tier == 2) and (ingredient_name .. '-equipment')) or (ingredient_name .. '-mk' .. (tier - 1) .. '-equipment'))) or (ingredient_name .. ((tier > 2) and ('-' .. (tier - 1)) or ''))) local ingredient_name = ((source.category == 'equipment' and (((tier == 2) and (source.name .. '-equipment')) or (source.name .. '-mk' .. (tier - 1) .. '-equipment'))) or (source.name .. ((tier > 2) and ('-' .. (tier - 1)) or '')))
new_name = new_name .. ((source.category == 'equipment' and ('-mk' .. tier .. '-equipment')) or ('-' .. tier)) local result_name = source.name .. ((source.category == 'equipment' and ('-mk' .. tier .. '-equipment')) or ('-' .. tier))
result_name = result_name .. ((source.category == 'equipment' and ('-mk' .. tier .. '-equipment')) or ('-' .. tier))
data:extend({{ data:extend({{
type = 'recipe', type = 'recipe',
name = new_name, name = result_name,
icons = icons, icons = icons,
energy_required = 2, energy_required = 2,
enabled = false, enabled = false,
ingredients = (source.tech == 'compound-energy' and (((source.type == 'solar-panel') or (source.type == 'accumulator')) and {{type = 'item', name = ingredient_name, amount = tonumber(settings.startup['PHI-MB-ENERGY-SOLAR-RATIO'].value) or 4}}) or ((tier > 2 and {{type = 'item', name = ingredient_name, amount = 1}, {type='item', name = source.name, amount = 1}}) or {{type = 'item', name = source.name, amount = 2}})) or {{type = 'item', name = ingredient_name, amount = 2}}, ingredients = (source.tech == 'compound-energy' and (((source.type == 'solar-panel') or (source.type == 'accumulator')) and {{type = 'item', name = ingredient_name, amount = tonumber(settings.startup['PHI-MB-ENERGY-SOLAR-RATIO'].value) or 4}}) or ((tier > 2 and {{type = 'item', name = ingredient_name, amount = 1}, {type='item', name = source.name, amount = 1}}) or {{type = 'item', name = source.name, amount = 2}})) or {{type = 'item', name = ingredient_name, amount = 2}},
results = {{type = 'item', name = result_name, amount = 1}}, results = {{type = 'item', name = result_name, amount = 1}},
main_product = result_name, main_product = result_name,
localised_name = {'?', data.raw[source.type][new_name].localised_name, ''}, localised_name = {'?', data.raw[source.type][result_name].localised_name, ''},
localised_description = {'?', data.raw[source.type][new_name].localised_description, ''} localised_description = {'?', data.raw[source.type][result_name].localised_description, ''}
}}) }})
end end
@@ -349,8 +343,7 @@ function main.ET(source, tier)
table.insert(data.raw.technology['compound-energy-' .. (tier - 1)].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier}) table.insert(data.raw.technology['compound-energy-' .. (tier - 1)].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier})
elseif data.raw.technology[source.tech] then elseif data.raw.technology[source.tech] then
local recipe_name = source.name local recipe_name = (source.category == 'equipment' and (source.name .. '-mk' .. tier .. '-equipment')) or (source.name .. '-' .. tier)
recipe_name = (source.category == 'equipment' and (recipe_name .. '-mk' .. tier .. '-equipment')) or (recipe_name .. '-' .. tier)
table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=recipe_name}) table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=recipe_name})
if source.type == 'ammo-turret' or source.type == 'fluid-turret' then if source.type == 'ammo-turret' or source.type == 'fluid-turret' then