This commit is contained in:
2026-06-05 04:35:57 +09:00
parent 309ad6c8df
commit 140ae6651c
13 changed files with 15 additions and 880 deletions
+1
View File
@@ -4,6 +4,7 @@ Date: 2026-06-21
Changes: Changes:
- [GM] Generic code layout restructure. - [GM] Generic code layout restructure.
- [MB] Dropped support for AAI, SE.
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 3.0.144 Version: 3.0.144
-25
View File
@@ -23,29 +23,4 @@ local inserter_direction_reversed = {}
for k, v in pairs(inserter_direction) do for k, v in pairs(inserter_direction) do
inserter_direction_reversed[v] = k inserter_direction_reversed[v] = k
end end
local function gui_create(player)
if player.gui.relative.phi_cl_inserter_config then
player.gui.relative.phi_cl_inserter_config.destroy()
end
do
local frame = player.gui.relative.add({type = 'frame', name = 'phi_cl_inserter_config', anchor = {gui = defines.relative_gui_type.inserter_gui, position = defines.relative_gui_position.right, type = 'inserter', ghost_mode = 'both'}})
frame.add({type = 'drop-down', name = 'i_sub_direction', items = {'[virtual-signal=signal-0]', '[virtual-signal=signal-1]', '[virtual-signal=signal-2]', '[virtual-signal=signal-3]'}, selected_index = 1})
end
end
local function gui_update(player, entity)
if entity.valid and entity.type and (entity.type == 'inserter' or (entity.type == 'entity-ghost' and entity.ghost_type == 'inserter')) then
player.gui.relative.phi_cl_inserter_config['i_sub_direction'].selected_index = ((inserter_direction_reversed[entity.direction] - 1) % 4) + 1
end
end
if settings.startup['PHI-MI'].value or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value ~= '') then
script.on_event(defines.events.on_gui_selection_state_changed, function(event)
if (player.opened.type == 'inserter' or (player.opened.type == 'entity-ghost' and player.opened.ghost_type == 'inserter')) and player.gui.relative.phi_cl_inserter_config then
player.opened.direction = inserter_direction[(math.floor(inserter_direction_reversed[player.opened.direction] / 4) * 4 + (event.element.parent['i_sub_direction'].selected_index - 1)) % 16 + 1]
end
end
end
]] ]]
-14
View File
@@ -1,18 +1,4 @@
if settings.startup['PHI-MB'].value then
if settings.startup['PHI-MB-ENERGY'].value and settings.startup['PHI-MB-ENERGY'].value > 1 then
require 'data.u.mbe'
end
if settings.startup['PHI-MB-MACHINE'].value and settings.startup['PHI-MB-MACHINE'].value > 1 then
require 'data.u.mbm'
end
if settings.startup['PHI-MB-EQUIPMENT'].value and settings.startup['PHI-MB-EQUIPMENT'].value > 1 then
require 'data.u.mbq'
end
end
if (settings.startup['PHI-MI'].value and settings.startup['PHI-MI-GENERIC'].value) or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value ~= '') then if (settings.startup['PHI-MI'].value and settings.startup['PHI-MI-GENERIC'].value) or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value ~= '') then
require 'data.u.mig' require 'data.u.mig'
end end
+11
View File
@@ -126,3 +126,14 @@ for _, v in pairs(items) do
end end
end end
end end
-- MBQ C 11 BASE ARMOR_EQUIPMENT
if settings.startup['PHI-MB-EQUIPMENT-SIZE'].value then
for _, e in pairs({'night-vision-equipment', 'energy-shield-equipment', 'battery-equipment', 'solar-panel-equipment', 'generator-equipment','active-defense-equipment', 'movement-bonus-equipment', 'roboport-equipment', 'belt-immunity-equipment', 'inventory-bonus-equipment'}) do
if data.raw[e] then
for _, v in pairs(data.raw[e]) do
v.shape = {width = 1, height = 1, type = 'full', points = {{0, 0}}}
end
end
end
end
-436
View File
@@ -1,436 +0,0 @@
local research_modifier = {
['ammo-turret'] = {
'physical-projectile-damage-1',
'physical-projectile-damage-2',
'physical-projectile-damage-3',
'physical-projectile-damage-4',
'physical-projectile-damage-5',
'physical-projectile-damage-6',
'physical-projectile-damage-7'
},
['fluid-turret'] = {
'refined-flammables-1',
'refined-flammables-2',
'refined-flammables-3',
'refined-flammables-4',
'refined-flammables-5',
'refined-flammables-6',
'refined-flammables-7'
}
}
local mod_tint = {
[2] = {r=140, g=142, b=200},
[3] = {r=242, g=161, b=26},
[4] = {r=255, g=254, b=42},
[5] = {r=54, g=228, b=255},
[6] = {r=253, g=0, b=97},
[7] = {r=0, g=209, b=102},
[8] = {r=233, g=63, b=233}
}
local main = {}
local function tint_handle(item, tier, tl)
for _, ve in pairs(tl) do
if item[ve] then
for _, tc in pairs({'layers', 'sheets', 'structure', 'frames'}) do
if item[ve][tc] and type(item[ve][tc]) == 'table' then
for _, v2 in pairs(item[ve][tc]) do
v2.tint = mod_tint[tier]
if v2.frames then
for _, v3 in pairs(v2.frames) do
v3.tint = mod_tint[tier]
end
end
end
end
end
item[ve].tint = mod_tint[tier]
end
end
end
-- entity
function main.EEE(source, tier)
local item = table.deepcopy(data.raw[source.type][source.ref_name])
item.name = source.name .. '-' .. tier
item.minable.result = item.name
item.max_health = item.max_health * (tier - source.min + 2)
item.next_upgrade = ((tier < source.max) and source.name .. '-' .. (tier + 1)) or nil
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
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))
end
end
for _, v in pairs({'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 '')
end
end
if item.energy_source then
for _, v in pairs({'buffer_capacity', 'input_flow_limit', 'output_flow_limit'}) do
if not (source.tech == 'compound-energy' and (source.type == 'solar-panel' or source.type == 'accumulator')) and item[v] then
item.energy_source[v] = tonumber(string.match(item.energy_source[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1)) .. string.match(item.energy_source[v], '%a+')
end
end
if item.energy_source.emissions_per_minute then
local m = ((source.tech == 'compound-energy' and ((source.type == 'boiler') or (source.name == 'kr-gas-power-station'))) and (tier - source.min + 2)) or (2 ^ (tier - source.min + 1))
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)
end
end
end
if (source.type == 'electric-turret') or (source.type == 'ammo-turret') or (source.type == 'fluid-turret') then
if item.attack_parameters then
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.cooldown = (item.attack_parameters.cooldown and (item.attack_parameters.cooldown * ((24 - tier + source.min) / 25))) or nil
end
item.call_for_help_radius = (item.call_for_help_radius and (item.call_for_help_radius + (2 * (tier - source.min + 1)))) or nil
if source.type == 'electric-turret' then
item.glow_light_intensity = 1
if item.attack_parameters then
item.attack_parameters.damage_modifier = (item.attack_parameters.damage_modifier and (item.attack_parameters.damage_modifier * 2)) or nil
if item.attack_parameters.ammo_type 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.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
end
elseif source.type == 'fluid-turret' then
item.prepare_range = item.prepare_range + (2 * (tier - source.min + 1))
end
end
if source.tech == 'compound-energy' then
if mods['space-age'] and (not (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value == 'VP')) then
if not item.surface_conditions then
item.surface_conditions = {}
end
table.insert(item.surface_conditions, {property = 'gravity', min = 0.01})
end
if (source.type == 'accumulator') and item['chargable_graphics'] then
if item['chargable_graphics']['picture'].layers and item['chargable_graphics']['picture'].layers[1] then
item['chargable_graphics']['picture'].layers[1].tint = mod_tint[tier]
end
for _, v in pairs({item['chargable_graphics']['charge_animation'], item['chargable_graphics']['discharge_animation']}) do
if v.layers and v.layers[1] and v.layers[1].layers and v.layers[1].layers[1] then
v.layers[1].layers[1].tint = mod_tint[tier]
end
end
for _, v in pairs({'buffer_capacity', 'input_flow_limit', 'output_flow_limit'}) do
item.energy_source[v] = (item.energy_source[v] and (tonumber(string.match(item.energy_source[v], '[%d%.]+')) * (settings.startup['PHI-MB-ENERGY-SOLAR-RATIO'].value ^ (tier - source.min + 1)) .. string.match(item.energy_source[v], '%a+'))) or nil
end
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)
if (source.name == 'heat-exchanger') then
item.energy_source.min_working_temperature = 15 + ((item.energy_source.min_working_temperature - 15) * tier)
item.energy_source.max_temperature = item.energy_source.max_temperature * tier
item.energy_source.max_transfer = tostring(tonumber(string.match(item.energy_source.max_transfer, '[%d%.]+')) * tier) .. string.match(item.energy_source.max_transfer, '%a+')
end
elseif (source.type == 'generator') then
item.max_power_output = (item.max_power_output and (tonumber(string.match(item.max_power_output, '[%d%.]+')) * (tier - source.min + 2)) .. string.match(item.max_power_output, '%a+')) or nil
item.maximum_temperature = (item.maximum_temperature and 15 + ((item.maximum_temperature - 15) * tier)) or nil
elseif (source.type == 'reactor') then
item.consumption = tostring(tonumber(string.match(item.consumption, '[%d%.]+')) * tier) .. string.match(item.consumption, '%a+')
item.heat_buffer.max_temperature = item.heat_buffer.max_temperature * tier
item.heat_buffer.max_transfer = tostring(tonumber(string.match(item.heat_buffer.max_transfer, '[%d%.]+')) * tier) .. string.match(item.heat_buffer.max_transfer, '%a+')
tint_handle(item, tier, {'connection_patches_connected', 'connection_patches_disconnected', 'heat_connection_patches_connected', 'heat_connection_patches_disconnected', 'lower_layer_picture'})
elseif (source.type == 'fusion-reactor') then
item.power_input = tostring(tonumber(string.match(item.power_input, '[%d%.]+')) * tier) .. string.match(item.power_input, '%a+')
item.max_fluid_usage = item.max_fluid_usage * tier
elseif (source.type == 'fusion-generator') then
item.energy_source.output_flow_limit = tostring(tonumber(string.match(item.energy_source.output_flow_limit, '[%d%.]+')) * tier) .. string.match(item.energy_source.output_flow_limit, '%a+')
item.max_fluid_usage = item.max_fluid_usage * tier
elseif (source.type == 'heat-pipe') then
item.heat_buffer.max_temperature = item.heat_buffer.max_temperature * tier
item.heat_buffer.max_transfer = tostring(tonumber(string.match(item.heat_buffer.max_transfer, '[%d%.]+')) * tier) .. string.match(item.heat_buffer.max_transfer, '%a+')
tint_handle(item, tier, {'connection_sprites', 'heat_glow_sprites'})
end
end
if (source.type == 'lab') then
for _, v in pairs({{['a'] = 'on_animation', ['n'] = 3}, {['a'] = 'off_animation', ['n'] = 2}}) do
if item[v['a']] and item[v['a']].layers then
for i=1, v['n'], 1 do
if item[v['a']].layers[i] then
item[v['a']].layers[i].tint = mod_tint[tier]
end
end
end
end
elseif (source.type == 'mining-drill') then
for _, e in pairs({'graphics_set', 'wet_mining_graphics_set'}) do
if item[e] and item[e].animation then
for _, d in pairs(item[e].animation) do
if d.layers then
d.layers[1].tint = mod_tint[tier]
d.layers[2].tint = mod_tint[tier]
end
end
end
end
elseif source.type == 'radar' then
item.max_distance_of_sector_revealed = item.max_distance_of_sector_revealed + (2 * (tier - source.min + 1))
item.max_distance_of_nearby_sector_revealed = item.max_distance_of_nearby_sector_revealed + (2 * (tier - source.min + 1))
elseif source.type == 'thruster' then
for _, v in pairs({'min_performance', 'max_performance'}) do
item[v].fluid_usage = (item[v].fluid_usage and item[v].fluid_usage * (2 ^ (tier - source.min + 1))) or nil
end
elseif source.type == 'reactor' and source.name == 'heating-tower' then
item.consumption = tostring(tonumber(string.match(item.consumption, '[%d%.]+')) * tier) .. string.match(item.consumption, '%a+')
elseif source.type == 'agricultural-tower' then
item.radius = item.radius + (1 * (tier - source.min + 1))
end
tint_handle(item, tier, {'picture', 'pictures', 'animation', 'structure', 'integration_patch', 'horizontal_animation', 'vertical_animation'})
for _, v in pairs({'graphics_set', 'graphics_set_flipped'}) do
if item[v] then
tint_handle(item[v], tier, {'animation', 'idle_animation', 'frozen_patch'})
if item[v].working_visualisations then
tint_handle(item[v].working_visualisations, tier, {'north_animation', 'east_animation', 'south_animation', 'west_animation', 'animation'})
end
end
end
if item.idle_animation and item.idle_animation.layers then
local i = 1
while i < #item.idle_animation.layers do
if item.idle_animation.layers[i] then
item.idle_animation.layers[i].tint = mod_tint[tier]
end
i = i + 2
if not item.idle_animation.layers[i] then
break
end
end
end
if item.base_picture and item.base_picture.sheets then
item.base_picture.sheets[1].tint = mod_tint[tier]
end
item.localised_name = (tier > 1 and {'phi-cl.combine', {'?', {'entity-name.' .. source.ref_name}, {'name.' .. source.ref_name}}, tostring(tier)}) or {'?', {'entity-name.' .. source.ref_name}, {'name.' .. source.ref_name}}
item.localised_description = {'?', {'entity-description.' .. source.ref_name}, {'description.' .. source.ref_name}}
data:extend({item})
end
-- equipment
function main.EEQ(source, tier)
local item = table.deepcopy(data.raw[source.type][source.ref_name])
item.name = source.name .. '-mk' .. tier .. '-equipment'
item.take_result = item.name
for _, v in pairs({'power', 'energy_consumption', 'energy_input', 'charging_energy'}) do
item[v] = (item[v] and tostring(tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item[v], '%a+')) or nil
end
if item.energy_source then
for _, v in pairs({'buffer_capacity', 'input_flow_limit', 'output_flow_limit'}) do
item.energy_source[v] = (item.energy_source[v] and tostring(tonumber(string.match(item.energy_source[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.energy_source[v], '%a+')) or nil
end
end
for _, v in pairs({'max_shield_value', 'movement_bonus', 'inventory_size_bonus'}) do
item[v] = (item[v] and item[v] * (2 ^ (tier - source.min + 1))) or nil
end
if item.darkness_to_turn_on and item.color_lookup then
item.darkness_to_turn_on = 0
item.color_lookup = {{0, '__core__/graphics/color_luts/lut-sunset.png'}}
end
if item.attack_parameters then
item.attack_parameters.cooldown = (item.attack_parameters.cooldown and item.attack_parameters.cooldown * ((24 - tier + source.min) / 25)) or nil
item.attack_parameters.damage_modifier = (item.attack_parameters.damage_modifier and item.attack_parameters.damage_modifier * (2 ^ (tier - source.min + 1))) or nil
item.attack_parameters.range = (item.attack_parameters.range and item.attack_parameters.range + (tier - source.min + 1)) or nil
if item.attack_parameters.ammo_type then
item.attack_parameters.ammo_type.energy_consumption = (item.attack_parameters.ammo_type.energy_consumption and tostring(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
if item.attack_parameters.ammo_type.action_delivery then
item.attack_parameters.ammo_type.action_delivery.max_length = item.attack_parameters.ammo_type.action_delivery.max_length + (tier - source.min + 1)
end
end
end
if item.sprite then
item.sprite.tint = mod_tint[tier]
end
item.localised_name = (tier > 1 and {'phi-cl.combine', {'?', {'equipment-name.' .. source.ref_name}, {'name.' .. source.ref_name}}, tostring(tier)}) or {'?', {'equipment-name.' .. source.ref_name}, {'name.' .. source.ref_name}}
item.localised_description = {'?', {'equipment-description.' .. source.ref_name}, {'description.' .. source.ref_name}}
data:extend({item})
end
-- item
function main.EI(source, tier)
local item = table.deepcopy(data.raw.item[source.ref_name])
item.name = (source.category == 'equipment' and (source.name .. '-mk' .. tier .. '-equipment')) or (source.name .. ((tier > 1 and '-' .. tier) or ''))
item[(source.category == 'equipment' and 'place_as_equipment_result') or 'place_result'] = item.name
if item.icons and item.icons[1] then
item.icons[1].tint = mod_tint[tier]
elseif item.icon then
item.icons = {{icon = item.icon, tint = mod_tint[tier]}}
item.icon = nil
if item.icon_size then
item.icons[1].icon_size = item.icon_size
item.icon_size = nil
end
end
item.order = item.order .. tier
item.localised_name = (tier > 1 and {'phi-cl.combine', {'?', {'entity-name.' .. source.ref_name}, {'equipment-name.' .. source.ref_name}, {'item-name.' .. source.ref_name}, {'name.' .. source.ref_name}}, tostring(tier)}) or {'?', {'entity-name.' .. source.ref_name}, {'equipment-name.' .. source.ref_name}, {'item-name.' .. source.ref_name}, {'name.' .. source.ref_name}}
item.localised_description = {'?', {'entity-description.' .. source.ref_name}, {'equipment-description.' .. source.ref_name}, {'item-description.' .. source.ref_name}, {'description.' .. source.ref_name}}
data:extend({item})
end
-- recipe
function main.ER(source, tier)
local icons = {{icon = data.raw.item[source.ref_name].icon, tint = mod_tint[tier]}}
local result_name = source.name .. ((source.category == 'equipment' and ('-mk' .. tier .. '-equipment')) or ('-' .. tier))
local ingredients = {}
local ingredient_name
if source.category == 'equipment' then
ingredient_name = (tier == source.min and source.ref_name) or (source.name .. '-mk' .. (tier - 1) .. '-equipment')
else
ingredient_name = (tier > source.min and (source.name .. '-' .. (tier - 1))) or source.ref_name
end
if source.tech == 'compound-energy' then
if source.type == 'solar-panel' or source.type == 'accumulator' then
table.insert(ingredients, {type = 'item', name = ingredient_name, amount = tonumber(settings.startup['PHI-MB-ENERGY-SOLAR-RATIO'].value) or 4})
else
if tier > source.min then
table.insert(ingredients, {type = 'item', name = ingredient_name, amount = 1})
table.insert(ingredients, {type = 'item', name = source.ref_name, amount = 1})
else
table.insert(ingredients, {type = 'item', name = source.ref_name, amount = 2})
end
end
else
table.insert(ingredients, {type = 'item', name = ingredient_name, amount = 2})
end
data:extend({{
type = 'recipe',
name = result_name,
icons = icons,
energy_required = 2,
enabled = false,
ingredients = ingredients,
results = {{type = 'item', name = result_name, amount = 1}},
main_product = result_name,
localised_name = {'?', data.raw[source.type][result_name].localised_name, ''},
localised_description = {'?', data.raw[source.type][result_name].localised_description, ''}
}})
end
-- technology
function main.ET(source, tier)
if (source.tech == 'compound-energy') then
table.insert(data.raw.technology['compound-energy-' .. (tier - 1)].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier})
elseif data.raw.technology[source.tech] then
local recipe_name = (source.category == 'equipment' and (source.name .. '-mk' .. tier .. '-equipment')) or (source.name .. '-' .. tier)
table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=recipe_name})
if source.type == 'ammo-turret' or source.type == 'fluid-turret' then
for i=1, #research_modifier[source.type], 1 do
for j=1, #data.raw.technology[research_modifier[source.type][i]].effects, 1 do
if (data.raw.technology[research_modifier[source.type][i]].effects[j].type == 'turret-attack') then
if (data.raw.technology[research_modifier[source.type][i]].effects[j].turret_id == source.ref_name) then
table.insert(data.raw.technology[research_modifier[source.type][i]].effects, {type='turret-attack', turret_id=source.name .. '-' .. tier, modifier=data.raw.technology[research_modifier[source.type][i]].effects[j].modifier})
end
end
end
end
end
end
end
-- fast replace group
function main.EL(source)
if not data.raw[source.type][source.ref_name].fast_replaceable_group then
data.raw[source.type][source.ref_name].fast_replaceable_group = source.ref_name
end
if source.max > 2 then
data.raw[source.type][source.name .. '-' .. 2].fast_replaceable_group = data.raw[source.type][source.ref_name].fast_replaceable_group
end
if source.max > source.min then
for j=source.min + 1, source.max do
data.raw[source.type][source.name .. '-' .. j].fast_replaceable_group = data.raw[source.type][source.name .. '-' .. (j - 1)].fast_replaceable_group
end
end
end
-- entity category
function main.EEEC(source, tier)
local item_name = source.name .. '-' .. tier
if not (data.raw[source.type][source.ref_name] and data.raw[source.type][item_name]) then
return
end
if data.raw[source.type][source.ref_name].crafting_categories and data.raw[source.type][item_name].crafting_categories then
data.raw[source.type][item_name].crafting_categories = {table.unpack(data.raw[source.type][source.ref_name].crafting_categories)}
end
if data.raw[source.type][source.ref_name].resource_categories and data.raw[source.type][item_name].resource_categories then
data.raw[source.type][item_name].resource_categories = {table.unpack(data.raw[source.type][source.ref_name].resource_categories)}
end
data.raw[source.type][item_name].fuel_categories = (data.raw[source.type][source.ref_name].fuel_categories and table.deepcopy(data.raw[source.type][source.ref_name].fuel_categories)) or nil
data.raw[source.type][item_name].allowed_effects = (data.raw[source.type][source.ref_name].allowed_effects and table.deepcopy(data.raw[source.type][source.ref_name].allowed_effects)) or nil
end
return main
-10
View File
@@ -1,10 +0,0 @@
return {
-- MBE A 5 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-solar-panel'] = {
mod = 'space-exploration',
type = 'solar-panel',
name = 'se-space-solar-panel',
min = 4,
max = settings.startup['PHI-MB-ENERGY'].value
}
}
-23
View File
@@ -1,23 +0,0 @@
local main = require('main')
local items = require('mbe-c')
-- MBE A 5 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
for _, v in pairs(items) do
v.mod = v.mod or 'base'
v.min = v.min or 2
if (v.mod and mods[v.mod]) and (v.max >= v.min) then
v.category = v.category or 'item'
v.ref_name = v.ref_name or v.name
v.tech = v.tech or 'compound-energy'
for j=v.min, v.max, 1 do
main.EEE(v, j)
main.EI(v, j)
main.ER(v, j)
main.ET(v, j)
end
main.EL(v)
end
end
-260
View File
@@ -1,260 +0,0 @@
return {
-- MBM A 2 AAI_INDUSTRY ENTITY,RECIPE,RESEARCH_EFFECT
['industrial-furnace'] = {
mod = 'aai-industry',
type = 'assembling-machine',
name = 'industrial-furnace',
tech = 'industrial-furnace',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 AAI_INDUSTRY ENTITY,RECIPE,RESEARCH_EFFECT
['fuel-processor'] = {
mod = 'aai-industry',
type = 'assembling-machine',
name = 'fuel-processor',
tech = 'fuel-processing',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 AAI_INDUSTRY ENTITY,RECIPE,RESEARCH_EFFECT
['area-mining-drill'] = {
mod = (mods['big-mining-drill'] and 'big-mining-drill') or 'aai-industry',
type = 'mining-drill',
name = 'area-mining-drill',
tech = 'area-mining-drill',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-assembling-machine'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-assembling-machine',
tech = 'se-space-assembling',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-manufactory'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-manufactory',
tech = 'se-space-manufactory',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-casting-machine'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-casting-machine',
tech = 'se-pyroflux-smelting',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-pulveriser'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-pulveriser',
tech = 'se-pulveriser',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-lifesupport-facility'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-lifesupport-facility',
tech = 'se-lifesupport-facility',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-fuel-refinery'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-fuel-refinery',
tech = 'se-fuel-refining',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-decontamination-facility'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-decontamination-facility',
tech = 'se-space-decontamination-facility',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-genetics-laboratory'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-genetics-laboratory',
tech = 'se-space-genetics-laboratory',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-growth-facility'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-growth-facility',
tech = 'se-space-growth-facility',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-biochemical-laboratory'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-biochemical-laboratory',
tech = 'se-space-biochemical-laboratory',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-radiation-laboratory'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-radiation-laboratory',
tech = 'se-space-radiation-laboratory',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-electromagnetics-laboratory'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-electromagnetics-laboratory',
tech = 'se-space-electromagnetics-laboratory',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-laser-laboratory'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-laser-laboratory',
tech = 'se-space-laser-laboratory',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-astrometrics-laboratory'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-astrometrics-laboratory',
tech = 'se-space-astrometrics-laboratory',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-gravimetrics-laboratory'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-gravimetrics-laboratory',
tech = 'se-space-gravimetrics-laboratory',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-mechanical-laboratory'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-mechanical-laboratory',
tech = 'se-space-mechanical-laboratory',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-thermodynamics-laboratory'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-thermodynamics-laboratory',
tech = 'se-space-thermodynamics-laboratory',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-material-fabricator'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-material-fabricator',
tech = 'se-space-material-fabricator',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-particle-accelerator'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-particle-accelerator',
tech = 'se-space-particle-accelerator',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-particle-collider'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-particle-collider',
tech = 'se-space-particle-collider',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-plasma-generator'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-plasma-generator',
tech = 'se-space-plasma-generator',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-hypercooler'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-hypercooler',
tech = 'se-space-hypercooling-1',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-radiator'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-radiator',
ref_name = 'se-space-radiator-2',
tech = 'se-space-radiator-2',
min = 3,
max = settings.startup['PHI-MB-MACHINE'].value + 1
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-telescope'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-telescope',
tech = 'se-space-telescope',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-telescope-gammaray'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-telescope-gammaray',
tech = 'se-space-telescope-gammaray',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-telescope-microwave'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-telescope-microwave',
tech = 'se-space-telescope-microwave',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-telescope-radio'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-telescope-radio',
tech = 'se-space-telescope-radio',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-telescope-xray'] = {
mod = 'space-exploration',
type = 'assembling-machine',
name = 'se-space-telescope-xray',
tech = 'se-space-telescope-xray',
max = settings.startup['PHI-MB-MACHINE'].value
},
-- MBM A 2 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
['se-space-science-lab'] = {
mod = 'space-exploration',
type = 'lab',
name = 'se-space-science-lab',
tech = 'se-space-science-lab',
max = settings.startup['PHI-MB-MACHINE'].value
},
}
-87
View File
@@ -1,87 +0,0 @@
local main = require('main')
local items = require('mbm-c')
local mod_tint = {
[2] = {r=140, g=142, b=200},
[3] = {r=242, g=161, b=26},
[4] = {r=255, g=254, b=42},
[5] = {r=54, g=228, b=255},
[6] = {r=253, g=0, b=97},
[7] = {r=0, g=209, b=102},
[8] = {r=233, g=63, b=233}
}
-- MBE A 6 AAI_INDUSTRY ENTITY,RECIPE,RESEARCH_EFFECT
-- MBE A 58 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT
for _, v in pairs(items) do
v.mod = v.mod or 'base'
v.min = v.min or 2
if v.enabled and (v.mod and mods[v.mod]) and (v.max >= v.min) then
v.category = v.category or 'item'
v.ref_name = v.ref_name or v.name
for j=v.min, v.max, 1 do
main.EEE(v, j)
main.EI(v, j)
main.ER(v, j)
main.ET(v, j)
end
main.EL(v)
end
end
if mods['space-exploration'] then
data.raw['mining-drill']['se-core-miner-drill'].fast_replaceable_group = 'se-core-miner-drill'
local se = {
mod = 'space-exploration',
type = 'mining-drill',
name = 'se-core-miner-drill',
ref_name = 'se-core-miner-drill',
min = 2,
max = 3
}
for i = 2, settings.startup['PHI-MB-MACHINE'].value do
local miner_name = 'se-core-miner-drill-' .. i
main.EEE(se, i)
data.raw['mining-drill'][miner_name].minable.result = miner_name
data.raw['mining-drill'][miner_name].placeable_by.item = miner_name
data.raw['mining-drill'][miner_name].localised_name = {'phi-cl.combine', {'entity-name.se-core-miner-drill'}, tostring(i)}
data.raw['mining-drill'][miner_name].localised_description = {'entity-description.se-core-miner-drill'}
local item = table.deepcopy(data.raw['item']['se-core-miner-drill'])
item.name = 'se-core-miner-drill-' .. i
item.place_result = miner_name
item.order = 'zzzz-core-miner-drill-' .. i
item.icons = {{icon = '__space-exploration-graphics__/graphics/icons/core-miner.png', tint = mod_tint[i], icon_size = 64}}
item.icon = nil
item.icon_size = nil
item.localised_name = {'phi-cl.combine', {'entity-name.se-core-miner-drill'}, tostring(i)}
item.localised_description = {'entity-description.se-core-miner-drill'}
data:extend({item})
data:extend({{
type = 'recipe',
name = miner_name,
energy_required = 2,
enabled = false,
ingredients = (i > 2 and {{type = 'item', name = 'se-core-miner-drill-' .. (i - 1), amount = 1}, {type = 'item', name = 'se-core-miner-drill', amount = 1}}) or {{type = 'item', name = 'se-core-miner-drill', amount = 2}},
results = {{type = 'item', name = miner_name, amount = 1}},
localised_name = {'phi-cl.combine', {'entity-name.se-core-miner-drill'}, tostring(i)},
localised_description = {'entity-description.se-core-miner-drill'}
}})
data.raw['mining-drill'][miner_name].fast_replaceable_group = data.raw['mining-drill']['se-core-miner-drill'].fast_replaceable_group
table.insert(data.raw.technology['se-core-miner'].effects, {type='unlock-recipe', recipe=miner_name})
end
for i = 3, settings.startup['PHI-MB-MACHINE-TIER'].value + 1 do
data.raw['assembling-machine']['se-space-radiator-' .. i].localised_name = {'phi-cl.combine', {'entity-name.se-space-radiator'}, tostring(i)}
end
end
-11
View File
@@ -1,11 +0,0 @@
-- MBQ C 11 BASE ARMOR_EQUIPMENT
if settings.startup['PHI-MB-EQUIPMENT-SIZE'].value then
for _, e in pairs({'night-vision-equipment', 'energy-shield-equipment', 'battery-equipment', 'solar-panel-equipment', 'generator-equipment','active-defense-equipment', 'movement-bonus-equipment', 'roboport-equipment', 'belt-immunity-equipment', 'inventory-bonus-equipment'}) do
if data.raw[e] then
for _, v in pairs(data.raw[e]) do
v.shape = {width = 1, height = 1, type = 'full', points = {{0, 0}}}
end
end
end
end
+1 -3
View File
@@ -12,9 +12,7 @@
"base >= 2.0.0", "base >= 2.0.0",
"? space-age >= 2.0.0", "? space-age >= 2.0.0",
"? quality >= 2.0.0", "? quality >= 2.0.0",
"? elevated-rails >= 2.0.0", "? elevated-rails >= 2.0.0"
"? aai-industry >= 0.6.0",
"? space-exploration >= 0.7.0"
], ],
"quality_required": false, "quality_required": false,
"space_travel_required": false, "space_travel_required": false,
-9
View File
@@ -123,13 +123,4 @@ for _, force in pairs(game.forces) do
recipes['super-pump'].enabled = true recipes['super-pump'].enabled = true
recipes['super-pump'].reload() recipes['super-pump'].reload()
end end
if settings.startup['PHI-MB'].value and settings.startup['PHI-MB-MACHINE'].value and settings.startup['PHI-MB-MACHINE'].value > 1 and script.active_mods['space-exploration'] then
if technologies['se-core-miner'].researched then
for i = 2, settings.startup['PHI-MB-MACHINE'].value do
recipes['se-core-miner-drill-' .. i].enabled = true
recipes['se-core-miner-drill-' .. i].reload()
end
end
end
end end
+2 -2
View File
@@ -15,7 +15,7 @@ data:extend({
minimum_value = 1, minimum_value = 1,
maximum_value = 8, maximum_value = 8,
localised_name = {'phi-cl.setting-category-color', 'MBE', {'phi-cl.enable'}, {'mod-setting-name.PHI-MB-ENERGY'}}, localised_name = {'phi-cl.setting-category-color', 'MBE', {'phi-cl.enable'}, {'mod-setting-name.PHI-MB-ENERGY'}},
localised_description = {'', '[item=solar-panel]', {'phi-cl.setting-change-color', '\n[173] A172 C1'}}, localised_description = {'', '[item=solar-panel]', {'phi-cl.setting-change-color', '\n[159] A158 C1'}},
order = 'AA00' order = 'AA00'
}, { }, {
type = 'int-setting', type = 'int-setting',
@@ -35,7 +35,7 @@ data:extend({
minimum_value = 1, minimum_value = 1,
maximum_value = 3, maximum_value = 3,
localised_name = {'phi-cl.setting-category-color', 'MBM', {'phi-cl.enable'}, {'mod-setting-name.PHI-MB-MACHINE'}}, localised_name = {'phi-cl.setting-category-color', 'MBM', {'phi-cl.enable'}, {'mod-setting-name.PHI-MB-MACHINE'}},
localised_description = {'', '[item=assembling-machine-3]', {'phi-cl.setting-change-color', '\n[342] A342'}}, localised_description = {'', '[item=assembling-machine-3]', {'phi-cl.setting-change-color', '\n[150] A150'}},
order = 'AB00' order = 'AB00'
}, { }, {
type = 'int-setting', type = 'int-setting',