Resolve Lua language server diagnosed problems.

This commit is contained in:
Matthias Mailänder
2023-03-01 10:40:46 +01:00
committed by abcdefg30
parent 3d0efa1cbe
commit 378f66a1ff
122 changed files with 3006 additions and 3012 deletions

View File

@@ -104,42 +104,42 @@ InitialSovietPatrols = function()
end
InitialAlliedReinforcements = function()
local camera = Actor.Create("Camera", true, { Owner = player, Location = DefaultCameraPosition.Location })
local camera = Actor.Create("Camera", true, { Owner = Greece, Location = DefaultCameraPosition.Location })
Trigger.AfterDelay(DateTime.Seconds(30), camera.Destroy)
Trigger.AfterDelay(DateTime.Seconds(1), function()
Reinforcements.Reinforce(player, AlliedReinforcementsA, { AlliedEntry3.Location, UnitCStopLocation.Location }, 2)
Reinforcements.Reinforce(player, AlliedReinforcementsB, { AlliedEntry2.Location, UnitAStopLocation.Location }, 2)
Reinforcements.Reinforce(Greece, AlliedReinforcementsA, { AlliedEntry3.Location, UnitCStopLocation.Location }, 2)
Reinforcements.Reinforce(Greece, AlliedReinforcementsB, { AlliedEntry2.Location, UnitAStopLocation.Location }, 2)
end)
Trigger.AfterDelay(DateTime.Seconds(3), function()
Reinforcements.Reinforce(player, { "mcv" }, { AlliedEntry1.Location, UnitBStopLocation.Location })
Reinforcements.Reinforce(player, AlliedBoatReinforcements, { AlliedBoatEntry.Location, AlliedBoatStop.Location })
Reinforcements.Reinforce(Greece, { "mcv" }, { AlliedEntry1.Location, UnitBStopLocation.Location })
Reinforcements.Reinforce(Greece, AlliedBoatReinforcements, { AlliedBoatEntry.Location, AlliedBoatStop.Location })
end)
end
CaptureRadarDome = function()
Trigger.OnKilled(RadarDome, function()
player.MarkFailedObjective(CaptureRadarDomeObj)
Greece.MarkFailedObjective(CaptureRadarDomeObj)
end)
Trigger.OnCapture(RadarDome, function()
player.MarkCompletedObjective(CaptureRadarDomeObj)
Greece.MarkCompletedObjective(CaptureRadarDomeObj)
Utils.Do(SovietTechLabs, function(a)
if a.IsDead then
return
end
Beacon.New(player, a.CenterPosition)
Beacon.New(Greece, a.CenterPosition)
if Difficulty ~= "hard" then
Actor.Create("TECH.CAM", true, { Owner = player, Location = a.Location + CVec.New(1, 1) })
Actor.Create("TECH.CAM", true, { Owner = Greece, Location = a.Location + CVec.New(1, 1) })
end
end)
Media.DisplayMessage(UserInterface.Translate("soviet-tech-centers-discovered"))
if Difficulty == "easy" then
Actor.Create("Camera", true, { Owner = player, Location = Weapcam.Location })
Actor.Create("Camera", true, { Owner = Greece, Location = Weapcam.Location })
end
end)
end
@@ -147,61 +147,61 @@ end
InfiltrateTechCenter = function()
Utils.Do(SovietTechLabs, function(a)
Trigger.OnInfiltrated(a, function()
if infiltrated then
if Infiltrated then
return
end
infiltrated = true
DestroySovietsObj = AddPrimaryObjective(player, "destroy-soviet-buildings-units")
player.MarkCompletedObjective(InfiltrateTechCenterObj)
Infiltrated = true
DestroySovietsObj = AddPrimaryObjective(Greece, "destroy-soviet-buildings-units")
Greece.MarkCompletedObjective(InfiltrateTechCenterObj)
end)
Trigger.OnCapture(a, function()
if not infiltrated then
if not Infiltrated then
Media.DisplayMessage(UserInterface.Translate("dont-capture-tech-centers"))
end
end)
end)
Trigger.OnAllKilledOrCaptured(SovietTechLabs, function()
if not player.IsObjectiveCompleted(InfiltrateTechCenterObj) then
player.MarkFailedObjective(InfiltrateTechCenterObj)
if not Greece.IsObjectiveCompleted(InfiltrateTechCenterObj) then
Greece.MarkFailedObjective(InfiltrateTechCenterObj)
end
end)
end
Tick = function()
if player.HasNoRequiredUnits() then
player.MarkFailedObjective(InfiltrateTechCenterObj)
if Greece.HasNoRequiredUnits() then
Greece.MarkFailedObjective(InfiltrateTechCenterObj)
end
if DestroySovietsObj and ussr.HasNoRequiredUnits() then
player.MarkCompletedObjective(DestroySovietsObj)
if DestroySovietsObj and USSR.HasNoRequiredUnits() then
Greece.MarkCompletedObjective(DestroySovietsObj)
end
end
WorldLoaded = function()
player = Player.GetPlayer("Greece")
ussr = Player.GetPlayer("USSR")
Greece = Player.GetPlayer("Greece")
USSR = Player.GetPlayer("USSR")
InitObjectives(player)
InitObjectives(Greece)
InfiltrateTechCenterObj = AddPrimaryObjective(player, "infiltrate-tech-center-spy")
CaptureRadarDomeObj = AddSecondaryObjective(player, "capture-radar-shore")
InfiltrateTechCenterObj = AddPrimaryObjective(Greece, "infiltrate-tech-center-spy")
CaptureRadarDomeObj = AddSecondaryObjective(Greece, "capture-radar-shore")
Camera.Position = DefaultCameraPosition.CenterPosition
if Difficulty == "easy" then
Trigger.OnEnteredProximityTrigger(SovietDefenseCam.CenterPosition, WDist.New(1024 * 7), function(a, id)
if a.Owner == player then
if a.Owner == Greece then
Trigger.RemoveProximityTrigger(id)
local cam1 = Actor.Create("TECH.CAM", true, { Owner = player, Location = SovietDefenseCam.Location })
local cam1 = Actor.Create("TECH.CAM", true, { Owner = Greece, Location = SovietDefenseCam.Location })
Trigger.AfterDelay(DateTime.Seconds(15), cam1.Destroy)
if not DefenseFlame1.IsDead then
local cam2 = Actor.Create("TECH.CAM", true, { Owner = player, Location = DefenseFlame1.Location })
local cam2 = Actor.Create("TECH.CAM", true, { Owner = Greece, Location = DefenseFlame1.Location })
Trigger.AfterDelay(DateTime.Seconds(15), cam2.Destroy)
end
if not DefenseFlame2.IsDead then
local cam3 = Actor.Create("TECH.CAM", true, { Owner = player, Location = DefenseFlame2.Location })
local cam3 = Actor.Create("TECH.CAM", true, { Owner = Greece, Location = DefenseFlame2.Location })
Trigger.AfterDelay(DateTime.Seconds(15), cam3.Destroy)
end
end
@@ -231,9 +231,9 @@ WorldLoaded = function()
end)
Trigger.OnEnteredProximityTrigger(SovietMiniBaseCam.CenterPosition, WDist.New(1024 * 14), function(a, id)
if a.Owner == player then
if a.Owner == Greece then
Trigger.RemoveProximityTrigger(id)
local cam = Actor.Create("Camera", true, { Owner = player, Location = SovietMiniBaseCam.Location })
local cam = Actor.Create("Camera", true, { Owner = Greece, Location = SovietMiniBaseCam.Location })
Trigger.AfterDelay(DateTime.Seconds(15), cam.Destroy)
end
end)