use the new reinforcements methods
This commit is contained in:
@@ -52,34 +52,21 @@ BindActorTriggers = function(a)
|
|||||||
end
|
end
|
||||||
|
|
||||||
SendSovietUnits = function(entryCell, unitTypes, interval)
|
SendSovietUnits = function(entryCell, unitTypes, interval)
|
||||||
local i = 0
|
local units = Reinforcements.Reinforce(soviets, unitTypes, { entryCell }, interval)
|
||||||
team = {}
|
Utils.Do(units, function(unit)
|
||||||
|
BindActorTriggers(unit)
|
||||||
Utils.Do(unitTypes, function(type)
|
|
||||||
local a = Actor.Create(type, false, { Owner = soviets, Location = entryCell })
|
|
||||||
BindActorTriggers(a)
|
|
||||||
Trigger.AfterDelay(i * interval, function() a.IsInWorld = true end)
|
|
||||||
table.insert(team, a)
|
|
||||||
i = i + 1
|
|
||||||
end)
|
end)
|
||||||
|
Trigger.OnAllKilled(units, function() SendSovietUnits(entryCell, unitTypes, interval) end)
|
||||||
Trigger.OnAllKilled(team, function() SendSovietUnits(entryCell, unitTypes, interval) end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
ShipAlliedUnits = function()
|
ShipAlliedUnits = function()
|
||||||
local transport = Actor.Create("lst", true, { Location = LstEntry.Location, Owner = allies })
|
local units = Reinforcements.ReinforceWithTransport(allies, "lst",
|
||||||
|
ShipUnitTypes, { LstEntry.Location, LstUnload.Location }, { LstEntry.Location })[2]
|
||||||
|
|
||||||
Utils.Do(ShipUnitTypes, function(type)
|
Utils.Do(units, function(unit)
|
||||||
local a = Actor.Create(type, false, { Owner = allies })
|
BindActorTriggers(unit)
|
||||||
BindActorTriggers(a)
|
|
||||||
transport.LoadPassenger(a)
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
transport.Move(LstUnload.Location)
|
|
||||||
transport.UnloadPassengers()
|
|
||||||
transport.Wait(Utils.Seconds(2))
|
|
||||||
transport.Move(LstEntry.Location)
|
|
||||||
transport.Destroy()
|
|
||||||
Trigger.AfterDelay(Utils.Seconds(60), ShipAlliedUnits)
|
Trigger.AfterDelay(Utils.Seconds(60), ShipAlliedUnits)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user