| 1 |
here is final code thanks again xntwsad. its just a cleaned up version of your changes because they are working well.
|
1 |
here is final code thanks again xntwsad. its just a cleaned up version of your changes because they are working well.
|
| 2 |
\n
|
2 |
\n
|
| 3 |
[spoiler]
|
3 |
[spoiler]
|
| 4 |
{{{
|
4 |
{{{
|
| 5 |
local invalidUDNames={
|
5 |
local invalidUDNames={
|
| 6 |
["terraunit"]=true,
|
6 |
["terraunit"]=true,
|
| 7 |
["slicer"]=true
|
7 |
["slicer"]=true
|
| 8 |
}
|
8 |
}
|
| 9 |
local function MakeWDForUD(ud)
|
9 |
local function MakeWDForUD(ud)
|
| 10 |
return {
|
10 |
return {
|
| 11 |
areaOfEffect = math.pow(ud.metalcost,5/7)*8,
|
11 |
areaOfEffect = math.pow(ud.metalcost,5/7)*8,
|
| 12 |
craterBoost = 1,
|
12 |
craterBoost = 1,
|
| 13 |
craterMult = 3.5,
|
13 |
craterMult = 3.5,
|
| 14 |
edgeEffectiveness = 0.4,
|
14 |
edgeEffectiveness = 0.4,
|
| 15 |
explosionGenerator = "custom:ROACHPLOSION",
|
15 |
explosionGenerator = "custom:ROACHPLOSION",
|
| 16 |
explosionSpeed = 10000,
|
16 |
explosionSpeed = 10000,
|
| 17 |
impulseBoost = 0,
|
17 |
impulseBoost = 0,
|
| 18 |
impulseFactor = 0.3,
|
18 |
impulseFactor = 0.3,
|
| 19 |
name = "Explosion",
|
19 |
name = "Explosion",
|
| 20 |
scarIndices = Shared.SCAR_SET.MEDIUM_AOE,
|
20 |
scarIndices = Shared.SCAR_SET.MEDIUM_AOE,
|
| 21 |
soundHit = "explosion/mini_nuke",
|
21 |
soundHit = "explosion/mini_nuke",
|
| 22 |
damage = {
|
22 |
damage = {
|
| 23 |
default = ud.metalcost*1,
|
23 |
default = ud.metalcost*1,
|
| 24 |
},
|
24 |
},
|
| 25 |
customParams = {
|
25 |
customParams = {
|
| 26 |
burst = Shared.BURST_UNRELIABLE,
|
26 |
burst = Shared.BURST_UNRELIABLE,
|
| 27 |
},
|
27 |
},
|
| 28 |
}
|
28 |
}
|
| 29 |
end
|
29 |
end
|
| 30 |
local function SetWDForUD(ud)
|
30 |
local function SetWDForUD(ud)
|
| 31 |
ud.weapondefs=ud.weapondefs or {}
|
31 |
ud.weapondefs=ud.weapondefs or {}
|
| 32 |
ud.weapondefs.metalboom = MakeWDForUD(ud)
|
32 |
ud.weapondefs.metalboom = MakeWDForUD(ud)
|
| 33 |
end
|
33 |
end
|
| 34 |
for name, ud in pairs(UnitDefs) do
|
34 |
for name, ud in pairs(UnitDefs) do
|
| 35 |
if (
|
35 |
if (
|
| 36 |
(not invalidUDNames[name]) and
|
36 |
(not invalidUDNames[name]) and
|
| 37 |
((
|
37 |
((
|
| 38 |
ud.metalcost > 0
|
38 |
ud.metalcost > 0
|
| 39 |
)) and
|
39 |
)) and
|
| 40 |
(not
|
40 |
(not
|
| 41 |
(ud.selfDestructCountdown and ud.selfDestructCountdown < 1 )
|
41 |
(ud.selfDestructCountdown and ud.selfDestructCountdown < 1 )
|
| 42 |
)
|
42 |
)
|
| 43 |
) then
|
43 |
) then
|
| 44 |
SetWDForUD(ud)
|
44 |
SetWDForUD(ud)
|
| 45 |
ud.explodeas = "metalboom"
|
45 |
ud.explodeas = "metalboom"
|
| 46 |
ud.selfdestructas = "metalboom"
|
46 |
ud.selfdestructas = "metalboom"
|
| 47 |
ud.customParams = ud.customParams or {}
|
47 |
ud.customParams = ud.customParams or {}
|
| 48 |
ud.customParams.stats_show_death_explosion=true
|
48 |
ud.customParams.stats_show_death_explosion=true
|
| 49 |
end
|
49 |
end
|
| 50 |
end
|
50 |
end
|
| 51 |
{
{
{
|
51 |
}
}
}
|
| 52 |
[/spoiler]
|
52 |
[/spoiler]
|