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)
|
||||
table.insert(BGAttackGroup, units[1])
|
||||
SendBGAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceBadGuyInfantry)
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceBadGuyInfantry)
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -74,7 +74,7 @@ ProduceInfantry = function()
|
||||
USSR.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceInfantry)
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceInfantry)
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -86,7 +86,7 @@ ProduceVehicles = function()
|
||||
USSR.Build({ Utils.Random(SovietVehicles) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceVehicles)
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles)
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -103,7 +103,7 @@ ProduceAircraft = function()
|
||||
|
||||
local alive = Utils.Where(Migs, function(y) return not y.IsDead end)
|
||||
if #alive < 2 then
|
||||
Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft)
|
||||
Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft)
|
||||
end
|
||||
|
||||
InitializeAttackAircraft(mig, Greece)
|
||||
@@ -155,9 +155,8 @@ SendParabombs = function()
|
||||
end
|
||||
|
||||
ActivateAI = function()
|
||||
local difficulty = Map.LobbyOption("difficulty")
|
||||
ParadropDelay = ParadropDelay[difficulty]
|
||||
BombDelays = BombDelays[difficulty]
|
||||
ParadropDelay = ParadropDelay[Difficulty]
|
||||
BombDelays = BombDelays[Difficulty]
|
||||
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == USSR and self.HasProperty("StartBuildingRepairs") end)
|
||||
Utils.Do(buildings, function(actor)
|
||||
|
||||
@@ -160,26 +160,11 @@ WorldLoaded = function()
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
BadGuy = Player.GetPlayer("BadGuy")
|
||||
|
||||
Trigger.OnObjectiveAdded(Greece, function(p, id)
|
||||
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
|
||||
end)
|
||||
InitObjectives(Greece)
|
||||
|
||||
HoldOut = USSR.AddObjective("Hold out until missiles reach their destination")
|
||||
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
|
||||
StandardDrop = Actor.Create("paradrop", false, { Owner = USSR })
|
||||
MissionStart()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
World:
|
||||
LuaScript:
|
||||
Scripts: allies10a.lua, allies10a-AI.lua, campaign-global.lua
|
||||
Scripts: allies10a.lua, allies10a-AI.lua, campaign.lua, utils.lua
|
||||
MissionData:
|
||||
BriefingVideo: ally10.vqa
|
||||
LossVideo: trinity.vqa
|
||||
|
||||
Reference in New Issue
Block a user