This commit is contained in:
2025-02-27 02:27:46 +09:00
parent db3905e45b
commit daa27bb534
2 changed files with 32 additions and 86 deletions

View File

@@ -274,17 +274,11 @@ if settings.startup['PHI-MI'].value then
for _, t in pairs({data.raw['locomotive'], data.raw['cargo-wagon'], data.raw['fluid-wagon'], data.raw['artillery-wagon']}) do for _, t in pairs({data.raw['locomotive'], data.raw['cargo-wagon'], data.raw['fluid-wagon'], data.raw['artillery-wagon']}) do
for _, v in pairs(t) do for _, v in pairs(t) do
if v.max_health then v.max_health = (v.max_health and (v.max_health * s)) or nil
v.max_health = v.max_health * s v.max_speed = (v.max_speed and (v.max_speed * s)) or nil
end v.braking_force = (v.braking_force and (v.braking_force * s)) or nil
v.inventory_size = (v.inventory_size and math.ceil(v.inventory_size * s)) or nil
if v.max_speed then v.capacity = (v.capacity and math.ceil(v.capacity * s)) or nil
v.max_speed = v.max_speed * s
end
if v.braking_force then
v.braking_force = v.braking_force * s
end
if v.max_power then if v.max_power then
v.max_power = tostring(tonumber(string.match(v.max_power, '[%d%.]+')) * s) .. string.match(v.max_power, '%a+') v.max_power = tostring(tonumber(string.match(v.max_power, '[%d%.]+')) * s) .. string.match(v.max_power, '%a+')
@@ -294,14 +288,6 @@ if settings.startup['PHI-MI'].value then
v.energy_source.burnt_inventory_size = 1 v.energy_source.burnt_inventory_size = 1
end end
end end
if v.inventory_size then
v.inventory_size = math.ceil(v.inventory_size * s)
end
if v.capacity then
v.capacity = math.ceil(v.capacity * s)
end
end end
end end
end end
@@ -451,16 +437,14 @@ if settings.startup['PHI-SA'].value then
table.insert(data.raw.technology['cryogenic-plant'].effects, {type = 'unlock-recipe', recipe = 'unfreeze-' .. i.name}) table.insert(data.raw.technology['cryogenic-plant'].effects, {type = 'unlock-recipe', recipe = 'unfreeze-' .. i.name})
end end
spoil_handle(data.raw['item']['nutrients']) for _, v in pairs({'nutrients', 'captive-biter-spawner', 'biter-egg', 'pentapod-egg'}) do
spoil_handle(data.raw['item']['captive-biter-spawner']) spoil_handle(data.raw['item'][v])
spoil_handle(data.raw['item']['biter-egg']) end
spoil_handle(data.raw['item']['pentapod-egg'])
spoil_handle(data.raw['capsule']['raw-fish']) for _, v in pairs({'raw-fish', 'yumako-mash', 'yumako', 'jelly', 'jellynut', 'bioflux'}) do
spoil_handle(data.raw['capsule']['yumako-mash']) spoil_handle(data.raw['capsule'][v])
spoil_handle(data.raw['capsule']['yumako']) end
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']) spoil_handle(data.raw.tool['agricultural-science-pack'])
end end
@@ -471,16 +455,14 @@ if settings.startup['PHI-SA'].value then
i.spoil_to_trigger_result = nil i.spoil_to_trigger_result = nil
end end
spoil_handle(data.raw['item']['nutrients']) for _, v in pairs({'nutrients', 'captive-biter-spawner', 'biter-egg', 'pentapod-egg'}) do
spoil_handle(data.raw['item']['captive-biter-spawner']) spoil_handle(data.raw['item'][v])
spoil_handle(data.raw['item']['biter-egg']) end
spoil_handle(data.raw['item']['pentapod-egg'])
spoil_handle(data.raw['capsule']['raw-fish']) for _, v in pairs({'raw-fish', 'yumako-mash', 'yumako', 'jelly', 'jellynut', 'bioflux'}) do
spoil_handle(data.raw['capsule']['yumako-mash']) spoil_handle(data.raw['capsule'][v])
spoil_handle(data.raw['capsule']['yumako']) end
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']) spoil_handle(data.raw.tool['agricultural-science-pack'])
data:extend({{ data:extend({{

View File

@@ -31,29 +31,12 @@ function main.EEE(source, tier)
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)
item.next_upgrade = ((tier < source.max) and source.name .. '-' .. (tier + 1)) or nil
if (tier < source.max) then item.production = (item.production and ((source.tech == 'compound-energy' and source.type == 'solar-panel') and (tonumber(string.match(item.production, '[%d%.]+')) * (settings.startup['PHI-MB-ENERGY-SOLAR-RATIO'].value ^ (tier - source.min + 1)) .. (string.match(item.production, '%a+') or ''))) or (tonumber(string.match(item.production, '[%d%.]+')) * (2 ^ (tier - source.min + 1)) .. (string.match(item.production, '%a+') or ''))) or nil
item.next_upgrade = source.name .. '-' .. (tier + 1)
end
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-MB-ENERGY-SOLAR-RATIO'].value ^ (tier - source.min + 1)) .. (string.match(item.production, '%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({'energy_usage', 'heating_energy', 'crane_energy_usage', 'energy_per_shot', 'researching_speed', 'mining_speed', 'crafting_speed'}) do 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
local n = tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1)) item[v] = (tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. (string.match(item[v], '%a+') or '')
local a = string.match(item[v], '%a+')
item[v] = n
if a then
item[v] = item[v] .. a
end
end end
end end
@@ -65,16 +48,9 @@ function main.EEE(source, tier)
end end
if item.energy_source.emissions_per_minute then if item.energy_source.emissions_per_minute then
if source.tech == 'compound-energy' then if source.tech == 'compound-energy' and ((source.type == 'boiler') or (source.name == 'kr-gas-power-station')) then
if (source.type == 'boiler') or (source.name == 'kr-gas-power-station') then for k, _ in pairs(item.energy_source.emissions_per_minute) do
for k, _ in pairs(item.energy_source.emissions_per_minute) do item.energy_source.emissions_per_minute[k] = item.energy_source.emissions_per_minute[k] * (tier - source.min + 2)
item.energy_source.emissions_per_minute[k] = item.energy_source.emissions_per_minute[k] * (tier - source.min + 2)
end
else
for k, _ in pairs(item.energy_source.emissions_per_minute) do
item.energy_source.emissions_per_minute[k] = item.energy_source.emissions_per_minute[k] * (2 ^ (tier - source.min + 1))
end
end end
else else
@@ -89,32 +65,20 @@ function main.EEE(source, tier)
if item.attack_parameters then if item.attack_parameters then
item.attack_parameters.damage_modifier = 2 ^ (tier - source.min + 1) item.attack_parameters.damage_modifier = 2 ^ (tier - source.min + 1)
item.attack_parameters.range = item.attack_parameters.range + (2 * (tier - source.min + 1)) item.attack_parameters.range = item.attack_parameters.range + (2 * (tier - source.min + 1))
item.attack_parameters.cooldown = (item.attack_parameters.cooldown and (item.attack_parameters.cooldown * ((24 - tier + source.min) / 25))) or nil
if item.attack_parameters.cooldown then
item.attack_parameters.cooldown = item.attack_parameters.cooldown * ((24 - tier + source.min) / 25)
end
end end
if item.call_for_help_radius then item.call_for_help_radius = (item.call_for_help_radius and (item.call_for_help_radius + (2 * (tier - source.min + 1)))) or nil
item.call_for_help_radius = item.call_for_help_radius + (2 * (tier - source.min + 1))
end
if source.type == 'electric-turret' then if source.type == 'electric-turret' then
item.glow_light_intensity = 1 item.glow_light_intensity = 1
if item.attack_parameters then if item.attack_parameters then
if item.attack_parameters.damage_modifier and source.name == 'laser-turret' then item.attack_parameters.damage_modifier = ((item.attack_parameters.damage_modifier and source.name == 'laser-turret') and (item.attack_parameters.damage_modifier * 2)) or nil
item.attack_parameters.damage_modifier = item.attack_parameters.damage_modifier * 2
end
if item.attack_parameters.ammo_type then if item.attack_parameters.ammo_type then
if item.attack_parameters.ammo_type.action and item.attack_parameters.ammo_type.action.action_delivery and item.attack_parameters.ammo_type.action.action_delivery.max_length then item.attack_parameters.ammo_type.action.action_delivery.max_length = ((item.attack_parameters.ammo_type.action and item.attack_parameters.ammo_type.action.action_delivery and item.attack_parameters.ammo_type.action.action_delivery.max_length) and (item.attack_parameters.ammo_type.action.action_delivery.max_length + (2 * (tier - source.min + 1)))) or nil
item.attack_parameters.ammo_type.action.action_delivery.max_length = item.attack_parameters.ammo_type.action.action_delivery.max_length + (2 * (tier - source.min + 1)) item.attack_parameters.ammo_type.energy_consumption = (item.attack_parameters.ammo_type.energy_consumption and (tonumber(string.match(item.attack_parameters.ammo_type.energy_consumption, '[%d%.]+')) * (2 ^ (tier - source.min + 1)) .. string.match(item.attack_parameters.ammo_type.energy_consumption, '%a+'))) or nil
end
if item.attack_parameters.ammo_type.energy_consumption then
item.attack_parameters.ammo_type.energy_consumption = tonumber(string.match(item.attack_parameters.ammo_type.energy_consumption, '[%d%.]+')) * (2 ^ (tier - source.min + 1)) .. string.match(item.attack_parameters.ammo_type.energy_consumption, '%a+')
end
end end
end end