Loading...
  OR  Zero-K Name:    Password:   

Post edit history

Game mode explode cost

To display differences between versions, select one or more edits in the list using checkboxes and click "diff selected"
Post edit history
Date Editor Before After
7/17/2024 12:25:11 PMAUrankSmokeDragon before revert after revert
7/17/2024 7:59:01 AMAUrankSmokeDragon before revert after revert
Before After
1 fixed 1 [spoiler]
2 {{{
3 local invalidunitnames = {
4 ["Slicer"] = true,
5 ["Terraform"] = true
6 }
7 \n
8 local weapondefstoadd = {
9 metalboom = {
10 areaOfEffect = 384,
11 craterBoost = 1,
12 craterMult = 3.5,
13 edgeEffectiveness = 0.4,
14 explosionGenerator = "custom:ROACHPLOSION",
15 explosionSpeed = 10000,
16 impulseBoost = 0,
17 impulseFactor = 0.3,
18 name = "Explosion",
19 scarIndices = Shared.SCAR_SET.MEDIUM_AOE,
20 soundHit = "explosion/mini_nuke",
21 damage = {
22 default = 1200.8,
23 },
24 customParams = {
25 burst = Shared.BURST_UNRELIABLE,
26 },
27 },
28 }
29 \n
30 local function mergeweapondefs(weapondefs1, weapondefs2)
31 local mergeddefs = {}
32 for k, v in pairs(weapondefs1) do
33 mergeddefs[k] = v
34 end
35 for k, v in pairs(weapondefs2) do
36 if not mergeddefs[k] then
37 mergeddefs[k] = v
38 end
39 end
40 return mergeddefs
41 end
42 \n
43 for name, ud in pairs(UnitDefs) do
44 if not invalidunitnames[ud.name] then
45 if ud.metalcost > 0 then
46 local areaofeffectbuff = math.floor(ud.metalcost * 0.1)
47 weapondefstoadd.metalboom.areaOfEffect = areaofeffectbuff
48 local damagebuff = math.floor(ud.metalcost * 0.1)
49 weapondefstoadd.metalboom.damage.default = damagebuff
50 \n
51 ud.weapons = ud.weapons or {}
52 \n
53 table.insert(ud.weapons, {
54 def = "metalboom",
55 })
56 \n
57 ud.weapondefs = mergeweapondefs(ud.weapondefs or {}, weapondefstoadd)
58
59 ud.explodeas = "metalboom"
60 ud.selfdestructas = "metalboom"
61 end
62 end
63 end
64 \n
65 }}}
66 [/spoiler]
67 \n
68 this is not working for striders and multi weapon units.. i cant yet get my head around why but ill try fix it soon
69 \n
70 if anyone can help?