Convert Lua array-like structures to use named entries

This commit is contained in:
atlimit8
2015-10-18 15:14:11 -05:00
parent c87c2270ca
commit f79ac636f2
18 changed files with 265 additions and 267 deletions

View File

@@ -11,19 +11,19 @@ GDIReinforcements = { "e2", "e2", "e2", "e2", "e2" }
GDIReinforcementsWaypoints = { GDIReinforcementsEntry.Location, GDIReinforcementsWP1.Location } GDIReinforcementsWaypoints = { GDIReinforcementsEntry.Location, GDIReinforcementsWP1.Location }
NodHelis = { NodHelis = {
{ DateTime.Seconds(HeliDelay[1]), { NodHeliEntry.Location, NodHeliLZ1.Location }, { "e1", "e1", "e3" } }, { delay = DateTime.Seconds(HeliDelay[1]), entry = { NodHeliEntry.Location, NodHeliLZ1.Location }, types = { "e1", "e1", "e3" } },
{ DateTime.Seconds(HeliDelay[2]), { NodHeliEntry.Location, NodHeliLZ2.Location }, { "e1", "e1", "e1", "e1" } }, { delay = DateTime.Seconds(HeliDelay[2]), entry = { NodHeliEntry.Location, NodHeliLZ2.Location }, types = { "e1", "e1", "e1", "e1" } },
{ DateTime.Seconds(HeliDelay[3]), { NodHeliEntry.Location, NodHeliLZ3.Location }, { "e1", "e1", "e3" } } { delay = DateTime.Seconds(HeliDelay[3]), entry = { NodHeliEntry.Location, NodHeliLZ3.Location }, types = { "e1", "e1", "e3" } }
} }
SendHeli = function(heli) SendHeli = function(heli)
units = Reinforcements.ReinforceWithTransport(enemy, "tran", heli[3], heli[2], { heli[2][1] }) units = Reinforcements.ReinforceWithTransport(enemy, "tran", heli.types, heli.entry, { heli.entry[1] })
Utils.Do(units[2], function(actor) Utils.Do(units[2], function(actor)
actor.Hunt() actor.Hunt()
Trigger.OnIdle(actor, actor.Hunt) Trigger.OnIdle(actor, actor.Hunt)
Trigger.OnKilled(actor, KillCounter) Trigger.OnKilled(actor, KillCounter)
end) end)
Trigger.AfterDelay(heli[1], function() SendHeli(heli) end) Trigger.AfterDelay(heli.delay, function() SendHeli(heli) end)
end end
SendGDIReinforcements = function() SendGDIReinforcements = function()
@@ -134,7 +134,7 @@ WorldLoaded = function()
BuildNod1() BuildNod1()
Utils.Do(NodHelis, function(heli) Utils.Do(NodHelis, function(heli)
Trigger.AfterDelay(heli[1], function() SendHeli(heli) end) Trigger.AfterDelay(heli.delay, function() SendHeli(heli) end)
end) end)
autoTrigger = false autoTrigger = false

View File

@@ -28,25 +28,25 @@ AttackUnitTypes =
{ {
Easy = Easy =
{ {
{ HandOfNod, { "e1", "e1" } }, { factory = HandOfNod, types = { "e1", "e1" } },
{ HandOfNod, { "e1", "e3" } }, { factory = HandOfNod, types = { "e1", "e3" } },
{ HandOfNod, { "e1", "e1", "e3" } }, { factory = HandOfNod, types = { "e1", "e1", "e3" } },
{ HandOfNod, { "e1", "e3", "e3" } }, { factory = HandOfNod, types = { "e1", "e3", "e3" } },
}, },
Normal = Normal =
{ {
{ HandOfNod, { "e1", "e1", "e3" } }, { factory = HandOfNod, types = { "e1", "e1", "e3" } },
{ HandOfNod, { "e1", "e3", "e3" } }, { factory = HandOfNod, types = { "e1", "e3", "e3" } },
{ HandOfNod, { "e1", "e1", "e3", "e3" } }, { factory = HandOfNod, types = { "e1", "e1", "e3", "e3" } },
{ Airfield, { "bggy" } }, { factory = Airfield, types = { "bggy" } },
}, },
Hard = Hard =
{ {
{ HandOfNod, { "e1", "e1", "e3", "e3" } }, { factory = HandOfNod, types = { "e1", "e1", "e3", "e3" } },
{ HandOfNod, { "e1", "e1", "e1", "e3", "e3" } }, { factory = HandOfNod, types = { "e1", "e1", "e1", "e3", "e3" } },
{ HandOfNod, { "e1", "e1", "e3", "e3", "e3" } }, { factory = HandOfNod, types = { "e1", "e1", "e3", "e3", "e3" } },
{ Airfield, { "bggy" } }, { factory = Airfield, types = { "bggy" } },
{ Airfield, { "ltnk" } }, { factory = Airfield, types = { "ltnk" } },
} }
} }
AttackPaths = AttackPaths =
@@ -68,9 +68,9 @@ Build = function(factory, units, action)
end end
Attack = function() Attack = function()
local types = Utils.Random(AttackUnitTypes[Map.Difficulty]) local production = Utils.Random(AttackUnitTypes[Map.Difficulty])
local path = Utils.Random(AttackPaths) local path = Utils.Random(AttackPaths)
Build(types[1], types[2], function(units) Build(production.factory, production.types, function(units)
Utils.Do(units, function(unit) Utils.Do(units, function(unit)
if unit.Owner ~= enemy then return end if unit.Owner ~= enemy then return end
unit.Patrol(path, false) unit.Patrol(path, false)

View File

@@ -8,14 +8,14 @@ AtkRoute2 = { waypoint0.Location, waypoint1.Location, waypoint2.Location, waypoi
AutoCreateTeams = AutoCreateTeams =
{ {
{ { ['e1'] = 1, ['e3'] = 3 }, AtkRoute2 }, { types = { e1 = 1, e3 = 3 }, route = AtkRoute2 },
{ { ['e1'] = 3, ['e3'] = 1 }, AtkRoute2 }, { types = { e1 = 3, e3 = 1 }, route = AtkRoute2 },
{ { ['e3'] = 4 } , AtkRoute1 }, { types = { e3 = 4 } , route = AtkRoute1 },
{ { ['e1'] = 4 } , AtkRoute1 }, { types = { e1 = 4 } , route = AtkRoute1 },
{ { ['bggy'] = 1 } , AtkRoute1 }, { types = { bggy = 1 } , route = AtkRoute1 },
{ { ['bggy'] = 1 } , AtkRoute2 }, { types = { bggy = 1 } , route = AtkRoute2 },
{ { ['ltnk'] = 1 } , AtkRoute1 }, { types = { ltnk = 1 } , route = AtkRoute1 },
{ { ['ltnk'] = 1 } , AtkRoute2 } { types = { ltnk = 1 } , route = AtkRoute2 }
} }
RepairThreshold = 0.6 RepairThreshold = 0.6
@@ -55,8 +55,8 @@ end
AutoCreateTeam = function() AutoCreateTeam = function()
local team = Utils.Random(AutoCreateTeams) local team = Utils.Random(AutoCreateTeams)
for type, count in pairs(team[1]) do for type, count in pairs(team.types) do
MoveThenHunt(Utils.Take(count, enemy.GetActorsByType(type)), team[2]) MoveThenHunt(Utils.Take(count, enemy.GetActorsByType(type)), team.route)
end end
Trigger.AfterDelay(Utils.RandomInteger(AutoAtkMinDelay, AutoAtkMaxDelay), AutoCreateTeam) Trigger.AfterDelay(Utils.RandomInteger(AutoAtkMinDelay, AutoAtkMaxDelay), AutoCreateTeam)

View File

@@ -15,23 +15,23 @@ if Map.Difficulty == "Easy" then
TimerTicks = DateTime.Minutes(10) TimerTicks = DateTime.Minutes(10)
Announcements = Announcements =
{ {
{ "TenMinutesRemaining", DateTime.Seconds(3) }, { speech = "TenMinutesRemaining", delay = DateTime.Seconds(3) },
{ "WarningFiveMinutesRemaining", DateTime.Minutes(5) }, { speech = "WarningFiveMinutesRemaining", delay = DateTime.Minutes(5) },
{ "WarningFourMinutesRemaining", DateTime.Minutes(6) }, { speech = "WarningFourMinutesRemaining", delay = DateTime.Minutes(6) },
{ "WarningThreeMinutesRemaining", DateTime.Minutes(7) }, { speech = "WarningThreeMinutesRemaining", delay = DateTime.Minutes(7) },
{ "WarningTwoMinutesRemaining", DateTime.Minutes(8) }, { speech = "WarningTwoMinutesRemaining", delay = DateTime.Minutes(8) },
{ "WarningOneMinuteRemaining", DateTime.Minutes(9) } { speech = "WarningOneMinuteRemaining", delay = DateTime.Minutes(9) }
} }
elseif Map.Difficulty == "Normal" then elseif Map.Difficulty == "Normal" then
TimerTicks = DateTime.Minutes(5) TimerTicks = DateTime.Minutes(5)
Announcements = Announcements =
{ {
{ "WarningFiveMinutesRemaining", DateTime.Seconds(3) }, { speech = "WarningFiveMinutesRemaining", delay = DateTime.Seconds(3) },
{ "WarningFourMinutesRemaining", DateTime.Minutes(1) }, { speech = "WarningFourMinutesRemaining", delay = DateTime.Minutes(1) },
{ "WarningThreeMinutesRemaining", DateTime.Minutes(2) }, { speech = "WarningThreeMinutesRemaining", delay = DateTime.Minutes(2) },
{ "WarningTwoMinutesRemaining", DateTime.Minutes(3) }, { speech = "WarningTwoMinutesRemaining", delay = DateTime.Minutes(3) },
{ "WarningOneMinuteRemaining", DateTime.Minutes(4) } { speech = "WarningOneMinuteRemaining", delay = DateTime.Minutes(4) }
} }
InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "e1" } InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "e1" }
@@ -42,9 +42,9 @@ elseif Map.Difficulty == "Hard" then
TimerTicks = DateTime.Minutes(3) TimerTicks = DateTime.Minutes(3)
Announcements = Announcements =
{ {
{ "WarningThreeMinutesRemaining", DateTime.Seconds(3) }, { speech = "WarningThreeMinutesRemaining", delay = DateTime.Seconds(3) },
{ "WarningTwoMinutesRemaining", DateTime.Minutes(1) }, { speech = "WarningTwoMinutesRemaining", delay = DateTime.Minutes(1) },
{ "WarningOneMinuteRemaining", DateTime.Minutes(2) }, { speech = "WarningOneMinuteRemaining", delay = DateTime.Minutes(2) },
} }
InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "e1" } InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "e1" }
@@ -55,7 +55,7 @@ elseif Map.Difficulty == "Hard" then
else else
TimerTicks = DateTime.Minutes(1) TimerTicks = DateTime.Minutes(1)
Announcements = { { "WarningOneMinuteRemaining", DateTime.Seconds(3) } } Announcements = { { speech = "WarningOneMinuteRemaining", delay = DateTime.Seconds(3) } }
ConstructionVehicleReinforcements = { "jeep" } ConstructionVehicleReinforcements = { "jeep" }
InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "dog", "dog" } InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "dog", "dog" }
@@ -229,9 +229,9 @@ end
ConvoyTimerAnnouncements = function() ConvoyTimerAnnouncements = function()
for i = #Announcements, 1, -1 do for i = #Announcements, 1, -1 do
Trigger.AfterDelay(Announcements[i][2], function() Trigger.AfterDelay(Announcements[i].delay, function()
if not ConvoyOnSite then if not ConvoyOnSite then
Media.PlaySpeechNotification(player, Announcements[i][1]) Media.PlaySpeechNotification(player, Announcements[i].speech)
end end
end) end)
end end

View File

@@ -29,9 +29,9 @@ HeliReinforcements = { "medi", "mech", "mech" }
GreeceReinforcements = GreeceReinforcements =
{ {
{ { "2tnk", "2tnk", "2tnk", "arty", "arty" }, { SpyEntry.Location, SpyLoadout.Location } }, { types = { "2tnk", "2tnk", "2tnk", "arty", "arty" }, entry = { SpyEntry.Location, SpyLoadout.Location } },
{ { "e3", "e3", "e3", "e6", "e6" }, { SpyEntry.Location, GreeceLoadout1.Location } }, { types = { "e3", "e3", "e3", "e6", "e6" }, entry = { SpyEntry.Location, GreeceLoadout1.Location } },
{ { "jeep", "jeep", "e1", "e1", "2tnk" }, { SpyEntry.Location, GreeceLoadout2.Location } } { types = { "jeep", "jeep", "e1", "e1", "2tnk" }, entry = { SpyEntry.Location, GreeceLoadout2.Location } }
} }
DogPatrol = { Dog1, Dog2 } DogPatrol = { Dog1, Dog2 }
@@ -104,8 +104,8 @@ SendReinforcements = function()
Camera.Position = ReinforceCamera.CenterPosition Camera.Position = ReinforceCamera.CenterPosition
greece.Cash = greece.Cash + ReinforceCash greece.Cash = greece.Cash + ReinforceCash
Utils.Do(GreeceReinforcements, function(reinforceTable) Utils.Do(GreeceReinforcements, function(reinforcements)
Reinforcements.ReinforceWithTransport(greece, InsertionTransport, reinforceTable[1], reinforceTable[2], { SpyEntry.Location }) Reinforcements.ReinforceWithTransport(greece, InsertionTransport, reinforcements.types, reinforcements.entry, { SpyEntry.Location })
end) end)
Media.PlaySpeechNotification(greece, "AlliedReinforcementsArrived") Media.PlaySpeechNotification(greece, "AlliedReinforcementsArrived")

View File

@@ -4,13 +4,13 @@ if DateTime.IsHalloween then
ProxyType = "powerproxy.parazombies" ProxyType = "powerproxy.parazombies"
ProducedUnitTypes = ProducedUnitTypes =
{ {
{ AlliedBarracks1, { "e1", "e3" } }, { factory = AlliedBarracks1, types = { "e1", "e3" } },
{ AlliedBarracks2, { "e1", "e3" } }, { factory = AlliedBarracks2, types = { "e1", "e3" } },
{ SovietBarracks1, { "ant" } }, { factory = SovietBarracks1, types = { "ant" } },
{ SovietBarracks2, { "ant" } }, { factory = SovietBarracks2, types = { "ant" } },
{ SovietBarracks3, { "ant" } }, { factory = SovietBarracks3, types = { "ant" } },
{ AlliedWarFactory1, { "jeep", "1tnk", "2tnk", "arty", "ctnk" } }, { factory = AlliedWarFactory1, types = { "jeep", "1tnk", "2tnk", "arty", "ctnk" } },
{ SovietWarFactory1, { "3tnk", "4tnk", "v2rl", "ttnk", "apc" } } { factory = SovietWarFactory1, types = { "3tnk", "4tnk", "v2rl", "ttnk", "apc" } }
} }
else else
UnitTypes = { "3tnk", "ftrk", "ttnk", "apc" } UnitTypes = { "3tnk", "ftrk", "ttnk", "apc" }
@@ -18,13 +18,13 @@ else
ProxyType = "powerproxy.paratroopers" ProxyType = "powerproxy.paratroopers"
ProducedUnitTypes = ProducedUnitTypes =
{ {
{ AlliedBarracks1, { "e1", "e3" } }, { factory = AlliedBarracks1, types = { "e1", "e3" } },
{ AlliedBarracks2, { "e1", "e3" } }, { factory = AlliedBarracks2, types = { "e1", "e3" } },
{ SovietBarracks1, { "dog", "e1", "e2", "e3", "e4", "shok" } }, { factory = SovietBarracks1, types = { "dog", "e1", "e2", "e3", "e4", "shok" } },
{ SovietBarracks2, { "dog", "e1", "e2", "e3", "e4", "shok" } }, { factory = SovietBarracks2, types = { "dog", "e1", "e2", "e3", "e4", "shok" } },
{ SovietBarracks3, { "dog", "e1", "e2", "e3", "e4", "shok" } }, { factory = SovietBarracks3, types = { "dog", "e1", "e2", "e3", "e4", "shok" } },
{ AlliedWarFactory1, { "jeep", "1tnk", "2tnk", "arty", "ctnk" } }, { factory = AlliedWarFactory1, types = { "jeep", "1tnk", "2tnk", "arty", "ctnk" } },
{ SovietWarFactory1, { "3tnk", "4tnk", "v2rl", "ttnk", "apc" } } { factory = SovietWarFactory1, types = { "3tnk", "4tnk", "v2rl", "ttnk", "apc" } }
} }
end end
@@ -102,9 +102,9 @@ ParadropSovietUnits = function()
end end
ProduceUnits = function(t) ProduceUnits = function(t)
local factory = t[1] local factory = t.factory
if not factory.IsDead then if not factory.IsDead then
local unitType = t[2][Utils.RandomInteger(1, #t[2] + 1)] local unitType = t.types[Utils.RandomInteger(1, #t.types + 1)]
factory.Wait(Actor.BuildTime(unitType)) factory.Wait(Actor.BuildTime(unitType))
factory.Produce(unitType) factory.Produce(unitType)
factory.CallFunc(function() ProduceUnits(t) end) factory.CallFunc(function() ProduceUnits(t) end)
@@ -121,8 +121,8 @@ SetupAlliedUnits = function()
end end
SetupFactories = function() SetupFactories = function()
Utils.Do(ProducedUnitTypes, function(pair) Utils.Do(ProducedUnitTypes, function(production)
Trigger.OnProduction(pair[1], function(_, a) BindActorTriggers(a) end) Trigger.OnProduction(production.factory, function(_, a) BindActorTriggers(a) end)
end) end)
end end

View File

@@ -15,87 +15,87 @@ Snipers = { Sniper1, Sniper2, Sniper3, Sniper4, Sniper5, Sniper6, Sniper7, Snipe
Wave = 0 Wave = 0
Waves = Waves =
{ {
{ 500, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 500, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 750, PatrolWaypoints, Patrol, ParadropWaypoints }, { delay = 750, entries = PatrolWaypoints, units = Patrol, targets = ParadropWaypoints },
{ 750, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 750, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Vehicles, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Vehicles, targets = SpawnPoints },
{ 1500, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1500, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1500, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1500, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Vehicles, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Vehicles, targets = SpawnPoints },
{ 1500, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1500, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Tank, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Tank, targets = SpawnPoints },
{ 1, SovietEntryPoints, Vehicles, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Vehicles, targets = SpawnPoints },
{ 1500, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1500, entries = SovietEntryPoints, Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Tank, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Tank, targets = SpawnPoints },
{ 1, SovietEntryPoints, Tank, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Tank, targets = SpawnPoints },
{ 1500, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1500, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, LongRange, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = LongRange, targets = SpawnPoints },
{ 1500, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1500, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, LongRange, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = LongRange, targets = SpawnPoints },
{ 1, SovietEntryPoints, Tank, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Tank, targets = SpawnPoints },
{ 1, SovietEntryPoints, LongRange, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = LongRange, targets = SpawnPoints },
{ 1500, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1500, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, LongRange, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = LongRange, targets = SpawnPoints },
{ 1, SovietEntryPoints, LongRange, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = LongRange, targets = SpawnPoints },
{ 1, SovietEntryPoints, Tank, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Tank, targets = SpawnPoints },
{ 1, SovietEntryPoints, Tank, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Tank, targets = SpawnPoints },
{ 1, SovietEntryPoints, Vehicles, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Vehicles, targets = SpawnPoints },
{ 1500, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1500, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Infantry, SpawnPoints }, { delay = 1, entries = SovietEntryPoints, units = Infantry, targets = SpawnPoints },
{ 1, SovietEntryPoints, Boss, SpawnPoints } { delay = 1, entries = SovietEntryPoints, units = Boss, targets = SpawnPoints }
} }
SendUnits = function(entryCell, unitTypes, interval, targetCell) SendUnits = function(entryCell, unitTypes, interval, targetCell)
@@ -121,13 +121,11 @@ SendWave = function()
Wave = Wave + 1 Wave = Wave + 1
local wave = Waves[Wave] local wave = Waves[Wave]
local delay = wave[1] local entry = Utils.Random(wave.entries).Location
local entry = Utils.Random(wave[2]).Location local target = Utils.Random(wave.targets).Location
local units = wave[3]
local target = Utils.Random(wave[4]).Location
Trigger.AfterDelay(delay, function() Trigger.AfterDelay(wave.delay, function()
SendUnits(entry, units, 40, target) SendUnits(entry, wave.units, 40, target)
if not played then if not played then
played = true played = true

View File

@@ -1,8 +1,8 @@
AlliedUnits = AlliedUnits =
{ {
{ 0, { "1tnk", "1tnk", "2tnk", "2tnk" } }, { delay = 0, types = { "1tnk", "1tnk", "2tnk", "2tnk" } },
{ DateTime.Seconds(3), { "e1", "e1", "e1", "e3", "e3" } }, { delay = DateTime.Seconds(3), types = { "e1", "e1", "e1", "e3", "e3" } },
{ DateTime.Seconds(7), { "e6" } } { delay = DateTime.Seconds(7), types = { "e6" } }
} }
ReinforceBaseUnits = { "1tnk", "1tnk", "2tnk", "arty", "arty" } ReinforceBaseUnits = { "1tnk", "1tnk", "2tnk", "arty", "arty" }
CivilianEvacuees = { "c1", "c2", "c5", "c7", "c8" } CivilianEvacuees = { "c1", "c2", "c5", "c7", "c8" }
@@ -102,8 +102,8 @@ SendAlliedUnits = function()
Media.PlaySpeechNotification(player, "ReinforcementsArrived") Media.PlaySpeechNotification(player, "ReinforcementsArrived")
Utils.Do(AlliedUnits, function(table) Utils.Do(AlliedUnits, function(table)
Trigger.AfterDelay(table[1], function() Trigger.AfterDelay(table.delay, function()
Reinforcements.Reinforce(player, table[2], { StartEntryPoint.Location, StartMovePoint.Location }, 18) Reinforcements.Reinforce(player, table.types, { StartEntryPoint.Location, StartMovePoint.Location }, 18)
end) end)
end) end)

View File

@@ -11,12 +11,15 @@ IdlingUnits = function()
end) end)
end end
BaseBarracks = { type = "tent", pos = CVec.New(-9, 6), cost = 400, exists = true }
BaseProc = { type = "proc", pos = CVec.New(4, 7), cost = 1400, exists = true }
BaseWeaponsFactory = { type = "weap", pos = CVec.New(8, -1), cost = 2000, exists = true }
BaseBuildings = BaseBuildings =
{ {
{ "powr", CVec.New(0, 4), 300 }, { type = "powr", pos = CVec.New(0, 4), cost = 300 },
{ "tent", CVec.New(-9, 6), 400, true }, BaseBarracks,
{ "proc", CVec.New(4, 7), 1400, true }, BaseProc,
{ "weap", CVec.New(8, -1), 2000, true } BaseWeaponsFactory
} }
BuildBase = function() BuildBase = function()
@@ -27,7 +30,7 @@ BuildBase = function()
end end
for i,v in ipairs(BaseBuildings) do for i,v in ipairs(BaseBuildings) do
if not v[4] then if not v.exists then
BuildBuilding(v) BuildBuilding(v)
return return
end end
@@ -37,12 +40,12 @@ BuildBase = function()
end end
BuildBuilding = function(building) BuildBuilding = function(building)
Trigger.AfterDelay(Actor.BuildTime(building[1]), function() Trigger.AfterDelay(Actor.BuildTime(building.type), function()
local actor = Actor.Create(building[1], true, { Owner = Greece, Location = GreeceCYard.Location + building[2] }) local actor = Actor.Create(building.type, true, { Owner = Greece, Location = GreeceCYard.Location + building.pos })
Greece.Cash = Greece.Cash - building[3] Greece.Cash = Greece.Cash - building.cost
building[4] = true building.exists = true
Trigger.OnKilled(actor, function() building[4] = true end) Trigger.OnKilled(actor, function() building.exists = false end)
Trigger.OnDamaged(actor, function(building) Trigger.OnDamaged(actor, function(building)
if building.Owner == Greece and building.Health < building.MaxHealth * 3/4 then if building.Owner == Greece and building.Health < building.MaxHealth * 3/4 then
building.StartBuildingRepairs() building.StartBuildingRepairs()
@@ -54,7 +57,7 @@ BuildBuilding = function(building)
end end
ProduceInfantry = function() ProduceInfantry = function()
if not BaseBuildings[2][4] then if not BaseBarracks.exists then
return return
elseif Harvester.IsDead and Greece.Resources <= 299 then elseif Harvester.IsDead and Greece.Resources <= 299 then
return return
@@ -77,7 +80,7 @@ ProduceInfantry = function()
end end
ProduceArmor = function() ProduceArmor = function()
if not BaseBuildings[4][4] then if not BaseWeaponsFactory.exists then
return return
elseif Harvester.IsDead and Greece.Resources <= 599 then elseif Harvester.IsDead and Greece.Resources <= 599 then
return return

View File

@@ -24,15 +24,15 @@ RunInitialActivities = function()
Media.PlaySpeechNotification(player, "ReinforcementsArrived") Media.PlaySpeechNotification(player, "ReinforcementsArrived")
Trigger.OnKilled(Barr, function(building) Trigger.OnKilled(Barr, function(building)
BaseBuildings[2][4] = false BaseBarracks.exists = false
end) end)
Trigger.OnKilled(Proc, function(building) Trigger.OnKilled(Proc, function(building)
BaseBuildings[3][4] = false BaseProc.exists = false
end) end)
Trigger.OnKilled(Weap, function(building) Trigger.OnKilled(Weap, function(building)
BaseBuildings[4][4] = false BaseWeaponsFactory.exists = false
end) end)
Trigger.OnEnteredFootprint(VillageCamArea, function(actor, id) Trigger.OnEnteredFootprint(VillageCamArea, function(actor, id)

View File

@@ -11,13 +11,12 @@ IdlingUnits = function()
end) end)
end end
BaseBuildings = BasePower = { type = "powr", pos = CVec.New(-4, -2), cost = 300, exists = true }
{ BaseBarracks = { type = "tent", pos = CVec.New(-8, 1), cost = 400, exists = true }
{ "powr", CVec.New(-4, -2), 300, true }, BaseProc = { type = "proc", pos = CVec.New(-5, 1), cost = 1400, exists = true }
{ "tent", CVec.New(-8, 1), 400, true }, BaseWeaponsFactory = { type = "weap", pos = CVec.New(-12, -1), cost = 2000, exists = true }
{ "proc", CVec.New(-5, 1), 1400, true },
{ "weap", CVec.New(-12, -1), 2000, true } BaseBuildings = { BasePower, BaseBarracks, BaseProc, BaseWeaponsFactory }
}
BuildBase = function() BuildBase = function()
if CYard.IsDead or CYard.Owner ~= Greece then if CYard.IsDead or CYard.Owner ~= Greece then
@@ -27,7 +26,7 @@ BuildBase = function()
end end
for i,v in ipairs(BaseBuildings) do for i,v in ipairs(BaseBuildings) do
if not v[4] then if not v.exists then
BuildBuilding(v) BuildBuilding(v)
return return
end end
@@ -37,12 +36,12 @@ BuildBase = function()
end end
BuildBuilding = function(building) BuildBuilding = function(building)
Trigger.AfterDelay(Actor.BuildTime(building[1]), function() Trigger.AfterDelay(Actor.BuildTime(building.type), function()
local actor = Actor.Create(building[1], true, { Owner = Greece, Location = GreeceCYard.Location + building[2] }) local actor = Actor.Create(building.type, true, { Owner = Greece, Location = GreeceCYard.Location + building.pos })
Greece.Cash = Greece.Cash - building[3] Greece.Cash = Greece.Cash - building.cost
building[4] = true building.exists = true
Trigger.OnKilled(actor, function() building[4] = true end) Trigger.OnKilled(actor, function() building.exists = false end)
Trigger.OnDamaged(actor, function(building) Trigger.OnDamaged(actor, function(building)
if building.Owner == Greece and building.Health < building.MaxHealth * 3/4 then if building.Owner == Greece and building.Health < building.MaxHealth * 3/4 then
building.StartBuildingRepairs() building.StartBuildingRepairs()
@@ -54,7 +53,7 @@ BuildBuilding = function(building)
end end
ProduceInfantry = function() ProduceInfantry = function()
if not BaseBuildings[2][4] then if not BaseBarracks.exists then
return return
elseif Harvester.IsDead and Greece.Resources <= 299 then elseif Harvester.IsDead and Greece.Resources <= 299 then
return return
@@ -77,7 +76,7 @@ ProduceInfantry = function()
end end
ProduceArmor = function() ProduceArmor = function()
if not BaseBuildings[4][4] then if not BaseWeaponsFactory.exists then
return return
elseif Harvester.IsDead and Greece.Resources <= 599 then elseif Harvester.IsDead and Greece.Resources <= 599 then
return return

View File

@@ -22,19 +22,19 @@ RunInitialActivities = function()
end) end)
Trigger.OnKilled(Powr, function(building) Trigger.OnKilled(Powr, function(building)
BaseBuildings[1][4] = false BasePower.exists = false
end) end)
Trigger.OnKilled(Barr, function(building) Trigger.OnKilled(Barr, function(building)
BaseBuildings[2][4] = false BaseBarracks.exists = false
end) end)
Trigger.OnKilled(Proc, function(building) Trigger.OnKilled(Proc, function(building)
BaseBuildings[3][4] = false BaseProc.exists = false
end) end)
Trigger.OnKilled(Weap, function(building) Trigger.OnKilled(Weap, function(building)
BaseBuildings[4][4] = false BaseWeaponsFactory.exists = false
end) end)
Trigger.OnEnteredFootprint(VillageCamArea, function(actor, id) Trigger.OnEnteredFootprint(VillageCamArea, function(actor, id)

View File

@@ -13,28 +13,28 @@ IdlingUnits = function()
end end
BaseBuildings = { BaseBuildings = {
{ "powr", CVec.New(3, -2), 300 }, { type = "powr", pos = CVec.New(3, -2), cost = 300 },
{ "tent", CVec.New(0, 4), 400 }, { type = "tent", pos = CVec.New(0, 4), cost = 400 },
{ "hbox", CVec.New(3, 6), 600 }, { type = "hbox", pos = CVec.New(3, 6), cost = 600 },
{ "proc", CVec.New(4, 2), 1400 }, { type = "proc", pos = CVec.New(4, 2), cost = 1400 },
{ "powr", CVec.New(5, -3), 300 }, { type = "powr", pos = CVec.New(5, -3), cost = 300 },
{ "weap", CVec.New(-5, 3), 2000 }, { type = "weap", pos = CVec.New(-5, 3), cost = 2000 },
{ "hbox", CVec.New(-6, 5), 600 }, { type = "hbox", pos = CVec.New(-6, 5), cost = 600 },
{ "gun", CVec.New(0, 8), 600 }, { type = "gun", pos = CVec.New(0, 8), cost = 600 },
{ "gun", CVec.New(-4, 7), 600 }, { type = "gun", pos = CVec.New(-4, 7), cost = 600 },
{ "powr", CVec.New(-4, -3), 300 }, { type = "powr", pos = CVec.New(-4, -3), cost = 300 },
{ "proc", CVec.New(-9, 1), 1400 }, { type = "proc", pos = CVec.New(-9, 1), cost = 1400 },
{ "powr", CVec.New(-8, -2), 300 }, { type = "powr", pos = CVec.New(-8, -2), cost = 300 },
{ "silo", CVec.New(6, 0), 150 }, { type = "silo", pos = CVec.New(6, 0), cost = 150 },
{ "agun", CVec.New(-3, 0), 800 }, { type = "agun", pos = CVec.New(-3, 0), cost = 800 },
{ "powr", CVec.New(-6, -2), 300 }, { type = "powr", pos = CVec.New(-6, -2), cost = 300 },
{ "agun", CVec.New(4, 1), 800 }, { type = "agun", pos = CVec.New(4, 1), cost = 800 },
{ "gun", CVec.New(-9, 5), 600 }, { type = "gun", pos = CVec.New(-9, 5), cost = 600 },
{ "gun", CVec.New(-2, -3), 600 }, { type = "gun", pos = CVec.New(-2, -3), cost = 600 },
{ "powr", CVec.New(4, 6), 300 }, { type = "powr", pos = CVec.New(4, 6), cost = 300 },
{ "gun", CVec.New(3, -6), 600 }, { type = "gun", pos = CVec.New(3, -6), cost = 600 },
{ "hbox", CVec.New(3, -4), 600 }, { type = "hbox", pos = CVec.New(3, -4), cost = 600 },
{ "gun", CVec.New(2, 3), 600 } { type = "gun", pos = CVec.New(2, 3), cost = 600 }
} }
BuildBase = function() BuildBase = function()
@@ -43,7 +43,7 @@ BuildBase = function()
end end
for i,v in ipairs(BaseBuildings) do for i,v in ipairs(BaseBuildings) do
if not v[4] then if not v.exists then
BuildBuilding(v) BuildBuilding(v)
return return
end end
@@ -53,12 +53,12 @@ BuildBase = function()
end end
BuildBuilding = function(building) BuildBuilding = function(building)
Trigger.AfterDelay(Actor.BuildTime(building[1]), function() Trigger.AfterDelay(Actor.BuildTime(building.type), function()
local actor = Actor.Create(building[1], true, { Owner = GoodGuy, Location = MCVDeploy.Location + building[2] }) local actor = Actor.Create(building.type, true, { Owner = GoodGuy, Location = MCVDeploy.Location + building.pos })
GoodGuy.Cash = GoodGuy.Cash - building[3] GoodGuy.Cash = GoodGuy.Cash - building.cost
building[4] = true building.exists = true
Trigger.OnKilled(actor, function() building[4] = false end) Trigger.OnKilled(actor, function() building.exists = false end)
Trigger.OnDamaged(actor, function(building) Trigger.OnDamaged(actor, function(building)
if building.Owner == GoodGuy and building.Health < building.MaxHealth * 3/4 then if building.Owner == GoodGuy and building.Health < building.MaxHealth * 3/4 then
building.StartBuildingRepairs() building.StartBuildingRepairs()

View File

@@ -11,14 +11,13 @@ IdlingUnits = function()
end) end)
end end
BaseBuildings = BaseApwr = { type = "apwr", pos = CVec.New(-13, 7), cost = 500, exists = true }
{ BaseTent = { type = "tent", pos = CVec.New(-2, 12), cost = 400, exists = true }
{ "apwr", CVec.New(-13, 7), 500, true }, BaseProc = { type = "proc", pos = CVec.New(-7, 5), cost = 1400, exists = true }
{ "tent", CVec.New(-2, 12), 400, true }, BaseWeap = { type = "weap", pos = CVec.New(-9, 11), cost = 2000, exists = true }
{ "proc", CVec.New(-7, 5), 1400, true }, BaseApwr2 = { type = "apwr", pos = CVec.New(-4, 1), cost = 500, exists = true }
{ "weap", CVec.New(-9, 11), 2000, true },
{ "apwr", CVec.New(-4, 1), 500, true } BaseBuildings = { BaseApwr, BaseTent, BaseProc, BaseWeap, BaseApwr2 }
}
BuildBase = function() BuildBase = function()
if CYard.IsDead or CYard.Owner ~= enemy then if CYard.IsDead or CYard.Owner ~= enemy then
@@ -28,7 +27,7 @@ BuildBase = function()
end end
for i,v in ipairs(BaseBuildings) do for i,v in ipairs(BaseBuildings) do
if not v[4] then if not v.exists then
BuildBuilding(v) BuildBuilding(v)
return return
end end
@@ -38,12 +37,12 @@ BuildBase = function()
end end
BuildBuilding = function(building) BuildBuilding = function(building)
Trigger.AfterDelay(Actor.BuildTime(building[1]), function() Trigger.AfterDelay(Actor.BuildTime(building.type), function()
local actor = Actor.Create(building[1], true, { Owner = enemy, Location = CYardLocation.Location + building[2] }) local actor = Actor.Create(building.type, true, { Owner = enemy, Location = CYardLocation.Location + building.pos })
enemy.Cash = enemy.Cash - building[3] enemy.Cash = enemy.Cash - building.cost
building[4] = true building.exists = true
Trigger.OnKilled(actor, function() building[4] = false end) Trigger.OnKilled(actor, function() building.exists = false end)
Trigger.OnDamaged(actor, function(building) Trigger.OnDamaged(actor, function(building)
if building.Owner == enemy and building.Health < building.MaxHealth * 3/4 then if building.Owner == enemy and building.Health < building.MaxHealth * 3/4 then
building.StartBuildingRepairs() building.StartBuildingRepairs()

View File

@@ -57,23 +57,23 @@ Trigger.OnAllKilled(Trucks, function()
end) end)
Trigger.OnKilled(Apwr, function(building) Trigger.OnKilled(Apwr, function(building)
BaseBuildings[1][4] = false BaseApwr.exists = false
end) end)
Trigger.OnKilled(Barr, function(building) Trigger.OnKilled(Barr, function(building)
BaseBuildings[2][4] = false BaseTent.exists = false
end) end)
Trigger.OnKilled(Proc, function(building) Trigger.OnKilled(Proc, function(building)
BaseBuildings[3][4] = false BaseProc.exists = false
end) end)
Trigger.OnKilled(Weap, function(building) Trigger.OnKilled(Weap, function(building)
BaseBuildings[4][4] = false BaseWeap.exists = false
end) end)
Trigger.OnKilled(Apwr2, function(building) Trigger.OnKilled(Apwr2, function(building)
BaseBuildings[5][4] = false BaseApwr2.exists = false
end) end)
-- Activate the AI once the player deployed the Mcv -- Activate the AI once the player deployed the Mcv

View File

@@ -11,14 +11,13 @@ IdlingUnits = function()
end) end)
end end
BaseBuildings = BaseApwr = { type = "apwr", pos = CVec.New(5, -9), cost = 500, exists = true }
{ BaseTent = { type = "tent", pos = CVec.New(-4, -4), cost = 400, exists = true }
{ "apwr", CVec.New(5, -9), 500, true }, BaseProc = { type = "proc", pos = CVec.New(0, -8), cost = 1400, exists = true }
{ "tent", CVec.New(-4, -4), 400, true }, BaseWeap = { type = "weap", pos = CVec.New(-4, -8), cost = 2000, exists = true }
{ "proc", CVec.New(0, -8), 1400, true }, BaseApwr2 = { type = "apwr", pos = CVec.New(6, -5), cost = 500, exists = true }
{ "weap", CVec.New(-4, -8), 2000, true },
{ "apwr", CVec.New(6, -5), 500, true } BaseBuildings = { BaseApwr, BaseTent, BaseProc, BaseWeap, BaseApwr2 }
}
BuildBase = function() BuildBase = function()
if CYard.IsDead or CYard.Owner ~= enemy then if CYard.IsDead or CYard.Owner ~= enemy then
@@ -28,7 +27,7 @@ BuildBase = function()
end end
for i,v in ipairs(BaseBuildings) do for i,v in ipairs(BaseBuildings) do
if not v[4] then if not v.exists then
BuildBuilding(v) BuildBuilding(v)
return return
end end
@@ -38,12 +37,12 @@ BuildBase = function()
end end
BuildBuilding = function(building) BuildBuilding = function(building)
Trigger.AfterDelay(Actor.BuildTime(building[1]), function() Trigger.AfterDelay(Actor.BuildTime(building.type), function()
local actor = Actor.Create(building[1], true, { Owner = enemy, Location = CYardLocation.Location + building[2] }) local actor = Actor.Create(building.type, true, { Owner = enemy, Location = CYardLocation.Location + building.pos })
enemy.Cash = enemy.Cash - building[3] enemy.Cash = enemy.Cash - building.cost
building[4] = true building.exists = true
Trigger.OnKilled(actor, function() building[4] = false end) Trigger.OnKilled(actor, function() building.exists = false end)
Trigger.OnDamaged(actor, function(building) Trigger.OnDamaged(actor, function(building)
if building.Owner == enemy and building.Health < building.MaxHealth * 3/4 then if building.Owner == enemy and building.Health < building.MaxHealth * 3/4 then
building.StartBuildingRepairs() building.StartBuildingRepairs()

View File

@@ -28,23 +28,23 @@ Trigger.OnAllKilled(Trucks, function()
end) end)
Trigger.OnKilled(Apwr, function(building) Trigger.OnKilled(Apwr, function(building)
BaseBuildings[1][4] = false BaseApwr.exists = false
end) end)
Trigger.OnKilled(Barr, function(building) Trigger.OnKilled(Barr, function(building)
BaseBuildings[2][4] = false BaseTent.exists = false
end) end)
Trigger.OnKilled(Proc, function(building) Trigger.OnKilled(Proc, function(building)
BaseBuildings[3][4] = false BaseProc.exists = false
end) end)
Trigger.OnKilled(Weap, function(building) Trigger.OnKilled(Weap, function(building)
BaseBuildings[4][4] = false BaseWeap.exists = false
end) end)
Trigger.OnKilled(Apwr2, function(building) Trigger.OnKilled(Apwr2, function(building)
BaseBuildings[5][4] = false BaseApwr2.exists = false
end) end)
Trigger.OnRemovedFromWorld(Mcv, function() Trigger.OnRemovedFromWorld(Mcv, function()

View File

@@ -24,15 +24,15 @@ NewSovietRallyPoints = { SovietRally3, SovietRally4, SovietRally8 }
ParaWaves = ParaWaves =
{ {
{ AttackTicks, { "SovietSquad", SovietRally5 } }, { delay = AttackTicks, type = "SovietSquad", target = SovietRally5 },
{ 0, { "SovietSquad", SovietRally6 } }, { delay = 0, type = "SovietSquad", target = SovietRally6 },
{ AttackTicks * 2, { "SovietSquad", SovietParaDrop3 } }, { delay = AttackTicks * 2, type = "SovietSquad", target = SovietParaDrop3 },
{ 0, { "SovietPlatoonUnits", SovietRally5 } }, { delay = 0, type = "SovietPlatoonUnits", target = SovietRally5 },
{ 0, { "SovietPlatoonUnits", SovietRally6 } }, { delay = 0, type = "SovietPlatoonUnits", target = SovietRally6 },
{ 0, { "SovietSquad", SovietRally2 } }, { delay = 0, type = "SovietSquad", target = SovietRally2 },
{ AttackTicks * 2, { "SovietSquad", SovietParaDrop2 } }, { delay = AttackTicks * 2, type = "SovietSquad", target = SovietParaDrop2 },
{ AttackTicks * 2, { "SovietSquad", SovietParaDrop1 } }, { delay = AttackTicks * 2, type = "SovietSquad", target = SovietParaDrop1 },
{ AttackTicks * 3, { "SovietSquad", SovietParaDrop1 } } { delay = AttackTicks * 3, type = "SovietSquad", target = SovietParaDrop1 }
} }
IdleHunt = function(unit) IdleHunt = function(unit)
@@ -120,8 +120,8 @@ Tick = function()
end end
SendSovietParadrops = function(table) SendSovietParadrops = function(table)
local paraproxy = Actor.Create(table[1], false, { Owner = soviets }) local paraproxy = Actor.Create(table.type, false, { Owner = soviets })
units = paraproxy.SendParatroopers(table[2].CenterPosition) units = paraproxy.SendParatroopers(table.target.CenterPosition)
Utils.Do(units, function(unit) IdleHunt(unit) end) Utils.Do(units, function(unit) IdleHunt(unit) end)
paraproxy.Destroy() paraproxy.Destroy()
end end
@@ -227,13 +227,13 @@ end
wave = 1 wave = 1
SendParadrops = function() SendParadrops = function()
SendSovietParadrops(ParaWaves[wave][2]) SendSovietParadrops(ParaWaves[wave])
wave = wave + 1 wave = wave + 1
if wave > #ParaWaves then if wave > #ParaWaves then
Trigger.AfterDelay(AttackTicks, FrenchReinforcements) Trigger.AfterDelay(AttackTicks, FrenchReinforcements)
else else
Trigger.AfterDelay(ParaWaves[wave][1], SendParadrops) Trigger.AfterDelay(ParaWaves[wave].delay, SendParadrops)
end end
end end