Resolve Lua language server diagnosed problems.
This commit is contained in:
committed by
abcdefg30
parent
3d0efa1cbe
commit
378f66a1ff
@@ -11,7 +11,7 @@ ClearSubActivityTriggerActivator = { Sub1, Sub2, Sub3, Sub4, Sub5, Sub6, Sub7, S
|
||||
AlliedGunboats = { "pt", "pt", "pt" }
|
||||
BeachRifles = { BeachRifle1, BeachRifle2, BeachRifle3, BeachRifle4 }
|
||||
|
||||
lstReinforcements =
|
||||
LstReinforcements =
|
||||
{
|
||||
first =
|
||||
{
|
||||
@@ -42,15 +42,15 @@ RaidTwoPath = { RaidTwoEntry.Location, RaidTwoLanding.Location }
|
||||
StartTimer = false
|
||||
TimerColor = Player.GetPlayer("USSR").Color
|
||||
TimerTicks = DateTime.Minutes(10)
|
||||
ticked = TimerTicks
|
||||
Ticked = TimerTicks
|
||||
StartTimerDelay = DateTime.Minutes(5)
|
||||
|
||||
InitialAlliedReinforcements = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Reinforcements.Reinforce(greece, AlliedGunboats, { GunboatEntry.Location, waypoint42.Location }, 2)
|
||||
Media.PlaySpeechNotification(greece, "ReinforcementsArrived")
|
||||
local reinforcement = lstReinforcements.first
|
||||
Reinforcements.ReinforceWithTransport(greece, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
Reinforcements.Reinforce(Greece, AlliedGunboats, { GunboatEntry.Location, waypoint42.Location }, 2)
|
||||
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
|
||||
local reinforcement = LstReinforcements.first
|
||||
Reinforcements.ReinforceWithTransport(Greece, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -64,19 +64,19 @@ end
|
||||
|
||||
SecondAlliedLanding = function()
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), function()
|
||||
Media.PlaySpeechNotification(greece, "ReinforcementsArrived")
|
||||
local reinforcement = lstReinforcements.second
|
||||
Reinforcements.ReinforceWithTransport(greece, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
|
||||
local reinforcement = LstReinforcements.second
|
||||
Reinforcements.ReinforceWithTransport(Greece, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
end)
|
||||
end
|
||||
|
||||
CaptureRadarDome = function()
|
||||
Trigger.OnKilled(RadarDome, function()
|
||||
greece.MarkFailedObjective(CaptureRadarDomeObj)
|
||||
Greece.MarkFailedObjective(CaptureRadarDomeObj)
|
||||
end)
|
||||
|
||||
Trigger.OnCapture(RadarDome, function()
|
||||
greece.MarkCompletedObjective(CaptureRadarDomeObj)
|
||||
Greece.MarkCompletedObjective(CaptureRadarDomeObj)
|
||||
BaseRaids()
|
||||
end)
|
||||
end
|
||||
@@ -86,7 +86,7 @@ BaseRaids = function()
|
||||
return
|
||||
else
|
||||
Trigger.AfterDelay(Utils.RandomInteger(BaseRaidDelay1[1], BaseRaidDelay1[2]), function()
|
||||
local raiders = Reinforcements.ReinforceWithTransport(ussr, "lst", RaidingParty, RaidOnePath, { RaidOneEntry.Location })[2]
|
||||
local raiders = Reinforcements.ReinforceWithTransport(USSR, "lst", RaidingParty, RaidOnePath, { RaidOneEntry.Location })[2]
|
||||
Utils.Do(raiders, function(a)
|
||||
Trigger.OnAddedToWorld(a, function()
|
||||
a.AttackMove(PlayerBase.Location)
|
||||
@@ -96,7 +96,7 @@ BaseRaids = function()
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(Utils.RandomInteger(BaseRaidDelay2[1], BaseRaidDelay2[2]), function()
|
||||
local raiders = Reinforcements.ReinforceWithTransport(ussr, "lst", RaidingParty, RaidTwoPath, { RaidTwoEntry.Location })[2]
|
||||
local raiders = Reinforcements.ReinforceWithTransport(USSR, "lst", RaidingParty, RaidTwoPath, { RaidTwoEntry.Location })[2]
|
||||
Utils.Do(raiders, function(a)
|
||||
Trigger.OnAddedToWorld(a, function()
|
||||
a.AttackMove(PlayerBase.Location)
|
||||
@@ -110,7 +110,7 @@ end
|
||||
StartTimerFunction = function()
|
||||
if Difficulty == "hard" then
|
||||
StartTimer = true
|
||||
Media.PlaySpeechNotification(greece, "TimerStarted")
|
||||
Media.PlaySpeechNotification(Greece, "TimerStarted")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -138,10 +138,10 @@ BattalionWays =
|
||||
}
|
||||
|
||||
SendArmoredBattalion = function()
|
||||
Media.PlaySpeechNotification(greece, "EnemyUnitsApproaching")
|
||||
Media.PlaySpeechNotification(Greece, "EnemyUnitsApproaching")
|
||||
Utils.Do(BattalionWays, function(way)
|
||||
local units = { "3tnk", "3tnk", "3tnk", "4tnk", "4tnk" }
|
||||
local armor = Reinforcements.ReinforceWithTransport(ussr, "lst", units , way, { way[2], way[1] })[2]
|
||||
local armor = Reinforcements.ReinforceWithTransport(USSR, "lst", units , way, { way[2], way[1] })[2]
|
||||
Utils.Do(armor, function(a)
|
||||
Trigger.OnAddedToWorld(a, function()
|
||||
a.AttackMove(PlayerBase.Location)
|
||||
@@ -152,50 +152,50 @@ SendArmoredBattalion = function()
|
||||
end
|
||||
|
||||
DestroySubPensCompleted = function()
|
||||
greece.MarkCompletedObjective(DestroySubPens)
|
||||
Greece.MarkCompletedObjective(DestroySubPens)
|
||||
end
|
||||
|
||||
ClearSubActivityCompleted = function()
|
||||
greece.MarkCompletedObjective(ClearSubActivity)
|
||||
Greece.MarkCompletedObjective(ClearSubActivity)
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
ussr.Cash = 5000
|
||||
badguy.Cash = 500
|
||||
USSR.Cash = 5000
|
||||
BadGuy.Cash = 500
|
||||
|
||||
if StartTimer then
|
||||
if ticked > 0 then
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("soviet-armored-battalion-arrives-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if Ticked > 0 then
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("soviet-armored-battalion-arrives-in", { ["time"] = Utils.FormatTime(Ticked) })
|
||||
UserInterface.SetMissionText(Timer, TimerColor)
|
||||
end
|
||||
ticked = ticked - 1
|
||||
elseif ticked == 0 then
|
||||
Ticked = Ticked - 1
|
||||
elseif Ticked == 0 then
|
||||
FinishTimer()
|
||||
SendArmoredBattalion()
|
||||
ticked = ticked - 1
|
||||
Ticked = Ticked - 1
|
||||
end
|
||||
end
|
||||
|
||||
if greece.HasNoRequiredUnits() then
|
||||
ussr.MarkCompletedObjective(BeatAllies)
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
USSR.MarkCompletedObjective(BeatAllies)
|
||||
end
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
greece = Player.GetPlayer("Greece")
|
||||
ussr = Player.GetPlayer("USSR")
|
||||
badguy = Player.GetPlayer("BadGuy")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
BadGuy = Player.GetPlayer("BadGuy")
|
||||
|
||||
Camera.Position = DefaultCameraPosition.CenterPosition
|
||||
|
||||
InitObjectives(greece)
|
||||
CaptureRadarDomeObj = AddPrimaryObjective(greece, "capture-radar-dome")
|
||||
DestroySubPens = AddPrimaryObjective(greece, "destroy-all-soviet-sub-pens")
|
||||
ClearSubActivity = AddSecondaryObjective(greece, "clear-area-all-subs")
|
||||
BeatAllies = AddPrimaryObjective(ussr, "")
|
||||
InitObjectives(Greece)
|
||||
CaptureRadarDomeObj = AddPrimaryObjective(Greece, "capture-radar-dome")
|
||||
DestroySubPens = AddPrimaryObjective(Greece, "destroy-all-soviet-sub-pens")
|
||||
ClearSubActivity = AddSecondaryObjective(Greece, "clear-area-all-subs")
|
||||
BeatAllies = AddPrimaryObjective(USSR, "")
|
||||
|
||||
PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = ussr })
|
||||
PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
|
||||
InitialAlliedReinforcements()
|
||||
SecondAlliedLanding()
|
||||
|
||||
Reference in New Issue
Block a user