|
1 |
| --- Add some recipes to productivty modules limitation (which is whitelist for some reason) |
2 |
| -local limitation_to_add = { |
3 |
| - 'advanced-nuclear-fuel-reprocessing', |
4 |
| - 'MOX-fuel-cell', 'MOX-fuel-cell-reprocessing', |
5 |
| - 'plutonium-fuel', |
6 |
| - 'breeder-fuel-cell-reprocessing', |
7 |
| - 'used-up-uranium-fuel-cell-solution-centrifuging', |
8 |
| - 'used-up-breeder-fuel-cell-solution-centrifuging', |
9 |
| - 'breeder-fuel-cell', |
10 |
| -} |
11 |
| -for _, module in pairs(data.raw['module']) do |
12 |
| - if module.limitation and module.effect.productivity then |
13 |
| - for _, recipe in pairs(limitation_to_add) do |
14 |
| - table.insert(module.limitation, recipe) |
15 |
| - end |
16 |
| - end |
17 |
| -end |
18 |
| - |
19 |
| -local function replace_subgroup(prototype_type, replace_with, targets_list) |
20 |
| - for _, name in pairs(targets_list) do |
21 |
| - log("Replacing subgroup of " .. prototype_type .. " named `" .. name .. "` with `" .. replace_with .. "`") |
22 |
| - if data.raw[prototype_type][name] then |
23 |
| - data.raw[prototype_type][name].subgroup = replace_with |
24 |
| - else |
25 |
| - log("Warning: prototype does not exist in `data.raw`") |
26 |
| - end |
27 |
| - end |
28 |
| -end |
29 |
| - |
30 |
| -local function replace_recipe_subgroup(replace_with, targets_list) |
31 |
| - replace_subgroup('recipe', replace_with, targets_list) |
32 |
| -end |
33 |
| - |
34 |
| -local function replace_item_subgroup(replace_with, targets_list) |
35 |
| - replace_subgroup('item', replace_with, targets_list) |
36 |
| -end |
37 |
| - |
38 |
| -local nuclear_fuel_recipe_subgroup = data.raw['recipe']['nuclear-fuel'].subgroup |
39 |
| -local uranium_fuel_cell_recipe_subgroup = data.raw['recipe']['nuclear-fuel-reprocessing'].subgroup |
40 |
| - |
41 |
| -local nuclear_fuel_list_recipes = { |
42 |
| - 'plutonium-fuel' |
43 |
| -} |
44 |
| -local uranium_fuel_cell_list_recipes = { |
45 |
| - 'MOX-fuel-cell', |
46 |
| - 'breeder-fuel-cell', |
47 |
| - 'breeder-fuel-cell-from-uranium-cell', |
48 |
| - 'breeder-fuel-cell-from-MOX-fuel-cell', |
49 |
| - 'breeder-fuel-cell-reprocessing', |
50 |
| - 'used-up-uranium-fuel-cell-solution-centrifuging', |
51 |
| - 'used-up-breeder-fuel-cell-solution-centrifuging', |
52 |
| - 'advanced-nuclear-fuel-reprocessing', |
53 |
| - 'advanced-nuclear-fuel-reprocessing-with-barrelling', |
54 |
| - 'used-up-uranium-fuel-cell-solution-centrifuging', |
55 |
| - 'MOX-fuel-reprocessing', |
56 |
| - 'breeder-fuel-cell-reprocessing', |
57 |
| - 'breeder-fuel-cell-reprocessing-with-barrelling', |
58 |
| - 'used-up-breeder-fuel-cell-solution-centrifuging' |
59 |
| -} |
60 |
| - |
61 |
| -if nuclear_fuel_recipe_subgroup then |
62 |
| - replace_recipe_subgroup(nuclear_fuel_recipe_subgroup, nuclear_fuel_list_recipes) |
63 |
| -end |
64 |
| -if uranium_fuel_cell_recipe_subgroup then |
65 |
| - replace_recipe_subgroup(uranium_fuel_cell_recipe_subgroup, uranium_fuel_cell_list_recipes) |
66 |
| -end |
67 |
| - |
68 |
| -local nuclear_fuel_item_subgroup = data.raw['item']['nuclear-fuel'].subgroup |
69 |
| -local uranium_fuel_cell_item_subgroup = data.raw['item']['uranium-fuel-cell'].subgroup |
70 |
| - |
71 |
| -local nuclear_fuel_list_items = { |
72 |
| - 'plutonium-fuel' |
73 |
| -} |
74 |
| -local uranium_fuel_cell_list_items = { |
75 |
| - 'MOX-fuel', |
76 |
| - 'breeder-fuel-cell' |
77 |
| -} |
78 |
| - |
79 |
| -if nuclear_fuel_item_subgroup then |
80 |
| - replace_item_subgroup(nuclear_fuel_item_subgroup, nuclear_fuel_list_items) |
81 |
| -end |
82 |
| -if uranium_fuel_cell_item_subgroup then |
83 |
| - replace_item_subgroup(uranium_fuel_cell_item_subgroup, uranium_fuel_cell_list_items) |
84 |
| -end |
| 1 | +require('compat.productivity') |
| 2 | +require('compat.prototype-subgroup') |
0 commit comments