mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-27 11:05:22 +09:00
Update data.lua
This commit is contained in:
@@ -24,6 +24,28 @@ local item_max = {
|
|||||||
['exoskeleton'] = 2
|
['exoskeleton'] = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local item_parameter = {
|
||||||
|
['solar-panel'] = 30,
|
||||||
|
['fusion-reactor'] = 750,
|
||||||
|
['personal-laser-defense'] = 3,
|
||||||
|
['battery'] = 100,
|
||||||
|
['energy-shield'] = 150,
|
||||||
|
['personal-roboport'] = 0.5,
|
||||||
|
['night-vision'] = 1,
|
||||||
|
['exoskeleton'] = 0.6
|
||||||
|
}
|
||||||
|
|
||||||
|
local item_technology = {
|
||||||
|
['solar-panel'] = 'solar-panel-equipment',
|
||||||
|
['fusion-reactor'] = 'fusion-reactor-equipment',
|
||||||
|
['personal-laser-defense'] = 'personal-laser-defense-equipment',
|
||||||
|
['battery'] = 'battery-mk2-equipment',
|
||||||
|
['energy-shield'] = 'energy-shield-mk2-equipment',
|
||||||
|
['personal-roboport'] = 'personal-roboport-mk2-equipment',
|
||||||
|
['night-vision'] = 'night-vision-equipment',
|
||||||
|
['exoskeleton'] = 'exoskeleton-equipment'
|
||||||
|
}
|
||||||
|
|
||||||
if game.active_mods['space-exploration'] then
|
if game.active_mods['space-exploration'] then
|
||||||
items = {'solar-panel', 'fusion-reactor', 'personal-laser-defense', 'battery', 'energy-shield', 'personal-roboport'}
|
items = {'solar-panel', 'fusion-reactor', 'personal-laser-defense', 'battery', 'energy-shield', 'personal-roboport'}
|
||||||
|
|
||||||
@@ -71,8 +93,18 @@ else
|
|||||||
result = 'power-armor-mk3'
|
result = 'power-armor-mk3'
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
table.insert(data.raw.technology['power-armor-mk2'].effects, {type='unlock-recipe', recipe='power-armor-mk3'})
|
table.insert(data.raw.technology['power-armor-mk2'].effects, {type='unlock-recipe', recipe='power-armor-mk3'})
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- equipment
|
-- equipment
|
||||||
@@ -82,20 +114,20 @@ local function EE(source, tier)
|
|||||||
item['categories'] = {'armor'}
|
item['categories'] = {'armor'}
|
||||||
local w = 1
|
local w = 1
|
||||||
local h = 1
|
local h = 1
|
||||||
|
|
||||||
if (source == 'solar-panel') then
|
if (source == 'solar-panel') then
|
||||||
item['type'] = 'solar-panel-equipment'
|
item['type'] = 'solar-panel-equipment'
|
||||||
item['power'] = (30 * (2 ^ (tier - 1))) .. 'kW'
|
item['power'] = (item_parameter[source] * (2 ^ (tier - 1))) .. 'kW'
|
||||||
item['energy_source'] = {type = 'electric', usage_priority = 'primary-output'}
|
item['energy_source'] = {type = 'electric', usage_priority = 'primary-output'}
|
||||||
elseif (source == 'battery') then
|
elseif (source == 'battery') then
|
||||||
h = 2
|
h = 2
|
||||||
item['type'] = 'battery-equipment'
|
item['type'] = 'battery-equipment'
|
||||||
item['energy_source'] = {type = 'electric', usage_priority = 'tertiary', buffer_capacity= (100 * (2 ^ (tier - 2))) .. 'MJ'}
|
item['energy_source'] = {type = 'electric', usage_priority = 'tertiary', buffer_capacity= (item_parameter[source] * (2 ^ (tier - 2))) .. 'MJ'}
|
||||||
elseif (source == 'fusion-reactor') then
|
elseif (source == 'fusion-reactor') then
|
||||||
w = 4
|
w = 4
|
||||||
h = 4
|
h = 4
|
||||||
item['type'] = 'generator-equipment'
|
item['type'] = 'generator-equipment'
|
||||||
item['power'] = (750 * (2 ^ (tier - 1))) .. 'kW'
|
item['power'] = (item_parameter[source] * (2 ^ (tier - 1))) .. 'kW'
|
||||||
item['energy_source'] = {type = 'electric', usage_priority = 'primary-output'}
|
item['energy_source'] = {type = 'electric', usage_priority = 'primary-output'}
|
||||||
elseif (source == 'personal-laser-defense') then
|
elseif (source == 'personal-laser-defense') then
|
||||||
w = 2
|
w = 2
|
||||||
@@ -104,20 +136,20 @@ local function EE(source, tier)
|
|||||||
item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = (250 * (2 ^ (tier - 1))) .. 'kJ'}
|
item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = (250 * (2 ^ (tier - 1))) .. 'kJ'}
|
||||||
-- item['source_direction_count'] = 64
|
-- item['source_direction_count'] = 64
|
||||||
-- item['source_offset'] = {0, -3.423489 / 4}
|
-- 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['attack_parameters'] = {type = 'beam', cooldown = 60, range = (18 + tier), damage_modifier = (item_parameter[source] * (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
|
item['automatic'] = true
|
||||||
elseif (source == 'energy-shield') then
|
elseif (source == 'energy-shield') then
|
||||||
w = 2
|
w = 2
|
||||||
h = 2
|
h = 2
|
||||||
item['type'] = 'energy-shield-equipment'
|
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['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['max_shield_value'] = (item_parameter[source] * (2 ^ (tier - 2)))
|
||||||
item['energy_per_shield'] = '80kJ'
|
item['energy_per_shield'] = '80kJ'
|
||||||
elseif (source == 'personal-roboport') then
|
elseif (source == 'personal-roboport') then
|
||||||
w = 2
|
w = 2
|
||||||
h = 2
|
h = 2
|
||||||
item['type'] = 'roboport-equipment'
|
item['type'] = 'roboport-equipment'
|
||||||
item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = (80 * (2 ^ (tier - 1))) .. 'MJ'}
|
item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = (item_parameter[source] * 32 * (2 ^ (tier - 1))) .. 'MJ'}
|
||||||
item['robot_limit'] = 50
|
item['robot_limit'] = 50
|
||||||
item['construction_radius'] = 32
|
item['construction_radius'] = 32
|
||||||
item['spawn_and_station_height'] = 0.4
|
item['spawn_and_station_height'] = 0.4
|
||||||
@@ -129,7 +161,7 @@ local function EE(source, tier)
|
|||||||
item['stationing_offset'] = {0, -0.6}
|
item['stationing_offset'] = {0, -0.6}
|
||||||
item['charging_station_shift'] = {0, 0.5}
|
item['charging_station_shift'] = {0, 0.5}
|
||||||
item['charging_station_count'] = 16
|
item['charging_station_count'] = 16
|
||||||
item['charging_energy'] = (0.5 * (2 ^ (tier - 2))) .. 'MW'
|
item['charging_energy'] = (item_parameter[source] * (2 ^ (tier - 2))) .. 'MW'
|
||||||
item['charging_distance'] = 1.6
|
item['charging_distance'] = 1.6
|
||||||
item['charging_threshold_distance'] = 5
|
item['charging_threshold_distance'] = 5
|
||||||
elseif (source == 'night-vision') then
|
elseif (source == 'night-vision') then
|
||||||
@@ -140,7 +172,7 @@ local function EE(source, tier)
|
|||||||
item['energy_input'] = '20kW'
|
item['energy_input'] = '20kW'
|
||||||
item['activate_sound'] = {filename = '__base__/sound/nightvision-on.ogg', volume = 0.5}
|
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['deactivate_sound'] = {filename = '__base__/sound/nightvision-off.ogg', volume = 0.5}
|
||||||
item['darkness_to_turn_on'] = 1
|
item['darkness_to_turn_on'] = item_parameter[source]
|
||||||
item['color_lookup'] = {{0, '__core__/graphics/color_luts/lut-sunset.png'}}
|
item['color_lookup'] = {{0, '__core__/graphics/color_luts/lut-sunset.png'}}
|
||||||
elseif (source == 'exoskeleton') then
|
elseif (source == 'exoskeleton') then
|
||||||
w = 2
|
w = 2
|
||||||
@@ -148,7 +180,7 @@ local function EE(source, tier)
|
|||||||
item['type'] = 'movement-bonus-equipment'
|
item['type'] = 'movement-bonus-equipment'
|
||||||
item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = '10MJ'}
|
item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = '10MJ'}
|
||||||
item['energy_consumption'] = '400kW'
|
item['energy_consumption'] = '400kW'
|
||||||
item['movement_bonus'] = 0.6
|
item['movement_bonus'] = item_parameter[source]
|
||||||
end
|
end
|
||||||
|
|
||||||
item['shape'] = {width = w, height = h, type = 'full'}
|
item['shape'] = {width = w, height = h, type = 'full'}
|
||||||
@@ -207,15 +239,35 @@ local function ER(source, tier)
|
|||||||
}})
|
}})
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, animation in ipairs(data.raw['character']['character']['animations']) do
|
-- item
|
||||||
if animation.armors then
|
local function EI(source, tier)
|
||||||
for _, armor in ipairs(animation.armors) do
|
local item = table.deepcopy(data.raw.item[source .. '-equipment'])
|
||||||
if armor == 'power-armor-mk2' then
|
item.name = source .. '-mk' .. tier .. '-equipment'
|
||||||
animation.armors[#animation.armors + 1] = 'power-armor-mk3'
|
item.placed_as_equipment_result = source .. '-mk' .. tier .. '-equipment'
|
||||||
break
|
item.subgroup = 'equipment'
|
||||||
end
|
item.stack_size = 20
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
|
data:extend({item})
|
||||||
end
|
end
|
||||||
|
|
||||||
for i=1, #items, 1 do
|
for i=1, #items, 1 do
|
||||||
@@ -226,7 +278,6 @@ for i=1, #items, 1 do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
table.insert(data.raw.technology['night-vision-equipment'].effects, {type='unlock-recipe', recipe='night-vision-mk2-equipment'})
|
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['exoskeleton-equipment'].effects, {type='unlock-recipe', recipe='exoskeleton-mk2-equipment'})
|
||||||
|
|||||||
Reference in New Issue
Block a user