Update Allies10a to work with Lua cleanup
This commit is contained in:
@@ -45,7 +45,7 @@ ProduceBadGuyInfantry = function()
|
|||||||
BadGuy.Build({ Utils.Random(SovietInfantry) }, function(units)
|
BadGuy.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||||
table.insert(BGAttackGroup, units[1])
|
table.insert(BGAttackGroup, units[1])
|
||||||
SendBGAttackGroup()
|
SendBGAttackGroup()
|
||||||
Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceBadGuyInfantry)
|
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceBadGuyInfantry)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ ProduceInfantry = function()
|
|||||||
USSR.Build({ Utils.Random(SovietInfantry) }, function(units)
|
USSR.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||||
table.insert(AttackGroup, units[1])
|
table.insert(AttackGroup, units[1])
|
||||||
SendAttackGroup()
|
SendAttackGroup()
|
||||||
Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceInfantry)
|
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceInfantry)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ ProduceVehicles = function()
|
|||||||
USSR.Build({ Utils.Random(SovietVehicles) }, function(units)
|
USSR.Build({ Utils.Random(SovietVehicles) }, function(units)
|
||||||
table.insert(AttackGroup, units[1])
|
table.insert(AttackGroup, units[1])
|
||||||
SendAttackGroup()
|
SendAttackGroup()
|
||||||
Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceVehicles)
|
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ ProduceAircraft = function()
|
|||||||
|
|
||||||
local alive = Utils.Where(Migs, function(y) return not y.IsDead end)
|
local alive = Utils.Where(Migs, function(y) return not y.IsDead end)
|
||||||
if #alive < 2 then
|
if #alive < 2 then
|
||||||
Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft)
|
Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft)
|
||||||
end
|
end
|
||||||
|
|
||||||
InitializeAttackAircraft(mig, Greece)
|
InitializeAttackAircraft(mig, Greece)
|
||||||
@@ -155,9 +155,8 @@ SendParabombs = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
ActivateAI = function()
|
ActivateAI = function()
|
||||||
local difficulty = Map.LobbyOption("difficulty")
|
ParadropDelay = ParadropDelay[Difficulty]
|
||||||
ParadropDelay = ParadropDelay[difficulty]
|
BombDelays = BombDelays[Difficulty]
|
||||||
BombDelays = BombDelays[difficulty]
|
|
||||||
|
|
||||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == USSR and self.HasProperty("StartBuildingRepairs") end)
|
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == USSR and self.HasProperty("StartBuildingRepairs") end)
|
||||||
Utils.Do(buildings, function(actor)
|
Utils.Do(buildings, function(actor)
|
||||||
|
|||||||
@@ -160,26 +160,11 @@ WorldLoaded = function()
|
|||||||
USSR = Player.GetPlayer("USSR")
|
USSR = Player.GetPlayer("USSR")
|
||||||
BadGuy = Player.GetPlayer("BadGuy")
|
BadGuy = Player.GetPlayer("BadGuy")
|
||||||
|
|
||||||
Trigger.OnObjectiveAdded(Greece, function(p, id)
|
InitObjectives(Greece)
|
||||||
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
|
|
||||||
end)
|
|
||||||
|
|
||||||
HoldOut = USSR.AddObjective("Hold out until missiles reach their destination")
|
HoldOut = USSR.AddObjective("Hold out until missiles reach their destination")
|
||||||
ApproachBase = Greece.AddObjective("Find a way to take the atomic weapons off-line.")
|
ApproachBase = Greece.AddObjective("Find a way to take the atomic weapons off-line.")
|
||||||
|
|
||||||
Trigger.OnObjectiveCompleted(Greece, function(p, id)
|
|
||||||
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
|
|
||||||
end)
|
|
||||||
Trigger.OnObjectiveFailed(Greece, function(p, id)
|
|
||||||
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
|
|
||||||
end)
|
|
||||||
Trigger.OnPlayerLost(Greece, function()
|
|
||||||
Media.PlaySpeechNotification(Greece, "Lose")
|
|
||||||
end)
|
|
||||||
Trigger.OnPlayerWon(Greece, function()
|
|
||||||
Media.PlaySpeechNotification(Greece, "Win")
|
|
||||||
end)
|
|
||||||
|
|
||||||
Camera.Position = DefaultCameraPosition.CenterPosition
|
Camera.Position = DefaultCameraPosition.CenterPosition
|
||||||
StandardDrop = Actor.Create("paradrop", false, { Owner = USSR })
|
StandardDrop = Actor.Create("paradrop", false, { Owner = USSR })
|
||||||
MissionStart()
|
MissionStart()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
World:
|
World:
|
||||||
LuaScript:
|
LuaScript:
|
||||||
Scripts: allies10a.lua, allies10a-AI.lua, campaign-global.lua
|
Scripts: allies10a.lua, allies10a-AI.lua, campaign.lua, utils.lua
|
||||||
MissionData:
|
MissionData:
|
||||||
BriefingVideo: ally10.vqa
|
BriefingVideo: ally10.vqa
|
||||||
LossVideo: trinity.vqa
|
LossVideo: trinity.vqa
|
||||||
|
|||||||
Reference in New Issue
Block a user