Update Soviet-08a
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
the License, or (at your option) any later version. For more
|
||||
information, see COPYING.
|
||||
]]
|
||||
alliedScouts = { Actor189, Actor216, Actor217, Actor218, Actor219 }
|
||||
AlliedScouts = { Actor189, Actor216, Actor217, Actor218, Actor219 }
|
||||
|
||||
ussrReinforcements =
|
||||
SovReinforcements =
|
||||
{
|
||||
east =
|
||||
{
|
||||
@@ -30,66 +30,58 @@ ussrReinforcements =
|
||||
}
|
||||
}
|
||||
|
||||
Obj2ActorTriggerActivator = { Church, Actor147, Actor148, Actor149, Actor150, Actor151, Actor152, Actor153 }
|
||||
Village = { Church, Actor147, Actor148, Actor149, Actor150, Actor151, Actor152, Actor153 }
|
||||
|
||||
ActivateAIDelay = DateTime.Seconds(45)
|
||||
|
||||
AddEastReinforcementTrigger = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(30), function()
|
||||
Media.PlaySpeechNotification(ussr, "ReinforcementsArrived")
|
||||
local reinforcement = ussrReinforcements.east
|
||||
Reinforcements.ReinforceWithTransport(ussr, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
local reinforcement = SovReinforcements.east
|
||||
Reinforcements.ReinforceWithTransport(USSR, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
end)
|
||||
end
|
||||
|
||||
AddSouthReinforcementTrigger = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(60), function()
|
||||
Media.PlaySpeechNotification(ussr, "ReinforcementsArrived")
|
||||
local reinforcement = ussrReinforcements.south
|
||||
Reinforcements.ReinforceWithTransport(ussr, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
local reinforcement = SovReinforcements.south
|
||||
Reinforcements.ReinforceWithTransport(USSR, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
end)
|
||||
end
|
||||
|
||||
AddParadropReinforcementTrigger = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(90), function()
|
||||
Media.PlaySpeechNotification(ussr, "ReinforcementsArrived")
|
||||
scripteddrop.TargetParatroopers(ScriptedParadrop.CenterPosition, Angle.New(40))
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
ScriptedDrop.TargetParatroopers(ScriptedParadrop.CenterPosition, Angle.New(40))
|
||||
end)
|
||||
end
|
||||
|
||||
ChurchAmbushTrigger = function()
|
||||
if not AmbushSwitch then
|
||||
local hiding = Reinforcements.Reinforce(germany, { 'e1', 'e1', 'e1', 'e1', 'e1', 'e1', 'e1', 'e3', 'e3', 'e3' }, { ChurchAmbush.Location, AmbushMove.Location })
|
||||
Utils.Do(hiding, function(actor)
|
||||
IdleHunt(actor)
|
||||
end)
|
||||
local hiding = Reinforcements.Reinforce(Germany, { 'e1', 'e1', 'e1', 'e1', 'e1', 'e1', 'e1', 'e3', 'e3', 'e3' }, { ChurchAmbush.Location, AmbushMove.Location }, 0)
|
||||
Utils.Do(hiding, IdleHunt)
|
||||
end
|
||||
AmbushSwitch = true
|
||||
end
|
||||
|
||||
Trigger.OnKilled(Church, function()
|
||||
Actor.Create("moneycrate", true, { Owner = ussr, Location = ChurchAmbush.Location })
|
||||
Actor.Create("moneycrate", true, { Owner = USSR, Location = ChurchAmbush.Location })
|
||||
end)
|
||||
|
||||
Obj2TriggerFunction = function()
|
||||
ussr.MarkCompletedObjective(DestroyVillageObjective)
|
||||
Media.PlaySpeechNotification(ussr, "ReinforcementsArrived")
|
||||
local reinforcement = ussrReinforcements.mammoth
|
||||
Reinforcements.ReinforceWithTransport(ussr, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
end
|
||||
|
||||
AddReinforcmentTriggers = function()
|
||||
AddEastReinforcementTrigger()
|
||||
AddSouthReinforcementTrigger()
|
||||
AddParadropReinforcementTrigger()
|
||||
DestroyVillage = function()
|
||||
Media.PlaySpeechNotification(USSR, "ReinforcementsArrived")
|
||||
USSR.MarkCompletedObjective(DestroyVillageObjective)
|
||||
local reinforcement = SovReinforcements.mammoth
|
||||
Reinforcements.ReinforceWithTransport(USSR, "lst.reinforcement", reinforcement.actors, reinforcement.entryPath, reinforcement.exitPath)
|
||||
end
|
||||
|
||||
AddRetreatTrigger = function()
|
||||
Trigger.OnEnteredProximityTrigger(Actor222.CenterPosition, WDist.FromCells(12), function(actor, id)
|
||||
if actor.Owner == ussr and actor.Type == "barr" then
|
||||
alliedScouts = Utils.Where(alliedScouts, function(scout) return not scout.IsDead end)
|
||||
if actor.Owner == USSR and actor.Type == "barr" then
|
||||
AlliedScouts = Utils.Where(AlliedScouts, function(scout) return not scout.IsDead end)
|
||||
local removed
|
||||
Utils.Do(alliedScouts, function(scout)
|
||||
Utils.Do(AlliedScouts, function(scout)
|
||||
if scout.Type == "e1" and not removed then
|
||||
removed = true
|
||||
else
|
||||
@@ -102,61 +94,78 @@ AddRetreatTrigger = function()
|
||||
end)
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
greece.Cash = 1000
|
||||
BoatAttack = function(boat)
|
||||
if boat.IsDead then
|
||||
return
|
||||
else
|
||||
boat.AttackMove(BoatRally.Location)
|
||||
end
|
||||
end
|
||||
|
||||
if greece.HasNoRequiredUnits() and germany.HasNoRequiredUnits() then
|
||||
ussr.MarkCompletedObjective(KillAll)
|
||||
Tick = function()
|
||||
Greece.Cash = 1000
|
||||
|
||||
if Greece.HasNoRequiredUnits() and Germany.HasNoRequiredUnits() then
|
||||
USSR.MarkCompletedObjective(KillAll)
|
||||
end
|
||||
|
||||
if ussr.HasNoRequiredUnits() then
|
||||
greece.MarkCompletedObjective(BeatUSSR)
|
||||
if USSR.HasNoRequiredUnits() then
|
||||
Greece.MarkCompletedObjective(BeatUSSR)
|
||||
end
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
ussr = Player.GetPlayer("USSR")
|
||||
germany = Player.GetPlayer("Germany")
|
||||
greece = Player.GetPlayer("Greece")
|
||||
USSR = Player.GetPlayer("USSR")
|
||||
Germany = Player.GetPlayer("Germany")
|
||||
Greece = Player.GetPlayer("Greece")
|
||||
|
||||
Trigger.OnObjectiveAdded(ussr, function(p, id)
|
||||
Trigger.OnObjectiveAdded(USSR, function(p, id)
|
||||
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
|
||||
end)
|
||||
|
||||
KillAll = ussr.AddPrimaryObjective("Destroy all Allied units and structures.")
|
||||
DestroyVillageObjective = ussr.AddSecondaryObjective("Destroy the village of Allied sympathizers.")
|
||||
BeatUSSR = greece.AddPrimaryObjective("Defeat the Soviet forces.")
|
||||
KillAll = USSR.AddObjective("Destroy all Allied units and structures.")
|
||||
DestroyVillageObjective = USSR.AddObjective("Destroy the village of Allied sympathizers.", "Secondary", false)
|
||||
BeatUSSR = Greece.AddObjective("Defeat the Soviet forces.")
|
||||
|
||||
Trigger.OnObjectiveCompleted(ussr, function(p, id)
|
||||
Trigger.OnObjectiveCompleted(USSR, function(p, id)
|
||||
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
|
||||
end)
|
||||
Trigger.OnObjectiveFailed(ussr, function(p, id)
|
||||
Trigger.OnObjectiveFailed(USSR, function(p, id)
|
||||
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
|
||||
end)
|
||||
|
||||
Trigger.OnPlayerLost(ussr, function()
|
||||
Trigger.OnPlayerLost(USSR, function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Media.PlaySpeechNotification(ussr, "MissionFailed")
|
||||
Media.PlaySpeechNotification(USSR, "MissionFailed")
|
||||
end)
|
||||
end)
|
||||
Trigger.OnPlayerWon(ussr, function()
|
||||
Trigger.OnPlayerWon(USSR, function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(1), function()
|
||||
Media.PlaySpeechNotification(ussr, "MissionAccomplished")
|
||||
Media.PlaySpeechNotification(USSR, "MissionAccomplished")
|
||||
end)
|
||||
end)
|
||||
|
||||
AddReinforcmentTriggers()
|
||||
AddEastReinforcementTrigger()
|
||||
AddSouthReinforcementTrigger()
|
||||
AddParadropReinforcementTrigger()
|
||||
AddRetreatTrigger()
|
||||
|
||||
scripteddrop = Actor.Create("scripteddrop", false, { Owner = ussr })
|
||||
ScriptedDrop = Actor.Create("scripteddrop", false, { Owner = USSR })
|
||||
|
||||
OnAnyDamaged(Obj2ActorTriggerActivator, ChurchAmbushTrigger)
|
||||
OnAnyDamaged(Village, ChurchAmbushTrigger)
|
||||
|
||||
Trigger.OnAllRemovedFromWorld(Obj2ActorTriggerActivator, Obj2TriggerFunction)
|
||||
Trigger.OnAllRemovedFromWorld(Village, DestroyVillage)
|
||||
|
||||
Camera.Position = SovietBase.CenterPosition
|
||||
|
||||
Trigger.AfterDelay(ActivateAIDelay, ActivateAI)
|
||||
Trigger.AfterDelay(DateTime.Minutes(2), function() BoatAttack(Boat1) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(5), function() BoatAttack(Boat2) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(7), function() BoatAttack(Boat3) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(10), function() BoatAttack(Boat4) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(12), function() BoatAttack(Boat5) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(14), function() BoatAttack(Boat6) end)
|
||||
Trigger.AfterDelay(DateTime.Minutes(15), function() BoatAttack(Boat7) end)
|
||||
end
|
||||
|
||||
OnAnyDamaged = function(actors, func)
|
||||
|
||||
Reference in New Issue
Block a user