Polish and standardize Allies01

This commit is contained in:
Smittytron
2021-07-16 14:29:00 -05:00
committed by reaperrr
parent 0ea6a5626f
commit 8a4945d20a
3 changed files with 88 additions and 70 deletions

View File

@@ -15,9 +15,12 @@ TanyaReinforcements = { "e7.noautotarget" }
EinsteinType = "einstein"
FlareType = "flare"
CruisersReinforcements = { "ca", "ca", "ca", "ca" }
OpeningAttack = { Patrol1, Patrol2, Patrol3, Patrol4 }
Responders = { Response1, Response2, Response3, Response4, Response5 }
LabGuardsTeam = { LabGuard1, LabGuard2, LabGuard3 }
SendInsertionHelicopter = function()
local passengers = Reinforcements.ReinforceWithTransport(player, InsertionHelicopterType,
local passengers = Reinforcements.ReinforceWithTransport(Greece, InsertionHelicopterType,
TanyaReinforcements, InsertionPath, { InsertionEntry.Location })[2]
local tanya = passengers[1]
Trigger.OnKilled(tanya, TanyaKilledInAction)
@@ -27,41 +30,54 @@ SendInsertionHelicopter = function()
end
SendJeeps = function()
Reinforcements.Reinforce(player, JeepReinforcements, InsertionPath, DateTime.Seconds(2))
Media.PlaySpeechNotification(player, "ReinforcementsArrived")
Reinforcements.Reinforce(Greece, JeepReinforcements, InsertionPath, DateTime.Seconds(2))
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
end
RunInitialActivities = function()
SendInsertionHelicopter()
Patrol1.Hunt()
Patrol2.Hunt()
Patrol3.Hunt()
Patrol4.Hunt()
Civilian1.Wait(DateTime.Seconds(6))
Civilian2.Wait(DateTime.Seconds(6))
Civilian1.Hunt()
Civilian2.Hunt()
Utils.Do(OpeningAttack, function(a)
IdleHunt(a)
end)
Trigger.OnKilled(Patrol3, function()
if not Civilian1.IsDead then
Civilian1.Move(CivMove.Location)
end
end)
Trigger.OnKilled(BarrelPower, function()
if not Civilian2.IsDead then
Civilian2.Move(CivMove.Location)
end
Utils.Do(Responders, function(r)
if not r.IsDead then
IdleHunt(r)
end
end)
end)
end
LabGuardsKilled = function()
CreateEinstein()
Trigger.AfterDelay(DateTime.Seconds(2), function()
Actor.Create(FlareType, true, { Owner = england, Location = ExtractionFlarePoint.Location })
Media.PlaySpeechNotification(player, "SignalFlareNorth")
Actor.Create(FlareType, true, { Owner = England, Location = ExtractionFlarePoint.Location })
Media.PlaySpeechNotification(Greece, "SignalFlareNorth")
SendExtractionHelicopter()
end)
Trigger.AfterDelay(DateTime.Seconds(10), function()
Media.PlaySpeechNotification(player, "AlliedReinforcementsArrived")
Actor.Create("camera", true, { Owner = player, Location = CruiserCameraPoint.Location })
Media.PlaySpeechNotification(Greece, "AlliedReinforcementsArrived")
Actor.Create("camera", true, { Owner = Greece, Location = CruiserCameraPoint.Location })
SendCruisers()
end)
Trigger.AfterDelay(DateTime.Seconds(12), function()
for i = 0, 2 do
Trigger.AfterDelay(DateTime.Seconds(i), function()
Media.PlaySoundNotification(player, "AlertBuzzer")
Media.PlaySoundNotification(Greece, "AlertBuzzer")
end)
end
Utils.Do(sovietArmy, function(a)
@@ -73,7 +89,7 @@ LabGuardsKilled = function()
end
SendExtractionHelicopter = function()
heli = Reinforcements.ReinforceWithTransport(player, ExtractionHelicopterType, nil, ExtractionPath)[1]
heli = Reinforcements.ReinforceWithTransport(Greece, ExtractionHelicopterType, nil, ExtractionPath)[1]
if not einstein.IsDead then
Trigger.OnRemovedFromWorld(einstein, EvacuateHelicopter)
end
@@ -91,7 +107,7 @@ end
SendCruisers = function()
local i = 1
Utils.Do(CruisersReinforcements, function(cruiser)
local ca = Actor.Create(cruiser, true, { Owner = england, Location = SouthReinforcementsPoint.Location + CVec.New(2 * i, 0) })
local ca = Actor.Create(cruiser, true, { Owner = England, Location = SouthReinforcementsPoint.Location + CVec.New(2 * i, 0) })
ca.Move(Map.NamedActor("CruiserPoint" .. i).Location)
i = i + 1
end)
@@ -104,13 +120,13 @@ LabDestroyed = function()
end
RescueFailed = function()
Media.PlaySpeechNotification(player, "ObjectiveNotMet")
player.MarkFailedObjective(EinsteinSurviveObjective)
Media.PlaySpeechNotification(Greece, "ObjectiveNotMet")
Greece.MarkFailedObjective(EinsteinSurviveObjective)
end
TanyaKilledInAction = function()
Media.PlaySpeechNotification(player, "ObjectiveNotMet")
player.MarkFailedObjective(TanyaSurviveObjective)
Media.PlaySpeechNotification(Greece, "ObjectiveNotMet")
Greece.MarkFailedObjective(TanyaSurviveObjective)
end
OilPumpDestroyed = function()
@@ -118,8 +134,8 @@ OilPumpDestroyed = function()
end
CiviliansKilled = function()
player.MarkFailedObjective(CivilProtectionObjective)
Media.PlaySpeechNotification(player, "ObjectiveNotMet")
Greece.MarkFailedObjective(CivilProtectionObjective)
Media.PlaySpeechNotification(Greece, "ObjectiveNotMet")
collateralDamage = true
end
@@ -130,83 +146,82 @@ LostMate = function()
end
CreateEinstein = function()
player.MarkCompletedObjective(FindEinsteinObjective)
Media.PlaySpeechNotification(player, "ObjectiveMet")
einstein = Actor.Create(EinsteinType, true, { Location = EinsteinSpawnPoint.Location, Owner = player })
Greece.MarkCompletedObjective(FindEinsteinObjective)
Media.PlaySpeechNotification(Greece, "ObjectiveMet")
einstein = Actor.Create(EinsteinType, true, { Location = EinsteinSpawnPoint.Location, Owner = Greece })
einstein.Scatter()
Trigger.OnKilled(einstein, RescueFailed)
ExtractObjective = player.AddObjective("Wait for the helicopter and extract Einstein.")
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(player, "TargetFreed") end)
ExtractObjective = Greece.AddObjective("Wait for the helicopter and extract Einstein.")
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(Greece, "TargetFreed") end)
end
HelicopterGone = function()
if not heli.IsDead then
Media.PlaySpeechNotification(player, "TargetRescued")
Media.PlaySpeechNotification(Greece, "TargetRescued")
Trigger.AfterDelay(DateTime.Seconds(1), function()
player.MarkCompletedObjective(ExtractObjective)
player.MarkCompletedObjective(EinsteinSurviveObjective)
if not player.IsObjectiveFailed(TanyaSurviveObjective) then
player.MarkCompletedObjective(TanyaSurviveObjective)
Greece.MarkCompletedObjective(ExtractObjective)
Greece.MarkCompletedObjective(EinsteinSurviveObjective)
if not Greece.IsObjectiveFailed(TanyaSurviveObjective) then
Greece.MarkCompletedObjective(TanyaSurviveObjective)
end
if not collateralDamage then
player.MarkCompletedObjective(CivilProtectionObjective)
Greece.MarkCompletedObjective(CivilProtectionObjective)
end
end)
end
end
MissionAccomplished = function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
Media.PlaySpeechNotification(Greece, "MissionAccomplished")
end
MissionFailed = function()
Media.PlaySpeechNotification(player, "MissionFailed")
Media.PlaySpeechNotification(Greece, "MissionFailed")
end
SetUnitStances = function()
Utils.Do(Map.NamedActors, function(a)
if a.Owner == player then
if a.Owner == Greece then
a.Stance = "Defend"
end
end)
end
Tick = function()
ussr.Resources = ussr.Resources - (0.01 * ussr.ResourceCapacity / 25)
USSR.Resources = USSR.Resources - (0.01 * USSR.ResourceCapacity / 25)
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")
Trigger.OnObjectiveAdded(player, function(p, id)
Trigger.OnObjectiveAdded(Greece, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Trigger.OnObjectiveCompleted(Greece, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Trigger.OnObjectiveFailed(Greece, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(player, MissionFailed)
Trigger.OnPlayerWon(player, MissionAccomplished)
Trigger.OnPlayerLost(Greece, MissionFailed)
Trigger.OnPlayerWon(Greece, MissionAccomplished)
FindEinsteinObjective = player.AddObjective("Find Einstein.")
TanyaSurviveObjective = player.AddObjective("Tanya must survive.")
EinsteinSurviveObjective = player.AddObjective("Einstein must survive.")
CivilProtectionObjective = player.AddObjective("Protect all civilians.", "Secondary", false)
FindEinsteinObjective = Greece.AddObjective("Find Einstein.")
TanyaSurviveObjective = Greece.AddObjective("Tanya must survive.")
EinsteinSurviveObjective = Greece.AddObjective("Einstein must survive.")
CivilProtectionObjective = Greece.AddObjective("Protect all civilians.", "Secondary", false)
RunInitialActivities()
Trigger.OnKilled(Lab, LabDestroyed)
Trigger.OnKilled(OilPump, OilPumpDestroyed)
sovietArmy = ussr.GetGroundAttackers()
sovietArmy = USSR.GetGroundAttackers()
labGuardsTeam = { LabGuard1, LabGuard2, LabGuard3 }
Trigger.OnAllKilled(labGuardsTeam, LabGuardsKilled)
Trigger.OnAllKilled(LabGuardsTeam, LabGuardsKilled)
collateralDamage = false
civilianTeam = { Civilian1, Civilian2 }
@@ -215,7 +230,7 @@ WorldLoaded = function()
SetUnitStances()
Trigger.AfterDelay(DateTime.Seconds(5), function() Actor.Create("camera", true, { Owner = player, Location = BaseCameraPoint.Location }) end)
Trigger.AfterDelay(DateTime.Seconds(5), function() Actor.Create("camera", true, { Owner = Greece, Location = BaseCameraPoint.Location }) end)
Camera.Position = InsertionLZ.CenterPosition
end

Binary file not shown.

View File

@@ -21,10 +21,10 @@ LockPreview: True
Players:
PlayerReference@USSR:
Name: USSR
Bot: campaign
Faction: soviet
Color: FE1100
Enemies: Greece, England
Bot: campaign
PlayerReference@Neutral:
Name: Neutral
OwnsWorld: True
@@ -32,8 +32,8 @@ Players:
Faction: allies
PlayerReference@Greece:
Name: Greece
Playable: True
AllowBots: False
Playable: True
Required: True
LockFaction: True
Faction: allies
@@ -45,11 +45,11 @@ Players:
Enemies: USSR
PlayerReference@England:
Name: England
Bot: campaign
Faction: allies
Color: A1EF8C
Allies: Greece
Enemies: USSR
Bot: campaign
Actors:
Actor0: t16
@@ -127,7 +127,7 @@ Actors:
Actor24: powr
Location: 67,57
Owner: USSR
Actor25: powr
BarrelPower: powr
Location: 61,57
Owner: USSR
Actor27: fact
@@ -203,31 +203,31 @@ Actors:
Location: 73,66
Owner: USSR
SubCell: 1
Actor56: e1
Response3: e1
Location: 62,67
Owner: USSR
Facing: 512
SubCell: 4
Actor57: e1
Facing: 512
Response5: e1
Location: 67,67
Owner: USSR
Facing: 640
SubCell: 3
Actor58: e1
Facing: 640
Response4: e1
Location: 65,67
Owner: USSR
Facing: 640
SubCell: 3
Actor59: e1
Facing: 640
Response1: e1
Location: 56,60
Owner: USSR
Facing: 384
SubCell: 1
Actor63: e1
Facing: 384
Response2: e1
Location: 58,60
Owner: USSR
Facing: 256
SubCell: 1
Facing: 256
Actor64: e1
Location: 64,49
Owner: Greece
@@ -403,7 +403,7 @@ Actors:
Owner: England
SubCell: 3
EinsteinSpawnPoint: waypoint
Location: 62,61
Location: 62,60
Owner: Neutral
InsertionEntry: waypoint
Location: 63,45
@@ -441,6 +441,9 @@ Actors:
CruiserPoint3: waypoint
Location: 68,76
Owner: Neutral
CivMove: waypoint
Location: 69,56
Owner: Neutral
Rules: ra|rules/campaign-rules.yaml, ra|rules/campaign-tooltips.yaml, ra|rules/campaign-palettes.yaml, rules.yaml