Update Allies10a to work with Lua cleanup

This commit is contained in:
Smittytron
2021-12-28 20:36:45 -06:00
committed by abcdefg30
parent bb27837149
commit 3c24a3f9c7
3 changed files with 8 additions and 24 deletions

View File

@@ -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)

View File

@@ -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()

View File

@@ -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