mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-27 11:05:22 +09:00
.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
local items = require 'config'
|
local items = require 'config'
|
||||||
local file_stage = 2
|
local file_stage = 2
|
||||||
|
|
||||||
|
|
||||||
-- entity
|
-- entity
|
||||||
local function EEE(source, tier)
|
local function EEE(source, tier)
|
||||||
local item = table.deepcopy(data.raw[source.type][source.ref_name])
|
local item = table.deepcopy(data.raw[source.type][source.ref_name])
|
||||||
@@ -211,7 +212,7 @@ end
|
|||||||
local function EI(source, tier)
|
local function EI(source, tier)
|
||||||
local item = table.deepcopy(data.raw.item[source.ref_name])
|
local item = table.deepcopy(data.raw.item[source.ref_name])
|
||||||
|
|
||||||
if string.find(source.type, '-equipment') then
|
if source.category == 'equipment' then
|
||||||
item.name = source.name .. '-mk' .. tier .. '-equipment'
|
item.name = source.name .. '-mk' .. tier .. '-equipment'
|
||||||
item.placed_as_equipment_result = source.name .. '-mk' .. tier .. '-equipment'
|
item.placed_as_equipment_result = source.name .. '-mk' .. tier .. '-equipment'
|
||||||
|
|
||||||
@@ -232,7 +233,7 @@ local function ER(source, tier)
|
|||||||
local ingredient_name = source.name
|
local ingredient_name = source.name
|
||||||
local result_name = source.name
|
local result_name = source.name
|
||||||
|
|
||||||
if string.find(source.type, '-equipment') then
|
if source.category == 'equipment' then
|
||||||
if (tier == 1) then
|
if (tier == 1) then
|
||||||
ingredient_name = ingredient_name .. '-equipment'
|
ingredient_name = ingredient_name .. '-equipment'
|
||||||
|
|
||||||
@@ -320,7 +321,7 @@ local function ET(source, tier)
|
|||||||
end
|
end
|
||||||
|
|
||||||
elseif data.raw.technology[source.tech] then
|
elseif data.raw.technology[source.tech] then
|
||||||
if string.find(source.type, '-equipment') then
|
if source.category == 'equipment' then
|
||||||
table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-mk' .. tier .. '-equipment'})
|
table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-mk' .. tier .. '-equipment'})
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -361,6 +362,8 @@ end
|
|||||||
for _, v in pairs(items['item']) do
|
for _, v in pairs(items['item']) do
|
||||||
if v.enabled then
|
if v.enabled then
|
||||||
if v.stage == file_stage then
|
if v.stage == file_stage then
|
||||||
|
v.category = 'item'
|
||||||
|
|
||||||
for j=v.min, v.max, 1 do
|
for j=v.min, v.max, 1 do
|
||||||
EEE(v, j)
|
EEE(v, j)
|
||||||
EI(v, j)
|
EI(v, j)
|
||||||
@@ -376,6 +379,8 @@ end
|
|||||||
for _, v in pairs(items['equipment']) do
|
for _, v in pairs(items['equipment']) do
|
||||||
if v.enabled then
|
if v.enabled then
|
||||||
if v.stage == file_stage then
|
if v.stage == file_stage then
|
||||||
|
v.category = 'equipment'
|
||||||
|
|
||||||
for j=v.min, v.max, 1 do
|
for j=v.min, v.max, 1 do
|
||||||
EEQ(v, j)
|
EEQ(v, j)
|
||||||
EI(v, j)
|
EI(v, j)
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ end
|
|||||||
local function EI(source, tier)
|
local function EI(source, tier)
|
||||||
local item = table.deepcopy(data.raw.item[source.ref_name])
|
local item = table.deepcopy(data.raw.item[source.ref_name])
|
||||||
|
|
||||||
if string.find(source.type, '-equipment') then
|
if source.category == 'equipment' then
|
||||||
item.name = source.name .. '-mk' .. tier .. '-equipment'
|
item.name = source.name .. '-mk' .. tier .. '-equipment'
|
||||||
item.placed_as_equipment_result = source.name .. '-mk' .. tier .. '-equipment'
|
item.placed_as_equipment_result = source.name .. '-mk' .. tier .. '-equipment'
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ local function ER(source, tier)
|
|||||||
local ingredient_name = source.name
|
local ingredient_name = source.name
|
||||||
local result_name = source.name
|
local result_name = source.name
|
||||||
|
|
||||||
if string.find(source.type, '-equipment') then
|
if source.category == 'equipment' then
|
||||||
if (tier == 1) then
|
if (tier == 1) then
|
||||||
ingredient_name = ingredient_name .. '-equipment'
|
ingredient_name = ingredient_name .. '-equipment'
|
||||||
|
|
||||||
@@ -322,7 +322,7 @@ local function ET(source, tier)
|
|||||||
end
|
end
|
||||||
|
|
||||||
elseif data.raw.technology[source.tech] then
|
elseif data.raw.technology[source.tech] then
|
||||||
if string.find(source.type, '-equipment') then
|
if source.category == 'equipment' then
|
||||||
table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-mk' .. tier .. '-equipment'})
|
table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-mk' .. tier .. '-equipment'})
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -375,6 +375,8 @@ end
|
|||||||
for _, v in pairs(items['item']) do
|
for _, v in pairs(items['item']) do
|
||||||
if v.enabled then
|
if v.enabled then
|
||||||
if v.stage == file_stage then
|
if v.stage == file_stage then
|
||||||
|
v.category = 'item'
|
||||||
|
|
||||||
for j=v.min, v.max, 1 do
|
for j=v.min, v.max, 1 do
|
||||||
EEE(v, j)
|
EEE(v, j)
|
||||||
EI(v, j)
|
EI(v, j)
|
||||||
@@ -390,6 +392,8 @@ end
|
|||||||
for _, v in pairs(items['equipment']) do
|
for _, v in pairs(items['equipment']) do
|
||||||
if v.enabled then
|
if v.enabled then
|
||||||
if v.stage == file_stage then
|
if v.stage == file_stage then
|
||||||
|
v.category = 'equipment'
|
||||||
|
|
||||||
for j=v.min, v.max, 1 do
|
for j=v.min, v.max, 1 do
|
||||||
EEQ(v, j)
|
EEQ(v, j)
|
||||||
EI(v, j)
|
EI(v, j)
|
||||||
|
|||||||
Reference in New Issue
Block a user