-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdata-final-fixes.lua
More file actions
115 lines (95 loc) · 3.94 KB
/
Copy pathdata-final-fixes.lua
File metadata and controls
115 lines (95 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by heyqule.
--- DateTime: 10/23/2021 12:53 PM
---
local ERM = require("__enemyracemanager__/global")
require('prototypes/finalize-unit-prototypes')
require('prototypes/health-balance')
local String = require('__erm_libs__/stdlib/string')
local MapgenFunctions = require("__erm_libs__/prototypes/map_gen")
if ERM.DEBUG_MODE then
data.raw["radar"]["radar"]["max_distance_of_sector_revealed"] = 16
data.raw["radar"]["radar"]["max_distance_of_nearby_sector_revealed"] = 16
local autoplace_count = 0
local prototype_count = 0
local erm_prototype_count = 0
local damage_types_count = 0
local damage_types = {}
local planets_count = 0
local planets_with_pollutant = 0
local planets_with_enemy_autoplace = 0
local planets = { }
local space_loc_count = 0
local space_locs = { }
for type_name, entity_type in pairs(data.raw) do
for entity_name, entity in pairs(entity_type) do
prototype_count = prototype_count + 1
if entity.autoplace ~= nil then
autoplace_count = autoplace_count + 1
local nameToken = String.split(entity.name, "--")
if table_size(nameToken) == 3 then
erm_prototype_count = erm_prototype_count + 1
end
end
if type_name == "damage-type" then
damage_types_count = damage_types_count + 1
table.insert(damage_types, entity.name)
end
if type_name == "planet" then
planets_count = planets_count + 1
if entity.pollutant_type then
planets_with_pollutant = planets_with_pollutant + 1
end
local enemy_autoplaces = nil
if MapgenFunctions.has_enemy_autoplace(entity) then
planets_with_enemy_autoplace = planets_with_enemy_autoplace + 1
enemy_autoplaces = MapgenFunctions.get_enemy_autoplaces(entity)
end
table.insert(planets, {
name = entity.name,
pollutant_type = entity.pollutant_type,
enemy_autoplaces = enemy_autoplaces,
territory_units = MapgenFunctions.territory_units(entity)
})
end
if type_name == "space-location" then
space_loc_count = space_loc_count + 1
table.insert(space_locs, {
name = entity.name
})
end
end
end
log("Total Prototypes:" .. prototype_count)
log("Total Prototypes with autoplace: " .. autoplace_count)
log("Total ERM enemy prototype with autoplace: " .. erm_prototype_count)
log("Total Damage Types:"..damage_types_count)
log(serpent.block(damage_types))
log("Total Planets:"..planets_count)
log("Total Planets with pollutant_type:"..planets_count)
log(serpent.block(planets))
log("Total Space Location:"..space_loc_count)
log(serpent.block(space_locs))
end
--- Revert this value to default as it affects ERM spawner balance.
--- Bob Enemies changes it to 20 lol.
data.raw["utility-constants"].default.spawner_evolution_factor_health_modifier = 10
for _, planet in pairs(data.raw['planet']) do
if planet.hidden then
data.raw['mod-data'][ERM.MOD_DATA_SURFACE_EXCLUSIONS].data[planet.name] = true
data.raw['mod-data'][ERM.MOD_DATA_INTERPLANETARY_ATTACKS].data[planet.name] = true
end
end
--- Remove autoplace on all --boss_ prefixed spawner and turrets
local boss_needle = '--boss_'
for _, spawner in pairs(data.raw['unit-spawner']) do
if string.find(spawner.name, boss_needle, 1, true) then
spawner.autoplace = nil
end
end
for _, spawner in pairs(data.raw['turret']) do
if string.find(spawner.name, boss_needle, 1, true) then
spawner.autoplace = nil
end
end