Resolve Lua language server diagnosed problems.
This commit is contained in:
committed by
abcdefg30
parent
3d0efa1cbe
commit
378f66a1ff
@@ -80,7 +80,7 @@ LabGuardsKilled = function()
|
||||
Media.PlaySoundNotification(Greece, "AlertBuzzer")
|
||||
end)
|
||||
end
|
||||
Utils.Do(sovietArmy, function(a)
|
||||
Utils.Do(SovietArmy, function(a)
|
||||
if not a.IsDead and a.HasProperty("Hunt") then
|
||||
Trigger.OnIdle(a, a.Hunt)
|
||||
end
|
||||
@@ -89,18 +89,18 @@ LabGuardsKilled = function()
|
||||
end
|
||||
|
||||
SendExtractionHelicopter = function()
|
||||
heli = Reinforcements.ReinforceWithTransport(Greece, ExtractionHelicopterType, nil, ExtractionPath)[1]
|
||||
if not einstein.IsDead then
|
||||
Trigger.OnRemovedFromWorld(einstein, EvacuateHelicopter)
|
||||
Heli = Reinforcements.ReinforceWithTransport(Greece, ExtractionHelicopterType, nil, ExtractionPath)[1]
|
||||
if not Einstein.IsDead then
|
||||
Trigger.OnRemovedFromWorld(Einstein, EvacuateHelicopter)
|
||||
end
|
||||
Trigger.OnKilled(heli, RescueFailed)
|
||||
Trigger.OnRemovedFromWorld(heli, HelicopterGone)
|
||||
Trigger.OnKilled(Heli, RescueFailed)
|
||||
Trigger.OnRemovedFromWorld(Heli, HelicopterGone)
|
||||
end
|
||||
|
||||
EvacuateHelicopter = function()
|
||||
if heli.HasPassengers then
|
||||
heli.Move(ExtractionExitPoint.Location)
|
||||
heli.Destroy()
|
||||
if Heli.HasPassengers then
|
||||
Heli.Move(ExtractionExitPoint.Location)
|
||||
Heli.Destroy()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -114,7 +114,7 @@ SendCruisers = function()
|
||||
end
|
||||
|
||||
LabDestroyed = function()
|
||||
if not einstein then
|
||||
if not Einstein then
|
||||
RescueFailed()
|
||||
end
|
||||
end
|
||||
@@ -136,7 +136,7 @@ end
|
||||
CiviliansKilled = function()
|
||||
Greece.MarkFailedObjective(CivilProtectionObjective)
|
||||
Media.PlaySpeechNotification(Greece, "ObjectiveNotMet")
|
||||
collateralDamage = true
|
||||
CollateralDamage = true
|
||||
end
|
||||
|
||||
LostMate = function()
|
||||
@@ -148,15 +148,15 @@ end
|
||||
CreateEinstein = function()
|
||||
Greece.MarkCompletedObjective(FindEinsteinObjective)
|
||||
Media.PlaySpeechNotification(Greece, "ObjectiveMet")
|
||||
einstein = Actor.Create(EinsteinType, true, { Location = EinsteinSpawnPoint.Location, Owner = Greece })
|
||||
einstein.Scatter()
|
||||
Trigger.OnKilled(einstein, RescueFailed)
|
||||
Einstein = Actor.Create(EinsteinType, true, { Location = EinsteinSpawnPoint.Location, Owner = Greece })
|
||||
Einstein.Scatter()
|
||||
Trigger.OnKilled(Einstein, RescueFailed)
|
||||
ExtractObjective = AddPrimaryObjective(Greece, "extract-einstein-helicopter")
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(Greece, "TargetFreed") end)
|
||||
end
|
||||
|
||||
HelicopterGone = function()
|
||||
if not heli.IsDead then
|
||||
if not Heli.IsDead then
|
||||
Media.PlaySpeechNotification(Greece, "TargetRescued")
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Greece.MarkCompletedObjective(ExtractObjective)
|
||||
@@ -164,7 +164,7 @@ HelicopterGone = function()
|
||||
if not Greece.IsObjectiveFailed(TanyaSurviveObjective) then
|
||||
Greece.MarkCompletedObjective(TanyaSurviveObjective)
|
||||
end
|
||||
if not collateralDamage then
|
||||
if not CollateralDamage then
|
||||
Greece.MarkCompletedObjective(CivilProtectionObjective)
|
||||
end
|
||||
end)
|
||||
@@ -200,12 +200,12 @@ WorldLoaded = function()
|
||||
Trigger.OnKilled(Lab, LabDestroyed)
|
||||
Trigger.OnKilled(OilPump, OilPumpDestroyed)
|
||||
|
||||
sovietArmy = USSR.GetGroundAttackers()
|
||||
SovietArmy = USSR.GetGroundAttackers()
|
||||
|
||||
Trigger.OnAllKilled(LabGuardsTeam, LabGuardsKilled)
|
||||
|
||||
collateralDamage = false
|
||||
civilianTeam = { Civilian1, Civilian2 }
|
||||
CollateralDamage = false
|
||||
local civilianTeam = { Civilian1, Civilian2 }
|
||||
Trigger.OnAnyKilled(civilianTeam, CiviliansKilled)
|
||||
Trigger.OnKilled(Civilian1, LostMate)
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ else
|
||||
end
|
||||
|
||||
SendJeepReinforcements = function()
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Reinforcements.Reinforce(player, JeepReinforcements, JeepPath, DateTime.Seconds(1))
|
||||
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
|
||||
Reinforcements.Reinforce(Greece, JeepReinforcements, JeepPath, DateTime.Seconds(1))
|
||||
end
|
||||
|
||||
RunInitialActivities = function()
|
||||
@@ -59,12 +59,12 @@ RunInitialActivities = function()
|
||||
Trigger.OnKilled(Harvester, function() HarvesterKilled = true end)
|
||||
|
||||
Trigger.OnAllKilled(PathGuards, function()
|
||||
player.MarkCompletedObjective(SecureObjective)
|
||||
Greece.MarkCompletedObjective(SecureObjective)
|
||||
SendTrucks()
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(SovietBase, function()
|
||||
Utils.Do(ussr.GetGroundAttackers(), function(unit)
|
||||
Utils.Do(USSR.GetGroundAttackers(), function(unit)
|
||||
if not Utils.Any(PathGuards, function(pg) return pg == unit end) then
|
||||
Trigger.OnIdle(unit, unit.Hunt)
|
||||
end
|
||||
@@ -72,15 +72,15 @@ RunInitialActivities = function()
|
||||
end)
|
||||
|
||||
if InfantryTypes then
|
||||
Trigger.AfterDelay(InfantryDelay, InfantryProduction)
|
||||
Trigger.AfterDelay(InfantryDelay, ProduceInfantry)
|
||||
end
|
||||
|
||||
if VehicleTypes then
|
||||
Trigger.AfterDelay(VehicleDelay, VehicleProduction)
|
||||
Trigger.AfterDelay(VehicleDelay, ProduceVehicles)
|
||||
end
|
||||
end
|
||||
|
||||
InfantryProduction = function()
|
||||
ProduceInfantry = function()
|
||||
if SovietBarracks.IsDead then
|
||||
return
|
||||
end
|
||||
@@ -88,12 +88,12 @@ InfantryProduction = function()
|
||||
local toBuild = { Utils.Random(InfantryTypes) }
|
||||
|
||||
if SovietKennel.IsDead and toBuild == "dog" then
|
||||
toBuild = "e1"
|
||||
toBuild = { "e1" }
|
||||
end
|
||||
|
||||
ussr.Build(toBuild, function(unit)
|
||||
USSR.Build(toBuild, function(unit)
|
||||
IdlingUnits[#IdlingUnits + 1] = unit[1]
|
||||
Trigger.AfterDelay(InfantryDelay, InfantryProduction)
|
||||
Trigger.AfterDelay(InfantryDelay, ProduceInfantry)
|
||||
|
||||
if #IdlingUnits >= (AttackGroupSize * 1.5) then
|
||||
SendAttack()
|
||||
@@ -101,26 +101,26 @@ InfantryProduction = function()
|
||||
end)
|
||||
end
|
||||
|
||||
VehicleProduction = function()
|
||||
ProduceVehicles = function()
|
||||
if SovietWarfactory.IsDead then
|
||||
return
|
||||
end
|
||||
|
||||
if HarvesterKilled then
|
||||
ussr.Build({ "harv" }, function(harv)
|
||||
USSR.Build({ "harv" }, function(harv)
|
||||
harv[1].FindResources()
|
||||
Trigger.OnKilled(harv[1], function() HarvesterKilled = true end)
|
||||
|
||||
HarvesterKilled = false
|
||||
VehicleProduction()
|
||||
ProduceVehicles()
|
||||
end)
|
||||
return
|
||||
end
|
||||
|
||||
local toBuild = { Utils.Random(VehicleTypes) }
|
||||
ussr.Build(toBuild, function(unit)
|
||||
USSR.Build(toBuild, function(unit)
|
||||
IdlingUnits[#IdlingUnits + 1] = unit[1]
|
||||
Trigger.AfterDelay(VehicleDelay, VehicleProduction)
|
||||
Trigger.AfterDelay(VehicleDelay, ProduceVehicles)
|
||||
|
||||
if #IdlingUnits >= (AttackGroupSize * 1.5) then
|
||||
SendAttack()
|
||||
@@ -149,14 +149,14 @@ SendAttack = function()
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
ussr.Resources = ussr.Resources - (0.01 * ussr.ResourceCapacity / 25)
|
||||
USSR.Resources = USSR.Resources - (0.01 * USSR.ResourceCapacity / 25)
|
||||
|
||||
if ussr.HasNoRequiredUnits() then
|
||||
player.MarkCompletedObjective(ConquestObjective)
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(ConquestObjective)
|
||||
end
|
||||
|
||||
if player.HasNoRequiredUnits() then
|
||||
ussr.MarkCompletedObjective(ussrObj)
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
USSR.MarkCompletedObjective(USSRobjective)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -182,22 +182,22 @@ SendTrucks = function()
|
||||
|
||||
DateTime.TimeLimit = 0
|
||||
UserInterface.SetMissionText("")
|
||||
ConvoyObjective = AddPrimaryObjective(player, "escort-convoy")
|
||||
ConvoyObjective = AddPrimaryObjective(Greece, "escort-convoy")
|
||||
|
||||
Media.PlaySpeechNotification(player, "ConvoyApproaching")
|
||||
Media.PlaySpeechNotification(Greece, "ConvoyApproaching")
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
ConvoyUnharmed = true
|
||||
local trucks = Reinforcements.Reinforce(england, TruckReinforcements, TruckPath, DateTime.Seconds(1),
|
||||
local trucks = Reinforcements.Reinforce(England, TruckReinforcements, TruckPath, DateTime.Seconds(1),
|
||||
function(truck)
|
||||
Trigger.OnIdle(truck, function() truck.Move(TruckExitPoint.Location) end)
|
||||
end)
|
||||
count = 0
|
||||
local count = 0
|
||||
Trigger.OnEnteredFootprint( { TruckExitPoint.Location }, function(a, id)
|
||||
if a.Owner == england then
|
||||
if a.Owner == England then
|
||||
count = count + 1
|
||||
a.Destroy()
|
||||
if count == 3 then
|
||||
player.MarkCompletedObjective(ConvoyObjective)
|
||||
Greece.MarkCompletedObjective(ConvoyObjective)
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
end
|
||||
end
|
||||
@@ -208,30 +208,30 @@ SendTrucks = function()
|
||||
end
|
||||
|
||||
ConvoyCasualites = function()
|
||||
Media.PlaySpeechNotification(player, "ConvoyUnitLost")
|
||||
Media.PlaySpeechNotification(Greece, "ConvoyUnitLost")
|
||||
if ConvoyUnharmed then
|
||||
ConvoyUnharmed = false
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() player.MarkFailedObjective(ConvoyObjective) end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() Greece.MarkFailedObjective(ConvoyObjective) end)
|
||||
end
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("Greece")
|
||||
england = Player.GetPlayer("England")
|
||||
ussr = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
England = Player.GetPlayer("England")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
|
||||
InitObjectives(player)
|
||||
InitObjectives(Greece)
|
||||
|
||||
ussrObj = AddPrimaryObjective(ussr, "")
|
||||
USSRobjective = AddPrimaryObjective(USSR, "")
|
||||
|
||||
SecureObjective = AddPrimaryObjective(player, "secure-convoy")
|
||||
ConquestObjective = AddPrimaryObjective(player, "eliminate-soviets")
|
||||
SecureObjective = AddPrimaryObjective(Greece, "secure-convoy")
|
||||
ConquestObjective = AddPrimaryObjective(Greece, "eliminate-soviets")
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(Allies, "MissionTimerInitialised") end)
|
||||
|
||||
RunInitialActivities()
|
||||
|
||||
Reinforcements.Reinforce(player, ConstructionVehicleReinforcements, ConstructionVehiclePath)
|
||||
Reinforcements.Reinforce(Greece, ConstructionVehicleReinforcements, ConstructionVehiclePath)
|
||||
Trigger.AfterDelay(DateTime.Seconds(5), SendJeepReinforcements)
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), SendJeepReinforcements)
|
||||
|
||||
@@ -241,5 +241,5 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Camera.Position = ReinforcementsEntryPoint.CenterPosition
|
||||
TimerColor = player.Color
|
||||
TimerColor = Greece.Color
|
||||
end
|
||||
|
||||
@@ -24,7 +24,7 @@ else
|
||||
end
|
||||
|
||||
ProduceUnits = function(factory, count)
|
||||
if ussr.IsProducing("e1") then
|
||||
if USSR.IsProducing("e1") then
|
||||
Trigger.AfterDelay(DateTime.Seconds(5), function() ProduceUnits(factory, count) end)
|
||||
return
|
||||
end
|
||||
@@ -37,7 +37,7 @@ ProduceUnits = function(factory, count)
|
||||
|
||||
if not factory.IsDead then
|
||||
factory.IsPrimaryBuilding = true
|
||||
ussr.Build(units, function(soldiers)
|
||||
USSR.Build(units, function(soldiers)
|
||||
Utils.Do(soldiers, function(unit) IdleHunt(unit) end)
|
||||
end)
|
||||
end
|
||||
@@ -46,8 +46,8 @@ end
|
||||
SendAlliedUnits = function()
|
||||
Camera.Position = TanyaWaypoint.CenterPosition
|
||||
|
||||
local Artillery = Actor.Create("arty", true, { Owner = player, Location = AlliedUnitsEntry.Location })
|
||||
local Tanya = Actor.Create(TanyaType, true, { Owner = player, Location = AlliedUnitsEntry.Location })
|
||||
local Artillery = Actor.Create("arty", true, { Owner = Greece, Location = AlliedUnitsEntry.Location })
|
||||
local Tanya = Actor.Create(TanyaType, true, { Owner = Greece, Location = AlliedUnitsEntry.Location })
|
||||
|
||||
if TanyaType == "e7.noautotarget" then
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
@@ -59,11 +59,11 @@ SendAlliedUnits = function()
|
||||
Tanya.Move(TanyaWaypoint.Location)
|
||||
Artillery.Move(ArtilleryWaypoint.Location)
|
||||
|
||||
Trigger.OnKilled(Tanya, function() player.MarkFailedObjective(TanyaSurvive) end)
|
||||
Trigger.OnKilled(Tanya, function() Greece.MarkFailedObjective(TanyaSurvive) end)
|
||||
end
|
||||
|
||||
SendUSSRParadrops = function()
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = ussr })
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
|
||||
local aircraftA = powerproxy.TargetParatroopers(ParadropLZ.CenterPosition, Angle.SouthEast)
|
||||
Utils.Do(aircraftA, function(a)
|
||||
@@ -83,13 +83,13 @@ SendUSSRParadrops = function()
|
||||
end
|
||||
|
||||
SendUSSRWaterTransport = function()
|
||||
local units = Reinforcements.ReinforceWithTransport(ussr, "lst", TransportReinforcements, { WaterTransportEntry.Location, WaterTransportLoadout.Location }, { WaterTransportExit.Location })[2]
|
||||
local units = Reinforcements.ReinforceWithTransport(USSR, "lst", TransportReinforcements, { WaterTransportEntry.Location, WaterTransportLoadout.Location }, { WaterTransportExit.Location })[2]
|
||||
Utils.Do(units, function(unit) IdleHunt(unit) end)
|
||||
end
|
||||
|
||||
SendUSSRTankReinforcements = function()
|
||||
local camera = Actor.Create("camera", true, { Owner = player, Location = USSRReinforcementsCameraWaypoint.Location })
|
||||
local ussrTank = Reinforcements.Reinforce(ussr, { "3tnk" }, { USSRReinforcementsEntryWaypoint.Location, USSRReinforcementsRallyWaypoint1.Location, USSRReinforcementsRallyWaypoint2.Location })[1]
|
||||
local camera = Actor.Create("camera", true, { Owner = Greece, Location = USSRReinforcementsCameraWaypoint.Location })
|
||||
local ussrTank = Reinforcements.Reinforce(USSR, { "3tnk" }, { USSRReinforcementsEntryWaypoint.Location, USSRReinforcementsRallyWaypoint1.Location, USSRReinforcementsRallyWaypoint2.Location })[1]
|
||||
Trigger.OnRemovedFromWorld(ussrTank, function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
if not camera.IsDead then
|
||||
@@ -100,28 +100,28 @@ SendUSSRTankReinforcements = function()
|
||||
end
|
||||
|
||||
InitPlayers = function()
|
||||
player = Player.GetPlayer("Greece")
|
||||
ussr = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
|
||||
ussr.Cash = 10000
|
||||
USSR.Cash = 10000
|
||||
end
|
||||
|
||||
AddObjectives = function()
|
||||
KillBridges = AddPrimaryObjective(player, "destroy-bridges")
|
||||
TanyaSurvive = AddPrimaryObjective(player, "tanya-survive")
|
||||
KillUSSR = AddSecondaryObjective(player, "destroy-oilpumps")
|
||||
FreePrisoners = AddSecondaryObjective(player, "free-prisoners")
|
||||
KillBridges = AddPrimaryObjective(Greece, "destroy-bridges")
|
||||
TanyaSurvive = AddPrimaryObjective(Greece, "tanya-survive")
|
||||
KillUSSR = AddSecondaryObjective(Greece, "destroy-oilpumps")
|
||||
FreePrisoners = AddSecondaryObjective(Greece, "free-prisoners")
|
||||
end
|
||||
|
||||
InitTriggers = function()
|
||||
Utils.Do(ussr.GetGroundAttackers(), function(unit)
|
||||
Utils.Do(USSR.GetGroundAttackers(), function(unit)
|
||||
Trigger.OnDamaged(unit, function() IdleHunt(unit) end)
|
||||
end)
|
||||
|
||||
Trigger.OnAnyKilled(Prisoners, function() player.MarkFailedObjective(FreePrisoners) end)
|
||||
Trigger.OnAnyKilled(Prisoners, function() Greece.MarkFailedObjective(FreePrisoners) end)
|
||||
|
||||
Trigger.OnKilled(USSRTechCenter, function()
|
||||
Actor.Create("moneycrate", true, { Owner = ussr, Location = USSRMoneyCrateSpawn.Location })
|
||||
Actor.Create("moneycrate", true, { Owner = USSR, Location = USSRMoneyCrateSpawn.Location })
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(ExplosiveBarrel, function()
|
||||
@@ -135,9 +135,9 @@ InitTriggers = function()
|
||||
end)
|
||||
|
||||
local baseTrigger = Trigger.OnEnteredFootprint(CameraTriggerArea, function(a, id)
|
||||
if a.Owner == player and not baseCamera then
|
||||
if a.Owner == Greece and not BaseCamera then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
baseCamera = Actor.Create("camera", true, { Owner = player, Location = BaseCameraWaypoint.Location })
|
||||
BaseCamera = Actor.Create("camera", true, { Owner = Greece, Location = BaseCameraWaypoint.Location })
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -145,8 +145,8 @@ InitTriggers = function()
|
||||
Trigger.OnDamaged(unit, function()
|
||||
if not FirstBaseAlert then
|
||||
FirstBaseAlert = true
|
||||
if not baseCamera then
|
||||
baseCamera = Actor.Create("camera", true, { Owner = player, Location = BaseCameraWaypoint.Location })
|
||||
if not BaseCamera then
|
||||
BaseCamera = Actor.Create("camera", true, { Owner = Greece, Location = BaseCameraWaypoint.Location })
|
||||
Trigger.RemoveFootprintTrigger(baseTrigger)
|
||||
end
|
||||
Utils.Do(FirstUSSRBase, function(unit)
|
||||
@@ -156,7 +156,7 @@ InitTriggers = function()
|
||||
end)
|
||||
for i = 0, 2 do
|
||||
Trigger.AfterDelay(DateTime.Seconds(i), function()
|
||||
Media.PlaySoundNotification(player, "AlertBuzzer")
|
||||
Media.PlaySoundNotification(Greece, "AlertBuzzer")
|
||||
end)
|
||||
end
|
||||
ProduceUnits(ProductionBuildings[1], Utils.RandomInteger(4, 8))
|
||||
@@ -164,8 +164,8 @@ InitTriggers = function()
|
||||
end)
|
||||
end)
|
||||
Trigger.OnAllKilledOrCaptured(FirstUSSRBase, function()
|
||||
if baseCamera and baseCamera.IsInWorld then
|
||||
baseCamera.Destroy()
|
||||
if BaseCamera and BaseCamera.IsInWorld then
|
||||
BaseCamera.Destroy()
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -180,7 +180,7 @@ InitTriggers = function()
|
||||
end)
|
||||
for i = 0, 2 do
|
||||
Trigger.AfterDelay(DateTime.Seconds(i), function()
|
||||
Media.PlaySoundNotification(player, "AlertBuzzer")
|
||||
Media.PlaySoundNotification(Greece, "AlertBuzzer")
|
||||
end)
|
||||
end
|
||||
ProduceUnits(ProductionBuildings[2], Utils.RandomInteger(5, 7))
|
||||
@@ -189,7 +189,7 @@ InitTriggers = function()
|
||||
end)
|
||||
|
||||
Trigger.OnCapture(USSRRadarDome, function(self)
|
||||
largeCamera = Actor.Create("camera.verylarge", true, { Owner = player, Location = LargeCameraWaypoint.Location })
|
||||
local largeCamera = Actor.Create("camera.verylarge", true, { Owner = Greece, Location = LargeCameraWaypoint.Location })
|
||||
Trigger.ClearAll(self)
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Trigger.OnRemovedFromWorld(self, function()
|
||||
@@ -200,22 +200,22 @@ InitTriggers = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(WaterTransportTriggerArea, function(a, id)
|
||||
if a.Owner == player and not waterTransportTriggered then
|
||||
waterTransportTriggered = true
|
||||
if a.Owner == Greece and not WaterTransportTriggered then
|
||||
WaterTransportTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
SendUSSRWaterTransport()
|
||||
end
|
||||
end)
|
||||
Trigger.OnEnteredFootprint(ParadropTriggerArea, function(a, id)
|
||||
if a.Owner == player and not paradropsTriggered then
|
||||
paradropsTriggered = true
|
||||
if a.Owner == Greece and not ParadropsTriggered then
|
||||
ParadropsTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
SendUSSRParadrops()
|
||||
end
|
||||
end)
|
||||
Trigger.OnEnteredFootprint(ReinforcementsTriggerArea, function(a, id)
|
||||
if a.Owner == player and not reinforcementsTriggered then
|
||||
reinforcementsTriggered = true
|
||||
if a.Owner == Greece and not ReinforcementsTriggered then
|
||||
ReinforcementsTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() SendUSSRTankReinforcements() end)
|
||||
end
|
||||
@@ -225,19 +225,19 @@ InitTriggers = function()
|
||||
local bridges = Utils.Where(Map.ActorsInWorld, function(actor) return actor.Type == "bridge1" end)
|
||||
|
||||
Trigger.OnAllKilled(bridges, function()
|
||||
player.MarkCompletedObjective(KillBridges)
|
||||
player.MarkCompletedObjective(TanyaSurvive)
|
||||
Greece.MarkCompletedObjective(KillBridges)
|
||||
Greece.MarkCompletedObjective(TanyaSurvive)
|
||||
|
||||
-- The prisoners are free once their guards are dead
|
||||
if PGuard1.IsDead and PGuard2.IsDead then
|
||||
player.MarkCompletedObjective(FreePrisoners)
|
||||
Greece.MarkCompletedObjective(FreePrisoners)
|
||||
end
|
||||
end)
|
||||
|
||||
local oilPumps = ussr.GetActorsByType("v19")
|
||||
local oilPumps = USSR.GetActorsByType("v19")
|
||||
|
||||
Trigger.OnAllKilled(oilPumps, function()
|
||||
player.MarkCompletedObjective(KillUSSR)
|
||||
Greece.MarkCompletedObjective(KillUSSR)
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -253,7 +253,7 @@ WorldLoaded = function()
|
||||
|
||||
InitPlayers()
|
||||
|
||||
InitObjectives(player)
|
||||
InitObjectives(Greece)
|
||||
AddObjectives()
|
||||
InitTriggers()
|
||||
SendAlliedUnits()
|
||||
|
||||
@@ -41,7 +41,7 @@ Tick = function()
|
||||
end
|
||||
|
||||
ProduceUnits = function(factory, count)
|
||||
if ussr.IsProducing("e1") then
|
||||
if USSR.IsProducing("e1") then
|
||||
Trigger.AfterDelay(DateTime.Seconds(5), function() ProduceUnits(factory, count) end)
|
||||
return
|
||||
end
|
||||
@@ -53,14 +53,14 @@ ProduceUnits = function(factory, count)
|
||||
|
||||
if not factory.IsDead then
|
||||
factory.IsPrimaryBuilding = true
|
||||
ussr.Build(units, function(soldiers)
|
||||
USSR.Build(units, function(soldiers)
|
||||
Utils.Do(soldiers, function(unit) IdleHunt(unit) end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
SetupAlliedUnits = function()
|
||||
Tanya = Actor.Create(TanyaType, true, { Owner = player, Location = TanyaWaypoint.Location, Facing = Angle.South })
|
||||
Tanya = Actor.Create(TanyaType, true, { Owner = Greece, Location = TanyaWaypoint.Location, Facing = Angle.South })
|
||||
|
||||
if TanyaType == "e7.noautotarget" then
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
@@ -74,18 +74,18 @@ SetupAlliedUnits = function()
|
||||
InsertionHeli.Move(InsertionHeliExit.Location)
|
||||
InsertionHeli.Destroy()
|
||||
|
||||
Trigger.OnKilled(Tanya, function() player.MarkFailedObjective(TanyaSurvive) end)
|
||||
Trigger.OnKilled(Tanya, function() Greece.MarkFailedObjective(TanyaSurvive) end)
|
||||
end
|
||||
|
||||
SetupTopRightIsland = function()
|
||||
player.MarkCompletedObjective(FindAllies)
|
||||
Media.PlaySpeechNotification(player, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(player, AlliedIslandReinforcements, { AlliedIslandReinforcementsEntry.Location, IslandParadropReinforcementsDropzone.Location })
|
||||
Greece.MarkCompletedObjective(FindAllies)
|
||||
Media.PlaySpeechNotification(Greece, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(Greece, AlliedIslandReinforcements, { AlliedIslandReinforcementsEntry.Location, IslandParadropReinforcementsDropzone.Location })
|
||||
SendUSSRParadrops(Angle.New(720), IslandParadropReinforcementsDropzone)
|
||||
end
|
||||
|
||||
SendUSSRParadrops = function(facing, dropzone)
|
||||
local paraproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = ussr })
|
||||
local paraproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
|
||||
local aircraft = paraproxy.TargetParatroopers(dropzone.CenterPosition, facing)
|
||||
Utils.Do(aircraft, function(a)
|
||||
@@ -98,8 +98,8 @@ SendUSSRParadrops = function(facing, dropzone)
|
||||
end
|
||||
|
||||
SendUSSRTankReinforcements = function()
|
||||
local camera = Actor.Create("camera", true, { Owner = player, Location = USSRReinforcementsCameraWaypoint.Location })
|
||||
local ussrTanks = Reinforcements.Reinforce(ussr, USSRTankReinforcements, USSRTankReinforcementsWaypoints)
|
||||
local camera = Actor.Create("camera", true, { Owner = Greece, Location = USSRReinforcementsCameraWaypoint.Location })
|
||||
local ussrTanks = Reinforcements.Reinforce(USSR, USSRTankReinforcements, USSRTankReinforcementsWaypoints)
|
||||
Trigger.OnAllRemovedFromWorld(ussrTanks, function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
if not camera.IsDead then
|
||||
@@ -110,7 +110,7 @@ SendUSSRTankReinforcements = function()
|
||||
end
|
||||
|
||||
JeepCheckpointMove = function()
|
||||
JeepCamera = Actor.Create("camera.jeep", true, { Owner = player })
|
||||
JeepCamera = Actor.Create("camera.jeep", true, { Owner = Greece })
|
||||
TeleportJeepCamera = true
|
||||
|
||||
Trigger.OnIdle(Jeep, function()
|
||||
@@ -129,7 +129,7 @@ end
|
||||
|
||||
JeepSuicideMove = function()
|
||||
if not JeepCamera then
|
||||
JeepCamera = Actor.Create("camera.jeep", true, { Owner = player })
|
||||
JeepCamera = Actor.Create("camera.jeep", true, { Owner = Greece })
|
||||
TeleportJeepCamera = true
|
||||
end
|
||||
|
||||
@@ -156,7 +156,7 @@ AlertFirstBase = function()
|
||||
end)
|
||||
for i = 0, 2 do
|
||||
Trigger.AfterDelay(DateTime.Seconds(i), function()
|
||||
Media.PlaySoundNotification(player, "AlertBuzzer")
|
||||
Media.PlaySoundNotification(Greece, "AlertBuzzer")
|
||||
end)
|
||||
end
|
||||
ProduceUnits(ProductionBuildings[1], Utils.RandomInteger(4, 8))
|
||||
@@ -164,42 +164,42 @@ AlertFirstBase = function()
|
||||
end
|
||||
|
||||
InitPlayers = function()
|
||||
player = Player.GetPlayer("Greece")
|
||||
ussr = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
|
||||
ussr.Cash = 10000
|
||||
USSR.Cash = 10000
|
||||
end
|
||||
|
||||
AddObjectives = function()
|
||||
InitObjectives(player)
|
||||
InitObjectives(Greece)
|
||||
|
||||
KillBridges = AddPrimaryObjective(player, "destroy-bridges")
|
||||
TanyaSurvive = AddPrimaryObjective(player, "tanya-survive")
|
||||
FindAllies = AddSecondaryObjective(player, "find-lost-tanks")
|
||||
FreePrisoners = AddSecondaryObjective(player, "free-prisoners")
|
||||
KillBridges = AddPrimaryObjective(Greece, "destroy-bridges")
|
||||
TanyaSurvive = AddPrimaryObjective(Greece, "tanya-survive")
|
||||
FindAllies = AddSecondaryObjective(Greece, "find-lost-tanks")
|
||||
FreePrisoners = AddSecondaryObjective(Greece, "free-prisoners")
|
||||
end
|
||||
|
||||
InitTriggers = function()
|
||||
Utils.Do(ussr.GetGroundAttackers(), function(unit)
|
||||
Utils.Do(USSR.GetGroundAttackers(), function(unit)
|
||||
Trigger.OnDamaged(unit, function() IdleHunt(unit) end)
|
||||
end)
|
||||
|
||||
Trigger.OnAnyKilled(Prisoners, function() player.MarkFailedObjective(FreePrisoners) end)
|
||||
Trigger.OnKilled(PrisonedMedi, function() player.MarkFailedObjective(FreePrisoners) end)
|
||||
Trigger.OnAnyKilled(Prisoners, function() Greece.MarkFailedObjective(FreePrisoners) end)
|
||||
Trigger.OnKilled(PrisonedMedi, function() Greece.MarkFailedObjective(FreePrisoners) end)
|
||||
Trigger.OnKilled(MediHideaway, function()
|
||||
if not MediFreed then
|
||||
MediFreed = true
|
||||
player.MarkFailedObjective(FreePrisoners)
|
||||
Greece.MarkFailedObjective(FreePrisoners)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(ExplosiveBarrel, function()
|
||||
if reinforcementsTriggered then
|
||||
if ReinforcementsTriggered then
|
||||
return
|
||||
end
|
||||
|
||||
if not ExplodingBridge.IsDead then ExplodingBridge.Kill() end
|
||||
reinforcementsTriggered = true
|
||||
ReinforcementsTriggered = true
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), SendUSSRTankReinforcements)
|
||||
end)
|
||||
|
||||
@@ -215,19 +215,19 @@ InitTriggers = function()
|
||||
if not tank.IsDead then tank.Kill() end
|
||||
end)
|
||||
|
||||
jeepTriggered = true
|
||||
JeepTriggered = true
|
||||
JeepSuicideMove()
|
||||
end)
|
||||
|
||||
Utils.Do(FirstUSSRBase, function(unit)
|
||||
Trigger.OnDamaged(unit, function()
|
||||
if not baseCamera then baseCamera = Actor.Create("camera", true, { Owner = player, Location = BaseCameraWaypoint.Location }) end
|
||||
if not BaseCamera then BaseCamera = Actor.Create("camera", true, { Owner = Greece, Location = BaseCameraWaypoint.Location }) end
|
||||
AlertFirstBase()
|
||||
end)
|
||||
end)
|
||||
Trigger.OnAllKilledOrCaptured(FirstUSSRBase, function()
|
||||
if baseCamera and baseCamera.IsInWorld then
|
||||
baseCamera.Destroy()
|
||||
if BaseCamera and BaseCamera.IsInWorld then
|
||||
BaseCamera.Destroy()
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -239,19 +239,19 @@ InitTriggers = function()
|
||||
end)
|
||||
|
||||
Trigger.OnCapture(USSRRadarDome, function()
|
||||
largeCameraA = Actor.Create("camera.verylarge", true, { Owner = player, Location = LargeCameraWaypoint1.Location })
|
||||
largeCameraB = Actor.Create("camera.verylarge", true, { Owner = player, Location = LargeCameraWaypoint2.Location })
|
||||
largeCameraC = Actor.Create("camera.verylarge", true, { Owner = player, Location = LargeCameraWaypoint3.Location })
|
||||
LargeCameraA = Actor.Create("camera.verylarge", true, { Owner = Greece, Location = LargeCameraWaypoint1.Location })
|
||||
LargeCameraB = Actor.Create("camera.verylarge", true, { Owner = Greece, Location = LargeCameraWaypoint2.Location })
|
||||
LargeCameraC = Actor.Create("camera.verylarge", true, { Owner = Greece, Location = LargeCameraWaypoint3.Location })
|
||||
end)
|
||||
Trigger.OnRemovedFromWorld(USSRRadarDome, function()
|
||||
if largeCameraA and largeCameraA.IsInWorld then largeCameraA.Destroy() end
|
||||
if largeCameraB and largeCameraB.IsInWorld then largeCameraB.Destroy() end
|
||||
if largeCameraC and largeCameraC.IsInWorld then largeCameraC.Destroy() end
|
||||
if LargeCameraA and LargeCameraA.IsInWorld then LargeCameraA.Destroy() end
|
||||
if LargeCameraB and LargeCameraB.IsInWorld then LargeCameraB.Destroy() end
|
||||
if LargeCameraC and LargeCameraC.IsInWorld then LargeCameraC.Destroy() end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(TrukTriggerArea, function(a, id)
|
||||
if a.Owner == player and not trukTriggered then
|
||||
trukTriggered = true
|
||||
if a.Owner == Greece and not TrukTriggered then
|
||||
TrukTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
|
||||
if USSRTruk.IsDead then
|
||||
@@ -262,7 +262,7 @@ InitTriggers = function()
|
||||
if USSRTruk.Location == BaseCameraWaypoint.Location then
|
||||
Trigger.ClearAll(USSRTruk)
|
||||
|
||||
local driver = Actor.Create("e1", true, { Owner = ussr, Location = USSRTruk.Location })
|
||||
local driver = Actor.Create("e1", true, { Owner = USSR, Location = USSRTruk.Location })
|
||||
if not PGuard5.IsDead then
|
||||
driver.AttackMove(PGuard5.Location)
|
||||
else
|
||||
@@ -276,57 +276,57 @@ InitTriggers = function()
|
||||
end
|
||||
end)
|
||||
Trigger.OnEnteredProximityTrigger(BaseCameraWaypoint.CenterPosition, WDist.New(7 * 1024), function(a, id)
|
||||
if a.Type == "truk" and not baseCamera then
|
||||
if a.Type == "truk" and not BaseCamera then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
baseCamera = Actor.Create("camera", true, { Owner = player, Location = BaseCameraWaypoint.Location })
|
||||
BaseCamera = Actor.Create("camera", true, { Owner = Greece, Location = BaseCameraWaypoint.Location })
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
Trigger.OnEnteredFootprint(FreeMediTriggerArea, function(a, id)
|
||||
if a.Owner == player and not MediFreed then
|
||||
if a.Owner == Greece and not MediFreed then
|
||||
MediFreed = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
Reinforcements.Reinforce(player, { "medi" }, { MediSpawnpoint.Location, MediRallypoint.Location })
|
||||
Reinforcements.Reinforce(Greece, { "medi" }, { MediSpawnpoint.Location, MediRallypoint.Location })
|
||||
end
|
||||
end)
|
||||
Trigger.OnEnteredFootprint(CameraTriggerArea, function(a, id)
|
||||
if a.Owner == player and not baseCamera then
|
||||
if a.Owner == Greece and not BaseCamera then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
baseCamera = Actor.Create("camera", true, { Owner = player, Location = BaseCameraWaypoint.Location })
|
||||
BaseCamera = Actor.Create("camera", true, { Owner = Greece, Location = BaseCameraWaypoint.Location })
|
||||
end
|
||||
end)
|
||||
Trigger.OnEnteredFootprint(BeachTriggerArea, function(a, id)
|
||||
if a.Owner == player and not beachTransportTriggered then
|
||||
beachTransportTriggered = true
|
||||
if a.Owner == Greece and not BeachTransportTriggered then
|
||||
BeachTransportTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
SetupTopRightIsland()
|
||||
end
|
||||
end)
|
||||
Trigger.OnEnteredFootprint(ParadropTriggerArea, function(a, id)
|
||||
if a.Owner == player and a.Type ~= "jeep.mission" and not paradropsTriggered then
|
||||
paradropsTriggered = true
|
||||
if a.Owner == Greece and a.Type ~= "jeep.mission" and not ParadropsTriggered then
|
||||
ParadropsTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
SendUSSRParadrops(Angle.New(216), ParadropReinforcementsDropzone)
|
||||
end
|
||||
end)
|
||||
Trigger.OnEnteredFootprint(ReinforcementsTriggerArea, function(a, id)
|
||||
if a.Owner == player and not reinforcementsTriggered then
|
||||
reinforcementsTriggered = true
|
||||
if a.Owner == Greece and not ReinforcementsTriggered then
|
||||
ReinforcementsTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), SendUSSRTankReinforcements)
|
||||
end
|
||||
end)
|
||||
Trigger.OnEnteredFootprint(Barracks3TriggerArea, function(a, id)
|
||||
if a.Owner == player and not Barracks3Producing then
|
||||
if a.Owner == Greece and not Barracks3Producing then
|
||||
Barracks3Producing = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
ProduceUnits(ProductionBuildings[3], Utils.RandomInteger(2, 5))
|
||||
end
|
||||
end)
|
||||
Trigger.OnEnteredFootprint(JeepTriggerArea, function(a, id)
|
||||
if a.Owner == player and not jeepTriggered then
|
||||
jeepTriggered = true
|
||||
if a.Owner == Greece and not JeepTriggered then
|
||||
JeepTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
JeepCheckpointMove()
|
||||
end
|
||||
@@ -345,12 +345,12 @@ InitTriggers = function()
|
||||
ExplodingBridge = bridges[1]
|
||||
|
||||
Trigger.OnAllKilled(bridges, function()
|
||||
player.MarkCompletedObjective(KillBridges)
|
||||
player.MarkCompletedObjective(TanyaSurvive)
|
||||
Greece.MarkCompletedObjective(KillBridges)
|
||||
Greece.MarkCompletedObjective(TanyaSurvive)
|
||||
|
||||
-- The medic is freed once his guard is dead
|
||||
if MediFreed and MediGuard.IsDead and EngisFreed then
|
||||
player.MarkCompletedObjective(FreePrisoners)
|
||||
Greece.MarkCompletedObjective(FreePrisoners)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -59,9 +59,9 @@ BaseBuildings = { Powr1, Barr, Proc, Weap, Powr2, Powr3, Powr4, Ftur1, Ftur2, Ft
|
||||
InitialBase = { Barracks, Refinery, PowerPlant1, PowerPlant2, PowerPlant3, PowerPlant4, Warfactory, Flametur1, Flametur2, Flametur3, Airfield1, Airfield2 }
|
||||
|
||||
BuildBase = function()
|
||||
if Conyard.IsDead or Conyard.Owner ~= ussr then
|
||||
if Conyard.IsDead or Conyard.Owner ~= USSR then
|
||||
return
|
||||
elseif Harvester.IsDead and ussr.Resources <= 299 then
|
||||
elseif Harvester.IsDead and USSR.Resources <= 299 then
|
||||
return
|
||||
end
|
||||
|
||||
@@ -77,13 +77,13 @@ end
|
||||
|
||||
BuildBuilding = function(building)
|
||||
Trigger.AfterDelay(Actor.BuildTime(building.name), function()
|
||||
local actor = Actor.Create(building.name, true, { Owner = ussr, Location = building.pos })
|
||||
ussr.Cash = ussr.Cash - building.prize
|
||||
local actor = Actor.Create(building.name, true, { Owner = USSR, Location = building.pos })
|
||||
USSR.Cash = USSR.Cash - building.prize
|
||||
|
||||
building.exists = true
|
||||
Trigger.OnKilled(actor, function() building.exists = false end)
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == ussr and building.Health < building.MaxHealth * 3/4 then
|
||||
if building.Owner == USSR and building.Health < building.MaxHealth * 3/4 then
|
||||
building.StartBuildingRepairs()
|
||||
DefendActor(actor)
|
||||
end
|
||||
@@ -163,13 +163,13 @@ DefendActor = function(unit)
|
||||
end
|
||||
|
||||
InitAIUnits = function()
|
||||
IdlingUnits = ussr.GetGroundAttackers()
|
||||
IdlingUnits = USSR.GetGroundAttackers()
|
||||
|
||||
DefendActor(Conyard)
|
||||
for i,v in ipairs(InitialBase) do
|
||||
DefendActor(v)
|
||||
Trigger.OnDamaged(v, function(building)
|
||||
if building.Owner == ussr and building.Health < building.MaxHealth * 3/4 then
|
||||
if building.Owner == USSR and building.Health < building.MaxHealth * 3/4 then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
@@ -189,7 +189,7 @@ ProduceInfantry = function()
|
||||
-- See AttackDelay in WorldLoaded
|
||||
local delay = Utils.RandomInteger(AttackDelay[1], AttackDelay[2])
|
||||
local toBuild = { Utils.Random(SovietInfantryTypes) }
|
||||
ussr.Build(toBuild, function(unit)
|
||||
USSR.Build(toBuild, function(unit)
|
||||
IdlingUnits[#IdlingUnits + 1] = unit[1]
|
||||
Trigger.AfterDelay(delay, ProduceInfantry)
|
||||
|
||||
@@ -209,14 +209,14 @@ ProduceVehicles = function()
|
||||
-- See AttackDelay in WorldLoaded
|
||||
local delay = Utils.RandomInteger(AttackDelay[1], AttackDelay[2])
|
||||
if HarvesterKilled then
|
||||
ussr.Build({ "harv" }, function(harv)
|
||||
USSR.Build({ "harv" }, function(harv)
|
||||
ProtectHarvester(harv[1])
|
||||
HarvesterKilled = false
|
||||
Trigger.AfterDelay(delay, ProduceVehicles)
|
||||
end)
|
||||
else
|
||||
local toBuild = { Utils.Random(SovietVehicleTypes) }
|
||||
ussr.Build(toBuild, function(unit)
|
||||
USSR.Build(toBuild, function(unit)
|
||||
IdlingUnits[#IdlingUnits + 1] = unit[1]
|
||||
Trigger.AfterDelay(delay, ProduceVehicles)
|
||||
|
||||
@@ -229,7 +229,7 @@ ProduceVehicles = function()
|
||||
end
|
||||
|
||||
ProduceAircraft = function()
|
||||
ussr.Build(SovietAircraftType, function(units)
|
||||
USSR.Build(SovietAircraftType, function(units)
|
||||
local yak = units[1]
|
||||
Yaks[#Yaks + 1] = yak
|
||||
|
||||
@@ -238,7 +238,7 @@ ProduceAircraft = function()
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), ProduceAircraft)
|
||||
end
|
||||
|
||||
InitializeAttackAircraft(yak, player)
|
||||
InitializeAttackAircraft(yak, Greece)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ Paradrop = function()
|
||||
Trigger.AfterDelay(Utils.RandomInteger(ParadropDelay[1], ParadropDelay[2]), function()
|
||||
local aircraft = PowerProxy.TargetParatroopers(Utils.Random(ParadropLZs))
|
||||
Utils.Do(aircraft, function(a)
|
||||
Trigger.OnPassengerExited(a, function(t, p)
|
||||
Trigger.OnPassengerExited(a, function(_, p)
|
||||
IdleHunt(p)
|
||||
end)
|
||||
end)
|
||||
@@ -75,7 +75,7 @@ ConvoysSent = 0
|
||||
SendConvoys = function()
|
||||
Trigger.AfterDelay(Utils.RandomInteger(ConvoyDelay[1], ConvoyDelay[2]), function()
|
||||
local path = Utils.Random(ConvoyRallyPoints)
|
||||
local units = Reinforcements.Reinforce(ussr, Utils.Random(ConvoyUnits), { path[1] })
|
||||
local units = Reinforcements.Reinforce(USSR, Utils.Random(ConvoyUnits), { path[1] })
|
||||
local lastWaypoint = path[#path]
|
||||
|
||||
Utils.Do(units, function(unit)
|
||||
@@ -98,14 +98,14 @@ SendConvoys = function()
|
||||
end)
|
||||
|
||||
local id = Trigger.OnEnteredFootprint({ lastWaypoint }, function(a, id)
|
||||
if a.Owner == ussr and Utils.Any(units, function(unit) return unit == a end) then
|
||||
if a.Owner == USSR and Utils.Any(units, function(unit) return unit == a end) then
|
||||
|
||||
-- We are at our destination and thus don't care about other queued actions anymore
|
||||
a.Stop()
|
||||
a.Destroy()
|
||||
|
||||
if a.Type == "truk" then
|
||||
player.MarkFailedObjective(DestroyConvoys)
|
||||
Greece.MarkFailedObjective(DestroyConvoys)
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -117,44 +117,44 @@ SendConvoys = function()
|
||||
if ConvoysSent <= Convoys[Difficulty] then
|
||||
SendConvoys()
|
||||
else
|
||||
player.MarkCompletedObjective(DestroyConvoys)
|
||||
Greece.MarkCompletedObjective(DestroyConvoys)
|
||||
end
|
||||
end)
|
||||
|
||||
Media.PlaySpeechNotification(player, "ConvoyApproaching")
|
||||
Media.PlaySpeechNotification(Greece, "ConvoyApproaching")
|
||||
end)
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if player.HasNoRequiredUnits() then
|
||||
player.MarkFailedObjective(KillUSSR)
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
Greece.MarkFailedObjective(KillUSSR)
|
||||
end
|
||||
|
||||
if ussr.HasNoRequiredUnits() then
|
||||
player.MarkCompletedObjective(KillUSSR)
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(KillUSSR)
|
||||
|
||||
-- We don't care about future convoys anymore
|
||||
player.MarkCompletedObjective(DestroyConvoys)
|
||||
Greece.MarkCompletedObjective(DestroyConvoys)
|
||||
end
|
||||
end
|
||||
|
||||
AddObjectives = function()
|
||||
KillUSSR = AddPrimaryObjective(player, "destroy-soviet-units-buildings")
|
||||
DestroyConvoys = AddSecondaryObjective(player, "destroy-convoys")
|
||||
KillUSSR = AddPrimaryObjective(Greece, "destroy-soviet-units-buildings")
|
||||
DestroyConvoys = AddSecondaryObjective(Greece, "destroy-convoys")
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("Greece")
|
||||
ussr = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
|
||||
Camera.Position = AlliedConyard.CenterPosition
|
||||
|
||||
InitObjectives(player)
|
||||
InitObjectives(Greece)
|
||||
AddObjectives()
|
||||
|
||||
ConvoyDelay = ConvoyDelays[Difficulty]
|
||||
ParadropDelay = ParadropDelays[Difficulty]
|
||||
PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = ussr })
|
||||
PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
Paradrop()
|
||||
SendConvoys()
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ WaterAttack = function()
|
||||
types[i] = Utils.Random(SovietInfantryTypes)
|
||||
end
|
||||
|
||||
return Reinforcements.ReinforceWithTransport(ussr, InsertionTransport, types, { WaterTransportSpawn.Location, Utils.Random(WaterLZs).Location }, { WaterTransportSpawn.Location })[2]
|
||||
return Reinforcements.ReinforceWithTransport(USSR, InsertionTransport, types, { WaterTransportSpawn.Location, Utils.Random(WaterLZs).Location }, { WaterTransportSpawn.Location })[2]
|
||||
end
|
||||
|
||||
ProtectHarvester = function(unit)
|
||||
@@ -111,12 +111,12 @@ ProtectHarvester = function(unit)
|
||||
end
|
||||
|
||||
InitAIUnits = function()
|
||||
IdlingUnits = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == ussr and self.HasProperty("Hunt") and self.Location.Y > MainBaseTopLeft.Location.Y end)
|
||||
IdlingUnits = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == USSR and self.HasProperty("Hunt") and self.Location.Y > MainBaseTopLeft.Location.Y end)
|
||||
|
||||
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)
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == ussr and building.Health < building.MaxHealth * 3/4 then
|
||||
if building.Owner == USSR and building.Health < building.MaxHealth * 3/4 then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
@@ -124,7 +124,7 @@ InitAIUnits = function()
|
||||
end
|
||||
|
||||
InitAIEconomy = function()
|
||||
ussr.Cash = 6000
|
||||
USSR.Cash = 6000
|
||||
|
||||
if not Harvester.IsDead then
|
||||
Harvester.FindResources()
|
||||
@@ -200,7 +200,7 @@ ProduceInfantry = function()
|
||||
|
||||
local delay = Utils.RandomInteger(DateTime.Seconds(3), DateTime.Seconds(9))
|
||||
local toBuild = { Utils.Random(SovietInfantryTypes) }
|
||||
ussr.Build(toBuild, function(unit)
|
||||
USSR.Build(toBuild, function(unit)
|
||||
IdlingUnits[#IdlingUnits + 1] = unit[1]
|
||||
Trigger.AfterDelay(delay, ProduceInfantry)
|
||||
|
||||
@@ -223,7 +223,7 @@ ProduceVehicles = function()
|
||||
local delay = Utils.RandomInteger(DateTime.Seconds(5), DateTime.Seconds(9))
|
||||
if HarvesterKilled then
|
||||
HarvesterKilled = false
|
||||
ussr.Build({ "harv" }, function(harv)
|
||||
USSR.Build({ "harv" }, function(harv)
|
||||
harv[1].FindResources()
|
||||
ProtectHarvester(harv[1])
|
||||
Trigger.AfterDelay(delay, ProduceVehicles)
|
||||
@@ -233,7 +233,7 @@ ProduceVehicles = function()
|
||||
|
||||
Warfactory2.RallyPoint = Utils.Random(Rallypoints).Location
|
||||
local toBuild = { Utils.Random(SovietVehicleTypes) }
|
||||
ussr.Build(toBuild, function(unit)
|
||||
USSR.Build(toBuild, function(unit)
|
||||
IdlingUnits[#IdlingUnits + 1] = unit[1]
|
||||
Trigger.AfterDelay(delay, ProduceVehicles)
|
||||
|
||||
@@ -248,7 +248,7 @@ ProduceAircraft = function()
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build(SovietAircraftType, function(units)
|
||||
USSR.Build(SovietAircraftType, function(units)
|
||||
local yak = units[1]
|
||||
Yaks[#Yaks + 1] = yak
|
||||
|
||||
@@ -257,7 +257,7 @@ ProduceAircraft = function()
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), ProduceAircraft)
|
||||
end
|
||||
|
||||
InitializeAttackAircraft(yak, greece)
|
||||
InitializeAttackAircraft(yak, Greece)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -88,33 +88,33 @@ Tick = function()
|
||||
Camera.Position = Truk.CenterPosition
|
||||
end
|
||||
|
||||
if ussr.HasNoRequiredUnits() then
|
||||
if not greece.IsObjectiveCompleted(KillAll) and Difficulty == "tough" then
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
if not Greece.IsObjectiveCompleted(KillAll) and Difficulty == "tough" then
|
||||
SendWaterExtraction()
|
||||
end
|
||||
greece.MarkCompletedObjective(KillAll)
|
||||
Greece.MarkCompletedObjective(KillAll)
|
||||
end
|
||||
|
||||
if GreeceReinforcementsArrived and greece.HasNoRequiredUnits() then
|
||||
ussr.MarkCompletedObjective(ussrObj)
|
||||
if GreeceReinforcementsArrived and Greece.HasNoRequiredUnits() then
|
||||
USSR.MarkCompletedObjective(USSRobjective)
|
||||
end
|
||||
|
||||
if ussr.Resources >= ussr.ResourceCapacity * 0.75 then
|
||||
ussr.Cash = ussr.Cash + ussr.Resources - ussr.ResourceCapacity * 0.25
|
||||
ussr.Resources = ussr.ResourceCapacity * 0.25
|
||||
if USSR.Resources >= USSR.ResourceCapacity * 0.75 then
|
||||
USSR.Cash = USSR.Cash + USSR.Resources - USSR.ResourceCapacity * 0.25
|
||||
USSR.Resources = USSR.ResourceCapacity * 0.25
|
||||
end
|
||||
end
|
||||
|
||||
SendReinforcements = function()
|
||||
GreeceReinforcementsArrived = true
|
||||
Camera.Position = ReinforceCamera.CenterPosition
|
||||
greece.Cash = greece.Cash + ReinforceCash
|
||||
Greece.Cash = Greece.Cash + ReinforceCash
|
||||
|
||||
Utils.Do(GreeceReinforcements, function(reinforcements)
|
||||
Reinforcements.ReinforceWithTransport(greece, InsertionTransport, reinforcements.types, reinforcements.entry, { SpyEntry.Location })
|
||||
Reinforcements.ReinforceWithTransport(Greece, InsertionTransport, reinforcements.types, reinforcements.entry, { SpyEntry.Location })
|
||||
end)
|
||||
|
||||
Media.PlaySpeechNotification(greece, "AlliedReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(Greece, "AlliedReinforcementsArrived")
|
||||
|
||||
ActivateAI()
|
||||
end
|
||||
@@ -131,19 +131,19 @@ ExtractUnits = function(extractionUnit, pos, after)
|
||||
end
|
||||
|
||||
SendWaterExtraction = function()
|
||||
local flare = Actor.Create("flare", true, { Owner = greece, Location = SpyEntryPath[2] + CVec.New(2, 0) })
|
||||
local flare = Actor.Create("flare", true, { Owner = Greece, Location = SpyEntryPath[2] + CVec.New(2, 0) })
|
||||
Trigger.AfterDelay(DateTime.Seconds(5), flare.Destroy)
|
||||
Media.PlaySpeechNotification(greece, "SignalFlareNorth")
|
||||
Media.PlaySpeechNotification(Greece, "SignalFlareNorth")
|
||||
Camera.Position = flare.CenterPosition
|
||||
|
||||
WaterExtractionTran = Reinforcements.ReinforceWithTransport(greece, ExtractionTransport, nil, SpyEntryPath)[1]
|
||||
ExtractObj = AddPrimaryObjective(greece, "extract-transport")
|
||||
WaterExtractionTran = Reinforcements.ReinforceWithTransport(Greece, ExtractionTransport, nil, SpyEntryPath)[1]
|
||||
ExtractObjective = AddPrimaryObjective(Greece, "extract-transport")
|
||||
|
||||
Trigger.OnKilled(WaterExtractionTran, function() ussr.MarkCompletedObjective(ussrObj) end)
|
||||
Trigger.OnAllRemovedFromWorld(greece.GetGroundAttackers(), function()
|
||||
Trigger.OnKilled(WaterExtractionTran, function() USSR.MarkCompletedObjective(USSRobjective) end)
|
||||
Trigger.OnAllRemovedFromWorld(Greece.GetGroundAttackers(), function()
|
||||
ExtractUnits(WaterExtractionTran, SpyEntryPath[1], function()
|
||||
greece.MarkCompletedObjective(ExtractObj)
|
||||
greece.MarkCompletedObjective(surviveObj)
|
||||
Greece.MarkCompletedObjective(ExtractObjective)
|
||||
Greece.MarkCompletedObjective(TanyaSurviveObjective)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
@@ -169,7 +169,7 @@ MissInfiltrated = function()
|
||||
for i = 0, 5, 1 do
|
||||
local sound = Utils.Random(TanyaVoices)
|
||||
Trigger.AfterDelay(DateTime.Seconds(i), function()
|
||||
Media.PlaySoundNotification(greece, sound)
|
||||
Media.PlaySoundNotification(Greece, sound)
|
||||
end)
|
||||
end
|
||||
Prison.Attack(Prison)
|
||||
@@ -179,7 +179,7 @@ end
|
||||
|
||||
FreeTanya = function()
|
||||
Prison.Stop()
|
||||
Tanya = Actor.Create(TanyaType, true, { Owner = greece, Location = Prison.Location + CVec.New(1, 1) })
|
||||
Tanya = Actor.Create(TanyaType, true, { Owner = Greece, Location = Prison.Location + CVec.New(1, 1) })
|
||||
Tanya.Demolish(Prison)
|
||||
Tanya.Move(Tanya.Location + CVec.New(Utils.RandomInteger(-1, 2), 1))
|
||||
|
||||
@@ -189,18 +189,18 @@ FreeTanya = function()
|
||||
end)
|
||||
end
|
||||
|
||||
Trigger.OnKilled(Tanya, function() ussr.MarkCompletedObjective(ussrObj) end)
|
||||
Trigger.OnKilled(Tanya, function() USSR.MarkCompletedObjective(USSRobjective) end)
|
||||
|
||||
if Difficulty == "tough" then
|
||||
KillSams = AddPrimaryObjective(greece, "destroy-sam-sites-blocker")
|
||||
KillSams = AddPrimaryObjective(Greece, "destroy-sam-sites-blocker")
|
||||
|
||||
greece.MarkCompletedObjective(mainObj)
|
||||
surviveObj = AddPrimaryObjective(greece, "tanya-survive")
|
||||
Media.PlaySpeechNotification(greece, "TanyaRescued")
|
||||
Greece.MarkCompletedObjective(RescueTanyaObjective)
|
||||
TanyaSurviveObjective = AddPrimaryObjective(Greece, "tanya-survive")
|
||||
Media.PlaySpeechNotification(Greece, "TanyaRescued")
|
||||
else
|
||||
KillSams = AddPrimaryObjective(greece, "destroy-sam-sites-blocker")
|
||||
KillSams = AddPrimaryObjective(Greece, "destroy-sam-sites-blocker")
|
||||
|
||||
Media.PlaySpeechNotification(greece, "TargetFreed")
|
||||
Media.PlaySpeechNotification(Greece, "TargetFreed")
|
||||
end
|
||||
|
||||
if not SpecialCameras and PrisonCamera and PrisonCamera.IsInWorld then
|
||||
@@ -210,13 +210,13 @@ end
|
||||
|
||||
SendSpy = function()
|
||||
Camera.Position = SpyEntry.CenterPosition
|
||||
Spy = Reinforcements.ReinforceWithTransport(greece, InsertionTransport, SpyType, SpyEntryPath, { SpyEntryPath[1] })[2][1]
|
||||
Spy = Reinforcements.ReinforceWithTransport(Greece, InsertionTransport, SpyType, SpyEntryPath, { SpyEntryPath[1] })[2][1]
|
||||
|
||||
Trigger.OnKilled(Spy, function() ussr.MarkCompletedObjective(ussrObj) end)
|
||||
Trigger.OnKilled(Spy, function() USSR.MarkCompletedObjective(USSRobjective) end)
|
||||
|
||||
if SpecialCameras then
|
||||
SpyCameraA = Actor.Create("camera", true, { Owner = greece, Location = SpyCamera1.Location })
|
||||
SpyCameraB = Actor.Create("camera", true, { Owner = greece, Location = SpyCamera2.Location })
|
||||
SpyCameraA = Actor.Create("camera", true, { Owner = Greece, Location = SpyCamera1.Location })
|
||||
SpyCameraB = Actor.Create("camera", true, { Owner = Greece, Location = SpyCamera2.Location })
|
||||
end
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
@@ -235,44 +235,44 @@ end
|
||||
|
||||
InitTriggers = function()
|
||||
Trigger.OnInfiltrated(Warfactory, function()
|
||||
if greece.IsObjectiveCompleted(infWarfactory) then
|
||||
if Greece.IsObjectiveCompleted(InfiltrateWarfactoryObjective) then
|
||||
return
|
||||
elseif Truk.IsDead then
|
||||
if not greece.IsObjectiveCompleted(mainObj) then
|
||||
ussr.MarkCompletedObjective(ussrObj)
|
||||
if not Greece.IsObjectiveCompleted(RescueTanyaObjective) then
|
||||
USSR.MarkCompletedObjective(USSRobjective)
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
Trigger.ClearAll(Spy)
|
||||
greece.MarkCompletedObjective(infWarfactory)
|
||||
Greece.MarkCompletedObjective(InfiltrateWarfactoryObjective)
|
||||
WarfactoryInfiltrated()
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Truk, function()
|
||||
if not greece.IsObjectiveCompleted(infWarfactory) then
|
||||
greece.MarkFailedObjective(infWarfactory)
|
||||
if not Greece.IsObjectiveCompleted(InfiltrateWarfactoryObjective) then
|
||||
Greece.MarkFailedObjective(InfiltrateWarfactoryObjective)
|
||||
elseif FollowTruk then
|
||||
ussr.MarkCompletedObjective(ussrObj)
|
||||
USSR.MarkCompletedObjective(USSRobjective)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnInfiltrated(Prison, function()
|
||||
if greece.IsObjectiveCompleted(mainObj) then
|
||||
if Greece.IsObjectiveCompleted(RescueTanyaObjective) then
|
||||
return
|
||||
end
|
||||
|
||||
if not greece.IsObjectiveCompleted(infWarfactory) then
|
||||
if not Greece.IsObjectiveCompleted(InfiltrateWarfactoryObjective) then
|
||||
Media.DisplayMessage(UserInterface.Translate("skip-heroics"), UserInterface.Translate("battlefield-control"))
|
||||
greece.MarkCompletedObjective(infWarfactory)
|
||||
Greece.MarkCompletedObjective(InfiltrateWarfactoryObjective)
|
||||
end
|
||||
|
||||
if not PrisonCamera then
|
||||
if SpecialCameras then
|
||||
PrisonCamera = Actor.Create("camera", true, { Owner = greece, Location = TrukWaypoint5.Location })
|
||||
PrisonCamera = Actor.Create("camera", true, { Owner = Greece, Location = TrukWaypoint5.Location })
|
||||
else
|
||||
PrisonCamera = Actor.Create("camera.small", true, { Owner = greece, Location = Prison.Location + CVec.New(1, 1) })
|
||||
PrisonCamera = Actor.Create("camera.small", true, { Owner = Greece, Location = Prison.Location + CVec.New(1, 1) })
|
||||
end
|
||||
end
|
||||
|
||||
@@ -289,21 +289,21 @@ InitTriggers = function()
|
||||
if a == Truk then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
|
||||
Spy = Actor.Create("spy", true, { Owner = greece, Location = TrukWaypoint5.Location })
|
||||
Spy.DisguiseAsType("e1", ussr)
|
||||
Spy = Actor.Create("spy", true, { Owner = Greece, Location = TrukWaypoint5.Location })
|
||||
Spy.DisguiseAsType("e1", USSR)
|
||||
Spy.Move(SpyWaypoint.Location)
|
||||
Spy.Infiltrate(Prison)
|
||||
Media.PlaySoundNotification(greece, SpyVoice)
|
||||
Media.PlaySoundNotification(Greece, SpyVoice)
|
||||
|
||||
FollowTruk = false
|
||||
|
||||
if SpecialCameras then
|
||||
PrisonCamera = Actor.Create("camera", true, { Owner = greece, Location = TrukWaypoint5.Location })
|
||||
PrisonCamera = Actor.Create("camera", true, { Owner = Greece, Location = TrukWaypoint5.Location })
|
||||
else
|
||||
PrisonCamera = Actor.Create("camera.small", true, { Owner = greece, Location = Prison.Location + CVec.New(1, 1) })
|
||||
PrisonCamera = Actor.Create("camera.small", true, { Owner = Greece, Location = Prison.Location + CVec.New(1, 1) })
|
||||
end
|
||||
|
||||
Trigger.OnKilled(Spy, function() ussr.MarkCompletedObjective(ussrObj) end)
|
||||
Trigger.OnKilled(Spy, function() USSR.MarkCompletedObjective(USSRobjective) end)
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -336,28 +336,28 @@ InitTriggers = function()
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(SamSites, function()
|
||||
greece.MarkCompletedObjective(KillSams)
|
||||
Greece.MarkCompletedObjective(KillSams)
|
||||
|
||||
local flare = Actor.Create("flare", true, { Owner = greece, Location = ExtractionPath[2] + CVec.New(0, -1) })
|
||||
local flare = Actor.Create("flare", true, { Owner = Greece, Location = ExtractionPath[2] + CVec.New(0, -1) })
|
||||
Trigger.AfterDelay(DateTime.Seconds(7), flare.Destroy)
|
||||
Media.PlaySpeechNotification(greece, "SignalFlare")
|
||||
Media.PlaySpeechNotification(Greece, "SignalFlare")
|
||||
|
||||
if Difficulty == "tough" then
|
||||
Reinforcements.ReinforceWithTransport(greece, InsertionHeliType, HeliReinforcements, ExtractionPath, { ExtractionPath[1] })
|
||||
Reinforcements.ReinforceWithTransport(Greece, InsertionHeliType, HeliReinforcements, ExtractionPath, { ExtractionPath[1] })
|
||||
if not Harvester.IsDead then
|
||||
Harvester.FindResources()
|
||||
end
|
||||
|
||||
else
|
||||
ExtractionHeli = Reinforcements.ReinforceWithTransport(greece, ExtractionHeliType, nil, ExtractionPath)[1]
|
||||
ExtractionHeli = Reinforcements.ReinforceWithTransport(Greece, ExtractionHeliType, nil, ExtractionPath)[1]
|
||||
local exitPos = CPos.New(ExtractionPath[1].X, ExtractionPath[2].Y)
|
||||
|
||||
Trigger.OnKilled(ExtractionHeli, function() ussr.MarkCompletedObjective(ussrObj) end)
|
||||
Trigger.OnKilled(ExtractionHeli, function() USSR.MarkCompletedObjective(USSRobjective) end)
|
||||
Trigger.OnRemovedFromWorld(Tanya, function()
|
||||
ExtractUnits(ExtractionHeli, exitPos, function()
|
||||
|
||||
Media.PlaySpeechNotification(greece, "TanyaRescued")
|
||||
greece.MarkCompletedObjective(mainObj)
|
||||
Media.PlaySpeechNotification(Greece, "TanyaRescued")
|
||||
Greece.MarkCompletedObjective(RescueTanyaObjective)
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
SendReinforcements()
|
||||
end)
|
||||
@@ -372,17 +372,17 @@ InitTriggers = function()
|
||||
end
|
||||
|
||||
AddObjectives = function()
|
||||
ussrObj = AddPrimaryObjective(ussr, "")
|
||||
mainObj = AddPrimaryObjective(greece, "rescue-tanya")
|
||||
KillAll = AddPrimaryObjective(greece, "elminate-soviet-units")
|
||||
infWarfactory = AddSecondaryObjective(greece, "infiltrate-warfactory")
|
||||
USSRobjective = AddPrimaryObjective(USSR, "")
|
||||
RescueTanyaObjective = AddPrimaryObjective(Greece, "rescue-tanya")
|
||||
KillAll = AddPrimaryObjective(Greece, "elminate-soviet-units")
|
||||
InfiltrateWarfactoryObjective = AddSecondaryObjective(Greece, "infiltrate-warfactory")
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
greece = Player.GetPlayer("Greece")
|
||||
ussr = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
|
||||
InitObjectives(greece)
|
||||
InitObjectives(Greece)
|
||||
AddObjectives()
|
||||
InitTriggers()
|
||||
SendSpy()
|
||||
|
||||
@@ -83,13 +83,13 @@ end
|
||||
|
||||
Attack = 0
|
||||
ProduceInfantry = function()
|
||||
if SovietBarracks.IsDead or SovietBarracks.Owner ~= ussr then
|
||||
if SovietBarracks.IsDead or SovietBarracks.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
Attack = Attack + 1
|
||||
local toBuild = Utils.Random(InfTypes)
|
||||
ussr.Build(toBuild, function(units)
|
||||
USSR.Build(toBuild, function(units)
|
||||
if Attack == 2 and not AttackTnk1.IsDead then
|
||||
units[#units + 1] = AttackTnk1
|
||||
elseif Attack == 4 and not AttackTnk2.IsDead then
|
||||
@@ -102,10 +102,10 @@ ProduceInfantry = function()
|
||||
end
|
||||
|
||||
ProduceVehicles = function()
|
||||
if WeaponsFactory.IsDead or WeaponsFactory.Owner ~= ussr then
|
||||
if WeaponsFactory.IsDead or WeaponsFactory.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
ussr.Build(VehicleTypes, function(units)
|
||||
USSR.Build(VehicleTypes, function(units)
|
||||
Utils.Do(units, function(unit)
|
||||
if unit.Type ~= "harv" then
|
||||
IdlingTanks[#IdlingTanks + 1] = unit
|
||||
@@ -115,18 +115,18 @@ ProduceVehicles = function()
|
||||
end
|
||||
|
||||
ProduceNaval = function()
|
||||
if not shouldProduce and #Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == player and self.Type == "syrd" end) < 1 then
|
||||
if not ShouldProduce and #Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == Greece and self.Type == "syrd" end) < 1 then
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), ProduceNaval)
|
||||
return
|
||||
end
|
||||
|
||||
shouldProduce = true
|
||||
ShouldProduce = true
|
||||
|
||||
if SubPen.IsDead or SubPen.Owner ~= ussr then
|
||||
if SubPen.IsDead or SubPen.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build(WaterAttackTypes, function(units)
|
||||
USSR.Build(WaterAttackTypes, function(units)
|
||||
Utils.Do(units, function(unit)
|
||||
IdlingNavalUnits[#IdlingNavalUnits + 1] = unit
|
||||
end)
|
||||
@@ -141,11 +141,11 @@ ProduceNaval = function()
|
||||
end
|
||||
|
||||
ProduceAircraft = function()
|
||||
if Airfield.IsDead or Airfield.Owner ~= ussr then
|
||||
if Airfield.IsDead or Airfield.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build(SovietAircraftType, function(units)
|
||||
USSR.Build(SovietAircraftType, function(units)
|
||||
local yak = units[1]
|
||||
Yaks[#Yaks + 1] = yak
|
||||
|
||||
@@ -154,7 +154,7 @@ ProduceAircraft = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(BuildDelays), ProduceAircraft)
|
||||
end
|
||||
|
||||
InitializeAttackAircraft(yak, player)
|
||||
InitializeAttackAircraft(yak, Greece)
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -185,7 +185,7 @@ end
|
||||
WTransWaves = function()
|
||||
local way = Utils.Random(WTransWays)
|
||||
local units = Utils.Random(WTransUnits)
|
||||
local attackUnits = Reinforcements.ReinforceWithTransport(ussr, "lst", units , way, { way[2], way[1] })[2]
|
||||
local attackUnits = Reinforcements.ReinforceWithTransport(USSR, "lst", units , way, { way[2], way[1] })[2]
|
||||
Utils.Do(attackUnits, function(a)
|
||||
Trigger.OnAddedToWorld(a, function()
|
||||
a.AttackMove(UnitBStopLocation.Location)
|
||||
|
||||
@@ -95,41 +95,41 @@ 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)
|
||||
|
||||
Reinforcements.Reinforce(player, AlliedReinforcementsA, { AlliedEntry1.Location, UnitBStopLocation.Location }, 2)
|
||||
Reinforcements.Reinforce(Greece, AlliedReinforcementsA, { AlliedEntry1.Location, UnitBStopLocation.Location }, 2)
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
Reinforcements.Reinforce(player, AlliedReinforcementsB, { AlliedEntry2.Location, UnitAStopLocation.Location }, 2)
|
||||
Reinforcements.Reinforce(Greece, AlliedReinforcementsB, { AlliedEntry2.Location, UnitAStopLocation.Location }, 2)
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(5), function()
|
||||
Reinforcements.Reinforce(player, { "mcv" }, { AlliedEntry3.Location, MCVStopLocation.Location })
|
||||
Reinforcements.Reinforce(Greece, { "mcv" }, { AlliedEntry3.Location, MCVStopLocation.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
|
||||
@@ -137,14 +137,14 @@ 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)
|
||||
|
||||
local Proxy = Actor.Create("powerproxy.paratroopers", false, { Owner = ussr })
|
||||
local Proxy = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
Utils.Do(ParadropWaypoints[Difficulty], function(waypoint)
|
||||
Proxy.TargetParatroopers(waypoint.CenterPosition, Angle.South)
|
||||
end)
|
||||
@@ -152,37 +152,37 @@ InfiltrateTechCenter = function()
|
||||
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 DateTime.GameTime > DateTime.Seconds(10) and player.HasNoRequiredUnits() then
|
||||
player.MarkFailedObjective(InfiltrateTechCenterObj)
|
||||
if DateTime.GameTime > DateTime.Seconds(10) and 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
|
||||
|
||||
@@ -196,9 +196,9 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(SovietMiniBaseCam.CenterPosition, WDist.New(1024 * 6), 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)
|
||||
|
||||
@@ -93,13 +93,13 @@ end
|
||||
|
||||
Attack = 0
|
||||
ProduceInfantry = function()
|
||||
if SovietBarracks.IsDead or SovietBarracks.Owner ~= ussr then
|
||||
if SovietBarracks.IsDead or SovietBarracks.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
Attack = Attack + 1
|
||||
local toBuild = Utils.Random(InfTypes)
|
||||
ussr.Build(toBuild, function(units)
|
||||
USSR.Build(toBuild, function(units)
|
||||
if Attack == 2 and not AttackTank1.IsDead then
|
||||
units[#units + 1] = AttackTank1
|
||||
elseif Attack == 4 and not AttackTank2.IsDead then
|
||||
@@ -112,10 +112,10 @@ ProduceInfantry = function()
|
||||
end
|
||||
|
||||
ProduceVehicles = function()
|
||||
if WarFactory.IsDead or WarFactory.Owner ~= ussr then
|
||||
if WarFactory.IsDead or WarFactory.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
ussr.Build(VehicleTypes, function(units)
|
||||
USSR.Build(VehicleTypes, function(units)
|
||||
Utils.Do(units, function(unit)
|
||||
if unit.Type ~= "harv" then
|
||||
IdlingTanks[#IdlingTanks + 1] = unit
|
||||
@@ -125,18 +125,18 @@ ProduceVehicles = function()
|
||||
end
|
||||
|
||||
ProduceNaval = function()
|
||||
if SubPen.IsDead or SubPen.Owner ~= ussr then
|
||||
if SubPen.IsDead or SubPen.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
if not shouldProduce and #Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == player and self.Type == "syrd" end) < 1 then
|
||||
if not ShouldProduce and #Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == Greece and self.Type == "syrd" end) < 1 then
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), ProduceNaval)
|
||||
return
|
||||
end
|
||||
|
||||
shouldProduce = true
|
||||
ShouldProduce = true
|
||||
|
||||
ussr.Build(WaterAttackTypes, function(units)
|
||||
USSR.Build(WaterAttackTypes, function(units)
|
||||
Utils.Do(units, function(unit)
|
||||
IdlingNavalUnits[#IdlingNavalUnits + 1] = unit
|
||||
end)
|
||||
@@ -151,11 +151,11 @@ ProduceNaval = function()
|
||||
end
|
||||
|
||||
ProduceAircraft = function()
|
||||
if (Airfield1.IsDead or Airfield1.Owner ~= ussr) and (Airfield2.IsDead or Airfield2.Owner ~= ussr) then
|
||||
if (Airfield1.IsDead or Airfield1.Owner ~= USSR) and (Airfield2.IsDead or Airfield2.Owner ~= USSR) then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build(SovietAircraftType, function(units)
|
||||
USSR.Build(SovietAircraftType, function(units)
|
||||
local yak = units[1]
|
||||
Yaks[#Yaks + 1] = yak
|
||||
|
||||
@@ -166,7 +166,7 @@ ProduceAircraft = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(BuildDelays / 2), ProduceAircraft)
|
||||
end
|
||||
|
||||
InitializeAttackAircraft(yak, player)
|
||||
InitializeAttackAircraft(yak, Greece)
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -197,7 +197,7 @@ end
|
||||
WTransWaves = function()
|
||||
local way = Utils.Random(WTransWays)
|
||||
local units = Utils.Random(WTransUnits)
|
||||
local attackUnits = Reinforcements.ReinforceWithTransport(ussr, "lst", units , way, { way[2], way[1] })[2]
|
||||
local attackUnits = Reinforcements.ReinforceWithTransport(USSR, "lst", units , way, { way[2], way[1] })[2]
|
||||
Utils.Do(attackUnits, function(a)
|
||||
Trigger.OnAddedToWorld(a, function()
|
||||
a.AttackMove(SovietBaseAttack.Location)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -64,11 +64,11 @@ SendBGAttackGroup = function()
|
||||
end
|
||||
|
||||
ProduceBadGuyInfantry = function()
|
||||
if BadGuyRax.IsDead or BadGuyRax.Owner ~= badguy then
|
||||
if BadGuyRax.IsDead or BadGuyRax.Owner ~= BadGuy then
|
||||
return
|
||||
end
|
||||
|
||||
badguy.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
BadGuy.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
table.insert(BGAttackGroup, units[1])
|
||||
SendBGAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceBadGuyInfantry)
|
||||
@@ -90,11 +90,11 @@ SendAttackGroup = function()
|
||||
end
|
||||
|
||||
ProduceUSSRInfantry = function()
|
||||
if USSRRax.IsDead or USSRRax.Owner ~= ussr then
|
||||
if USSRRax.IsDead or USSRRax.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
USSR.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRInfantry)
|
||||
@@ -102,11 +102,11 @@ ProduceUSSRInfantry = function()
|
||||
end
|
||||
|
||||
ProduceVehicles = function()
|
||||
if USSRWarFactory.IsDead or USSRWarFactory.Owner ~= ussr then
|
||||
if USSRWarFactory.IsDead or USSRWarFactory.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build({ Utils.Random(SovietVehicles) }, function(units)
|
||||
USSR.Build({ Utils.Random(SovietVehicles) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles)
|
||||
@@ -114,11 +114,11 @@ ProduceVehicles = function()
|
||||
end
|
||||
|
||||
ProduceAircraft = function()
|
||||
if (Airfield1.IsDead or Airfield1.Owner ~= ussr) and (Airfield2.IsDead or Airfield2.Owner ~= ussr) and (Airfield3.IsDead or Airfield3.Owner ~= ussr) and (Airfield4.IsDead or Airfield4.Owner ~= ussr) then
|
||||
if (Airfield1.IsDead or Airfield1.Owner ~= USSR) and (Airfield2.IsDead or Airfield2.Owner ~= USSR) and (Airfield3.IsDead or Airfield3.Owner ~= USSR) and (Airfield4.IsDead or Airfield4.Owner ~= USSR) then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build(SovietAircraftType, function(units)
|
||||
USSR.Build(SovietAircraftType, function(units)
|
||||
local yak = units[1]
|
||||
Yaks[#Yaks + 1] = yak
|
||||
|
||||
@@ -129,17 +129,17 @@ ProduceAircraft = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft)
|
||||
end
|
||||
|
||||
InitializeAttackAircraft(yak, greece)
|
||||
InitializeAttackAircraft(yak, Greece)
|
||||
end)
|
||||
end
|
||||
|
||||
ActivateAI = function()
|
||||
SovietVehicles = SovietVehicles[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)
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == ussr and building.Health < building.MaxHealth * 3/4 then
|
||||
if building.Owner == USSR and building.Health < building.MaxHealth * 3/4 then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -84,11 +84,11 @@ SendAttackGroup = function()
|
||||
end
|
||||
|
||||
ProduceInfantry = function()
|
||||
if USSRRax.IsDead or USSRRax.Owner ~= ussr then
|
||||
if USSRRax.IsDead or USSRRax.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
USSR.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceInfantry)
|
||||
@@ -96,11 +96,11 @@ ProduceInfantry = function()
|
||||
end
|
||||
|
||||
ProduceVehicles = function()
|
||||
if USSRWarFactory.IsDead or USSRWarFactory.Owner ~= ussr then
|
||||
if USSRWarFactory.IsDead or USSRWarFactory.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build({ Utils.Random(SovietVehicles) }, function(units)
|
||||
USSR.Build({ Utils.Random(SovietVehicles) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles)
|
||||
@@ -108,11 +108,11 @@ ProduceVehicles = function()
|
||||
end
|
||||
|
||||
ProduceAircraft = function()
|
||||
if (Airfield1.IsDead or Airfield1.Owner ~= ussr) and (Airfield2.IsDead or Airfield2.Owner ~= ussr) then
|
||||
if (Airfield1.IsDead or Airfield1.Owner ~= USSR) and (Airfield2.IsDead or Airfield2.Owner ~= USSR) then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build(SovietAircraftType, function(units)
|
||||
USSR.Build(SovietAircraftType, function(units)
|
||||
local mig = units[1]
|
||||
Migs[#Migs + 1] = mig
|
||||
|
||||
@@ -123,13 +123,13 @@ ProduceAircraft = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft)
|
||||
end
|
||||
|
||||
InitializeAttackAircraft(mig, greece)
|
||||
InitializeAttackAircraft(mig, Greece)
|
||||
end)
|
||||
end
|
||||
|
||||
GroundWaves = function()
|
||||
local path = Utils.Random(GroundAttackPaths)
|
||||
local units = Reinforcements.Reinforce(ussr, Utils.Random(GroundAttackUnits[GroundAttackUnitType]), { path[1] })
|
||||
local units = Reinforcements.Reinforce(USSR, Utils.Random(GroundAttackUnits[GroundAttackUnitType]), { path[1] })
|
||||
local lastWaypoint = path[#path]
|
||||
Utils.Do(units, function(unit)
|
||||
Trigger.OnAddedToWorld(unit, function()
|
||||
@@ -146,7 +146,7 @@ end
|
||||
WTransWaves = function()
|
||||
local way = Utils.Random(WTransWays)
|
||||
local units = Utils.Random(WTransUnits)
|
||||
local attackUnits = Reinforcements.ReinforceWithTransport(ussr, "lst", units , way, { way[2], way[1] })[2]
|
||||
local attackUnits = Reinforcements.ReinforceWithTransport(USSR, "lst", units , way, { way[2], way[1] })[2]
|
||||
Utils.Do(attackUnits, function(a)
|
||||
Trigger.OnAddedToWorld(a, function()
|
||||
a.AttackMove(AttackChrono.Location)
|
||||
@@ -169,15 +169,15 @@ end
|
||||
|
||||
SendParabombs = function()
|
||||
local airfield = Airfield1
|
||||
if Airfield1.IsDead or Airfield1.Owner ~= ussr then
|
||||
if Airfield2.IsDead or Airfield2.Owner ~= ussr then
|
||||
if Airfield1.IsDead or Airfield1.Owner ~= USSR then
|
||||
if Airfield2.IsDead or Airfield2.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
airfield = Airfield2
|
||||
end
|
||||
|
||||
local targets = Utils.Where(greece.GetActors(), function(actor)
|
||||
local targets = Utils.Where(Greece.GetActors(), function(actor)
|
||||
return
|
||||
actor.HasProperty("Sell") and
|
||||
actor.Type ~= "brik" and
|
||||
@@ -199,10 +199,10 @@ ActivateAI = function()
|
||||
ParadropDelays = ParadropDelays[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)
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == ussr and building.Health < building.MaxHealth * 3/4 then
|
||||
if building.Owner == USSR and building.Health < building.MaxHealth * 3/4 then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -15,33 +15,33 @@ ScientistEvacuationFootprint = { CPos.New(29, 60), CPos.New(29, 61), CPos.New(29
|
||||
|
||||
InitialAlliedReinforcements = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
Media.PlaySpeechNotification(greece, "ReinforcementsArrived")
|
||||
Reinforcements.Reinforce(greece, { "mcv" }, { MCVEntry.Location, MCVStop.Location })
|
||||
Reinforcements.Reinforce(greece, AlliedBoatReinforcements, { DDEntry.Location, DDStop.Location })
|
||||
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
|
||||
Reinforcements.Reinforce(Greece, { "mcv" }, { MCVEntry.Location, MCVStop.Location })
|
||||
Reinforcements.Reinforce(Greece, AlliedBoatReinforcements, { DDEntry.Location, DDStop.Location })
|
||||
end)
|
||||
end
|
||||
|
||||
CreateScientists = function()
|
||||
scientists = Reinforcements.Reinforce(greece, ScientistTypes, { ScientistsExit.Location })
|
||||
local scientists = Reinforcements.Reinforce(Greece, ScientistTypes, { ScientistsExit.Location })
|
||||
Utils.Do(scientists, function(s)
|
||||
s.Move(s.Location + CVec.New(0, 1))
|
||||
s.Scatter()
|
||||
end)
|
||||
|
||||
local flare = Actor.Create("flare", true, { Owner = greece, Location = DefaultCameraPosition.Location + CVec.New(-1, 0) })
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function() Media.PlaySpeechNotification(player, "SignalFlareNorth") end)
|
||||
local flare = Actor.Create("flare", true, { Owner = Greece, Location = DefaultCameraPosition.Location + CVec.New(-1, 0) })
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function() Media.PlaySpeechNotification(Greece, "SignalFlareNorth") end)
|
||||
|
||||
Trigger.OnAnyKilled(scientists, function()
|
||||
Media.PlaySpeechNotification(greece, "ObjectiveNotMet")
|
||||
greece.MarkFailedObjective(EvacuateScientists)
|
||||
Media.PlaySpeechNotification(Greece, "ObjectiveNotMet")
|
||||
Greece.MarkFailedObjective(EvacuateScientists)
|
||||
end)
|
||||
|
||||
-- Add the footprint trigger in a frame end task (delay 0) to avoid crashes
|
||||
local left = #scientists
|
||||
Trigger.AfterDelay(0, function()
|
||||
local changeOwnerTrigger = Trigger.OnEnteredFootprint(ScientistEvacuationFootprint, function(a, id)
|
||||
if a.Owner == greece and a.Type == "chan" then
|
||||
a.Owner = germany
|
||||
if a.Owner == Greece and a.Type == "chan" then
|
||||
a.Owner = Germany
|
||||
a.Stop()
|
||||
a.Move(MCVEntry.Location)
|
||||
|
||||
@@ -54,7 +54,7 @@ CreateScientists = function()
|
||||
|
||||
-- Use a cell trigger to destroy the scientists preventing the player from causing glitchs by blocking the path
|
||||
Trigger.OnEnteredFootprint({ MCVEntry.Location }, function(a, id)
|
||||
if a.Owner == germany then
|
||||
if a.Owner == Germany then
|
||||
a.Stop()
|
||||
a.Destroy()
|
||||
|
||||
@@ -64,9 +64,9 @@ CreateScientists = function()
|
||||
Trigger.RemoveFootprintTrigger(changeOwnerTrigger)
|
||||
flare.Destroy()
|
||||
|
||||
if not greece.IsObjectiveCompleted(EvacuateScientists) and not greece.IsObjectiveFailed(EvacuateScientists) then
|
||||
Media.PlaySpeechNotification(greece, "ObjectiveMet")
|
||||
greece.MarkCompletedObjective(EvacuateScientists)
|
||||
if not Greece.IsObjectiveCompleted(EvacuateScientists) and not Greece.IsObjectiveFailed(EvacuateScientists) then
|
||||
Media.PlaySpeechNotification(Greece, "ObjectiveMet")
|
||||
Greece.MarkCompletedObjective(EvacuateScientists)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -78,84 +78,84 @@ DefendChronosphereCompleted = function()
|
||||
local cells = Utils.ExpandFootprint({ ChronoshiftLocation.Location }, false)
|
||||
local units = { }
|
||||
for i = 1, #cells do
|
||||
local unit = Actor.Create("2tnk", true, { Owner = greece, Facing = Angle.North })
|
||||
local unit = Actor.Create("2tnk", true, { Owner = Greece, Facing = Angle.North })
|
||||
units[unit] = cells[i]
|
||||
end
|
||||
Chronosphere.Chronoshift(units)
|
||||
UserInterface.SetMissionText(UserInterface.Translate("experiment-successful"), greece.Color)
|
||||
UserInterface.SetMissionText(UserInterface.Translate("experiment-successful"), Greece.Color)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
greece.MarkCompletedObjective(DefendChronosphere)
|
||||
greece.MarkCompletedObjective(KeepBasePowered)
|
||||
Greece.MarkCompletedObjective(DefendChronosphere)
|
||||
Greece.MarkCompletedObjective(KeepBasePowered)
|
||||
end)
|
||||
end
|
||||
|
||||
ticked = TimerTicks
|
||||
Ticked = TimerTicks
|
||||
Tick = function()
|
||||
ussr.Cash = 5000
|
||||
USSR.Cash = 5000
|
||||
|
||||
if ussr.HasNoRequiredUnits() then
|
||||
greece.MarkCompletedObjective(DefendChronosphere)
|
||||
greece.MarkCompletedObjective(KeepBasePowered)
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(DefendChronosphere)
|
||||
Greece.MarkCompletedObjective(KeepBasePowered)
|
||||
end
|
||||
|
||||
if greece.HasNoRequiredUnits() then
|
||||
ussr.MarkCompletedObjective(BeatAllies)
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
USSR.MarkCompletedObjective(BeatAllies)
|
||||
end
|
||||
|
||||
if ticked > 0 then
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("chronosphere-experiments-completes-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if Ticked > 0 then
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("chronosphere-experiments-completes-in", { ["time"] = Utils.FormatTime(Ticked) })
|
||||
UserInterface.SetMissionText(Timer, TimerColor)
|
||||
end
|
||||
ticked = ticked - 1
|
||||
elseif ticked == 0 and (greece.PowerState ~= "Normal") then
|
||||
greece.MarkFailedObjective(KeepBasePowered)
|
||||
elseif ticked == 0 then
|
||||
Ticked = Ticked - 1
|
||||
elseif Ticked == 0 and (Greece.PowerState ~= "Normal") then
|
||||
Greece.MarkFailedObjective(KeepBasePowered)
|
||||
elseif Ticked == 0 then
|
||||
DefendChronosphereCompleted()
|
||||
ticked = ticked - 1
|
||||
Ticked = Ticked - 1
|
||||
end
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
greece = Player.GetPlayer("Greece")
|
||||
ussr = Player.GetPlayer("USSR")
|
||||
germany = Player.GetPlayer("Germany")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Germany = Player.GetPlayer("Germany")
|
||||
|
||||
InitObjectives(greece)
|
||||
DefendChronosphere = AddPrimaryObjective(greece, "defend-chronosphere-tech-center")
|
||||
KeepBasePowered = AddPrimaryObjective(greece, "chronosphere-needs-power")
|
||||
EvacuateScientists = AddSecondaryObjective(greece, "evacuate-scientists-from-island")
|
||||
BeatAllies = AddPrimaryObjective(ussr, "")
|
||||
InitObjectives(Greece)
|
||||
DefendChronosphere = AddPrimaryObjective(Greece, "defend-chronosphere-tech-center")
|
||||
KeepBasePowered = AddPrimaryObjective(Greece, "chronosphere-needs-power")
|
||||
EvacuateScientists = AddSecondaryObjective(Greece, "evacuate-scientists-from-island")
|
||||
BeatAllies = AddPrimaryObjective(USSR, "")
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), function()
|
||||
Media.PlaySpeechNotification(greece, "TwentyMinutesRemaining")
|
||||
Media.PlaySpeechNotification(Greece, "TwentyMinutesRemaining")
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(11), function()
|
||||
Media.PlaySpeechNotification(greece, "TenMinutesRemaining")
|
||||
Media.PlaySpeechNotification(Greece, "TenMinutesRemaining")
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(16), function()
|
||||
Media.PlaySpeechNotification(greece, "WarningFiveMinutesRemaining")
|
||||
Media.PlaySpeechNotification(Greece, "WarningFiveMinutesRemaining")
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(18), function()
|
||||
Media.PlaySpeechNotification(greece, "WarningThreeMinutesRemaining")
|
||||
Media.PlaySpeechNotification(Greece, "WarningThreeMinutesRemaining")
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(20), function()
|
||||
Media.PlaySpeechNotification(greece, "WarningOneMinuteRemaining")
|
||||
Media.PlaySpeechNotification(Greece, "WarningOneMinuteRemaining")
|
||||
end)
|
||||
|
||||
PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = ussr })
|
||||
PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
|
||||
Camera.Position = DefaultCameraPosition.CenterPosition
|
||||
TimerColor = greece.Color
|
||||
TimerColor = Greece.Color
|
||||
|
||||
Trigger.OnAnyKilled(ObjectiveBuildings, function()
|
||||
greece.MarkFailedObjective(DefendChronosphere)
|
||||
Greece.MarkFailedObjective(DefendChronosphere)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(ScientistDiscoveryFootprint, function(a, id)
|
||||
if a.Owner == greece and not scientistsTriggered then
|
||||
scientistsTriggered = true
|
||||
if a.Owner == Greece and not ScientistsTriggered then
|
||||
ScientistsTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
CreateScientists()
|
||||
end
|
||||
|
||||
@@ -83,11 +83,11 @@ SendAttackGroup = function()
|
||||
end
|
||||
|
||||
ProduceInfantry = function()
|
||||
if USSRRax.IsDead or USSRRax.Owner ~= ussr then
|
||||
if USSRRax.IsDead or USSRRax.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
USSR.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceInfantry)
|
||||
@@ -95,11 +95,11 @@ ProduceInfantry = function()
|
||||
end
|
||||
|
||||
ProduceVehicles = function()
|
||||
if USSRWarFactory.IsDead or USSRWarFactory.Owner ~= ussr then
|
||||
if USSRWarFactory.IsDead or USSRWarFactory.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build({ Utils.Random(SovietVehicles) }, function(units)
|
||||
USSR.Build({ Utils.Random(SovietVehicles) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles)
|
||||
@@ -107,11 +107,11 @@ ProduceVehicles = function()
|
||||
end
|
||||
|
||||
ProduceAircraft = function()
|
||||
if (Airfield1.IsDead or Airfield1.Owner ~= ussr) and (Airfield2.IsDead or Airfield2.Owner ~= ussr) then
|
||||
if (Airfield1.IsDead or Airfield1.Owner ~= USSR) and (Airfield2.IsDead or Airfield2.Owner ~= USSR) then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build(SovietAircraftType, function(units)
|
||||
USSR.Build(SovietAircraftType, function(units)
|
||||
local mig = units[1]
|
||||
Migs[#Migs + 1] = mig
|
||||
|
||||
@@ -122,13 +122,13 @@ ProduceAircraft = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft)
|
||||
end
|
||||
|
||||
InitializeAttackAircraft(mig, greece)
|
||||
InitializeAttackAircraft(mig, Greece)
|
||||
end)
|
||||
end
|
||||
|
||||
GroundWaves = function()
|
||||
local path = Utils.Random(GroundAttackPaths)
|
||||
local units = Reinforcements.Reinforce(ussr, Utils.Random(GroundAttackUnits[GroundAttackUnitType]), { path[1] })
|
||||
local units = Reinforcements.Reinforce(USSR, Utils.Random(GroundAttackUnits[GroundAttackUnitType]), { path[1] })
|
||||
local lastWaypoint = path[#path]
|
||||
Utils.Do(units, function(unit)
|
||||
Trigger.OnAddedToWorld(unit, function()
|
||||
@@ -145,7 +145,7 @@ end
|
||||
WTransWaves = function()
|
||||
local way = Utils.Random(WTransWays)
|
||||
local units = Utils.Random(WTransUnits)
|
||||
local attackUnits = Reinforcements.ReinforceWithTransport(ussr, "lst", units , way, { way[2], way[1] })[2]
|
||||
local attackUnits = Reinforcements.ReinforceWithTransport(USSR, "lst", units , way, { way[2], way[1] })[2]
|
||||
Utils.Do(attackUnits, function(a)
|
||||
Trigger.OnAddedToWorld(a, function()
|
||||
a.AttackMove(AttackChrono.Location)
|
||||
@@ -169,15 +169,15 @@ end
|
||||
|
||||
SendParabombs = function()
|
||||
local airfield = Airfield1
|
||||
if Airfield1.IsDead or Airfield1.Owner ~= ussr then
|
||||
if Airfield2.IsDead or Airfield2.Owner ~= ussr then
|
||||
if Airfield1.IsDead or Airfield1.Owner ~= USSR then
|
||||
if Airfield2.IsDead or Airfield2.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
airfield = Airfield2
|
||||
end
|
||||
|
||||
local targets = Utils.Where(greece.GetActors(), function(actor)
|
||||
local targets = Utils.Where(Greece.GetActors(), function(actor)
|
||||
return
|
||||
actor.HasProperty("Sell") and
|
||||
actor.Type ~= "brik" and
|
||||
@@ -199,10 +199,10 @@ ActivateAI = function()
|
||||
ParadropDelays = ParadropDelays[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)
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == ussr and building.Health < building.MaxHealth * 3/4 then
|
||||
if building.Owner == USSR and building.Health < building.MaxHealth * 3/4 then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -15,33 +15,33 @@ ScientistEvacuationFootprint = { CPos.New(98, 88), CPos.New(98, 87), CPos.New(99
|
||||
|
||||
InitialAlliedReinforcements = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
Media.PlaySpeechNotification(greece, "ReinforcementsArrived")
|
||||
Reinforcements.Reinforce(greece, { "mcv" }, { MCVEntry.Location, MCVStop.Location })
|
||||
Reinforcements.Reinforce(greece, AlliedBoatReinforcements, { DDEntry.Location, DDStop.Location })
|
||||
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
|
||||
Reinforcements.Reinforce(Greece, { "mcv" }, { MCVEntry.Location, MCVStop.Location })
|
||||
Reinforcements.Reinforce(Greece, AlliedBoatReinforcements, { DDEntry.Location, DDStop.Location })
|
||||
end)
|
||||
end
|
||||
|
||||
CreateScientists = function()
|
||||
scientists = Reinforcements.Reinforce(greece, ScientistTypes, { ScientistsExit.Location })
|
||||
local scientists = Reinforcements.Reinforce(Greece, ScientistTypes, { ScientistsExit.Location })
|
||||
Utils.Do(scientists, function(s)
|
||||
s.Move(s.Location + CVec.New(0, 1))
|
||||
s.Scatter()
|
||||
end)
|
||||
|
||||
local flare = Actor.Create("flare", true, { Owner = greece, Location = DefaultCameraPosition.Location + CVec.New(-1, 0) })
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function() Media.PlaySpeechNotification(player, "SignalFlareSouth") end)
|
||||
local flare = Actor.Create("flare", true, { Owner = Greece, Location = DefaultCameraPosition.Location + CVec.New(-1, 0) })
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function() Media.PlaySpeechNotification(Greece, "SignalFlareSouth") end)
|
||||
|
||||
Trigger.OnAnyKilled(scientists, function()
|
||||
Media.PlaySpeechNotification(greece, "ObjectiveNotMet")
|
||||
greece.MarkFailedObjective(EvacuateScientists)
|
||||
Media.PlaySpeechNotification(Greece, "ObjectiveNotMet")
|
||||
Greece.MarkFailedObjective(EvacuateScientists)
|
||||
end)
|
||||
|
||||
-- Add the footprint trigger in a frame end task (delay 0) to avoid crashes
|
||||
local left = #scientists
|
||||
Trigger.AfterDelay(0, function()
|
||||
local changeOwnerTrigger = Trigger.OnEnteredFootprint(ScientistEvacuationFootprint, function(a, id)
|
||||
if a.Owner == greece and a.Type == "chan" then
|
||||
a.Owner = england
|
||||
if a.Owner == Greece and a.Type == "chan" then
|
||||
a.Owner = England
|
||||
a.Stop()
|
||||
a.Move(MCVEntry.Location)
|
||||
|
||||
@@ -54,7 +54,7 @@ CreateScientists = function()
|
||||
|
||||
-- Use a cell trigger to destroy the scientists preventing the player from causing glitchs by blocking the path
|
||||
Trigger.OnEnteredFootprint({ MCVEntry.Location }, function(a, id)
|
||||
if a.Owner == england then
|
||||
if a.Owner == England then
|
||||
a.Stop()
|
||||
a.Destroy()
|
||||
|
||||
@@ -64,9 +64,9 @@ CreateScientists = function()
|
||||
Trigger.RemoveFootprintTrigger(changeOwnerTrigger)
|
||||
flare.Destroy()
|
||||
|
||||
if not greece.IsObjectiveCompleted(EvacuateScientists) and not greece.IsObjectiveFailed(EvacuateScientists) then
|
||||
Media.PlaySpeechNotification(greece, "ObjectiveMet")
|
||||
greece.MarkCompletedObjective(EvacuateScientists)
|
||||
if not Greece.IsObjectiveCompleted(EvacuateScientists) and not Greece.IsObjectiveFailed(EvacuateScientists) then
|
||||
Media.PlaySpeechNotification(Greece, "ObjectiveMet")
|
||||
Greece.MarkCompletedObjective(EvacuateScientists)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -78,84 +78,84 @@ DefendChronosphereCompleted = function()
|
||||
local cells = Utils.ExpandFootprint({ ChronoshiftLocation.Location }, false)
|
||||
local units = { }
|
||||
for i = 1, #cells do
|
||||
local unit = Actor.Create("2tnk", true, { Owner = greece, Facing = Angle.North })
|
||||
local unit = Actor.Create("2tnk", true, { Owner = Greece, Facing = Angle.North })
|
||||
units[unit] = cells[i]
|
||||
end
|
||||
Chronosphere.Chronoshift(units)
|
||||
UserInterface.SetMissionText(UserInterface.Translate("experiment-successful"), greece.Color)
|
||||
UserInterface.SetMissionText(UserInterface.Translate("experiment-successful"), Greece.Color)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
greece.MarkCompletedObjective(DefendChronosphere)
|
||||
greece.MarkCompletedObjective(KeepBasePowered)
|
||||
Greece.MarkCompletedObjective(DefendChronosphere)
|
||||
Greece.MarkCompletedObjective(KeepBasePowered)
|
||||
end)
|
||||
end
|
||||
|
||||
ticked = TimerTicks
|
||||
Ticked = TimerTicks
|
||||
Tick = function()
|
||||
ussr.Cash = 5000
|
||||
USSR.Cash = 5000
|
||||
|
||||
if ussr.HasNoRequiredUnits() then
|
||||
greece.MarkCompletedObjective(DefendChronosphere)
|
||||
greece.MarkCompletedObjective(KeepBasePowered)
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(DefendChronosphere)
|
||||
Greece.MarkCompletedObjective(KeepBasePowered)
|
||||
end
|
||||
|
||||
if greece.HasNoRequiredUnits() then
|
||||
ussr.MarkCompletedObjective(BeatAllies)
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
USSR.MarkCompletedObjective(BeatAllies)
|
||||
end
|
||||
|
||||
if ticked > 0 then
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("chronosphere-experiments-completes-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if Ticked > 0 then
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("chronosphere-experiments-completes-in", { ["time"] = Utils.FormatTime(Ticked) })
|
||||
UserInterface.SetMissionText(Timer, TimerColor)
|
||||
end
|
||||
ticked = ticked - 1
|
||||
elseif ticked == 0 and (greece.PowerState ~= "Normal") then
|
||||
greece.MarkFailedObjective(KeepBasePowered)
|
||||
elseif ticked == 0 then
|
||||
Ticked = Ticked - 1
|
||||
elseif Ticked == 0 and (Greece.PowerState ~= "Normal") then
|
||||
Greece.MarkFailedObjective(KeepBasePowered)
|
||||
elseif Ticked == 0 then
|
||||
DefendChronosphereCompleted()
|
||||
ticked = ticked - 1
|
||||
Ticked = Ticked - 1
|
||||
end
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
greece = Player.GetPlayer("Greece")
|
||||
ussr = Player.GetPlayer("USSR")
|
||||
england = Player.GetPlayer("England")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
England = Player.GetPlayer("England")
|
||||
|
||||
InitObjectives(greece)
|
||||
DefendChronosphere = AddPrimaryObjective(greece, "defend-chronosphere-tech-center")
|
||||
KeepBasePowered = AddPrimaryObjective(greece, "chronosphere-needs-power")
|
||||
EvacuateScientists = AddSecondaryObjective(greece, "evacuate-scientists-from-island")
|
||||
BeatAllies = AddPrimaryObjective(ussr, "")
|
||||
InitObjectives(Greece)
|
||||
DefendChronosphere = AddPrimaryObjective(Greece, "defend-chronosphere-tech-center")
|
||||
KeepBasePowered = AddPrimaryObjective(Greece, "chronosphere-needs-power")
|
||||
EvacuateScientists = AddSecondaryObjective(Greece, "evacuate-scientists-from-island")
|
||||
BeatAllies = AddPrimaryObjective(USSR, "")
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), function()
|
||||
Media.PlaySpeechNotification(greece, "TwentyMinutesRemaining")
|
||||
Media.PlaySpeechNotification(Greece, "TwentyMinutesRemaining")
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(11), function()
|
||||
Media.PlaySpeechNotification(greece, "TenMinutesRemaining")
|
||||
Media.PlaySpeechNotification(Greece, "TenMinutesRemaining")
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(16), function()
|
||||
Media.PlaySpeechNotification(greece, "WarningFiveMinutesRemaining")
|
||||
Media.PlaySpeechNotification(Greece, "WarningFiveMinutesRemaining")
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(18), function()
|
||||
Media.PlaySpeechNotification(greece, "WarningThreeMinutesRemaining")
|
||||
Media.PlaySpeechNotification(Greece, "WarningThreeMinutesRemaining")
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(20), function()
|
||||
Media.PlaySpeechNotification(greece, "WarningOneMinuteRemaining")
|
||||
Media.PlaySpeechNotification(Greece, "WarningOneMinuteRemaining")
|
||||
end)
|
||||
|
||||
PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = ussr })
|
||||
PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
|
||||
Camera.Position = DefaultCameraPosition.CenterPosition
|
||||
TimerColor = greece.Color
|
||||
TimerColor = Greece.Color
|
||||
|
||||
Trigger.OnAnyKilled(ObjectiveBuildings, function()
|
||||
greece.MarkFailedObjective(DefendChronosphere)
|
||||
Greece.MarkFailedObjective(DefendChronosphere)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(ScientistDiscoveryFootprint, function(a, id)
|
||||
if a.Owner == greece and not scientistsTriggered then
|
||||
scientistsTriggered = true
|
||||
if a.Owner == Greece and not ScientistsTriggered then
|
||||
ScientistsTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
CreateScientists()
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
information, see COPYING.
|
||||
]]
|
||||
|
||||
lstReinforcements =
|
||||
LstReinforcements =
|
||||
{
|
||||
actors = { "mcv" },
|
||||
entryPath = { AlliedMCVEntry.Location, Unload1.Location },
|
||||
@@ -28,7 +28,7 @@ KosyginContacted = false
|
||||
InitialAlliedReinforcements = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
|
||||
Reinforcements.ReinforceWithTransport(Greece, "lst.reinforcement", lstReinforcements.actors, lstReinforcements.entryPath, lstReinforcements.exitPath)
|
||||
Reinforcements.ReinforceWithTransport(Greece, "lst.reinforcement", LstReinforcements.actors, LstReinforcements.entryPath, LstReinforcements.exitPath)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ end
|
||||
|
||||
LaunchMissiles = function()
|
||||
MissilesLaunched = true
|
||||
local missileCam = Actor.Create("camera", true, { Owner = Greece, Location = FCom.Location })
|
||||
Actor.Create("camera", true, { Owner = Greece, Location = FCom.Location })
|
||||
Camera.Position = FCom.CenterPosition
|
||||
Media.PlaySpeechNotification(Greece, "AbombLaunchDetected")
|
||||
MissileSilo1.ActivateNukePower(CPos.New(127, 127))
|
||||
|
||||
@@ -15,7 +15,7 @@ AtEndGame = false
|
||||
TimerColor = Player.GetPlayer("Spain").Color
|
||||
InsertionHelicopterType = "tran.insertion"
|
||||
TimerTicks = DateTime.Minutes(18) -- 18 minutes is roughly 30 mins in the original game
|
||||
ticks = TimerTicks
|
||||
Ticks = TimerTicks
|
||||
|
||||
--Table Vars
|
||||
TankPath = { waypoint12.Location, waypoint13.Location }
|
||||
@@ -104,27 +104,27 @@ SetupTimeNotifications = function()
|
||||
end
|
||||
|
||||
GetTicks = function()
|
||||
return ticks
|
||||
return Ticks
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if SurviveObjective ~= nil then
|
||||
if ticks > 0 then
|
||||
if ticks == DateTime.Minutes(17) then
|
||||
if Ticks > 0 then
|
||||
if Ticks == DateTime.Minutes(17) then
|
||||
StartAntAttack()
|
||||
elseif ticks == DateTime.Minutes(15) then
|
||||
elseif Ticks == DateTime.Minutes(15) then
|
||||
SendInsertionHelicopter()
|
||||
elseif ticks == DateTime.Minutes(12) then
|
||||
elseif Ticks == DateTime.Minutes(12) then
|
||||
StartAntAttack()
|
||||
elseif ticks == DateTime.Minutes(6) then
|
||||
elseif Ticks == DateTime.Minutes(6) then
|
||||
StartAntAttack()
|
||||
elseif ticks == DateTime.Minutes(1) then
|
||||
elseif Ticks == DateTime.Minutes(1) then
|
||||
EndAntAttack()
|
||||
end
|
||||
|
||||
ticks = ticks - 1;
|
||||
if (ticks % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("reinforcements-arrive-in", { ["time"] = Utils.FormatTime(ticks) })
|
||||
Ticks = Ticks - 1;
|
||||
if (Ticks % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("reinforcements-arrive-in", { ["time"] = Utils.FormatTime(Ticks) })
|
||||
UserInterface.SetMissionText(Timer, TimerColor)
|
||||
end
|
||||
else
|
||||
@@ -136,7 +136,7 @@ Tick = function()
|
||||
SendTanks()
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function() TimerExpired() end)
|
||||
end
|
||||
ticks = ticks - 1
|
||||
Ticks = Ticks - 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -46,7 +46,7 @@ Mig2Waypoints = { Mig21, Mig22, Mig23, Mig24 }
|
||||
|
||||
BindActorTriggers = function(a)
|
||||
if a.HasProperty("Hunt") then
|
||||
if a.Owner == allies then
|
||||
if a.Owner == Allies then
|
||||
Trigger.OnIdle(a, function(a)
|
||||
if a.IsInWorld then
|
||||
a.Hunt()
|
||||
@@ -76,7 +76,7 @@ BindActorTriggers = function(a)
|
||||
end
|
||||
|
||||
SendSovietUnits = function(entryCell, unitTypes, interval)
|
||||
local units = Reinforcements.Reinforce(soviets, unitTypes, { entryCell }, interval)
|
||||
local units = Reinforcements.Reinforce(Soviets, unitTypes, { entryCell }, interval)
|
||||
Utils.Do(units, function(unit)
|
||||
BindActorTriggers(unit)
|
||||
end)
|
||||
@@ -85,7 +85,7 @@ end
|
||||
|
||||
SendMigs = function(waypoints)
|
||||
local migEntryPath = { waypoints[1].Location, waypoints[2].Location }
|
||||
local migs = Reinforcements.Reinforce(soviets, { "mig" }, migEntryPath, 4)
|
||||
local migs = Reinforcements.Reinforce(Soviets, { "mig" }, migEntryPath, 4)
|
||||
Utils.Do(migs, function(mig)
|
||||
mig.Move(waypoints[3].Location)
|
||||
mig.Move(waypoints[4].Location)
|
||||
@@ -96,7 +96,7 @@ SendMigs = function(waypoints)
|
||||
end
|
||||
|
||||
ShipAlliedUnits = function()
|
||||
local units = Reinforcements.ReinforceWithTransport(allies, "lst",
|
||||
local units = Reinforcements.ReinforceWithTransport(Allies, "lst",
|
||||
ShipUnitTypes, { LstEntry.Location, LstUnload.Location }, { LstEntry.Location })[2]
|
||||
|
||||
Utils.Do(units, function(unit)
|
||||
@@ -108,7 +108,7 @@ end
|
||||
|
||||
--- @param hpad actor
|
||||
InsertAlliedChinookReinforcements = function(entry, hpad)
|
||||
local units = Reinforcements.ReinforceWithTransport(allies, "tran",
|
||||
local units = Reinforcements.ReinforceWithTransport(Allies, "tran",
|
||||
HelicopterUnitTypes, { entry.Location, hpad.Location + CVec.New(1, 2) }, { entry.Location })[2]
|
||||
|
||||
Utils.Do(units, function(unit)
|
||||
@@ -120,7 +120,7 @@ end
|
||||
|
||||
ParadropSovietUnits = function()
|
||||
local lz = Utils.Random(ParadropWaypoints)
|
||||
local aircraft = powerproxy.TargetParatroopers(lz.CenterPosition)
|
||||
local aircraft = PowerProxy.TargetParatroopers(lz.CenterPosition)
|
||||
|
||||
Utils.Do(aircraft, function(a)
|
||||
Trigger.OnPassengerExited(a, function(t, p)
|
||||
@@ -143,7 +143,7 @@ end
|
||||
|
||||
SetupAlliedUnits = function()
|
||||
Utils.Do(Map.NamedActors, function(a)
|
||||
if a.Owner == allies and a.HasProperty("AcceptsCondition") and a.AcceptsCondition("unkillable") then
|
||||
if a.Owner == Allies and a.HasProperty("AcceptsCondition") and a.AcceptsCondition("unkillable") then
|
||||
a.GrantCondition("unkillable")
|
||||
a.Stance = "Defend"
|
||||
end
|
||||
@@ -160,7 +160,7 @@ ChronoshiftAlliedUnits = function()
|
||||
local cells = Utils.ExpandFootprint({ ChronoshiftLocation.Location }, false)
|
||||
local units = { }
|
||||
for i = 1, #cells do
|
||||
local unit = Actor.Create("2tnk", true, { Owner = allies, Facing = Angle.North })
|
||||
local unit = Actor.Create("2tnk", true, { Owner = Allies, Facing = Angle.North })
|
||||
BindActorTriggers(unit)
|
||||
units[unit] = cells[i]
|
||||
end
|
||||
@@ -168,27 +168,27 @@ ChronoshiftAlliedUnits = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(60), ChronoshiftAlliedUnits)
|
||||
end
|
||||
|
||||
ticks = 0
|
||||
speed = 5
|
||||
Ticks = 0
|
||||
Speed = 5
|
||||
|
||||
Tick = function()
|
||||
ticks = ticks + 1
|
||||
Ticks = Ticks + 1
|
||||
|
||||
local t = (ticks + 45) % (360 * speed) * (math.pi / 180) / speed;
|
||||
Camera.Position = viewportOrigin + WVec.New(19200 * math.sin(t), 20480 * math.cos(t), 0)
|
||||
local t = (Ticks + 45) % (360 * Speed) * (math.pi / 180) / Speed;
|
||||
Camera.Position = ViewportOrigin + WVec.New(19200 * math.sin(t), 20480 * math.cos(t), 0)
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
allies = Player.GetPlayer("Allies")
|
||||
soviets = Player.GetPlayer("Soviets")
|
||||
viewportOrigin = Camera.Position
|
||||
Allies = Player.GetPlayer("Allies")
|
||||
Soviets = Player.GetPlayer("Soviets")
|
||||
ViewportOrigin = Camera.Position
|
||||
|
||||
SetupAlliedUnits()
|
||||
SetupFactories()
|
||||
ShipAlliedUnits()
|
||||
InsertAlliedChinookReinforcements(Chinook1Entry, HeliPad1)
|
||||
InsertAlliedChinookReinforcements(Chinook2Entry, HeliPad2)
|
||||
powerproxy = Actor.Create(ProxyType, false, { Owner = soviets })
|
||||
PowerProxy = Actor.Create(ProxyType, false, { Owner = Soviets })
|
||||
ParadropSovietUnits()
|
||||
Trigger.AfterDelay(DateTime.Seconds(5), ChronoshiftAlliedUnits)
|
||||
Utils.Do(ProducedUnitTypes, ProduceUnits)
|
||||
|
||||
@@ -73,17 +73,17 @@ ReinforcementsUnits = { "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "1tnk",
|
||||
"e1", "e1", "e1", "e3", "e3", "mcv", "truk", "truk", "truk", "truk", "truk", "truk" }
|
||||
|
||||
SpawnAlliedReinforcements = function()
|
||||
if allies2.IsLocalPlayer then
|
||||
if Allies2.IsLocalPlayer then
|
||||
UserInterface.SetMissionText("")
|
||||
Media.PlaySpeechNotification(allies2, "AlliedReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(Allies2, "AlliedReinforcementsArrived")
|
||||
end
|
||||
Reinforcements.Reinforce(allies2, ReinforcementsUnits, { ReinforcementsEntryPoint.Location, Allies2BasePoint.Location })
|
||||
Reinforcements.Reinforce(Allies2, ReinforcementsUnits, { ReinforcementsEntryPoint.Location, Allies2BasePoint.Location })
|
||||
end
|
||||
|
||||
Yak = nil
|
||||
YakAttack = function()
|
||||
local targets = Map.ActorsInCircle(YakAttackPoint.CenterPosition, WDist.FromCells(10), function(a)
|
||||
return a.Owner == allies1 and not a.IsDead and a ~= Einstein and a ~= Tanya and a ~= Engineer and Yak.CanTarget(a)
|
||||
return a.Owner == Allies1 and not a.IsDead and a ~= Einstein and a ~= Tanya and a ~= Engineer and Yak.CanTarget(a)
|
||||
end)
|
||||
|
||||
if (#targets > 0) then
|
||||
@@ -106,7 +106,7 @@ SovietTownAttack = function()
|
||||
end
|
||||
|
||||
SendParabombs = function()
|
||||
local proxy = Actor.Create("powerproxy.parabombs", false, { Owner = soviets })
|
||||
local proxy = Actor.Create("powerproxy.parabombs", false, { Owner = Soviets })
|
||||
proxy.TargetAirstrike(ParabombPoint1.CenterPosition, (BadgerEntryPoint2.CenterPosition - ParabombPoint1.CenterPosition).Facing)
|
||||
proxy.TargetAirstrike(ParabombPoint2.CenterPosition, (Map.CenterOfCell(BadgerEntryPoint2.Location + CVec.New(0, 3)) - ParabombPoint2.CenterPosition).Facing)
|
||||
proxy.Destroy()
|
||||
@@ -114,7 +114,7 @@ end
|
||||
|
||||
SendParatroopers = function()
|
||||
Utils.Do(Paratroopers, function(para)
|
||||
local proxy = Actor.Create(para.proxy, false, { Owner = soviets })
|
||||
local proxy = Actor.Create(para.proxy, false, { Owner = Soviets })
|
||||
local target = Map.CenterOfCell(para.drop)
|
||||
local dir = target - Map.CenterOfCell(para.entry)
|
||||
|
||||
@@ -143,11 +143,11 @@ SendAttackGroup = function()
|
||||
end
|
||||
|
||||
ProduceInfantry = function()
|
||||
if SovietBarracks.IsDead or SovietBarracks.Owner ~= soviets then
|
||||
if SovietBarracks.IsDead or SovietBarracks.Owner ~= Soviets then
|
||||
return
|
||||
end
|
||||
|
||||
soviets.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
Soviets.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceInfantry)
|
||||
@@ -155,11 +155,11 @@ ProduceInfantry = function()
|
||||
end
|
||||
|
||||
ProduceVehicles = function()
|
||||
if SovietWarFactory.IsDead or SovietWarFactory.Owner ~= soviets then
|
||||
if SovietWarFactory.IsDead or SovietWarFactory.Owner ~= Soviets then
|
||||
return
|
||||
end
|
||||
|
||||
soviets.Build({ Utils.Random(SovietVehicles[SovietVehicleType]) }, function(units)
|
||||
Soviets.Build({ Utils.Random(SovietVehicles[SovietVehicleType]) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles)
|
||||
@@ -168,7 +168,7 @@ end
|
||||
|
||||
NumBaseBuildings = function()
|
||||
local buildings = Map.ActorsInBox(AlliedBaseTopLeft.CenterPosition, AlliedBaseBottomRight.CenterPosition, function(a)
|
||||
return not a.IsDead and a.Owner == allies2 and a.HasProperty("StartBuildingRepairs")
|
||||
return not a.IsDead and a.Owner == Allies2 and a.HasProperty("StartBuildingRepairs")
|
||||
end)
|
||||
|
||||
return #buildings
|
||||
@@ -176,18 +176,18 @@ end
|
||||
|
||||
Tick = function()
|
||||
if DateTime.GameTime > 1 and DateTime.GameTime % 25 == 0 and NumBaseBuildings() == 0 then
|
||||
allies2.MarkFailedObjective(objHoldPosition)
|
||||
Allies2.MarkFailedObjective(HoldPositionObjective)
|
||||
end
|
||||
|
||||
if not allies2.IsObjectiveCompleted(objCutSovietPower) and soviets.PowerState ~= "Normal" then
|
||||
allies2.MarkCompletedObjective(objCutSovietPower)
|
||||
if not Allies2.IsObjectiveCompleted(CutSovietPowerObjective) and Soviets.PowerState ~= "Normal" then
|
||||
Allies2.MarkCompletedObjective(CutSovietPowerObjective)
|
||||
end
|
||||
|
||||
if not allies2.IsObjectiveCompleted(objLimitLosses) and allies2.UnitsLost > DeathThreshold[Difficulty] then
|
||||
allies2.MarkFailedObjective(objLimitLosses)
|
||||
if not Allies2.IsObjectiveCompleted(LimitLossesObjective) and Allies2.UnitsLost > DeathThreshold[Difficulty] then
|
||||
Allies2.MarkFailedObjective(LimitLossesObjective)
|
||||
end
|
||||
|
||||
if allies2.IsLocalPlayer and DateTime.GameTime <= ReinforcementsDelay then
|
||||
if Allies2.IsLocalPlayer and DateTime.GameTime <= ReinforcementsDelay then
|
||||
if DateTime.GameTime % DateTime.Seconds(1) == 0 then
|
||||
local time = Utils.FormatTime(ReinforcementsDelay - DateTime.GameTime)
|
||||
local timer = UserInterface.Translate("allied-reinforcements-arrive-in", { ["time"] = time })
|
||||
@@ -199,21 +199,21 @@ Tick = function()
|
||||
end
|
||||
|
||||
SetupSoviets = function()
|
||||
soviets.Cash = 1000
|
||||
Soviets.Cash = 1000
|
||||
|
||||
if Difficulty == "easy" then
|
||||
Utils.Do(Sams, function(sam)
|
||||
local camera = Actor.Create("Camera.SAM", true, { Owner = allies1, Location = sam.Location })
|
||||
local camera = Actor.Create("Camera.SAM", true, { Owner = Allies1, Location = sam.Location })
|
||||
Trigger.OnKilledOrCaptured(sam, function()
|
||||
camera.Destroy()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == soviets and self.HasProperty("StartBuildingRepairs") end)
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == Soviets and self.HasProperty("StartBuildingRepairs") end)
|
||||
Utils.Do(buildings, function(actor)
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == soviets and building.Health < (building.MaxHealth * RepairTriggerThreshold[Difficulty] / 100) then
|
||||
if building.Owner == Soviets and building.Health < (building.MaxHealth * RepairTriggerThreshold[Difficulty] / 100) then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
@@ -233,43 +233,43 @@ end
|
||||
|
||||
SetupTriggers = function()
|
||||
Trigger.OnKilled(Tanya, function()
|
||||
allies1.MarkFailedObjective(objTanyaMustSurvive)
|
||||
Allies1.MarkFailedObjective(TanyaMustSurviveObjective)
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilledOrCaptured(Sams, function()
|
||||
allies1.MarkCompletedObjective(objDestroySamSites)
|
||||
objExtractEinstein = AddPrimaryObjective(allies1, "wait-for-helicopter-extract-einstein")
|
||||
Actor.Create("flare", true, { Owner = allies1, Location = ExtractionLZ.Location + CVec.New(1, -1) })
|
||||
Beacon.New(allies1, ExtractionLZ.CenterPosition)
|
||||
Media.PlaySpeechNotification(allies1, "SignalFlareNorth")
|
||||
Allies1.MarkCompletedObjective(DestroySamSitesObjective)
|
||||
ExtractEinsteinObjective = AddPrimaryObjective(Allies1, "wait-for-helicopter-extract-einstein")
|
||||
Actor.Create("flare", true, { Owner = Allies1, Location = ExtractionLZ.Location + CVec.New(1, -1) })
|
||||
Beacon.New(Allies1, ExtractionLZ.CenterPosition)
|
||||
Media.PlaySpeechNotification(Allies1, "SignalFlareNorth")
|
||||
|
||||
ExtractionHeli = Reinforcements.ReinforceWithTransport(allies1, "tran", nil, { ExtractionLZEntryPoint.Location, ExtractionLZ.Location })[1]
|
||||
ExtractionHeli = Reinforcements.ReinforceWithTransport(Allies1, "tran", nil, { ExtractionLZEntryPoint.Location, ExtractionLZ.Location })[1]
|
||||
Trigger.OnKilled(ExtractionHeli, function()
|
||||
allies1.MarkFailedObjective(objExtractEinstein)
|
||||
Allies1.MarkFailedObjective(ExtractEinsteinObjective)
|
||||
end)
|
||||
Trigger.OnPassengerEntered(ExtractionHeli, function(heli, passenger)
|
||||
if passenger == Einstein then
|
||||
heli.Move(ExtractionLZEntryPoint.Location)
|
||||
heli.Destroy()
|
||||
Trigger.OnRemovedFromWorld(heli, function()
|
||||
allies2.MarkCompletedObjective(objLimitLosses)
|
||||
allies2.MarkCompletedObjective(objHoldPosition)
|
||||
allies1.MarkCompletedObjective(objTanyaMustSurvive)
|
||||
allies1.MarkCompletedObjective(objEinsteinSurvival)
|
||||
allies1.MarkCompletedObjective(objExtractEinstein)
|
||||
Allies2.MarkCompletedObjective(LimitLossesObjective)
|
||||
Allies2.MarkCompletedObjective(HoldPositionObjective)
|
||||
Allies1.MarkCompletedObjective(TanyaMustSurviveObjective)
|
||||
Allies1.MarkCompletedObjective(EinsteinSurvivalObjective)
|
||||
Allies1.MarkCompletedObjective(ExtractEinsteinObjective)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(TownPoint.CenterPosition, WDist.FromCells(15), function(actor, trigger)
|
||||
if actor.Owner == allies1 then
|
||||
ReassignActors(TownUnits, neutral, allies1)
|
||||
if actor.Owner == Allies1 then
|
||||
ReassignActors(TownUnits, Neutral, Allies1)
|
||||
Utils.Do(TownUnits, function(a) a.Stance = "Defend" end)
|
||||
allies1.MarkCompletedObjective(objFindEinstein)
|
||||
objEinsteinSurvival = AddPrimaryObjective(allies1, "keep-einstein-alive-at-all-costs")
|
||||
Allies1.MarkCompletedObjective(FindEinsteinObjective)
|
||||
EinsteinSurvivalObjective = AddPrimaryObjective(Allies1, "keep-einstein-alive-at-all-costs")
|
||||
Trigger.OnKilled(Einstein, function()
|
||||
allies1.MarkFailedObjective(objEinsteinSurvival)
|
||||
Allies1.MarkFailedObjective(EinsteinSurvivalObjective)
|
||||
end)
|
||||
Trigger.RemoveProximityTrigger(trigger)
|
||||
SovietTownAttack()
|
||||
@@ -277,11 +277,11 @@ SetupTriggers = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(YakAttackPoint.CenterPosition, WDist.FromCells(5), function(actor, trigger)
|
||||
if not (Yak == nil or Yak.IsDead) or actor.Owner ~= allies1 then
|
||||
if not (Yak == nil or Yak.IsDead) or actor.Owner ~= Allies1 then
|
||||
return
|
||||
end
|
||||
|
||||
Yak = Actor.Create("yak", true, { Owner = soviets, Location = YakEntryPoint.Location, CenterPosition = YakEntryPoint.CenterPosition + WVec.New(0, 0, Actor.CruiseAltitude("yak")) })
|
||||
Yak = Actor.Create("yak", true, { Owner = Soviets, Location = YakEntryPoint.Location, CenterPosition = YakEntryPoint.CenterPosition + WVec.New(0, 0, Actor.CruiseAltitude("yak")) })
|
||||
Yak.Move(YakAttackPoint.Location + CVec.New(0, -10))
|
||||
Yak.CallFunc(YakAttack)
|
||||
end)
|
||||
@@ -292,9 +292,9 @@ SetupTriggers = function()
|
||||
end
|
||||
|
||||
SpawnTanya = function()
|
||||
Tanya = Actor.Create(TanyaType, true, { Owner = allies1, Location = TanyaLocation.Location })
|
||||
Tanya = Actor.Create(TanyaType, true, { Owner = Allies1, Location = TanyaLocation.Location })
|
||||
|
||||
if Difficulty ~= "easy" and allies1.IsLocalPlayer then
|
||||
if Difficulty ~= "easy" and Allies1.IsLocalPlayer then
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
Media.DisplayMessage(UserInterface.Translate("tanya-rules-of-engagement"), UserInterface.Translate("tanya"))
|
||||
end)
|
||||
@@ -311,46 +311,46 @@ ReassignActors = function(actors, from, to)
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
neutral = Player.GetPlayer("Neutral")
|
||||
Neutral = Player.GetPlayer("Neutral")
|
||||
|
||||
-- Allies is the pre-set owner of units that get assigned to either the second player, if any, or the first player otherwise.
|
||||
allies = Player.GetPlayer("Allies")
|
||||
Allies = Player.GetPlayer("Allies")
|
||||
|
||||
-- Allies1 is the player starting on the right, controlling Tanya
|
||||
allies1 = Player.GetPlayer("Allies1")
|
||||
Allies1 = Player.GetPlayer("Allies1")
|
||||
|
||||
-- Allies2 is the player starting on the left, defending the base
|
||||
allies2 = Player.GetPlayer("Allies2")
|
||||
Allies2 = Player.GetPlayer("Allies2")
|
||||
|
||||
soviets = Player.GetPlayer("Soviets")
|
||||
Soviets = Player.GetPlayer("Soviets")
|
||||
|
||||
Utils.Do({ allies1, allies2 }, function(player)
|
||||
Utils.Do({ Allies1, Allies2 }, function(player)
|
||||
if player and player.IsLocalPlayer then
|
||||
InitObjectives(player)
|
||||
end
|
||||
end)
|
||||
|
||||
if not allies2 or allies2.IsLocalPlayer then
|
||||
if not Allies2 or Allies2.IsLocalPlayer then
|
||||
Camera.Position = Allies2BasePoint.CenterPosition
|
||||
else
|
||||
Camera.Position = ChinookHusk.CenterPosition
|
||||
end
|
||||
|
||||
if not allies2 then
|
||||
allies2 = allies1
|
||||
if not Allies2 then
|
||||
Allies2 = Allies1
|
||||
end
|
||||
|
||||
ReassignActors(Map.ActorsInWorld, allies, allies2)
|
||||
ReassignActors(Map.ActorsInWorld, Allies, Allies2)
|
||||
SpawnTanya()
|
||||
|
||||
objTanyaMustSurvive = AddPrimaryObjective(allies1, "tanya-survive")
|
||||
objFindEinstein = AddPrimaryObjective(allies1, "find-einstein-crashed-helicopter")
|
||||
objDestroySamSites = AddPrimaryObjective(allies1, "destroy-sam-sites")
|
||||
TanyaMustSurviveObjective = AddPrimaryObjective(Allies1, "tanya-survive")
|
||||
FindEinsteinObjective = AddPrimaryObjective(Allies1, "find-einstein-crashed-helicopter")
|
||||
DestroySamSitesObjective = AddPrimaryObjective(Allies1, "destroy-sam-sites")
|
||||
|
||||
objHoldPosition = AddPrimaryObjective(allies2, "hold-position-protect-base")
|
||||
HoldPositionObjective = AddPrimaryObjective(Allies2, "hold-position-protect-base")
|
||||
local dontLoseMoreThan = UserInterface.Translate("keep-civilians-alive", { ["units"] = DeathThreshold[Difficulty] })
|
||||
objLimitLosses = AddSecondaryObjective(allies2, dontLoseMoreThan)
|
||||
objCutSovietPower = AddSecondaryObjective(allies2, "take-out-the-soviet-power-grid")
|
||||
LimitLossesObjective = AddSecondaryObjective(Allies2, dontLoseMoreThan)
|
||||
CutSovietPowerObjective = AddSecondaryObjective(Allies2, "take-out-the-soviet-power-grid")
|
||||
|
||||
SetupTriggers()
|
||||
SetupSoviets()
|
||||
|
||||
@@ -108,13 +108,13 @@ SovietUnits2 =
|
||||
CurrentReinforcement1 = 0
|
||||
CurrentReinforcement2 = 0
|
||||
SpawnAlliedUnit = function(units)
|
||||
Reinforcements.Reinforce(allies1, units, { Allies1EntryPoint.Location, Allies1MovePoint.Location })
|
||||
Reinforcements.Reinforce(Allies1, units, { Allies1EntryPoint.Location, Allies1MovePoint.Location })
|
||||
|
||||
if allies2 then
|
||||
Reinforcements.Reinforce(allies2, units, { Allies2EntryPoint.Location, Allies2MovePoint.Location })
|
||||
if Allies2 then
|
||||
Reinforcements.Reinforce(Allies2, units, { Allies2EntryPoint.Location, Allies2MovePoint.Location })
|
||||
end
|
||||
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
Media.PlaySpeechNotification(player, "AlliedReinforcementsNorth")
|
||||
end)
|
||||
@@ -148,11 +148,11 @@ SpawnSovietUnits = function()
|
||||
local unitType = Utils.Random(units)
|
||||
local spawnPoint = Utils.Random(SovietEntryPoints)
|
||||
local rallyPoint = Utils.Random(SovietRallyPoints)
|
||||
local actor = Actor.Create(unitType, true, { Owner = soviets, Location = spawnPoint.Location })
|
||||
local actor = Actor.Create(unitType, true, { Owner = Soviets, Location = spawnPoint.Location })
|
||||
actor.AttackMove(rallyPoint.Location)
|
||||
IdleHunt(actor)
|
||||
|
||||
local delay = math.max(attackAtFrame - 5, minAttackAtFrame)
|
||||
local delay = math.max(AttackAtFrame[Difficulty] - 5, MinAttackAtFrame[Difficulty])
|
||||
Trigger.AfterDelay(delay, SpawnSovietUnits)
|
||||
end
|
||||
|
||||
@@ -166,7 +166,7 @@ SendSovietParadrop = function()
|
||||
|
||||
SovietParadrop = SovietParadrop + 1
|
||||
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
Media.PlaySpeechNotification(player, "SovietForcesApproaching")
|
||||
end)
|
||||
|
||||
@@ -176,16 +176,16 @@ SendSovietParadrop = function()
|
||||
local randomParadropCell = CPos.New(x, y)
|
||||
local lz = Map.CenterOfCell(randomParadropCell)
|
||||
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = soviets })
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = Soviets })
|
||||
powerproxy.TargetParatroopers(lz)
|
||||
powerproxy.Destroy()
|
||||
|
||||
Trigger.AfterDelay(sovietParadropTicks, SendSovietParadrop)
|
||||
Trigger.AfterDelay(SovietParadropTicks[Difficulty], SendSovietParadrop)
|
||||
end
|
||||
|
||||
AircraftTargets = function(yak)
|
||||
local targets = Utils.Where(Map.ActorsInWorld, function(a)
|
||||
return (a.Owner == allies1 or a.Owner == allies2) and a.HasProperty("Health") and yak.CanTarget(a)
|
||||
return (a.Owner == Allies1 or a.Owner == Allies2) and a.HasProperty("Health") and yak.CanTarget(a)
|
||||
end)
|
||||
|
||||
-- Prefer mobile units
|
||||
@@ -215,14 +215,14 @@ YakAttack = function(yak, target)
|
||||
end
|
||||
|
||||
ManageSovietAircraft = function()
|
||||
if allies1.IsObjectiveCompleted(destroyAirbases) then
|
||||
if Allies1.IsObjectiveCompleted(DestroyAirbases) then
|
||||
return
|
||||
end
|
||||
|
||||
local maxSovietYaks = MaxSovietYaks[Difficulty]
|
||||
local sovietYaks = soviets.GetActorsByType('yak')
|
||||
local sovietYaks = Soviets.GetActorsByType('yak')
|
||||
if #sovietYaks < maxSovietYaks then
|
||||
soviets.Build(Yak, function(units)
|
||||
Soviets.Build(Yak, function(units)
|
||||
local yak = units[1]
|
||||
YakAttack(yak)
|
||||
end)
|
||||
@@ -230,21 +230,21 @@ ManageSovietAircraft = function()
|
||||
end
|
||||
|
||||
SetEvacuateMissionText = function()
|
||||
local attributes = { ["evacuated"] = UnitsEvacuated, ["threshold"] = unitsEvacuatedThreshold }
|
||||
local attributes = { ["evacuated"] = UnitsEvacuated, ["threshold"] = UnitsEvacuatedThreshold[Difficulty] }
|
||||
local unitsEvacuated = UserInterface.Translate("units-evacuated", attributes)
|
||||
UserInterface.SetMissionText(unitsEvacuated, TextColor)
|
||||
end
|
||||
|
||||
UnitsEvacuated = 0
|
||||
EvacuateAlliedUnit = function(unit)
|
||||
if (unit.Owner == allies1 or unit.Owner == allies2) and unit.HasProperty("Move") then
|
||||
if (unit.Owner == Allies1 or unit.Owner == Allies2) and unit.HasProperty("Move") then
|
||||
unit.Stop()
|
||||
unit.Owner = allies
|
||||
unit.Owner = Allies
|
||||
|
||||
if unit.Type == 'mgg' then
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
if player then
|
||||
player.MarkCompletedObjective(evacuateMgg)
|
||||
player.MarkCompletedObjective(EvacuateMgg)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -266,10 +266,10 @@ EvacuateAlliedUnit = function(unit)
|
||||
|
||||
SetEvacuateMissionText()
|
||||
|
||||
if UnitsEvacuated >= unitsEvacuatedThreshold then
|
||||
Utils.Do(humans, function(player)
|
||||
if UnitsEvacuated >= UnitsEvacuatedThreshold[Difficulty] then
|
||||
Utils.Do(Humans, function(player)
|
||||
if player then
|
||||
player.MarkCompletedObjective(evacuateUnits)
|
||||
player.MarkCompletedObjective(EvacuateUnits)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -280,9 +280,9 @@ Tick = function()
|
||||
if DateTime.GameTime % 100 == 0 then
|
||||
ManageSovietAircraft()
|
||||
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
if player and player.HasNoRequiredUnits() then
|
||||
soviets.MarkCompletedObjective(sovietObjective)
|
||||
Soviets.MarkCompletedObjective(SovietObjective)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -290,61 +290,56 @@ end
|
||||
|
||||
WorldLoaded = function()
|
||||
-- NPC
|
||||
neutral = Player.GetPlayer("Neutral")
|
||||
allies = Player.GetPlayer("Allies")
|
||||
soviets = Player.GetPlayer("Soviets")
|
||||
Neutral = Player.GetPlayer("Neutral")
|
||||
Allies = Player.GetPlayer("Allies")
|
||||
Soviets = Player.GetPlayer("Soviets")
|
||||
|
||||
-- Player controlled
|
||||
allies1 = Player.GetPlayer("Allies1")
|
||||
allies2 = Player.GetPlayer("Allies2")
|
||||
Allies1 = Player.GetPlayer("Allies1")
|
||||
Allies2 = Player.GetPlayer("Allies2")
|
||||
|
||||
humans = { allies1, allies2 }
|
||||
Utils.Do(humans, function(player)
|
||||
Humans = { Allies1, Allies2 }
|
||||
Utils.Do(Humans, function(player)
|
||||
if player and player.IsLocalPlayer then
|
||||
InitObjectives(player)
|
||||
TextColor = player.Color
|
||||
end
|
||||
end)
|
||||
|
||||
unitsEvacuatedThreshold = UnitsEvacuatedThreshold[Difficulty]
|
||||
SetEvacuateMissionText()
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
if player then
|
||||
evacuateUnits = AddPrimaryObjective(player, UserInterface.Translate("evacuate-units", { ["threshold"] = unitsEvacuatedThreshold }))
|
||||
destroyAirbases = AddSecondaryObjective(player, "destroy-nearby-soviet-airbases")
|
||||
evacuateMgg = AddSecondaryObjective(player, "evacuate-at-least-one-gap-generator")
|
||||
EvacuateUnits = AddPrimaryObjective(player, UserInterface.Translate("evacuate-units", { ["threshold"] = UnitsEvacuatedThreshold[Difficulty] }))
|
||||
DestroyAirbases = AddSecondaryObjective(player, "destroy-nearby-soviet-airbases")
|
||||
EvacuateMgg = AddSecondaryObjective(player, "evacuate-at-least-one-gap-generator")
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilledOrCaptured(SovietAirfields, function()
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
if player then
|
||||
player.MarkCompletedObjective(destroyAirbases)
|
||||
player.MarkCompletedObjective(DestroyAirbases)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
sovietObjective = AddPrimaryObjective(soviets, "")
|
||||
SovietObjective = AddPrimaryObjective(Soviets, "")
|
||||
|
||||
if not allies2 or allies1.IsLocalPlayer then
|
||||
if not Allies2 or Allies1.IsLocalPlayer then
|
||||
Camera.Position = Allies1EntryPoint.CenterPosition
|
||||
else
|
||||
Camera.Position = Allies2EntryPoint.CenterPosition
|
||||
end
|
||||
|
||||
if not allies2 then
|
||||
allies1.Cash = 10000
|
||||
if not Allies2 then
|
||||
Allies1.Cash = 10000
|
||||
Media.DisplayMessage(UserInterface.Translate("transferring-funds"), UserInterface.Translate("co-commander-missing"))
|
||||
end
|
||||
|
||||
SpawnAlliedUnit(MobileConstructionVehicle)
|
||||
|
||||
minAttackAtFrame = MinAttackAtFrame[Difficulty]
|
||||
attackAtFrame = AttackAtFrame[Difficulty]
|
||||
Trigger.AfterDelay(attackAtFrame, SpawnSovietUnits)
|
||||
|
||||
sovietParadropTicks = SovietParadropTicks[Difficulty]
|
||||
Trigger.AfterDelay(sovietParadropTicks, SendSovietParadrop)
|
||||
Trigger.AfterDelay(AttackAtFrame[Difficulty], SpawnSovietUnits)
|
||||
Trigger.AfterDelay(SovietParadropTicks[Difficulty], SendSovietParadrop)
|
||||
|
||||
Trigger.OnEnteredFootprint(MountainEntry, EvacuateAlliedUnit)
|
||||
Trigger.OnEnteredFootprint(BridgeEntry, EvacuateAlliedUnit)
|
||||
|
||||
@@ -36,7 +36,7 @@ FootprintTrigger12 = { CPos.New(35, 39), CPos.New(35, 40), CPos.New(35, 41), CPo
|
||||
ExtractionHelicopterType = "tran"
|
||||
ExtractionPath = { ChinookEntry.Location, ExtractionPoint.Location }
|
||||
|
||||
lstReinforcements =
|
||||
LstReinforcements =
|
||||
{
|
||||
first =
|
||||
{
|
||||
@@ -241,7 +241,7 @@ FootprintTriggers = function()
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
foot6Triggered = true
|
||||
|
||||
local reinforcement = lstReinforcements.first
|
||||
local reinforcement = LstReinforcements.first
|
||||
Media.PlaySpeechNotification(Allies, "ReinforcementsArrived")
|
||||
Reinforcements.ReinforceWithTransport(Allies, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
end
|
||||
@@ -349,7 +349,7 @@ FootprintTriggers = function()
|
||||
trig11camera.Destroy()
|
||||
end)
|
||||
|
||||
local reinforcement = lstReinforcements.second
|
||||
local reinforcement = LstReinforcements.second
|
||||
Media.PlaySpeechNotification(Allies, "ReinforcementsArrived")
|
||||
Reinforcements.ReinforceWithTransport(Allies, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
end
|
||||
|
||||
@@ -47,7 +47,7 @@ end
|
||||
|
||||
InitialInfantryProduction = function(id, units)
|
||||
local productionComplete = AIPlayers[id].Build(units, function(actors)
|
||||
InfantryProduction(id)
|
||||
ProduceInfantry(id)
|
||||
end)
|
||||
|
||||
Trigger.OnProduction(AIBarracks[id], function(producer, produced)
|
||||
@@ -55,13 +55,13 @@ InitialInfantryProduction = function(id, units)
|
||||
end)
|
||||
end
|
||||
|
||||
InfantryProduction = function(id)
|
||||
ProduceInfantry = function(id)
|
||||
local productionComplete = AIPlayers[id].Build({ Utils.Random(UnitsToBuild) }, function(actors)
|
||||
Trigger.AfterDelay(0, function() InfantryProduction(id) end)
|
||||
Trigger.AfterDelay(0, function() ProduceInfantry(id) end)
|
||||
end)
|
||||
|
||||
if not productionComplete then
|
||||
Trigger.AfterDelay(0, function() InfantryProduction(id) end)
|
||||
Trigger.AfterDelay(0, function() ProduceInfantry(id) end)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ IdleHunt = function(actor)
|
||||
end
|
||||
|
||||
SendUnits = function(entryCell, unitTypes, targetCell, extraData)
|
||||
Reinforcements.Reinforce(soviets, unitTypes, { entryCell }, 40, function(a)
|
||||
Reinforcements.Reinforce(Soviets, unitTypes, { entryCell }, 40, function(a)
|
||||
if not a.HasProperty("AttackMove") then
|
||||
Trigger.OnIdle(a, function(a)
|
||||
a.Move(targetCell)
|
||||
@@ -140,7 +140,7 @@ SendWave = function()
|
||||
end)
|
||||
end
|
||||
|
||||
Utils.Do(players, function(player)
|
||||
Utils.Do(Players, function(player)
|
||||
Media.PlaySpeechNotification(player, "EnemyUnitsApproaching")
|
||||
end)
|
||||
|
||||
@@ -174,7 +174,7 @@ end
|
||||
|
||||
SovietsRetreating = function()
|
||||
Utils.Do(Snipers, function(a)
|
||||
if not a.IsDead and a.Owner == soviets then
|
||||
if not a.IsDead and a.Owner == Soviets then
|
||||
a.Destroy()
|
||||
end
|
||||
end)
|
||||
@@ -201,7 +201,7 @@ Tick = function()
|
||||
end
|
||||
|
||||
SetupWallOwners = function()
|
||||
Utils.Do(players, function(player)
|
||||
Utils.Do(Players, function(player)
|
||||
Utils.Do(Walls[player.Spawn], function(wall)
|
||||
wall.Owner = player
|
||||
end)
|
||||
@@ -209,14 +209,14 @@ SetupWallOwners = function()
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
soviets = Player.GetPlayer("Soviets")
|
||||
players = { }
|
||||
Soviets = Player.GetPlayer("Soviets")
|
||||
Players = { }
|
||||
for i = 0, 4 do
|
||||
local player = Player.GetPlayer("Multi" ..i)
|
||||
players[i] = player
|
||||
Players[i] = player
|
||||
|
||||
if players[i] and players[i].IsBot then
|
||||
ActivateAI(players[i], i)
|
||||
if Players[i] and Players[i].IsBot then
|
||||
ActivateAI(Players[i], i)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -224,6 +224,6 @@ WorldLoaded = function()
|
||||
|
||||
SetupWallOwners()
|
||||
|
||||
ParaProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = soviets })
|
||||
ParaProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = Soviets })
|
||||
SendWave()
|
||||
end
|
||||
|
||||
@@ -129,7 +129,7 @@ AlliedReinforcements = function()
|
||||
|
||||
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
|
||||
local chinookChalk2 = Reinforcements.ReinforceWithTransport(Greece, "tran.reinforcement", NorthChinookChalk, NorthChinookPath, { NorthChinookPath[1] })
|
||||
InfantryProduction()
|
||||
ProduceInfantry()
|
||||
TankProduction()
|
||||
end
|
||||
end)
|
||||
@@ -266,7 +266,7 @@ AttackGroupSize = 4
|
||||
ProductionDelay = DateTime.Seconds(10)
|
||||
IdlingUnits = { }
|
||||
|
||||
InfantryProduction = function()
|
||||
ProduceInfantry = function()
|
||||
if (Tent1.IsDead or Tent1.Owner ~= USSR) and (Tent2.IsDead or Tent2.Owner ~= USSR) then
|
||||
return
|
||||
end
|
||||
@@ -275,7 +275,7 @@ InfantryProduction = function()
|
||||
|
||||
USSR.Build(toBuild, function(unit)
|
||||
IdlingUnits[#IdlingUnits + 1] = unit[1]
|
||||
Trigger.AfterDelay(ProductionDelay, InfantryProduction)
|
||||
Trigger.AfterDelay(ProductionDelay, ProduceInfantry)
|
||||
|
||||
if #IdlingUnits >= (AttackGroupSize * 1.5) then
|
||||
SendAttack()
|
||||
@@ -336,19 +336,19 @@ LoseTriggers = function()
|
||||
end)
|
||||
end
|
||||
|
||||
ticked = TimerTicks
|
||||
Ticked = TimerTicks
|
||||
Tick = function()
|
||||
if Greece.HasNoRequiredUnits() and UnitsArrived then
|
||||
USSR.MarkCompletedObjective(SovietObj)
|
||||
end
|
||||
|
||||
if ticked > 0 then
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("chronosphere-explodes-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if Ticked > 0 then
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("chronosphere-explodes-in", { ["time"] = Utils.FormatTime(Ticked) })
|
||||
UserInterface.SetMissionText(Timer, TimerColor)
|
||||
end
|
||||
ticked = ticked - 1
|
||||
elseif ticked == 0 then
|
||||
Ticked = Ticked - 1
|
||||
elseif Ticked == 0 then
|
||||
UserInterface.SetMissionText(UserInterface.Translate("too-late"), USSR.Color)
|
||||
USSR.MarkCompletedObjective(SovietObj)
|
||||
end
|
||||
|
||||
@@ -40,25 +40,25 @@ Patrol3 = { "e1", "e1", "dog.patrol" }
|
||||
TransportType = "lst.unselectable.unloadonly"
|
||||
|
||||
SecureLabFailed = function()
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
if player then
|
||||
player.MarkFailedObjective(secureLab)
|
||||
player.MarkFailedObjective(SecureLab)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
timerStarted = false
|
||||
TimerStarted = false
|
||||
StartTimer = function()
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
if player.IsLocalPlayer then
|
||||
TimerColor = player.Color
|
||||
end
|
||||
end)
|
||||
CountDownTimerAnnouncements()
|
||||
ticked = TimerTicks
|
||||
timerStarted = true
|
||||
Ticked = TimerTicks
|
||||
TimerStarted = true
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
Media.PlaySpeechNotification(player, "TimerStarted")
|
||||
end)
|
||||
end)
|
||||
@@ -68,8 +68,8 @@ CountDownTimerAnnouncements = function()
|
||||
for i = #Announcements, 1, -1 do
|
||||
local delay = TimerTicks - Announcements[i].delay
|
||||
Trigger.AfterDelay(delay, function()
|
||||
if not labSecured then
|
||||
Utils.Do(humans, function(player)
|
||||
if not LabSecured then
|
||||
Utils.Do(Humans, function(player)
|
||||
Media.PlaySpeechNotification(player, Announcements[i].speech)
|
||||
end)
|
||||
end
|
||||
@@ -77,13 +77,13 @@ CountDownTimerAnnouncements = function()
|
||||
end
|
||||
end
|
||||
|
||||
reinforcementsHaveArrived = false
|
||||
ReinforcementsHaveArrived = false
|
||||
LabInfiltrated = function()
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
if player then
|
||||
secureLab = AddPrimaryObjective(player, "secure-laboratory-guards")
|
||||
destroyBase = AddPrimaryObjective(player, "destroy-remaining-soviet-presence")
|
||||
player.MarkCompletedObjective(infiltrateLab)
|
||||
SecureLab = AddPrimaryObjective(player, "secure-laboratory-guards")
|
||||
DestroyBase = AddPrimaryObjective(player, "destroy-remaining-soviet-presence")
|
||||
player.MarkCompletedObjective(InfiltrateLab)
|
||||
Trigger.ClearAll(Lab)
|
||||
Trigger.AfterDelay(0, function()
|
||||
Trigger.OnKilled(Lab, SecureLabFailed)
|
||||
@@ -95,46 +95,46 @@ LabInfiltrated = function()
|
||||
local entryPath = { ReinforcementsEntryPoint.Location, ReinforcementsUnloadPoint.Location }
|
||||
local exit = { ReinforcementsEntryPoint.Location }
|
||||
|
||||
mcvActors = { "mcv" }
|
||||
if player2 then
|
||||
local mcvActors = { "mcv" }
|
||||
if Allies2 then
|
||||
mcvActors = { "mcv", "mcv" }
|
||||
end
|
||||
|
||||
local reinforcements = Reinforcements.ReinforceWithTransport(allies, TransportType, mcvActors, entryPath, exit)
|
||||
local reinforcements = Reinforcements.ReinforceWithTransport(Allies, TransportType, mcvActors, entryPath, exit)
|
||||
local mcvs = reinforcements[2]
|
||||
|
||||
Trigger.OnAddedToWorld(mcvs[1], function(mcvUnloaded)
|
||||
|
||||
-- Don't call this twice (because of the owner change)
|
||||
if mcvUnloaded.Owner == player1 then
|
||||
if mcvUnloaded.Owner == Allies1 then
|
||||
return
|
||||
end
|
||||
|
||||
mcvUnloaded.Owner = player1
|
||||
if not player2 then
|
||||
player1.Cash = 5000
|
||||
mcvUnloaded.Owner = Allies1
|
||||
if not Allies2 then
|
||||
Allies1.Cash = 5000
|
||||
end
|
||||
Media.PlaySpeechNotification(player, "AlliedReinforcementsSouth")
|
||||
Media.PlaySpeechNotification(Allies1, "AlliedReinforcementsSouth")
|
||||
StartTimer()
|
||||
HijackTruck.Destroy()
|
||||
reinforcementsHaveArrived = true
|
||||
ReinforcementsHaveArrived = true
|
||||
end)
|
||||
|
||||
if player2 then
|
||||
if Allies2 then
|
||||
Trigger.OnAddedToWorld(mcvs[2], function(mcvUnloaded)
|
||||
|
||||
-- Don't call this twice (because of the owner change)
|
||||
if mcvUnloaded.Owner == player2 then
|
||||
if mcvUnloaded.Owner == Allies2 then
|
||||
return
|
||||
end
|
||||
|
||||
mcvUnloaded.Owner = player2
|
||||
player1.Cash = 2500
|
||||
player2.Cash = 2500
|
||||
mcvUnloaded.Owner = Allies2
|
||||
Allies1.Cash = 2500
|
||||
Allies2.Cash = 2500
|
||||
end)
|
||||
end
|
||||
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
for i = 0, 2 do
|
||||
Trigger.AfterDelay(DateTime.Seconds(i), function()
|
||||
Media.PlaySoundNotification(player, "AlertBuzzer")
|
||||
@@ -155,9 +155,9 @@ LabInfiltrated = function()
|
||||
end
|
||||
|
||||
InfiltrateLabFailed = function()
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
if player then
|
||||
player.MarkFailedObjective(infiltrateLab)
|
||||
player.MarkFailedObjective(InfiltrateLab)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -170,14 +170,14 @@ ChangeOwnerOnAddedToWorld = function(actor, newOwner)
|
||||
end
|
||||
|
||||
InsertSpies = function()
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
if player then
|
||||
infiltrateLab = AddPrimaryObjective(player, "infiltrate-laboratory")
|
||||
InfiltrateLab = AddPrimaryObjective(player, "infiltrate-laboratory")
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Lab, function()
|
||||
if not player1.IsObjectiveCompleted(infiltrateLab) then
|
||||
if not Allies1.IsObjectiveCompleted(InfiltrateLab) then
|
||||
InfiltrateLabFailed()
|
||||
end
|
||||
end)
|
||||
@@ -188,30 +188,30 @@ InsertSpies = function()
|
||||
Trigger.OnInfiltrated(Lab, function()
|
||||
infiltrationCount = infiltrationCount + 1
|
||||
|
||||
if (player2 and infiltrationCount == 2) or not player2 then
|
||||
if (Allies2 and infiltrationCount == 2) or not Allies2 then
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), LabInfiltrated)
|
||||
end
|
||||
end)
|
||||
|
||||
spyActors = { "spy.strong" }
|
||||
if player2 then
|
||||
local spyActors = { "spy.strong" }
|
||||
if Allies2 then
|
||||
spyActors = { "spy.strong", "spy.strong" }
|
||||
end
|
||||
|
||||
local entryPath = { SpyReinforcementsEntryPoint.Location, SpyReinforcementsUnloadPoint.Location }
|
||||
local exit = { SpyReinforcementsExitPoint.Location }
|
||||
local reinforcements = Reinforcements.ReinforceWithTransport(allies, TransportType, spyActors, entryPath, exit)
|
||||
local reinforcements = Reinforcements.ReinforceWithTransport(Allies, TransportType, spyActors, entryPath, exit)
|
||||
|
||||
local transport = reinforcements[1]
|
||||
Camera.Position = transport.CenterPosition
|
||||
|
||||
spies = reinforcements[2]
|
||||
local spies = reinforcements[2]
|
||||
Trigger.OnAnyKilled(spies, InfiltrateLabFailed)
|
||||
|
||||
ChangeOwnerOnAddedToWorld(spies[1], player1)
|
||||
ChangeOwnerOnAddedToWorld(spies[1], Allies1)
|
||||
|
||||
if player2 then
|
||||
ChangeOwnerOnAddedToWorld(spies[2], player2)
|
||||
if Allies2 then
|
||||
ChangeOwnerOnAddedToWorld(spies[2], Allies2)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -237,7 +237,7 @@ CapOre = function(player)
|
||||
end
|
||||
|
||||
NewPatrol = function(actorType, start, waypoints)
|
||||
local guard = Actor.Create(actorType, true, { Owner = soviets, Location = start })
|
||||
local guard = Actor.Create(actorType, true, { Owner = Soviets, Location = start })
|
||||
guard.Patrol(waypoints, true, Utils.RandomInteger(50, 75))
|
||||
end
|
||||
|
||||
@@ -260,20 +260,20 @@ SetupPatrols = function()
|
||||
end)
|
||||
end
|
||||
|
||||
ticked = 0
|
||||
Ticked = 0
|
||||
SecureLabTimer = function()
|
||||
if not timerStarted or labSecured then
|
||||
if not TimerStarted or LabSecured then
|
||||
return
|
||||
end
|
||||
|
||||
if ticked > 0 then
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("secure-lab-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if Ticked > 0 then
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("secure-lab-in", { ["time"] = Utils.FormatTime(Ticked) })
|
||||
UserInterface.SetMissionText(Timer, TimerColor)
|
||||
end
|
||||
ticked = ticked - 1
|
||||
elseif ticked <= 0 then
|
||||
TimerColor = soviets.Color
|
||||
Ticked = Ticked - 1
|
||||
elseif Ticked <= 0 then
|
||||
TimerColor = Soviets.Color
|
||||
UserInterface.SetMissionText(UserInterface.Translate("soviet-research-lab-not-secured-in-time"), TimerColor)
|
||||
SecureLabFailed()
|
||||
end
|
||||
@@ -281,18 +281,18 @@ end
|
||||
|
||||
SovietBaseMaintenanceSetup = function()
|
||||
local sovietbuildings = Utils.Where(Map.NamedActors, function(a)
|
||||
return a.Owner == soviets and a.HasProperty("StartBuildingRepairs")
|
||||
return a.Owner == Soviets and a.HasProperty("StartBuildingRepairs")
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilledOrCaptured(sovietbuildings, function()
|
||||
Utils.Do(humans, function(player)
|
||||
player.MarkCompletedObjective(destroyBase)
|
||||
Utils.Do(Humans, function(player)
|
||||
player.MarkCompletedObjective(DestroyBase)
|
||||
end)
|
||||
end)
|
||||
|
||||
Utils.Do(sovietbuildings, function(sovietbuilding)
|
||||
Trigger.OnDamaged(sovietbuilding, function(building)
|
||||
if building.Owner == soviets and building.Health < building.MaxHealth * 3/4 then
|
||||
if building.Owner == Soviets and building.Health < building.MaxHealth * 3/4 then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
@@ -300,61 +300,61 @@ SovietBaseMaintenanceSetup = function()
|
||||
end
|
||||
|
||||
CheckPlayerDefeat = function()
|
||||
if not reinforcementsHaveArrived then
|
||||
if not ReinforcementsHaveArrived then
|
||||
return
|
||||
end
|
||||
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
if player.HasNoRequiredUnits() then
|
||||
player.MarkFailedObjective(destroyBase)
|
||||
player.MarkFailedObjective(DestroyBase)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
labSecured = false
|
||||
LabSecured = false
|
||||
CheckLabSecured = function()
|
||||
if not reinforcementsHaveArrived or labSecured then
|
||||
if not ReinforcementsHaveArrived or LabSecured then
|
||||
return
|
||||
end
|
||||
|
||||
if player1.HasNoRequiredUnits() or (player2 and player2.HasNoRequiredUnits()) then
|
||||
Utils.Do(humans, function(player)
|
||||
player.MarkFailedObjective(secureLab)
|
||||
if Allies1.HasNoRequiredUnits() or (Allies2 and Allies2.HasNoRequiredUnits()) then
|
||||
Utils.Do(Humans, function(player)
|
||||
player.MarkFailedObjective(SecureLab)
|
||||
end)
|
||||
end
|
||||
|
||||
local radius = WDist.FromCells(10)
|
||||
local labGuards = Utils.Where(Map.ActorsInCircle(LabWaypoint.CenterPosition, radius), function(a)
|
||||
return a.Owner == soviets and a.HasProperty("Move")
|
||||
return a.Owner == Soviets and a.HasProperty("Move")
|
||||
end)
|
||||
|
||||
if #labGuards < 1 then
|
||||
labSecured = true
|
||||
Utils.Do(humans, function(player)
|
||||
player.MarkCompletedObjective(secureLab)
|
||||
LabSecured = true
|
||||
Utils.Do(Humans, function(player)
|
||||
player.MarkCompletedObjective(SecureLab)
|
||||
end)
|
||||
UserInterface.SetMissionText("")
|
||||
end
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
CapOre(soviets)
|
||||
CapOre(Soviets)
|
||||
SecureLabTimer()
|
||||
CheckLabSecured()
|
||||
CheckPlayerDefeat()
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
allies = Player.GetPlayer("Allies")
|
||||
neutral = Player.GetPlayer("Neutral")
|
||||
creeps = Player.GetPlayer("Creeps")
|
||||
soviets = Player.GetPlayer("Soviets")
|
||||
Allies = Player.GetPlayer("Allies")
|
||||
Neutral = Player.GetPlayer("Neutral")
|
||||
Creeps = Player.GetPlayer("Creeps")
|
||||
Soviets = Player.GetPlayer("Soviets")
|
||||
|
||||
player1 = Player.GetPlayer("Allies1")
|
||||
player2 = Player.GetPlayer("Allies2")
|
||||
humans = { player1, player2 }
|
||||
Allies1 = Player.GetPlayer("Allies1")
|
||||
Allies2 = Player.GetPlayer("Allies2")
|
||||
Humans = { Allies1, Allies2 }
|
||||
|
||||
Utils.Do(humans, function(player)
|
||||
Utils.Do(Humans, function(player)
|
||||
if player and player.IsLocalPlayer then
|
||||
InitObjectives(player)
|
||||
end
|
||||
|
||||
@@ -62,7 +62,7 @@ GroundPatrolUnits =
|
||||
}
|
||||
|
||||
ParadropSovietUnits = function()
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = soviets })
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = Soviets })
|
||||
local aircraft = powerproxy.TargetParatroopers(MCVDeployLocation.CenterPosition, Angle.New(812))
|
||||
Utils.Do(aircraft, function(a)
|
||||
Trigger.OnPassengerExited(a, function(t, p)
|
||||
@@ -81,7 +81,7 @@ AirRaid = function(planeTypes, ingress, target)
|
||||
for i = 1, #planeTypes do
|
||||
Trigger.AfterDelay((i - 1) * DateTime.Seconds(1), function()
|
||||
local start = Map.CenterOfCell(ingress[1]) + WVec.New(0, 0, Actor.CruiseAltitude(planeTypes[i]))
|
||||
local plane = Actor.Create(planeTypes[i], true, { CenterPosition = start, Owner = soviets, Facing = (Map.CenterOfCell(ingress[2]) - start).Facing })
|
||||
local plane = Actor.Create(planeTypes[i], true, { CenterPosition = start, Owner = Soviets, Facing = (Map.CenterOfCell(ingress[2]) - start).Facing })
|
||||
|
||||
Utils.Do(ingress, function(wpt) plane.Move(wpt) end)
|
||||
plane.Attack(target)
|
||||
@@ -91,7 +91,7 @@ end
|
||||
|
||||
BaseRaid = function()
|
||||
local targets = Map.ActorsInBox(AlliedAreaTopLeft.CenterPosition, AlliedAreaBottomRight.CenterPosition, function(actor)
|
||||
return actor.Owner == player and actor.HasProperty("StartBuildingRepairs")
|
||||
return actor.Owner == Allies and actor.HasProperty("StartBuildingRepairs")
|
||||
end)
|
||||
|
||||
if #targets == 0 then
|
||||
@@ -163,7 +163,7 @@ BaseRearAttack = function(team)
|
||||
end
|
||||
|
||||
Build = function(units, action)
|
||||
if not soviets.Build(units, action) then
|
||||
if not Soviets.Build(units, action) then
|
||||
Trigger.AfterDelay(DateTime.Seconds(15), function()
|
||||
Build(units, action)
|
||||
end)
|
||||
@@ -185,9 +185,9 @@ SetupWorld = function()
|
||||
end)
|
||||
|
||||
Utils.Do(Map.NamedActors, function(actor)
|
||||
if actor.Owner == soviets and actor.HasProperty("StartBuildingRepairs") then
|
||||
if actor.Owner == Soviets and actor.HasProperty("StartBuildingRepairs") then
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == soviets then
|
||||
if building.Owner == Soviets then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
@@ -227,12 +227,12 @@ end
|
||||
|
||||
Tick = function()
|
||||
if DateTime.GameTime > 2 then
|
||||
if soviets.Resources > soviets.ResourceCapacity * 0.75 then
|
||||
soviets.Resources = soviets.Resources - ((soviets.ResourceCapacity * 0.01) / 25)
|
||||
if Soviets.Resources > Soviets.ResourceCapacity * 0.75 then
|
||||
Soviets.Resources = Soviets.Resources - ((Soviets.ResourceCapacity * 0.01) / 25)
|
||||
end
|
||||
|
||||
if player.HasNoRequiredUnits() then
|
||||
player.MarkFailedObjective(villageObjective)
|
||||
if Allies.HasNoRequiredUnits() then
|
||||
Allies.MarkFailedObjective(VillageObjective)
|
||||
end
|
||||
|
||||
if CachedVillagePercentage ~= VillagePercentage then
|
||||
@@ -244,43 +244,43 @@ Tick = function()
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("Allies")
|
||||
soviets = Player.GetPlayer("Soviets")
|
||||
Allies = Player.GetPlayer("Allies")
|
||||
Soviets = Player.GetPlayer("Soviets")
|
||||
|
||||
InitObjectives(player)
|
||||
InitObjectives(Allies)
|
||||
|
||||
sovietObjective = AddPrimaryObjective(soviets, "")
|
||||
villageObjective = AddPrimaryObjective(player, "save-village")
|
||||
beachheadObjective = AddPrimaryObjective(player, "mcv-main-island")
|
||||
SovietObjective = AddPrimaryObjective(Soviets, "")
|
||||
VillageObjective = AddPrimaryObjective(Allies, "save-village")
|
||||
BeachheadObjective = AddPrimaryObjective(Allies, "mcv-main-island")
|
||||
|
||||
beachheadTrigger = false
|
||||
BeachheadTriggered = false
|
||||
Trigger.OnExitedFootprint(BeachheadTrigger, function(a, id)
|
||||
if not beachheadTrigger and a.Owner == player and a.Type == "mcv" then
|
||||
beachheadTrigger = true
|
||||
if not BeachheadTriggered and a.Owner == Allies and a.Type == "mcv" then
|
||||
BeachheadTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
player.MarkCompletedObjective(beachheadObjective)
|
||||
Allies.MarkCompletedObjective(BeachheadObjective)
|
||||
|
||||
captureObjective = AddPrimaryObjective(player, "capture-air-force-hq")
|
||||
CaptureObjective = AddPrimaryObjective(Allies, "capture-air-force-hq")
|
||||
|
||||
if AirForceHQ.IsDead then
|
||||
player.MarkFailedObjective(captureObjective)
|
||||
Allies.MarkFailedObjective(CaptureObjective)
|
||||
return
|
||||
end
|
||||
if AirForceHQ.Owner == player then
|
||||
player.MarkCompletedObjective(captureObjective)
|
||||
player.MarkCompletedObjective(villageObjective)
|
||||
if AirForceHQ.Owner == Allies then
|
||||
Allies.MarkCompletedObjective(CaptureObjective)
|
||||
Allies.MarkCompletedObjective(VillageObjective)
|
||||
return
|
||||
end
|
||||
|
||||
Trigger.OnCapture(AirForceHQ, function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
player.MarkCompletedObjective(captureObjective)
|
||||
player.MarkCompletedObjective(villageObjective)
|
||||
Allies.MarkCompletedObjective(CaptureObjective)
|
||||
Allies.MarkCompletedObjective(VillageObjective)
|
||||
end)
|
||||
end)
|
||||
Trigger.OnKilled(AirForceHQ, function() player.MarkFailedObjective(captureObjective) end)
|
||||
Trigger.OnKilled(AirForceHQ, function() Allies.MarkFailedObjective(CaptureObjective) end)
|
||||
|
||||
Actor.Create("mainland", true, { Owner = player })
|
||||
Actor.Create("mainland", true, { Owner = Allies })
|
||||
|
||||
Trigger.AfterDelay(BaseFrontAttackInterval, function()
|
||||
Build(BaseFrontAttackUnits, BaseFrontAttack)
|
||||
@@ -301,7 +301,7 @@ WorldLoaded = function()
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(Village, function() player.MarkFailedObjective(villageObjective) end)
|
||||
Trigger.OnAllKilled(Village, function() Allies.MarkFailedObjective(VillageObjective) end)
|
||||
|
||||
SetupWorld()
|
||||
SetupMissionText()
|
||||
@@ -311,7 +311,7 @@ WorldLoaded = function()
|
||||
Trigger.AfterDelay(1, function() Build(UBoatPatrolUnits, SendUboatPatrol) end)
|
||||
Trigger.AfterDelay(1, function() Build(Utils.Random(GroundPatrolUnits), SendGroundPatrol) end)
|
||||
|
||||
Reinforcements.Reinforce(player, { "mcv" }, { MCVInsertLocation.Location, MCVDeployLocation.Location }, 0, function(mcv)
|
||||
Reinforcements.Reinforce(Allies, { "mcv" }, { MCVInsertLocation.Location, MCVDeployLocation.Location }, 0, function(mcv)
|
||||
mcv.Deploy()
|
||||
end)
|
||||
|
||||
|
||||
@@ -30,13 +30,13 @@ DemitriAreaTrigger = { CPos.New(32, 98), CPos.New(32, 99), CPos.New(33, 99), CPo
|
||||
HospitalAreaTrigger = { CPos.New(43, 41), CPos.New(44, 41), CPos.New(45, 41), CPos.New(46, 41), CPos.New(46, 42), CPos.New(46, 43), CPos.New(46, 44), CPos.New(46, 45), CPos.New(46, 46), CPos.New(45, 46), CPos.New(44, 46), CPos.New(43, 46) }
|
||||
|
||||
EvacuateCivilians = function()
|
||||
local evacuees = Reinforcements.Reinforce(neutral, CivilianEvacuees, { HospitalCivilianSpawnPoint.Location }, 0)
|
||||
local evacuees = Reinforcements.Reinforce(Neutral, CivilianEvacuees, { HospitalCivilianSpawnPoint.Location }, 0)
|
||||
|
||||
Trigger.OnAnyKilled(evacuees, function()
|
||||
player.MarkFailedObjective(RescueCivilians)
|
||||
Greece.MarkFailedObjective(RescueCivilians)
|
||||
end)
|
||||
Trigger.OnAllRemovedFromWorld(evacuees, function()
|
||||
player.MarkCompletedObjective(RescueCivilians)
|
||||
Greece.MarkCompletedObjective(RescueCivilians)
|
||||
end)
|
||||
|
||||
Utils.Do(evacuees, function(civ)
|
||||
@@ -51,33 +51,33 @@ EvacuateCivilians = function()
|
||||
end
|
||||
|
||||
SpawnAndMoveAlliedBaseUnits = function()
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Reinforcements.Reinforce(player, ReinforceBaseUnits, { AlliedBaseEntryPoint.Location, AlliedBaseMovePoint.Location }, 18)
|
||||
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
|
||||
Reinforcements.Reinforce(Greece, ReinforceBaseUnits, { AlliedBaseEntryPoint.Location, AlliedBaseMovePoint.Location }, 18)
|
||||
end
|
||||
|
||||
SetupAlliedBase = function()
|
||||
local alliedOutpost = Map.ActorsInBox(AlliedBaseTopLeft.CenterPosition, AlliedBaseBottomRight.CenterPosition,
|
||||
function(self) return self.Owner == outpost end)
|
||||
function(self) return self.Owner == Outpost end)
|
||||
|
||||
Media.PlaySoundNotification(player, "BaseSetup")
|
||||
Media.PlaySoundNotification(Greece, "BaseSetup")
|
||||
Utils.Do(alliedOutpost, function(building)
|
||||
building.Owner = player
|
||||
building.Owner = Greece
|
||||
end)
|
||||
|
||||
AlliedBaseHarv.Owner = player
|
||||
AlliedBaseHarv.Owner = Greece
|
||||
AlliedBaseHarv.FindResources()
|
||||
|
||||
FindDemitri = AddPrimaryObjective(player, "find-demitri")
|
||||
InfiltrateRadarDome = AddPrimaryObjective(player, "reprogram-super-tanks")
|
||||
DefendOutpost = AddSecondaryObjective(player, "defend-outpost")
|
||||
player.MarkCompletedObjective(FindOutpost)
|
||||
FindDemitri = AddPrimaryObjective(Greece, "find-demitri")
|
||||
InfiltrateRadarDome = AddPrimaryObjective(Greece, "reprogram-super-tanks")
|
||||
DefendOutpost = AddSecondaryObjective(Greece, "defend-outpost")
|
||||
Greece.MarkCompletedObjective(FindOutpost)
|
||||
|
||||
-- Don't fail the Objective instantly
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
|
||||
-- The actor might have been destroyed/crushed in this one second delay
|
||||
local actors = Utils.Where(alliedOutpost, function(actor) return actor.IsInWorld end)
|
||||
Trigger.OnAllRemovedFromWorld(actors, function() player.MarkFailedObjective(DefendOutpost) end)
|
||||
Trigger.OnAllRemovedFromWorld(actors, function() Greece.MarkFailedObjective(DefendOutpost) end)
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(1) + DateTime.Seconds(40), function()
|
||||
@@ -111,10 +111,10 @@ SendAlliedUnits = function()
|
||||
|
||||
Camera.Position = StartEntryPoint.CenterPosition
|
||||
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
|
||||
Utils.Do(AlliedUnits, function(table)
|
||||
Trigger.AfterDelay(table.delay, function()
|
||||
local units = Reinforcements.Reinforce(player, table.types, { StartEntryPoint.Location, StartMovePoint.Location }, 18)
|
||||
local units = Reinforcements.Reinforce(Greece, table.types, { StartEntryPoint.Location, StartMovePoint.Location }, 18)
|
||||
|
||||
Utils.Do(units, function(unit)
|
||||
if unit.Type == "e6" then
|
||||
@@ -122,7 +122,7 @@ SendAlliedUnits = function()
|
||||
Trigger.OnKilled(unit, LandingPossible)
|
||||
elseif unit.Type == "thf" then
|
||||
Trigger.OnKilled(unit, function()
|
||||
player.MarkFailedObjective(StealMoney)
|
||||
Greece.MarkFailedObjective(StealMoney)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
@@ -133,15 +133,15 @@ SendAlliedUnits = function()
|
||||
end
|
||||
|
||||
LandingPossible = function()
|
||||
if not beachReached and (USSRSpen.IsDead or Engineer.IsDead) and LstProduced < 1 then
|
||||
player.MarkFailedObjective(CrossRiver)
|
||||
if not BeachReached and (USSRSpen.IsDead or Engineer.IsDead) and LstProduced < 1 then
|
||||
Greece.MarkFailedObjective(CrossRiver)
|
||||
end
|
||||
end
|
||||
|
||||
SuperTankDomeInfiltrated = function()
|
||||
SuperTankAttack = true
|
||||
Utils.Do(SuperTanks, function(tnk)
|
||||
tnk.Owner = friendlyMadTanks
|
||||
tnk.Owner = FriendlyMadTanks
|
||||
if not tnk.IsDead then
|
||||
tnk.GrantCondition("friendly")
|
||||
Trigger.ClearAll(tnk)
|
||||
@@ -169,29 +169,29 @@ SuperTankDomeInfiltrated = function()
|
||||
end
|
||||
end)
|
||||
|
||||
player.MarkCompletedObjective(InfiltrateRadarDome)
|
||||
Greece.MarkCompletedObjective(InfiltrateRadarDome)
|
||||
Trigger.AfterDelay(DateTime.Minutes(3), SuperTanksDestruction)
|
||||
ticked = DateTime.Minutes(3)
|
||||
Ticked = DateTime.Minutes(3)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
Media.PlaySpeechNotification(player, "ControlCenterDeactivated")
|
||||
Media.PlaySpeechNotification(Greece, "ControlCenterDeactivated")
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(4), function()
|
||||
Media.DisplayMessage(UserInterface.Translate("super-tank-self-destruct-t-minus-3"))
|
||||
Media.PlaySpeechNotification(player, "WarningThreeMinutesRemaining")
|
||||
Media.PlaySpeechNotification(Greece, "WarningThreeMinutesRemaining")
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
SuperTanksDestruction = function()
|
||||
local badGuys = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == badguy and self.HasProperty("Health") end)
|
||||
local badGuys = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == BadGuy and self.HasProperty("Health") end)
|
||||
Utils.Do(badGuys, function(unit)
|
||||
unit.Kill()
|
||||
end)
|
||||
|
||||
Utils.Do(SuperTanks, function(tnk)
|
||||
if not tnk.IsDead then
|
||||
local camera = Actor.Create("camera", true, { Owner = player, Location = tnk.Location })
|
||||
local camera = Actor.Create("camera", true, { Owner = Greece, Location = tnk.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), camera.Destroy)
|
||||
|
||||
Trigger.ClearAll(tnk)
|
||||
@@ -199,31 +199,31 @@ SuperTanksDestruction = function()
|
||||
end
|
||||
end)
|
||||
|
||||
player.MarkCompletedObjective(DefendOutpost)
|
||||
Greece.MarkCompletedObjective(DefendOutpost)
|
||||
end
|
||||
|
||||
CreateDemitri = function()
|
||||
local demitri = Actor.Create("demitri", true, { Owner = player, Location = DemitriChurchSpawnPoint.Location })
|
||||
local demitri = Actor.Create("demitri", true, { Owner = Greece, Location = DemitriChurchSpawnPoint.Location })
|
||||
demitri.Move(DemitriTriggerAreaCenter.Location)
|
||||
|
||||
Media.PlaySpeechNotification(player, "TargetFreed")
|
||||
EvacuateDemitri = AddPrimaryObjective(player, "evacuate-demitri")
|
||||
player.MarkCompletedObjective(FindDemitri)
|
||||
Media.PlaySpeechNotification(Greece, "TargetFreed")
|
||||
EvacuateDemitri = AddPrimaryObjective(Greece, "evacuate-demitri")
|
||||
Greece.MarkCompletedObjective(FindDemitri)
|
||||
|
||||
local flarepos = CPos.New(DemitriLZ.Location.X, DemitriLZ.Location.Y - 1)
|
||||
local demitriLZFlare = Actor.Create("flare", true, { Owner = player, Location = flarepos })
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function() Media.PlaySpeechNotification(player, "SignalFlareNorth") end)
|
||||
local demitriLZFlare = Actor.Create("flare", true, { Owner = Greece, Location = flarepos })
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function() Media.PlaySpeechNotification(Greece, "SignalFlareNorth") end)
|
||||
|
||||
local demitriChinook = Reinforcements.ReinforceWithTransport(player, ExtractionHeli, nil, { ExtractionWaypoint, ExtractionLZ })[1]
|
||||
local demitriChinook = Reinforcements.ReinforceWithTransport(Greece, ExtractionHeli, nil, { ExtractionWaypoint, ExtractionLZ })[1]
|
||||
|
||||
Trigger.OnAnyKilled({ demitri, demitriChinook }, function()
|
||||
player.MarkFailedObjective(EvacuateDemitri)
|
||||
Greece.MarkFailedObjective(EvacuateDemitri)
|
||||
end)
|
||||
|
||||
Trigger.OnRemovedFromWorld(demitriChinook, function()
|
||||
if not demitriChinook.IsDead then
|
||||
Media.PlaySpeechNotification(player, "TargetRescued")
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() player.MarkCompletedObjective(EvacuateDemitri) end)
|
||||
Media.PlaySpeechNotification(Greece, "TargetRescued")
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() Greece.MarkCompletedObjective(EvacuateDemitri) end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), SpawnAndMoveAlliedBaseUnits)
|
||||
end
|
||||
end)
|
||||
@@ -236,27 +236,27 @@ CreateDemitri = function()
|
||||
end)
|
||||
end
|
||||
|
||||
ticked = -1
|
||||
Ticked = -1
|
||||
Tick = function()
|
||||
ussr.Resources = ussr.Resources - (0.01 * ussr.ResourceCapacity / 25)
|
||||
USSR.Resources = USSR.Resources - (0.01 * USSR.ResourceCapacity / 25)
|
||||
|
||||
if InitialUnitsArrived then -- don't fail the mission straight at the beginning
|
||||
if not DemitriFound or not SuperTankDomeIsInfiltrated then
|
||||
if player.HasNoRequiredUnits() then
|
||||
player.MarkFailedObjective(EliminateSuperTanks)
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
Greece.MarkFailedObjective(EliminateSuperTanks)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if ticked > 0 then
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("super-tank-self-destruct-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if Ticked > 0 then
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("super-tank-self-destruct-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()
|
||||
ticked = ticked - 1
|
||||
Ticked = Ticked - 1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -273,67 +273,67 @@ FinishTimer = function()
|
||||
end
|
||||
|
||||
SetupMission = function()
|
||||
TestCamera = Actor.Create("camera" ,true , { Owner = player, Location = ProvingGroundsCameraPoint.Location })
|
||||
TestCamera = Actor.Create("camera" ,true , { Owner = Greece, Location = ProvingGroundsCameraPoint.Location })
|
||||
Camera.Position = ProvingGroundsCameraPoint.CenterPosition
|
||||
TimerColor = player.Color
|
||||
TimerColor = Greece.Color
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(12), function()
|
||||
Media.PlaySpeechNotification(player, "StartGame")
|
||||
Media.PlaySpeechNotification(Greece, "StartGame")
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), SendAlliedUnits)
|
||||
end)
|
||||
end
|
||||
|
||||
InitPlayers = function()
|
||||
player = Player.GetPlayer("Greece")
|
||||
neutral = Player.GetPlayer("Neutral")
|
||||
outpost = Player.GetPlayer("Outpost")
|
||||
badguy = Player.GetPlayer("BadGuy")
|
||||
ussr = Player.GetPlayer("USSR")
|
||||
ukraine = Player.GetPlayer("Ukraine")
|
||||
turkey = Player.GetPlayer("Turkey")
|
||||
friendlyMadTanks = Player.GetPlayer("FriendlyMadTanks")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
Neutral = Player.GetPlayer("Neutral")
|
||||
Outpost = Player.GetPlayer("Outpost")
|
||||
BadGuy = Player.GetPlayer("BadGuy")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Ukraine = Player.GetPlayer("Ukraine")
|
||||
Turkey = Player.GetPlayer("Turkey")
|
||||
FriendlyMadTanks = Player.GetPlayer("FriendlyMadTanks")
|
||||
|
||||
ussr.Cash = 2000
|
||||
Trigger.AfterDelay(0, function() badguy.Resources = badguy.ResourceCapacity * 0.75 end)
|
||||
USSR.Cash = 2000
|
||||
Trigger.AfterDelay(0, function() BadGuy.Resources = BadGuy.ResourceCapacity * 0.75 end)
|
||||
end
|
||||
|
||||
AddObjectives = function()
|
||||
InitObjectives(player)
|
||||
InitObjectives(Greece)
|
||||
|
||||
EliminateSuperTanks = AddPrimaryObjective(player, "eliminate-super-tanks")
|
||||
StealMoney = AddPrimaryObjective(player, "steal-money-outpost")
|
||||
CrossRiver = AddPrimaryObjective(player, "cross-river")
|
||||
FindOutpost = AddPrimaryObjective(player, "find-outpost")
|
||||
RescueCivilians = AddSecondaryObjective(player, "evacuate-civilian-hospital")
|
||||
BadGuyObj = AddPrimaryObjective(badguy, "")
|
||||
USSRObj = AddPrimaryObjective(ussr, "")
|
||||
UkraineObj = AddPrimaryObjective(ukraine, "")
|
||||
TurkeyObj = AddPrimaryObjective(turkey, "")
|
||||
EliminateSuperTanks = AddPrimaryObjective(Greece, "eliminate-super-tanks")
|
||||
StealMoney = AddPrimaryObjective(Greece, "steal-money-outpost")
|
||||
CrossRiver = AddPrimaryObjective(Greece, "cross-river")
|
||||
FindOutpost = AddPrimaryObjective(Greece, "find-outpost")
|
||||
RescueCivilians = AddSecondaryObjective(Greece, "evacuate-civilian-hospital")
|
||||
BadGuyObj = AddPrimaryObjective(BadGuy, "")
|
||||
USSRObj = AddPrimaryObjective(USSR, "")
|
||||
UkraineObj = AddPrimaryObjective(Ukraine, "")
|
||||
TurkeyObj = AddPrimaryObjective(Turkey, "")
|
||||
|
||||
Trigger.OnPlayerLost(player, function()
|
||||
ussr.MarkCompletedObjective(USSRObj)
|
||||
badguy.MarkCompletedObjective(BadGuyObj)
|
||||
ukraine.MarkCompletedObjective(UkraineObj)
|
||||
turkey.MarkCompletedObjective(TurkeyObj)
|
||||
Trigger.OnPlayerLost(Greece, function()
|
||||
USSR.MarkCompletedObjective(USSRObj)
|
||||
BadGuy.MarkCompletedObjective(BadGuyObj)
|
||||
Ukraine.MarkCompletedObjective(UkraineObj)
|
||||
Turkey.MarkCompletedObjective(TurkeyObj)
|
||||
end)
|
||||
|
||||
Trigger.OnPlayerWon(player, function()
|
||||
Trigger.OnPlayerWon(Greece, function()
|
||||
Media.DisplayMessage(UserInterface.Translate("demitri-extracted-super-tanks-destroyed"))
|
||||
ussr.MarkFailedObjective(USSRObj)
|
||||
badguy.MarkFailedObjective(BadGuyObj)
|
||||
ukraine.MarkFailedObjective(UkraineObj)
|
||||
turkey.MarkFailedObjective(TurkeyObj)
|
||||
USSR.MarkFailedObjective(USSRObj)
|
||||
BadGuy.MarkFailedObjective(BadGuyObj)
|
||||
Ukraine.MarkFailedObjective(UkraineObj)
|
||||
Turkey.MarkFailedObjective(TurkeyObj)
|
||||
end)
|
||||
end
|
||||
|
||||
InitTriggers = function()
|
||||
Trigger.OnAllKilled(SuperTanks, function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function() player.MarkCompletedObjective(EliminateSuperTanks) end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function() Greece.MarkCompletedObjective(EliminateSuperTanks) end)
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(SuperTankDome, function()
|
||||
if not SuperTankDomeIsInfiltrated then
|
||||
player.MarkFailedObjective(InfiltrateRadarDome)
|
||||
Greece.MarkFailedObjective(InfiltrateRadarDome)
|
||||
end
|
||||
end)
|
||||
Trigger.OnInfiltrated(SuperTankDome, function()
|
||||
@@ -361,46 +361,46 @@ InitTriggers = function()
|
||||
|
||||
Trigger.OnKilled(DemitriChurch, function()
|
||||
if not DemitriFound then
|
||||
player.MarkFailedObjective(FindDemitri)
|
||||
Greece.MarkFailedObjective(FindDemitri)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Hospital, function()
|
||||
if not HospitalEvacuated then
|
||||
HospitalEvacuated = true
|
||||
player.MarkFailedObjective(RescueCivilians)
|
||||
Greece.MarkFailedObjective(RescueCivilians)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnInfiltrated(USSROutpostSilo, function()
|
||||
MoneyStolen = true
|
||||
player.MarkCompletedObjective(StealMoney)
|
||||
Greece.MarkCompletedObjective(StealMoney)
|
||||
end)
|
||||
|
||||
Trigger.OnKilledOrCaptured(USSROutpostSilo, function()
|
||||
if not MoneyStolen then
|
||||
player.MarkFailedObjective(StealMoney)
|
||||
Greece.MarkFailedObjective(StealMoney)
|
||||
end
|
||||
end)
|
||||
|
||||
beachReached = false
|
||||
BeachReached = false
|
||||
Trigger.OnEnteredFootprint(BeachTrigger, function(a, id)
|
||||
if not beachReached and a.Owner == player then
|
||||
beachReached = true
|
||||
if not BeachReached and a.Owner == Greece then
|
||||
BeachReached = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
player.MarkCompletedObjective(CrossRiver)
|
||||
Greece.MarkCompletedObjective(CrossRiver)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnPlayerDiscovered(outpost, function(_, discoverer)
|
||||
if not outpostReached and discoverer == player then
|
||||
outpostReached = true
|
||||
Trigger.OnPlayerDiscovered(Outpost, function(_, discoverer)
|
||||
if not OutpostReached and discoverer == Greece then
|
||||
OutpostReached = true
|
||||
SetupAlliedBase()
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(DemitriAreaTrigger, function(a, id)
|
||||
if not DemitriFound and a.Owner == player then
|
||||
if not DemitriFound and a.Owner == Greece then
|
||||
DemitriFound = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
CreateDemitri()
|
||||
@@ -408,7 +408,7 @@ InitTriggers = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(HospitalAreaTrigger, function(a, id)
|
||||
if not HospitalEvacuated and a.Owner == player then
|
||||
if not HospitalEvacuated and a.Owner == Greece then
|
||||
HospitalEvacuated = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
EvacuateCivilians()
|
||||
|
||||
@@ -200,7 +200,7 @@ end
|
||||
|
||||
UnitsArrived = false
|
||||
TimerFinished = false
|
||||
ticked = TimerTicks
|
||||
Ticked = TimerTicks
|
||||
Tick = function()
|
||||
if BadGuy.PowerState ~= "Normal" then
|
||||
PowerDownTeslas()
|
||||
@@ -210,13 +210,13 @@ Tick = function()
|
||||
USSR.MarkCompletedObjective(EscapeWithSub)
|
||||
end
|
||||
|
||||
if ticked > 0 then
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("submarine-completes-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if Ticked > 0 then
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("submarine-completes-in", { ["time"] = Utils.FormatTime(Ticked) })
|
||||
UserInterface.SetMissionText(Timer, TimerColor)
|
||||
end
|
||||
ticked = ticked - 1
|
||||
elseif ticked == 0 and not TimerFinished then
|
||||
Ticked = Ticked - 1
|
||||
elseif Ticked == 0 and not TimerFinished then
|
||||
MissileSubEscape()
|
||||
TimerFinished = true
|
||||
end
|
||||
|
||||
@@ -48,11 +48,11 @@ SendBGAttackGroup = function()
|
||||
end
|
||||
|
||||
ProduceBadGuyInfantry = function()
|
||||
if BadGuyRax.IsDead or BadGuyRax.Owner ~= badguy then
|
||||
if BadGuyRax.IsDead or BadGuyRax.Owner ~= BadGuy then
|
||||
return
|
||||
end
|
||||
|
||||
badguy.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
BadGuy.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
table.insert(BGAttackGroup, units[1])
|
||||
SendBGAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceBadGuyInfantry)
|
||||
@@ -74,11 +74,11 @@ SendAttackGroup = function()
|
||||
end
|
||||
|
||||
ProduceUSSRInfantry = function()
|
||||
if USSRRax.IsDead or USSRRax.Owner ~= ussr then
|
||||
if USSRRax.IsDead or USSRRax.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
USSR.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRInfantry)
|
||||
@@ -86,11 +86,11 @@ ProduceUSSRInfantry = function()
|
||||
end
|
||||
|
||||
ProduceVehicles = function()
|
||||
if USSRWarFactory.IsDead or USSRWarFactory.Owner ~= ussr then
|
||||
if USSRWarFactory.IsDead or USSRWarFactory.Owner ~= USSR then
|
||||
return
|
||||
end
|
||||
|
||||
ussr.Build({ Utils.Random(SovietVehicles) }, function(units)
|
||||
USSR.Build({ Utils.Random(SovietVehicles) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles)
|
||||
@@ -98,7 +98,7 @@ ProduceVehicles = function()
|
||||
end
|
||||
|
||||
GroundWaves = function()
|
||||
Reinforcements.Reinforce(ussr, Utils.Random(GroundAttackUnits), Utils.Random(GroundAttackPaths), 0, function(unit)
|
||||
Reinforcements.Reinforce(USSR, Utils.Random(GroundAttackUnits), Utils.Random(GroundAttackPaths), 0, function(unit)
|
||||
unit.Hunt()
|
||||
end)
|
||||
|
||||
|
||||
@@ -25,28 +25,28 @@ CombatTeam2 =
|
||||
|
||||
SetupTriggers = function()
|
||||
Trigger.OnInfiltrated(RadarDome, function()
|
||||
greece.MarkCompletedObjective(objRadarSpy)
|
||||
Actor.Create("camera", true, { Owner = greece, Location = Cam1.Location })
|
||||
Actor.Create("camera", true, { Owner = greece, Location = Cam2.Location })
|
||||
Actor.Create("camera", true, { Owner = greece, Location = Cam3.Location })
|
||||
Actor.Create("camera", true, { Owner = greece, Location = Cam4.Location })
|
||||
Greece.MarkCompletedObjective(RadarSpyObjective)
|
||||
Actor.Create("camera", true, { Owner = Greece, Location = Cam1.Location })
|
||||
Actor.Create("camera", true, { Owner = Greece, Location = Cam2.Location })
|
||||
Actor.Create("camera", true, { Owner = Greece, Location = Cam3.Location })
|
||||
Actor.Create("camera", true, { Owner = Greece, Location = Cam4.Location })
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(RadarDome, function()
|
||||
if not greece.IsObjectiveCompleted(objRadarSpy) then
|
||||
greece.MarkFailedObjective(objRadarSpy)
|
||||
if not Greece.IsObjectiveCompleted(RadarSpyObjective) then
|
||||
Greece.MarkFailedObjective(RadarSpyObjective)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(ConvoyTrucks, function()
|
||||
greece.MarkCompletedObjective(objDestroyAllTrucks)
|
||||
Greece.MarkCompletedObjective(DestroyAllTrucksObjective)
|
||||
end)
|
||||
end
|
||||
|
||||
MissionStart = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Reinforcements.Reinforce(greece, CombatTeam1, { TruckEscapeCenter.Location, DefaultCameraPosition.Location })
|
||||
local StartCamera = Actor.Create("camera", true, { Owner = greece, Location = DefaultCameraPosition.Location })
|
||||
Reinforcements.Reinforce(Greece, CombatTeam1, { TruckEscapeCenter.Location, DefaultCameraPosition.Location })
|
||||
local StartCamera = Actor.Create("camera", true, { Owner = Greece, Location = DefaultCameraPosition.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
StartCamera.Destroy()
|
||||
end)
|
||||
@@ -87,8 +87,8 @@ MissionStart = function()
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), function()
|
||||
CombatTeam2 = CombatTeam2[Difficulty]
|
||||
Reinforcements.Reinforce(greece, CombatTeam2, { TruckEscapeCenter.Location, DefaultCameraPosition.Location })
|
||||
Media.PlaySpeechNotification(greece, "ReinforcementsArrived")
|
||||
Reinforcements.Reinforce(Greece, CombatTeam2, { TruckEscapeCenter.Location, DefaultCameraPosition.Location })
|
||||
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -103,7 +103,7 @@ MoveTruckEscapeRoute = function(truck, route)
|
||||
return
|
||||
else
|
||||
Media.DisplayMessage(UserInterface.Translate("convoy-truck-escaping"))
|
||||
Media.PlaySoundNotification(greece, "AlertBleep")
|
||||
Media.PlaySoundNotification(Greece, "AlertBleep")
|
||||
Utils.Do(route, function(waypoint)
|
||||
truck.Move(waypoint.Location)
|
||||
end)
|
||||
@@ -111,7 +111,7 @@ MoveTruckEscapeRoute = function(truck, route)
|
||||
Trigger.OnIdle(truck, function()
|
||||
if truck.Location == route[#route].Location then
|
||||
truck.Destroy()
|
||||
greece.MarkFailedObjective(objDestroyAllTrucks)
|
||||
Greece.MarkFailedObjective(DestroyAllTrucksObjective)
|
||||
else
|
||||
truck.Move(route[#route].Location)
|
||||
end
|
||||
@@ -120,29 +120,29 @@ MoveTruckEscapeRoute = function(truck, route)
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
ussr.Cash = 5000
|
||||
badguy.Cash = 5000
|
||||
USSR.Cash = 5000
|
||||
BadGuy.Cash = 5000
|
||||
|
||||
if ussr.HasNoRequiredUnits() and badguy.HasNoRequiredUnits() then
|
||||
greece.MarkCompletedObjective(objKillAll)
|
||||
if USSR.HasNoRequiredUnits() and BadGuy.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(KillAllObjective)
|
||||
end
|
||||
|
||||
if greece.HasNoRequiredUnits() then
|
||||
ussr.MarkCompletedObjective(ussrObj)
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
USSR.MarkCompletedObjective(USSRobjective)
|
||||
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")
|
||||
|
||||
InitObjectives(greece)
|
||||
InitObjectives(Greece)
|
||||
|
||||
objDestroyAllTrucks = AddPrimaryObjective(greece, "prevent-soviet-trucks-escaping")
|
||||
objKillAll = AddPrimaryObjective(greece, "clear-sector-soviet-presence")
|
||||
objRadarSpy = AddSecondaryObjective(greece, "infiltrate-radar-reveal-escape-routes")
|
||||
ussrObj = ussr.AddObjective("")
|
||||
DestroyAllTrucksObjective = AddPrimaryObjective(Greece, "prevent-soviet-trucks-escaping")
|
||||
KillAllObjective = AddPrimaryObjective(Greece, "clear-sector-soviet-presence")
|
||||
RadarSpyObjective = AddSecondaryObjective(Greece, "infiltrate-radar-reveal-escape-routes")
|
||||
USSRobjective = USSR.AddObjective("")
|
||||
|
||||
ActivateAI()
|
||||
SetupTriggers()
|
||||
|
||||
@@ -28,49 +28,49 @@ WinTriggerArea = { CPos.New(111, 59), CPos.New(111, 60), CPos.New(111, 61), CPos
|
||||
|
||||
ObjectiveTriggers = function()
|
||||
Trigger.OnEnteredFootprint(WinTriggerArea, function(a, id)
|
||||
if not EscapeGoalTrigger and a.Owner == greece then
|
||||
if not EscapeGoalTrigger and a.Owner == Greece then
|
||||
EscapeGoalTrigger = true
|
||||
|
||||
greece.MarkCompletedObjective(ExitBase)
|
||||
Greece.MarkCompletedObjective(ExitBase)
|
||||
if Difficulty == "hard" then
|
||||
greece.MarkCompletedObjective(NoCasualties)
|
||||
Greece.MarkCompletedObjective(NoCasualties)
|
||||
end
|
||||
|
||||
if not TanyaFreed then
|
||||
greece.MarkFailedObjective(FreeTanya)
|
||||
Greece.MarkFailedObjective(FreeTanyaObjective)
|
||||
else
|
||||
greece.MarkCompletedObjective(FreeTanya)
|
||||
Greece.MarkCompletedObjective(FreeTanyaObjective)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Tanya, function()
|
||||
greece.MarkFailedObjective(FreeTanya)
|
||||
Greece.MarkFailedObjective(FreeTanyaObjective)
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(TanyaTowers, function()
|
||||
TanyaFreed = true
|
||||
if not Tanya.IsDead then
|
||||
Media.PlaySpeechNotification(greece, "TanyaRescued")
|
||||
Tanya.Owner = greece
|
||||
Media.PlaySpeechNotification(Greece, "TanyaRescued")
|
||||
Tanya.Owner = Greece
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(SovietImportantGuys, function()
|
||||
greece.MarkCompletedObjective(KillVIPs)
|
||||
Greece.MarkCompletedObjective(KillVIPs)
|
||||
end)
|
||||
|
||||
Trigger.OnInfiltrated(WarFactory2, function()
|
||||
if not StealMammoth.IsDead or StealMammoth.Owner == ussr then
|
||||
greece.MarkCompletedObjective(StealTank)
|
||||
StealMammoth.Owner = greece
|
||||
if not StealMammoth.IsDead or StealMammoth.Owner == USSR then
|
||||
Greece.MarkCompletedObjective(StealTank)
|
||||
StealMammoth.Owner = Greece
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
ConsoleTriggers = function()
|
||||
Trigger.OnEnteredProximityTrigger(Terminal1.CenterPosition, WDist.FromCells(1), function(actor, id)
|
||||
if actor.Owner == greece then
|
||||
if actor.Owner == Greece then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
if not FlameTower1.IsDead then
|
||||
Media.DisplayMessage(UserInterface.Translate("flame-turret-deactivated"), UserInterface.Translate("console"))
|
||||
@@ -80,7 +80,7 @@ ConsoleTriggers = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(Terminal2.CenterPosition, WDist.FromCells(1), function(actor, id)
|
||||
if actor.Owner == greece then
|
||||
if actor.Owner == Greece then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
if not FlameTower2.IsDead then
|
||||
Media.DisplayMessage(UserInterface.Translate("flame-turret-deactivated"), UserInterface.Translate("console"))
|
||||
@@ -90,7 +90,7 @@ ConsoleTriggers = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(Terminal3.CenterPosition, WDist.FromCells(1), function(actor, id)
|
||||
if actor.Owner == greece then
|
||||
if actor.Owner == Greece then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
if not FlameTower3.IsDead then
|
||||
Media.DisplayMessage(UserInterface.Translate("flame-turret-deactivated"), UserInterface.Translate("console"))
|
||||
@@ -101,16 +101,16 @@ ConsoleTriggers = function()
|
||||
|
||||
local gasActive
|
||||
Trigger.OnEnteredProximityTrigger(Terminal4.CenterPosition, WDist.FromCells(1), function(actor, id)
|
||||
if actor.Owner == greece and not gasActive then
|
||||
if actor.Owner == Greece and not gasActive then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
gasActive = true
|
||||
|
||||
Media.DisplayMessage(UserInterface.Translate("sarin-dispenser-activated"), UserInterface.Translate("console"))
|
||||
local KillCamera = Actor.Create("camera", true, { Owner = greece, Location = Sarin2.Location })
|
||||
local flare1 = Actor.Create("flare", true, { Owner = england, Location = Sarin1.Location })
|
||||
local flare2 = Actor.Create("flare", true, { Owner = england, Location = Sarin2.Location })
|
||||
local flare3 = Actor.Create("flare", true, { Owner = england, Location = Sarin3.Location })
|
||||
local flare4 = Actor.Create("flare", true, { Owner = england, Location = Sarin4.Location })
|
||||
local KillCamera = Actor.Create("camera", true, { Owner = Greece, Location = Sarin2.Location })
|
||||
local flare1 = Actor.Create("flare", true, { Owner = England, Location = Sarin1.Location })
|
||||
local flare2 = Actor.Create("flare", true, { Owner = England, Location = Sarin2.Location })
|
||||
local flare3 = Actor.Create("flare", true, { Owner = England, Location = Sarin3.Location })
|
||||
local flare4 = Actor.Create("flare", true, { Owner = England, Location = Sarin4.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(4), function()
|
||||
Utils.Do(SarinVictims, function(actor)
|
||||
if not actor.IsDead then
|
||||
@@ -130,7 +130,7 @@ ConsoleTriggers = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(Terminal5.CenterPosition, WDist.FromCells(1), function(actor, id)
|
||||
if actor.Owner == greece then
|
||||
if actor.Owner == Greece then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
if not BadCoil.IsDead then
|
||||
Media.DisplayMessage(UserInterface.Translate("tesla-coil-deactivated"), UserInterface.Translate("console"))
|
||||
@@ -141,13 +141,13 @@ ConsoleTriggers = function()
|
||||
|
||||
local teslaActive
|
||||
Trigger.OnEnteredProximityTrigger(Terminal6.CenterPosition, WDist.FromCells(1), function(actor, id)
|
||||
if actor.Owner == greece and not teslaActive then
|
||||
if actor.Owner == Greece and not teslaActive then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
teslaActive = true
|
||||
|
||||
Media.DisplayMessage(UserInterface.Translate("tesla-coil-activated"), UserInterface.Translate("console"))
|
||||
local tesla1 = Actor.Create("tsla", true, { Owner = turkey, Location = TurkeyCoil1.Location })
|
||||
local tesla2 = Actor.Create("tsla", true, { Owner = turkey, Location = TurkeyCoil2.Location })
|
||||
local tesla1 = Actor.Create("tsla", true, { Owner = Turkey, Location = TurkeyCoil1.Location })
|
||||
local tesla2 = Actor.Create("tsla", true, { Owner = Turkey, Location = TurkeyCoil2.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
if not tesla1.IsDead then
|
||||
tesla1.Kill()
|
||||
@@ -160,7 +160,7 @@ ConsoleTriggers = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(Terminal7.CenterPosition, WDist.FromCells(1), function(actor, id)
|
||||
if actor.Owner == greece then
|
||||
if actor.Owner == Greece then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
if not FlameTowerTanya1.IsDead then
|
||||
Media.DisplayMessage(UserInterface.Translate("flame-turret-deactivated"), UserInterface.Translate("console"))
|
||||
@@ -174,7 +174,7 @@ ConsoleTriggers = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(Terminal8.CenterPosition, WDist.FromCells(1), function(actor, id)
|
||||
if actor.Owner == greece then
|
||||
if actor.Owner == Greece then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
if not FlameTowerExit1.IsDead then
|
||||
Media.DisplayMessage(UserInterface.Translate("flame-turret-deactivated"), UserInterface.Translate("console"))
|
||||
@@ -190,7 +190,7 @@ end
|
||||
|
||||
CameraTriggers = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
local startCamera = Actor.Create("camera", true, { Owner = greece, Location = start.Location })
|
||||
local startCamera = Actor.Create("camera", true, { Owner = Greece, Location = start.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
startCamera.Destroy()
|
||||
end)
|
||||
@@ -198,11 +198,11 @@ CameraTriggers = function()
|
||||
|
||||
local cam1Triggered
|
||||
Trigger.OnEnteredProximityTrigger(CameraTrigger1.CenterPosition, WDist.FromCells(8), function(actor, id)
|
||||
if actor.Owner == greece and not cam1Triggered then
|
||||
if actor.Owner == Greece and not cam1Triggered then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
cam1Triggered = true
|
||||
|
||||
local camera1 = Actor.Create("camera", true, { Owner = greece, Location = CameraTrigger1.Location })
|
||||
local camera1 = Actor.Create("camera", true, { Owner = Greece, Location = CameraTrigger1.Location })
|
||||
Trigger.OnAllKilled(Camera1Towers, function()
|
||||
camera1.Destroy()
|
||||
end)
|
||||
@@ -211,11 +211,11 @@ CameraTriggers = function()
|
||||
|
||||
local cam2Triggered
|
||||
Trigger.OnEnteredProximityTrigger(CameraTrigger2.CenterPosition, WDist.FromCells(8), function(actor, id)
|
||||
if actor.Owner == greece and not cam2Triggered then
|
||||
if actor.Owner == Greece and not cam2Triggered then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
cam2Triggered = true
|
||||
|
||||
local camera2 = Actor.Create("camera", true, { Owner = greece, Location = CameraTrigger2.Location })
|
||||
local camera2 = Actor.Create("camera", true, { Owner = Greece, Location = CameraTrigger2.Location })
|
||||
Utils.Do(Camera2Team, function(actor)
|
||||
actor.AttackMove(CameraTrigger1.Location)
|
||||
end)
|
||||
@@ -227,13 +227,13 @@ CameraTriggers = function()
|
||||
|
||||
local cam3Triggered
|
||||
Trigger.OnEnteredProximityTrigger(CameraTrigger3.CenterPosition, WDist.FromCells(8), function(actor, id)
|
||||
if actor.Owner == greece and not cam3Triggered then
|
||||
if actor.Owner == Greece and not cam3Triggered then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
cam3Triggered = true
|
||||
|
||||
local camera3 = Actor.Create("camera", true, { Owner = greece, Location = CameraTrigger3.Location })
|
||||
Actor.Create("apwr", true, { Owner = france, Location = PowerPlantSpawn1.Location })
|
||||
Actor.Create("apwr", true, { Owner = germany, Location = PowerPlantSpawn2.Location })
|
||||
local camera3 = Actor.Create("camera", true, { Owner = Greece, Location = CameraTrigger3.Location })
|
||||
Actor.Create("apwr", true, { Owner = France, Location = PowerPlantSpawn1.Location })
|
||||
Actor.Create("apwr", true, { Owner = Germany, Location = PowerPlantSpawn2.Location })
|
||||
if not Mammoth1.IsDead then
|
||||
Mammoth1.AttackMove(MammothGo.Location)
|
||||
end
|
||||
@@ -246,11 +246,11 @@ CameraTriggers = function()
|
||||
|
||||
local cam4Triggered
|
||||
Trigger.OnEnteredProximityTrigger(CameraTrigger4.CenterPosition, WDist.FromCells(9), function(actor, id)
|
||||
if actor.Owner == greece and not cam4Triggered then
|
||||
if actor.Owner == Greece and not cam4Triggered then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
cam4Triggered = true
|
||||
|
||||
local camera4 = Actor.Create("camera", true, { Owner = greece, Location = CameraTrigger4.Location })
|
||||
local camera4 = Actor.Create("camera", true, { Owner = Greece, Location = CameraTrigger4.Location })
|
||||
Trigger.OnKilled(Mammoth2, function()
|
||||
camera4.Destroy()
|
||||
end)
|
||||
@@ -259,11 +259,11 @@ CameraTriggers = function()
|
||||
|
||||
local cam5Triggered
|
||||
Trigger.OnEnteredProximityTrigger(CameraTrigger5.CenterPosition, WDist.FromCells(8), function(actor, id)
|
||||
if actor.Owner == greece and not cam5Triggered then
|
||||
if actor.Owner == Greece and not cam5Triggered then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
cam5Triggered = true
|
||||
|
||||
local camera5 = Actor.Create("camera", true, { Owner = greece, Location = CameraTrigger5.Location })
|
||||
local camera5 = Actor.Create("camera", true, { Owner = Greece, Location = CameraTrigger5.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
camera5.Destroy()
|
||||
end)
|
||||
@@ -272,21 +272,21 @@ CameraTriggers = function()
|
||||
|
||||
local cam6Triggered
|
||||
Trigger.OnEnteredProximityTrigger(CameraTrigger6.CenterPosition, WDist.FromCells(11), function(actor, id)
|
||||
if actor.Owner == greece and not cam6Triggered then
|
||||
if actor.Owner == Greece and not cam6Triggered then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
cam6Triggered = true
|
||||
|
||||
Actor.Create("camera", true, { Owner = greece, Location = CameraTrigger6.Location })
|
||||
Actor.Create("camera", true, { Owner = Greece, Location = CameraTrigger6.Location })
|
||||
end
|
||||
end)
|
||||
|
||||
local executionTriggered
|
||||
Trigger.OnEnteredFootprint(ExecutionArea, function(actor, id)
|
||||
if actor.Owner == greece and not executionTriggered then
|
||||
if actor.Owner == Greece and not executionTriggered then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
executionTriggered = true
|
||||
|
||||
local camera7 = Actor.Create("camera", true, { Owner = greece, Location = CameraTrigger7.Location })
|
||||
local camera7 = Actor.Create("camera", true, { Owner = Greece, Location = CameraTrigger7.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(25), function()
|
||||
camera7.Destroy()
|
||||
end)
|
||||
@@ -301,7 +301,7 @@ TruckSteal = function()
|
||||
if not TruckStolen and not StealTruck.IsDead then
|
||||
TruckStolen = true
|
||||
|
||||
local truckSteal1 = Actor.Create("camera", true, { Owner = greece, Location = TruckDrive1.Location })
|
||||
local truckSteal1 = Actor.Create("camera", true, { Owner = Greece, Location = TruckDrive1.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
truckSteal1.Destroy()
|
||||
end)
|
||||
@@ -326,8 +326,8 @@ TruckSteal = function()
|
||||
end
|
||||
|
||||
SpyTruckDrive = function()
|
||||
StealTruck = Reinforcements.Reinforce(ussr, TruckType, TruckEntry)
|
||||
local truckSteal2 = Actor.Create("camera", true, { Owner = greece, Location = TruckCamera.Location })
|
||||
StealTruck = Reinforcements.Reinforce(USSR, TruckType, TruckEntry)
|
||||
local truckSteal2 = Actor.Create("camera", true, { Owner = Greece, Location = TruckCamera.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
truckSteal2.Destroy()
|
||||
end)
|
||||
@@ -338,11 +338,11 @@ SpyTruckDrive = function()
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
spyCreated = true
|
||||
|
||||
Spy = Actor.Create("spy", true, { Owner = greece, Location = TruckDrive5.Location })
|
||||
Spy.DisguiseAsType("e1", ussr)
|
||||
Spy = Actor.Create("spy", true, { Owner = Greece, Location = TruckDrive5.Location })
|
||||
Spy.DisguiseAsType("e1", USSR)
|
||||
Spy.Move(SpyMove.Location)
|
||||
|
||||
local dogCrewCamera = Actor.Create("camera", true, { Owner = greece, Location = DoggyCam.Location })
|
||||
local dogCrewCamera = Actor.Create("camera", true, { Owner = Greece, Location = DoggyCam.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
dogCrewCamera.Destroy()
|
||||
end)
|
||||
@@ -367,13 +367,13 @@ PrisonEscape = function()
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
|
||||
Media.DisplayMessage(UserInterface.Translate("prisoners-escaping"), UserInterface.Translate("intercom"))
|
||||
Media.PlaySoundNotification(greece, "AlertBuzzer")
|
||||
Media.PlaySoundNotification(Greece, "AlertBuzzer")
|
||||
Utils.Do(GuardDogs, IdleHunt)
|
||||
end)
|
||||
end
|
||||
|
||||
ScientistExecution = function()
|
||||
Media.PlaySoundNotification(greece, "AlertBleep")
|
||||
Media.PlaySoundNotification(Greece, "AlertBleep")
|
||||
Media.DisplayMessage(UserInterface.Translate("hurry-base-compromised"), UserInterface.Translate("soviet-officer"))
|
||||
Utils.Do(DemoTeam, function(actor)
|
||||
actor.AttackMove(DemoDrive2.Location)
|
||||
@@ -440,35 +440,35 @@ end
|
||||
|
||||
AcceptableLosses = 0
|
||||
Tick = function()
|
||||
if greece.HasNoRequiredUnits() then
|
||||
greece.MarkFailedObjective(ExitBase)
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
Greece.MarkFailedObjective(ExitBase)
|
||||
end
|
||||
|
||||
if Difficulty == "hard" and greece.UnitsLost > AcceptableLosses then
|
||||
greece.MarkFailedObjective(NoCasualties)
|
||||
if Difficulty == "hard" and Greece.UnitsLost > AcceptableLosses then
|
||||
Greece.MarkFailedObjective(NoCasualties)
|
||||
end
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
greece = Player.GetPlayer("Greece")
|
||||
england = Player.GetPlayer("England")
|
||||
turkey = Player.GetPlayer("Turkey")
|
||||
ussr = Player.GetPlayer("USSR")
|
||||
france = Player.GetPlayer("France")
|
||||
germany = Player.GetPlayer("Germany")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
England = Player.GetPlayer("England")
|
||||
Turkey = Player.GetPlayer("Turkey")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
France = Player.GetPlayer("France")
|
||||
Germany = Player.GetPlayer("Germany")
|
||||
|
||||
InitObjectives(greece)
|
||||
InitObjectives(Greece)
|
||||
|
||||
ussrObj = ussr.AddObjective("")
|
||||
ExitBase = AddPrimaryObjective(greece, "reach-eastern-exit")
|
||||
FreeTanya = AddPrimaryObjective(greece, "free-tanya-keep-alive")
|
||||
KillVIPs = AddSecondaryObjective(greece, "kill-soviet-officers-scientists")
|
||||
StealTank = AddSecondaryObjective(greece, "steal-soviet-mammoth-tank")
|
||||
USSRobjective = USSR.AddObjective("")
|
||||
ExitBase = AddPrimaryObjective(Greece, "reach-eastern-exit")
|
||||
FreeTanyaObjective = AddPrimaryObjective(Greece, "free-tanya-keep-alive")
|
||||
KillVIPs = AddSecondaryObjective(Greece, "kill-soviet-officers-scientists")
|
||||
StealTank = AddSecondaryObjective(Greece, "steal-soviet-mammoth-tank")
|
||||
if Difficulty == "hard" then
|
||||
NoCasualties = AddPrimaryObjective(greece, "no-casualties")
|
||||
NoCasualties = AddPrimaryObjective(Greece, "no-casualties")
|
||||
end
|
||||
|
||||
StartSpy.DisguiseAsType("e1", ussr)
|
||||
StartSpy.DisguiseAsType("e1", USSR)
|
||||
StartAttacker1.AttackMove(start.Location)
|
||||
StartAttacker2.AttackMove(start.Location)
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@ MissionStart = function()
|
||||
TroopsArrived = true
|
||||
end)
|
||||
|
||||
InfantryProduction()
|
||||
ProduceInfantry()
|
||||
end
|
||||
|
||||
InfantryProduction = function()
|
||||
ProduceInfantry = function()
|
||||
if (SETent1.IsDead or SETent1.Owner ~= Greece) and (SETent2.IsDead or SETent2.Owner ~= Greece) then
|
||||
return
|
||||
end
|
||||
@@ -56,7 +56,7 @@ InfantryProduction = function()
|
||||
|
||||
Greece.Build(toBuild, function(unit)
|
||||
IdlingUnits[#IdlingUnits + 1] = unit[1]
|
||||
Trigger.AfterDelay(InfantryDelay, InfantryProduction)
|
||||
Trigger.AfterDelay(InfantryDelay, ProduceInfantry)
|
||||
|
||||
if #IdlingUnits >= (AttackGroupSize * 1.5) then
|
||||
SendAttack()
|
||||
|
||||
@@ -217,16 +217,16 @@ FinishTimer = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(6), function() UserInterface.SetMissionText("") end)
|
||||
end
|
||||
|
||||
ticked = TimerTicks
|
||||
Ticked = TimerTicks
|
||||
ConvoysSent = false
|
||||
Tick = function()
|
||||
if ticked > 0 then
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("first-trucks-arrive-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if Ticked > 0 then
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("first-trucks-arrive-in", { ["time"] = Utils.FormatTime(Ticked) })
|
||||
UserInterface.SetMissionText(Timer, TimerColor)
|
||||
end
|
||||
ticked = ticked - 1
|
||||
elseif ticked == 0 and not ConvoysSent then
|
||||
Ticked = Ticked - 1
|
||||
elseif Ticked == 0 and not ConvoysSent then
|
||||
SendConvoys()
|
||||
FinishTimer()
|
||||
end
|
||||
|
||||
@@ -150,19 +150,19 @@ SendInVolkov = function()
|
||||
end
|
||||
end
|
||||
|
||||
ticked = TimerTicks
|
||||
Ticked = TimerTicks
|
||||
Tick = function()
|
||||
if Turkey.PowerState ~= "Normal" then
|
||||
SendInVolkov()
|
||||
end
|
||||
|
||||
if ticked > 0 then
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("missiles-launch-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if Ticked > 0 then
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("missiles-launch-in", { ["time"] = Utils.FormatTime(Ticked) })
|
||||
UserInterface.SetMissionText(Timer, TimerColor)
|
||||
end
|
||||
ticked = ticked - 1
|
||||
elseif ticked == 0 then
|
||||
Ticked = Ticked - 1
|
||||
elseif Ticked == 0 then
|
||||
UserInterface.SetMissionText(UserInterface.Translate("too-late"), USSR.Color)
|
||||
Turkey.MarkCompletedObjective(LaunchMissles)
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@ InsertYaks = function()
|
||||
Utils.Do(Yaks, function(yakType)
|
||||
local start = YakEntry.CenterPosition + WVec.New(0, (i - 1) * 1536, Actor.CruiseAltitude(yakType))
|
||||
local dest = StartJeep.Location + CVec.New(0, 2 * i)
|
||||
local yak = Actor.Create(yakType, true, { CenterPosition = start, Owner = player, Facing = (Map.CenterOfCell(dest) - start).Facing })
|
||||
local yak = Actor.Create(yakType, true, { CenterPosition = start, Owner = USSR, Facing = (Map.CenterOfCell(dest) - start).Facing })
|
||||
yak.Move(dest)
|
||||
yak.ReturnToBase(Airfields[i])
|
||||
i = i + 1
|
||||
@@ -25,7 +25,7 @@ JeepDemolishingBridge = function()
|
||||
StartJeep.Move(StartJeepMovePoint.Location)
|
||||
|
||||
Trigger.OnEnteredFootprint({ StartJeepMovePoint.Location }, function(actor, id)
|
||||
if actor.Owner == france and not BridgeBarrel.IsDead then
|
||||
if actor.Owner == France and not BridgeBarrel.IsDead then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
BridgeBarrel.Kill()
|
||||
end
|
||||
@@ -41,24 +41,24 @@ end
|
||||
|
||||
Paratroopers = function()
|
||||
Trigger.OnKilled(StartJeep, function()
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
Paradrop.TargetParatroopers(StartJeepMovePoint.CenterPosition, Angle.East)
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Church, function()
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
Paradrop.TargetParatroopers(StartJeepMovePoint.CenterPosition, Angle.East)
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(ParaHut, function()
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
Paradrop.TargetParatroopers(StartJeepMovePoint.CenterPosition, Angle.East)
|
||||
end)
|
||||
end
|
||||
|
||||
PanicAttack = function()
|
||||
if not HouseDamaged then
|
||||
local panicTeam = Reinforcements.Reinforce(france, { "c3", "c6", "c9" }, { CivSpawn.Location }, 0)
|
||||
local panicTeam = Reinforcements.Reinforce(France, { "c3", "c6", "c9" }, { CivSpawn.Location }, 0)
|
||||
Utils.Do(panicTeam, function(a)
|
||||
a.Move(a.Location + CVec.New(-1,-1))
|
||||
a.Panic()
|
||||
@@ -68,21 +68,21 @@ PanicAttack = function()
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("USSR")
|
||||
france = Player.GetPlayer("France")
|
||||
germany = Player.GetPlayer("Germany")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
France = Player.GetPlayer("France")
|
||||
Germany = Player.GetPlayer("Germany")
|
||||
|
||||
InitObjectives(player)
|
||||
InitObjectives(USSR)
|
||||
|
||||
VillageRaidObjective = AddPrimaryObjective(player, "raze-village")
|
||||
VillageRaidObjective = AddPrimaryObjective(USSR, "raze-village")
|
||||
|
||||
Trigger.OnAllRemovedFromWorld(Airfields, function()
|
||||
player.MarkFailedObjective(VillageRaidObjective)
|
||||
USSR.MarkFailedObjective(VillageRaidObjective)
|
||||
end)
|
||||
|
||||
JeepDemolishingBridge()
|
||||
|
||||
Paradrop = Actor.Create("powerproxy.paratroopers", false, { Owner = player })
|
||||
Paradrop = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), InsertYaks)
|
||||
Paratroopers()
|
||||
Trigger.OnDamaged(HayHouse, PanicAttack)
|
||||
@@ -99,7 +99,7 @@ WorldLoaded = function()
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if france.HasNoRequiredUnits() and germany.HasNoRequiredUnits() then
|
||||
player.MarkCompletedObjective(VillageRaidObjective)
|
||||
if France.HasNoRequiredUnits() and Germany.HasNoRequiredUnits() then
|
||||
USSR.MarkCompletedObjective(VillageRaidObjective)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -39,7 +39,7 @@ ProduceInfantry = function()
|
||||
return
|
||||
end
|
||||
|
||||
greece.Build({ Utils.Random(AlliedInfantry) }, function(units)
|
||||
Greece.Build({ Utils.Random(AlliedInfantry) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), ProduceInfantry)
|
||||
@@ -47,29 +47,29 @@ ProduceInfantry = function()
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("USSR")
|
||||
greece = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
|
||||
InitObjectives(player)
|
||||
InitObjectives(USSR)
|
||||
|
||||
CommandCenterIntact = AddPrimaryObjective(player, "protect-command-center")
|
||||
DestroyAllAllied = AddPrimaryObjective(player, "destroy-allied-units-structures")
|
||||
CommandCenterIntact = AddPrimaryObjective(USSR, "protect-command-center")
|
||||
DestroyAllAllied = AddPrimaryObjective(USSR, "destroy-allied-units-structures")
|
||||
|
||||
Camera.Position = CameraWaypoint.CenterPosition
|
||||
|
||||
Trigger.OnKilled(CommandCenter, function()
|
||||
player.MarkFailedObjective(CommandCenterIntact)
|
||||
USSR.MarkFailedObjective(CommandCenterIntact)
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(0, function()
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == greece and self.HasProperty("StartBuildingRepairs") end)
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == Greece and self.HasProperty("StartBuildingRepairs") end)
|
||||
Utils.Do(buildings, function(actor)
|
||||
Trigger.OnDamaged(actor, function(building, attacker)
|
||||
if building.Owner == greece and building.Health < building.MaxHealth * 0.8 then
|
||||
if building.Owner == Greece and building.Health < building.MaxHealth * 0.8 then
|
||||
building.StartBuildingRepairs()
|
||||
if attacker.Type ~= "yak" and not AlreadyHunting then
|
||||
AlreadyHunting = true
|
||||
Utils.Do(greece.GetGroundAttackers(), function(unit)
|
||||
Utils.Do(Greece.GetGroundAttackers(), function(unit)
|
||||
Trigger.OnIdle(unit, unit.Hunt)
|
||||
end)
|
||||
end
|
||||
@@ -78,15 +78,15 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
-- Find the bridge actors
|
||||
bridgepart1 = Map.ActorsInBox(Box1.CenterPosition, Box2.CenterPosition, function(self) return self.Type == "br1" end)[1]
|
||||
bridgepart2 = Map.ActorsInBox(Box1.CenterPosition, Box2.CenterPosition, function(self) return self.Type == "br2" end)[1]
|
||||
BridgePart1 = Map.ActorsInBox(Box1.CenterPosition, Box2.CenterPosition, function(self) return self.Type == "br1" end)[1]
|
||||
BridgePart2 = Map.ActorsInBox(Box1.CenterPosition, Box2.CenterPosition, function(self) return self.Type == "br2" end)[1]
|
||||
end)
|
||||
|
||||
-- Discover the area around the bridge exposing the two german soldiers
|
||||
-- When the two infantry near the bridge are discovered move them across the bridge to waypoint4
|
||||
-- in the meanwhile one USSR soldier hunts them down
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Actor.Create("camera", true, { Owner = player, Location = Box1.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = Box1.Location })
|
||||
|
||||
Utils.Do(FleeingUnits, function(unit)
|
||||
unit.Move(RifleRetreat.Location)
|
||||
@@ -97,21 +97,21 @@ WorldLoaded = function()
|
||||
-- To make it look more smooth we will blow up the bridge when the barrel closest to it blows up
|
||||
Trigger.OnAnyKilled({ BridgeBarrel1, BridgeBarrel2 }, function()
|
||||
-- Destroy the bridge
|
||||
if not bridgepart1.IsDead then
|
||||
bridgepart1.Kill()
|
||||
if not BridgePart1.IsDead then
|
||||
BridgePart1.Kill()
|
||||
end
|
||||
if not bridgepart2.IsDead then
|
||||
bridgepart2.Kill()
|
||||
if not BridgePart2.IsDead then
|
||||
BridgePart2.Kill()
|
||||
end
|
||||
end)
|
||||
|
||||
-- If player passes over the bridge, blow up the barrel and destroy the bridge
|
||||
Trigger.OnEnteredFootprint(PassingBridgeLocation, function(unit, id)
|
||||
if unit.Owner == player then
|
||||
if unit.Owner == USSR then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
|
||||
-- Also don't if the bridge is already dead
|
||||
if bridgepart1.IsDead and bridgepart2.IsDead then
|
||||
if BridgePart1.IsDead and BridgePart2.IsDead then
|
||||
return
|
||||
end
|
||||
|
||||
@@ -140,27 +140,27 @@ WorldLoaded = function()
|
||||
|
||||
-- When destroying the allied radar dome or the refinery drop 2 badgers with 5 grenadiers each
|
||||
Trigger.OnAnyKilled({ AlliedDome, AlliedProc }, function()
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", true, { Owner = player })
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", true, { Owner = USSR })
|
||||
powerproxy.TargetParatroopers(ParadropLZ.CenterPosition, Angle.South)
|
||||
powerproxy.TargetParatroopers(ParadropLZ.CenterPosition, Angle.SouthEast)
|
||||
powerproxy.Destroy()
|
||||
end)
|
||||
|
||||
greece.Resources = 2000
|
||||
Greece.Resources = 2000
|
||||
Trigger.AfterDelay(DateTime.Seconds(30), ProduceInfantry)
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if greece.HasNoRequiredUnits() then
|
||||
player.MarkCompletedObjective(CommandCenterIntact)
|
||||
player.MarkCompletedObjective(DestroyAllAllied)
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
USSR.MarkCompletedObjective(CommandCenterIntact)
|
||||
USSR.MarkCompletedObjective(DestroyAllAllied)
|
||||
end
|
||||
|
||||
if player.HasNoRequiredUnits() then
|
||||
player.MarkFailedObjective(DestroyAllAllied)
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
USSR.MarkFailedObjective(DestroyAllAllied)
|
||||
end
|
||||
|
||||
if greece.Resources > greece.ResourceCapacity / 2 then
|
||||
greece.Resources = greece.ResourceCapacity / 2
|
||||
if Greece.Resources > Greece.ResourceCapacity / 2 then
|
||||
Greece.Resources = Greece.ResourceCapacity / 2
|
||||
end
|
||||
end
|
||||
|
||||
@@ -41,7 +41,7 @@ ProduceInfantry = function()
|
||||
return
|
||||
end
|
||||
|
||||
enemy.Build({ Utils.Random(AlliedInfantry) }, function(units)
|
||||
Greece.Build({ Utils.Random(AlliedInfantry) }, function(units)
|
||||
table.insert(AttackGroup, units[1])
|
||||
SendAttackGroup()
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), ProduceInfantry)
|
||||
@@ -49,54 +49,54 @@ ProduceInfantry = function()
|
||||
end
|
||||
|
||||
SendUSSRParadrops = function()
|
||||
paraproxy1 = Actor.Create("powerproxy.paratroopers", false, { Owner = player })
|
||||
local paraproxy1 = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
paraproxy1.TargetParatroopers(ParachuteBaseEntrance.CenterPosition, Angle.North)
|
||||
paraproxy1.Destroy()
|
||||
end
|
||||
|
||||
SendUSSRParadropsBase = function()
|
||||
paraproxy2 = Actor.Create("powerproxy.paratroopers2", false, { Owner = player })
|
||||
local paraproxy2 = Actor.Create("powerproxy.paratroopers2", false, { Owner = USSR })
|
||||
paraproxy2.TargetParatroopers(ParachuteBase1.CenterPosition, Angle.East)
|
||||
paraproxy2.Destroy()
|
||||
paraproxy3 = Actor.Create("powerproxy.paratroopers3", false, { Owner = player })
|
||||
local paraproxy3 = Actor.Create("powerproxy.paratroopers3", false, { Owner = USSR })
|
||||
paraproxy3.TargetParatroopers(ParachuteBase2.CenterPosition, Angle.East)
|
||||
paraproxy3.Destroy()
|
||||
end
|
||||
|
||||
Trigger.OnEnteredFootprint(BridgeShroudTrigger, function(a, id)
|
||||
if not bridgeShroudTrigger and a.Owner == player then
|
||||
bridgeShroudTrigger = true
|
||||
local cameraBridge = Actor.Create("camera", true, { Owner = player, Location = CameraBridge.Location })
|
||||
Trigger.OnEnteredFootprint(BridgeShroudTrigger, function(a)
|
||||
if not BridgeShroudTriggered and a.Owner == USSR then
|
||||
BridgeShroudTriggered = true
|
||||
local cameraBridge = Actor.Create("camera", true, { Owner = USSR, Location = CameraBridge.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(15), function()
|
||||
cameraBridge.Destroy()
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(BridgeExplosionTrigger, function(a, id)
|
||||
if not bridgeExplosionTrigger and a.Owner == player then
|
||||
bridgeExplosionTrigger = true
|
||||
Trigger.OnEnteredFootprint(BridgeExplosionTrigger, function(a)
|
||||
if not BridgeExplosionTriggered and a.Owner == USSR then
|
||||
BridgeExplosionTriggered = true
|
||||
if not BarrelBridge.IsDead then
|
||||
BarrelBridge.Kill()
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(EnemyBaseEntranceShroudTrigger, function(a, id)
|
||||
if not enemyBaseEntranceShroudTrigger and a.Owner == player then
|
||||
enemyBaseEntranceShroudTrigger = true
|
||||
local cameraBaseEntrance = Actor.Create("camera", true, { Owner = player, Location = CameraBaseEntrance.Location })
|
||||
Trigger.OnEnteredFootprint(EnemyBaseEntranceShroudTrigger, function(a)
|
||||
if not EnemyBaseEntranceShroudTriggered and a.Owner == USSR then
|
||||
EnemyBaseEntranceShroudTriggered = true
|
||||
local cameraBaseEntrance = Actor.Create("camera", true, { Owner = USSR, Location = CameraBaseEntrance.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(15), function()
|
||||
cameraBaseEntrance.Destroy()
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(EnemyBaseShroudTrigger, function(a, id)
|
||||
if not enemyBaseShroudTrigger and a.Owner == player then
|
||||
enemyBaseShroudTrigger = true
|
||||
local cameraBase1 = Actor.Create("camera", true, { Owner = player, Location = CameraBase1.Location })
|
||||
local cameraBase2 = Actor.Create("camera", true, { Owner = player, Location = CameraBase2.Location })
|
||||
Trigger.OnEnteredFootprint(EnemyBaseShroudTrigger, function(a)
|
||||
if not EnemyBaseShroudTriggered and a.Owner == USSR then
|
||||
EnemyBaseShroudTriggered = true
|
||||
local cameraBase1 = Actor.Create("camera", true, { Owner = USSR, Location = CameraBase1.Location })
|
||||
local cameraBase2 = Actor.Create("camera", true, { Owner = USSR, Location = CameraBase2.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(15), function()
|
||||
cameraBase1.Destroy()
|
||||
cameraBase2.Destroy()
|
||||
@@ -104,17 +104,17 @@ Trigger.OnEnteredFootprint(EnemyBaseShroudTrigger, function(a, id)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(ParachuteTrigger, function(a, id)
|
||||
if not parachuteTrigger and a.Owner == player then
|
||||
parachuteTrigger = true
|
||||
Trigger.OnEnteredFootprint(ParachuteTrigger, function(a)
|
||||
if not ParachuteTriggered and a.Owner == USSR then
|
||||
ParachuteTriggered = true
|
||||
SendUSSRParadrops()
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(TransportTrigger, function(a, id)
|
||||
if not transportTrigger and a.Type == "truk" then
|
||||
transportTrigger = true
|
||||
if not TransportTriggered and a.Type == "truk" then
|
||||
TransportTriggered = true
|
||||
if not TransportTruck.IsDead then
|
||||
TransportTruck.Wait(DateTime.Seconds(5))
|
||||
TransportTruck.Move(TransportWaypoint2.Location)
|
||||
@@ -124,14 +124,14 @@ Trigger.OnEnteredFootprint(TransportTrigger, function(a, id)
|
||||
TransportTruck.Move(TransportWaypoint1.Location)
|
||||
end
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
transportTrigger = false
|
||||
TransportTriggered = false
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(BarrelBase, function()
|
||||
SendUSSRParadropsBase()
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(BarrelBridge, function()
|
||||
@@ -142,64 +142,64 @@ Trigger.OnKilled(BarrelBridge, function()
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Church1, function()
|
||||
Actor.Create("moneycrate", true, { Owner = player, Location = TransportWaypoint3.Location })
|
||||
Actor.Create("moneycrate", true, { Owner = USSR, Location = TransportWaypoint3.Location })
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Church2, function()
|
||||
Actor.Create("healcrate", true, { Owner = player, Location = Church2.Location })
|
||||
Actor.Create("healcrate", true, { Owner = USSR, Location = Church2.Location })
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(ForwardCommand, function()
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
Greece.MarkCompletedObjective(AlliedObjective)
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(IntroSoldier1, function()
|
||||
local cameraIntro = Actor.Create("camera", true, { Owner = player, Location = CameraStart.Location })
|
||||
local cameraIntro = Actor.Create("camera", true, { Owner = USSR, Location = CameraStart.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(15), function()
|
||||
cameraIntro.Destroy()
|
||||
end)
|
||||
end)
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("USSR")
|
||||
enemy = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
Utils.Do(IntroAttackers, function(actor)
|
||||
if not actor.IsDead then
|
||||
Trigger.OnIdle(actor, actor.Hunt)
|
||||
end
|
||||
end)
|
||||
Trigger.AfterDelay(0, function()
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == enemy and self.HasProperty("StartBuildingRepairs") end)
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == Greece and self.HasProperty("StartBuildingRepairs") end)
|
||||
Utils.Do(buildings, function(actor)
|
||||
Trigger.OnDamaged(actor, function(building, attacker)
|
||||
if building.Owner == enemy and building.Health < building.MaxHealth * 0.8 then
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == Greece and building.Health < building.MaxHealth * 0.8 then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
InitObjectives(player)
|
||||
alliedObjective = AddPrimaryObjective(enemy, "")
|
||||
sovietObjective1 = AddPrimaryObjective(player, "protect-command-center")
|
||||
sovietObjective2 = AddPrimaryObjective(player, "destroy-allied-units-structures")
|
||||
InitObjectives(USSR)
|
||||
AlliedObjective = AddPrimaryObjective(Greece, "")
|
||||
SovietObjective1 = AddPrimaryObjective(USSR, "protect-command-center")
|
||||
SovietObjective2 = AddPrimaryObjective(USSR, "destroy-allied-units-structures")
|
||||
|
||||
enemy.Resources = 2000
|
||||
Greece.Resources = 2000
|
||||
Trigger.AfterDelay(DateTime.Seconds(30), ProduceInfantry)
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if player.HasNoRequiredUnits() then
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(AlliedObjective)
|
||||
end
|
||||
|
||||
if enemy.HasNoRequiredUnits() then
|
||||
player.MarkCompletedObjective(sovietObjective1)
|
||||
player.MarkCompletedObjective(sovietObjective2)
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
USSR.MarkCompletedObjective(SovietObjective1)
|
||||
USSR.MarkCompletedObjective(SovietObjective2)
|
||||
end
|
||||
|
||||
if enemy.Resources >= enemy.ResourceCapacity * 0.75 then
|
||||
enemy.Cash = enemy.Cash + enemy.Resources - enemy.ResourceCapacity * 0.25
|
||||
enemy.Resources = enemy.ResourceCapacity * 0.25
|
||||
if Greece.Resources >= Greece.ResourceCapacity * 0.75 then
|
||||
Greece.Cash = Greece.Cash + Greece.Resources - Greece.ResourceCapacity * 0.25
|
||||
Greece.Resources = Greece.ResourceCapacity * 0.25
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
information, see COPYING.
|
||||
]]
|
||||
if Difficulty == "easy" then
|
||||
remainingTime = DateTime.Minutes(7)
|
||||
RemainingTime = DateTime.Minutes(7)
|
||||
elseif Difficulty == "normal" then
|
||||
remainingTime = DateTime.Minutes(6)
|
||||
RemainingTime = DateTime.Minutes(6)
|
||||
elseif Difficulty == "hard" then
|
||||
remainingTime = DateTime.Minutes(5)
|
||||
RemainingTime = DateTime.Minutes(5)
|
||||
end
|
||||
|
||||
USSRReinforcements1 = { "dog", "dog", "dog", "dog", "dog" }
|
||||
@@ -39,19 +39,19 @@ RTrapTrigger = { CPos.New(46, 34), CPos.New(47, 35), CPos.New(48, 36), CPos.New(
|
||||
SpyHideout4Trigger = { CPos.New(41, 34), CPos.New(41, 35), CPos.New(41, 36), CPos.New(41, 37), CPos.New(41, 38) }
|
||||
|
||||
IntroSequence = function()
|
||||
TheSpy.DisguiseAsType("e1", player)
|
||||
Actor.Create("camera", true, { Owner = player, Location = Playerbase.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = IntroCamera.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = FarmArea.Location })
|
||||
TheSpy.DisguiseAsType("e1", USSR)
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = Playerbase.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = IntroCamera.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = FarmArea.Location })
|
||||
if not TheSpy.IsDead then
|
||||
TheSpy.Move(SpyWaypoint1.Location)
|
||||
TheSpy.Move(SpyWaypoint2.Location)
|
||||
end
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Media.PlaySoundNotification(player, "sking")
|
||||
Media.PlaySoundNotification(USSR, "sking")
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
Media.PlaySpeechNotification(player, "ExplosiveChargePlaced")
|
||||
Media.PlaySpeechNotification(USSR, "ExplosiveChargePlaced")
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(4), function()
|
||||
if not RSoldier1.IsDead and not BaseBarrel1.IsDead then
|
||||
@@ -82,20 +82,20 @@ IntroSequence = function()
|
||||
end
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(8), function()
|
||||
Dogs = Reinforcements.Reinforce(player, USSRReinforcements1, { ReinforcementSpawn.Location, ReinforcementGoal.Location }, 0)
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
timerstarted = true
|
||||
Dogs = Reinforcements.Reinforce(USSR, USSRReinforcements1, { ReinforcementSpawn.Location, ReinforcementGoal.Location }, 0)
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
TimerStarted = true
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(9), function()
|
||||
Media.PlaySoundNotification(player, "AlertBleep")
|
||||
Media.PlaySoundNotification(USSR, "AlertBleep")
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
Media.PlaySpeechNotification(player, "TimerStarted")
|
||||
Media.PlaySpeechNotification(USSR, "TimerStarted")
|
||||
end)
|
||||
end
|
||||
|
||||
SendUSSRParadrops = function()
|
||||
paraproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = player })
|
||||
local paraproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
paraproxy.TargetParatroopers(ReinforcementDropOff.CenterPosition, Angle.North)
|
||||
paraproxy.Destroy()
|
||||
end
|
||||
@@ -112,11 +112,11 @@ SpyFinalSequency = function()
|
||||
end
|
||||
|
||||
SpyHelicopterEscape = function()
|
||||
if not spyHelicopterEscape then
|
||||
spyHelicopterEscape = true
|
||||
if not SpyHelicopterEscaped then
|
||||
SpyHelicopterEscaped = true
|
||||
SpyFinalSequency()
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraFinalArea.Location })
|
||||
ExtractionHeli = Reinforcements.ReinforceWithTransport(greece, ExtractionHeliType, nil, ExtractionPath)[1]
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraFinalArea.Location })
|
||||
ExtractionHeli = Reinforcements.ReinforceWithTransport(Greece, ExtractionHeliType, nil, ExtractionPath)[1]
|
||||
local exitPos = CPos.New(ExtractionPath[1].X, ExtractionPath[2].Y)
|
||||
Trigger.AfterDelay(DateTime.Seconds(5), function()
|
||||
if not TheSpy.IsDead and not ExtractionHeli.IsDead then
|
||||
@@ -129,22 +129,22 @@ SpyHelicopterEscape = function()
|
||||
end
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(12), function()
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
England.MarkCompletedObjective(AlliedObjective)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
Trigger.OnAllKilled(Farmers, function()
|
||||
Reinforcements.Reinforce(player, USSRReinforcementsFarm, { FarmSpawn.Location, FarmArea.Location }, 0)
|
||||
player.MarkCompletedObjective(sovietObjective2)
|
||||
Reinforcements.Reinforce(USSR, USSRReinforcementsFarm, { FarmSpawn.Location, FarmArea.Location }, 0)
|
||||
USSR.MarkCompletedObjective(SovietObjective2)
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(RedBuildings, function()
|
||||
player.MarkCompletedObjective(sovietObjective3)
|
||||
USSR.MarkCompletedObjective(SovietObjective3)
|
||||
end)
|
||||
|
||||
Trigger.OnAnyKilled(BarrierSoldiers, function()
|
||||
if barrier1Trigger then
|
||||
if Barrier1Triggered then
|
||||
Utils.Do(BarrierSoldiers, function(actor)
|
||||
if not actor.IsDead then
|
||||
Trigger.OnIdle(actor, actor.Hunt)
|
||||
@@ -154,10 +154,10 @@ Trigger.OnAnyKilled(BarrierSoldiers, function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(SpyHideout1Trigger, function(a, id)
|
||||
if not spyHideout1Trigger and a.Owner == player then
|
||||
spyHideout1Trigger = true
|
||||
if not SpyHideout1Triggered and a.Owner == USSR then
|
||||
SpyHideout1Triggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
Actor.Create("camera", true, { Owner = player, Location = SpyHideout1.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = SpyHideout1.Location })
|
||||
if not TheSpy.IsDead and not SpyHideout1.IsDead then
|
||||
TheSpy.EnterTransport(SpyHideout1)
|
||||
end
|
||||
@@ -165,11 +165,11 @@ Trigger.OnEnteredFootprint(SpyHideout1Trigger, function(a, id)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(SpyHideout2PathTrigger, function(a, id)
|
||||
if not spyHideout2PathTrigger and a.Owner == player then
|
||||
spyHideout2PathTrigger = true
|
||||
if not SpyHideout2PathTriggered and a.Owner == USSR then
|
||||
SpyHideout2PathTriggered = true
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraSpyVillage.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraVillage.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraSpyVillage.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraVillage.Location })
|
||||
if not TheSpy.IsDead and not SpyHideout2.IsDead then
|
||||
TheSpy.EnterTransport(SpyHideout2)
|
||||
end
|
||||
@@ -177,10 +177,10 @@ Trigger.OnEnteredFootprint(SpyHideout2PathTrigger, function(a, id)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(SpyHideout2Trigger, function(a, id)
|
||||
if not spyHideout2Trigger and a.Owner == player then
|
||||
spyHideout2Trigger = true
|
||||
SpyGuards1 = Reinforcements.Reinforce(greece, EnemyReinforcements1SpyHideout2, { EnemyReinforcements1.Location, EnemyReinforcements1Goal.Location }, 0)
|
||||
SpyGuards2 = Reinforcements.Reinforce(greece, EnemyReinforcements2SpyHideout2, { EnemyReinforcements2.Location, EnemyReinforcements2Goal.Location }, 0)
|
||||
if not SpyHideout2Triggered and a.Owner == USSR then
|
||||
SpyHideout2Triggered = true
|
||||
SpyGuards1 = Reinforcements.Reinforce(Greece, EnemyReinforcements1SpyHideout2, { EnemyReinforcements1.Location, EnemyReinforcements1Goal.Location }, 0)
|
||||
SpyGuards2 = Reinforcements.Reinforce(Greece, EnemyReinforcements2SpyHideout2, { EnemyReinforcements2.Location, EnemyReinforcements2Goal.Location }, 0)
|
||||
Utils.Do(SpyGuards1, function(actor)
|
||||
if not actor.IsDead then
|
||||
Trigger.OnIdle(actor, actor.Hunt)
|
||||
@@ -203,22 +203,22 @@ Trigger.OnEnteredFootprint(SpyHideout2Trigger, function(a, id)
|
||||
end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(7), function()
|
||||
SendUSSRParadrops()
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(SpyTransport1CheckpointTrigger, function(a, id)
|
||||
if not spyTransport1CheckpointTrigger and a.Owner == enemy then
|
||||
spyTransport1CheckpointTrigger = true
|
||||
if not SpyTransport1CheckpointTriggered and a.Owner == England then
|
||||
SpyTransport1CheckpointTriggered = true
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraWater1.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraWater2.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraWater3.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraWater4.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraWater5.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraWater6.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = TransportPath2.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraWater1.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraWater2.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraWater3.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraWater4.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraWater5.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraWater6.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = TransportPath2.Location })
|
||||
if not Transport.IsDead then
|
||||
Transport.Wait(25)
|
||||
Transport.Move(TransportPath2Water.Location)
|
||||
@@ -228,8 +228,8 @@ Trigger.OnEnteredFootprint(SpyTransport1CheckpointTrigger, function(a, id)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(SpyTransport2CheckpointTrigger, function(a, id)
|
||||
if not spyTransport2CheckpointTrigger and a.Owner == greece then
|
||||
spyTransport2CheckpointTrigger = true
|
||||
if not SpyTransport2CheckpointTriggered and a.Owner == Greece then
|
||||
SpyTransport2CheckpointTriggered = true
|
||||
Transport.UnloadPassengers()
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
if not TheSpy.IsDead then
|
||||
@@ -246,35 +246,35 @@ Trigger.OnEnteredFootprint(SpyTransport2CheckpointTrigger, function(a, id)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(Barrier1Trigger, function(a, id)
|
||||
if not barrier1Trigger and a.Owner == player then
|
||||
barrier1Trigger = true
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraBarrier.Location })
|
||||
if not Barrier1Triggered and a.Owner == USSR then
|
||||
Barrier1Triggered = true
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraBarrier.Location })
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(Barrier2Trigger, function(a, id)
|
||||
if not barrier2Trigger and a.Owner == player then
|
||||
barrier2Trigger = true
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraSpyHideout31.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraSpyHideout32.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraSpyHideout33.Location })
|
||||
if not Barrier2Triggered and a.Owner == USSR then
|
||||
Barrier2Triggered = true
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraSpyHideout31.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraSpyHideout32.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraSpyHideout33.Location })
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(SpyHideout3Trigger, function(a, id)
|
||||
if not spyHideout3Trigger and a.Owner == player then
|
||||
spyHideout3Trigger = true
|
||||
if not SpyHideout3Triggered and a.Owner == USSR then
|
||||
SpyHideout3Triggered = true
|
||||
if Difficulty ~= "hard" then
|
||||
Reinforcements.Reinforce(player, USSRReinforcements2, { ReinforcementSpawn.Location, CameraSpyHideout33.Location }, 0)
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Reinforcements.Reinforce(USSR, USSRReinforcements2, { ReinforcementSpawn.Location, CameraSpyHideout33.Location }, 0)
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(RTrapTrigger, function(a, id)
|
||||
if not rTrapTrigger and a.Owner == player then
|
||||
rTrapTrigger = true
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraFinalArea.Location })
|
||||
if not RTrapTriggered and a.Owner == USSR then
|
||||
RTrapTriggered = true
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraFinalArea.Location })
|
||||
if not RSoldier3.IsDead and not RSoldierTrap.IsDead then
|
||||
RSoldier3.Attack(RSoldierTrap)
|
||||
end
|
||||
@@ -285,10 +285,10 @@ Trigger.OnEnteredFootprint(RTrapTrigger, function(a, id)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(SpyHideout4Trigger, function(a, id)
|
||||
if not spyHideout4Trigger and a.Owner == player then
|
||||
spyHideout4Trigger = true
|
||||
if not SpyHideout4Triggered and a.Owner == USSR then
|
||||
SpyHideout4Triggered = true
|
||||
SpyFinalSequency()
|
||||
Actor.Create("camera", true, { Owner = player, Location = HelicopterGoal.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = HelicopterGoal.Location })
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -332,54 +332,54 @@ Trigger.OnKilled(Hideout3Barrel, function()
|
||||
end)
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("USSR")
|
||||
enemy = Player.GetPlayer("England")
|
||||
greece = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
England = Player.GetPlayer("England")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
|
||||
Camera.Position = Playerbase.CenterPosition
|
||||
IntroSequence()
|
||||
|
||||
InitObjectives(player)
|
||||
alliedObjective = AddPrimaryObjective(enemy, "")
|
||||
sovietObjective1 = AddPrimaryObjective(player, "kill-enemy-spy")
|
||||
sovietObjective2 = AddSecondaryObjective(player, "clear-farm-reinforcements")
|
||||
sovietObjective3 = AddSecondaryObjective(player, "scavenge-civilian-buildings")
|
||||
InitObjectives(USSR)
|
||||
AlliedObjective = AddPrimaryObjective(England, "")
|
||||
SovietObjective1 = AddPrimaryObjective(USSR, "kill-enemy-spy")
|
||||
SovietObjective2 = AddSecondaryObjective(USSR, "clear-farm-reinforcements")
|
||||
SovietObjective3 = AddSecondaryObjective(USSR, "scavenge-civilian-buildings")
|
||||
end
|
||||
|
||||
Trigger.OnKilled(TheSpy, function()
|
||||
player.MarkCompletedObjective(sovietObjective1)
|
||||
USSR.MarkCompletedObjective(SovietObjective1)
|
||||
end)
|
||||
|
||||
Tick = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(12), function()
|
||||
if player.HasNoRequiredUnits() then
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
England.MarkCompletedObjective(AlliedObjective)
|
||||
end
|
||||
end)
|
||||
if not SpyHideout4.IsDead and SpyHideout4.HasPassengers then
|
||||
spyReachedHideout4 = true
|
||||
SpyReachedHideout4 = true
|
||||
end
|
||||
if remainingTime == DateTime.Minutes(5) and Difficulty ~= "hard" then
|
||||
Media.PlaySpeechNotification(player, "WarningFiveMinutesRemaining")
|
||||
elseif remainingTime == DateTime.Minutes(4) then
|
||||
Media.PlaySpeechNotification(player, "WarningFourMinutesRemaining")
|
||||
elseif remainingTime == DateTime.Minutes(3) then
|
||||
Media.PlaySpeechNotification(player, "WarningThreeMinutesRemaining")
|
||||
elseif remainingTime == DateTime.Minutes(2) then
|
||||
Media.PlaySpeechNotification(player, "WarningTwoMinutesRemaining")
|
||||
elseif remainingTime == DateTime.Minutes(1) then
|
||||
Media.PlaySpeechNotification(player, "WarningOneMinuteRemaining")
|
||||
if RemainingTime == DateTime.Minutes(5) and Difficulty ~= "hard" then
|
||||
Media.PlaySpeechNotification(USSR, "WarningFiveMinutesRemaining")
|
||||
elseif RemainingTime == DateTime.Minutes(4) then
|
||||
Media.PlaySpeechNotification(USSR, "WarningFourMinutesRemaining")
|
||||
elseif RemainingTime == DateTime.Minutes(3) then
|
||||
Media.PlaySpeechNotification(USSR, "WarningThreeMinutesRemaining")
|
||||
elseif RemainingTime == DateTime.Minutes(2) then
|
||||
Media.PlaySpeechNotification(USSR, "WarningTwoMinutesRemaining")
|
||||
elseif RemainingTime == DateTime.Minutes(1) then
|
||||
Media.PlaySpeechNotification(USSR, "WarningOneMinuteRemaining")
|
||||
end
|
||||
if remainingTime > 0 and timerstarted then
|
||||
if (remainingTime % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("time-remaining", { ["time"] = Utils.FormatTime(remainingTime) })
|
||||
UserInterface.SetMissionText(Timer, player.Color)
|
||||
if RemainingTime > 0 and TimerStarted then
|
||||
if (RemainingTime % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("time-remaining", { ["time"] = Utils.FormatTime(RemainingTime) })
|
||||
UserInterface.SetMissionText(Timer, USSR.Color)
|
||||
end
|
||||
remainingTime = remainingTime - 1
|
||||
elseif remainingTime == 0 and not spyReachedHideout4 then
|
||||
RemainingTime = RemainingTime - 1
|
||||
elseif RemainingTime == 0 and not SpyReachedHideout4 then
|
||||
UserInterface.SetMissionText("")
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
elseif remainingTime == 0 and spyReachedHideout4 then
|
||||
England.MarkCompletedObjective(AlliedObjective)
|
||||
elseif RemainingTime == 0 and SpyReachedHideout4 then
|
||||
UserInterface.SetMissionText("")
|
||||
SpyHelicopterEscape()
|
||||
end
|
||||
|
||||
@@ -26,29 +26,29 @@ RunInitialActivities = function()
|
||||
end
|
||||
end)
|
||||
|
||||
Reinforcements.Reinforce(player, SovietMCV, SovietStartToBasePath, 0, function(mcv)
|
||||
Reinforcements.Reinforce(USSR, SovietMCV, SovietStartToBasePath, 0, function(mcv)
|
||||
mcv.Move(StartCamPoint.Location)
|
||||
end)
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
|
||||
Trigger.OnKilled(Barr, function(building)
|
||||
Trigger.OnKilled(Barr, function()
|
||||
BaseBarracks.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Proc, function(building)
|
||||
Trigger.OnKilled(Proc, function()
|
||||
BaseProc.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Weap, function(building)
|
||||
Trigger.OnKilled(Weap, function()
|
||||
BaseWeaponsFactory.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(VillageCamArea, function(actor, id)
|
||||
if actor.Owner == player then
|
||||
if actor.Owner == USSR then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
|
||||
if not AllVillagersDead then
|
||||
VillageCamera = Actor.Create("camera", true, { Owner = player, Location = VillagePoint.Location })
|
||||
VillageCamera = Actor.Create("camera", true, { Owner = USSR, Location = VillagePoint.Location })
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -101,11 +101,11 @@ end
|
||||
|
||||
Tick = function()
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
player.MarkCompletedObjective(KillAll)
|
||||
player.MarkCompletedObjective(KillRadar)
|
||||
USSR.MarkCompletedObjective(KillAll)
|
||||
USSR.MarkCompletedObjective(KillRadar)
|
||||
end
|
||||
|
||||
if player.HasNoRequiredUnits() then
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(BeatUSSR)
|
||||
end
|
||||
|
||||
@@ -127,20 +127,20 @@ Tick = function()
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("USSR")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
|
||||
RunInitialActivities()
|
||||
|
||||
InitObjectives(player)
|
||||
InitObjectives(USSR)
|
||||
|
||||
KillAll = AddPrimaryObjective(player, "defeat-allied-forces")
|
||||
KillAll = AddPrimaryObjective(USSR, "defeat-allied-forces")
|
||||
BeatUSSR = AddPrimaryObjective(Greece, "")
|
||||
KillRadar = AddSecondaryObjective(player, "destroy-radar-dome-reinforcements")
|
||||
KillRadar = AddSecondaryObjective(USSR, "destroy-radar-dome-reinforcements")
|
||||
|
||||
Trigger.OnKilled(RadarDome, function()
|
||||
player.MarkCompletedObjective(KillRadar)
|
||||
Media.PlaySpeechNotification(player, "ObjectiveMet")
|
||||
USSR.MarkCompletedObjective(KillRadar)
|
||||
Media.PlaySpeechNotification(USSR, "ObjectiveMet")
|
||||
end)
|
||||
|
||||
Camera.Position = StartCamPoint.CenterPosition
|
||||
|
||||
@@ -29,28 +29,28 @@ RunInitialActivities = function()
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Powr, function(building)
|
||||
Trigger.OnKilled(Powr, function()
|
||||
BasePower.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Barr, function(building)
|
||||
Trigger.OnKilled(Barr, function()
|
||||
BaseBarracks.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Proc, function(building)
|
||||
Trigger.OnKilled(Proc, function()
|
||||
BaseProc.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Weap, function(building)
|
||||
Trigger.OnKilled(Weap, function()
|
||||
BaseWeaponsFactory.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(VillageCamArea, function(actor, id)
|
||||
if actor.Owner == player then
|
||||
if actor.Owner == USSR then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
|
||||
if not AllVillagersDead then
|
||||
VillageCamera = Actor.Create("camera", true, { Owner = player, Location = VillagePoint.Location })
|
||||
VillageCamera = Actor.Create("camera", true, { Owner = USSR, Location = VillagePoint.Location })
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -86,11 +86,11 @@ end
|
||||
|
||||
Tick = function()
|
||||
if Greece.HasNoRequiredUnits() then
|
||||
player.MarkCompletedObjective(KillAll)
|
||||
player.MarkCompletedObjective(KillRadar)
|
||||
USSR.MarkCompletedObjective(KillAll)
|
||||
USSR.MarkCompletedObjective(KillRadar)
|
||||
end
|
||||
|
||||
if player.HasNoRequiredUnits() then
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(BeatUSSR)
|
||||
end
|
||||
|
||||
@@ -112,20 +112,20 @@ Tick = function()
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("USSR")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
|
||||
RunInitialActivities()
|
||||
|
||||
InitObjectives(player)
|
||||
InitObjectives(USSR)
|
||||
|
||||
KillAll = AddPrimaryObjective(player, "defeat-allied-forces")
|
||||
KillAll = AddPrimaryObjective(USSR, "defeat-allied-forces")
|
||||
BeatUSSR = AddPrimaryObjective(Greece, "")
|
||||
KillRadar = AddSecondaryObjective(player, "destroy-radar-dome-reinforcements")
|
||||
KillRadar = AddSecondaryObjective(USSR, "destroy-radar-dome-reinforcements")
|
||||
|
||||
Trigger.OnKilled(RadarDome, function()
|
||||
player.MarkCompletedObjective(KillRadar)
|
||||
Media.PlaySpeechNotification(player, "ObjectiveMet")
|
||||
USSR.MarkCompletedObjective(KillRadar)
|
||||
Media.PlaySpeechNotification(USSR, "ObjectiveMet")
|
||||
end)
|
||||
|
||||
Trigger.OnDamaged(Harvester, function()
|
||||
|
||||
@@ -46,13 +46,13 @@ InfantryGGWaypoints = { PatrolPoint2, BetweenBasesPoint, PrepGGArmyPoint }
|
||||
TanksGGWaypoints = { PatrolPoint2, BetweenBasesPoint, PrepGGArmyPoint }
|
||||
|
||||
Para = function()
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = player })
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
powerproxy.TargetParatroopers(ParaPoint.CenterPosition, Angle.New(112))
|
||||
powerproxy.Destroy()
|
||||
end
|
||||
|
||||
Para2 = function()
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = player })
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR })
|
||||
powerproxy.TargetParatroopers(USSRExpansionPoint.CenterPosition, Angle.New(112))
|
||||
powerproxy.Destroy()
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
]]
|
||||
|
||||
CheckForBase = function()
|
||||
baseBuildings = Map.ActorsInBox(Map.TopLeft, CFBPoint.CenterPosition, function(actor)
|
||||
local baseBuildings = Map.ActorsInBox(Map.TopLeft, CFBPoint.CenterPosition, function(actor)
|
||||
return actor.Type == "fact" or actor.Type == "powr"
|
||||
end)
|
||||
|
||||
@@ -38,7 +38,7 @@ RunInitialActivities = function()
|
||||
Trigger.AfterDelay(1, function()
|
||||
Harvester.FindResources()
|
||||
IdlingUnits()
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == Greece and self.HasProperty("StartBuildingRepairs") end)
|
||||
Utils.Do(buildings, function(actor)
|
||||
@@ -50,12 +50,12 @@ RunInitialActivities = function()
|
||||
end)
|
||||
end)
|
||||
|
||||
Reinforcements.Reinforce(player, SovietStartReinf, SovietStartToBasePath, 0, function(soldier)
|
||||
Reinforcements.Reinforce(USSR, SovietStartReinf, SovietStartToBasePath, 0, function(soldier)
|
||||
soldier.AttackMove(SovietBasePoint.Location)
|
||||
end)
|
||||
|
||||
Actor.Create("camera", true, { Owner = player, Location = GreeceBasePoint.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = SovietBasePoint.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = GreeceBasePoint.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = SovietBasePoint.Location })
|
||||
|
||||
startmcv.Move(MCVStartMovePoint.Location)
|
||||
Runner1.Move(RunnerPoint.Location)
|
||||
@@ -132,14 +132,14 @@ end
|
||||
|
||||
Tick = function()
|
||||
if Greece.HasNoRequiredUnits() and GoodGuy.HasNoRequiredUnits() then
|
||||
player.MarkCompletedObjective(KillAll)
|
||||
USSR.MarkCompletedObjective(KillAll)
|
||||
|
||||
if HoldObjective then
|
||||
player.MarkCompletedObjective(HoldObjective)
|
||||
USSR.MarkCompletedObjective(HoldObjective)
|
||||
end
|
||||
end
|
||||
|
||||
if player.HasNoRequiredUnits() then
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
GoodGuy.MarkCompletedObjective(BeatUSSR)
|
||||
end
|
||||
|
||||
@@ -153,8 +153,8 @@ Tick = function()
|
||||
GoodGuy.Resources = GoodGuy.ResourceCapacity * 0.25
|
||||
end
|
||||
|
||||
if not baseEstablished and CheckForBase() then
|
||||
baseEstablished = true
|
||||
if not BaseEstablished and CheckForBase() then
|
||||
BaseEstablished = true
|
||||
Para()
|
||||
end
|
||||
|
||||
@@ -182,14 +182,14 @@ Tick = function()
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("USSR")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
GoodGuy = Player.GetPlayer("GoodGuy")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
|
||||
InitObjectives(player)
|
||||
InitObjectives(USSR)
|
||||
|
||||
CaptureObjective = AddPrimaryObjective(player, "capture-radar-dome")
|
||||
KillAll = AddPrimaryObjective(player, "defeat-allied-forces")
|
||||
CaptureObjective = AddPrimaryObjective(USSR, "capture-radar-dome")
|
||||
KillAll = AddPrimaryObjective(USSR, "defeat-allied-forces")
|
||||
BeatUSSR = AddPrimaryObjective(Greece, "")
|
||||
|
||||
RunInitialActivities()
|
||||
@@ -198,30 +198,30 @@ WorldLoaded = function()
|
||||
Trigger.OnDamaged(mcvtransport, Expand)
|
||||
|
||||
Trigger.OnKilled(RadarDome, function()
|
||||
if not player.IsObjectiveCompleted(CaptureObjective) then
|
||||
player.MarkFailedObjective(CaptureObjective)
|
||||
if not USSR.IsObjectiveCompleted(CaptureObjective) then
|
||||
USSR.MarkFailedObjective(CaptureObjective)
|
||||
end
|
||||
|
||||
if HoldObjective then
|
||||
player.MarkFailedObjective(HoldObjective)
|
||||
USSR.MarkFailedObjective(HoldObjective)
|
||||
end
|
||||
end)
|
||||
|
||||
RadarDome.GrantCondition("french")
|
||||
Trigger.OnCapture(RadarDome, function()
|
||||
if player.IsObjectiveCompleted(KillAll) then
|
||||
player.MarkCompletedObjective(CaptureObjective)
|
||||
if USSR.IsObjectiveCompleted(KillAll) then
|
||||
USSR.MarkCompletedObjective(CaptureObjective)
|
||||
return
|
||||
end
|
||||
|
||||
HoldObjective = AddPrimaryObjective(player, "defend-radar-dome")
|
||||
player.MarkCompletedObjective(CaptureObjective)
|
||||
Beacon.New(player, MCVDeploy.CenterPosition)
|
||||
HoldObjective = AddPrimaryObjective(USSR, "defend-radar-dome")
|
||||
USSR.MarkCompletedObjective(CaptureObjective)
|
||||
Beacon.New(USSR, MCVDeploy.CenterPosition)
|
||||
if Difficulty == "easy" then
|
||||
Actor.Create("camera", true, { Owner = player, Location = MCVDeploy.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = MCVDeploy.Location })
|
||||
Media.DisplayMessage(UserInterface.Translate("allied-expansion-movement-detected"))
|
||||
else
|
||||
Actor.Create("MCV.CAM", true, { Owner = player, Location = MCVDeploy.Location })
|
||||
Actor.Create("MCV.CAM", true, { Owner = USSR, Location = MCVDeploy.Location })
|
||||
Media.DisplayMessage(UserInterface.Translate("coordinates-allied-expansion-discovered"))
|
||||
end
|
||||
|
||||
@@ -236,18 +236,18 @@ WorldLoaded = function()
|
||||
Trigger.ClearAll(RadarDome)
|
||||
Trigger.AfterDelay(0, function()
|
||||
Trigger.OnRemovedFromWorld(RadarDome, function()
|
||||
player.MarkFailedObjective(HoldObjective)
|
||||
USSR.MarkFailedObjective(HoldObjective)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(USSRExpansionPoint.CenterPosition, WDist.New(4 * 1024), function(unit, id)
|
||||
if unit.Owner == player and RadarDome.Owner == player then
|
||||
if unit.Owner == USSR and RadarDome.Owner == USSR then
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
|
||||
Para2()
|
||||
|
||||
local units = Reinforcements.ReinforceWithTransport(player, "lst", SovietMCVReinf, { ReinfSouthPoint.Location, USSRlstPoint.Location }, { ReinfSouthPoint.Location })[2]
|
||||
local units = Reinforcements.ReinforceWithTransport(USSR, "lst", SovietMCVReinf, { ReinfSouthPoint.Location, USSRlstPoint.Location }, { ReinfSouthPoint.Location })[2]
|
||||
Utils.Do(units, function(unit)
|
||||
Trigger.OnAddedToWorld(unit, function()
|
||||
if unit.Type == "mcv" then
|
||||
@@ -258,7 +258,7 @@ WorldLoaded = function()
|
||||
end)
|
||||
end)
|
||||
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
information, see COPYING.
|
||||
]]
|
||||
IdlingUnits = function()
|
||||
local lazyUnits = enemy.GetGroundAttackers()
|
||||
local lazyUnits = Greece.GetGroundAttackers()
|
||||
|
||||
Utils.Do(lazyUnits, function(unit)
|
||||
Trigger.OnDamaged(unit, function()
|
||||
@@ -38,19 +38,19 @@ end
|
||||
|
||||
BuildBuilding = function(building)
|
||||
Trigger.AfterDelay(Actor.BuildTime(building.type), function()
|
||||
if CYard.IsDead or CYard.Owner ~= enemy then
|
||||
if CYard.IsDead or CYard.Owner ~= Greece then
|
||||
return
|
||||
elseif Harvester.IsDead and enemy.Resources <= 299 then
|
||||
elseif Harvester.IsDead and Greece.Resources <= 299 then
|
||||
return
|
||||
end
|
||||
|
||||
local actor = Actor.Create(building.type, true, { Owner = enemy, Location = CYardLocation.Location + building.pos })
|
||||
enemy.Cash = enemy.Cash - building.cost
|
||||
local actor = Actor.Create(building.type, true, { Owner = Greece, Location = CYardLocation.Location + building.pos })
|
||||
Greece.Cash = Greece.Cash - building.cost
|
||||
|
||||
building.exists = true
|
||||
Trigger.OnKilled(actor, function() building.exists = false end)
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == enemy and building.Health < building.MaxHealth * 3/4 then
|
||||
if building.Owner == Greece and building.Health < building.MaxHealth * 3/4 then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
@@ -62,14 +62,14 @@ end
|
||||
ProduceInfantry = function()
|
||||
if not BaseTent.exists then
|
||||
return
|
||||
elseif Harvester.IsDead and enemy.Resources <= 299 then
|
||||
elseif Harvester.IsDead and Greece.Resources <= 299 then
|
||||
return
|
||||
end
|
||||
|
||||
local delay = Utils.RandomInteger(DateTime.Seconds(3), DateTime.Seconds(9))
|
||||
local toBuild = { Utils.Random(AlliedInfantryTypes) }
|
||||
local Path = Utils.Random(AttackPaths)
|
||||
enemy.Build(toBuild, function(unit)
|
||||
Greece.Build(toBuild, function(unit)
|
||||
InfAttack[#InfAttack + 1] = unit[1]
|
||||
|
||||
if #InfAttack >= 10 then
|
||||
@@ -85,14 +85,14 @@ end
|
||||
ProduceArmor = function()
|
||||
if not BaseWeap.exists then
|
||||
return
|
||||
elseif Harvester.IsDead and enemy.Resources <= 599 then
|
||||
elseif Harvester.IsDead and Greece.Resources <= 599 then
|
||||
return
|
||||
end
|
||||
|
||||
local delay = Utils.RandomInteger(DateTime.Seconds(12), DateTime.Seconds(17))
|
||||
local toBuild = { Utils.Random(AlliedArmorTypes) }
|
||||
local Path = Utils.Random(AttackPaths)
|
||||
enemy.Build(toBuild, function(unit)
|
||||
Greece.Build(toBuild, function(unit)
|
||||
ArmorAttack[#ArmorAttack + 1] = unit[1]
|
||||
|
||||
if #ArmorAttack >= 6 then
|
||||
|
||||
@@ -43,20 +43,20 @@ EnemyPaths =
|
||||
{ EnemyEntry2.Location, EnemyRally2.Location }
|
||||
}
|
||||
|
||||
wave = 0
|
||||
Wave = 0
|
||||
SendEnemies = function()
|
||||
Trigger.AfterDelay(EnemyAttackDelay[Difficulty], function()
|
||||
|
||||
wave = wave + 1
|
||||
if wave > 3 then
|
||||
wave = 1
|
||||
Wave = Wave + 1
|
||||
if Wave > 3 then
|
||||
Wave = 1
|
||||
end
|
||||
|
||||
if wave == 1 then
|
||||
local units = Reinforcements.ReinforceWithTransport(enemy, "tran", EnemyReinforcements[Difficulty][wave], EnemyPaths[1], { EnemyPaths[1][1] })[2]
|
||||
if Wave == 1 then
|
||||
local units = Reinforcements.ReinforceWithTransport(Greece, "tran", EnemyReinforcements[Difficulty][Wave], EnemyPaths[1], { EnemyPaths[1][1] })[2]
|
||||
Utils.Do(units, IdleHunt)
|
||||
else
|
||||
local units = Reinforcements.ReinforceWithTransport(enemy, "lst", EnemyReinforcements[Difficulty][wave], EnemyPaths[2], { EnemyPaths[2][1] })[2]
|
||||
local units = Reinforcements.ReinforceWithTransport(Greece, "lst", EnemyReinforcements[Difficulty][Wave], EnemyPaths[2], { EnemyPaths[2][1] })[2]
|
||||
Utils.Do(units, IdleHunt)
|
||||
end
|
||||
|
||||
|
||||
@@ -26,17 +26,17 @@ CameraBarrierTrigger = { CPos.New(65, 39), CPos.New(65, 40), CPos.New(66, 40), C
|
||||
CameraBaseTrigger = { CPos.New(53, 42), CPos.New(54, 42), CPos.New(54, 41), CPos.New(55, 41), CPos.New(56, 41), CPos.New(56, 40), CPos.New(57, 40), CPos.New(57, 39), CPos.New(58, 39), CPos.New(59, 39), CPos.New(59, 38), CPos.New(60, 38), CPos.New(61, 38) }
|
||||
|
||||
Trigger.OnEnteredFootprint(TruckGoalTrigger, function(a, id)
|
||||
if not truckGoalTrigger and a.Owner == player and a.Type == "truk" then
|
||||
truckGoalTrigger = true
|
||||
player.MarkCompletedObjective(sovietObjective)
|
||||
player.MarkCompletedObjective(SaveAllTrucks)
|
||||
if not TruckGoalTriggered and a.Owner == USSR and a.Type == "truk" then
|
||||
TruckGoalTriggered = true
|
||||
USSR.MarkCompletedObjective(SovietObjective)
|
||||
USSR.MarkCompletedObjective(SaveAllTrucks)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(CameraBarrierTrigger, function(a, id)
|
||||
if not cameraBarrierTrigger and a.Owner == player then
|
||||
cameraBarrierTrigger = true
|
||||
local cameraBarrier = Actor.Create("camera", true, { Owner = player, Location = CameraBarrier.Location })
|
||||
if not CameraBarrierTriggered and a.Owner == USSR then
|
||||
CameraBarrierTriggered = true
|
||||
local cameraBarrier = Actor.Create("camera", true, { Owner = USSR, Location = CameraBarrier.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(15), function()
|
||||
cameraBarrier.Destroy()
|
||||
end)
|
||||
@@ -44,12 +44,12 @@ Trigger.OnEnteredFootprint(CameraBarrierTrigger, function(a, id)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(CameraBaseTrigger, function(a, id)
|
||||
if not cameraBaseTrigger and a.Owner == player then
|
||||
cameraBaseTrigger = true
|
||||
local cameraBase1 = Actor.Create("camera", true, { Owner = player, Location = CameraBase1.Location })
|
||||
local cameraBase2 = Actor.Create("camera", true, { Owner = player, Location = CameraBase2.Location })
|
||||
local cameraBase3 = Actor.Create("camera", true, { Owner = player, Location = CameraBase3.Location })
|
||||
local cameraBase4 = Actor.Create("camera", true, { Owner = player, Location = CameraBase4.Location })
|
||||
if not CameraBaseTriggered and a.Owner == USSR then
|
||||
CameraBaseTriggered = true
|
||||
local cameraBase1 = Actor.Create("camera", true, { Owner = USSR, Location = CameraBase1.Location })
|
||||
local cameraBase2 = Actor.Create("camera", true, { Owner = USSR, Location = CameraBase2.Location })
|
||||
local cameraBase3 = Actor.Create("camera", true, { Owner = USSR, Location = CameraBase3.Location })
|
||||
local cameraBase4 = Actor.Create("camera", true, { Owner = USSR, Location = CameraBase4.Location })
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), function()
|
||||
cameraBase1.Destroy()
|
||||
cameraBase2.Destroy()
|
||||
@@ -60,44 +60,44 @@ Trigger.OnEnteredFootprint(CameraBaseTrigger, function(a, id)
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(Trucks, function()
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
Greece.MarkCompletedObjective(AlliedObjective)
|
||||
end)
|
||||
|
||||
Trigger.OnAnyKilled(Trucks, function()
|
||||
player.MarkFailedObjective(SaveAllTrucks)
|
||||
USSR.MarkFailedObjective(SaveAllTrucks)
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Apwr, function(building)
|
||||
Trigger.OnKilled(Apwr, function()
|
||||
BaseApwr.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Barr, function(building)
|
||||
Trigger.OnKilled(Barr, function()
|
||||
BaseTent.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Proc, function(building)
|
||||
Trigger.OnKilled(Proc, function()
|
||||
BaseProc.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Weap, function(building)
|
||||
Trigger.OnKilled(Weap, function()
|
||||
BaseWeap.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Apwr2, function(building)
|
||||
Trigger.OnKilled(Apwr2, function()
|
||||
BaseApwr2.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilledOrCaptured(Dome, function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
player.MarkCompletedObjective(sovietObjective2)
|
||||
Media.PlaySpeechNotification(player, "ObjectiveMet")
|
||||
USSR.MarkCompletedObjective(SovietObjective2)
|
||||
Media.PlaySpeechNotification(USSR, "ObjectiveMet")
|
||||
end)
|
||||
end)
|
||||
|
||||
-- Activate the AI once the player deployed the Mcv
|
||||
Trigger.OnRemovedFromWorld(Mcv, function()
|
||||
if not mcvDeployed then
|
||||
mcvDeployed = true
|
||||
if not McvDeployed then
|
||||
McvDeployed = true
|
||||
BuildBase()
|
||||
SendEnemies()
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), ProduceInfantry)
|
||||
@@ -111,8 +111,8 @@ Trigger.OnRemovedFromWorld(Mcv, function()
|
||||
end)
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("USSR")
|
||||
enemy = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
|
||||
Camera.Position = CameraStart.CenterPosition
|
||||
|
||||
@@ -123,33 +123,33 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Utils.Do(Map.NamedActors, function(actor)
|
||||
if actor.Owner == enemy and actor.HasProperty("StartBuildingRepairs") then
|
||||
if actor.Owner == Greece and actor.HasProperty("StartBuildingRepairs") then
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == enemy and building.Health < 3/4 * building.MaxHealth then
|
||||
if building.Owner == Greece and building.Health < 3/4 * building.MaxHealth then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements1, SovietReinforcements1Waypoints)
|
||||
Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements2, SovietReinforcements2Waypoints)
|
||||
Reinforcements.ReinforceWithTransport(USSR, "apc", SovietReinforcements1, SovietReinforcements1Waypoints)
|
||||
Reinforcements.ReinforceWithTransport(USSR, "apc", SovietReinforcements2, SovietReinforcements2Waypoints)
|
||||
|
||||
InitObjectives(player)
|
||||
InitObjectives(USSR)
|
||||
|
||||
alliedObjective = AddPrimaryObjective(enemy, "")
|
||||
sovietObjective = AddPrimaryObjective(player, "escort-convoy")
|
||||
sovietObjective2 = AddSecondaryObjective(player, "destroy-capture-radar-dome-reinforcements")
|
||||
SaveAllTrucks = AddSecondaryObjective(player, "Keep all trucks alive.")
|
||||
AlliedObjective = AddPrimaryObjective(Greece, "")
|
||||
SovietObjective = AddPrimaryObjective(USSR, "escort-convoy")
|
||||
SovietObjective2 = AddSecondaryObjective(USSR, "destroy-capture-radar-dome-reinforcements")
|
||||
SaveAllTrucks = AddSecondaryObjective(USSR, "Keep all trucks alive.")
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if player.HasNoRequiredUnits() then
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(AlliedObjective)
|
||||
end
|
||||
|
||||
if enemy.Resources >= enemy.ResourceCapacity * 0.75 then
|
||||
enemy.Cash = enemy.Cash + enemy.Resources - enemy.ResourceCapacity * 0.25
|
||||
enemy.Resources = enemy.ResourceCapacity * 0.25
|
||||
if Greece.Resources >= Greece.ResourceCapacity * 0.75 then
|
||||
Greece.Cash = Greece.Cash + Greece.Resources - Greece.ResourceCapacity * 0.25
|
||||
Greece.Resources = Greece.ResourceCapacity * 0.25
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
information, see COPYING.
|
||||
]]
|
||||
IdlingUnits = function()
|
||||
local lazyUnits = enemy.GetGroundAttackers()
|
||||
local lazyUnits = Greece.GetGroundAttackers()
|
||||
|
||||
Utils.Do(lazyUnits, function(unit)
|
||||
Trigger.OnDamaged(unit, function()
|
||||
@@ -38,19 +38,19 @@ end
|
||||
|
||||
BuildBuilding = function(building)
|
||||
Trigger.AfterDelay(Actor.BuildTime(building.type), function()
|
||||
if CYard.IsDead or CYard.Owner ~= enemy then
|
||||
if CYard.IsDead or CYard.Owner ~= Greece then
|
||||
return
|
||||
elseif Harvester.IsDead and enemy.Resources <= 299 then
|
||||
elseif Harvester.IsDead and Greece.Resources <= 299 then
|
||||
return
|
||||
end
|
||||
|
||||
local actor = Actor.Create(building.type, true, { Owner = enemy, Location = CYardLocation.Location + building.pos })
|
||||
enemy.Cash = enemy.Cash - building.cost
|
||||
local actor = Actor.Create(building.type, true, { Owner = Greece, Location = CYardLocation.Location + building.pos })
|
||||
Greece.Cash = Greece.Cash - building.cost
|
||||
|
||||
building.exists = true
|
||||
Trigger.OnKilled(actor, function() building.exists = false end)
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == enemy and building.Health < building.MaxHealth * 3/4 then
|
||||
if building.Owner == Greece and building.Health < building.MaxHealth * 3/4 then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
@@ -62,14 +62,14 @@ end
|
||||
ProduceInfantry = function()
|
||||
if not BaseTent.exists then
|
||||
return
|
||||
elseif Harvester.IsDead and enemy.Resources <= 299 then
|
||||
elseif Harvester.IsDead and Greece.Resources <= 299 then
|
||||
return
|
||||
end
|
||||
|
||||
local delay = Utils.RandomInteger(DateTime.Seconds(3), DateTime.Seconds(9))
|
||||
local toBuild = { Utils.Random(AlliedInfantryTypes) }
|
||||
local Path = Utils.Random(AttackPaths)
|
||||
enemy.Build(toBuild, function(unit)
|
||||
Greece.Build(toBuild, function(unit)
|
||||
InfAttack[#InfAttack + 1] = unit[1]
|
||||
|
||||
if #InfAttack >= 10 then
|
||||
@@ -85,14 +85,14 @@ end
|
||||
ProduceArmor = function()
|
||||
if not BaseWeap.exists then
|
||||
return
|
||||
elseif Harvester.IsDead and enemy.Resources <= 599 then
|
||||
elseif Harvester.IsDead and Greece.Resources <= 599 then
|
||||
return
|
||||
end
|
||||
|
||||
local delay = Utils.RandomInteger(DateTime.Seconds(12), DateTime.Seconds(17))
|
||||
local toBuild = { Utils.Random(AlliedArmorTypes) }
|
||||
local Path = Utils.Random(AttackPaths)
|
||||
enemy.Build(toBuild, function(unit)
|
||||
Greece.Build(toBuild, function(unit)
|
||||
ArmorAttack[#ArmorAttack + 1] = unit[1]
|
||||
|
||||
if #ArmorAttack >= 6 then
|
||||
|
||||
@@ -43,20 +43,20 @@ EnemyPaths =
|
||||
{ EnemyEntry2.Location, EnemyRally2.Location }
|
||||
}
|
||||
|
||||
wave = 0
|
||||
Wave = 0
|
||||
SendEnemies = function()
|
||||
Trigger.AfterDelay(EnemyAttackDelay[Difficulty], function()
|
||||
|
||||
wave = wave + 1
|
||||
if wave > 3 then
|
||||
wave = 1
|
||||
Wave = Wave + 1
|
||||
if Wave > 3 then
|
||||
Wave = 1
|
||||
end
|
||||
|
||||
if wave == 1 then
|
||||
local units = Reinforcements.ReinforceWithTransport(enemy, "tran", EnemyReinforcements[Difficulty][wave], EnemyPaths[1], { EnemyPaths[1][1] })[2]
|
||||
if Wave == 1 then
|
||||
local units = Reinforcements.ReinforceWithTransport(Greece, "tran", EnemyReinforcements[Difficulty][Wave], EnemyPaths[1], { EnemyPaths[1][1] })[2]
|
||||
Utils.Do(units, IdleHunt)
|
||||
else
|
||||
local units = Reinforcements.ReinforceWithTransport(enemy, "lst", EnemyReinforcements[Difficulty][wave], EnemyPaths[2], { EnemyPaths[2][1] })[2]
|
||||
local units = Reinforcements.ReinforceWithTransport(Greece, "lst", EnemyReinforcements[Difficulty][Wave], EnemyPaths[2], { EnemyPaths[2][1] })[2]
|
||||
Utils.Do(units, IdleHunt)
|
||||
end
|
||||
|
||||
|
||||
@@ -23,51 +23,51 @@ SovietReinforcements2Waypoints = { McvWaypoint.Location, APCWaypoint2.Location }
|
||||
TruckGoalTrigger = { CPos.New(85, 10), CPos.New(85, 11), CPos.New(85, 12), CPos.New(86, 13), CPos.New(87, 13), CPos.New(88, 13), CPos.New(88, 14), CPos.New(89, 14), CPos.New(90, 14), CPos.New(90, 15), CPos.New(91, 15), CPos.New(91, 16), CPos.New(91, 17), CPos.New(92, 17), CPos.New(93, 17), CPos.New(94, 17), CPos.New(94, 18), CPos.New(95, 18), CPos.New(96, 18), CPos.New(96, 19), CPos.New(97, 19), CPos.New(98, 19)}
|
||||
|
||||
Trigger.OnEnteredFootprint(TruckGoalTrigger, function(a, id)
|
||||
if not truckGoalTrigger and a.Owner == player and a.Type == "truk" then
|
||||
truckGoalTrigger = true
|
||||
player.MarkCompletedObjective(sovietObjective)
|
||||
player.MarkCompletedObjective(SaveAllTrucks)
|
||||
if not TruckGoalTriggered and a.Owner == USSR and a.Type == "truk" then
|
||||
TruckGoalTriggered = true
|
||||
USSR.MarkCompletedObjective(SovietObjective)
|
||||
USSR.MarkCompletedObjective(SaveAllTrucks)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(Trucks, function()
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
Greece.MarkCompletedObjective(AlliedObjective)
|
||||
end)
|
||||
|
||||
Trigger.OnAnyKilled(Trucks, function()
|
||||
player.MarkFailedObjective(SaveAllTrucks)
|
||||
USSR.MarkFailedObjective(SaveAllTrucks)
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Apwr, function(building)
|
||||
Trigger.OnKilled(Apwr, function()
|
||||
BaseApwr.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Barr, function(building)
|
||||
Trigger.OnKilled(Barr, function()
|
||||
BaseTent.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Proc, function(building)
|
||||
Trigger.OnKilled(Proc, function()
|
||||
BaseProc.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Weap, function(building)
|
||||
Trigger.OnKilled(Weap, function()
|
||||
BaseWeap.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(Apwr2, function(building)
|
||||
Trigger.OnKilled(Apwr2, function()
|
||||
BaseApwr2.exists = false
|
||||
end)
|
||||
|
||||
Trigger.OnKilledOrCaptured(Dome, function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
player.MarkCompletedObjective(sovietObjective2)
|
||||
Media.PlaySpeechNotification(player, "ObjectiveMet")
|
||||
USSR.MarkCompletedObjective(SovietObjective2)
|
||||
Media.PlaySpeechNotification(USSR, "ObjectiveMet")
|
||||
end)
|
||||
end)
|
||||
|
||||
Trigger.OnRemovedFromWorld(Mcv, function()
|
||||
if not mcvDeployed then
|
||||
mcvDeployed = true
|
||||
if not McvDeployed then
|
||||
McvDeployed = true
|
||||
BuildBase()
|
||||
SendEnemies()
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), ProduceInfantry)
|
||||
@@ -76,8 +76,8 @@ Trigger.OnRemovedFromWorld(Mcv, function()
|
||||
end)
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("USSR")
|
||||
enemy = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
|
||||
Camera.Position = CameraStart.CenterPosition
|
||||
|
||||
@@ -87,33 +87,33 @@ WorldLoaded = function()
|
||||
IdleHunt(actor)
|
||||
end)
|
||||
|
||||
Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements1, SovietReinforcements1Waypoints)
|
||||
Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements2, SovietReinforcements2Waypoints)
|
||||
Reinforcements.ReinforceWithTransport(USSR, "apc", SovietReinforcements1, SovietReinforcements1Waypoints)
|
||||
Reinforcements.ReinforceWithTransport(USSR, "apc", SovietReinforcements2, SovietReinforcements2Waypoints)
|
||||
|
||||
Utils.Do(Map.NamedActors, function(actor)
|
||||
if actor.Owner == enemy and actor.HasProperty("StartBuildingRepairs") then
|
||||
if actor.Owner == Greece and actor.HasProperty("StartBuildingRepairs") then
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == enemy and building.Health < 3/4 * building.MaxHealth then
|
||||
if building.Owner == Greece and building.Health < 3/4 * building.MaxHealth then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
InitObjectives(player)
|
||||
alliedObjective = AddPrimaryObjective(enemy, "")
|
||||
sovietObjective = AddPrimaryObjective(player, "escort-convoy")
|
||||
sovietObjective2 = AddSecondaryObjective(player, "destroy-capture-radar-dome-reinforcements")
|
||||
SaveAllTrucks = AddSecondaryObjective(player, "Keep all trucks alive.")
|
||||
InitObjectives(USSR)
|
||||
AlliedObjective = AddPrimaryObjective(Greece, "")
|
||||
SovietObjective = AddPrimaryObjective(USSR, "escort-convoy")
|
||||
SovietObjective2 = AddSecondaryObjective(USSR, "destroy-capture-radar-dome-reinforcements")
|
||||
SaveAllTrucks = AddSecondaryObjective(USSR, "Keep all trucks alive.")
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if player.HasNoRequiredUnits() then
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(AlliedObjective)
|
||||
end
|
||||
|
||||
if enemy.Resources >= enemy.ResourceCapacity * 0.75 then
|
||||
enemy.Cash = enemy.Cash + enemy.Resources - enemy.ResourceCapacity * 0.25
|
||||
enemy.Resources = enemy.ResourceCapacity * 0.25
|
||||
if Greece.Resources >= Greece.ResourceCapacity * 0.75 then
|
||||
Greece.Cash = Greece.Cash + Greece.Resources - Greece.ResourceCapacity * 0.25
|
||||
Greece.Resources = Greece.ResourceCapacity * 0.25
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
information, see COPYING.
|
||||
]]
|
||||
if Difficulty == "easy" then
|
||||
remainingTime = DateTime.Minutes(7)
|
||||
RemainingTime = DateTime.Minutes(7)
|
||||
elseif Difficulty == "normal" then
|
||||
remainingTime = DateTime.Minutes(6)
|
||||
RemainingTime = DateTime.Minutes(6)
|
||||
elseif Difficulty == "hard" then
|
||||
remainingTime = DateTime.Minutes(5)
|
||||
RemainingTime = DateTime.Minutes(5)
|
||||
end
|
||||
|
||||
Dogs = { Dog1, Dog2, Dog3, Dog4, Dog5, Dog6, Dog7, Dog8, Dog9, Dog10, Dog11, Dog12, Dog13, Dog14, Dog15, Dog16, Dog17, Dog18, Dog19 }
|
||||
@@ -40,61 +40,61 @@ RSoldierTrapTrigger = { CPos.New(72, 72), CPos.New(72,73), CPos.New(72,74) }
|
||||
SoldierTrap2Trigger = { CPos.New(51, 73), CPos.New(51, 74) }
|
||||
|
||||
Trigger.OnEnteredFootprint(CameraCCTrigger, function(a, id)
|
||||
if not cameraCCTrigger and a.Owner == player then
|
||||
cameraCCTrigger = true
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraCC.Location })
|
||||
if not CameraCCTriggered and a.Owner == USSR then
|
||||
CameraCCTriggered = true
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraCC.Location })
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(CameraGoalCenterTrigger, function(a, id)
|
||||
if not cameraGoalCenterTrigger and a.Owner == player then
|
||||
cameraGoalCenterTrigger = true
|
||||
if not controlCenterEngineerTrigger then
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraGoalCenter1.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraGoalCenter2.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraGoalCenter3.Location })
|
||||
if not CameraGoalCenterTriggered and a.Owner == USSR then
|
||||
CameraGoalCenterTriggered = true
|
||||
if not ControlCenterEngineerTriggered then
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraGoalCenter1.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraGoalCenter2.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraGoalCenter3.Location })
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(CameraGoalLeftTrigger, function(a, id)
|
||||
if not cameraGoalLeftTrigger and a.Owner == player then
|
||||
cameraGoalLeftTrigger = true
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraGoalLeft1.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraGoalLeft2.Location })
|
||||
if not CameraGoalLeftTriggered and a.Owner == USSR then
|
||||
CameraGoalLeftTriggered = true
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraGoalLeft1.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraGoalLeft2.Location })
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(CameraGoalRightTrigger, function(a, id)
|
||||
if not cameraGoalRightTrigger and a.Owner == player then
|
||||
cameraGoalRightTrigger = true
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraGoalRight1.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraGoalRight2.Location })
|
||||
if not CameraGoalRightTriggered and a.Owner == USSR then
|
||||
CameraGoalRightTriggered = true
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraGoalRight1.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraGoalRight2.Location })
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(ControlCenterTrigger, function(a, id)
|
||||
if not controlCenterTrigger and a.Owner == player and a.Type == "e1" then
|
||||
controlCenterTrigger = true
|
||||
if not ControlCenterTriggered and a.Owner == USSR and a.Type == "e1" then
|
||||
ControlCenterTriggered = true
|
||||
FTurPrisoners.Kill()
|
||||
FTurLeft.Kill()
|
||||
FTurRight.Kill()
|
||||
FTurBottom.Kill()
|
||||
player.MarkCompletedObjective(sovietObjective1)
|
||||
USSR.MarkCompletedObjective(SovietObjective1)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(ControlCenterEngineerTrigger, function(a, id)
|
||||
if not controlCenterEngineerTrigger and a.Owner == player and a.Type == "e6" then
|
||||
controlCenterEngineerTrigger = true
|
||||
local fturA = Actor.Create("ftur", true, { Owner = player, Location = FTur1Goal.Location})
|
||||
local fturB = Actor.Create("ftur", true, { Owner = player, Location = FTur2Goal.Location})
|
||||
if not ControlCenterEngineerTriggered and a.Owner == USSR and a.Type == "e6" then
|
||||
ControlCenterEngineerTriggered = true
|
||||
local fturA = Actor.Create("ftur", true, { Owner = USSR, Location = FTur1Goal.Location})
|
||||
local fturB = Actor.Create("ftur", true, { Owner = USSR, Location = FTur2Goal.Location})
|
||||
Camera.Position = CameraGoalCenter1.CenterPosition
|
||||
|
||||
if not cameraGoalRightTrigger then
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraGoalCenter1.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraGoalCenter2.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraGoalCenter3.Location })
|
||||
if not CameraGoalRightTriggered then
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraGoalCenter1.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraGoalCenter2.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraGoalCenter3.Location })
|
||||
end
|
||||
|
||||
Utils.Do(GoalGuards, function(actor)
|
||||
@@ -108,75 +108,75 @@ Trigger.OnEnteredFootprint(ControlCenterEngineerTrigger, function(a, id)
|
||||
Tanya.Demolish(fturB)
|
||||
end
|
||||
|
||||
player.MarkCompletedObjective(sovietObjective4)
|
||||
USSR.MarkCompletedObjective(SovietObjective4)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(FTurBottomTrigger, function(a, id)
|
||||
if not fTurBottomTrigger and a.Owner == player then
|
||||
fTurBottomTrigger = true
|
||||
if not rSoldierTrapTrigger then
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraRSoldier.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraFTurBottom.Location })
|
||||
if not FTurBottomTriggered and a.Owner == USSR then
|
||||
FTurBottomTriggered = true
|
||||
if not RSoldierTrapTriggered then
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraRSoldier.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraFTurBottom.Location })
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(FTurLeftTrigger, function(a, id)
|
||||
if not fTurLeftTrigger and a.Owner == player then
|
||||
fTurLeftTrigger = true
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraFTurLeft.Location })
|
||||
if not FTurLeftTriggered and a.Owner == USSR then
|
||||
FTurLeftTriggered = true
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraFTurLeft.Location })
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(FTurRightTrigger, function(a, id)
|
||||
if not fTurRightTrigger and a.Owner == player then
|
||||
fTurRightTrigger = true
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraFTurRight.Location })
|
||||
if not FTurRightTriggered and a.Owner == USSR then
|
||||
FTurRightTriggered = true
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraFTurRight.Location })
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(GoalCenterTrigger, function(a, id)
|
||||
if not goalCenterTrigger and a.Owner == player and a.Type == "e6" then
|
||||
goalCenterTrigger = true
|
||||
player.MarkCompletedObjective(sovietObjective5)
|
||||
if not GoalCenterTriggered and a.Owner == USSR and a.Type == "e6" then
|
||||
GoalCenterTriggered = true
|
||||
USSR.MarkCompletedObjective(SovietObjective5)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(GoalLeft1Trigger, function(a, id)
|
||||
if not goalLeft1Trigger and a.Owner == player and a.Type == "e6" then
|
||||
goalLeft1Trigger = true
|
||||
Media.PlaySpeechNotification(player, "ControlCenterDeactivated")
|
||||
if not GoalLeft1Triggered and a.Owner == USSR and a.Type == "e6" then
|
||||
GoalLeft1Triggered = true
|
||||
Media.PlaySpeechNotification(USSR, "ControlCenterDeactivated")
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(GoalLeft2Trigger, function(a, id)
|
||||
if not goalLeft2Trigger and a.Owner == player and a.Type == "e6" then
|
||||
goalLeft2Trigger = true
|
||||
Media.PlaySpeechNotification(player, "ControlCenterDeactivated")
|
||||
if not GoalLeft2Triggered and a.Owner == USSR and a.Type == "e6" then
|
||||
GoalLeft2Triggered = true
|
||||
Media.PlaySpeechNotification(USSR, "ControlCenterDeactivated")
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(GoalRight1Trigger, function(a, id)
|
||||
if not goalRight1Trigger and a.Owner == player and a.Type == "e6" then
|
||||
goalRight1Trigger = true
|
||||
Media.PlaySpeechNotification(player, "ControlCenterDeactivated")
|
||||
if not GoalRight1Triggered and a.Owner == USSR and a.Type == "e6" then
|
||||
GoalRight1Triggered = true
|
||||
Media.PlaySpeechNotification(USSR, "ControlCenterDeactivated")
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(GoalRight2Trigger, function(a, id)
|
||||
if not goalRight2Trigger and a.Owner == player and a.Type == "e6" then
|
||||
goalRight2Trigger = true
|
||||
Media.PlaySpeechNotification(player, "ControlCenterDeactivated")
|
||||
if not GoalRight2Triggered and a.Owner == USSR and a.Type == "e6" then
|
||||
GoalRight2Triggered = true
|
||||
Media.PlaySpeechNotification(USSR, "ControlCenterDeactivated")
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(RSoldierTrapTrigger, function(a, id)
|
||||
if not rSoldierTrapTrigger and a.Owner == player then
|
||||
rSoldierTrapTrigger = true
|
||||
if not fTurBottomTrigger then
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraRSoldier.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraFTurBottom.Location })
|
||||
if not RSoldierTrapTriggered and a.Owner == USSR then
|
||||
RSoldierTrapTriggered = true
|
||||
if not FTurBottomTriggered then
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraRSoldier.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraFTurBottom.Location })
|
||||
end
|
||||
|
||||
if not RSoldier1.IsDead and not RSoldierTrap1.IsDead then
|
||||
@@ -190,9 +190,9 @@ Trigger.OnEnteredFootprint(RSoldierTrapTrigger, function(a, id)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(SoldierTrap2Trigger, function(a, id)
|
||||
if not soldierTrap2Trigger and a.Owner == player then
|
||||
soldierTrap2Trigger = true
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraSoldierTrap2.Location })
|
||||
if not SoldierTrap2Triggered and a.Owner == USSR then
|
||||
SoldierTrap2Triggered = true
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraSoldierTrap2.Location })
|
||||
if not SoldierTrap2.IsDead then
|
||||
PrisonEntranceGuard.Attack(SoldierTrap2)
|
||||
end
|
||||
@@ -201,22 +201,22 @@ Trigger.OnEnteredFootprint(SoldierTrap2Trigger, function(a, id)
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(Engineers, function()
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
Greece.MarkCompletedObjective(AlliedObjective)
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(PrisonerGuards, function()
|
||||
Utils.Do(Engineers, function(actor)
|
||||
actor.Owner = player
|
||||
actor.Owner = USSR
|
||||
end)
|
||||
|
||||
Prisoner6.Owner = player
|
||||
player.MarkCompletedObjective(sovietObjective2)
|
||||
Prisoner6.Owner = USSR
|
||||
USSR.MarkCompletedObjective(SovietObjective2)
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(BarlCC, function()
|
||||
if not cameraCCTrigger then
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraCC.Location })
|
||||
cameraCCTrigger = true
|
||||
if not CameraCCTriggered then
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraCC.Location })
|
||||
CameraCCTriggered = true
|
||||
end
|
||||
|
||||
Utils.Do(CCGuards, function(actor)
|
||||
@@ -229,13 +229,13 @@ end)
|
||||
Trigger.OnKilled(PBoxBrl, function()
|
||||
PBox.Kill()
|
||||
Utils.Do(Dogs, function(actor)
|
||||
actor.Owner = player
|
||||
actor.Owner = USSR
|
||||
end)
|
||||
player.MarkCompletedObjective(sovietObjective6)
|
||||
USSR.MarkCompletedObjective(SovietObjective6)
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(PrisonEntranceGuard, function()
|
||||
if controlCenterTrigger then
|
||||
if ControlCenterTriggered then
|
||||
Utils.Do(PrisonerGuards, function(actor)
|
||||
if not actor.IsDead then
|
||||
actor.Hunt()
|
||||
@@ -245,7 +245,7 @@ Trigger.OnKilled(PrisonEntranceGuard, function()
|
||||
end)
|
||||
|
||||
IntroSequence = function()
|
||||
StartingUnits = Reinforcements.Reinforce(player, StartingUnitsReinforcements, { StartingUnitsSpawn.Location, SoldierTrap1Waypoint1.Location }, 0)
|
||||
StartingUnits = Reinforcements.Reinforce(USSR, StartingUnitsReinforcements, { StartingUnitsSpawn.Location, SoldierTrap1Waypoint1.Location }, 0)
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||
Utils.Do(EntranceGuards, function(actor)
|
||||
if not SoldierTrap1.IsDead then
|
||||
@@ -255,67 +255,67 @@ IntroSequence = function()
|
||||
actor.AttackMove(SoldierTrap1Waypoint2.Location)
|
||||
actor.AttackMove(SoldierTrap1Waypoint3.Location)
|
||||
end)
|
||||
Media.PlaySpeechNotification(player, "TimerStarted")
|
||||
timerStarted = true
|
||||
Media.PlaySpeechNotification(USSR, "TimerStarted")
|
||||
TimerStarted = true
|
||||
end)
|
||||
|
||||
-- Trigger a game over if the player lost all human units before the security system has been deactivated
|
||||
Trigger.OnAllKilled(StartingUnits, function()
|
||||
if not controlCenterTrigger then
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
if not ControlCenterTriggered then
|
||||
Greece.MarkCompletedObjective(AlliedObjective)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = Player.GetPlayer("USSR")
|
||||
enemy = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
|
||||
Camera.Position = SoldierTrap1Waypoint1.CenterPosition
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraStart1.Location })
|
||||
Actor.Create("camera", true, { Owner = player, Location = CameraStart2.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraStart1.Location })
|
||||
Actor.Create("camera", true, { Owner = USSR, Location = CameraStart2.Location })
|
||||
|
||||
IntroSequence()
|
||||
|
||||
InitObjectives(player)
|
||||
alliedObjective = AddPrimaryObjective(enemy, "")
|
||||
sovietObjective1 = AddPrimaryObjective(player, "deactivate-security-system")
|
||||
sovietObjective2 = AddPrimaryObjective(player, "rescue-engineers")
|
||||
sovietObjective3 = AddPrimaryObjective(player, "engineers-coolant-station")
|
||||
sovietObjective4 = AddPrimaryObjective(player, "engineer-reprogram-security")
|
||||
sovietObjective5 = AddPrimaryObjective(player, "engineer-reactor-core")
|
||||
sovietObjective6 = AddSecondaryObjective(player, "free-dogs")
|
||||
InitObjectives(USSR)
|
||||
AlliedObjective = AddPrimaryObjective(Greece, "")
|
||||
SovietObjective1 = AddPrimaryObjective(USSR, "deactivate-security-system")
|
||||
SovietObjective2 = AddPrimaryObjective(USSR, "rescue-engineers")
|
||||
SovietObjective3 = AddPrimaryObjective(USSR, "engineers-coolant-station")
|
||||
SovietObjective4 = AddPrimaryObjective(USSR, "engineer-reprogram-security")
|
||||
SovietObjective5 = AddPrimaryObjective(USSR, "engineer-reactor-core")
|
||||
SovietObjective6 = AddSecondaryObjective(USSR, "free-dogs")
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if player.HasNoRequiredUnits() and timerStarted then
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
if USSR.HasNoRequiredUnits() and TimerStarted then
|
||||
Greece.MarkCompletedObjective(AlliedObjective)
|
||||
end
|
||||
|
||||
if remainingTime == DateTime.Minutes(5) and Difficulty ~= "hard" then
|
||||
Media.PlaySpeechNotification(player, "WarningFiveMinutesRemaining")
|
||||
elseif remainingTime == DateTime.Minutes(4) then
|
||||
Media.PlaySpeechNotification(player, "WarningFourMinutesRemaining")
|
||||
elseif remainingTime == DateTime.Minutes(3) then
|
||||
Media.PlaySpeechNotification(player, "WarningThreeMinutesRemaining")
|
||||
elseif remainingTime == DateTime.Minutes(2) then
|
||||
Media.PlaySpeechNotification(player, "WarningTwoMinutesRemaining")
|
||||
elseif remainingTime == DateTime.Minutes(1) then
|
||||
Media.PlaySpeechNotification(player, "WarningOneMinuteRemaining")
|
||||
if RemainingTime == DateTime.Minutes(5) and Difficulty ~= "hard" then
|
||||
Media.PlaySpeechNotification(USSR, "WarningFiveMinutesRemaining")
|
||||
elseif RemainingTime == DateTime.Minutes(4) then
|
||||
Media.PlaySpeechNotification(USSR, "WarningFourMinutesRemaining")
|
||||
elseif RemainingTime == DateTime.Minutes(3) then
|
||||
Media.PlaySpeechNotification(USSR, "WarningThreeMinutesRemaining")
|
||||
elseif RemainingTime == DateTime.Minutes(2) then
|
||||
Media.PlaySpeechNotification(USSR, "WarningTwoMinutesRemaining")
|
||||
elseif RemainingTime == DateTime.Minutes(1) then
|
||||
Media.PlaySpeechNotification(USSR, "WarningOneMinuteRemaining")
|
||||
end
|
||||
|
||||
if goalLeft1Trigger and goalLeft2Trigger and goalRight1Trigger and goalRight2Trigger then
|
||||
player.MarkCompletedObjective(sovietObjective3)
|
||||
if GoalLeft1Triggered and GoalLeft2Triggered and GoalRight1Triggered and GoalRight2Triggered then
|
||||
USSR.MarkCompletedObjective(SovietObjective3)
|
||||
end
|
||||
|
||||
if remainingTime > 0 and timerStarted then
|
||||
if (remainingTime % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("time-until-meltdown", { ["time"] = Utils.FormatTime(remainingTime) })
|
||||
UserInterface.SetMissionText(Timer, player.Color)
|
||||
if RemainingTime > 0 and TimerStarted then
|
||||
if (RemainingTime % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("time-until-meltdown", { ["time"] = Utils.FormatTime(RemainingTime) })
|
||||
UserInterface.SetMissionText(Timer, USSR.Color)
|
||||
end
|
||||
remainingTime = remainingTime - 1
|
||||
elseif remainingTime == 0 then
|
||||
RemainingTime = RemainingTime - 1
|
||||
elseif RemainingTime == 0 then
|
||||
UserInterface.SetMissionText("")
|
||||
enemy.MarkCompletedObjective(alliedObjective)
|
||||
Greece.MarkCompletedObjective(AlliedObjective)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -45,7 +45,7 @@ HunterTeam = { "1tnk", "1tnk", "1tnk", "1tnk", "2tnk", "2tnk", "arty" }
|
||||
StartTimer = false
|
||||
TimerColor = Player.GetPlayer("USSR").Color
|
||||
TimerTicks = DateTime.Minutes(9)
|
||||
ticked = TimerTicks
|
||||
Ticked = TimerTicks
|
||||
StartTimerDelay =
|
||||
{
|
||||
easy = DateTime.Minutes(5),
|
||||
@@ -144,9 +144,9 @@ MissionSetup = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(LightVehicleAttackTrigger, function(unit, id)
|
||||
if not attackTriggered and unit.Type == "3tnk" then
|
||||
if not AttackTriggered and unit.Type == "3tnk" then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
attackTriggered = true
|
||||
AttackTriggered = true
|
||||
|
||||
Utils.Do(LightVehicleAttack, function(unit)
|
||||
if not unit.IsDead then
|
||||
@@ -157,9 +157,9 @@ MissionSetup = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(EngiDropTriggerArea, function(unit, id)
|
||||
if unit.Owner == USSR and not dropTriggered then
|
||||
if unit.Owner == USSR and not DropTriggered then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
dropTriggered = true
|
||||
DropTriggered = true
|
||||
|
||||
Media.PlaySpeechNotification(USSR, "SignalFlare")
|
||||
local engiFlare = Actor.Create("flare", true, { Owner = USSR, Location = EngiDropLZ.Location })
|
||||
@@ -174,9 +174,9 @@ MissionSetup = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(ChinookAmbushTrigger, function(unit, id)
|
||||
if not chinookTriggered and unit.Owner == USSR then
|
||||
if not ChinookTriggered and unit.Owner == USSR then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
chinookTriggered = true
|
||||
ChinookTriggered = true
|
||||
|
||||
local chalk = Reinforcements.ReinforceWithTransport(Greece, "tran", ChinookChalk , ChinookPath, { ChinookPath[1] })[2]
|
||||
Utils.Do(chalk, function(unit)
|
||||
@@ -224,7 +224,7 @@ ClosestActorTo = function(actors, target)
|
||||
local closestActor = nil
|
||||
Utils.Do(actors, function(actor)
|
||||
local offset = actor.Location - target.Location
|
||||
distSq = offset.X * offset.X + offset.Y * offset.Y
|
||||
local distSq = offset.X * offset.X + offset.Y * offset.Y
|
||||
if closestActor == nil or distSq < closestDistSq then
|
||||
closestDistSq = distSq
|
||||
closestActor = actor
|
||||
@@ -289,16 +289,16 @@ end
|
||||
|
||||
Tick = function()
|
||||
if StartTimer then
|
||||
if ticked > 0 then
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("corridor-closes-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if Ticked > 0 then
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("corridor-closes-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()
|
||||
SendHunters()
|
||||
ticked = ticked - 1
|
||||
Ticked = Ticked - 1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -54,13 +54,13 @@ end
|
||||
ProduceInfantry = function()
|
||||
if AlliedBarracks01.IsDead then
|
||||
return
|
||||
elseif (OreRefinery01.IsDead and OreRefinery02.IsDead or GreeceHarvestersAreDead) and greece.Resources <= 299 then
|
||||
elseif (OreRefinery01.IsDead and OreRefinery02.IsDead or GreeceHarvestersAreDead) and Greece.Resources <= 299 then
|
||||
return
|
||||
end
|
||||
|
||||
local delay = Utils.RandomInteger(DateTime.Seconds(1), DateTime.Seconds(2))
|
||||
local toBuild = { Utils.Random(AlliedInfantryTypes) }
|
||||
greece.Build(toBuild, function(unit)
|
||||
Greece.Build(toBuild, function(unit)
|
||||
InfAttack[#InfAttack + 1] = unit[1]
|
||||
|
||||
if #InfAttack >= 5 then
|
||||
@@ -76,7 +76,7 @@ end
|
||||
ProduceArmor = function()
|
||||
if AlliedWarFact01.IsDead and AlliedWarFact02.IsDead then
|
||||
return
|
||||
elseif (OreRefinery01.IsDead and OreRefinery02.IsDead or GreeceHarvestersAreDead) and greece.Resources <= 699 then
|
||||
elseif (OreRefinery01.IsDead and OreRefinery02.IsDead or GreeceHarvestersAreDead) and Greece.Resources <= 699 then
|
||||
return
|
||||
end
|
||||
|
||||
@@ -84,7 +84,7 @@ ProduceArmor = function()
|
||||
local toBuild = { Utils.Random(AlliedArmorTypes) }
|
||||
local Rally = Utils.Random(AlliedWarFactRally)
|
||||
Utils.Do(AlliedWarFact, function(fact) fact.RallyPoint = Rally.Location end)
|
||||
greece.Build(toBuild, function(unit)
|
||||
Greece.Build(toBuild, function(unit)
|
||||
ArmorAttack[#ArmorAttack + 1] = unit[1]
|
||||
|
||||
if #ArmorAttack >= ArmorAttackNumbers[Difficulty] then
|
||||
@@ -100,11 +100,11 @@ end
|
||||
ProduceNavyGuard = function()
|
||||
if NavalYard01.IsDead then
|
||||
return
|
||||
elseif (OreRefinery01.IsDead and OreRefinery02.IsDead or GreeceHarvestersAreDead) and greece.Resources <= 2399 then
|
||||
elseif (OreRefinery01.IsDead and OreRefinery02.IsDead or GreeceHarvestersAreDead) and Greece.Resources <= 2399 then
|
||||
return
|
||||
end
|
||||
NavalYard01.RallyPoint = waypoint26.Location
|
||||
greece.Build(AlliedNavyGuard, function(nvgrd)
|
||||
Greece.Build(AlliedNavyGuard, function(nvgrd)
|
||||
Utils.Do(nvgrd, function(unit)
|
||||
Trigger.OnKilled(unit, ProduceNavyGuard)
|
||||
end)
|
||||
|
||||
@@ -40,13 +40,13 @@ AlloyFacilityDestroyed = false
|
||||
WorldLoaded = function()
|
||||
|
||||
--Players Setup
|
||||
player = Player.GetPlayer("USSR")
|
||||
greece = Player.GetPlayer("Greece")
|
||||
goodguy = Player.GetPlayer("GoodGuy")
|
||||
spain = Player.GetPlayer("Spain")
|
||||
france = Player.GetPlayer("France")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
GoodGuy = Player.GetPlayer("GoodGuy")
|
||||
Spain = Player.GetPlayer("Spain")
|
||||
France = Player.GetPlayer("France")
|
||||
|
||||
greece.Cash = 20000
|
||||
Greece.Cash = 20000
|
||||
|
||||
Camera.Position = DefaultCameraPosition.CenterPosition
|
||||
|
||||
@@ -62,45 +62,45 @@ WorldLoaded = function()
|
||||
end
|
||||
|
||||
--Objectives Setup
|
||||
InitObjectives(player)
|
||||
InitObjectives(USSR)
|
||||
|
||||
DestroyControlCenter = AddPrimaryObjective(player, "destroy-control-center")
|
||||
KeepTanksAlive = AddPrimaryObjective(player, "tank-division-must-not-be-destroyed")
|
||||
KeepVolkovAlive = AddPrimaryObjective(player, "volkov-survive")
|
||||
KeepChitzkoiAlive = AddSecondaryObjective(player, "keep-chitzkoi-alive")
|
||||
DestroyControlCenter = AddPrimaryObjective(USSR, "destroy-control-center")
|
||||
KeepTanksAlive = AddPrimaryObjective(USSR, "tank-division-must-not-be-destroyed")
|
||||
KeepVolkovAlive = AddPrimaryObjective(USSR, "volkov-survive")
|
||||
KeepChitzkoiAlive = AddSecondaryObjective(USSR, "keep-chitzkoi-alive")
|
||||
|
||||
Trigger.OnKilled(ControlCenter, function()
|
||||
Utils.Do(HeavyTurrets, function(struc)
|
||||
if not struc.IsDead then struc.Kill() end
|
||||
end)
|
||||
player.MarkCompletedObjective(DestroyControlCenter)
|
||||
DestroyAlloyFacility = AddPrimaryObjective(player, "destroy-alloy-facility")
|
||||
Media.PlaySpeechNotification(player, "FirstObjectiveMet")
|
||||
USSR.MarkCompletedObjective(DestroyControlCenter)
|
||||
DestroyAlloyFacility = AddPrimaryObjective(USSR, "destroy-alloy-facility")
|
||||
Media.PlaySpeechNotification(USSR, "FirstObjectiveMet")
|
||||
Media.DisplayMessage(UserInterface.Translate("heavy-turret-control-destroyed"))
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(AlloyFacility, function()
|
||||
if not player.IsObjectiveCompleted(DestroyControlCenter) then --Prevent a crash if the player somehow manage to cheese the mission and destroy
|
||||
player.MarkCompletedObjective(DestroyControlCenter) --the Alloy Facility without destroying the Control Center.
|
||||
DestroyAlloyFacility = AddPrimaryObjective(player, "destroy-alloy-facility")
|
||||
if not USSR.IsObjectiveCompleted(DestroyControlCenter) then --Prevent a crash if the player somehow manage to cheese the mission and destroy
|
||||
USSR.MarkCompletedObjective(DestroyControlCenter) --the Alloy Facility without destroying the Control Center.
|
||||
DestroyAlloyFacility = AddPrimaryObjective(USSR, "destroy-alloy-facility")
|
||||
end
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
player.MarkCompletedObjective(DestroyAlloyFacility)
|
||||
player.MarkCompletedObjective(KeepTanksAlive)
|
||||
player.MarkCompletedObjective(KeepVolkovAlive)
|
||||
player.MarkCompletedObjective(KeepChitzkoiAlive)
|
||||
USSR.MarkCompletedObjective(DestroyAlloyFacility)
|
||||
USSR.MarkCompletedObjective(KeepTanksAlive)
|
||||
USSR.MarkCompletedObjective(KeepVolkovAlive)
|
||||
USSR.MarkCompletedObjective(KeepChitzkoiAlive)
|
||||
end)
|
||||
AlloyFacilityDestroyed = true
|
||||
Media.PlaySpeechNotification(player, "SecondObjectiveMet")
|
||||
Media.PlaySpeechNotification(USSR, "SecondObjectiveMet")
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(PlayerTankDivision, function()
|
||||
if not AlloyFacilityDestroyed then player.MarkFailedObjective(KeepTanksAlive) end
|
||||
if not AlloyFacilityDestroyed then USSR.MarkFailedObjective(KeepTanksAlive) end
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(0, function()
|
||||
local AlliedBaseCamera = Actor.Create("camera", true, { Owner = player, Location = waypoint12.Location })
|
||||
local SuperTeamCamera = Actor.Create("camera", true, { Owner = player, Location = DefaultCameraPosition.Location })
|
||||
local AlliedBaseCamera = Actor.Create("camera", true, { Owner = USSR, Location = waypoint12.Location })
|
||||
local SuperTeamCamera = Actor.Create("camera", true, { Owner = USSR, Location = DefaultCameraPosition.Location })
|
||||
Trigger.AfterDelay(1, function()
|
||||
if AlliedBaseCamera.IsInWorld then AlliedBaseCamera.Destroy() end
|
||||
end)
|
||||
@@ -112,9 +112,9 @@ WorldLoaded = function()
|
||||
--Super Team Setup
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
local spawn = superteamspawn.CenterPosition + WVec.New(0, 0, Actor.CruiseAltitude("badr"))
|
||||
local transport = Actor.Create("badr", true, { CenterPosition = spawn, Owner = player, Facing = (superteamdrop.CenterPosition - spawn).Facing, Health = 3 })
|
||||
local transport = Actor.Create("badr", true, { CenterPosition = spawn, Owner = USSR, Facing = (superteamdrop.CenterPosition - spawn).Facing, Health = 3 })
|
||||
Utils.Do(SuperTeam, function(type)
|
||||
local a = Actor.Create(type, false, { Owner = player })
|
||||
local a = Actor.Create(type, false, { Owner = USSR })
|
||||
transport.LoadPassenger(a)
|
||||
if a.Type == "volk" then
|
||||
VolkovIsDead(a)
|
||||
@@ -123,12 +123,12 @@ WorldLoaded = function()
|
||||
ChitzkoiIsDead(a)
|
||||
end
|
||||
end)
|
||||
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
transport.Paradrop(CPos.New(21, 82))
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(SuperTeamLandCell, function(unit, id)
|
||||
if unit.Owner == player then
|
||||
if unit.Owner == USSR then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
if not BarrelsShooter[1].IsDead then
|
||||
@@ -147,14 +147,14 @@ WorldLoaded = function()
|
||||
|
||||
--Guards Squads Setup -- I used proximity triggers to make them hunt you down in order to mimic their behavior from the original mission
|
||||
Trigger.OnEnteredProximityTrigger(RangerGuard01.CenterPosition, WDist.New(70 * 70), function(unit, id)
|
||||
if not RangerGuard01.IsDead and unit.Owner == player then
|
||||
if not RangerGuard01.IsDead and unit.Owner == USSR then
|
||||
Trigger.OnIdle(RangerGuard01, RangerGuard01.Hunt)
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(waypoint7.CenterPosition, WDist.FromCells(6), function(unit, id)
|
||||
if unit.Owner == player then
|
||||
if unit.Owner == USSR then
|
||||
Utils.Do(InfGuardSquad01, function(actor)
|
||||
if not actor.IsDead then
|
||||
Trigger.OnIdle(actor, actor.Hunt)
|
||||
@@ -165,7 +165,7 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(InfGuardSquad02Unit01.CenterPosition, WDist.FromCells(6), function(unit, id)
|
||||
if unit.Owner == player and (unit.Type == "volk" or unit.Type == "zkoi") then
|
||||
if unit.Owner == USSR and (unit.Type == "volk" or unit.Type == "zkoi") then
|
||||
Utils.Do(InfGuardSquad02, function(actor)
|
||||
if not actor.IsDead then
|
||||
Trigger.OnIdle(actor, actor.Hunt)
|
||||
@@ -176,8 +176,8 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(InfGuardSquad03Unit05.CenterPosition, WDist.FromCells(8), function(unit, id)
|
||||
if unit.Owner == player then
|
||||
local HospitalCamera = Actor.Create("camera", true, { Owner = player, Location = waypoint13.Location })
|
||||
if unit.Owner == USSR then
|
||||
local HospitalCamera = Actor.Create("camera", true, { Owner = USSR, Location = waypoint13.Location })
|
||||
Utils.Do(InfGuardSquad03, function(actor)
|
||||
if not actor.IsDead then
|
||||
Trigger.OnIdle(actor, actor.Hunt)
|
||||
@@ -199,7 +199,7 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredProximityTrigger(LightTankGuard02.CenterPosition, WDist.FromCells(8), function(unit, id)
|
||||
if not LightTankGuard02.IsDead and unit.Owner == player and (unit.Type == "volk" or unit.Type == "zkoi") then
|
||||
if not LightTankGuard02.IsDead and unit.Owner == USSR and (unit.Type == "volk" or unit.Type == "zkoi") then
|
||||
Trigger.OnIdle(LightTankGuard02, LightTankGuard02.Hunt)
|
||||
Trigger.RemoveProximityTrigger(id)
|
||||
end
|
||||
@@ -207,10 +207,10 @@ WorldLoaded = function()
|
||||
|
||||
--Tanya Squad Setup
|
||||
Trigger.OnEnteredFootprint(TanyaTrigger, function(unit, id)
|
||||
if unit.Owner == player then
|
||||
if unit.Owner == USSR then
|
||||
if not TanyaSquadTanya.IsDead then
|
||||
local TanyaSquadCamera = Actor.Create("camera", true, { Owner = player, Location = waypoint85.Location })
|
||||
Media.PlaySoundNotification(player, "rokroll")
|
||||
local TanyaSquadCamera = Actor.Create("camera", true, { Owner = USSR, Location = waypoint85.Location })
|
||||
Media.PlaySoundNotification(USSR, "rokroll")
|
||||
Utils.Do(TanyaSquad, function(actor)
|
||||
if not actor.IsDead then
|
||||
Trigger.OnIdle(actor, actor.Hunt)
|
||||
@@ -239,9 +239,9 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(CivTeam01Trigger, function(unit, id)
|
||||
if unit.Owner == player then
|
||||
if unit.Owner == USSR then
|
||||
if not TownHouse03.IsDead then
|
||||
local civ01 = Reinforcements.Reinforce(spain, CivTeam01, { civteam01spawn.Location }, 0)
|
||||
local civ01 = Reinforcements.Reinforce(Spain, CivTeam01, { civteam01spawn.Location }, 0)
|
||||
Utils.Do(civ01, function(actor)
|
||||
if not actor.IsDead then
|
||||
Trigger.OnIdle(actor, actor.Hunt)
|
||||
@@ -253,9 +253,9 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(CivTeam02Trigger, function(unit, id)
|
||||
if unit.Owner == player then
|
||||
if unit.Owner == USSR then
|
||||
if not TownHouse04.IsDead then
|
||||
local civ02 = Reinforcements.Reinforce(spain, CivTeam02, { civteam02spawn.Location }, 0)
|
||||
local civ02 = Reinforcements.Reinforce(Spain, CivTeam02, { civteam02spawn.Location }, 0)
|
||||
Utils.Do(civ02, function(actor)
|
||||
if not actor.IsDead then
|
||||
Trigger.OnIdle(actor, actor.Hunt)
|
||||
@@ -268,8 +268,8 @@ WorldLoaded = function()
|
||||
|
||||
--Minefield Setup
|
||||
Trigger.OnEnteredFootprint(MineSoldierTrigger, function(unit, id)
|
||||
if unit.Owner == player then
|
||||
local MineSoldierCamera1 = Actor.Create("camera", true, { Owner = player, Location = waypoint96.Location })
|
||||
if unit.Owner == USSR then
|
||||
local MineSoldierCamera1 = Actor.Create("camera", true, { Owner = USSR, Location = waypoint96.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function()
|
||||
if MineSoldierCamera1.IsInWorld then MineSoldierCamera1.Destroy() end
|
||||
end)
|
||||
@@ -296,8 +296,8 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(MineRevealTrigger, function(unit, id)
|
||||
if unit.Owner == goodguy then
|
||||
local MineSoldierCamera2 = Actor.Create("camera", true, { Owner = player, Location = waypoint76.Location })
|
||||
if unit.Owner == GoodGuy then
|
||||
local MineSoldierCamera2 = Actor.Create("camera", true, { Owner = USSR, Location = waypoint76.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(12), function()
|
||||
if MineSoldierCamera2.IsInWorld then MineSoldierCamera2.Destroy() end
|
||||
end)
|
||||
@@ -307,10 +307,10 @@ WorldLoaded = function()
|
||||
|
||||
--Paradrop Rifle Team Setup
|
||||
Trigger.OnEnteredFootprint(ParaTrigger, function(unit, id)
|
||||
if unit.Owner == player then
|
||||
local powerproxy = Actor.Create("powerproxy.pararifles", true, { Owner = greece })
|
||||
if unit.Owner == USSR then
|
||||
local powerproxy = Actor.Create("powerproxy.pararifles", true, { Owner = Greece })
|
||||
local aircraft = powerproxy.TargetParatroopers(waypoint89.CenterPosition, Angle.South)
|
||||
local prtcamera = Actor.Create("camera", true, { Owner = player, Location = waypoint89.Location })
|
||||
local prtcamera = Actor.Create("camera", true, { Owner = USSR, Location = waypoint89.Location })
|
||||
Utils.Do(aircraft, function(a)
|
||||
Trigger.OnPassengerExited(a, function(t, p)
|
||||
IdleHunt(p)
|
||||
@@ -332,7 +332,7 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
local GreeceHarvesters = greece.GetActorsByType("harv")
|
||||
local GreeceHarvesters = Greece.GetActorsByType("harv")
|
||||
Trigger.OnAllKilled(GreeceHarvesters, function()
|
||||
GreeceHarvestersAreDead = true
|
||||
end)
|
||||
@@ -342,16 +342,16 @@ end
|
||||
|
||||
VolkovIsDead = function(a)
|
||||
Trigger.OnKilled(a, function()
|
||||
player.MarkFailedObjective(KeepVolkovAlive)
|
||||
USSR.MarkFailedObjective(KeepVolkovAlive)
|
||||
end)
|
||||
end
|
||||
|
||||
ChitzkoiIsDead = function(a)
|
||||
Trigger.OnKilled(a, function()
|
||||
player.MarkFailedObjective(KeepChitzkoiAlive)
|
||||
USSR.MarkFailedObjective(KeepChitzkoiAlive)
|
||||
Media.DisplayMessage(UserInterface.Translate("rebuild-chitzkoy"))
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Media.PlaySpeechNotification(player, "ObjectiveNotMet")
|
||||
Media.PlaySpeechNotification(USSR, "ObjectiveNotMet")
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -70,7 +70,7 @@ SovietGateRallyPoints = { AlliesBaseGate2, AlliesBaseGate2, AlliesBaseGate1, All
|
||||
Airfields = { SovietAirfield1, SovietAirfield2, SovietAirfield3 }
|
||||
SovietBuildings = { Barrack1, SubPen, RadarDome, AdvancedPowerPlant1, AdvancedPowerPlant2, AdvancedPowerPlant3, WarFactory, Refinery, Silo1, Silo2, FlameTower1, FlameTower2, FlameTower3, Sam1, Sam2, Sam3, Sam4, SovietAirfield1, SovietAirfield2, SovietAirfield3 }
|
||||
|
||||
IdleTrigger = function(units, dest)
|
||||
IdleTrigger = function(units, _)
|
||||
Utils.Do(units, function(unit)
|
||||
|
||||
if not unit.IsDead then
|
||||
@@ -108,32 +108,32 @@ SetupHuntTrigger = function(units)
|
||||
end)
|
||||
end
|
||||
|
||||
ticked = TimerTicks
|
||||
Ticked = TimerTicks
|
||||
Tick = function()
|
||||
if KillObj and soviets.HasNoRequiredUnits() then
|
||||
allies.MarkCompletedObjective(KillObj)
|
||||
if KillObj and Soviets.HasNoRequiredUnits() then
|
||||
Allies.MarkCompletedObjective(KillObj)
|
||||
end
|
||||
|
||||
if allies.HasNoRequiredUnits() then
|
||||
soviets.MarkCompletedObjective(SovietObj)
|
||||
if Allies.HasNoRequiredUnits() then
|
||||
Soviets.MarkCompletedObjective(SovietObj)
|
||||
end
|
||||
|
||||
if soviets.Resources > soviets.ResourceCapacity / 2 then
|
||||
soviets.Resources = soviets.ResourceCapacity / 2
|
||||
if Soviets.Resources > Soviets.ResourceCapacity / 2 then
|
||||
Soviets.Resources = Soviets.ResourceCapacity / 2
|
||||
end
|
||||
|
||||
if ticked > 0 then
|
||||
if DateTime.Minutes(20) == ticked then
|
||||
Media.PlaySpeechNotification(allies, "TwentyMinutesRemaining")
|
||||
if Ticked > 0 then
|
||||
if DateTime.Minutes(20) == Ticked then
|
||||
Media.PlaySpeechNotification(Allies, "TwentyMinutesRemaining")
|
||||
|
||||
elseif DateTime.Minutes(10) == ticked then
|
||||
Media.PlaySpeechNotification(allies, "TenMinutesRemaining")
|
||||
elseif DateTime.Minutes(10) == Ticked then
|
||||
Media.PlaySpeechNotification(Allies, "TenMinutesRemaining")
|
||||
|
||||
elseif DateTime.Minutes(5) == ticked then
|
||||
Media.PlaySpeechNotification(allies, "WarningFiveMinutesRemaining")
|
||||
elseif DateTime.Minutes(5) == Ticked then
|
||||
Media.PlaySpeechNotification(Allies, "WarningFiveMinutesRemaining")
|
||||
|
||||
elseif DateTime.Minutes(4) == ticked then
|
||||
Media.PlaySpeechNotification(allies, "WarningFourMinutesRemaining")
|
||||
elseif DateTime.Minutes(4) == Ticked then
|
||||
Media.PlaySpeechNotification(Allies, "WarningFourMinutesRemaining")
|
||||
|
||||
Trigger.AfterDelay(ParadropTicks, function()
|
||||
SendSovietParadrops(ParadropWaypoints[3])
|
||||
@@ -144,31 +144,31 @@ Tick = function()
|
||||
SendSovietParadrops(ParadropWaypoints[1])
|
||||
end)
|
||||
|
||||
elseif DateTime.Minutes(3) == ticked then
|
||||
Media.PlaySpeechNotification(allies, "WarningThreeMinutesRemaining")
|
||||
elseif DateTime.Minutes(3) == Ticked then
|
||||
Media.PlaySpeechNotification(Allies, "WarningThreeMinutesRemaining")
|
||||
|
||||
elseif DateTime.Minutes(2) == ticked then
|
||||
Media.PlaySpeechNotification(allies, "WarningTwoMinutesRemaining")
|
||||
elseif DateTime.Minutes(2) == Ticked then
|
||||
Media.PlaySpeechNotification(Allies, "WarningTwoMinutesRemaining")
|
||||
|
||||
AttackAtFrameIncrement = DateTime.Seconds(4)
|
||||
AttackAtFrameIncrementInf = DateTime.Seconds(4)
|
||||
|
||||
elseif DateTime.Minutes(1) == ticked then
|
||||
Media.PlaySpeechNotification(allies, "WarningOneMinuteRemaining")
|
||||
elseif DateTime.Minutes(1) == Ticked then
|
||||
Media.PlaySpeechNotification(Allies, "WarningOneMinuteRemaining")
|
||||
|
||||
elseif DateTime.Seconds(45) == ticked then
|
||||
Media.PlaySpeechNotification(allies, "AlliedForcesApproaching")
|
||||
elseif DateTime.Seconds(45) == Ticked then
|
||||
Media.PlaySpeechNotification(Allies, "AlliedForcesApproaching")
|
||||
end
|
||||
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("french-reinforcements-arrive-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("french-reinforcements-arrive-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()
|
||||
TimerExpired()
|
||||
ticked = ticked - 1
|
||||
Ticked = Ticked - 1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -186,7 +186,7 @@ FinishTimer = function()
|
||||
end
|
||||
|
||||
SendSovietParadrops = function(table)
|
||||
local aircraft = powerproxy.TargetParatroopers(table[2].CenterPosition, table[1])
|
||||
local aircraft = ParaTroopersPowerProxy.TargetParatroopers(table[2].CenterPosition, table[1])
|
||||
Utils.Do(aircraft, function(a)
|
||||
Trigger.OnPassengerExited(a, function(t, p)
|
||||
IdleHunt(p)
|
||||
@@ -197,7 +197,7 @@ end
|
||||
SendSovietNavalReinforcements = function()
|
||||
if SpawnNavalUnits then
|
||||
local entry = NavalEntryPoint.Location
|
||||
local units = Reinforcements.ReinforceWithTransport(soviets, "lst", NavalTransportPassengers, { entry, Utils.Random(NavalReinforcementsWaypoints).Location }, { entry })[2]
|
||||
local units = Reinforcements.ReinforceWithTransport(Soviets, "lst", NavalTransportPassengers, { entry, Utils.Random(NavalReinforcementsWaypoints).Location }, { entry })[2]
|
||||
Utils.Do(units, function(unit)
|
||||
Trigger.OnIdle(unit, unit.Hunt)
|
||||
end)
|
||||
@@ -215,7 +215,7 @@ SpawnSovietInfantry = function()
|
||||
units[i] = type
|
||||
end
|
||||
|
||||
soviets.Build(units, function(soldiers)
|
||||
Soviets.Build(units, function(soldiers)
|
||||
Trigger.AfterDelay(25, function() IdleTrigger(soldiers) end)
|
||||
end)
|
||||
end
|
||||
@@ -228,7 +228,7 @@ SpawnSovietUnits = function()
|
||||
end
|
||||
|
||||
local route = Utils.RandomInteger(1, #SovietEntryPoints + 1)
|
||||
local attackers = Reinforcements.Reinforce(soviets, units, { SovietEntryPoints[route].Location, SovietRallyPoints[route].Location })
|
||||
local attackers = Reinforcements.Reinforce(Soviets, units, { SovietEntryPoints[route].Location, SovietRallyPoints[route].Location })
|
||||
Trigger.AfterDelay(25, function()
|
||||
IdleTrigger(attackers, SovietGateRallyPoints[route].Location)
|
||||
end)
|
||||
@@ -267,32 +267,32 @@ TimerExpired = function()
|
||||
SpawningInfantry = false
|
||||
SpawnNavalUnits = false
|
||||
|
||||
Beacon.New(allies, SovietEntryPoint7.CenterPosition - WVec.New(3 * 1024, 0, 0))
|
||||
Media.PlaySpeechNotification(allies, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(allies, FrenchReinforcements, { SovietEntryPoint7.Location, Alliesbase.Location })
|
||||
Beacon.New(Allies, SovietEntryPoint7.CenterPosition - WVec.New(3 * 1024, 0, 0))
|
||||
Media.PlaySpeechNotification(Allies, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(Allies, FrenchReinforcements, { SovietEntryPoint7.Location, Alliesbase.Location })
|
||||
|
||||
if DestroyObj then
|
||||
KillObj = AddPrimaryObjective(allies, "control-reinforcements-kill-remaining-soviet-forces")
|
||||
KillObj = AddPrimaryObjective(Allies, "control-reinforcements-kill-remaining-soviet-forces")
|
||||
else
|
||||
DestroyObj = AddPrimaryObjective(allies, "takeover-reinforcements-dismantle-soviet-base")
|
||||
DestroyObj = AddPrimaryObjective(Allies, "takeover-reinforcements-dismantle-soviet-base")
|
||||
end
|
||||
|
||||
allies.MarkCompletedObjective(SurviveObj)
|
||||
if not allies.IsObjectiveCompleted(KillSams) then
|
||||
allies.MarkFailedObjective(KillSams)
|
||||
Allies.MarkCompletedObjective(SurviveObj)
|
||||
if not Allies.IsObjectiveCompleted(KillSams) then
|
||||
Allies.MarkFailedObjective(KillSams)
|
||||
end
|
||||
end
|
||||
|
||||
DropAlliedArtillery = function(facing, dropzone)
|
||||
local proxy = Actor.Create("powerproxy.allied", true, { Owner = allies })
|
||||
local proxy = Actor.Create("powerproxy.allied", true, { Owner = Allies })
|
||||
proxy.TargetParatroopers(dropzone, facing)
|
||||
proxy.Destroy()
|
||||
end
|
||||
|
||||
SendLongBowReinforcements = function()
|
||||
Media.PlaySpeechNotification(allies, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(allies, LongBowReinforcements, AlliedAirReinforcementsWaypoints[1])
|
||||
Reinforcements.Reinforce(allies, LongBowReinforcements, AlliedAirReinforcementsWaypoints[2])
|
||||
Media.PlaySpeechNotification(Allies, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(Allies, LongBowReinforcements, AlliedAirReinforcementsWaypoints[1])
|
||||
Reinforcements.Reinforce(Allies, LongBowReinforcements, AlliedAirReinforcementsWaypoints[2])
|
||||
|
||||
if ParadropArtillery then
|
||||
local facing = Angle.New(Utils.RandomInteger(128, 384))
|
||||
@@ -301,23 +301,23 @@ SendLongBowReinforcements = function()
|
||||
end
|
||||
|
||||
AddObjectives = function()
|
||||
InitObjectives(allies)
|
||||
InitObjectives(Allies)
|
||||
|
||||
SurviveObj = AddPrimaryObjective(allies, "enforce-position-hold-until-reinforcements")
|
||||
KillSams = AddSecondaryObjective(allies, "destroy-two-sames-before-reinforcements")
|
||||
SurviveObj = AddPrimaryObjective(Allies, "enforce-position-hold-until-reinforcements")
|
||||
KillSams = AddSecondaryObjective(Allies, "destroy-two-sames-before-reinforcements")
|
||||
Media.DisplayMessage(UserInterface.Translate("soviets-blocking-gps"))
|
||||
CaptureAirfields = AddSecondaryObjective(allies, "capture-hold-soviet-airbase-northeast")
|
||||
SovietObj = AddPrimaryObjective(soviets, "")
|
||||
CaptureAirfields = AddSecondaryObjective(Allies, "capture-hold-soviet-airbase-northeast")
|
||||
SovietObj = AddPrimaryObjective(Soviets, "")
|
||||
|
||||
Trigger.OnPlayerWon(allies, function()
|
||||
Trigger.OnPlayerWon(Allies, function()
|
||||
Media.DisplayMessage(UserInterface.Translate("french-survived-dismantled-soviet-presence"))
|
||||
end)
|
||||
end
|
||||
|
||||
InitMission = function()
|
||||
Camera.Position = Alliesbase.CenterPosition
|
||||
camera1 = Actor.Create("camera.sam", true, { Owner = allies, Location = Sam1.Location })
|
||||
camera2 = Actor.Create("camera.sam", true, { Owner = allies, Location = Sam2.Location })
|
||||
local camera1 = Actor.Create("camera.sam", true, { Owner = Allies, Location = Sam1.Location })
|
||||
local camera2 = Actor.Create("camera.sam", true, { Owner = Allies, Location = Sam2.Location })
|
||||
Trigger.OnKilled(Sam1, function()
|
||||
if camera1.IsInWorld then camera1.Destroy() end
|
||||
end)
|
||||
@@ -325,8 +325,8 @@ InitMission = function()
|
||||
if camera2.IsInWorld then camera2.Destroy() end
|
||||
end)
|
||||
Trigger.OnAllKilledOrCaptured({ Sam1, Sam2 }, function()
|
||||
if not allies.IsObjectiveFailed(KillSams) then
|
||||
allies.MarkCompletedObjective(KillSams)
|
||||
if not Allies.IsObjectiveFailed(KillSams) then
|
||||
Allies.MarkCompletedObjective(KillSams)
|
||||
SendLongBowReinforcements()
|
||||
end
|
||||
end)
|
||||
@@ -336,30 +336,30 @@ InitMission = function()
|
||||
Trigger.OnCapture(field, function()
|
||||
count = count + 1
|
||||
if count == #Airfields then
|
||||
allies.MarkCompletedObjective(CaptureAirfields)
|
||||
local atek = Actor.Create("atek.mission", true, { Owner = allies, Location = HiddenATEK.Location })
|
||||
Allies.MarkCompletedObjective(CaptureAirfields)
|
||||
local atek = Actor.Create("atek.mission", true, { Owner = Allies, Location = HiddenATEK.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(5), atek.Destroy)
|
||||
end
|
||||
end)
|
||||
Trigger.OnKilled(field, function()
|
||||
allies.MarkFailedObjective(CaptureAirfields)
|
||||
Allies.MarkFailedObjective(CaptureAirfields)
|
||||
end)
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilledOrCaptured(SovietBuildings, function()
|
||||
if DestroyObj then
|
||||
if not soviets.HasNoRequiredUnits() then
|
||||
KillObj = AddPrimaryObjective(allies, "kill-remaining-soviet-forces")
|
||||
if not Soviets.HasNoRequiredUnits() then
|
||||
KillObj = AddPrimaryObjective(Allies, "kill-remaining-soviet-forces")
|
||||
end
|
||||
allies.MarkCompletedObjective(DestroyObj)
|
||||
Allies.MarkCompletedObjective(DestroyObj)
|
||||
else
|
||||
DestroyObj = AddPrimaryObjective(allies, "dismantle-nearby-soviet-base")
|
||||
allies.MarkCompletedObjective(DestroyObj)
|
||||
DestroyObj = AddPrimaryObjective(Allies, "dismantle-nearby-soviet-base")
|
||||
Allies.MarkCompletedObjective(DestroyObj)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end)
|
||||
TimerColor = allies.Color
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(Allies, "MissionTimerInitialised") end)
|
||||
TimerColor = Allies.Color
|
||||
end
|
||||
|
||||
SetupSoviets = function()
|
||||
@@ -370,20 +370,20 @@ SetupSoviets = function()
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(0, function()
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == soviets and self.HasProperty("StartBuildingRepairs") end)
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == Soviets and self.HasProperty("StartBuildingRepairs") end)
|
||||
Utils.Do(buildings, function(actor)
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == soviets and building.Health < building.MaxHealth * DamageModifier then
|
||||
if building.Owner == Soviets and building.Health < building.MaxHealth * DamageModifier then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reinforcements.Reinforce(soviets, Squad1, { AlliesBaseGate1.Location, Alliesbase1.Location })
|
||||
Reinforcements.Reinforce(soviets, Squad2, { AlliesBaseGate2.Location, Alliesbase2.Location })
|
||||
Reinforcements.Reinforce(Soviets, Squad1, { AlliesBaseGate1.Location, Alliesbase1.Location })
|
||||
Reinforcements.Reinforce(Soviets, Squad2, { AlliesBaseGate2.Location, Alliesbase2.Location })
|
||||
|
||||
powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = soviets })
|
||||
ParaTroopersPowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = Soviets })
|
||||
Trigger.AfterDelay(ParadropTicks, function()
|
||||
SendSovietParadrops(ParadropWaypoints[1])
|
||||
SendSovietParadrops(ParadropWaypoints[2])
|
||||
@@ -410,8 +410,8 @@ end
|
||||
|
||||
WorldLoaded = function()
|
||||
|
||||
allies = Player.GetPlayer("Allies")
|
||||
soviets = Player.GetPlayer("Soviets")
|
||||
Allies = Player.GetPlayer("Allies")
|
||||
Soviets = Player.GetPlayer("Soviets")
|
||||
|
||||
AddObjectives()
|
||||
InitMission()
|
||||
|
||||
@@ -68,23 +68,23 @@ GuardHarvester = function(unit, harvester)
|
||||
end
|
||||
end
|
||||
|
||||
ticked = TimerTicks
|
||||
Ticked = TimerTicks
|
||||
Tick = function()
|
||||
if soviets.HasNoRequiredUnits() then
|
||||
if Soviets.HasNoRequiredUnits() then
|
||||
if DestroyObj then
|
||||
allies.MarkCompletedObjective(DestroyObj)
|
||||
Allies.MarkCompletedObjective(DestroyObj)
|
||||
else
|
||||
DestroyObj = AddPrimaryObjective(allies, "destroy-all-soviet-forces")
|
||||
allies.MarkCompletedObjective(DestroyObj)
|
||||
DestroyObj = AddPrimaryObjective(Allies, "destroy-all-soviet-forces")
|
||||
Allies.MarkCompletedObjective(DestroyObj)
|
||||
end
|
||||
end
|
||||
|
||||
if allies.HasNoRequiredUnits() then
|
||||
soviets.MarkCompletedObjective(SovietObj)
|
||||
if Allies.HasNoRequiredUnits() then
|
||||
Soviets.MarkCompletedObjective(SovietObj)
|
||||
end
|
||||
|
||||
if soviets.Resources > soviets.ResourceCapacity / 2 then
|
||||
soviets.Resources = soviets.ResourceCapacity / 2
|
||||
if Soviets.Resources > Soviets.ResourceCapacity / 2 then
|
||||
Soviets.Resources = Soviets.ResourceCapacity / 2
|
||||
end
|
||||
|
||||
if DateTime.GameTime == ProduceAtFrame then
|
||||
@@ -105,25 +105,25 @@ Tick = function()
|
||||
end
|
||||
end
|
||||
|
||||
if DateTime.Minutes(5) == ticked then
|
||||
Media.PlaySpeechNotification(allies, "WarningFiveMinutesRemaining")
|
||||
if DateTime.Minutes(5) == Ticked then
|
||||
Media.PlaySpeechNotification(Allies, "WarningFiveMinutesRemaining")
|
||||
InitCountDown()
|
||||
end
|
||||
|
||||
if ticked > 0 then
|
||||
if (ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("soviet-reinforcements-arrive-in", { ["time"] = Utils.FormatTime(ticked) })
|
||||
if Ticked > 0 then
|
||||
if (Ticked % DateTime.Seconds(1)) == 0 then
|
||||
Timer = UserInterface.Translate("soviet-reinforcements-arrive-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()
|
||||
ticked = ticked - 1
|
||||
Ticked = Ticked - 1
|
||||
end
|
||||
end
|
||||
|
||||
SendSovietParadrops = function(table)
|
||||
local paraproxy = Actor.Create(table.type, false, { Owner = soviets })
|
||||
local paraproxy = Actor.Create(table.type, false, { Owner = Soviets })
|
||||
local aircraft = paraproxy.TargetParatroopers(table.target.CenterPosition)
|
||||
Utils.Do(aircraft, function(a)
|
||||
Trigger.OnPassengerExited(a, function(t, p)
|
||||
@@ -134,7 +134,7 @@ SendSovietParadrops = function(table)
|
||||
end
|
||||
|
||||
SpawnSovietInfantry = function()
|
||||
soviets.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
Soviets.Build({ Utils.Random(SovietInfantry) }, function(units)
|
||||
IdleHunt(units[1])
|
||||
end)
|
||||
end
|
||||
@@ -142,7 +142,7 @@ end
|
||||
SpawnSovietVehicle = function(spawnpoints, rallypoints)
|
||||
local route = Utils.RandomInteger(1, #spawnpoints + 1)
|
||||
local rally = Utils.RandomInteger(1, #rallypoints + 1)
|
||||
local unit = Reinforcements.Reinforce(soviets, { Utils.Random(SovietVehicles) }, { spawnpoints[route].Location })[1]
|
||||
local unit = Reinforcements.Reinforce(Soviets, { Utils.Random(SovietVehicles) }, { spawnpoints[route].Location })[1]
|
||||
unit.AttackMove(rallypoints[rally].Location)
|
||||
IdleHunt(unit)
|
||||
|
||||
@@ -152,7 +152,7 @@ SpawnSovietVehicle = function(spawnpoints, rallypoints)
|
||||
end
|
||||
|
||||
SpawnAndAttack = function(types, entry)
|
||||
local units = Reinforcements.Reinforce(soviets, types, { entry })
|
||||
local units = Reinforcements.Reinforce(Soviets, types, { entry })
|
||||
Utils.Do(units, function(unit)
|
||||
IdleHunt(unit)
|
||||
|
||||
@@ -164,10 +164,10 @@ SpawnAndAttack = function(types, entry)
|
||||
end
|
||||
|
||||
SendFrenchReinforcements = function()
|
||||
local camera = Actor.Create("camera", true, { Owner = allies, Location = SovietRally1.Location })
|
||||
Beacon.New(allies, FranceEntry.CenterPosition - WVec.New(0, 3 * 1024, 0))
|
||||
Media.PlaySpeechNotification(allies, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(allies, FrenchSquad, { FranceEntry.Location, FranceRally.Location })
|
||||
local camera = Actor.Create("camera", true, { Owner = Allies, Location = SovietRally1.Location })
|
||||
Beacon.New(Allies, FranceEntry.CenterPosition - WVec.New(0, 3 * 1024, 0))
|
||||
Media.PlaySpeechNotification(Allies, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(Allies, FrenchSquad, { FranceEntry.Location, FranceRally.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(3), function() camera.Destroy() end)
|
||||
end
|
||||
|
||||
@@ -179,7 +179,7 @@ FrenchReinforcements = function()
|
||||
return
|
||||
end
|
||||
|
||||
powerproxy = Actor.Create("powerproxy.parabombs", false, { Owner = allies })
|
||||
local powerproxy = Actor.Create("powerproxy.parabombs", false, { Owner = Allies })
|
||||
powerproxy.TargetAirstrike(drum1.CenterPosition, Angle.NorthEast + Angle.New(16))
|
||||
powerproxy.TargetAirstrike(drum2.CenterPosition, Angle.NorthEast)
|
||||
powerproxy.TargetAirstrike(drum3.CenterPosition, Angle.NorthEast - Angle.New(16))
|
||||
@@ -215,9 +215,9 @@ FinalAttack = function()
|
||||
Trigger.OnAllKilledOrCaptured(units, function()
|
||||
if not DestroyObj then
|
||||
Media.DisplayMessage(UserInterface.Translate("reinforced-position-initiate-counter-attack"), UserInterface.Translate("incoming-report"))
|
||||
DestroyObj = AddPrimaryObjective(allies, "destroy-remaining-soviet-forces-area")
|
||||
DestroyObj = AddPrimaryObjective(Allies, "destroy-remaining-soviet-forces-area")
|
||||
end
|
||||
allies.MarkCompletedObjective(SurviveObj)
|
||||
Allies.MarkCompletedObjective(SurviveObj)
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -234,15 +234,15 @@ FinishTimer = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function() UserInterface.SetMissionText("") end)
|
||||
end
|
||||
|
||||
wave = 1
|
||||
Wave = 1
|
||||
SendParadrops = function()
|
||||
SendSovietParadrops(ParaWaves[wave])
|
||||
SendSovietParadrops(ParaWaves[Wave])
|
||||
|
||||
wave = wave + 1
|
||||
if wave > #ParaWaves then
|
||||
Wave = Wave + 1
|
||||
if Wave > #ParaWaves then
|
||||
Trigger.AfterDelay(AttackTicks, FrenchReinforcements)
|
||||
else
|
||||
Trigger.AfterDelay(ParaWaves[wave].delay, SendParadrops)
|
||||
Trigger.AfterDelay(ParaWaves[Wave].delay, SendParadrops)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -251,12 +251,12 @@ SetupBridges = function()
|
||||
local counter = function()
|
||||
count = count + 1
|
||||
if count == 2 then
|
||||
allies.MarkCompletedObjective(RepairBridges)
|
||||
Allies.MarkCompletedObjective(RepairBridges)
|
||||
end
|
||||
end
|
||||
|
||||
Media.DisplayMessage(UserInterface.Translate("repair-bridges-for-reinforcement"), UserInterface.Translate("incoming-report"))
|
||||
RepairBridges = AddSecondaryObjective(allies, "repair-two-southern-bridges")
|
||||
RepairBridges = AddSecondaryObjective(Allies, "repair-two-southern-bridges")
|
||||
|
||||
local bridgeA = Map.ActorsInCircle(BrokenBridge1.CenterPosition, WDist.FromCells(1), function(self) return self.Type == "bridge1" end)
|
||||
local bridgeB = Map.ActorsInCircle(BrokenBridge2.CenterPosition, WDist.FromCells(1), function(self) return self.Type == "bridge1" end)
|
||||
@@ -264,39 +264,39 @@ SetupBridges = function()
|
||||
Utils.Do(bridgeA, function(bridge)
|
||||
Trigger.OnDamaged(bridge, function()
|
||||
Utils.Do(bridgeA, function(self) Trigger.ClearAll(self) end)
|
||||
Media.PlaySpeechNotification(allies, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(allies, { "1tnk", "2tnk", "2tnk" }, { ReinforcementsEntry1.Location, ReinforcementsRally1.Location })
|
||||
Media.PlaySpeechNotification(Allies, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(Allies, { "1tnk", "2tnk", "2tnk" }, { ReinforcementsEntry1.Location, ReinforcementsRally1.Location })
|
||||
counter()
|
||||
end)
|
||||
end)
|
||||
Utils.Do(bridgeB, function(bridge)
|
||||
Trigger.OnDamaged(bridge, function()
|
||||
Utils.Do(bridgeB, function(self) Trigger.ClearAll(self) end)
|
||||
Media.PlaySpeechNotification(allies, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(allies, { "jeep", "1tnk", "1tnk" }, { ReinforcementsEntry2.Location, ReinforcementsRally2.Location })
|
||||
Media.PlaySpeechNotification(Allies, "AlliedReinforcementsArrived")
|
||||
Reinforcements.Reinforce(Allies, { "jeep", "1tnk", "1tnk" }, { ReinforcementsEntry2.Location, ReinforcementsRally2.Location })
|
||||
counter()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
InitCountDown = function()
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), function() Media.PlaySpeechNotification(allies, "WarningFourMinutesRemaining") end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(2), function() Media.PlaySpeechNotification(allies, "WarningThreeMinutesRemaining") end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(3), function() Media.PlaySpeechNotification(allies, "WarningTwoMinutesRemaining") end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(4), function() Media.PlaySpeechNotification(allies, "WarningOneMinuteRemaining") end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(1), function() Media.PlaySpeechNotification(Allies, "WarningFourMinutesRemaining") end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(2), function() Media.PlaySpeechNotification(Allies, "WarningThreeMinutesRemaining") end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(3), function() Media.PlaySpeechNotification(Allies, "WarningTwoMinutesRemaining") end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(4), function() Media.PlaySpeechNotification(Allies, "WarningOneMinuteRemaining") end)
|
||||
end
|
||||
|
||||
AddObjectives = function()
|
||||
InitObjectives(allies)
|
||||
InitObjectives(Allies)
|
||||
|
||||
SurviveObj = AddPrimaryObjective(allies, "enforce-position-hold-out-onslaught")
|
||||
SovietObj = AddPrimaryObjective(soviets, "")
|
||||
SurviveObj = AddPrimaryObjective(Allies, "enforce-position-hold-out-onslaught")
|
||||
SovietObj = AddPrimaryObjective(Soviets, "")
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(15), function()
|
||||
SetupBridges()
|
||||
end)
|
||||
|
||||
Trigger.OnPlayerWon(allies, function()
|
||||
Trigger.OnPlayerWon(Allies, function()
|
||||
Media.DisplayMessage(UserInterface.Translate("remaining-soviet-presence-destroyed"), UserInterface.Translate("incoming-report"))
|
||||
end)
|
||||
end
|
||||
@@ -305,11 +305,11 @@ InitMission = function()
|
||||
Camera.Position = AlliesBase.CenterPosition
|
||||
TimerColor = HSLColor.Red
|
||||
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end)
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(Allies, "MissionTimerInitialised") end)
|
||||
|
||||
Trigger.AfterDelay(TimerTicks, function()
|
||||
Media.DisplayMessage(UserInterface.Translate("soviet-reinforcements-approaching"), UserInterface.Translate("incoming-report"))
|
||||
Media.PlaySpeechNotification(allies, "SovietReinforcementsArrived")
|
||||
Media.PlaySpeechNotification(Allies, "SovietReinforcementsArrived")
|
||||
SpawnSovietVehicle(NewSovietEntryPoints, NewSovietRallyPoints)
|
||||
FinalAttack()
|
||||
Producing = false
|
||||
@@ -361,7 +361,7 @@ SetupSoviets = function()
|
||||
toBuild[i] = Utils.Random(SovietInfantry)
|
||||
end
|
||||
|
||||
soviets.Build(toBuild, function(units)
|
||||
Soviets.Build(toBuild, function(units)
|
||||
Utils.Do(units, function(unit)
|
||||
InfantryGuards[#InfantryGuards + 1] = unit
|
||||
GuardHarvester(unit, Harvester2)
|
||||
@@ -373,10 +373,10 @@ SetupSoviets = function()
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(0, function()
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == soviets and self.HasProperty("StartBuildingRepairs") end)
|
||||
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == Soviets and self.HasProperty("StartBuildingRepairs") end)
|
||||
Utils.Do(buildings, function(actor)
|
||||
Trigger.OnDamaged(actor, function(building)
|
||||
if building.Owner == soviets and building.Health < building.MaxHealth * 3/4 then
|
||||
if building.Owner == Soviets and building.Health < building.MaxHealth * 3/4 then
|
||||
building.StartBuildingRepairs()
|
||||
end
|
||||
end)
|
||||
@@ -385,9 +385,8 @@ SetupSoviets = function()
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
|
||||
allies = Player.GetPlayer("Allies")
|
||||
soviets = Player.GetPlayer("Soviets")
|
||||
Allies = Player.GetPlayer("Allies")
|
||||
Soviets = Player.GetPlayer("Soviets")
|
||||
|
||||
AddObjectives()
|
||||
InitMission()
|
||||
|
||||
@@ -46,7 +46,7 @@ BridgeIsIntact = true
|
||||
--Mission Functions Setup
|
||||
HuntObjectiveTruck = function(a)
|
||||
if a.HasProperty("Hunt") then
|
||||
if a.Owner == greece or a.Owner == goodguy then
|
||||
if a.Owner == Greece or a.Owner == GoodGuy then
|
||||
Trigger.OnIdle(a, function(a)
|
||||
if a.IsInWorld and not ObjectiveTruck01.IsDead then
|
||||
a.AttackMove(ObjectiveTruck01.Location, 2)
|
||||
@@ -79,7 +79,7 @@ end
|
||||
SpawnAlliedHuntingParty = function()
|
||||
Trigger.AfterDelay(DateTime.Minutes(3), function()
|
||||
if BridgeIsIntact then
|
||||
local tanks = Reinforcements.Reinforce(greece, AlliedHuntingParty, { AlliedHuntingPartySpawn.Location, AlliedHuntingPartyWP01.Location,AlliedHuntingPartyWP03.Location, AlliedHuntingPartyWP05.Location }, 0)
|
||||
local tanks = Reinforcements.Reinforce(Greece, AlliedHuntingParty, { AlliedHuntingPartySpawn.Location, AlliedHuntingPartyWP01.Location,AlliedHuntingPartyWP03.Location, AlliedHuntingPartyWP05.Location }, 0)
|
||||
Utils.Do(tanks, function(units)
|
||||
HuntObjectiveTruck(units)
|
||||
end)
|
||||
@@ -90,45 +90,45 @@ end
|
||||
|
||||
WorldLoaded = function()
|
||||
--Players Setup
|
||||
player = Player.GetPlayer("USSR")
|
||||
greece = Player.GetPlayer("Greece")
|
||||
goodguy = Player.GetPlayer("GoodGuy")
|
||||
badguy = Player.GetPlayer("BadGuy")
|
||||
neutral = Player.GetPlayer("Neutral")
|
||||
creeps = Player.GetPlayer("Creeps")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
GoodGuy = Player.GetPlayer("GoodGuy")
|
||||
BadGuy = Player.GetPlayer("BadGuy")
|
||||
Neutral = Player.GetPlayer("Neutral")
|
||||
Creeps = Player.GetPlayer("Creeps")
|
||||
|
||||
Camera.Position = DefaultCameraPosition.CenterPosition
|
||||
|
||||
--Objectives Setup
|
||||
InitObjectives(player)
|
||||
InitObjectives(USSR)
|
||||
|
||||
BringSupplyTruck = AddPrimaryObjective(player, "supply-truck-waystation")
|
||||
ProtectWaystation = AddPrimaryObjective(player, "waystation-must-not-be-destroyed")
|
||||
DestroyAAGuns = AddSecondaryObjective(player, "destory-aa-guns-enable-air-support")
|
||||
PreventAlliedIncursions = AddSecondaryObjective(player, "find-destroy-bridge-stop-allied-reinforcements")
|
||||
BringSupplyTruck = AddPrimaryObjective(USSR, "supply-truck-waystation")
|
||||
ProtectWaystation = AddPrimaryObjective(USSR, "waystation-must-not-be-destroyed")
|
||||
DestroyAAGuns = AddSecondaryObjective(USSR, "destory-aa-guns-enable-air-support")
|
||||
PreventAlliedIncursions = AddSecondaryObjective(USSR, "find-destroy-bridge-stop-allied-reinforcements")
|
||||
|
||||
Trigger.OnKilled(USSRTechCenter01, function()
|
||||
player.MarkFailedObjective(ProtectWaystation)
|
||||
USSR.MarkFailedObjective(ProtectWaystation)
|
||||
end)
|
||||
|
||||
Trigger.OnKilled(ObjectiveTruck01, function()
|
||||
player.MarkFailedObjective(BringSupplyTruck)
|
||||
USSR.MarkFailedObjective(BringSupplyTruck)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(WaystationTrigger, function(unit, id)
|
||||
if unit == ObjectiveTruck01 then
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
player.MarkCompletedObjective(BringSupplyTruck)
|
||||
player.MarkCompletedObjective(ProtectWaystation)
|
||||
USSR.MarkCompletedObjective(BringSupplyTruck)
|
||||
USSR.MarkCompletedObjective(ProtectWaystation)
|
||||
end
|
||||
end)
|
||||
|
||||
Trigger.OnAllKilled(AlliedAAGuns, function()
|
||||
player.MarkCompletedObjective(DestroyAAGuns)
|
||||
Media.PlaySpeechNotification(player, "ObjectiveMet")
|
||||
USSR.MarkCompletedObjective(DestroyAAGuns)
|
||||
Media.PlaySpeechNotification(USSR, "ObjectiveMet")
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
Actor.Create("powerproxy.spyplane", true, { Owner = player })
|
||||
Actor.Create("powerproxy.parabombs", true, { Owner = player })
|
||||
Actor.Create("powerproxy.spyplane", true, { Owner = USSR })
|
||||
Actor.Create("powerproxy.parabombs", true, { Owner = USSR })
|
||||
Media.DisplayMessage(UserInterface.Translate("air-support-t-minus-3"))
|
||||
end)
|
||||
end)
|
||||
@@ -137,21 +137,21 @@ WorldLoaded = function()
|
||||
SpawnAlliedHuntingParty()
|
||||
|
||||
Trigger.AfterDelay(0, function()
|
||||
local playerrevealcam = Actor.Create("camera", true, { Owner = player, Location = PlayerStartLocation.Location })
|
||||
local playerrevealcam = Actor.Create("camera", true, { Owner = USSR, Location = PlayerStartLocation.Location })
|
||||
Trigger.AfterDelay(1, function()
|
||||
if playerrevealcam.IsInWorld then playerrevealcam.Destroy() end
|
||||
end)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(Inf01Trigger, function(unit, id)
|
||||
if unit.Owner == player then
|
||||
if unit.Owner == USSR then
|
||||
if not AlliedGNRLHouse.IsDead then
|
||||
Reinforcements.Reinforce(greece, { "gnrl" }, { AlliedGNRLSpawn.Location, AlliedGNRLDestination.Location }, 0, function(unit)
|
||||
Reinforcements.Reinforce(Greece, { "gnrl" }, { AlliedGNRLSpawn.Location, AlliedGNRLDestination.Location }, 0, function(unit)
|
||||
HuntEnemyUnits(unit)
|
||||
end)
|
||||
end
|
||||
Utils.Do(AlliedSquad01, HuntEnemyUnits)
|
||||
local alliedgnrlcamera = Actor.Create("scamera", true, { Owner = player, Location = AlliedGNRLSpawn.Location })
|
||||
local alliedgnrlcamera = Actor.Create("scamera", true, { Owner = USSR, Location = AlliedGNRLSpawn.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(6), function()
|
||||
if alliedgnrlcamera.IsInWorld then alliedgnrlcamera.Destroy() end
|
||||
end)
|
||||
@@ -160,7 +160,7 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(Inf02Trigger, function(unit, id)
|
||||
if unit.Owner == player then
|
||||
if unit.Owner == USSR then
|
||||
Utils.Do(AlliedSquad02, HuntEnemyUnits)
|
||||
Trigger.RemoveFootprintTrigger(id)
|
||||
end
|
||||
@@ -168,30 +168,30 @@ WorldLoaded = function()
|
||||
|
||||
Utils.Do(AlliedSquad03, function(actor)
|
||||
Trigger.OnDamaged(actor, function(unit, attacker)
|
||||
if attacker.Owner == player then
|
||||
if attacker.Owner == USSR then
|
||||
Utils.Do(AlliedSquad03, HuntEnemyUnits)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
Trigger.OnEnteredFootprint(RevealBridgeTrigger, function(unit, id)
|
||||
if unit.Owner == player then
|
||||
local bridgecamera01 = Actor.Create("camera", true, { Owner = player, Location = AlliedHuntingPartySpawn.Location })
|
||||
local bridgecamera02 = Actor.Create("camera", true, { Owner = player, Location = AlliedHuntingPartyWP01.Location })
|
||||
if unit.Owner == USSR then
|
||||
local bridgecamera01 = Actor.Create("camera", true, { Owner = USSR, Location = AlliedHuntingPartySpawn.Location })
|
||||
local bridgecamera02 = Actor.Create("camera", true, { Owner = USSR, Location = AlliedHuntingPartyWP01.Location })
|
||||
Trigger.AfterDelay(DateTime.Seconds(6), function()
|
||||
if bridgecamera01.IsInWorld then bridgecamera01.Destroy() end
|
||||
if bridgecamera02.IsInWorld then bridgecamera02.Destroy() end
|
||||
end)
|
||||
if Difficulty == "normal" then
|
||||
Reinforcements.Reinforce(goodguy, { "dd" }, { AlliedDestroyer01Spawn.Location, AlliedDestroyer01WP01.Location, AlliedDestroyer01WP02.Location }, 0, function(unit)
|
||||
Reinforcements.Reinforce(GoodGuy, { "dd" }, { AlliedDestroyer01Spawn.Location, AlliedDestroyer01WP01.Location, AlliedDestroyer01WP02.Location }, 0, function(unit)
|
||||
unit.Stance = "Defend"
|
||||
end)
|
||||
end
|
||||
if Difficulty == "hard" then
|
||||
Reinforcements.Reinforce(goodguy, { "dd" }, { AlliedDestroyer01Spawn.Location, AlliedDestroyer01WP01.Location, AlliedDestroyer01WP02.Location }, 0, function(unit)
|
||||
Reinforcements.Reinforce(GoodGuy, { "dd" }, { AlliedDestroyer01Spawn.Location, AlliedDestroyer01WP01.Location, AlliedDestroyer01WP02.Location }, 0, function(unit)
|
||||
unit.Stance = "Defend"
|
||||
end)
|
||||
Reinforcements.Reinforce(goodguy, { "dd" }, { AlliedDestroyer02Spawn.Location, AlliedDestroyer02WP01.Location, AlliedDestroyer02WP02.Location }, 0, function(unit)
|
||||
Reinforcements.Reinforce(GoodGuy, { "dd" }, { AlliedDestroyer02Spawn.Location, AlliedDestroyer02WP01.Location, AlliedDestroyer02WP02.Location }, 0, function(unit)
|
||||
unit.Stance = "Defend"
|
||||
end)
|
||||
end
|
||||
@@ -200,7 +200,7 @@ WorldLoaded = function()
|
||||
end)
|
||||
|
||||
Trigger.AfterDelay(DateTime.Minutes(9), function()
|
||||
local powerproxy01 = Actor.Create("powerproxy.paratroopers", true, { Owner = greece })
|
||||
local powerproxy01 = Actor.Create("powerproxy.paratroopers", true, { Owner = Greece })
|
||||
local aircraft01 = powerproxy01.TargetParatroopers(AlliedParadropLZ01.CenterPosition, Angle.SouthWest)
|
||||
Utils.Do(aircraft01, function(a)
|
||||
Trigger.OnPassengerExited(a, function(t, p)
|
||||
@@ -208,7 +208,7 @@ WorldLoaded = function()
|
||||
end)
|
||||
end)
|
||||
|
||||
local powerproxy02 = Actor.Create("powerproxy.paratroopers", true, { Owner = goodguy })
|
||||
local powerproxy02 = Actor.Create("powerproxy.paratroopers", true, { Owner = GoodGuy })
|
||||
local aircraft02 = powerproxy02.TargetParatroopers(AlliedParadropLZ02.CenterPosition, Angle.SouthWest)
|
||||
Utils.Do(aircraft02, function(a)
|
||||
Trigger.OnPassengerExited(a, function(t, p)
|
||||
@@ -223,8 +223,8 @@ WorldLoaded = function()
|
||||
BridgeIsIntact = false
|
||||
if not BridgeBarrel01.IsDead then BridgeBarrel01.Kill() end
|
||||
if not BridgeBarrel03.IsDead then BridgeBarrel03.Kill() end
|
||||
player.MarkCompletedObjective(PreventAlliedIncursions)
|
||||
Media.PlaySpeechNotification(player, "ObjectiveMet")
|
||||
USSR.MarkCompletedObjective(PreventAlliedIncursions)
|
||||
Media.PlaySpeechNotification(USSR, "ObjectiveMet")
|
||||
Trigger.AfterDelay(DateTime.Seconds(2), function()
|
||||
Media.DisplayMessage(UserInterface.Translate("allied-ground-reinforcements-stopped"))
|
||||
end)
|
||||
@@ -239,12 +239,12 @@ WorldLoaded = function()
|
||||
|
||||
Trigger.OnAnyKilled(AlliedSquad04, function()
|
||||
if BridgeIsIntact then
|
||||
local tanks = Reinforcements.Reinforce(greece, AlliedTanksReinforcement, { AlliedHuntingPartySpawn.Location, AlliedHuntingPartyWP01.Location }, 0, function(units)
|
||||
local tanks = Reinforcements.Reinforce(Greece, AlliedTanksReinforcement, { AlliedHuntingPartySpawn.Location, AlliedHuntingPartyWP01.Location }, 0, function(units)
|
||||
AlliedGroundPatrols(units)
|
||||
end)
|
||||
Trigger.OnAllKilled(tanks, function()
|
||||
if BridgeIsIntact then
|
||||
Reinforcements.Reinforce(greece, AlliedTanksReinforcement, { AlliedHuntingPartySpawn.Location, AlliedHuntingPartyWP01.Location }, 0, function(units)
|
||||
Reinforcements.Reinforce(Greece, AlliedTanksReinforcement, { AlliedHuntingPartySpawn.Location, AlliedHuntingPartyWP01.Location }, 0, function(units)
|
||||
AlliedGroundPatrols(units)
|
||||
end)
|
||||
end
|
||||
@@ -254,12 +254,12 @@ WorldLoaded = function()
|
||||
|
||||
Trigger.OnAllKilled(AlliedSquad04, function()
|
||||
if BridgeIsIntact then
|
||||
local tanks = Reinforcements.Reinforce(greece, AlliedTanksReinforcement, { AlliedHuntingPartySpawn.Location, AlliedHuntingPartyWP01.Location }, 0, function(units)
|
||||
local tanks = Reinforcements.Reinforce(Greece, AlliedTanksReinforcement, { AlliedHuntingPartySpawn.Location, AlliedHuntingPartyWP01.Location }, 0, function(units)
|
||||
AlliedGroundPatrols(units)
|
||||
end)
|
||||
Trigger.OnAllKilled(tanks, function()
|
||||
if BridgeIsIntact then
|
||||
Reinforcements.Reinforce(greece, AlliedTanksReinforcement, { AlliedHuntingPartySpawn.Location, AlliedHuntingPartyWP01.Location }, 0, function(units)
|
||||
Reinforcements.Reinforce(Greece, AlliedTanksReinforcement, { AlliedHuntingPartySpawn.Location, AlliedHuntingPartyWP01.Location }, 0, function(units)
|
||||
AlliedGroundPatrols(units)
|
||||
end)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user