From 21ba85e4dd313b6acb6d2bad8e101e3808c0a8f6 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Fri, 17 Jan 2025 19:29:53 +0900 Subject: [PATCH] . --- PHI-CL/changelog.txt | 7 ++++ PHI-CL/data.lua | 76 ++++++++++++++++++++++---------------------- PHI-CL/info.json | 4 +-- PHI-CL/main.lua | 26 ++++++++------- 4 files changed, 61 insertions(+), 52 deletions(-) diff --git a/PHI-CL/changelog.txt b/PHI-CL/changelog.txt index 36f1501..c988d44 100644 --- a/PHI-CL/changelog.txt +++ b/PHI-CL/changelog.txt @@ -1,3 +1,10 @@ +--------------------------------------------------------------------------------------------------- +Version: 3.0.55 +Date: 2025-01-16 + + Changes: + - [SA] Fixed logic on spoilage. + --------------------------------------------------------------------------------------------------- Version: 3.0.54 Date: 2025-01-08 diff --git a/PHI-CL/data.lua b/PHI-CL/data.lua index c7cabf3..6ae6a90 100644 --- a/PHI-CL/data.lua +++ b/PHI-CL/data.lua @@ -419,44 +419,7 @@ if (settings.startup['PHI-CT'].value and settings.startup['PHI-CT-TOOL'].value) end if settings.startup['PHI-SA'].value then - if (not settings.startup['PHI-SA-SPOIL'].value) and mods['space-age'] then - local function spoil_handle(i) - i.spoil_ticks = nil - i.spoil_result = nil - i.spoil_to_trigger_result = nil - end - - spoil_handle(data.raw['item']['nutrients']) - spoil_handle(data.raw['item']['captive-biter-spawner']) - spoil_handle(data.raw['item']['biter-egg']) - spoil_handle(data.raw['item']['pentapod-egg']) - spoil_handle(data.raw['capsule']['raw-fish']) - spoil_handle(data.raw['capsule']['yumako-mash']) - spoil_handle(data.raw['capsule']['yumako']) - spoil_handle(data.raw['capsule']['jelly']) - spoil_handle(data.raw['capsule']['jellynut']) - spoil_handle(data.raw['capsule']['bioflux']) - spoil_handle(data.raw.tool['agricultural-science-pack']) - - data:extend({{ - type = 'recipe', - name = 'spoilage-from-nutrients', - energy_required = 1, - enabled = false, - ingredients = {{type='item', name='nutrients', amount=1}}, - results = {{type='item', name='spoilage', amount=10}}, - main_product = 'spoilage', - localised_name = {'phi-cl.combine', '', ''} - }}) - - table.insert(data.raw.technology['agriculture'].effects, {type='unlock-recipe', recipe='spoilage-from-nutrients'}) - - data.raw['tips-and-tricks-item']['spoilables'] = nil - data.raw['tips-and-tricks-item']['spoilables-result'] = nil - data.raw['tips-and-tricks-item']['spoilables-research'] = nil - end - - if settings.startup['PHI-SA-SPOIL-FREEZE'].value and mods['space-age'] then + if settings.startup['PHI-SA-SPOIL-FREEZE'].value and settings.startup['PHI-SA-SPOIL'].value and mods['space-age'] then local function spoil_handle(i) item = table.deepcopy(i) item.name = 'frozen-' .. i.name @@ -527,6 +490,43 @@ if settings.startup['PHI-SA'].value then spoil_handle(data.raw.tool['agricultural-science-pack']) end + if (not settings.startup['PHI-SA-SPOIL'].value) and mods['space-age'] then + local function spoil_handle(i) + i.spoil_ticks = nil + i.spoil_result = nil + i.spoil_to_trigger_result = nil + end + + spoil_handle(data.raw['item']['nutrients']) + spoil_handle(data.raw['item']['captive-biter-spawner']) + spoil_handle(data.raw['item']['biter-egg']) + spoil_handle(data.raw['item']['pentapod-egg']) + spoil_handle(data.raw['capsule']['raw-fish']) + spoil_handle(data.raw['capsule']['yumako-mash']) + spoil_handle(data.raw['capsule']['yumako']) + spoil_handle(data.raw['capsule']['jelly']) + spoil_handle(data.raw['capsule']['jellynut']) + spoil_handle(data.raw['capsule']['bioflux']) + spoil_handle(data.raw.tool['agricultural-science-pack']) + + data:extend({{ + type = 'recipe', + name = 'spoilage-from-nutrients', + energy_required = 1, + enabled = false, + ingredients = {{type='item', name='nutrients', amount=1}}, + results = {{type='item', name='spoilage', amount=10}}, + main_product = 'spoilage', + localised_name = {'phi-cl.combine', '', ''} + }}) + + table.insert(data.raw.technology['agriculture'].effects, {type='unlock-recipe', recipe='spoilage-from-nutrients'}) + + data.raw['tips-and-tricks-item']['spoilables'] = nil + data.raw['tips-and-tricks-item']['spoilables-result'] = nil + data.raw['tips-and-tricks-item']['spoilables-research'] = nil + end + if (settings.startup['PHI-SA-RESTRICTION'].value or settings.startup['PHI-SA-VANILLA'].value) and mods['space-age'] then data.raw['assembling-machine']['captive-biter-spawner'].surface_conditions = nil data.raw['agricultural-tower']['agricultural-tower'].surface_conditions = nil diff --git a/PHI-CL/info.json b/PHI-CL/info.json index d59f1d6..bcef13a 100644 --- a/PHI-CL/info.json +++ b/PHI-CL/info.json @@ -1,8 +1,8 @@ { "name": "PHI-CL", - "version": "3.0.54", + "version": "3.0.55", "factorio_version": "2.0", - "date": "2025-01-08", + "date": "2025-01-17", "title": "Phidias Collection", "author": "PHIDIAS0303", "contributers": "", diff --git a/PHI-CL/main.lua b/PHI-CL/main.lua index 2151464..6b8633d 100644 --- a/PHI-CL/main.lua +++ b/PHI-CL/main.lua @@ -36,19 +36,24 @@ function main.EEE(source, tier) item.next_upgrade = source.name .. '-' .. (tier + 1) end - --[[ - TODO some better handle of EEE code - ]] + if item.production then + if source.tech == 'compound-energy' and source.type == 'solar-panel' then + item.production = tonumber(string.match(item.production, '[%d%.]+')) * (settings.startup['PHI-EN-SOLAR-RATIO'].value ^ (tier - source.min + 1)) .. (string.match(item.production, '%a+') or '') - for _, v in pairs({'production', 'energy_usage', 'heating_energy', 'crane_energy_usage', 'energy_per_shot'}) do - if not (source.tech == 'compound-energy' and (source.type == 'solar-panel' or source.type == 'accumulator')) and item[v] then - item[v] = tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1)) .. (string.match(item[v], '%a+') or '') + else + item.production = tonumber(string.match(item.production, '[%d%.]+')) * (2 ^ (tier - source.min + 1)) .. (string.match(item.production, '%a+') or '') end end - for _, v in pairs({'researching_speed', 'mining_speed', 'crafting_speed'}) do - if item[v] then - item[v] = tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1)) + for _, v in pairs({'energy_usage', 'heating_energy', 'crane_energy_usage', 'energy_per_shot', 'researching_speed', 'mining_speed', 'crafting_speed'}) do + if not (source.tech == 'compound-energy' and (source.type == 'solar-panel' or source.type == 'accumulator')) and item[v] then + local n = tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1)) + local a = string.match(item[v], '%a+') + item[v] = n + + if a then + item[v] = item[v] .. a + end end end @@ -136,9 +141,6 @@ function main.EEE(source, tier) end end - elseif (source.type == 'solar-panel') then - item.production = tostring(tonumber(string.match(item.production, '[%d%.]+')) * (settings.startup['PHI-EN-SOLAR-RATIO'].value ^ (tier - source.min + 1))) .. string.match(item.production, '%a+') - elseif (source.type == 'boiler') then item.energy_consumption = tostring(tonumber(string.match(item.energy_consumption, '[%d%.]+')) * tier) .. string.match(item.energy_consumption, '%a+') item.target_temperature = 15 + ((item.target_temperature - 15) * tier)