Move Utils.Seconds and .Minutes into DateTime global

Also renames Date.IsHalloween to DateTime.IsHalloween
This commit is contained in:
Oliver Brakmann
2014-10-19 16:30:03 +02:00
parent 6a44c265e2
commit 37c5d51f19
15 changed files with 127 additions and 134 deletions

View File

@@ -14,7 +14,7 @@ using OpenRA.Scripting;
namespace OpenRA.Mods.RA.Scripting namespace OpenRA.Mods.RA.Scripting
{ {
[ScriptGlobal("Date")] [ScriptGlobal("DateTime")]
public class DateGlobal : ScriptGlobal public class DateGlobal : ScriptGlobal
{ {
public DateGlobal(ScriptContext context) public DateGlobal(ScriptContext context)
@@ -25,18 +25,23 @@ namespace OpenRA.Mods.RA.Scripting
{ {
get { return DateTime.Today.Month == 10 && DateTime.Today.Day == 31; } get { return DateTime.Today.Month == 10 && DateTime.Today.Day == 31; }
} }
}
[ScriptGlobal("Time")]
public class TimeGlobal : ScriptGlobal
{
public TimeGlobal(ScriptContext context)
: base(context) { }
[Desc("Get the current game time (in ticks)")] [Desc("Get the current game time (in ticks)")]
public int GameTime public int GameTime
{ {
get { return context.World.WorldTick; } get { return context.World.WorldTick; }
} }
[Desc("Converts the number of seconds into game time (ticks).")]
public int Seconds(int seconds)
{
return seconds * 25;
}
[Desc("Converts the number of minutes into game time (ticks).")]
public int Minutes(int minutes)
{
return Seconds(minutes * 60);
}
} }
} }

View File

@@ -95,17 +95,5 @@ namespace OpenRA.Mods.RA.Scripting
{ {
return context.World.Map.CenterOfCell(cell); return context.World.Map.CenterOfCell(cell);
} }
[Desc("Converts the number of seconds into game time (ticks).")]
public int Seconds(int seconds)
{
return seconds * 25;
}
[Desc("Converts the number of minutes into game time (ticks).")]
public int Minutes(int minutes)
{
return Seconds(minutes * 60);
}
} }
} }

View File

@@ -76,10 +76,10 @@ WorldLoaded = function()
SendNodPatrol() SendNodPatrol()
Trigger.AfterDelay(Utils.Seconds(5), function() Reinforce(InfantryReinforcements) end) Trigger.AfterDelay(DateTime.Seconds(5), function() Reinforce(InfantryReinforcements) end)
Trigger.AfterDelay(Utils.Seconds(15), function() Reinforce(InfantryReinforcements) end) Trigger.AfterDelay(DateTime.Seconds(15), function() Reinforce(InfantryReinforcements) end)
Trigger.AfterDelay(Utils.Seconds(30), function() Reinforce(VehicleReinforcements) end) Trigger.AfterDelay(DateTime.Seconds(30), function() Reinforce(VehicleReinforcements) end)
Trigger.AfterDelay(Utils.Seconds(60), function() Reinforce(VehicleReinforcements) end) Trigger.AfterDelay(DateTime.Seconds(60), function() Reinforce(VehicleReinforcements) end)
end end
tick = 0 tick = 0
@@ -94,7 +94,7 @@ Tick = function()
enemy.MarkCompletedObjective(nodObjective) enemy.MarkCompletedObjective(nodObjective)
end end
if not baseEstablished and tick % Utils.Seconds(1) == 0 and CheckForBase() then if not baseEstablished and tick % DateTime.Seconds(1) == 0 and CheckForBase() then
baseEstablished = true baseEstablished = true
player.MarkCompletedObjective(gdiObjective2) player.MarkCompletedObjective(gdiObjective2)
end end

View File

@@ -12,9 +12,9 @@ end
BridgeheadSecured = function() BridgeheadSecured = function()
Reinforce(MobileConstructionVehicle) Reinforce(MobileConstructionVehicle)
Trigger.AfterDelay(Utils.Seconds(15), NodAttack) Trigger.AfterDelay(DateTime.Seconds(15), NodAttack)
Trigger.AfterDelay(Utils.Seconds(30), function() Reinforce(EngineerReinforcements) end) Trigger.AfterDelay(DateTime.Seconds(30), function() Reinforce(EngineerReinforcements) end)
Trigger.AfterDelay(Utils.Seconds(120), function() Reinforce(VehicleReinforcements) end) Trigger.AfterDelay(DateTime.Seconds(120), function() Reinforce(VehicleReinforcements) end)
end end
NodAttack = function() NodAttack = function()
@@ -25,7 +25,7 @@ NodAttack = function()
unit.AttackMove(waypoint2.Location) unit.AttackMove(waypoint2.Location)
Trigger.OnIdle(unit, unit.Hunt) Trigger.OnIdle(unit, unit.Hunt)
end) end)
Trigger.OnAllKilled(attackers, function() Trigger.AfterDelay(Utils.Seconds(15), NodAttack) end) Trigger.OnAllKilled(attackers, function() Trigger.AfterDelay(DateTime.Seconds(15), NodAttack) end)
end end
end end
@@ -45,14 +45,14 @@ WorldLoaded = function()
Trigger.OnPlayerWon(player, function() Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win") Media.PlaySpeechNotification(player, "Win")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("flag.vqa") Media.PlayMovieFullscreen("flag.vqa")
end) end)
end) end)
Trigger.OnPlayerLost(player, function() Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose") Media.PlaySpeechNotification(player, "Lose")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("gameover.vqa") Media.PlayMovieFullscreen("gameover.vqa")
end) end)
end) end)

View File

@@ -11,9 +11,9 @@ GDIReinforcements = { "e2", "e2", "e2", "e2", "e2" }
GDIReinforcementsWaypoints = { GDIReinforcementsEntry.Location, GDIReinforcementsWP1.Location } GDIReinforcementsWaypoints = { GDIReinforcementsEntry.Location, GDIReinforcementsWP1.Location }
NodHelis = { NodHelis = {
{ Utils.Seconds(HeliDelay[1]), { NodHeliEntry.Location, NodHeliLZ1.Location }, { "e1", "e1", "e3" } }, { DateTime.Seconds(HeliDelay[1]), { NodHeliEntry.Location, NodHeliLZ1.Location }, { "e1", "e1", "e3" } },
{ Utils.Seconds(HeliDelay[2]), { NodHeliEntry.Location, NodHeliLZ2.Location }, { "e1", "e1", "e1", "e1" } }, { DateTime.Seconds(HeliDelay[2]), { NodHeliEntry.Location, NodHeliLZ2.Location }, { "e1", "e1", "e1", "e1" } },
{ Utils.Seconds(HeliDelay[3]), { NodHeliEntry.Location, NodHeliLZ3.Location }, { "e1", "e1", "e3" } } { DateTime.Seconds(HeliDelay[3]), { NodHeliEntry.Location, NodHeliLZ3.Location }, { "e1", "e1", "e3" } }
} }
SendHeli = function(heli) SendHeli = function(heli)
@@ -30,7 +30,7 @@ SendGDIReinforcements = function()
Media.PlaySpeechNotification(gdi, "Reinforce") Media.PlaySpeechNotification(gdi, "Reinforce")
Reinforcements.ReinforceWithTransport(gdi, "apc", GDIReinforcements, GDIReinforcementsWaypoints, nil, function(apc, team) Reinforcements.ReinforceWithTransport(gdi, "apc", GDIReinforcements, GDIReinforcementsWaypoints, nil, function(apc, team)
table.insert(team, apc) table.insert(team, apc)
Trigger.OnAllKilled(team, function() Trigger.AfterDelay(Utils.Seconds(5), SendGDIReinforcements) end) Trigger.OnAllKilled(team, function() Trigger.AfterDelay(DateTime.Seconds(5), SendGDIReinforcements) end)
Utils.Do(team, function(unit) unit.Stance = "Defend" end) Utils.Do(team, function(unit) unit.Stance = "Defend" end)
end) end)
end end
@@ -49,7 +49,7 @@ BuildNod1 = function()
end end
if not HandOfNod.Build(Nod1Units, func) then if not HandOfNod.Build(Nod1Units, func) then
Trigger.AfterDelay(Utils.Seconds(5), BuildNod1) Trigger.AfterDelay(DateTime.Seconds(5), BuildNod1)
end end
end end
@@ -66,7 +66,7 @@ BuildAuto1 = function()
end end
if not HandOfNod.IsDead and HandOfNod.Build(Auto1Units, func) then if not HandOfNod.IsDead and HandOfNod.Build(Auto1Units, func) then
Trigger.AfterDelay(Utils.Seconds(5), BuildAuto1) Trigger.AfterDelay(DateTime.Seconds(5), BuildAuto1)
end end
end end
@@ -84,7 +84,7 @@ Tick = function()
end end
if gdi.HasNoRequiredUnits() then if gdi.HasNoRequiredUnits() then
Trigger.AfterDelay(Utils.Seconds(1), function() gdi.MarkFailedObjective(gdiObjective) end) Trigger.AfterDelay(DateTime.Seconds(1), function() gdi.MarkFailedObjective(gdiObjective) end)
end end
end end
@@ -121,14 +121,14 @@ WorldLoaded = function()
Trigger.OnPlayerWon(gdi, function() Trigger.OnPlayerWon(gdi, function()
Media.PlaySpeechNotification(gdi, "Win") Media.PlaySpeechNotification(gdi, "Win")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("burdet1.vqa") Media.PlayMovieFullscreen("burdet1.vqa")
end) end)
end) end)
Trigger.OnPlayerLost(gdi, function() Trigger.OnPlayerLost(gdi, function()
Media.PlaySpeechNotification(gdi, "Lose") Media.PlaySpeechNotification(gdi, "Lose")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("gameover.vqa") Media.PlayMovieFullscreen("gameover.vqa")
end) end)
end) end)

View File

@@ -28,7 +28,7 @@ SendGDIReinforcements = function()
Media.PlaySpeechNotification(gdi, "Reinforce") Media.PlaySpeechNotification(gdi, "Reinforce")
Reinforcements.ReinforceWithTransport(gdi, "apc", GDIReinforcements, GDIReinforcementsWaypoints, nil, function(apc, team) Reinforcements.ReinforceWithTransport(gdi, "apc", GDIReinforcements, GDIReinforcementsWaypoints, nil, function(apc, team)
table.insert(team, apc) table.insert(team, apc)
Trigger.OnAllKilled(team, function() Trigger.AfterDelay(Utils.Seconds(5), SendGDIReinforcements) end) Trigger.OnAllKilled(team, function() Trigger.AfterDelay(DateTime.Seconds(5), SendGDIReinforcements) end)
Utils.Do(team, function(unit) unit.Stance = "Defend" end) Utils.Do(team, function(unit) unit.Stance = "Defend" end)
end) end)
end end
@@ -48,7 +48,7 @@ Build = function(unitTypes, repeats, func)
end end
if not HandOfNod.Build(unitTypes, innerFunc) then if not HandOfNod.Build(unitTypes, innerFunc) then
Trigger.AfterDelay(Utils.Seconds(5), function() Trigger.AfterDelay(DateTime.Seconds(5), function()
Build(unitTypes, repeats, func) Build(unitTypes, repeats, func)
end) end)
end end
@@ -90,7 +90,7 @@ Tick = function()
end end
if gdi.HasNoRequiredUnits() then if gdi.HasNoRequiredUnits() then
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
gdi.MarkFailedObjective(gdiObjective) gdi.MarkFailedObjective(gdiObjective)
end) end)
end end
@@ -126,14 +126,14 @@ WorldLoaded = function()
Trigger.OnPlayerWon(gdi, function() Trigger.OnPlayerWon(gdi, function()
Media.PlaySpeechNotification(gdi, "Win") Media.PlaySpeechNotification(gdi, "Win")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("burdet1.vqa") Media.PlayMovieFullscreen("burdet1.vqa")
end) end)
end) end)
Trigger.OnPlayerLost(gdi, function() Trigger.OnPlayerLost(gdi, function()
Media.PlaySpeechNotification(gdi, "Lose") Media.PlaySpeechNotification(gdi, "Lose")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("gameover.vqa") Media.PlayMovieFullscreen("gameover.vqa")
end) end)
end) end)
@@ -177,7 +177,7 @@ WorldLoaded = function()
autoTrigger = true autoTrigger = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
BuildAuto() BuildAuto()
Trigger.AfterDelay(Utils.Seconds(4), function() Trigger.AfterDelay(DateTime.Seconds(4), function()
tank.Hunt() tank.Hunt()
end) end)
end end

View File

@@ -15,7 +15,7 @@ Civvie2Wpts = { waypoint26, waypoint3, waypoint9, waypoint4, waypoint5, waypoint
FollowCivvieWpts = function(actor, wpts) FollowCivvieWpts = function(actor, wpts)
Utils.Do(wpts, function(wpt) Utils.Do(wpts, function(wpt)
actor.Move(wpt.Location, 2) actor.Move(wpt.Location, 2)
actor.Wait(Utils.Seconds(2)) actor.Wait(DateTime.Seconds(2))
end) end)
end end
@@ -36,22 +36,22 @@ TownAttackAction = function(actor)
end end
AttackTown = function() AttackTown = function()
Reinforcements.Reinforce(nod, TownAttackWave1, { NodReinfEntry.Location, waypoint0.Location }, Utils.Seconds(0.25), TownAttackAction) Reinforcements.Reinforce(nod, TownAttackWave1, { NodReinfEntry.Location, waypoint0.Location }, DateTime.Seconds(0.25), TownAttackAction)
Trigger.AfterDelay(Utils.Seconds(2), function() Trigger.AfterDelay(DateTime.Seconds(2), function()
Reinforcements.Reinforce(nod, TownAttackWave2, { NodReinfEntry.Location, waypoint0.Location }, Utils.Seconds(1), TownAttackAction) Reinforcements.Reinforce(nod, TownAttackWave2, { NodReinfEntry.Location, waypoint0.Location }, DateTime.Seconds(1), TownAttackAction)
end) end)
Trigger.AfterDelay(Utils.Seconds(4), function() Trigger.AfterDelay(DateTime.Seconds(4), function()
Reinforcements.Reinforce(nod, TownAttackWave3, { NodReinfEntry.Location, waypoint0.Location }, Utils.Seconds(1), TownAttackAction) Reinforcements.Reinforce(nod, TownAttackWave3, { NodReinfEntry.Location, waypoint0.Location }, DateTime.Seconds(1), TownAttackAction)
end) end)
end end
SendGDIReinforcements = function() SendGDIReinforcements = function()
Reinforcements.Reinforce(player, GDIReinforcementsPart1, { GDIReinfEntry1.Location, waypoint12.Location }, Utils.Seconds(1), function(actor) Reinforcements.Reinforce(player, GDIReinforcementsPart1, { GDIReinfEntry1.Location, waypoint12.Location }, DateTime.Seconds(1), function(actor)
Media.PlaySpeechNotification(player, "Reinforce") Media.PlaySpeechNotification(player, "Reinforce")
actor.Move(waypoint10.Location) actor.Move(waypoint10.Location)
actor.Stance = "Defend" actor.Stance = "Defend"
end) end)
Trigger.AfterDelay(Utils.Seconds(5), function() Trigger.AfterDelay(DateTime.Seconds(5), function()
Reinforcements.ReinforceWithTransport(player, "apc", GDIReinforcementsPart2, { GDIReinfEntry2.Location, waypoint13.Location }, nil, function(apc, team) Reinforcements.ReinforceWithTransport(player, "apc", GDIReinforcementsPart2, { GDIReinfEntry2.Location, waypoint13.Location }, nil, function(apc, team)
Media.PlaySpeechNotification(player, "Reinforce") Media.PlaySpeechNotification(player, "Reinforce")
apc.Move(GDIUnloadWpt.Location) apc.Move(GDIUnloadWpt.Location)
@@ -81,14 +81,14 @@ WorldLoaded = function()
Trigger.OnPlayerWon(player, function() Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win") Media.PlaySpeechNotification(player, "Win")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("burdet1.vqa") Media.PlayMovieFullscreen("burdet1.vqa")
end) end)
end) end)
Trigger.OnPlayerLost(player, function() Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose") Media.PlaySpeechNotification(player, "Lose")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("gameover.vqa") Media.PlayMovieFullscreen("gameover.vqa")
end) end)
end) end)

View File

@@ -37,7 +37,7 @@ WorldLoaded = function()
Trigger.OnPlayerLost(nod, function() Trigger.OnPlayerLost(nod, function()
Media.PlaySpeechNotification(nod, "Lose") Media.PlaySpeechNotification(nod, "Lose")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("nodlose.vqa") Media.PlayMovieFullscreen("nodlose.vqa")
end) end)
end) end)
@@ -49,13 +49,13 @@ WorldLoaded = function()
Trigger.OnKilled(Nikoomba, function() Trigger.OnKilled(Nikoomba, function()
nod.MarkCompletedObjective(NodObjective1) nod.MarkCompletedObjective(NodObjective1)
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
SendLastInfantryReinforcements() SendLastInfantryReinforcements()
end) end)
end) end)
Trigger.AfterDelay(Utils.Seconds(30), SendFirstInfantryReinforcements) Trigger.AfterDelay(DateTime.Seconds(30), SendFirstInfantryReinforcements)
Trigger.AfterDelay(Utils.Seconds(60), SendSecondInfantryReinforcements) Trigger.AfterDelay(DateTime.Seconds(60), SendSecondInfantryReinforcements)
end end
Tick = function() Tick = function()

View File

@@ -3,14 +3,14 @@ FirstAttackWave = { "e1", "e1", "e1", "e2", }
SecondThirdAttackWave = { "e1", "e1", "e2", } SecondThirdAttackWave = { "e1", "e1", "e2", }
SendAttackWave = function(units, spawnPoint) SendAttackWave = function(units, spawnPoint)
Reinforcements.Reinforce(enemy, units, { spawnPoint }, Utils.Seconds(1), function(actor) Reinforcements.Reinforce(enemy, units, { spawnPoint }, DateTime.Seconds(1), function(actor)
actor.AttackMove(PlayerBase.Location) actor.AttackMove(PlayerBase.Location)
end) end)
end end
InsertNodUnits = function() InsertNodUnits = function()
Reinforcements.Reinforce(player, NodUnits, { NodEntry.Location, NodRallyPoint.Location }) Reinforcements.Reinforce(player, NodUnits, { NodEntry.Location, NodRallyPoint.Location })
Trigger.AfterDelay(Utils.Seconds(9), function() Trigger.AfterDelay(DateTime.Seconds(9), function()
Reinforcements.Reinforce(player, { "mcv" }, { NodEntry.Location, PlayerBase.Location }) Reinforcements.Reinforce(player, { "mcv" }, { NodEntry.Location, PlayerBase.Location })
end) end)
end end
@@ -31,14 +31,14 @@ WorldLoaded = function()
Trigger.OnPlayerWon(player, function() Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win") Media.PlaySpeechNotification(player, "Win")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("desflees.vqa") Media.PlayMovieFullscreen("desflees.vqa")
end) end)
end) end)
Trigger.OnPlayerLost(player, function() Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose") Media.PlaySpeechNotification(player, "Lose")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("flag.vqa") Media.PlayMovieFullscreen("flag.vqa")
end) end)
end) end)
@@ -48,7 +48,7 @@ WorldLoaded = function()
nodObjective2 = player.AddSecondaryObjective("Destroy all GDI forces") nodObjective2 = player.AddSecondaryObjective("Destroy all GDI forces")
Trigger.OnCapture(TechCenter, function() Trigger.OnCapture(TechCenter, function()
Trigger.AfterDelay(Utils.Seconds(2), function() Trigger.AfterDelay(DateTime.Seconds(2), function()
player.MarkCompletedObjective(nodObjective1) player.MarkCompletedObjective(nodObjective1)
end) end)
end) end)
@@ -58,9 +58,9 @@ WorldLoaded = function()
end) end)
InsertNodUnits() InsertNodUnits()
Trigger.AfterDelay(Utils.Seconds(20), function() SendAttackWave(FirstAttackWave, AttackWaveSpawnA.Location) end) Trigger.AfterDelay(DateTime.Seconds(20), function() SendAttackWave(FirstAttackWave, AttackWaveSpawnA.Location) end)
Trigger.AfterDelay(Utils.Seconds(50), function() SendAttackWave(SecondThirdAttackWave, AttackWaveSpawnB.Location) end) Trigger.AfterDelay(DateTime.Seconds(50), function() SendAttackWave(SecondThirdAttackWave, AttackWaveSpawnB.Location) end)
Trigger.AfterDelay(Utils.Seconds(100), function() SendAttackWave(SecondThirdAttackWave, AttackWaveSpawnC.Location) end) Trigger.AfterDelay(DateTime.Seconds(100), function() SendAttackWave(SecondThirdAttackWave, AttackWaveSpawnC.Location) end)
end end
Tick = function() Tick = function()

View File

@@ -26,7 +26,7 @@ end
InsertNodUnits = function() InsertNodUnits = function()
Reinforcements.Reinforce(player, { "mcv" }, { McvEntry.Location, McvDeploy.Location }) Reinforcements.Reinforce(player, { "mcv" }, { McvEntry.Location, McvDeploy.Location })
Reinforcements.Reinforce(player, NodUnits, { NodEntry.Location, NodRallypoint.Location }) Reinforcements.Reinforce(player, NodUnits, { NodEntry.Location, NodRallypoint.Location })
Trigger.AfterDelay(Utils.Seconds(15), function() Trigger.AfterDelay(DateTime.Seconds(15), function()
Reinforcements.Reinforce(player, Engineers, { McvEntry.Location, PlayerBase.Location }) Reinforcements.Reinforce(player, Engineers, { McvEntry.Location, PlayerBase.Location })
end) end)
end end
@@ -47,14 +47,14 @@ WorldLoaded = function()
Trigger.OnPlayerWon(player, function() Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win") Media.PlaySpeechNotification(player, "Win")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("desflees.vqa") Media.PlayMovieFullscreen("desflees.vqa")
end) end)
end) end)
Trigger.OnPlayerLost(player, function() Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose") Media.PlaySpeechNotification(player, "Lose")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("flag.vqa") Media.PlayMovieFullscreen("flag.vqa")
end) end)
end) end)
@@ -65,15 +65,15 @@ WorldLoaded = function()
Trigger.OnKilled(TechCenter, function() player.MarkFailedObjective(nodObjective1) end) Trigger.OnKilled(TechCenter, function() player.MarkFailedObjective(nodObjective1) end)
Trigger.OnCapture(TechCenter, function() Trigger.OnCapture(TechCenter, function()
Trigger.AfterDelay(Utils.Seconds(2), function() Trigger.AfterDelay(DateTime.Seconds(2), function()
player.MarkCompletedObjective(nodObjective1) player.MarkCompletedObjective(nodObjective1)
end) end)
end) end)
InsertNodUnits() InsertNodUnits()
Trigger.AfterDelay(Utils.Seconds(40), function() SendAttackWave(FirstAttackWaveUnits, FirstAttackWave) end) Trigger.AfterDelay(DateTime.Seconds(40), function() SendAttackWave(FirstAttackWaveUnits, FirstAttackWave) end)
Trigger.AfterDelay(Utils.Seconds(80), function() SendAttackWave(SecondAttackWaveUnits, SecondAttackWave) end) Trigger.AfterDelay(DateTime.Seconds(80), function() SendAttackWave(SecondAttackWaveUnits, SecondAttackWave) end)
Trigger.AfterDelay(Utils.Seconds(140), function() SendAttackWave(ThirdAttackWaveUnits, FirstAttackWave) end) Trigger.AfterDelay(DateTime.Seconds(140), function() SendAttackWave(ThirdAttackWaveUnits, FirstAttackWave) end)
end end

View File

@@ -17,7 +17,7 @@ SendInsertionHelicopter = function()
end end
SendJeeps = function() SendJeeps = function()
Reinforcements.Reinforce(player, JeepReinforcements, InsertionPath, Utils.Seconds(2)) Reinforcements.Reinforce(player, JeepReinforcements, InsertionPath, DateTime.Seconds(2))
Media.PlaySpeechNotification(player, "ReinforcementsArrived") Media.PlaySpeechNotification(player, "ReinforcementsArrived")
end end
@@ -28,8 +28,8 @@ RunInitialActivities = function()
Patrol3.Hunt() Patrol3.Hunt()
Patrol4.Hunt() Patrol4.Hunt()
Harvester.FindResources() Harvester.FindResources()
Civilian1.Wait(Utils.Seconds(6)) Civilian1.Wait(DateTime.Seconds(6))
Civilian2.Wait(Utils.Seconds(6)) Civilian2.Wait(DateTime.Seconds(6))
Civilian1.Hunt() Civilian1.Hunt()
Civilian2.Hunt() Civilian2.Hunt()
end end
@@ -37,21 +37,21 @@ end
LabGuardsKilled = function() LabGuardsKilled = function()
CreateEinstein() CreateEinstein()
Trigger.AfterDelay(Utils.Seconds(2), function() Trigger.AfterDelay(DateTime.Seconds(2), function()
Actor.Create(FlareType, true, { Owner = england, Location = ExtractionFlarePoint.Location }) Actor.Create(FlareType, true, { Owner = england, Location = ExtractionFlarePoint.Location })
Media.PlaySpeechNotification(player, "SignalFlareNorth") Media.PlaySpeechNotification(player, "SignalFlareNorth")
SendExtractionHelicopter() SendExtractionHelicopter()
end) end)
Trigger.AfterDelay(Utils.Seconds(10), function() Trigger.AfterDelay(DateTime.Seconds(10), function()
Media.PlaySpeechNotification(player, "AlliedReinforcementsArrived") Media.PlaySpeechNotification(player, "AlliedReinforcementsArrived")
Actor.Create("camera", true, { Owner = player, Location = CruiserCameraPoint.Location }) Actor.Create("camera", true, { Owner = player, Location = CruiserCameraPoint.Location })
SendCruisers() SendCruisers()
end) end)
Trigger.AfterDelay(Utils.Seconds(12), function() Trigger.AfterDelay(DateTime.Seconds(12), function()
for i = 0, 2 do for i = 0, 2 do
Trigger.AfterDelay(Utils.Seconds(i), function() Trigger.AfterDelay(DateTime.Seconds(i), function()
Media.PlaySoundNotification(player, "AlertBuzzer") Media.PlaySoundNotification(player, "AlertBuzzer")
end) end)
end end
@@ -100,7 +100,7 @@ RescueFailed = function()
end end
OilPumpDestroyed = function() OilPumpDestroyed = function()
Trigger.AfterDelay(Utils.Seconds(5), SendJeeps) Trigger.AfterDelay(DateTime.Seconds(5), SendJeeps)
end end
CiviliansKilled = function() CiviliansKilled = function()
@@ -116,13 +116,13 @@ CreateEinstein = function()
einstein.Scatter() einstein.Scatter()
Trigger.OnKilled(einstein, RescueFailed) Trigger.OnKilled(einstein, RescueFailed)
ExtractObjective = player.AddPrimaryObjective("Wait for the helicopter and extract Einstein.") ExtractObjective = player.AddPrimaryObjective("Wait for the helicopter and extract Einstein.")
Trigger.AfterDelay(Utils.Seconds(1), function() Media.PlaySpeechNotification(player, "TargetFreed") end) Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(player, "TargetFreed") end)
end end
HelicopterGone = function() HelicopterGone = function()
if not heli.IsDead then if not heli.IsDead then
Media.PlaySpeechNotification(player, "TargetRescued") Media.PlaySpeechNotification(player, "TargetRescued")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
player.MarkCompletedObjective(ExtractObjective) player.MarkCompletedObjective(ExtractObjective)
player.MarkCompletedObjective(SurviveObjective) player.MarkCompletedObjective(SurviveObjective)
ussr.MarkFailedObjective(DefendObjective) ussr.MarkFailedObjective(DefendObjective)
@@ -135,14 +135,14 @@ end
MissionAccomplished = function() MissionAccomplished = function()
Media.PlaySpeechNotification(player, "Win") Media.PlaySpeechNotification(player, "Win")
--Trigger.AfterDelay(Utils.Seconds(1), function() --Trigger.AfterDelay(DateTime.Seconds(1), function()
--Media.PlayMovieFullscreen("snowbomb.vqa") -- https://github.com/OpenRA/OpenRA/issues/4224 --Media.PlayMovieFullscreen("snowbomb.vqa") -- https://github.com/OpenRA/OpenRA/issues/4224
--end) --end)
end end
MissionFailed = function() MissionFailed = function()
Media.PlaySpeechNotification(player, "Lose") Media.PlaySpeechNotification(player, "Lose")
Trigger.AfterDelay(Utils.Seconds(1), function() Media.PlayMovieFullscreen("bmap.vqa") end) Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlayMovieFullscreen("bmap.vqa") end)
end end
SetUnitStances = function() SetUnitStances = function()
@@ -197,7 +197,7 @@ WorldLoaded = function()
SetUnitStances() SetUnitStances()
Trigger.AfterDelay(Utils.Seconds(5), function() Actor.Create("camera", true, { Owner = player, Location = BaseCameraPoint.Location }) end) Trigger.AfterDelay(DateTime.Seconds(5), function() Actor.Create("camera", true, { Owner = player, Location = BaseCameraPoint.Location }) end)
Camera.Position = InsertionLZ.CenterPosition Camera.Position = InsertionLZ.CenterPosition

View File

@@ -13,7 +13,7 @@ end
SendJeepReinforcements = function() SendJeepReinforcements = function()
Media.PlaySpeechNotification(player, "ReinforcementsArrived") Media.PlaySpeechNotification(player, "ReinforcementsArrived")
Reinforcements.Reinforce(player, JeepReinforcements, JeepPath, Utils.Seconds(1)) Reinforcements.Reinforce(player, JeepReinforcements, JeepPath, DateTime.Seconds(1))
end end
RunInitialActivities = function() RunInitialActivities = function()
@@ -22,14 +22,14 @@ end
MissionAccomplished = function() MissionAccomplished = function()
Media.PlaySpeechNotification(player, "Win") Media.PlaySpeechNotification(player, "Win")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("montpass.vqa") Media.PlayMovieFullscreen("montpass.vqa")
end) end)
end end
MissionFailed = function() MissionFailed = function()
Media.PlaySpeechNotification(player, "Lose") Media.PlaySpeechNotification(player, "Lose")
Trigger.AfterDelay(Utils.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("frozen.vqa") Media.PlayMovieFullscreen("frozen.vqa")
end) end)
end end
@@ -53,9 +53,9 @@ SendTrucks = function()
ConvoyOnSite = true ConvoyOnSite = true
ConvoyObjective = player.AddPrimaryObjective("Escort the convoy") ConvoyObjective = player.AddPrimaryObjective("Escort the convoy")
Media.PlaySpeechNotification(player, "ConvoyApproaching") Media.PlaySpeechNotification(player, "ConvoyApproaching")
Trigger.AfterDelay(Utils.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
ConvoyUnharmed = true ConvoyUnharmed = true
local trucks = Reinforcements.Reinforce(france, TruckReinforcements, TruckPath, Utils.Seconds(1), local trucks = Reinforcements.Reinforce(france, TruckReinforcements, TruckPath, DateTime.Seconds(1),
function(truck) function(truck)
Trigger.OnIdle(truck, function() truck.Move(TruckExitPoint.Location) end) Trigger.OnIdle(truck, function() truck.Move(TruckExitPoint.Location) end)
end) end)
@@ -79,7 +79,7 @@ ConvoyCasualites = function()
Media.PlaySpeechNotification(player, "ConvoyUnitLost") Media.PlaySpeechNotification(player, "ConvoyUnitLost")
if ConvoyUnharmed then if ConvoyUnharmed then
ConvoyUnharmed = false ConvoyUnharmed = false
Trigger.AfterDelay(Utils.Seconds(1), function() player.MarkFailedObjective(ConvoyObjective) end) Trigger.AfterDelay(DateTime.Seconds(1), function() player.MarkFailedObjective(ConvoyObjective) end)
end end
end end
@@ -116,19 +116,19 @@ WorldLoaded = function()
RunInitialActivities() RunInitialActivities()
SendConstructionVehicleReinforcements() SendConstructionVehicleReinforcements()
Trigger.AfterDelay(Utils.Seconds(5), SendJeepReinforcements) Trigger.AfterDelay(DateTime.Seconds(5), SendJeepReinforcements)
Trigger.AfterDelay(Utils.Seconds(10), SendJeepReinforcements) Trigger.AfterDelay(DateTime.Seconds(10), SendJeepReinforcements)
Trigger.AfterDelay(Utils.Minutes(10), SendTrucks) Trigger.AfterDelay(DateTime.Minutes(10), SendTrucks)
Camera.Position = ReinforcementsEntryPoint.CenterPosition Camera.Position = ReinforcementsEntryPoint.CenterPosition
Media.PlayMovieFullscreen("mcv.vqa") Media.PlayMovieFullscreen("mcv.vqa")
ConvoyTimer(Utils.Seconds(3), "TenMinutesRemaining") ConvoyTimer(DateTime.Seconds(3), "TenMinutesRemaining")
ConvoyTimer(Utils.Minutes(5), "WarningFiveMinutesRemaining") ConvoyTimer(DateTime.Minutes(5), "WarningFiveMinutesRemaining")
ConvoyTimer(Utils.Minutes(6), "WarningFourMinutesRemaining") ConvoyTimer(DateTime.Minutes(6), "WarningFourMinutesRemaining")
ConvoyTimer(Utils.Minutes(7), "WarningThreeMinutesRemaining") ConvoyTimer(DateTime.Minutes(7), "WarningThreeMinutesRemaining")
ConvoyTimer(Utils.Minutes(8), "WarningTwoMinutesRemaining") ConvoyTimer(DateTime.Minutes(8), "WarningTwoMinutesRemaining")
ConvoyTimer(Utils.Minutes(9), "WarningOneMinuteRemaining") ConvoyTimer(DateTime.Minutes(9), "WarningOneMinuteRemaining")
end end

View File

@@ -1,4 +1,4 @@
if Date.IsHalloween then if DateTime.IsHalloween then
UnitTypes = { "ant", "ant", "ant" } UnitTypes = { "ant", "ant", "ant" }
BeachUnitTypes = { "ant", "ant" } BeachUnitTypes = { "ant", "ant" }
ParadropUnitTypes = { "zombie", "zombie", "zombie", "zombie", "zombie" } ParadropUnitTypes = { "zombie", "zombie", "zombie", "zombie", "zombie" }
@@ -68,7 +68,7 @@ ShipAlliedUnits = function()
BindActorTriggers(unit) BindActorTriggers(unit)
end) end)
Trigger.AfterDelay(Utils.Seconds(60), ShipAlliedUnits) Trigger.AfterDelay(DateTime.Seconds(60), ShipAlliedUnits)
end end
InsertAlliedChinookReinforcements = function(entry, hpad) InsertAlliedChinookReinforcements = function(entry, hpad)
@@ -79,7 +79,7 @@ InsertAlliedChinookReinforcements = function(entry, hpad)
BindActorTriggers(unit) BindActorTriggers(unit)
end) end)
Trigger.AfterDelay(Utils.Seconds(60), function() InsertAlliedChinookReinforcements(entry, hpad) end) Trigger.AfterDelay(DateTime.Seconds(60), function() InsertAlliedChinookReinforcements(entry, hpad) end)
end end
ParadropSovietUnits = function() ParadropSovietUnits = function()
@@ -94,7 +94,7 @@ ParadropSovietUnits = function()
end) end)
transport.Paradrop(lz) transport.Paradrop(lz)
Trigger.AfterDelay(Utils.Seconds(35), ParadropSovietUnits) Trigger.AfterDelay(DateTime.Seconds(35), ParadropSovietUnits)
end end
ProduceUnits = function(t) ProduceUnits = function(t)
@@ -131,7 +131,7 @@ ChronoshiftAlliedUnits = function()
units[unit] = cells[i] units[unit] = cells[i]
end end
Chronosphere.Chronoshift(units) Chronosphere.Chronoshift(units)
Trigger.AfterDelay(Utils.Seconds(60), ChronoshiftAlliedUnits) Trigger.AfterDelay(DateTime.Seconds(60), ChronoshiftAlliedUnits)
end end
ticks = 0 ticks = 0
@@ -155,7 +155,7 @@ WorldLoaded = function()
InsertAlliedChinookReinforcements(Chinook1Entry, HeliPad1) InsertAlliedChinookReinforcements(Chinook1Entry, HeliPad1)
InsertAlliedChinookReinforcements(Chinook2Entry, HeliPad2) InsertAlliedChinookReinforcements(Chinook2Entry, HeliPad2)
ParadropSovietUnits() ParadropSovietUnits()
Trigger.AfterDelay(Utils.Seconds(5), ChronoshiftAlliedUnits) Trigger.AfterDelay(DateTime.Seconds(5), ChronoshiftAlliedUnits)
Utils.Do(ProducedUnitTypes, ProduceUnits) Utils.Do(ProducedUnitTypes, ProduceUnits)
SendSovietUnits(Entry1.Location, UnitTypes, 50) SendSovietUnits(Entry1.Location, UnitTypes, 50)

View File

@@ -9,14 +9,14 @@ BeachheadTrigger =
CPos.New(137, 104), CPos.New(137, 105), CPos.New(137, 106), CPos.New(136, 106), CPos.New(136, 107) CPos.New(137, 104), CPos.New(137, 105), CPos.New(137, 106), CPos.New(136, 106), CPos.New(136, 107)
} }
BaseRaidInterval = Utils.Minutes(3) BaseRaidInterval = DateTime.Minutes(3)
BaseFrontAttackInterval = Utils.Minutes(3) + Utils.Seconds(30) BaseFrontAttackInterval = DateTime.Minutes(3) + DateTime.Seconds(30)
BaseRearAttackInterval = Utils.Minutes(8) BaseRearAttackInterval = DateTime.Minutes(8)
UBoatPatrolDelay = Utils.Minutes(2) + Utils.Seconds(30) UBoatPatrolDelay = DateTime.Minutes(2) + DateTime.Seconds(30)
BaseFrontAttackWpts = { PatrolWpt1.Location, BaseRaidWpt1.Location } BaseFrontAttackWpts = { PatrolWpt1.Location, BaseRaidWpt1.Location }
Village = { FarmHouse1, FarmHouse2, FarmHouse3, FarmHouse4, FarmHouse5, FarmHouse6, FarmHouse7, FarmHouse8, FarmHouse9, Church } Village = { FarmHouse1, FarmHouse2, FarmHouse3, FarmHouse4, FarmHouse5, FarmHouse6, FarmHouse7, FarmHouse8, FarmHouse9, Church }
VillageRaidInterval = Utils.Minutes(3) VillageRaidInterval = DateTime.Minutes(3)
VillageRaidAircraft = { "mig", "mig" } VillageRaidAircraft = { "mig", "mig" }
VillageRaidWpts = { VillageRaidEntrypoint.Location, VillageRaidWpt1.Location, VillageRaidWpt2.Location } VillageRaidWpts = { VillageRaidEntrypoint.Location, VillageRaidWpt1.Location, VillageRaidWpt2.Location }
@@ -65,7 +65,7 @@ AirRaid = function(planeTypes, ingress, egress, target)
end end
for i = 1, #planeTypes do for i = 1, #planeTypes do
Trigger.AfterDelay((i - 1) * Utils.Seconds(1), function() Trigger.AfterDelay((i - 1) * DateTime.Seconds(1), function()
local start = Utils.CenterOfCell(ingress[1]) + WVec.New(0, 0, Actor.CruiseAltitude(planeTypes[i])) local start = Utils.CenterOfCell(ingress[1]) + WVec.New(0, 0, Actor.CruiseAltitude(planeTypes[i]))
local plane = Actor.Create(planeTypes[i], true, { CenterPosition = start, Owner = soviets, Facing = (Utils.CenterOfCell(ingress[2]) - start).Facing }) local plane = Actor.Create(planeTypes[i], true, { CenterPosition = start, Owner = soviets, Facing = (Utils.CenterOfCell(ingress[2]) - start).Facing })
@@ -116,7 +116,7 @@ SendUboatPatrol = function(team)
Utils.Do(team, function(uboat) Utils.Do(team, function(uboat)
if not uboat.IsDead then if not uboat.IsDead then
uboat.PatrolUntil(UboatPatrolWpts1, function() uboat.PatrolUntil(UboatPatrolWpts1, function()
return Time.GameTime > Utils.Minutes(2) + UBoatPatrolDelay return DateTime.GameTime > DateTime.Minutes(2) + UBoatPatrolDelay
end) end)
uboat.Patrol(UboatPatrolWpts2) uboat.Patrol(UboatPatrolWpts2)
end end
@@ -125,7 +125,7 @@ SendUboatPatrol = function(team)
end end
SendGroundPatrol = function(team) SendGroundPatrol = function(team)
Utils.Do(team, function(unit) unit.Patrol(GroundPatrolWpts, true, Utils.Seconds(3)) end) Utils.Do(team, function(unit) unit.Patrol(GroundPatrolWpts, true, DateTime.Seconds(3)) end)
Utils.Do(team, function(unit) Utils.Do(team, function(unit)
Trigger.OnIdle(unit, function(actor) actor.Hunt() end) Trigger.OnIdle(unit, function(actor) actor.Hunt() end)
end) end)
@@ -152,7 +152,7 @@ end
Build = function(units, action) Build = function(units, action)
if not soviets.Build(units, action) then if not soviets.Build(units, action) then
Trigger.AfterDelay(Utils.Seconds(15), function() Trigger.AfterDelay(DateTime.Seconds(15), function()
Build(units, action) Build(units, action)
end) end)
end end
@@ -235,7 +235,7 @@ WorldLoaded = function()
captureObjective = player.AddPrimaryObjective("Locate and capture the enemy's Air Force HQ.") captureObjective = player.AddPrimaryObjective("Locate and capture the enemy's Air Force HQ.")
Trigger.OnCapture(AirForceHQ, function() Trigger.OnCapture(AirForceHQ, function()
Trigger.AfterDelay(Utils.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
player.MarkCompletedObjective(captureObjective) player.MarkCompletedObjective(captureObjective)
player.MarkCompletedObjective(villageObjective) player.MarkCompletedObjective(villageObjective)
end) end)
@@ -275,5 +275,5 @@ WorldLoaded = function()
end) end)
Camera.Position = CameraSpot.CenterPosition Camera.Position = CameraSpot.CenterPosition
Trigger.AfterDelay(Utils.Seconds(5), function() CameraSpot.Destroy() end) Trigger.AfterDelay(DateTime.Seconds(5), function() CameraSpot.Destroy() end)
end end

View File

@@ -1,8 +1,8 @@
AlliedUnits = AlliedUnits =
{ {
{ 0, { "1tnk", "1tnk", "2tnk", "2tnk" } }, { 0, { "1tnk", "1tnk", "2tnk", "2tnk" } },
{ Utils.Seconds(3), { "e1", "e1", "e1", "e3", "e3" } }, { DateTime.Seconds(3), { "e1", "e1", "e1", "e3", "e3" } },
{ Utils.Seconds(7), { "e6" } } { DateTime.Seconds(7), { "e6" } }
} }
ReinforceBaseUnits = { "1tnk", "1tnk", "2tnk", "arty", "arty" } ReinforceBaseUnits = { "1tnk", "1tnk", "2tnk", "arty", "arty" }
CivilianEvacuees = { "c1", "c2", "c5", "c7", "c8" } CivilianEvacuees = { "c1", "c2", "c5", "c7", "c8" }
@@ -66,11 +66,11 @@ SetupAlliedBase = function()
DefendOutpost = player.AddSecondaryObjective("Defend and repair our outpost.") DefendOutpost = player.AddSecondaryObjective("Defend and repair our outpost.")
player.MarkCompletedObjective(FindOutpost) player.MarkCompletedObjective(FindOutpost)
Trigger.AfterDelay(Utils.Seconds(1), function() -- don't fail the Objective instantly Trigger.AfterDelay(DateTime.Seconds(1), function() -- don't fail the Objective instantly
Trigger.OnAllRemovedFromWorld(alliedOutpost, function() player.MarkFailedObjective(DefendOutpost) end) Trigger.OnAllRemovedFromWorld(alliedOutpost, function() player.MarkFailedObjective(DefendOutpost) end)
end) end)
Trigger.AfterDelay(Utils.Minutes(1) + Utils.Seconds(40), function() Trigger.AfterDelay(DateTime.Minutes(1) + DateTime.Seconds(40), function()
if not SuperTankDomeIsInfiltrated then if not SuperTankDomeIsInfiltrated then
SuperTankAttack = true SuperTankAttack = true
Utils.Do(SuperTanks, function(tnk) Utils.Do(SuperTanks, function(tnk)
@@ -101,7 +101,7 @@ SendAlliedUnits = function()
Actor.Create("camera" ,true , { Owner = player, Location = ProvingGroundsCameraPoint.Location }) Actor.Create("camera" ,true , { Owner = player, Location = ProvingGroundsCameraPoint.Location })
Actor.Create("camera" ,true , { Owner = ussr, Location = USSRSpen.Location }) Actor.Create("camera" ,true , { Owner = ussr, Location = USSRSpen.Location })
Trigger.AfterDelay(Utils.Seconds(1), function() Media.PlaySpeechNotification(player, "ReinforcementsArrived") end) Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(player, "ReinforcementsArrived") end)
--To avoid overlapping "battlecontrol initialized" and "reinforcements have arrived" --To avoid overlapping "battlecontrol initialized" and "reinforcements have arrived"
Utils.Do(AlliedUnits, function(table) Utils.Do(AlliedUnits, function(table)
Trigger.AfterDelay(table[1], function() Trigger.AfterDelay(table[1], function()
@@ -109,7 +109,7 @@ SendAlliedUnits = function()
end) end)
end) end)
Trigger.AfterDelay(Utils.Seconds(1), function() InitialUnitsArrived = true end) Trigger.AfterDelay(DateTime.Seconds(1), function() InitialUnitsArrived = true end)
end end
SuperTankDomeInfiltrated = function() SuperTankDomeInfiltrated = function()
@@ -145,12 +145,12 @@ SuperTankDomeInfiltrated = function()
end) end)
player.MarkCompletedObjective(InfiltrateRadarDome) player.MarkCompletedObjective(InfiltrateRadarDome)
Trigger.AfterDelay(Utils.Minutes(3), SuperTanksDestruction) Trigger.AfterDelay(DateTime.Minutes(3), SuperTanksDestruction)
Trigger.AfterDelay(Utils.Seconds(2), function() Trigger.AfterDelay(DateTime.Seconds(2), function()
Media.PlaySpeechNotification(player, "ControlCenterDeactivated") Media.PlaySpeechNotification(player, "ControlCenterDeactivated")
Trigger.AfterDelay(Utils.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
Media.DisplayMessage("In 3 minutes the super tanks will self destruct.") Media.DisplayMessage("In 3 minutes the super tanks will self destruct.")
Media.PlaySpeechNotification(player, "WarningThreeMinutesRemaining") Media.PlaySpeechNotification(player, "WarningThreeMinutesRemaining")
end) end)
@@ -185,7 +185,7 @@ CreateDemitri = function()
local flarepos = CPos.New(DemitriLZ.Location.X, DemitriLZ.Location.Y - 1) local flarepos = CPos.New(DemitriLZ.Location.X, DemitriLZ.Location.Y - 1)
local demitriLZFlare = Actor.Create("flare", true, { Owner = player, Location = flarepos }) local demitriLZFlare = Actor.Create("flare", true, { Owner = player, Location = flarepos })
Trigger.AfterDelay(Utils.Seconds(3), function() Media.PlaySpeechNotification(player, "SignalFlareNorth") end) Trigger.AfterDelay(DateTime.Seconds(3), function() Media.PlaySpeechNotification(player, "SignalFlareNorth") end)
local demitriChinook = Reinforcements.ReinforceWithTransport(player, ExtractionHeli, nil, { ExtractionWaypoint, ExtractionLZ })[1] local demitriChinook = Reinforcements.ReinforceWithTransport(player, ExtractionHeli, nil, { ExtractionWaypoint, ExtractionLZ })[1]
@@ -196,8 +196,8 @@ CreateDemitri = function()
Trigger.OnRemovedFromWorld(demitriChinook, function() Trigger.OnRemovedFromWorld(demitriChinook, function()
if not demitriChinook.IsDead then if not demitriChinook.IsDead then
Media.PlaySpeechNotification(player, "TargetRescued") Media.PlaySpeechNotification(player, "TargetRescued")
Trigger.AfterDelay(Utils.Seconds(1), function() player.MarkCompletedObjective(EvacuateDemitri) end) Trigger.AfterDelay(DateTime.Seconds(1), function() player.MarkCompletedObjective(EvacuateDemitri) end)
Trigger.AfterDelay(Utils.Seconds(3), SpawnAndMoveAlliedBaseUnits) Trigger.AfterDelay(DateTime.Seconds(3), SpawnAndMoveAlliedBaseUnits)
end end
end) end)
Trigger.OnRemovedFromWorld(demitri, function() Trigger.OnRemovedFromWorld(demitri, function()
@@ -280,7 +280,7 @@ end
InitTriggers = function() InitTriggers = function()
Trigger.OnAllKilled(SuperTanks, function() Trigger.OnAllKilled(SuperTanks, function()
Trigger.AfterDelay(Utils.Seconds(3), function() player.MarkCompletedObjective(EliminateSuperTanks) end) Trigger.AfterDelay(DateTime.Seconds(3), function() player.MarkCompletedObjective(EliminateSuperTanks) end)
end) end)
Trigger.OnKilled(SuperTankDome, function() Trigger.OnKilled(SuperTankDome, function()