1 |
[spoiler]
|
1 |
[spoiler]
|
2 |
{{{
|
2 |
{{{
|
3 |
local highestspeed = 0
|
3 |
local highestspeed = 0
|
4 |
local lowestspeed = math.huge
|
4 |
local lowestspeed = math.huge
|
5 |
local highesthealth = 0
|
5 |
local highesthealth = 0
|
6 |
local lowesthealth = math.huge
|
6 |
local lowesthealth = math.huge
|
7 |
local highestmetalcost = 0
|
7 |
local highestmetalcost = 0
|
8 |
local lowestmetalcost = math.huge
|
8 |
local lowestmetalcost = math.huge
|
9 |
local highestrange = 0
|
9 |
local highestrange = 0
|
10 |
local lowestrange = math.huge
|
10 |
local lowestrange = math.huge
|
11 |
local highestflighttime = 0
|
11 |
local highestflighttime = 0
|
12 |
local lowestflighttime = math.huge
|
12 |
local lowestflighttime = math.huge
|
13 |
local highestdamagedefault = 0
|
13 |
local highestdamagedefault = 0
|
14 |
local lowestdamagedefault = math.huge
|
14 |
local lowestdamagedefault = math.huge
|
15 |
local highestreloadtime = 0
|
15 |
local highestreloadtime = 0
|
16 |
local lowestreloadtime = math.huge
|
16 |
local lowestreloadtime = math.huge
|
17 |
\n
|
17 |
\n
|
18 |
local validunitnames = {
|
18 |
local validunitnames = {
|
19 |
["Glaive"] = true, ["Ronin"] = true, ["Reaver"] = true, ["Knight"] = true,
|
19 |
["Glaive"] = true, ["Ronin"] = true, ["Reaver"] = true, ["Knight"] = true,
|
20 |
["Sling"] = true, ["Scythe"] = true, ["Phantom"] = true, ["Imp"] = true,
|
20 |
["Sling"] = true, ["Scythe"] = true, ["Phantom"] = true, ["Imp"] = true,
|
21 |
["Bandit"] = true, ["Rogue"] = true, ["Outlaw"] = true, ["Thug"] = true,
|
21 |
["Bandit"] = true, ["Rogue"] = true, ["Outlaw"] = true, ["Thug"] = true,
|
22 |
["Racketeer"] = true, ["Dirtbag"] = true, ["Felon"] = true, ["Snitch"] = true,
|
22 |
["Racketeer"] = true, ["Dirtbag"] = true, ["Felon"] = true, ["Snitch"] = true,
|
23 |
["Scorcher"] = true, ["Fencer"] = true, ["Ripper"] = true, ["Ravager"] = true,
|
23 |
["Scorcher"] = true, ["Fencer"] = true, ["Ripper"] = true, ["Ravager"] = true,
|
24 |
["Badger"] = true, ["Dart"] = true, ["Impaler"] = true, ["Dominatrix"] = true,
|
24 |
["Badger"] = true, ["Dart"] = true, ["Impaler"] = true, ["Dominatrix"] = true,
|
25 |
["Dagger"] = true, ["Scalpel"] = true, ["Mace"] = true, ["Halberd"] = true,
|
25 |
["Dagger"] = true, ["Scalpel"] = true, ["Mace"] = true, ["Halberd"] = true,
|
26 |
["Lance"] = true, ["Bolas"] = true, ["Claymore"] = true, ["Locust"] = true,
|
26 |
["Lance"] = true, ["Bolas"] = true, ["Claymore"] = true, ["Locust"] = true,
|
27 |
["Harpy"] = true, ["Blastwing"] = true, ["Revenant"] = true, ["Nimbus"] = true,
|
27 |
["Harpy"] = true, ["Blastwing"] = true, ["Revenant"] = true, ["Nimbus"] = true,
|
28 |
["Gnat"] = true, ["Krow"] = true, ["Charon"] = true, ["Hercules"] = true,
|
28 |
["Gnat"] = true, ["Krow"] = true, ["Charon"] = true, ["Hercules"] = true,
|
29 |
["Swift"] = true, ["Phoenix"] = true, ["Raven"] = true, ["Sparrow"] = true,
|
29 |
["Swift"] = true, ["Phoenix"] = true, ["Raven"] = true, ["Sparrow"] = true,
|
30 |
["Likho"] = true, ["Thunderbird"] = true, ["Owl"] = true, ["Flea"] = true,
|
30 |
["Likho"] = true, ["Thunderbird"] = true, ["Owl"] = true, ["Flea"] = true,
|
31 |
["Recluse"] = true, ["Redback"] = true, ["Hermit"] = true, ["Venom"] = true,
|
31 |
["Recluse"] = true, ["Redback"] = true, ["Hermit"] = true, ["Venom"] = true,
|
32 |
["Crab"] = true, ["Widow"] = true, ["Pyro"] = true, ["Moderator"] = true,
|
32 |
["Crab"] = true, ["Widow"] = true, ["Pyro"] = true, ["Moderator"] = true,
|
33 |
["Placeholder"] = true, ["Jack"] = true, ["Firewalker"] = true, ["Puppy"] = true,
|
33 |
["Placeholder"] = true, ["Jack"] = true, ["Firewalker"] = true, ["Puppy"] = true,
|
34 |
["Jugglenaut"] = true, ["Skuttle"] = true, ["Blitz"] = true, ["Ogre"] = true,
|
34 |
["Jugglenaut"] = true, ["Skuttle"] = true, ["Blitz"] = true, ["Ogre"] = true,
|
35 |
["Minotaur"] = true, ["Emissary"] = true, ["Kodachi"] = true, ["Cyclops"] = true,
|
35 |
["Minotaur"] = true, ["Emissary"] = true, ["Kodachi"] = true, ["Cyclops"] = true,
|
36 |
["Tremor"] = true, ["Duck"] = true, ["Buoy"] = true, ["Scallop"] = true,
|
36 |
["Tremor"] = true, ["Duck"] = true, ["Buoy"] = true, ["Scallop"] = true,
|
37 |
["Bulkhead"] = true, ["Lobster"] = true, ["Archer"] = true, ["Grizzly"] = true,
|
37 |
["Bulkhead"] = true, ["Lobster"] = true, ["Archer"] = true, ["Grizzly"] = true,
|
38 |
["Limpet"] = true, ["Hunter"] = true, ["Mistral"] = true, ["Corsair"] = true,
|
38 |
["Limpet"] = true, ["Hunter"] = true, ["Mistral"] = true, ["Corsair"] = true,
|
39 |
["Siren"] = true, ["Envoy"] = true, ["Cutter"] = true, ["Seawolf"] = true,
|
39 |
["Siren"] = true, ["Envoy"] = true, ["Cutter"] = true, ["Seawolf"] = true,
|
40 |
}
|
40 |
}
|
41 |
\n
|
41 |
\n
|
42 |
for name, ud in pairs(UnitDefs) do
|
42 |
for name, ud in pairs(UnitDefs) do
|
43 |
if validunitnames[ud.name] then
|
43 |
if validunitnames[ud.name] then
|
44 |
Spring.Echo("gathering info on unit: " .. ud.name)
|
44 |
Spring.Echo("gathering info on unit: " .. ud.name)
|
45 |
\n
|
45 |
\n
|
46 |
if ud.speed then
|
46 |
if ud.speed then
|
47 |
if ud.speed > highestspeed then
|
47 |
if ud.speed > highestspeed then
|
48 |
highestspeed = ud.speed
|
48 |
highestspeed = ud.speed
|
49 |
end
|
49 |
end
|
50 |
if ud.speed < lowestspeed then
|
50 |
if ud.speed < lowestspeed then
|
51 |
lowestspeed = ud.speed
|
51 |
lowestspeed = ud.speed
|
52 |
end
|
52 |
end
|
53 |
end
|
53 |
end
|
54 |
\n
|
54 |
\n
|
55 |
if ud.health then
|
55 |
if ud.health then
|
56 |
if ud.health > highesthealth then
|
56 |
if ud.health > highesthealth then
|
57 |
highesthealth = ud.health
|
57 |
highesthealth = ud.health
|
58 |
end
|
58 |
end
|
59 |
if ud.health < lowesthealth then
|
59 |
if ud.health < lowesthealth then
|
60 |
lowesthealth = ud.health
|
60 |
lowesthealth = ud.health
|
61 |
end
|
61 |
end
|
62 |
end
|
62 |
end
|
63 |
\n
|
63 |
\n
|
64 |
if ud.metalcost then
|
64 |
if ud.metalcost then
|
65 |
if ud.metalcost > highestmetalcost then
|
65 |
if ud.metalcost > highestmetalcost then
|
66 |
highestmetalcost = ud.metalcost
|
66 |
highestmetalcost = ud.metalcost
|
67 |
end
|
67 |
end
|
68 |
if ud.metalcost < lowestmetalcost then
|
68 |
if ud.metalcost < lowestmetalcost then
|
69 |
lowestmetalcost = ud.metalcost
|
69 |
lowestmetalcost = ud.metalcost
|
70 |
end
|
70 |
end
|
71 |
end
|
71 |
end
|
72 |
\n
|
72 |
\n
|
73 |
if ud.weapondefs then
|
73 |
if ud.weapondefs then
|
74 |
for _, wd in pairs(ud.weapondefs) do
|
74 |
for _, wd in pairs(ud.weapondefs) do
|
75 |
\n
|
75 |
\n
|
76 |
if wd.range then
|
76 |
if wd.range then
|
77 |
if wd.range > highestrange then
|
77 |
if wd.range > highestrange then
|
78 |
highestrange = wd.range
|
78 |
highestrange = wd.range
|
79 |
end
|
79 |
end
|
80 |
if wd.range < lowestrange then
|
80 |
if wd.range < lowestrange then
|
81 |
lowestrange = wd.range
|
81 |
lowestrange = wd.range
|
82 |
end
|
82 |
end
|
83 |
end
|
83 |
end
|
84 |
\n
|
84 |
\n
|
85 |
if wd.flighttime then
|
85 |
if wd.flighttime then
|
86 |
if wd.flighttime > highestflighttime then
|
86 |
if wd.flighttime > highestflighttime then
|
87 |
highestflighttime = wd.flighttime
|
87 |
highestflighttime = wd.flighttime
|
88 |
end
|
88 |
end
|
89 |
if wd.flighttime < lowestflighttime then
|
89 |
if wd.flighttime < lowestflighttime then
|
90 |
lowestflighttime = wd.flighttime
|
90 |
lowestflighttime = wd.flighttime
|
91 |
end
|
91 |
end
|
92 |
end
|
92 |
end
|
93 |
\n
|
93 |
\n
|
94 |
if wd.damage then
|
94 |
if wd.damage then
|
95 |
if wd.damage and wd.damage.default then
|
95 |
if wd.damage and wd.damage.default then
|
96 |
if wd.damage.default > highestdamagedefault then
|
96 |
if wd.damage.default > highestdamagedefault then
|
97 |
highestdamagedefault = wd.damage.default
|
97 |
highestdamagedefault = wd.damage.default
|
98 |
end
|
98 |
end
|
99 |
if wd.damage.default < lowestdamagedefault then
|
99 |
if wd.damage.default < lowestdamagedefault then
|
100 |
lowestdamagedefault = wd.damage.default
|
100 |
lowestdamagedefault = wd.damage.default
|
101 |
end
|
101 |
end
|
102 |
end
|
102 |
end
|
103 |
end
|
103 |
end
|
104 |
\n
|
104 |
\n
|
105 |
if wd.reloadtime then
|
105 |
if wd.reloadtime then
|
106 |
if wd.reloadtime > highestreloadtime then
|
106 |
if wd.reloadtime > highestreloadtime then
|
107 |
highestreloadtime = wd.reloadtime
|
107 |
highestreloadtime = wd.reloadtime
|
108 |
end
|
108 |
end
|
109 |
if wd.reloadtime < lowestreloadtime then
|
109 |
if wd.reloadtime < lowestreloadtime then
|
110 |
lowestreloadtime = wd.reloadtime
|
110 |
lowestreloadtime = wd.reloadtime
|
111 |
end
|
111 |
end
|
112 |
end
|
112 |
end
|
113 |
\n
|
113 |
\n
|
114 |
end
|
114 |
end
|
115 |
end
|
115 |
end
|
116 |
\n
|
116 |
\n
|
117 |
end
|
117 |
end
|
118 |
end
|
118 |
end
|
119 |
\n
|
119 |
\n
|
120 |
for name, ud in pairs(UnitDefs) do
|
120 |
for name, ud in pairs(UnitDefs) do
|
121 |
if validunitnames[ud.name] then
|
121 |
if validunitnames[ud.name] then
|
122 |
Spring.Echo("processing unit: " .. ud.name)
|
122 |
Spring.Echo("processing unit: " .. ud.name)
|
123 |
\n
|
123 |
\n
|
124 |
if ud.speed then
|
124 |
if ud.speed then
|
125 |
local distance_speed_midpoint = ud.speed - lowestspeed
|
125 |
local distance_speed_midpoint = ud.speed - lowestspeed
|
126 |
ud.speed = highestspeed - distance_speed_midpoint
|
126 |
ud.speed = highestspeed - distance_speed_midpoint
|
127 |
end
|
127 |
end
|
128 |
\n
|
128 |
\n
|
129 |
if ud.health then
|
129 |
if ud.health then
|
130 |
local distance_health_midpoint = ud.health - lowesthealth
|
130 |
local distance_health_midpoint = ud.health - lowesthealth
|
131 |
ud.health = highesthealth - distance_health_midpoint
|
131 |
ud.health = highesthealth - distance_health_midpoint
|
132 |
end
|
132 |
end
|
133 |
\n
|
133 |
\n
|
134 |
if ud.metalcost then
|
134 |
if ud.metalcost then
|
135 |
local distance_metalcost_midpoint = ud.metalcost - lowestmetalcost
|
135 |
local distance_metalcost_midpoint = ud.metalcost - lowestmetalcost
|
136 |
ud.metalcost = highestmetalcost - distance_metalcost_midpoint
|
136 |
ud.metalcost = highestmetalcost - distance_metalcost_midpoint
|
137 |
end
|
137 |
end
|
138 |
\n
|
138 |
\n
|
139 |
if ud.weapondefs then
|
139 |
if ud.weapondefs then
|
140 |
for _, wd in pairs(ud.weapondefs) do
|
140 |
for _, wd in pairs(ud.weapondefs) do
|
141 |
\n
|
141 |
\n
|
142 |
if wd.range then
|
142 |
if wd.range then
|
143 |
local distance_range_midpoint = wd.range - lowestrange
|
143 |
local distance_range_midpoint = wd.range - lowestrange
|
144 |
wd.range = (highestrange - distance_range_midpoint) + 100
|
144 |
wd.range = (highestrange - distance_range_midpoint) + 100
|
145 |
end
|
145 |
end
|
146 |
\n
|
146 |
\n
|
147 |
if wd.flighttime then
|
147 |
if wd.flighttime then
|
148 |
local distance_flighttime_midpoint = wd.flighttime - lowestflighttime
|
148 |
local distance_flighttime_midpoint = wd.flighttime - lowestflighttime
|
149 |
wd.flighttime = (highestflighttime - distance_flighttime_midpoint) + 100
|
149 |
wd.flighttime = (highestflighttime - distance_flighttime_midpoint) + 100
|
150 |
end
|
150 |
end
|
151 |
\n
|
151 |
\n
|
152 |
if wd.damage then
|
152 |
if wd.damage then
|
153 |
if wd.damage and wd.damage.default then
|
153 |
if wd.damage and wd.damage.default then
|
154 |
local distance_damagedefault_midpoint = wd.damage.default - lowestdamagedefault
|
154 |
local distance_damagedefault_midpoint = wd.damage.default - lowestdamagedefault
|
155 |
wd.damage.default = highestdamagedefault - distance_damagedefault_midpoint
|
155 |
wd.damage.default = highestdamagedefault - distance_damagedefault_midpoint
|
156 |
end
|
156 |
end
|
157 |
end
|
157 |
end
|
158 |
\n
|
158 |
\n
|
159 |
if wd.reloadtime then
|
159 |
if wd.reloadtime then
|
160 |
local distance_reloadtime_midpoint = wd.reloadtime - lowestreloadtime
|
160 |
local distance_reloadtime_midpoint = wd.reloadtime - lowestreloadtime
|
161 |
wd.reloadtime = (highestreloadtime - distance_reloadtime_midpoint)
|
161 |
wd.reloadtime = (highestreloadtime - distance_reloadtime_midpoint)
|
162 |
end
|
162 |
end
|
163 |
\n
|
163 |
\n
|
164 |
end
|
164 |
end
|
165 |
end
|
165 |
end
|
166 |
\n
|
166 |
\n
|
167 |
end
|
167 |
end
|
168 |
end
|
168 |
end
|
169 |
}}}
|
169 |
}}}
|
170 |
[/spoiler]
|
170 |
[/spoiler]
|
171 |
woo finished it!!
|
171 |
woo finished it!!
|
|
|
172 |
\n
|
|
|
173 |
i think i still need to incorperate striders and make hub plopable
|