mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-27 11:05:22 +09:00
.
This commit is contained in:
@@ -37,7 +37,7 @@ GUI set 0 ~ 1
|
|||||||
entity.valve_threshold_override
|
entity.valve_threshold_override
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local function inserter_gui_create(player)
|
local function gui_create(player)
|
||||||
if player.gui.relative.phi_cl_inserter_config then
|
if player.gui.relative.phi_cl_inserter_config then
|
||||||
player.gui.relative.phi_cl_inserter_config.destroy()
|
player.gui.relative.phi_cl_inserter_config.destroy()
|
||||||
end
|
end
|
||||||
@@ -146,7 +146,7 @@ end
|
|||||||
script.on_init(function()
|
script.on_init(function()
|
||||||
if settings.startup['PHI-CT'].value or settings.startup['PHI-MI'].value or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value ~= '-') then
|
if settings.startup['PHI-CT'].value or settings.startup['PHI-MI'].value or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value ~= '-') then
|
||||||
for _, player in pairs(game.players) do
|
for _, player in pairs(game.players) do
|
||||||
inserter_gui_create(player)
|
gui_create(player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -154,7 +154,7 @@ end)
|
|||||||
script.on_configuration_changed(function()
|
script.on_configuration_changed(function()
|
||||||
if settings.startup['PHI-CT'].value or settings.startup['PHI-MI'].value or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value ~= '-') then
|
if settings.startup['PHI-CT'].value or settings.startup['PHI-MI'].value or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value ~= '-') then
|
||||||
for _, player in pairs(game.players) do
|
for _, player in pairs(game.players) do
|
||||||
inserter_gui_create(player)
|
gui_create(player)
|
||||||
|
|
||||||
if player.opened and player.opened.object_name == 'LuaEntity' and (player.opened.entity.type == 'inserter' or (player.opened.entity.type == 'entity-ghost' and player.opened.entity.ghost_type == 'inserter')) then
|
if player.opened and player.opened.object_name == 'LuaEntity' and (player.opened.entity.type == 'inserter' or (player.opened.entity.type == 'entity-ghost' and player.opened.entity.ghost_type == 'inserter')) then
|
||||||
inserter_gui_update(player, player.opened.entity)
|
inserter_gui_update(player, player.opened.entity)
|
||||||
|
|||||||
187
PHI-CL/data.lua
187
PHI-CL/data.lua
@@ -145,8 +145,100 @@ if settings.startup['PHI-CT'].value or settings.startup['PHI-MI'].value or (sett
|
|||||||
data.raw['utility-constants'].default.rocket_lift_weight = settings.startup['PHI-SA-ROCKET-CAPACITY'].value * 1000000
|
data.raw['utility-constants'].default.rocket_lift_weight = settings.startup['PHI-SA-ROCKET-CAPACITY'].value * 1000000
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for _, v in pairs({'one-way-valve', 'overflow-valve', 'top-up-valve'}) do
|
||||||
|
data.raw['valve'][v].hidden = false
|
||||||
|
data.raw.item[v].hidden = false
|
||||||
|
|
||||||
|
data:extend({{
|
||||||
|
type = 'recipe',
|
||||||
|
name = v,
|
||||||
|
energy_required = 1,
|
||||||
|
enabled = true,
|
||||||
|
icon = data.raw.item[v].icon,
|
||||||
|
icon_size = 64,
|
||||||
|
order = 'zc',
|
||||||
|
allow_productivity = false,
|
||||||
|
ingredients = {{type = 'item', name = 'pipe', amount = 1}, {type = 'item', name = 'pump', amount = 1}, {type = 'item', name = 'electronic-circuit', amount = 3}},
|
||||||
|
results = {{type = 'item', name = v, amount = 1}},
|
||||||
|
main_product = v,
|
||||||
|
localised_name = {'entity-name.' .. v},
|
||||||
|
localised_description = {'entity-description.' .. v}
|
||||||
|
}})
|
||||||
|
end
|
||||||
|
|
||||||
|
data:extend({{type = 'recipe-category', name = 'fluid'}})
|
||||||
|
|
||||||
|
local item = table.deepcopy(data.raw['item']['offshore-pump'])
|
||||||
|
item.name = 'super-pump'
|
||||||
|
item.place_result = item.name
|
||||||
|
item.order = 'b[fluids]-a[super-pump]-o'
|
||||||
|
item.icons = {{icon = '__base__/graphics/icons/offshore-pump.png', tint = items['tint'][2], icon_size = 64, icon_mipmaps = 4}}
|
||||||
|
item.icon = nil
|
||||||
|
item.icon_size = nil
|
||||||
|
item.icon_mipmaps = nil
|
||||||
|
item.localised_name = {'', {'name.super-entity'}, {'entity-name.pump'}}
|
||||||
|
data:extend({item})
|
||||||
|
|
||||||
|
local entity = table.deepcopy(data.raw['offshore-pump']['offshore-pump'])
|
||||||
|
entity.name = item.name
|
||||||
|
entity.minable.result = item.name
|
||||||
|
entity.type = 'assembling-machine'
|
||||||
|
entity.crafting_categories = {'fluid'}
|
||||||
|
entity.crafting_speed = 1
|
||||||
|
entity.energy_source = {type = 'void'}
|
||||||
|
|
||||||
|
entity.fluid_boxes = {{
|
||||||
|
production_type = 'output',
|
||||||
|
pipe_covers = table.deepcopy(entity.fluid_box.pipe_covers),
|
||||||
|
volume = 100 * settings.startup['PHI-MI-PIPE'].value / 10,
|
||||||
|
pipe_connections = {{
|
||||||
|
flow_direction = 'output',
|
||||||
|
connection_category = (mods['space-age'] and {'default', 'fusion-plasma'}) or {'default'},
|
||||||
|
direction = defines.direction.south,
|
||||||
|
position = {0, 0}
|
||||||
|
}}
|
||||||
|
}}
|
||||||
|
|
||||||
|
entity.fluid_box = nil
|
||||||
|
entity.fluid_boxes_off_when_no_fluid_recipe = false
|
||||||
|
entity.effect_receiver = {uses_module_effects = false, uses_beacon_effects = false}
|
||||||
|
entity.allowed_effects = {'consumption'}
|
||||||
|
entity.tile_buildability_rules = nil
|
||||||
|
entity.fluid_source_offset = nil
|
||||||
|
entity.localised_name = {'', {'name.super-entity'}, {'entity-name.pump'}}
|
||||||
|
data:extend({entity})
|
||||||
|
|
||||||
|
data:extend({{
|
||||||
|
type = 'recipe',
|
||||||
|
name = item.name,
|
||||||
|
energy_required = 2,
|
||||||
|
enabled = true,
|
||||||
|
ingredients = {{type = 'item', name = 'electronic-circuit', amount = 2}, {type = 'item', name = 'pipe', amount = 1}, {type = 'item', name = 'iron-gear-wheel', amount = 1}},
|
||||||
|
results = {{type = 'item', name = item.name, amount = 1}},
|
||||||
|
main_product = item.name,
|
||||||
|
localised_name = {'', {'name.super-entity'}, {'entity-name.pump'}}
|
||||||
|
}})
|
||||||
|
|
||||||
|
if data.raw.fluid['water'] then
|
||||||
|
data:extend({{
|
||||||
|
type = 'recipe',
|
||||||
|
name = 'pump-water',
|
||||||
|
category = 'fluid',
|
||||||
|
energy_required = 1,
|
||||||
|
enabled = true,
|
||||||
|
ingredients = {},
|
||||||
|
results = {{type = 'fluid', name = 'water', amount = 12000 * settings.startup['PHI-MI-PIPE'].value / 10, temperature = data.raw.fluid['water'].default_temperature}},
|
||||||
|
main_product = 'water',
|
||||||
|
hide_from_player_crafting = true,
|
||||||
|
hidden_in_factoriopedia = true,
|
||||||
|
allow_productivity = false,
|
||||||
|
crafting_machine_tint = {primary = data.raw.fluid['water'].flow_color},
|
||||||
|
localised_name = {'fluid-name.water'}
|
||||||
|
}})
|
||||||
|
end
|
||||||
|
|
||||||
if mods['elevated-rails'] then
|
if mods['elevated-rails'] then
|
||||||
local entity = table.deepcopy(data.raw['electric-pole']['big-electric-pole'])
|
entity = table.deepcopy(data.raw['electric-pole']['big-electric-pole'])
|
||||||
entity.name = 'rail-support-pole-electric'
|
entity.name = 'rail-support-pole-electric'
|
||||||
entity.hidden = true
|
entity.hidden = true
|
||||||
entity.hidden_in_factoriopedia = true
|
entity.hidden_in_factoriopedia = true
|
||||||
@@ -255,78 +347,6 @@ if settings.startup['PHI-MI'].value then
|
|||||||
data.raw['utility-constants'].default.default_pipeline_extent = settings.startup['PHI-MI-PIPE-EXTENT'].value
|
data.raw['utility-constants'].default.default_pipeline_extent = settings.startup['PHI-MI-PIPE-EXTENT'].value
|
||||||
end
|
end
|
||||||
|
|
||||||
if settings.startup['PHI-CT'].value or (settings.startup['PHI-MI'].value) or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value ~= '-') then
|
|
||||||
data:extend({{type = 'recipe-category', name = 'fluid'}})
|
|
||||||
|
|
||||||
local item = table.deepcopy(data.raw['item']['offshore-pump'])
|
|
||||||
item.name = 'super-pump'
|
|
||||||
item.place_result = item.name
|
|
||||||
item.order = 'b[fluids]-a[super-pump]-o'
|
|
||||||
item.icons = {{icon = '__base__/graphics/icons/offshore-pump.png', tint = items['tint'][2], icon_size = 64, icon_mipmaps = 4}}
|
|
||||||
item.icon = nil
|
|
||||||
item.icon_size = nil
|
|
||||||
item.icon_mipmaps = nil
|
|
||||||
item.localised_name = {'', {'name.super-entity'}, {'entity-name.pump'}}
|
|
||||||
data:extend({item})
|
|
||||||
|
|
||||||
local entity = table.deepcopy(data.raw['offshore-pump']['offshore-pump'])
|
|
||||||
entity.name = item.name
|
|
||||||
entity.minable.result = item.name
|
|
||||||
entity.type = 'assembling-machine'
|
|
||||||
entity.crafting_categories = {'fluid'}
|
|
||||||
entity.crafting_speed = 1
|
|
||||||
entity.energy_source = {type = 'void'}
|
|
||||||
|
|
||||||
entity.fluid_boxes = {{
|
|
||||||
production_type = 'output',
|
|
||||||
pipe_covers = table.deepcopy(entity.fluid_box.pipe_covers),
|
|
||||||
volume = 100 * settings.startup['PHI-MI-PIPE'].value / 10,
|
|
||||||
pipe_connections = {{
|
|
||||||
flow_direction = 'output',
|
|
||||||
connection_category = (mods['space-age'] and {'default', 'fusion-plasma'}) or {'default'},
|
|
||||||
direction = defines.direction.south,
|
|
||||||
position = {0, 0}
|
|
||||||
}}
|
|
||||||
}}
|
|
||||||
|
|
||||||
entity.fluid_box = nil
|
|
||||||
entity.fluid_boxes_off_when_no_fluid_recipe = false
|
|
||||||
entity.effect_receiver = {uses_module_effects = false, uses_beacon_effects = false}
|
|
||||||
entity.allowed_effects = {'consumption'}
|
|
||||||
entity.tile_buildability_rules = nil
|
|
||||||
entity.fluid_source_offset = nil
|
|
||||||
entity.localised_name = {'', {'name.super-entity'}, {'entity-name.pump'}}
|
|
||||||
data:extend({entity})
|
|
||||||
|
|
||||||
data:extend({{
|
|
||||||
type = 'recipe',
|
|
||||||
name = item.name,
|
|
||||||
energy_required = 2,
|
|
||||||
enabled = true,
|
|
||||||
ingredients = {{type = 'item', name = 'electronic-circuit', amount = 2}, {type = 'item', name = 'pipe', amount = 1}, {type = 'item', name = 'iron-gear-wheel', amount = 1}},
|
|
||||||
results = {{type = 'item', name = item.name, amount = 1}},
|
|
||||||
main_product = item.name,
|
|
||||||
localised_name = {'', {'name.super-entity'}, {'entity-name.pump'}}
|
|
||||||
}})
|
|
||||||
|
|
||||||
if data.raw.fluid['water'] then
|
|
||||||
data:extend({{
|
|
||||||
type = 'recipe',
|
|
||||||
name = 'pump-water',
|
|
||||||
category = 'fluid',
|
|
||||||
energy_required = 1,
|
|
||||||
enabled = true,
|
|
||||||
ingredients = {},
|
|
||||||
results = {{type = 'fluid', name = 'water', amount = 12000 * settings.startup['PHI-MI-PIPE'].value / 10, temperature = data.raw.fluid['water'].default_temperature}},
|
|
||||||
main_product = 'water',
|
|
||||||
hide_from_player_crafting = true,
|
|
||||||
hidden_in_factoriopedia = true,
|
|
||||||
allow_productivity = false,
|
|
||||||
crafting_machine_tint = {primary = data.raw.fluid['water'].flow_color},
|
|
||||||
localised_name = {'fluid-name.water'}
|
|
||||||
}})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if settings.startup['PHI-SA'].value and settings.startup['PHI-SA-QUALITY'].value and mods['quality'] then
|
if settings.startup['PHI-SA'].value and settings.startup['PHI-SA-QUALITY'].value and mods['quality'] then
|
||||||
for _, v in pairs(data.raw.module) do
|
for _, v in pairs(data.raw.module) do
|
||||||
if v.category and v.category == 'quality' then
|
if v.category and v.category == 'quality' then
|
||||||
@@ -523,27 +543,6 @@ if mods['space-age'] and (settings.startup['PHI-GM'].value and settings.startup[
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, v in pairs({'one-way-valve', 'overflow-valve', 'top-up-valve'}) do
|
|
||||||
data.raw['valve'][v].hidden = false
|
|
||||||
data.raw.item[v].hidden = false
|
|
||||||
|
|
||||||
data:extend({{
|
|
||||||
type = 'recipe',
|
|
||||||
name = v,
|
|
||||||
energy_required = 1,
|
|
||||||
enabled = true,
|
|
||||||
icon = data.raw.item[v].icon,
|
|
||||||
icon_size = 64,
|
|
||||||
order = 'zc',
|
|
||||||
allow_productivity = false,
|
|
||||||
ingredients = {{type = 'item', name = 'pipe', amount = 1}, {type = 'item', name = 'pump', amount = 1}, {type = 'item', name = 'electronic-circuit', amount = 3}},
|
|
||||||
results = {{type = 'item', name = v, amount = 1}},
|
|
||||||
main_product = v,
|
|
||||||
localised_name = {'entity-name.' .. v},
|
|
||||||
localised_description = {'entity-description.' .. v}
|
|
||||||
}})
|
|
||||||
end
|
|
||||||
|
|
||||||
data.raw['module']['efficiency-module'].effect.consumption = math.min(-0.3, data.raw['module']['efficiency-module'].effect.consumption)
|
data.raw['module']['efficiency-module'].effect.consumption = math.min(-0.3, data.raw['module']['efficiency-module'].effect.consumption)
|
||||||
data.raw['module']['efficiency-module-2'].effect.consumption = math.min(-0.6, data.raw['module']['efficiency-module'].effect.consumption)
|
data.raw['module']['efficiency-module-2'].effect.consumption = math.min(-0.6, data.raw['module']['efficiency-module'].effect.consumption)
|
||||||
data.raw['module']['efficiency-module-3'].effect.consumption = math.min(-0.9, data.raw['module']['efficiency-module'].effect.consumption)
|
data.raw['module']['efficiency-module-3'].effect.consumption = math.min(-0.9, data.raw['module']['efficiency-module'].effect.consumption)
|
||||||
|
|||||||
Reference in New Issue
Block a user