mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2026-05-12 21:08:43 +09:00
@@ -0,0 +1,156 @@
|
||||
|
||||
if settings.startup['PHI-SA'].value and (not settings.startup['PHI-SA-SPOIL'].value) or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value == 'VP') then
|
||||
local function spoil_handle(i)
|
||||
i.spoil_ticks = nil
|
||||
i.spoil_result = nil
|
||||
i.spoil_to_trigger_result = nil
|
||||
end
|
||||
|
||||
for _, v in pairs({'nutrients', 'captive-biter-spawner', 'biter-egg', 'pentapod-egg'}) do
|
||||
spoil_handle(data.raw['item'][v])
|
||||
end
|
||||
|
||||
for _, v in pairs({'raw-fish', 'yumako-mash', 'yumako', 'jelly', 'jellynut', 'bioflux'}) do
|
||||
spoil_handle(data.raw['capsule'][v])
|
||||
end
|
||||
|
||||
spoil_handle(data.raw.tool['agricultural-science-pack'])
|
||||
|
||||
data:extend({{
|
||||
type = 'recipe',
|
||||
name = 'spoilage-from-nutrients',
|
||||
category = 'organic-or-assembling',
|
||||
subgroup = 'agriculture-processes',
|
||||
order = 'c[nutrients]-z',
|
||||
energy_required = 2,
|
||||
enabled = false,
|
||||
allow_productivity = true,
|
||||
ingredients = {{type = 'item', name = 'nutrients', amount = 1}},
|
||||
results = {{type = 'item', name = 'spoilage', amount = 8}},
|
||||
main_product = 'spoilage',
|
||||
localised_name = {'item-name.spoilage'}
|
||||
}})
|
||||
|
||||
table.insert(data.raw.technology['agriculture'].effects, {type = 'unlock-recipe', recipe = 'spoilage-from-nutrients'})
|
||||
|
||||
for _, v in pairs({'spoilables', 'spoilables-result', 'spoilables-research'}) do
|
||||
data.raw['tips-and-tricks-item'][v] = nil
|
||||
end
|
||||
end
|
||||
|
||||
if settings.startup['PHI-SA'].value and settings.startup['PHI-SA-SPOIL'].value and settings.startup['PHI-SA-SPOIL-FREEZE'].value then
|
||||
local function spoil_handle(i)
|
||||
local item = table.deepcopy(i)
|
||||
item.name = 'frozen-' .. i.name
|
||||
item.order = item.order .. '-f'
|
||||
item.icons = {{icon = item.icon, icon_size = 64, icon_mipmaps = 4}, {icon = data.raw['item']['ice'].icon, tint = {r = 1, g = 1, b = 1, a = 0.5}, icon_size = 64, icon_mipmaps = 4}}
|
||||
item.icon = nil
|
||||
item.icon_size = nil
|
||||
item.icon_mipmaps = nil
|
||||
item.spoil_ticks = math.floor(i.spoil_ticks * settings.startup['PHI-SA-SPOIL-FREEZE-RATIO'].value / 10)
|
||||
item.spoil_result = i.name
|
||||
item.spoil_to_trigger_result = nil
|
||||
item.localised_name = {'item-name.' .. i.name}
|
||||
data:extend({item})
|
||||
|
||||
data:extend({{
|
||||
type = 'recipe',
|
||||
name = item.name,
|
||||
energy_required = 2,
|
||||
enabled = false,
|
||||
category = 'cryogenics',
|
||||
ingredients = {{type = 'item', name = i.name, amount = 1}, {type = 'fluid', name = 'fluoroketone-cold', amount = 2, ignored_by_stats = 2}},
|
||||
results = {{type = 'item', name = item.name, amount = 1}, {type = 'fluid', name = 'fluoroketone-hot', amount = 2, ignored_by_stats=2, ignored_by_productivity = 2}},
|
||||
allow_productivity = false,
|
||||
main_product = item.name,
|
||||
localised_name = {'item-name.' .. i.name}
|
||||
}})
|
||||
|
||||
data:extend({{
|
||||
type = 'recipe',
|
||||
name = 'unfreeze-' .. i.name,
|
||||
energy_required = 2,
|
||||
enabled = false,
|
||||
category = 'cryogenics',
|
||||
ingredients = {{type = 'item', name = item.name, amount = 1}},
|
||||
results = {{type = 'item', name = i.name, amount = 1}},
|
||||
allow_productivity = false,
|
||||
main_product = i.name,
|
||||
localised_name = {'item-name.' .. i.name}
|
||||
}})
|
||||
|
||||
table.insert(data.raw.technology['cryogenic-plant'].effects, {type = 'unlock-recipe', recipe = item.name})
|
||||
table.insert(data.raw.technology['cryogenic-plant'].effects, {type = 'unlock-recipe', recipe = 'unfreeze-' .. i.name})
|
||||
end
|
||||
|
||||
for _, v in pairs({'nutrients', 'captive-biter-spawner', 'biter-egg', 'pentapod-egg'}) do
|
||||
spoil_handle(data.raw['item'][v])
|
||||
end
|
||||
|
||||
for _, v in pairs({'raw-fish', 'yumako-mash', 'yumako', 'jelly', 'jellynut', 'bioflux'}) do
|
||||
spoil_handle(data.raw['capsule'][v])
|
||||
end
|
||||
|
||||
spoil_handle(data.raw.tool['agricultural-science-pack'])
|
||||
end
|
||||
|
||||
if settings.startup['PHI-SA'].value and settings.startup['PHI-SA-QUALITY'].value then
|
||||
for _, v in pairs(data.raw.module) do
|
||||
if v.category and v.category == 'quality' then
|
||||
v.effect.quality = v.effect.quality * settings.startup['PHI-SA-QUALITY'].value / 10
|
||||
|
||||
elseif v.category and v.category == 'speed' and settings.startup['PHI-SA-QUALITY'].value ~= 10 then
|
||||
v.effect.quality = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if settings.startup['PHI-SA'].value then
|
||||
data.raw['utility-constants'].default.rocket_lift_weight = settings.startup['PHI-SA-ROCKET-CAPACITY'].value * 1000000
|
||||
end
|
||||
|
||||
if (settings.startup['PHI-SA'].value and (not settings.startup['PHI-SA-ENABLE-QUALITY'].value)) or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value == 'VP') then
|
||||
for _, v in pairs({'quality-module', 'quality-module-2', 'quality-module-3'}) do
|
||||
if data.raw.technology[v] then
|
||||
data.raw.technology[v].hidden = true
|
||||
data.raw.technology[v].hidden_in_factoriopedia = true
|
||||
data.raw.technology[v].unit.ingredients = {{'space-science-pack', 1}}
|
||||
data.raw.technology[v].effects = nil
|
||||
end
|
||||
|
||||
if data.raw.module[v] then
|
||||
data.raw.module[v].hidden = true
|
||||
data.raw.module[v].hidden_in_factoriopedia = true
|
||||
end
|
||||
|
||||
if data.raw.recipe[v] then
|
||||
data.raw.recipe[v].hidden = true
|
||||
data.raw.recipe[v].hidden_in_factoriopedia = true
|
||||
end
|
||||
end
|
||||
|
||||
for _, v in pairs({'epic-quality', 'legendary-quality'}) do
|
||||
data.raw.technology[v].hidden = true
|
||||
data.raw.technology[v].hidden_in_factoriopedia = true
|
||||
data.raw.technology[v].unit.ingredients = {{'space-science-pack', 1}}
|
||||
data.raw.technology[v].effects = nil
|
||||
end
|
||||
|
||||
for _, v in pairs({'normal', 'uncommon', 'rare', 'epic', 'legendary'}) do
|
||||
data.raw.quality[v].next = nil
|
||||
data.raw.quality[v].next_probability = nil
|
||||
data.raw.quality[v].hidden = true
|
||||
data.raw.quality[v].hidden_in_factoriopedia = true
|
||||
end
|
||||
|
||||
for _, v in pairs({'quality', 'quality-modules', 'quality-factoriopedia', 'quality-probabilities'}) do
|
||||
data.raw['tips-and-tricks-item'][v] = nil
|
||||
end
|
||||
|
||||
data.raw['produce-achievement']['crafting-with-quality'] = nil
|
||||
data.raw['module-transfer-achievement']['make-it-better'] = nil
|
||||
data.raw['produce-achievement']['my-modules-are-legendary'] = nil
|
||||
data.raw['equip-armor-achievement']['look-at-my-shiny-rare-armor'] = nil
|
||||
data.raw['use-item-achievement']['todays-fish-is-trout-a-la-creme'] = nil
|
||||
data.raw['place-equipment-achievement']['no-room-for-more'] = nil
|
||||
end
|
||||
Reference in New Issue
Block a user