This commit is contained in:
2025-01-17 19:29:53 +09:00
parent 719a7cf9ac
commit 21ba85e4dd
4 changed files with 61 additions and 52 deletions

View File

@@ -1,3 +1,10 @@
---------------------------------------------------------------------------------------------------
Version: 3.0.55
Date: 2025-01-16
Changes:
- [SA] Fixed logic on spoilage.
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 3.0.54 Version: 3.0.54
Date: 2025-01-08 Date: 2025-01-08

View File

@@ -419,44 +419,7 @@ if (settings.startup['PHI-CT'].value and settings.startup['PHI-CT-TOOL'].value)
end end
if settings.startup['PHI-SA'].value then if settings.startup['PHI-SA'].value then
if (not settings.startup['PHI-SA-SPOIL'].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)
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
local function spoil_handle(i) local function spoil_handle(i)
item = table.deepcopy(i) item = table.deepcopy(i)
item.name = 'frozen-' .. i.name item.name = 'frozen-' .. i.name
@@ -527,6 +490,43 @@ if settings.startup['PHI-SA'].value then
spoil_handle(data.raw.tool['agricultural-science-pack']) spoil_handle(data.raw.tool['agricultural-science-pack'])
end 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 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['assembling-machine']['captive-biter-spawner'].surface_conditions = nil
data.raw['agricultural-tower']['agricultural-tower'].surface_conditions = nil data.raw['agricultural-tower']['agricultural-tower'].surface_conditions = nil

View File

@@ -1,8 +1,8 @@
{ {
"name": "PHI-CL", "name": "PHI-CL",
"version": "3.0.54", "version": "3.0.55",
"factorio_version": "2.0", "factorio_version": "2.0",
"date": "2025-01-08", "date": "2025-01-17",
"title": "Phidias Collection", "title": "Phidias Collection",
"author": "PHIDIAS0303", "author": "PHIDIAS0303",
"contributers": "", "contributers": "",

View File

@@ -36,19 +36,24 @@ function main.EEE(source, tier)
item.next_upgrade = source.name .. '-' .. (tier + 1) item.next_upgrade = source.name .. '-' .. (tier + 1)
end end
--[[ if item.production then
TODO some better handle of EEE code 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 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({'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 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 '') local n = tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1))
end local a = string.match(item[v], '%a+')
end item[v] = n
for _, v in pairs({'researching_speed', 'mining_speed', 'crafting_speed'}) do if a then
if item[v] then item[v] = item[v] .. a
item[v] = tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1)) end
end end
end end
@@ -136,9 +141,6 @@ function main.EEE(source, tier)
end end
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 elseif (source.type == 'boiler') then
item.energy_consumption = tostring(tonumber(string.match(item.energy_consumption, '[%d%.]+')) * tier) .. string.match(item.energy_consumption, '%a+') 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) item.target_temperature = 15 + ((item.target_temperature - 15) * tier)