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 2:46:55 AMAUrankSmokeDragon before revert after revert
7/16/2024 11:50:35 PMAUrankSmokeDragon before revert after revert
Before After
1 major breakthrough.. this is the tech i needed and will lead to the compleation of shield health, explode cost, train factory, and countless new mods soon to come 1 major breakthrough.. this is the tech i needed and will lead to the compleation of shield health, explode cost, train factory, and countless new mods soon to come
2 \n 2 \n
3 [spoiler] 3 [spoiler]
4 {{{ 4 {{{
5 local invalidunitnames = { 5 local invalidunitnames = {
6 ["Slicer"] = true, 6 ["Slicer"] = true,
7 } 7 }
8 \n 8 \n
9 local weapondefstoadd = { 9 local weapondefstoadd = {
10 metalboom = { 10 metalboom = {
11 areaOfEffect = 384, 11 areaOfEffect = 384,
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 = 1200.8, 23 default = 1200.8,
24 }, 24 },
25 customParams = { 25 customParams = {
26 burst = Shared.BURST_UNRELIABLE, 26 burst = Shared.BURST_UNRELIABLE,
27 }, 27 },
28 }, 28 },
29 } 29 }
30 \n 30 \n
31 local function mergeweapondefs(weapondefs1, weapondefs2) 31 local function mergeweapondefs(weapondefs1, weapondefs2)
32 local mergeddefs = {} 32 local mergeddefs = {}
33 for k, v in pairs(weapondefs1) do 33 for k, v in pairs(weapondefs1) do
34 mergeddefs[k] = v 34 mergeddefs[k] = v
35 end 35 end
36 for k, v in pairs(weapondefs2) do 36 for k, v in pairs(weapondefs2) do
37 if not mergeddefs[k] then 37 if not mergeddefs[k] then
38 mergeddefs[k] = v 38 mergeddefs[k] = v
39 end 39 end
40 end 40 end
41 return mergeddefs 41 return mergeddefs
42 end 42 end
43 \n 43 \n
44 for name, ud in pairs(UnitDefs) do 44 for name, ud in pairs(UnitDefs) do
45 if not invalidunitnames[ud.name] then 45 if not invalidunitnames[ud.name] then
46 if ud.metalcost > 0 then 46 if ud.metalcost > 0 then
47 Spring.Echo("Processing unit: " .. name) 47 Spring.Echo("Processing unit: " .. name)
48 Spring.Echo("Updating unit: " .. ud.name) 48 Spring.Echo("Updating unit: " .. ud.name)
49 Spring.Echo("Existing weapondefs:") 49 Spring.Echo("Existing weapondefs:")
50 if ud.weapondefs then 50 if ud.weapondefs then
51 for k, v in pairs(ud.weapondefs) do 51 for k, v in pairs(ud.weapondefs) do
52 Spring.Echo("- " .. k) 52 Spring.Echo("- " .. k)
53 end 53 end
54 else 54 else
55 Spring.Echo("- None") 55 Spring.Echo("- None")
56 end 56 end
57 \n 57 \n
58 Spring.Echo("metalcost".. ud.metalcost)
59 \n
60 local areaofeffectbuff = math.floor(ud.metalcost * 1)
61 weapondefstoadd.metalboom.areaofeffect = areaofeffectbuff
62 \n
63 local damagebuff = math.floor(ud.metalcost * 0.5)
64 weapondefstoadd.metalboom.damage.default = damagebuff
65 \n
58 ud.weapondefs = mergeweapondefs(ud.weapondefs or {}, weapondefstoadd) 66 ud.weapondefs = mergeweapondefs(ud.weapondefs or {}, weapondefstoadd)
59 67
60 Spring.Echo("Updated weapondefs:") 68 Spring.Echo("Updated weapondefs:")
61 if ud.weapondefs then 69 if ud.weapondefs then
62 for k, v in pairs(ud.weapondefs) do 70 for k, v in pairs(ud.weapondefs) do
63 Spring.Echo("- " .. k) 71 Spring.Echo("- " .. k)
64 end 72 end
65 else 73 else
66 Spring.Echo("- None") 74 Spring.Echo("- None")
67 end 75 end
68 \n 76 \n
69 ud.explodeas = "metalboom" 77 ud.explodeas = "metalboom"
70 ud.selfdestructas = "metalboom" 78 ud.selfdestructas = "metalboom"
71 \n 79 \n
72 Spring.Echo("explodeas for unit " .. ud.name .. ": " .. ud.explodeas) 80 Spring.Echo("explodeas for unit " .. ud.name .. ": " .. ud.explodeas)
73 Spring.Echo("selfdestructas for unit " .. ud.name .. ": " .. ud.selfdestructas) 81 Spring.Echo("selfdestructas for unit " .. ud.name .. ": " .. ud.selfdestructas)
82 Spring.Echo("damage".. ud.weapondefs.metalboom.damage.default)
83 Spring.Echo("aoe".. ud.weapondefs.metalboom.areaofeffect)
74 end 84 end
75 end 85 end
76 end 86 end
77 \n
78 }}} 87 }}}
79 [/spoiler] 88 [/spoiler]