Code style

This commit is contained in:
Gustas
2025-09-27 19:02:24 +03:00
committed by Matthias Mailänder
parent 2804d103ae
commit 48a5b5b9bc
2 changed files with 29 additions and 23 deletions

View File

@@ -6,15 +6,15 @@
the License, or (at your option) any later version. For more the License, or (at your option) any later version. For more
information, see COPYING. information, see COPYING.
]] ]]
AttackGroupSize = {8} AttackGroupSize = { 8 }
AttackDelay = { DateTime.Seconds(2), DateTime.Seconds(4) } AttackDelay = { DateTime.Seconds(2), DateTime.Seconds(4) }
IdlingUnits = IdlingUnits =
{ {
Atreides = { }, Atreides = {},
Harkonnen = { }, Harkonnen = {},
Ordos = { }, Ordos = {},
Corrino = { } Corrino = {}
} }
HoldProduction = HoldProduction =
@@ -36,22 +36,26 @@ IsAttacking =
AtreidesInfantryTypes = { "light_inf", "light_inf", "light_inf", "trooper", "trooper", "grenadier", "grenadier" } AtreidesInfantryTypes = { "light_inf", "light_inf", "light_inf", "trooper", "trooper", "grenadier", "grenadier" }
AtreidesVehicleTypes = { "trike", "trike", "quad" } AtreidesVehicleTypes = { "trike", "trike", "quad" }
AtreidesTankTypes = { "combat_tank_a", "combat_tank_a", "combat_tank_a", "siege_tank" } AtreidesTankTypes = { "combat_tank_a", "combat_tank_a", "combat_tank_a", "siege_tank" }
AtreidesStarportTypes = { "trike.starport", "quad.starport", "siege_tank.starport", "missile_tank.starport", "combat_tank_a.starport" } AtreidesStarportTypes = { "trike.starport", "quad.starport", "siege_tank.starport", "missile_tank.starport",
"combat_tank_a.starport" }
HarkonnenInfantryTypes = { "light_inf", "light_inf", "light_inf", "trooper", "trooper", "mpsardaukar" } HarkonnenInfantryTypes = { "light_inf", "light_inf", "light_inf", "trooper", "trooper", "mpsardaukar" }
HarkonnenVehicleTypes = { "trike", "quad", "quad" } HarkonnenVehicleTypes = { "trike", "quad", "quad" }
HarkonnenTankTypes = { "combat_tank_h", "combat_tank_h", "combat_tank_h", "siege_tank" } HarkonnenTankTypes = { "combat_tank_h", "combat_tank_h", "combat_tank_h", "siege_tank" }
HarkonnenStarportTypes = { "trike.starport", "quad.starport", "siege_tank.starport", "missile_tank.starport", "combat_tank_h.starport" } HarkonnenStarportTypes = { "trike.starport", "quad.starport", "siege_tank.starport", "missile_tank.starport",
"combat_tank_h.starport" }
OrdosInfantryTypes = { "light_inf", "light_inf", "light_inf", "trooper", "trooper" } OrdosInfantryTypes = { "light_inf", "light_inf", "light_inf", "trooper", "trooper" }
OrdosVehicleTypes = { "raider", "raider", "quad", "stealth_raider" } OrdosVehicleTypes = { "raider", "raider", "quad", "stealth_raider" }
OrdosTankTypes = { "combat_tank_o", "combat_tank_o", "combat_tank_o", "siege_tank" } OrdosTankTypes = { "combat_tank_o", "combat_tank_o", "combat_tank_o", "siege_tank" }
OrdosStarportTypes = { "trike.starport", "quad.starport", "siege_tank.starport", "missile_tank.starport", "combat_tank_o.starport" } OrdosStarportTypes = { "trike.starport", "quad.starport", "siege_tank.starport", "missile_tank.starport",
"combat_tank_o.starport" }
CorrinoInfantryTypes = { "light_inf", "trooper", "sardaukar", "sardaukar", "sardaukar", "sardaukar" } CorrinoInfantryTypes = { "light_inf", "trooper", "sardaukar", "sardaukar", "sardaukar", "sardaukar" }
CorrinoVehicleTypes = { "trike", "quad", "quad" } CorrinoVehicleTypes = { "trike", "quad", "quad" }
CorrinoTankTypes = { "combat_tank_h", "combat_tank_h", "combat_tank_h", "siege_tank" } CorrinoTankTypes = { "combat_tank_h", "combat_tank_h", "combat_tank_h", "siege_tank" }
CorrinoStarportTypes = { "trike.starport", "quad.starport", "siege_tank.starport", "missile_tank.starport", "combat_tank_h.starport" } CorrinoStarportTypes = { "trike.starport", "quad.starport", "siege_tank.starport", "missile_tank.starport",
"combat_tank_h.starport" }
Upgrades = { "upgrade.barracks", "upgrade.light", "upgrade.conyard", "upgrade.heavy", "upgrade.hightech" } Upgrades = { "upgrade.barracks", "upgrade.light", "upgrade.conyard", "upgrade.heavy", "upgrade.hightech" }
@@ -80,13 +84,13 @@ Produce = function(house, units)
Trigger.AfterDelay(delay, function() Produce(house, units) end) Trigger.AfterDelay(delay, function() Produce(house, units) end)
if unitCount >= (AttackGroupSize[1] * 2) then if unitCount >= (AttackGroupSize[1] * 2) then
SendAttack(house) SendAttack(house)
end end
end) end)
end end
SetupAttackGroup = function(house) SetupAttackGroup = function(house)
local units = { } local units = {}
for i = 0, AttackGroupSize[1], 1 do for i = 0, AttackGroupSize[1], 1 do
if #IdlingUnits[house.Name] == 0 then if #IdlingUnits[house.Name] == 0 then
@@ -125,7 +129,9 @@ end
SendNewHarv = function(house, waypoint, count) SendNewHarv = function(house, waypoint, count)
local harvs = house.GetActorsByType("harvester") local harvs = house.GetActorsByType("harvester")
if #harvs < count then if #harvs < count then
local harvesters = Reinforcements.ReinforceWithTransport(house, "carryall.reinforce", Harvester, waypoint, { waypoint[1] })[2] local harvesters = Reinforcements.ReinforceWithTransport(
house, "carryall.reinforce", Harvester, waypoint, { waypoint[1] })[2]
Utils.Do(harvesters, function(harvester) Utils.Do(harvesters, function(harvester)
Trigger.OnAddedToWorld(harvester, function() Trigger.OnAddedToWorld(harvester, function()
InitializeHarvester(harvester) InitializeHarvester(harvester)

View File

@@ -14,11 +14,11 @@ if DateTime.CurrentMonth == 10 and DateTime.CurrentDay == 31 then
ProxyType = "powerproxy.parazombies" ProxyType = "powerproxy.parazombies"
ProducedUnitTypes = ProducedUnitTypes =
{ {
{ factory = AlliedBarracks1, types = { "e1", "e3" } }, { factory = AlliedBarracks1, types = { "e1", "e3" } },
{ factory = AlliedBarracks2, types = { "e1", "e3" } }, { factory = AlliedBarracks2, types = { "e1", "e3" } },
{ factory = SovietBarracks1, types = { "ant" } }, { factory = SovietBarracks1, types = { "ant" } },
{ factory = SovietBarracks2, types = { "ant" } }, { factory = SovietBarracks2, types = { "ant" } },
{ factory = SovietBarracks3, types = { "ant" } }, { factory = SovietBarracks3, types = { "ant" } },
{ factory = AlliedWarFactory1, types = { "jeep", "1tnk", "2tnk", "arty", "ctnk" } }, { factory = AlliedWarFactory1, types = { "jeep", "1tnk", "2tnk", "arty", "ctnk" } },
{ factory = SovietWarFactory1, types = { "3tnk", "4tnk", "v2rl", "ttnk", "apc" } } { factory = SovietWarFactory1, types = { "3tnk", "4tnk", "v2rl", "ttnk", "apc" } }
} }
@@ -28,11 +28,11 @@ else
ProxyType = "powerproxy.paratroopers" ProxyType = "powerproxy.paratroopers"
ProducedUnitTypes = ProducedUnitTypes =
{ {
{ factory = AlliedBarracks1, types = { "e1", "e3" } }, { factory = AlliedBarracks1, types = { "e1", "e3" } },
{ factory = AlliedBarracks2, types = { "e1", "e3" } }, { factory = AlliedBarracks2, types = { "e1", "e3" } },
{ factory = SovietBarracks1, types = { "dog", "e1", "e2", "e3", "e4", "shok" } }, { factory = SovietBarracks1, types = { "dog", "e1", "e2", "e3", "e4", "shok" } },
{ factory = SovietBarracks2, types = { "dog", "e1", "e2", "e3", "e4", "shok" } }, { factory = SovietBarracks2, types = { "dog", "e1", "e2", "e3", "e4", "shok" } },
{ factory = SovietBarracks3, types = { "dog", "e1", "e2", "e3", "e4", "shok" } }, { factory = SovietBarracks3, types = { "dog", "e1", "e2", "e3", "e4", "shok" } },
{ factory = AlliedWarFactory1, types = { "jeep", "1tnk", "2tnk", "arty", "ctnk" } }, { factory = AlliedWarFactory1, types = { "jeep", "1tnk", "2tnk", "arty", "ctnk" } },
{ factory = SovietWarFactory1, types = { "3tnk", "4tnk", "v2rl", "ttnk", "apc" } } { factory = SovietWarFactory1, types = { "3tnk", "4tnk", "v2rl", "ttnk", "apc" } }
} }
@@ -160,7 +160,7 @@ end
ChronoshiftAlliedUnits = function() ChronoshiftAlliedUnits = function()
local cells = Utils.ExpandFootprint({ ChronoshiftLocation.Location }, false) local cells = Utils.ExpandFootprint({ ChronoshiftLocation.Location }, false)
local units = { } local units = {}
for i = 1, #cells do for i = 1, #cells do
local unit = Actor.Create("2tnk", true, { Owner = Allies, Facing = Angle.North }) local unit = Actor.Create("2tnk", true, { Owner = Allies, Facing = Angle.North })
BindActorTriggers(unit) BindActorTriggers(unit)