From e88efc2893d1ef4af4483e687cfc6bacf119d4e2 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Thu, 13 Apr 2023 00:57:55 +0900 Subject: [PATCH] Update --- PHI-EN/data.lua | 125 ++++++++++++- PHI-EN/info.json | 4 +- PHI-EN/main.lua | 124 ------------- PHI-EQ/data.lua | 255 ++++++++++++++++++++++++++- PHI-EQ/info.json | 4 +- PHI-EQ/main.lua | 254 --------------------------- PHI-MB/data.lua | 122 ++++++++++++- PHI-MB/info.json | 4 +- PHI-MB/main.lua | 121 ------------- PHI-MI/data.lua | 181 ++++++++++++++++++- PHI-MI/info.json | 4 +- PHI-MI/main.lua | 159 ----------------- PHI-MI/migrations/migrations.lua | 29 +++ PHI-RS/data.lua | 293 ++++++++++++++++++++++++++++++- PHI-RS/info.json | 2 +- PHI-RS/main.lua | 209 ---------------------- PHI-WE/data.lua | 1 - PHI-WE/main.lua | 0 PHI-XW/data.lua | 9 +- PHI-XW/info.json | 6 +- PHI-XW/main.lua | 8 - 21 files changed, 1020 insertions(+), 894 deletions(-) delete mode 100644 PHI-MI/main.lua create mode 100644 PHI-MI/migrations/migrations.lua delete mode 100644 PHI-RS/main.lua delete mode 100644 PHI-WE/main.lua delete mode 100644 PHI-XW/main.lua diff --git a/PHI-EN/data.lua b/PHI-EN/data.lua index f829ce9..680a3aa 100644 --- a/PHI-EN/data.lua +++ b/PHI-EN/data.lua @@ -1 +1,124 @@ -require("main") \ No newline at end of file +local alpha_order = {'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'} +local base_battery_energy = 5 +local base_battery_flow = 300 +local base_solar_energy = 60 +local graphics_location = '__PHI-EN__/graphics/' +local items = {'accumulator', 'solar-panel'} + +-- entity +local function EE(source, tier) + local item = table.deepcopy(data.raw[source][source]) + item.name = source .. '-mk' .. tier + item.minable.result = source .. '-mk' .. tier + item.max_health = 200 * (2 ^ (tier - 1)) + item.picture.layers[1].filename = graphics_location .. source .. '-e.png' + item.picture.layers[1].hr_version.filename = graphics_location .. source ..'-eh.png' + item.icon = graphics_location .. source .. '-i.png' + item.icon_size = 64 + item.icon_mipmaps = 4 + + if (source == 'accumulator') then + item.energy_source.buffer_capacity = (base_battery_energy * 4 ^ (tier - 1)) .. 'MJ' + item.energy_source.input_flow_limit = (base_battery_flow * (4 ^ (tier - 1))) .. 'kW' + item.energy_source.output_flow_limit = (base_battery_flow * (4 ^ (tier - 1))) .. 'kW' + item.charge_animation.layers[1].layers[1].filename = item.picture.layers[1].filename + item.charge_animation.layers[1].layers[1].tint = {r = 1, g = 1, b = 1, a = 1} + item.charge_animation.layers[1].layers[1].hr_version.filename = item.picture.layers[1].hr_version.filename + item.charge_animation.layers[1].layers[1].hr_version.tint = {r = 1, g = 1, b = 1, a = 1} + item.discharge_animation.layers[1].layers[1].filename = item.picture.layers[1].filename + item.discharge_animation.layers[1].layers[1].tint = {r = 1, g = 1, b = 1, a = 1} + item.discharge_animation.layers[1].layers[1].hr_version.filename = item.picture.layers[1].hr_version.filename + item.discharge_animation.layers[1].layers[1].hr_version.tint = {r = 1, g = 1, b = 1, a = 1} + else + item.production = (base_solar_energy * (4 ^ (tier - 1))) .. 'kW' + end + + if (tier <= 7) then + item.next_upgrade = source .. '-mk' .. (tier + 1) + end + + data:extend({item}) +end + +-- item +local function EI(source, tier) + local item = table.deepcopy(data.raw.item[source]) + item.name = source .. '-mk' .. tier + item.place_result = source .. '-mk' .. tier + item.max_health = 200 * (2 ^ (tier - 1)) + item.subgroup = 'energy' + item.stack_size = 50 + item.default_request_amount = 50 + item.icons = {{icon = graphics_location .. source .. '-i.png', icon_mipmaps = 4, icon_size = 64}} + + if (source == 'accumulator') then + item.order = 'd[' .. source .. ']-a' .. tier .. '[' .. source .. '-mk' .. tier .. ']' + else + item.order = 'e[' .. source .. ']-a' .. tier .. '[' .. source .. '-mk' .. tier .. ']' + end + + data:extend({item}) +end + +-- recipe +local function ER(source, tier) + local na = source + + if (tier >= 3) then + na = na .. '-mk' .. (tier - 1) + end + + data:extend({{ + type = 'recipe', + name = source .. '-mk' .. tier, + energy_required = 2, + enabled = false, + ingredients = {{na, 4}}, + result = source .. '-mk' .. tier, + }}) +end + +-- technology +local function ET(tier) + if (tier == 2) then + local prereq = {'solar-energy', 'advanced-electronics', 'electric-energy-accumulators'} + else + local prereq = {'compound-energy-' .. (tier - 2)} + end + + data:extend({{ + type = 'technology', + name = 'compound-energy-' .. (tier - 1), + icon_size = 256, + icon = graphics_location .. 'solar-energy' .. '-t.png', + effects = { + { + type = 'unlock-recipe', + recipe = 'solar-panel-mk' .. tier + }, + { + type = 'unlock-recipe', + recipe = 'accumulator-mk' .. tier + } + }, + prerequisites = prereq, + unit = { + count = 200 * (2 ^ (tier - 1)), + ingredients = { + {'automation-science-pack', 1}, + {'logistic-science-pack', 1} + }, + time = 60 + }, + order = 'a-h-' .. alpha_order[tier + 1] + }}) +end + +for i=1, 2, 1 do + for j=2, 8, 1 do + EE(items[i], j) + EI(items[i], j) + ER(items[i], j) + ET(j) + end +end diff --git a/PHI-EN/info.json b/PHI-EN/info.json index 6082356..a61bfc8 100644 --- a/PHI-EN/info.json +++ b/PHI-EN/info.json @@ -1,8 +1,8 @@ { "name": "PHI-EN", - "version": "1.1.4", + "version": "1.1.5", "factorio_version": "1.1", - "date": "2023-04-04", + "date": "2023-04-13", "title": "Phidias Energy", "author": "PHIDIAS0303", "contributers": "", diff --git a/PHI-EN/main.lua b/PHI-EN/main.lua index 680a3aa..e69de29 100644 --- a/PHI-EN/main.lua +++ b/PHI-EN/main.lua @@ -1,124 +0,0 @@ -local alpha_order = {'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'} -local base_battery_energy = 5 -local base_battery_flow = 300 -local base_solar_energy = 60 -local graphics_location = '__PHI-EN__/graphics/' -local items = {'accumulator', 'solar-panel'} - --- entity -local function EE(source, tier) - local item = table.deepcopy(data.raw[source][source]) - item.name = source .. '-mk' .. tier - item.minable.result = source .. '-mk' .. tier - item.max_health = 200 * (2 ^ (tier - 1)) - item.picture.layers[1].filename = graphics_location .. source .. '-e.png' - item.picture.layers[1].hr_version.filename = graphics_location .. source ..'-eh.png' - item.icon = graphics_location .. source .. '-i.png' - item.icon_size = 64 - item.icon_mipmaps = 4 - - if (source == 'accumulator') then - item.energy_source.buffer_capacity = (base_battery_energy * 4 ^ (tier - 1)) .. 'MJ' - item.energy_source.input_flow_limit = (base_battery_flow * (4 ^ (tier - 1))) .. 'kW' - item.energy_source.output_flow_limit = (base_battery_flow * (4 ^ (tier - 1))) .. 'kW' - item.charge_animation.layers[1].layers[1].filename = item.picture.layers[1].filename - item.charge_animation.layers[1].layers[1].tint = {r = 1, g = 1, b = 1, a = 1} - item.charge_animation.layers[1].layers[1].hr_version.filename = item.picture.layers[1].hr_version.filename - item.charge_animation.layers[1].layers[1].hr_version.tint = {r = 1, g = 1, b = 1, a = 1} - item.discharge_animation.layers[1].layers[1].filename = item.picture.layers[1].filename - item.discharge_animation.layers[1].layers[1].tint = {r = 1, g = 1, b = 1, a = 1} - item.discharge_animation.layers[1].layers[1].hr_version.filename = item.picture.layers[1].hr_version.filename - item.discharge_animation.layers[1].layers[1].hr_version.tint = {r = 1, g = 1, b = 1, a = 1} - else - item.production = (base_solar_energy * (4 ^ (tier - 1))) .. 'kW' - end - - if (tier <= 7) then - item.next_upgrade = source .. '-mk' .. (tier + 1) - end - - data:extend({item}) -end - --- item -local function EI(source, tier) - local item = table.deepcopy(data.raw.item[source]) - item.name = source .. '-mk' .. tier - item.place_result = source .. '-mk' .. tier - item.max_health = 200 * (2 ^ (tier - 1)) - item.subgroup = 'energy' - item.stack_size = 50 - item.default_request_amount = 50 - item.icons = {{icon = graphics_location .. source .. '-i.png', icon_mipmaps = 4, icon_size = 64}} - - if (source == 'accumulator') then - item.order = 'd[' .. source .. ']-a' .. tier .. '[' .. source .. '-mk' .. tier .. ']' - else - item.order = 'e[' .. source .. ']-a' .. tier .. '[' .. source .. '-mk' .. tier .. ']' - end - - data:extend({item}) -end - --- recipe -local function ER(source, tier) - local na = source - - if (tier >= 3) then - na = na .. '-mk' .. (tier - 1) - end - - data:extend({{ - type = 'recipe', - name = source .. '-mk' .. tier, - energy_required = 2, - enabled = false, - ingredients = {{na, 4}}, - result = source .. '-mk' .. tier, - }}) -end - --- technology -local function ET(tier) - if (tier == 2) then - local prereq = {'solar-energy', 'advanced-electronics', 'electric-energy-accumulators'} - else - local prereq = {'compound-energy-' .. (tier - 2)} - end - - data:extend({{ - type = 'technology', - name = 'compound-energy-' .. (tier - 1), - icon_size = 256, - icon = graphics_location .. 'solar-energy' .. '-t.png', - effects = { - { - type = 'unlock-recipe', - recipe = 'solar-panel-mk' .. tier - }, - { - type = 'unlock-recipe', - recipe = 'accumulator-mk' .. tier - } - }, - prerequisites = prereq, - unit = { - count = 200 * (2 ^ (tier - 1)), - ingredients = { - {'automation-science-pack', 1}, - {'logistic-science-pack', 1} - }, - time = 60 - }, - order = 'a-h-' .. alpha_order[tier + 1] - }}) -end - -for i=1, 2, 1 do - for j=2, 8, 1 do - EE(items[i], j) - EI(items[i], j) - ER(items[i], j) - ET(j) - end -end diff --git a/PHI-EQ/data.lua b/PHI-EQ/data.lua index f829ce9..b378e28 100644 --- a/PHI-EQ/data.lua +++ b/PHI-EQ/data.lua @@ -1 +1,254 @@ -require("main") \ No newline at end of file +local alpha_order = {'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'} +local graphics_location = '__PHI-EQ__/graphics/' +local items = {'solar-panel', 'fusion-reactor', 'personal-laser-defense', 'battery', 'energy-shield', 'personal-roboport', 'night-vision', 'exoskeleton'} + +-- equipment +local function EE(source, tier) + local item = {} + item['name'] = source .. '-mk' .. tier .. '-equipment' + item['categories'] = {'armor'} + local w = 1 + local h = 1 + + if (source == 'solar-panel') then + item['type'] = 'solar-panel-equipment' + item['power'] = (30 * (2 ^ (tier - 1))) .. 'kW' + item['energy_source'] = {type = 'electric', usage_priority = 'primary-output'} + elseif (source == 'battery') then + h = 2 + item['type'] = 'battery-equipment' + item['energy_source'] = {type = 'electric', usage_priority = 'tertiary', buffer_capacity= (100 * (2 ^ (tier - 2))) .. 'MJ'} + elseif (source == 'fusion-reactor') then + w = 4 + h = 4 + item['type'] = 'generator-equipment' + item['power'] = (750 * (2 ^ (tier - 1))) .. 'kW' + item['energy_source'] = {type = 'electric', usage_priority = 'primary-output'} + elseif (source == 'personal-laser-defense') then + w = 2 + h = 2 + item['type'] = 'active-defense-equipment' + item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = (250 * (2 ^ (tier - 1))) .. 'kJ'} + -- item['source_direction_count'] = 64 + -- item['source_offset'] = {0, -3.423489 / 4} + item['attack_parameters'] = {type = 'beam', cooldown = 60, range = (18 + tier), damage_modifier = (3 * (2 ^ (tier - 1))), ammo_type = {category = 'laser', energy_consumption = (50 * (2 ^ (tier - 1))) .. 'kJ', action = {type = 'direct', action_delivery = {type = 'beam', beam = 'laser-beam', max_length = (18 + tier), duration = 60, source_offset = {0, -1.31439}}}}} + item['automatic'] = true + elseif (source == 'energy-shield') then + w = 2 + h = 2 + item['type'] = 'energy-shield-equipment' + item['energy_source'] = {type = 'electric', usage_priority = 'primary-input', input_flow_limit = (1000 * (2 ^ (tier - 1))) .. 'kW', buffer_capacity = (480 * (2 ^ (tier - 1))) .. 'kJ'} + item['max_shield_value'] = (150 * (2 ^ (tier - 2))) + item['energy_per_shield'] = '80kJ' + elseif (source == 'personal-roboport') then + w = 2 + h = 2 + item['type'] = 'roboport-equipment' + item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = (80 * (2 ^ (tier - 1))) .. 'MJ'} + item['robot_limit'] = 50 + item['construction_radius'] = 32 + item['spawn_and_station_height'] = 0.4 + item['spawn_and_station_shadow_height_offset'] = 0.5 + item['charge_approach_distance'] = 2.6 + item['robots_shrink_when_entering_and_exiting'] = true + item['recharging_animation'] = {filename = '__base__/graphics/entity/roboport/roboport-recharging.png', draw_as_glow = true, priority = 'high', width = 37, height = 35, frame_count = 16, scale = 1.5, animation_speed = 0.5} + item['recharging_light'] = {intensity = 0.2, size = 3, color = {r = 0.5, g = 0.5, b = 1.0}} + item['stationing_offset'] = {0, -0.6} + item['charging_station_shift'] = {0, 0.5} + item['charging_station_count'] = 16 + item['charging_energy'] = (0.5 * (2 ^ (tier - 2))) .. 'MW' + item['charging_distance'] = 1.6 + item['charging_threshold_distance'] = 5 + elseif (source == 'night-vision') then + w = 2 + h = 2 + item['type'] = 'night-vision-equipment' + item['energy_source'] = {type = 'electric', usage_priority = 'primary-input', buffer_capacity = '1MJ'} + item['energy_input'] = '20kW' + item['activate_sound'] = {filename = '__base__/sound/nightvision-on.ogg', volume = 0.5} + item['deactivate_sound'] = {filename = '__base__/sound/nightvision-off.ogg', volume = 0.5} + item['darkness_to_turn_on'] = 1 + item['color_lookup'] = {{0, '__core__/graphics/color_luts/lut-sunset.png'}} + elseif (source == 'exoskeleton') then + w = 2 + h = 4 + item['type'] = 'movement-bonus-equipment' + item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = '10MJ'} + item['energy_consumption'] = '400kW' + item['movement_bonus'] = 0.6 + end + + item['shape'] = {width = w, height = h, type = 'full'} + item['sprite'] = {filename = graphics_location .. source .. '-equipment-e.png', width = w * 32, height = h * 32, priority = 'medium', hr_version = {filename = graphics_location .. source .. '-equipment-eh.png', width = w * 64, height = h *64, priority = 'medium', scale = 0.5}} + data:extend({item}) +end + +-- item +local function EI(source, tier) + local item = table.deepcopy(data.raw.item[source .. '-equipment']) + item.name = source .. '-mk' .. tier .. '-equipment' + item.placed_as_equipment_result = source .. '-mk' .. tier .. '-equipment' + item.subgroup = 'equipment' + item.stack_size = 20 + item.default_request_amount = 5 + item.icons = {{icon = graphics_location .. source .. '-equipment-i.png', icon_mipmaps = 4, icon_size = 64}} + + if (source == 'solar-panel') then + item.order = 'a[energy-source]-a' .. alpha_order[tier - 1] .. '[' .. source .. '-mk' .. tier .. ']' + elseif (source == 'battery') then + item.order = 'b[battery]-b' .. alpha_order[tier] .. '[' .. source .. 'equipment-mk' .. tier .. ']' + elseif (source == 'fusion-reactor') then + item.order = 'a[energy-source]-b' .. alpha_order[tier - 1] .. '[' .. source .. '-mk' .. tier .. ']' + elseif (source == 'personal-laser-defense') then + item.order = 'd[active-defense]-b' .. alpha_order[tier - 1] .. '[' .. source .. '-mk' .. tier .. ']' + elseif (source == 'energy-shield') then + item.order = 'b[shield]-c' .. alpha_order[tier - 1] .. '[' .. source .. '-equipment-mk' .. tier .. ']' + elseif (source == 'personal-roboport') then + item.order = 'e[robotics]-b' .. alpha_order[tier - 1] .. '[' .. source .. '-mk' .. tier .. '-equipment]' + elseif (source == 'night-vision') then + item.order = 'f[night-vision]-a' .. alpha_order[tier - 1] .. '[' .. source .. '-mk' .. tier .. ']' + elseif (source == 'exoskeleton') then + item.order = 'd[exoskeleton]-a' .. alpha_order[tier - 1] .. '[' .. source .. 'equipment-mk' .. tier .. ']' + end + + data:extend({item}) +end + +-- recipe +local function ER(source, tier) + na = source + + if (tier == 2) then + na = source .. '-equipment' + elseif (tier >= 3) then + na = source .. '-mk' .. (tier - 1) .. '-equipment' + end + + data:extend({{ + type = 'recipe', + name = source .. '-mk' .. tier .. '-equipment', + energy_required = 2, + enabled = false, + ingredients = {{na, 2}}, + result = source .. '-mk' .. tier .. '-equipment', + }}) +end + +for _, animation in ipairs(data.raw['character']['character']['animations']) do + if animation.armors then + for _, armor in ipairs(animation.armors) do + if armor == 'power-armor-mk2' then + animation.armors[#animation.armors + 1] = 'power-armor-mk3' + break + end + end + end +end + +data:extend({ + { + type = 'equipment-grid', + name = 'equipment-grid-14x14', + width = 14, + height = 14, + equipment_categories = {'armor'} + }, + { + type = 'armor', + name = 'power-armor-mk3', + icon = '__base__/graphics/icons/power-armor-mk2.png', + icon_size = 64, icon_mipmaps = 4, + resistances = {{type = 'physical', decrease = 20, percent = 50}, {type = 'acid', decrease = 20, percent = 80}, + {type = 'explosion', decrease = 70, percent = 60}, {type = 'fire', decrease = 20, percent = 80}, + {type = 'laser', decrease = 20, percent = 50}, {type = 'electric', decrease = 20, percent = 50}, + {type = 'impact', decrease = 20, percent = 50}, {type = 'poison', decrease = 20, percent = 50}}, + subgroup = 'armor', + order = 'eb[power-armor-mk3]', + stack_size = 1, + infinite = true, + equipment_grid = 'equipment-grid-14x14', + inventory_size_bonus = 40, + open_sound = {filename = '__base__/sound/armor-open.ogg', volume = 1}, + close_sound = {filename = '__base__/sound/armor-close.ogg', volume = 1} + } +}) + +data:extend({{ + type = 'recipe', + name = 'power-armor-mk3', + energy_required = 5, + enabled = 'false', + ingredients = {{'power-armor-mk2', 2}}, + result = 'power-armor-mk3' +}}) + +for i=1, 8, 1 do + if (i <= 3) then + for j=2, 8, 1 do + EE(items[i], j) + EI(items[i], j) + ER(items[i], j) + end + elseif (i <= 6) then + for j=3, 8, 1 do + EE(items[i], j) + EI(items[i], j) + ER(items[i], j) + end + elseif (i <= 8) then + EE(items[i], 2) + EI(items[i], 2) + ER(items[i], 2) + end +end + +table.insert(data.raw.technology['power-armor-mk2'].effects, {type='unlock-recipe', recipe='power-armor-mk3'}) + +table.insert(data.raw.technology['night-vision-equipment'].effects, {type='unlock-recipe', recipe='night-vision-mk2-equipment'}) + +table.insert(data.raw.technology['exoskeleton-equipment'].effects, {type='unlock-recipe', recipe='exoskeleton-mk2-equipment'}) + +table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk2-equipment'}) +table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk3-equipment'}) +table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk4-equipment'}) +table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk5-equipment'}) +table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk6-equipment'}) +table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk7-equipment'}) +table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk8-equipment'}) + +table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk2-equipment'}) +table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk3-equipment'}) +table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk4-equipment'}) +table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk5-equipment'}) +table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk6-equipment'}) +table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk7-equipment'}) +table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk8-equipment'}) + +table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk3-equipment'}) +table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk4-equipment'}) +table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk5-equipment'}) +table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk6-equipment'}) +table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk7-equipment'}) +table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk8-equipment'}) + +table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk2-equipment'}) +table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk3-equipment'}) +table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk4-equipment'}) +table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk5-equipment'}) +table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk6-equipment'}) +table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk7-equipment'}) +table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk8-equipment'}) + +table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk3-equipment'}) +table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk4-equipment'}) +table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk5-equipment'}) +table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk6-equipment'}) +table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk7-equipment'}) +table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk8-equipment'}) + +table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk3-equipment'}) +table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk4-equipment'}) +table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk5-equipment'}) +table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk6-equipment'}) +table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk7-equipment'}) +table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk8-equipment'}) diff --git a/PHI-EQ/info.json b/PHI-EQ/info.json index e264064..e2c9b7f 100644 --- a/PHI-EQ/info.json +++ b/PHI-EQ/info.json @@ -1,8 +1,8 @@ { "name": "PHI-EQ", - "version": "1.1.5", + "version": "1.1.6", "factorio_version": "1.1", - "date": "2023-03-20", + "date": "2023-04-13", "title": "Phidias Equipment", "author": "PHIDIAS0303", "contributers": "", diff --git a/PHI-EQ/main.lua b/PHI-EQ/main.lua index b378e28..e69de29 100644 --- a/PHI-EQ/main.lua +++ b/PHI-EQ/main.lua @@ -1,254 +0,0 @@ -local alpha_order = {'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'} -local graphics_location = '__PHI-EQ__/graphics/' -local items = {'solar-panel', 'fusion-reactor', 'personal-laser-defense', 'battery', 'energy-shield', 'personal-roboport', 'night-vision', 'exoskeleton'} - --- equipment -local function EE(source, tier) - local item = {} - item['name'] = source .. '-mk' .. tier .. '-equipment' - item['categories'] = {'armor'} - local w = 1 - local h = 1 - - if (source == 'solar-panel') then - item['type'] = 'solar-panel-equipment' - item['power'] = (30 * (2 ^ (tier - 1))) .. 'kW' - item['energy_source'] = {type = 'electric', usage_priority = 'primary-output'} - elseif (source == 'battery') then - h = 2 - item['type'] = 'battery-equipment' - item['energy_source'] = {type = 'electric', usage_priority = 'tertiary', buffer_capacity= (100 * (2 ^ (tier - 2))) .. 'MJ'} - elseif (source == 'fusion-reactor') then - w = 4 - h = 4 - item['type'] = 'generator-equipment' - item['power'] = (750 * (2 ^ (tier - 1))) .. 'kW' - item['energy_source'] = {type = 'electric', usage_priority = 'primary-output'} - elseif (source == 'personal-laser-defense') then - w = 2 - h = 2 - item['type'] = 'active-defense-equipment' - item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = (250 * (2 ^ (tier - 1))) .. 'kJ'} - -- item['source_direction_count'] = 64 - -- item['source_offset'] = {0, -3.423489 / 4} - item['attack_parameters'] = {type = 'beam', cooldown = 60, range = (18 + tier), damage_modifier = (3 * (2 ^ (tier - 1))), ammo_type = {category = 'laser', energy_consumption = (50 * (2 ^ (tier - 1))) .. 'kJ', action = {type = 'direct', action_delivery = {type = 'beam', beam = 'laser-beam', max_length = (18 + tier), duration = 60, source_offset = {0, -1.31439}}}}} - item['automatic'] = true - elseif (source == 'energy-shield') then - w = 2 - h = 2 - item['type'] = 'energy-shield-equipment' - item['energy_source'] = {type = 'electric', usage_priority = 'primary-input', input_flow_limit = (1000 * (2 ^ (tier - 1))) .. 'kW', buffer_capacity = (480 * (2 ^ (tier - 1))) .. 'kJ'} - item['max_shield_value'] = (150 * (2 ^ (tier - 2))) - item['energy_per_shield'] = '80kJ' - elseif (source == 'personal-roboport') then - w = 2 - h = 2 - item['type'] = 'roboport-equipment' - item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = (80 * (2 ^ (tier - 1))) .. 'MJ'} - item['robot_limit'] = 50 - item['construction_radius'] = 32 - item['spawn_and_station_height'] = 0.4 - item['spawn_and_station_shadow_height_offset'] = 0.5 - item['charge_approach_distance'] = 2.6 - item['robots_shrink_when_entering_and_exiting'] = true - item['recharging_animation'] = {filename = '__base__/graphics/entity/roboport/roboport-recharging.png', draw_as_glow = true, priority = 'high', width = 37, height = 35, frame_count = 16, scale = 1.5, animation_speed = 0.5} - item['recharging_light'] = {intensity = 0.2, size = 3, color = {r = 0.5, g = 0.5, b = 1.0}} - item['stationing_offset'] = {0, -0.6} - item['charging_station_shift'] = {0, 0.5} - item['charging_station_count'] = 16 - item['charging_energy'] = (0.5 * (2 ^ (tier - 2))) .. 'MW' - item['charging_distance'] = 1.6 - item['charging_threshold_distance'] = 5 - elseif (source == 'night-vision') then - w = 2 - h = 2 - item['type'] = 'night-vision-equipment' - item['energy_source'] = {type = 'electric', usage_priority = 'primary-input', buffer_capacity = '1MJ'} - item['energy_input'] = '20kW' - item['activate_sound'] = {filename = '__base__/sound/nightvision-on.ogg', volume = 0.5} - item['deactivate_sound'] = {filename = '__base__/sound/nightvision-off.ogg', volume = 0.5} - item['darkness_to_turn_on'] = 1 - item['color_lookup'] = {{0, '__core__/graphics/color_luts/lut-sunset.png'}} - elseif (source == 'exoskeleton') then - w = 2 - h = 4 - item['type'] = 'movement-bonus-equipment' - item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = '10MJ'} - item['energy_consumption'] = '400kW' - item['movement_bonus'] = 0.6 - end - - item['shape'] = {width = w, height = h, type = 'full'} - item['sprite'] = {filename = graphics_location .. source .. '-equipment-e.png', width = w * 32, height = h * 32, priority = 'medium', hr_version = {filename = graphics_location .. source .. '-equipment-eh.png', width = w * 64, height = h *64, priority = 'medium', scale = 0.5}} - data:extend({item}) -end - --- item -local function EI(source, tier) - local item = table.deepcopy(data.raw.item[source .. '-equipment']) - item.name = source .. '-mk' .. tier .. '-equipment' - item.placed_as_equipment_result = source .. '-mk' .. tier .. '-equipment' - item.subgroup = 'equipment' - item.stack_size = 20 - item.default_request_amount = 5 - item.icons = {{icon = graphics_location .. source .. '-equipment-i.png', icon_mipmaps = 4, icon_size = 64}} - - if (source == 'solar-panel') then - item.order = 'a[energy-source]-a' .. alpha_order[tier - 1] .. '[' .. source .. '-mk' .. tier .. ']' - elseif (source == 'battery') then - item.order = 'b[battery]-b' .. alpha_order[tier] .. '[' .. source .. 'equipment-mk' .. tier .. ']' - elseif (source == 'fusion-reactor') then - item.order = 'a[energy-source]-b' .. alpha_order[tier - 1] .. '[' .. source .. '-mk' .. tier .. ']' - elseif (source == 'personal-laser-defense') then - item.order = 'd[active-defense]-b' .. alpha_order[tier - 1] .. '[' .. source .. '-mk' .. tier .. ']' - elseif (source == 'energy-shield') then - item.order = 'b[shield]-c' .. alpha_order[tier - 1] .. '[' .. source .. '-equipment-mk' .. tier .. ']' - elseif (source == 'personal-roboport') then - item.order = 'e[robotics]-b' .. alpha_order[tier - 1] .. '[' .. source .. '-mk' .. tier .. '-equipment]' - elseif (source == 'night-vision') then - item.order = 'f[night-vision]-a' .. alpha_order[tier - 1] .. '[' .. source .. '-mk' .. tier .. ']' - elseif (source == 'exoskeleton') then - item.order = 'd[exoskeleton]-a' .. alpha_order[tier - 1] .. '[' .. source .. 'equipment-mk' .. tier .. ']' - end - - data:extend({item}) -end - --- recipe -local function ER(source, tier) - na = source - - if (tier == 2) then - na = source .. '-equipment' - elseif (tier >= 3) then - na = source .. '-mk' .. (tier - 1) .. '-equipment' - end - - data:extend({{ - type = 'recipe', - name = source .. '-mk' .. tier .. '-equipment', - energy_required = 2, - enabled = false, - ingredients = {{na, 2}}, - result = source .. '-mk' .. tier .. '-equipment', - }}) -end - -for _, animation in ipairs(data.raw['character']['character']['animations']) do - if animation.armors then - for _, armor in ipairs(animation.armors) do - if armor == 'power-armor-mk2' then - animation.armors[#animation.armors + 1] = 'power-armor-mk3' - break - end - end - end -end - -data:extend({ - { - type = 'equipment-grid', - name = 'equipment-grid-14x14', - width = 14, - height = 14, - equipment_categories = {'armor'} - }, - { - type = 'armor', - name = 'power-armor-mk3', - icon = '__base__/graphics/icons/power-armor-mk2.png', - icon_size = 64, icon_mipmaps = 4, - resistances = {{type = 'physical', decrease = 20, percent = 50}, {type = 'acid', decrease = 20, percent = 80}, - {type = 'explosion', decrease = 70, percent = 60}, {type = 'fire', decrease = 20, percent = 80}, - {type = 'laser', decrease = 20, percent = 50}, {type = 'electric', decrease = 20, percent = 50}, - {type = 'impact', decrease = 20, percent = 50}, {type = 'poison', decrease = 20, percent = 50}}, - subgroup = 'armor', - order = 'eb[power-armor-mk3]', - stack_size = 1, - infinite = true, - equipment_grid = 'equipment-grid-14x14', - inventory_size_bonus = 40, - open_sound = {filename = '__base__/sound/armor-open.ogg', volume = 1}, - close_sound = {filename = '__base__/sound/armor-close.ogg', volume = 1} - } -}) - -data:extend({{ - type = 'recipe', - name = 'power-armor-mk3', - energy_required = 5, - enabled = 'false', - ingredients = {{'power-armor-mk2', 2}}, - result = 'power-armor-mk3' -}}) - -for i=1, 8, 1 do - if (i <= 3) then - for j=2, 8, 1 do - EE(items[i], j) - EI(items[i], j) - ER(items[i], j) - end - elseif (i <= 6) then - for j=3, 8, 1 do - EE(items[i], j) - EI(items[i], j) - ER(items[i], j) - end - elseif (i <= 8) then - EE(items[i], 2) - EI(items[i], 2) - ER(items[i], 2) - end -end - -table.insert(data.raw.technology['power-armor-mk2'].effects, {type='unlock-recipe', recipe='power-armor-mk3'}) - -table.insert(data.raw.technology['night-vision-equipment'].effects, {type='unlock-recipe', recipe='night-vision-mk2-equipment'}) - -table.insert(data.raw.technology['exoskeleton-equipment'].effects, {type='unlock-recipe', recipe='exoskeleton-mk2-equipment'}) - -table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk2-equipment'}) -table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk3-equipment'}) -table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk4-equipment'}) -table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk5-equipment'}) -table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk6-equipment'}) -table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk7-equipment'}) -table.insert(data.raw.technology['solar-panel-equipment'].effects, {type='unlock-recipe', recipe='solar-panel-mk8-equipment'}) - -table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk2-equipment'}) -table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk3-equipment'}) -table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk4-equipment'}) -table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk5-equipment'}) -table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk6-equipment'}) -table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk7-equipment'}) -table.insert(data.raw.technology['fusion-reactor-equipment'].effects, {type='unlock-recipe', recipe='fusion-reactor-mk8-equipment'}) - -table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk3-equipment'}) -table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk4-equipment'}) -table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk5-equipment'}) -table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk6-equipment'}) -table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk7-equipment'}) -table.insert(data.raw.technology['battery-mk2-equipment'].effects, {type='unlock-recipe', recipe='battery-mk8-equipment'}) - -table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk2-equipment'}) -table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk3-equipment'}) -table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk4-equipment'}) -table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk5-equipment'}) -table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk6-equipment'}) -table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk7-equipment'}) -table.insert(data.raw.technology['personal-laser-defense-equipment'].effects, {type='unlock-recipe', recipe='personal-laser-defense-mk8-equipment'}) - -table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk3-equipment'}) -table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk4-equipment'}) -table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk5-equipment'}) -table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk6-equipment'}) -table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk7-equipment'}) -table.insert(data.raw.technology['energy-shield-mk2-equipment'].effects, {type='unlock-recipe', recipe='energy-shield-mk8-equipment'}) - -table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk3-equipment'}) -table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk4-equipment'}) -table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk5-equipment'}) -table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk6-equipment'}) -table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk7-equipment'}) -table.insert(data.raw.technology['personal-roboport-mk2-equipment'].effects, {type='unlock-recipe', recipe='personal-roboport-mk8-equipment'}) diff --git a/PHI-MB/data.lua b/PHI-MB/data.lua index f829ce9..d1b8905 100644 --- a/PHI-MB/data.lua +++ b/PHI-MB/data.lua @@ -1 +1,121 @@ -require("main") \ No newline at end of file +local alpha_order = {'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'} +local graphics_location = '__PHI-MB__/graphics/' + +local items = {'assembling-machine', 'electric-furnace', 'oil-refinery', 'chemical-plant', 'centrifuge', 'lab'} + +local item_min = { + ['assembling-machine'] = 4, + ['electric-furnace'] = 2, + ['oil-refinery'] = 2, + ['chemical-plant'] = 2, + ['centrifuge'] = 2, + ['lab'] = 2 +} + +local item_max = { + ['assembling-machine'] = 5, + ['electric-furnace'] = 3, + ['oil-refinery'] = 3, + ['chemical-plant'] = 3, + ['centrifuge'] = 3, + ['lab'] = 3 +} + +-- entity +local function EE(source, tier) + local item + + if source == 'assembling-machine' then + item = table.deepcopy(data.raw['assembling-machine']['assembling-machine-3']) + elseif source == 'electric-furnace' then + item = table.deepcopy(data.raw['furnace']['electric-furnace']) + elseif source == 'lab' then + item = table.deepcopy(data.raw['lab']['lab']) + else + item = table.deepcopy(data.raw['assembling-machine'][source]) + end + + item.name = source .. '-' .. tier + item.minable.result = source .. '-' .. tier + item.max_health = item.max_health * (2 ^ (tier - item_min[source] + 1)) + + if source == 'lab' then + item.researching_speed = item.researching_speed * (2 ^ (tier - item_min[source] + 1)) + else + item.crafting_speed = item.crafting_speed * (2 ^ (tier - item_min[source] + 1)) + item.energy_source.emissions_per_minute = item.energy_source.emissions_per_minute * (2 ^ (tier - item_min[source] + 1)) + end + + item.energy_usage = tonumber(string.match(item.energy_usage, '%d+')) * (2 ^ (tier - item_min[source] + 1)) .. 'kW' + -- item.animation.layers[1].filename = graphics_location .. source .. '-e.png' + -- item.animation.layers[1].hr_version.filename = graphics_location .. source ..'-eh.png' + -- item.icon = graphics_location .. source .. '-i.png' + -- item.icon_size = 64 + -- item.icon_mipmaps = 4 + + if (tier <= item_max[source] - 1) then + item.next_upgrade = source .. '-' .. (tier + 1) + end + + data:extend({item}) +end + +-- item +local function EI(source, tier) + local item + + if source == 'assembling-machine' then + item = table.deepcopy(data.raw.item['assembling-machine-3']) + else + item = table.deepcopy(data.raw.item[source]) + end + + item.name = source .. '-' .. tier + item.place_result = source .. '-' .. tier + -- item.icons = {{icon = graphics_location .. source .. '-i.png', icon_mipmaps = 4, icon_size = 64}} + item.order = item.order .. tier + data:extend({item}) +end + +-- recipe +local function ER(source, tier) + local na = source + + if (tier >= 3) then + na = na .. '-' .. (tier - 1) + end + + data:extend({{ + type = 'recipe', + name = source .. '-' .. tier, + energy_required = 2, + enabled = false, + ingredients = {{na, 2}}, + result = source .. '-' .. tier, + }}) +end + +for i=1, #items, 1 do + for j=item_min[items[i]], item_max[items[i]], 1 do + EE(items[i], j) + EI(items[i], j) + ER(items[i], j) + end +end + +table.insert(data.raw.technology['automation-3'].effects, {type='unlock-recipe', recipe='assembling-machine-4'}) +table.insert(data.raw.technology['automation-3'].effects, {type='unlock-recipe', recipe='assembling-machine-5'}) + +table.insert(data.raw.technology['advanced-material-processing-2'].effects, {type='unlock-recipe', recipe='electric-furnace-2'}) +table.insert(data.raw.technology['advanced-material-processing-2'].effects, {type='unlock-recipe', recipe='electric-furnace-3'}) + +table.insert(data.raw.technology['oil-processing'].effects, {type='unlock-recipe', recipe='oil-refinery-2'}) +table.insert(data.raw.technology['oil-processing'].effects, {type='unlock-recipe', recipe='oil-refinery-3'}) +table.insert(data.raw.technology['oil-processing'].effects, {type='unlock-recipe', recipe='chemical-plant-2'}) +table.insert(data.raw.technology['oil-processing'].effects, {type='unlock-recipe', recipe='chemical-plant-3'}) + +table.insert(data.raw.technology['uranium-processing'].effects, {type='unlock-recipe', recipe='centrifuge-2'}) +table.insert(data.raw.technology['uranium-processing'].effects, {type='unlock-recipe', recipe='centrifuge-3'}) + +table.insert(data.raw.technology['automation'].effects, {type='unlock-recipe', recipe='lab-2'}) +table.insert(data.raw.technology['automation'].effects, {type='unlock-recipe', recipe='lab-3'}) diff --git a/PHI-MB/info.json b/PHI-MB/info.json index b3d33b8..914c0c7 100644 --- a/PHI-MB/info.json +++ b/PHI-MB/info.json @@ -1,8 +1,8 @@ { "name": "PHI-MB", - "version": "1.0.1", + "version": "1.0.2", "factorio_version": "1.1", - "date": "2023-04-10", + "date": "2023-04-13", "title": "Phidias Megabase", "author": "PHIDIAS0303", "contributers": "", diff --git a/PHI-MB/main.lua b/PHI-MB/main.lua index d1b8905..e69de29 100644 --- a/PHI-MB/main.lua +++ b/PHI-MB/main.lua @@ -1,121 +0,0 @@ -local alpha_order = {'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'} -local graphics_location = '__PHI-MB__/graphics/' - -local items = {'assembling-machine', 'electric-furnace', 'oil-refinery', 'chemical-plant', 'centrifuge', 'lab'} - -local item_min = { - ['assembling-machine'] = 4, - ['electric-furnace'] = 2, - ['oil-refinery'] = 2, - ['chemical-plant'] = 2, - ['centrifuge'] = 2, - ['lab'] = 2 -} - -local item_max = { - ['assembling-machine'] = 5, - ['electric-furnace'] = 3, - ['oil-refinery'] = 3, - ['chemical-plant'] = 3, - ['centrifuge'] = 3, - ['lab'] = 3 -} - --- entity -local function EE(source, tier) - local item - - if source == 'assembling-machine' then - item = table.deepcopy(data.raw['assembling-machine']['assembling-machine-3']) - elseif source == 'electric-furnace' then - item = table.deepcopy(data.raw['furnace']['electric-furnace']) - elseif source == 'lab' then - item = table.deepcopy(data.raw['lab']['lab']) - else - item = table.deepcopy(data.raw['assembling-machine'][source]) - end - - item.name = source .. '-' .. tier - item.minable.result = source .. '-' .. tier - item.max_health = item.max_health * (2 ^ (tier - item_min[source] + 1)) - - if source == 'lab' then - item.researching_speed = item.researching_speed * (2 ^ (tier - item_min[source] + 1)) - else - item.crafting_speed = item.crafting_speed * (2 ^ (tier - item_min[source] + 1)) - item.energy_source.emissions_per_minute = item.energy_source.emissions_per_minute * (2 ^ (tier - item_min[source] + 1)) - end - - item.energy_usage = tonumber(string.match(item.energy_usage, '%d+')) * (2 ^ (tier - item_min[source] + 1)) .. 'kW' - -- item.animation.layers[1].filename = graphics_location .. source .. '-e.png' - -- item.animation.layers[1].hr_version.filename = graphics_location .. source ..'-eh.png' - -- item.icon = graphics_location .. source .. '-i.png' - -- item.icon_size = 64 - -- item.icon_mipmaps = 4 - - if (tier <= item_max[source] - 1) then - item.next_upgrade = source .. '-' .. (tier + 1) - end - - data:extend({item}) -end - --- item -local function EI(source, tier) - local item - - if source == 'assembling-machine' then - item = table.deepcopy(data.raw.item['assembling-machine-3']) - else - item = table.deepcopy(data.raw.item[source]) - end - - item.name = source .. '-' .. tier - item.place_result = source .. '-' .. tier - -- item.icons = {{icon = graphics_location .. source .. '-i.png', icon_mipmaps = 4, icon_size = 64}} - item.order = item.order .. tier - data:extend({item}) -end - --- recipe -local function ER(source, tier) - local na = source - - if (tier >= 3) then - na = na .. '-' .. (tier - 1) - end - - data:extend({{ - type = 'recipe', - name = source .. '-' .. tier, - energy_required = 2, - enabled = false, - ingredients = {{na, 2}}, - result = source .. '-' .. tier, - }}) -end - -for i=1, #items, 1 do - for j=item_min[items[i]], item_max[items[i]], 1 do - EE(items[i], j) - EI(items[i], j) - ER(items[i], j) - end -end - -table.insert(data.raw.technology['automation-3'].effects, {type='unlock-recipe', recipe='assembling-machine-4'}) -table.insert(data.raw.technology['automation-3'].effects, {type='unlock-recipe', recipe='assembling-machine-5'}) - -table.insert(data.raw.technology['advanced-material-processing-2'].effects, {type='unlock-recipe', recipe='electric-furnace-2'}) -table.insert(data.raw.technology['advanced-material-processing-2'].effects, {type='unlock-recipe', recipe='electric-furnace-3'}) - -table.insert(data.raw.technology['oil-processing'].effects, {type='unlock-recipe', recipe='oil-refinery-2'}) -table.insert(data.raw.technology['oil-processing'].effects, {type='unlock-recipe', recipe='oil-refinery-3'}) -table.insert(data.raw.technology['oil-processing'].effects, {type='unlock-recipe', recipe='chemical-plant-2'}) -table.insert(data.raw.technology['oil-processing'].effects, {type='unlock-recipe', recipe='chemical-plant-3'}) - -table.insert(data.raw.technology['uranium-processing'].effects, {type='unlock-recipe', recipe='centrifuge-2'}) -table.insert(data.raw.technology['uranium-processing'].effects, {type='unlock-recipe', recipe='centrifuge-3'}) - -table.insert(data.raw.technology['automation'].effects, {type='unlock-recipe', recipe='lab-2'}) -table.insert(data.raw.technology['automation'].effects, {type='unlock-recipe', recipe='lab-3'}) diff --git a/PHI-MI/data.lua b/PHI-MI/data.lua index f829ce9..4a308e8 100644 --- a/PHI-MI/data.lua +++ b/PHI-MI/data.lua @@ -1 +1,180 @@ -require("main") \ No newline at end of file +local alpha_order = {'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'} +local graphics_location = '__PHI-MP__/graphics/' + +local ups_chests = { + 'steel-chest', + 'logistic-chest-passive-provider', + 'logistic-chest-active-provider', + 'logistic-chest-storage', + 'logistic-chest-buffer', + 'logistic-chest-requester' +} + +data.raw.recipe['loader'].hidden = false +data.raw.recipe['fast-loader'].hidden = false +data.raw.recipe['express-loader'].hidden = false + +data.raw.recipe['loader'].ingredients = { + {'iron-plate', 5}, + {'electronic-circuit', 5}, + {'transport-belt', 2}, + {'inserter', 2}, +} +data.raw.recipe['fast-loader'].ingredients = { + {'iron-gear-wheel', 10}, + {'electronic-circuit', 10}, + {'advanced-circuit', 1}, + {'loader', 1}, +} +data.raw.recipe['express-loader'].ingredients = { + {'iron-gear-wheel', 10}, + {'advanced-circuit', 10}, + {'fast-loader', 1}, + {type='fluid', name='lubricant', amount=40} +} + +table.insert(data.raw.technology['logistics'].effects, {type='unlock-recipe', recipe='loader'}) +table.insert(data.raw.technology['logistics-2'].effects, {type='unlock-recipe', recipe='fast-loader'}) +table.insert(data.raw.technology['logistics-3'].effects, {type='unlock-recipe', recipe='express-loader'}) + +data.raw.recipe['landfill'].ingredients = { + {'stone', 5} +} + +data.raw['module']['effectivity-module'].effect = {consumption = {bonus = -0.5}, pollution = {bonus = -0.1}} +data.raw['module']['effectivity-module-2'].effect = {consumption = {bonus = -1.0}, pollution = {bonus = -0.15}} +data.raw['module']['effectivity-module-3'].effect = {consumption = {bonus = -1.5}, pollution = {bonus = -0.2}} + +data.raw['pipe']['pipe'].fluid_box.base_area = 4 +data.raw['pipe-to-ground']['pipe-to-ground'].fluid_box.base_area = 4 +data.raw['pump']['pump'].fluid_box.height = 16 +data.raw['pump']['pump'].pumping_speed = 800 +data.raw['storage-tank']['storage-tank'].fluid_box.base_area = 500 + +data.raw['locomotive']['locomotive'].max_health = 2000 +data.raw['locomotive']['locomotive'].max_speed = 2 +data.raw['locomotive']['locomotive'].max_power = '1200kW' +data.raw['locomotive']['locomotive'].reversing_power_modifier = 1 +data.raw['locomotive']['locomotive'].braking_force = 20 +data.raw['locomotive']['locomotive'].friction_force = 0.25 +data.raw['locomotive']['locomotive'].air_resistance = 0.004 +data.raw['locomotive']['locomotive'].burner.effectivity = 2 +data.raw['locomotive']['locomotive'].burner.fuel_inventory_size = 3 +data.raw['cargo-wagon']['cargo-wagon'].max_health = 1000 +data.raw['cargo-wagon']['cargo-wagon'].inventory_size = 80 +data.raw['cargo-wagon']['cargo-wagon'].max_speed = 3.5 +data.raw['cargo-wagon']['cargo-wagon'].braking_force = 5 +data.raw['cargo-wagon']['cargo-wagon'].friction_force = 0.25 +data.raw['cargo-wagon']['cargo-wagon'].air_resistance = 0.005 +data.raw['fluid-wagon']['fluid-wagon'].max_health = 1000 +data.raw['fluid-wagon']['fluid-wagon'].capacity = 50000 +data.raw['fluid-wagon']['fluid-wagon'].max_speed = 3.5 +data.raw['fluid-wagon']['fluid-wagon'].braking_force = 5 +data.raw['fluid-wagon']['fluid-wagon'].friction_force = 0.25 +data.raw['fluid-wagon']['fluid-wagon'].air_resistance = 0.005 + +data.raw['construction-robot']['construction-robot'].max_health = 400 +data.raw['construction-robot']['construction-robot'].max_payload_size = 3 +data.raw['construction-robot']['construction-robot'].max_energy = '6MJ' +data.raw['construction-robot']['construction-robot'].speed = 0.12 +data.raw['construction-robot']['construction-robot'].speed_multiplier_when_out_of_energy = 0.4 +data.raw['construction-robot']['construction-robot'].energy_per_move = '10kJ' + +data.raw['logistic-robot']['logistic-robot'].max_health = 400 +data.raw['logistic-robot']['logistic-robot'].max_payload_size = 3 +data.raw['logistic-robot']['logistic-robot'].max_energy = '6MJ' +data.raw['logistic-robot']['logistic-robot'].speed = 0.12 +data.raw['logistic-robot']['logistic-robot'].speed_multiplier_when_out_of_energy = 0.4 +data.raw['logistic-robot']['logistic-robot'].energy_per_move = '10kJ' + +data.raw['roboport']['roboport'].max_health = 1000 +data.raw['roboport']['roboport'].energy_usage = '100kW' +data.raw['roboport']['roboport'].energy_source.input_flow_limit = '40MW' +data.raw['roboport']['roboport'].energy_source.buffer_capacity = '200MJ' +data.raw['roboport']['roboport'].recharge_minimum = '40MJ' +data.raw['roboport']['roboport'].charging_energy = '4000kW' +data.raw['roboport']['roboport'].robot_slots_count = 10 +data.raw['roboport']['roboport'].material_slots_count = 2 +-- data.raw['roboport']['roboport'].logistics_radius = 25 +-- data.raw['roboport']['roboport'].construction_radius = 55 +data.raw['roboport']['roboport'].charging_offsets = { + {-1.5, -0.5}, + {1.5, -0.5}, + {1.5, 1.5}, + {-1.5, 1.5}, + {-2.5, -1.5}, + {2.5, -1.5}, + {2.5, 2.5}, + {-2.5, 2.5} +} + +local item = table.deepcopy(data.raw['item']['boiler']) +item.name = 'electric-boiler' +item.place_result = 'electric-boiler' +item.order = 'b[steam-power]-b[electric-boiler]' +data:extend({item}) + +local entity = table.deepcopy(data.raw['boiler']['boiler']) +entity.name = 'electric-boiler' +entity.energy_consumption = '7200kW' +entity.target_temperature = 165 +entity.minable = {hardness = 0.2, mining_time = 0.5, result = 'electric-boiler'} +entity.emissions_per_minute = 0 +entity.energy_source.type = 'electric' +entity.energy_source.fuel_inventory_size = 0 +entity.energy_source.input_priority = 'secondary' +entity.energy_source.usage_priority = 'secondary-input' +entity.energy_source.light_flicker.color = {r=0.5, g=1, b=1, a=0.5} +entity.energy_source.light_flicker.minimum_light_size = 0.1 +entity.energy_source.light_flicker.light_intensity_to_size_coefficient = 1 +entity.fire_flicker_enabled = false +entity.fire_glow_flicker_enabled = false +entity.fire = {} +data:extend({entity}) + +data:extend({{ + type = 'recipe', + name = 'electric-boiler', + energy_required = 2, + enabled = true, + ingredients = {{'boiler', 1}, {'electronic-circuit', 1}}, + result = 'electric-boiler', +}}) + +for i=1, #ups_chests, 1 do + local item = table.deepcopy(data.raw['item'][ups_chests[i]]) + local entity + + if ups_chests[i] == 'steel-chest' then + entity = table.deepcopy(data.raw['container'][ups_chests[i]]) + else + entity = table.deepcopy(data.raw['logistic-container'][ups_chests[i]]) + end + + item.name = 'ups-' .. ups_chests[i] + item.place_result = 'ups-' .. ups_chests[i] + item.order = item.order .. '-ups' + data:extend({item}) + + entity.inventory_size = 1 + entity.name = 'ups-' .. ups_chests[i] + data:extend({entity}) + + data:extend({{ + type = 'recipe', + name = 'ups-' .. ups_chests[i], + energy_required = 2, + enabled = false, + ingredients = {{'steel-plate', 8}}, + result = 'ups-' .. ups_chests[i], + }}) +end + +table.insert(data.raw.technology['steel-processing'].effects, {type='unlock-recipe', recipe='ups-steel-chest'}) +table.insert(data.raw.technology['construction-robotics'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-passive-provider'}) +table.insert(data.raw.technology['construction-robotics'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-storage'}) +table.insert(data.raw.technology['logistic-robotics'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-passive-provider'}) +table.insert(data.raw.technology['logistic-robotics'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-storage'}) +table.insert(data.raw.technology['logistic-system'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-active-provider'}) +table.insert(data.raw.technology['logistic-system'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-buffer'}) +table.insert(data.raw.technology['logistic-system'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-requester'}) diff --git a/PHI-MI/info.json b/PHI-MI/info.json index 4289f8f..bdeff55 100644 --- a/PHI-MI/info.json +++ b/PHI-MI/info.json @@ -1,8 +1,8 @@ { "name": "PHI-MI", - "version": "1.0.2", + "version": "1.0.4", "factorio_version": "1.1", - "date": "2023-04-10", + "date": "2023-04-13", "title": "Phidias Megabase Item", "author": "PHIDIAS0303", "contributers": "", diff --git a/PHI-MI/main.lua b/PHI-MI/main.lua deleted file mode 100644 index 56df2eb..0000000 --- a/PHI-MI/main.lua +++ /dev/null @@ -1,159 +0,0 @@ -local alpha_order = {'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'} -local graphics_location = '__PHI-MP__/graphics/' - -local ups_chests = { - 'steel-chest', - 'logistic-chest-passive-provider', - 'logistic-chest-active-provider', - 'logistic-chest-storage', - 'logistic-chest-buffer', - 'logistic-chest-requester' -} - -data.raw.recipe['loader'].hidden = false -data.raw.recipe['fast-loader'].hidden = false -data.raw.recipe['express-loader'].hidden = false - -table.insert(data.raw.technology['logistics'].effects, {type='unlock-recipe', recipe='loader'}) -table.insert(data.raw.technology['logistics-2'].effects, {type='unlock-recipe', recipe='fast-loader'}) -table.insert(data.raw.technology['logistics-3'].effects, {type='unlock-recipe', recipe='express-loader'}) - -data.raw['module']['effectivity-module'].effect = {consumption = {bonus = -0.5}, pollution = {bonus = -0.1}} -data.raw['module']['effectivity-module-2'].effect = {consumption = {bonus = -1.0}, pollution = {bonus = -0.15}} -data.raw['module']['effectivity-module-3'].effect = {consumption = {bonus = -1.5}, pollution = {bonus = -0.2}} - --- data.raw['pipe']['pipe'].fluid_box.height = 4 -data.raw['pipe']['pipe'].fluid_box.base_area = 4 --- data.raw['pipe-to-ground']['pipe-to-ground'].fluid_box.height = 4 -data.raw['pipe-to-ground']['pipe-to-ground'].fluid_box.base_area = 4 -data.raw['pump']['pump'].fluid_box.height = 16 -data.raw['pump']['pump'].pumping_speed = 800 -data.raw['storage-tank']['storage-tank'].fluid_box.base_area = 500 - -data.raw['locomotive']['locomotive'].max_health = 2000 -data.raw['locomotive']['locomotive'].max_speed = 2 -data.raw['locomotive']['locomotive'].max_power = '1200kW' -data.raw['locomotive']['locomotive'].reversing_power_modifier = 1 -data.raw['locomotive']['locomotive'].braking_force = 20 -data.raw['locomotive']['locomotive'].friction_force = 0.25 -data.raw['locomotive']['locomotive'].air_resistance = 0.004 -data.raw['locomotive']['locomotive'].burner.effectivity = 2 -data.raw['locomotive']['locomotive'].burner.fuel_inventory_size = 3 -data.raw['cargo-wagon']['cargo-wagon'].max_health = 1000 -data.raw['cargo-wagon']['cargo-wagon'].inventory_size = 80 -data.raw['cargo-wagon']['cargo-wagon'].max_speed = 3.5 -data.raw['cargo-wagon']['cargo-wagon'].braking_force = 5 -data.raw['cargo-wagon']['cargo-wagon'].friction_force = 0.25 -data.raw['cargo-wagon']['cargo-wagon'].air_resistance = 0.005 -data.raw['fluid-wagon']['fluid-wagon'].max_health = 1000 -data.raw['fluid-wagon']['fluid-wagon'].capacity = 50000 -data.raw['fluid-wagon']['fluid-wagon'].max_speed = 3.5 -data.raw['fluid-wagon']['fluid-wagon'].braking_force = 5 -data.raw['fluid-wagon']['fluid-wagon'].friction_force = 0.25 -data.raw['fluid-wagon']['fluid-wagon'].air_resistance = 0.005 - -data.raw['construction-robot']['construction-robot'].max_health = 400 -data.raw['construction-robot']['construction-robot'].max_payload_size = 3 -data.raw['construction-robot']['construction-robot'].max_energy = '6MJ' -data.raw['construction-robot']['construction-robot'].speed = 0.12 -data.raw['construction-robot']['construction-robot'].speed_multiplier_when_out_of_energy = 0.4 -data.raw['construction-robot']['construction-robot'].energy_per_move = '10kJ' - -data.raw['logistic-robot']['logistic-robot'].max_health = 400 -data.raw['logistic-robot']['logistic-robot'].max_payload_size = 3 -data.raw['logistic-robot']['logistic-robot'].max_energy = '6MJ' -data.raw['logistic-robot']['logistic-robot'].speed = 0.12 -data.raw['logistic-robot']['logistic-robot'].speed_multiplier_when_out_of_energy = 0.4 -data.raw['logistic-robot']['logistic-robot'].energy_per_move = '10kJ' - -data.raw['roboport']['roboport'].max_health = 1000 -data.raw['roboport']['roboport'].energy_usage = '100kW' -data.raw['roboport']['roboport'].energy_source.input_flow_limit = '40MW' -data.raw['roboport']['roboport'].energy_source.buffer_capacity = '200MJ' -data.raw['roboport']['roboport'].recharge_minimum = '40MJ' -data.raw['roboport']['roboport'].charging_energy = '4000kW' -data.raw['roboport']['roboport'].robot_slots_count = 10 -data.raw['roboport']['roboport'].material_slots_count = 2 --- data.raw['roboport']['roboport'].logistics_radius = 25 --- data.raw['roboport']['roboport'].construction_radius = 55 -data.raw['roboport']['roboport'].charging_offsets = { - {-1.5, -0.5}, - {1.5, -0.5}, - {1.5, 1.5}, - {-1.5, 1.5}, - {-2.5, -1.5}, - {2.5, -1.5}, - {2.5, 2.5}, - {-2.5, 2.5} -} - -local item = table.deepcopy(data.raw['item']['boiler']) -item.name = 'electric-boiler' -item.place_result = 'electric-boiler' -item.order = 'b[steam-power]-b[electric-boiler]' -data:extend({item}) - -local entity = table.deepcopy(data.raw['boiler']['boiler']) -entity.name = 'electric-boiler' -entity.energy_consumption = '7200kW' -entity.target_temperature = 165 -entity.minable = {hardness = 0.2, mining_time = 0.5, result = 'electric-boiler'} -entity.emissions_per_minute = 0 -entity.energy_source.type = 'electric' -entity.energy_source.fuel_inventory_size = 0 -entity.energy_source.input_priority = 'secondary' -entity.energy_source.usage_priority = 'secondary-input' -entity.energy_source.light_flicker.color = {r=0.5, g=1, b=1, a=0.5} -entity.energy_source.light_flicker.minimum_light_size = 0.1 -entity.energy_source.light_flicker.light_intensity_to_size_coefficient = 1 -entity.fire_flicker_enabled = false -entity.fire_glow_flicker_enabled = false -entity.fire = {} -data:extend({entity}) - -data:extend({{ - type = 'recipe', - name = 'electric-boiler', - energy_required = 2, - enabled = true, - ingredients = {{'boiler', 1}, {'electronic-circuit', 1}}, - result = 'electric-boiler', -}}) - -for i=1, #ups_chests, 1 do - local item = table.deepcopy(data.raw['item'][ups_chests[i]]) - local entity - - if ups_chests[i] == 'steel-chest' then - entity = table.deepcopy(data.raw['container'][ups_chests[i]]) - else - entity = table.deepcopy(data.raw['logistic-container'][ups_chests[i]]) - end - - item.name = 'ups-' .. ups_chests[i] - item.place_result = 'ups-' .. ups_chests[i] - item.order = item.order .. '-ups' - data:extend({item}) - - entity.inventory_size = 1 - entity.name = 'ups-' .. ups_chests[i] - data:extend({entity}) - - data:extend({{ - type = 'recipe', - name = 'ups-' .. ups_chests[i], - energy_required = 2, - enabled = false, - ingredients = {{'steel-plate', 8}}, - result = 'ups-' .. ups_chests[i], - }}) -end - -table.insert(data.raw.technology['steel-processing'].effects, {type='unlock-recipe', recipe='ups-steel-chest'}) -table.insert(data.raw.technology['construction-robotics'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-passive-provider'}) -table.insert(data.raw.technology['construction-robotics'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-storage'}) -table.insert(data.raw.technology['logistic-robotics'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-passive-provider'}) -table.insert(data.raw.technology['logistic-robotics'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-storage'}) -table.insert(data.raw.technology['logistic-system'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-active-provider'}) -table.insert(data.raw.technology['logistic-system'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-buffer'}) -table.insert(data.raw.technology['logistic-system'].effects, {type='unlock-recipe', recipe='ups-logistic-chest-requester'}) diff --git a/PHI-MI/migrations/migrations.lua b/PHI-MI/migrations/migrations.lua new file mode 100644 index 0000000..6de39a9 --- /dev/null +++ b/PHI-MI/migrations/migrations.lua @@ -0,0 +1,29 @@ +for index, force in pairs(game.forces) do + local technologies = force.technologies + local recipes = force.recipes + + if technologies['steel-processing'].researched then + recipes['ups-steel-chest'].enabled = true + recipes['ups-steel-chest'].reload() + + elseif technologies['construction-robotics'].researched then + recipes['ups-logistic-chest-passive-provider'].enabled = true + recipes['ups-logistic-chest-passive-provider'].reload() + recipes['ups-logistic-chest-storage'].enabled = true + recipes['ups-logistic-chest-storage'].reload() + + elseif technologies['logistic-robotics'].researched then + recipes['ups-logistic-chest-passive-provider'].enabled = true + recipes['ups-logistic-chest-passive-provider'].reload() + recipes['ups-logistic-chest-storage'].enabled = true + recipes['ups-logistic-chest-storage'].reload() + + elseif technologies['logistic-system'].researched then + recipes['ups-logistic-chest-active-provider'].enabled = true + recipes['ups-logistic-chest-active-provider'].reload() + recipes['ups-logistic-chest-buffer'].enabled = true + recipes['ups-logistic-chest-buffer'].reload() + recipes['ups-logistic-chest-requester'].enabled = true + recipes['ups-logistic-chest-requester'].reload() + end +end diff --git a/PHI-RS/data.lua b/PHI-RS/data.lua index f829ce9..e16f4fa 100644 --- a/PHI-RS/data.lua +++ b/PHI-RS/data.lua @@ -1 +1,292 @@ -require("main") \ No newline at end of file +local recipe_multiplier = {4, 8} +local recipe_display = {true, false} + +local recipe_list = { + { + name='iron-plate', + tech=nil + }, + { + name='copper-plate', + tech=nil + }, + { + name='stone-brick', + tech=nil + }, + { + name='steel-plate', + tech='steel-processing' + }, + { + name='basic-oil-processing', + tech='oil-processing' + }, + { + name='advanced-oil-processing', + tech='advanced-oil-processing' + }, + { + name='heavy-oil-cracking', + tech='advanced-oil-processing' + }, + { + name='light-oil-cracking', + tech='advanced-oil-processing' + }, + { + name='solid-fuel-from-light-oil', + tech='advanced-oil-processing' + }, + { + name='solid-fuel-from-heavy-oil', + tech='advanced-oil-processing' + }, + { + name='solid-fuel-from-petroleum-gas', + tech='oil-processing' + }, + { + name='coal-liquefaction', + tech='coal-liquefaction' + }, + { + name='sulfur', + tech='sulfur-processing' + }, + { + name='sulfuric-acid', + tech='sulfur-processing' + }, + { + name='lubricant', + tech='lubricant' + }, + { + name='plastic-bar', + tech='plastics' + }, + { + name='battery', + tech='battery' + }, + { + name='explosives', + tech='explosives' + }, + { + name='cliff-explosives', + tech='cliff-explosives' + }, + { + name='empty-barrel', + tech='fluid-handling' + }, + { + name='copper-cable', + tech=nil + }, + { + name='iron-stick', + tech=nil + }, + { + name='iron-gear-wheel', + tech=nil + }, + { + name='pipe', + tech=nil + }, + { + name='electronic-circuit', + tech=nil + }, + { + name='advanced-circuit', + tech='advanced-electronics' + }, + { + name='processing-unit', + tech='advanced-electronics-2' + }, + + + 'engine-unit', + 'electric-engine-unit', + 'flying-robot-frame', + + 'low-density-structure', + 'rocket-fuel', + 'rocket-control-unit', + 'rocket-part', + + 'automation-science-pack', + 'logistic-science-pack', + 'chemical-science-pack', + 'military-science-pack', + 'production-science-pack', + 'utility-science-pack', + + 'uranium-processing', + 'kovarex-enrichment-process', + 'uranium-fuel-cell', + 'nuclear-fuel', + 'nuclear-fuel-reprocessing', + + 'inserter', + 'transport-belt', + 'grenade', + 'firearm-magazine', + 'piercing-rounds-magazine', + 'stone-wall', + 'rail', + 'electric-furnace', + + 'speed-module', + 'speed-module-2', + 'speed-module-3', + 'productivity-module', + 'productivity-module-2', + 'productivity-module-3', + 'effectivity-module', + 'effectivity-module-2', + 'effectivity-module-3', + + 'fast-inserter', + 'long-handed-inserter', + 'filter-inserter', + 'stack-inserter', + 'stack-filter-inserter', + + 'underground-belt', + 'fast-transport-belt', + 'fast-underground-belt', + 'fast-splitter', + --'express-transport-belt', + --'express-underground-belt', + --'express-splitter', + + 'uranium-rounds-magazine', + 'explosive-cannon-shell', + 'artillery-shell', + 'rocket', + 'explosive-rocket' +} + + +for i=1, #recipe_list, 1 do + if data.raw.recipe[recipe_list[i].name] ~= nil then + for j=1, #recipe_multiplier, 1 do + local item = table.deepcopy(data.raw.recipe[recipe_list[i].name]) + item.enabled = false + + if (item.normal ~= nil) and (item.normal ~= false) then + for k, v in pairs(item.normal.ingredients) do + if (v[1] ~= nil) and (v[2] ~= nil) then + item.normal.ingredients[k][2] = v[2] * recipe_multiplier[j] + else + item.normal.ingredients[k].amount = v.amount * recipe_multiplier[j] + end + end + + if item.normal.results ~= nil then + for k, v in pairs(item.normal.results) do + if (v[1] ~= nil) and (v[2] ~= nil) then + item.normal.results[k][2] = v[2] * recipe_multiplier[j] + else + item.normal.results[k].amount = v.amount * recipe_multiplier[j] + end + end + + else + if item.normal.result_count ~= nil then + item.normal.result_count = item.normal.result_count * recipe_multiplier[j] + else + item.normal.result_count = recipe_multiplier[j] + end + end + + if item.normal.energy_required ~= nil then + item.normal.energy_required = item.normal.energy_required * recipe_multiplier[j] + else + item.normal.energy_required = recipe_multiplier[j] / 2 + end + + elseif (item.expensive) ~= nil and (item.expensive ~= false) then + for k, v in pairs(item.expensive.ingredients) do + if (v[1] ~= nil) and (v[2] ~= nil) then + item.expensive.ingredients[k][2] = v[2] * recipe_multiplier[j] + else + item.expensive.ingredients[k].amount = v.amount * recipe_multiplier[j] + end + end + + if item.expensive.results ~= nil then + for k, v in pairs(item.expensive.results) do + if (v[1] ~= nil) and (v[2] ~= nil) then + item.expensive.results[k][2] = v[2] * recipe_multiplier[j] + else + item.expensive.results[k].amount = v.amount * recipe_multiplier[j] + end + end + + else + if item.expensive.result_count ~= nil then + item.expensive.result_count = item.expensive.result_count * recipe_multiplier[j] + else + item.expensive.result_count = recipe_multiplier[j] + end + end + + if item.expensive.energy_required ~= nil then + item.expensive.energy_required = item.expensive.energy_required * recipe_multiplier[j] + else + item.expensive.energy_required = recipe_multiplier[j] / 2 + end + + else + for k, v in pairs(item.ingredients) do + if (v[1] ~= nil) and (v[2] ~= nil) then + item.ingredients[k][2] = v[2] * recipe_multiplier[j] + else + item.ingredients[k].amount = v.amount * recipe_multiplier[j] + end + end + + if item.results ~= nil then + for k, v in pairs(item.results) do + if (v[1] ~= nil) and (v[2] ~= nil) then + item.results[k][2] = v[2] * recipe_multiplier[j] + else + item.results[k].amount = v.amount * recipe_multiplier[j] + end + end + + else + if item.result_count ~= nil then + item.result_count = item.result_count * recipe_multiplier[j] + else + item.result_count = recipe_multiplier[j] + end + end + + if item.energy_required ~= nil then + item.energy_required = item.energy_required * recipe_multiplier[j] + else + item.energy_required = recipe_multiplier[j] / 2 + end + end + + item.name = item.name .. '-' .. j + + if recipe_list[i].tech ~= nil then + data:extend({item}) + table.insert(data.raw.technology[recipe_list[i].tech].effects, {type='unlock-recipe', recipe=item.name}) + else + item.enabled = true + data:extend({item}) + end + end + end +end diff --git a/PHI-RS/info.json b/PHI-RS/info.json index c005550..bd26437 100644 --- a/PHI-RS/info.json +++ b/PHI-RS/info.json @@ -2,7 +2,7 @@ "name": "PHI-RS", "version": "1.0.0", "factorio_version": "1.1", - "date": "2023-03-17", + "date": "2023-04-13", "title": "Phidias Recipe Scaling", "author": "PHIDIAS0303", "contributers": "", diff --git a/PHI-RS/main.lua b/PHI-RS/main.lua deleted file mode 100644 index 04340c2..0000000 --- a/PHI-RS/main.lua +++ /dev/null @@ -1,209 +0,0 @@ -local recipe_multiplier = {4, 8} -local recipe_display = {true, false} - -local recipe_list = { - 'sulfuric-acid', - 'basic-oil-processing', - 'advanced-oil-processing', - 'coal-liquefaction', - 'heavy-oil-cracking', - 'light-oil-cracking', - 'solid-fuel-from-light-oil', - 'solid-fuel-from-heavy-oil', - 'solid-fuel-from-petroleum-gas', - 'lubricant', - - 'iron-plate', - 'copper-plate', - 'steel-plate', - 'stone-brick', - - 'sulfur', - 'plastic-bar', - 'explosives', - 'battery', - - 'empty-barrel', - 'copper-cable', - 'iron-stick', - 'iron-gear-wheel', - - 'electronic-circuit', - 'advanced-circuit', - 'processing-unit', - - 'engine-unit', - 'electric-engine-unit', - 'flying-robot-frame', - - 'low-density-structure', - 'rocket-fuel', - 'rocket-control-unit', - 'rocket-part', - - 'automation-science-pack', - 'logistic-science-pack', - 'chemical-science-pack', - 'military-science-pack', - 'production-science-pack', - 'utility-science-pack', - - 'uranium-processing', - 'kovarex-enrichment-process', - 'uranium-fuel-cell', - 'nuclear-fuel', - 'nuclear-fuel-reprocessing', - - 'inserter', - 'transport-belt', - 'grenade', - 'firearm-magazine', - 'piercing-rounds-magazine', - 'stone-wall', - 'rail', - 'electric-furnace', - 'solid-fuel-from-heavy-oil', - 'solid-fuel-from-light-oil', - 'solid-fuel-from-petroleum-gas', - - 'speed-module', - 'speed-module-2', - 'speed-module-3', - 'productivity-module', - 'productivity-module-2', - 'productivity-module-3', - 'effectivity-module', - 'effectivity-module-2', - 'effectivity-module-3', - - 'pipe', - 'fast-inserter', - 'long-handed-inserter', - 'filter-inserter', - 'stack-inserter', - 'stack-filter-inserter', - - 'underground-belt', - 'fast-transport-belt', - 'fast-underground-belt', - 'fast-splitter', - --'express-transport-belt', - --'express-underground-belt', - --'express-splitter', - - 'uranium-rounds-magazine', - 'explosive-cannon-shell', - 'artillery-shell', - 'rocket', - 'explosive-rocket' -} - - -for i=1, #recipe_list, 1 do - if data.raw.recipe[recipe_list[i]] ~= nil then - for j=1, #recipe_multiplier, 1 do - local item = table.deepcopy(data.raw.recipe[recipe_list[i]]) - item.enabled = true - - if (item.normal ~= nil) and (item.normal ~= false) then - for k, v in pairs(item.normal.ingredients) do - if (v[1] ~= nil) and (v[2] ~= nil) then - item.normal.ingredients[k][2] = v[2] * recipe_multiplier[j] - else - item.normal.ingredients[k].amount = v.amount * recipe_multiplier[j] - end - end - - if item.normal.results ~= nil then - for k, v in pairs(item.normal.results) do - if (v[1] ~= nil) and (v[2] ~= nil) then - item.normal.results[k][2] = v[2] * recipe_multiplier[j] - else - item.normal.results[k].amount = v.amount * recipe_multiplier[j] - end - end - - else - if item.normal.result_count ~= nil then - item.normal.result_count = item.normal.result_count * recipe_multiplier[j] - else - item.normal.result_count = recipe_multiplier[j] - end - end - - if item.normal.energy_required ~= nil then - item.normal.energy_required = item.normal.energy_required * recipe_multiplier[j] - else - item.normal.energy_required = recipe_multiplier[j] / 2 - end - - elseif (item.expensive) ~= nil and (item.expensive ~= false) then - for k, v in pairs(item.expensive.ingredients) do - if (v[1] ~= nil) and (v[2] ~= nil) then - item.expensive.ingredients[k][2] = v[2] * recipe_multiplier[j] - else - item.expensive.ingredients[k].amount = v.amount * recipe_multiplier[j] - end - end - - if item.expensive.results ~= nil then - for k, v in pairs(item.expensive.results) do - if (v[1] ~= nil) and (v[2] ~= nil) then - item.expensive.results[k][2] = v[2] * recipe_multiplier[j] - else - item.expensive.results[k].amount = v.amount * recipe_multiplier[j] - end - end - - else - if item.expensive.result_count ~= nil then - item.expensive.result_count = item.expensive.result_count * recipe_multiplier[j] - else - item.expensive.result_count = recipe_multiplier[j] - end - end - - if item.expensive.energy_required ~= nil then - item.expensive.energy_required = item.expensive.energy_required * recipe_multiplier[j] - else - item.expensive.energy_required = recipe_multiplier[j] / 2 - end - - else - for k, v in pairs(item.ingredients) do - if (v[1] ~= nil) and (v[2] ~= nil) then - item.ingredients[k][2] = v[2] * recipe_multiplier[j] - else - item.ingredients[k].amount = v.amount * recipe_multiplier[j] - end - end - - if item.results ~= nil then - for k, v in pairs(item.results) do - if (v[1] ~= nil) and (v[2] ~= nil) then - item.results[k][2] = v[2] * recipe_multiplier[j] - else - item.results[k].amount = v.amount * recipe_multiplier[j] - end - end - - else - if item.result_count ~= nil then - item.result_count = item.result_count * recipe_multiplier[j] - else - item.result_count = recipe_multiplier[j] - end - end - - if item.energy_required ~= nil then - item.energy_required = item.energy_required * recipe_multiplier[j] - else - item.energy_required = recipe_multiplier[j] / 2 - end - end - - item.name = item.name .. '-' .. j - data:extend({item}) - end - end -end diff --git a/PHI-WE/data.lua b/PHI-WE/data.lua index f829ce9..e69de29 100644 --- a/PHI-WE/data.lua +++ b/PHI-WE/data.lua @@ -1 +0,0 @@ -require("main") \ No newline at end of file diff --git a/PHI-WE/main.lua b/PHI-WE/main.lua deleted file mode 100644 index e69de29..0000000 diff --git a/PHI-XW/data.lua b/PHI-XW/data.lua index f829ce9..f0edc9b 100644 --- a/PHI-XW/data.lua +++ b/PHI-XW/data.lua @@ -1 +1,8 @@ -require("main") \ No newline at end of file +data.raw['offshore-pump']['offshore-pump'].pumping_speed = 100 +data.raw['offshore-pump']['offshore-pump'].fluid_box.base_area = 5 +data.raw['offshore-pump']['offshore-pump'].fluid_box.base_level = 5 +data.raw['offshore-pump']['offshore-pump'].flags = {'placeable-neutral', 'player-creation'} +data.raw['offshore-pump']['offshore-pump'].adjacent_tile_collision_box = {{-0.5, -0.25}, {0.5, 0.25}} +data.raw['offshore-pump']['offshore-pump'].adjacent_tile_collision_test = {'ground-tile', 'water-tile', 'object-layer'} +data.raw['offshore-pump']['offshore-pump'].adjacent_tile_collision_mask = nil +data.raw['offshore-pump']['offshore-pump'].placeable_position_visualization = nil diff --git a/PHI-XW/info.json b/PHI-XW/info.json index 6288590..af098b0 100644 --- a/PHI-XW/info.json +++ b/PHI-XW/info.json @@ -1,9 +1,9 @@ { "name": "PHI-XW", - "version": "1.0.0", + "version": "1.0.2", "factorio_version": "1.1", - "date": "2023-04-10", - "title": "PHIDIAS Water Pump", + "date": "2023-04-13", + "title": "Phidias Water Pump", "author": "PHIDIAS0303", "contributers": "", "homepage": "", diff --git a/PHI-XW/main.lua b/PHI-XW/main.lua deleted file mode 100644 index f0edc9b..0000000 --- a/PHI-XW/main.lua +++ /dev/null @@ -1,8 +0,0 @@ -data.raw['offshore-pump']['offshore-pump'].pumping_speed = 100 -data.raw['offshore-pump']['offshore-pump'].fluid_box.base_area = 5 -data.raw['offshore-pump']['offshore-pump'].fluid_box.base_level = 5 -data.raw['offshore-pump']['offshore-pump'].flags = {'placeable-neutral', 'player-creation'} -data.raw['offshore-pump']['offshore-pump'].adjacent_tile_collision_box = {{-0.5, -0.25}, {0.5, 0.25}} -data.raw['offshore-pump']['offshore-pump'].adjacent_tile_collision_test = {'ground-tile', 'water-tile', 'object-layer'} -data.raw['offshore-pump']['offshore-pump'].adjacent_tile_collision_mask = nil -data.raw['offshore-pump']['offshore-pump'].placeable_position_visualization = nil