Add Allies05b

This commit is contained in:
Smittytron
2021-01-31 19:55:58 -06:00
committed by reaperrr
parent 887a093f46
commit 8deba81214
9 changed files with 1931 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
--[[
Copyright 2007-2021 The OpenRA Developers (see AUTHORS)
This file is part of OpenRA, which is free software. It is made
available to you under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version. For more
information, see COPYING.
]]
AttackGroup = { }
AttackGroupSize = 10
SovietInfantry = { "e1", "e1", "e2", "e4" }
SovietVehicles = { "3tnk", "3tnk", "3tnk", "v2rl", "v2rl", "apc" }
SovietAircraftType = { "yak" }
Planes = { }
SovietProduction = { Conyard, USSRBarracks, USSRWarFactory }
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
ProductionInterval =
{
easy = DateTime.Seconds(25),
normal = DateTime.Seconds(15),
hard = DateTime.Seconds(5)
}
SendAttackGroup = function()
if #AttackGroup < AttackGroupSize then
return
end
Utils.Do(AttackGroup, function(unit)
if not unit.IsDead then
Trigger.OnIdle(unit, unit.Hunt)
end
end)
AttackGroup = { }
end
ProduceUSSRInfantry = function()
if USSRBarracks.IsDead or USSRBarracks.Owner ~= USSR then
return
end
USSR.Build({ Utils.Random(SovietInfantry) }, function(units)
table.insert(AttackGroup, units[1])
SendAttackGroup()
Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceUSSRInfantry)
end)
end
ProduceUSSRVehicles = function()
if USSRWarFactory.IsDead or USSRWarFactory.Owner ~= USSR then
return
end
USSR.Build({ Utils.Random(SovietVehicles) }, function(units)
table.insert(AttackGroup, units[1])
SendAttackGroup()
Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceUSSRVehicles)
end)
end
ProduceAircraft = function()
if (Airfield1.IsDead or Airfield1.Owner ~= USSR) and (Airfield2.IsDead or Airfield2.Owner ~= USSR) then
return
end
USSR.Build(SovietAircraftType, function(units)
local plane = units[1]
Planes[#Planes + 1] = plane
Trigger.OnKilled(plane, ProduceAircraft)
local alive = Utils.Where(Planes, function(y) return not y.IsDead end)
if #alive < 2 then
Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft)
end
InitializeAttackAircraft(plane, Greece)
end)
end
ActivateAI = function()
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
building.StartBuildingRepairs()
end
end)
end)
ProduceUSSRInfantry()
Trigger.AfterDelay(DateTime.Minutes(1), ProduceUSSRVehicles)
Trigger.AfterDelay(DateTime.Minutes(2), ProduceAircraft)
Trigger.OnAllKilled(SovietProduction, function()
Utils.Do(USSR.GetGroundAttackers(), IdleHunt)
end)
end

View File

@@ -0,0 +1,433 @@
--[[
Copyright 2007-2021 The OpenRA Developers (see AUTHORS)
This file is part of OpenRA, which is free software. It is made
available to you under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version. For more
information, see COPYING.
]]
SpyType = { "spy" }
SpyEntryPath = { SpyEntry.Location, SpyLoadout.Location }
InsertionTransport = "lst.in"
TrukPath1 = { SpyCamera1, TrukWaypoint1, TrukWaypoint2, TrukWaypoint3, TrukWaypoint4 }
TrukPath2 = { TruckWaypoint5, TruckCrash }
ExtractionHeliType = "tran"
ExtractionPath = { ExtractionEntry.Location, ExtractionLZ.Location }
GreeceReinforcements =
{
{ types = { "e3", "e3", "e1", "e1", "e1" }, entry = { SpyEntry.Location, SpyLoadout.Location } },
{ types = { "jeep", "1tnk", "1tnk", "2tnk", "2tnk" }, entry = { GreeceEntry1.Location, GreeceLoadout1.Location } },
{ types = { "e6", "e6", "e6", "e6", "e6" }, entry = { GreeceEntry2.Location, GreeceLoadout2.Location } }
}
FlameTowerDogs = { FlameTowerDog1, FlameTowerDog2 }
PatrolA = { PatrolA1, PatrolA2, PatrolA3 }
PatrolB = { PatrolB1, PatrolB2, PatrolB3 }
PatrolC = { PatrolC1, PatrolC2, PatrolC3 }
PatrolAPath = { APatrol1.Location, CPatrol1.Location, APatrol2.Location }
PatrolBPath = { BPatrol1.Location, BPatrol2.Location, SpyCamera2.Location }
PatrolCPath = { CPatrol1.Location, CPatrol2.Location, CPatrol3.Location }
CheckpointDogs = { CheckpointDog1, CheckpointDog2 }
CheckpointRifles = { CheckpointRifle1, CheckpointRifle2 }
BridgePatrol = { CheckpointDog1, CheckpointDog2, CheckpointRifle1, CheckpointRifle2 }
BridgePatrolPath = { TrukWaypoint4.Location, BridgePatrolWay.Location }
TanyaVoices = { "tuffguy", "bombit", "laugh", "gotit", "lefty", "keepem" }
SpyVoice = "sking"
CivVoice = "guyokay"
DogBark = "dogy"
SamSites = { Sam1, Sam2, Sam3, Sam4 }
SendSpy = function()
Camera.Position = SpyEntry.CenterPosition
Spy = Reinforcements.ReinforceWithTransport(Greece, InsertionTransport, SpyType, SpyEntryPath, { SpyEntryPath[1] })[2][1]
Trigger.OnKilled(Spy, function() USSR.MarkCompletedObjective(USSRObj) end)
Trigger.AfterDelay(DateTime.Seconds(3), function()
Media.DisplayMessage("Commander! You have to disguise me in order to get through the enemy patrols.", "Spy")
if SpecialCameras then
SpyCameraA = Actor.Create("camera", true, { Owner = Greece, Location = SpyCamera1.Location })
SpyCameraB = Actor.Create("camera", true, { Owner = Greece, Location = SpyCamera2.Location })
SpyCameraC = Actor.Create("camera", true, { Owner = Greece, Location = BPatrol2.Location })
else
SpyCameraHard = Actor.Create("camera.small", true, { Owner = Greece, Location = FlameTowerDogRally.Location + CVec.New(2, 0) })
end
end)
end
ChurchFootprint = function()
Trigger.OnEnteredProximityTrigger(ChurchSpawn.CenterPosition, WDist.FromCells(2), function(actor, id)
if actor.Type == "spy" and not Greece.IsObjectiveCompleted(MainObj) then
Trigger.RemoveProximityTrigger(id)
ChurchSequence()
end
end)
end
ChurchSequence = function()
Media.PlaySoundNotification(Greece, CivVoice)
Hero = Actor.Create("c1", true, { Owner = GoodGuy, Location = ChurchSpawn.Location })
Hero.Attack(TargetBarrel)
Trigger.OnKilled(ResponseBarrel, function()
if not Hero.IsDead then
Hero.Stop()
Hero.Move(SouthVillage.Location)
BarrelsTower.Kill()
Utils.Do(FlameTowerDogs, function(dogs)
if not dogs.IsDead then
dogs.Stop()
dogs.AttackMove(SouthVillage.Location)
end
end)
Utils.Do(PatrolA, function(patrol1)
if not patrol1.IsDead then
patrol1.Stop()
patrol1.AttackMove(SouthVillage.Location)
end
end)
Utils.Do(PatrolB, function(patrol2)
if not patrol2.IsDead then
patrol2.Stop()
patrol2.AttackMove(SouthVillage.Location)
end
end)
end
end)
end
ActivatePatrols = function()
Utils.Do(FlameTowerDogs, function(dogs)
dogs.AttackMove(FlameTowerDogRally.Location)
end)
Trigger.AfterDelay(DateTime.Seconds(3), function()
GroupPatrol(PatrolA, PatrolAPath, DateTime.Seconds(7))
GroupPatrol(PatrolB, PatrolBPath, DateTime.Seconds(6))
GroupPatrol(PatrolC, PatrolCPath, DateTime.Seconds(6))
end)
end
GroupPatrol = function(units, waypoints, delay)
local i = 1
local stop = false
Utils.Do(units, function(unit)
Trigger.OnIdle(unit, function()
if stop then
return
end
if unit.Location == waypoints[i] then
local bool = Utils.All(units, function(actor) return actor.IsIdle end)
if bool then
stop = true
i = i + 1
if i > #waypoints then
i = 1
end
Trigger.AfterDelay(delay, function() stop = false end)
end
else
unit.AttackMove(waypoints[i])
end
end)
end)
end
WarfactoryInfiltrated = function()
FollowTruk = true
Truk.GrantCondition("hijacked")
Truk.Wait(DateTime.Seconds(1))
Utils.Do(TrukPath1, function(waypoint)
Truk.Move(waypoint.Location)
end)
Trigger.AfterDelay(DateTime.Seconds(2), function()
if SpecialCameras then
SpyCameraA.Destroy()
SpyCameraB.Destroy()
SpyCameraC.Destroy()
else
SpyCameraHard.Destroy()
end
end)
Trigger.OnEnteredProximityTrigger(TrukWaypoint4.CenterPosition, WDist.FromCells(1), function(actor, id)
if actor.Type == "truk.mission" then
Trigger.RemoveProximityTrigger(id)
Utils.Do(CheckpointDogs, function(dog)
dog.Move(TrukInspect.Location)
end)
end
end)
Trigger.OnEnteredProximityTrigger(TrukWaypoint4.CenterPosition, WDist.FromCells(1), function(actor, id)
if actor.Type == "dog" then
Trigger.RemoveProximityTrigger(id)
Media.PlaySoundNotification(Greece, DogBark)
Utils.Do(CheckpointRifles, function(guard)
guard.Move(TrukInspect.Location)
end)
Trigger.AfterDelay(DateTime.Seconds(2), function()
Utils.Do(TrukPath2, function(waypoint)
Truk.Move(waypoint.Location)
end)
end)
end
end)
Trigger.OnEnteredFootprint({ SpyJumpOut.Location }, function(a, id)
if a == Truk then
Trigger.RemoveFootprintTrigger(id)
Spy = Actor.Create("spy", true, { Owner = Greece, Location = SpyJumpOut.Location })
Spy.DisguiseAsType("e1", USSR)
Spy.Move(TruckWaypoint5.Location)
Spy.Infiltrate(Prison)
Media.PlaySoundNotification(Greece, SpyVoice)
FollowTruk = false
if SpecialCameras then
PrisonCamera = Actor.Create("camera", true, { Owner = Greece, Location = SpyJumpOut.Location })
else
PrisonCamera = Actor.Create("camera.small", true, { Owner = Greece, Location = Prison.Location + CVec.New(1, 1) })
end
Trigger.OnKilled(Spy, function() USSR.MarkCompletedObjective(USSRObj) end)
end
end)
Trigger.OnEnteredFootprint({ TruckCrash.Location }, function(a, id)
if a == Truk then
Trigger.RemoveFootprintTrigger(id)
Truk.Stop()
Truk.Kill()
CrashTower.Kill()
CrashBarrel.Kill()
end
end)
end
MissInfiltrated = function()
for i = 0, 5, 1 do
local sound = Utils.Random(TanyaVoices)
Trigger.AfterDelay(DateTime.Seconds(i), function()
Media.PlaySoundNotification(Greece, sound)
end)
end
Prison.Attack(Prison)
Trigger.AfterDelay(DateTime.Seconds(6), FreeTanya)
end
FreeTanya = function()
Prison.Stop()
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))
GroupPatrol(BridgePatrol, BridgePatrolPath, DateTime.Seconds(7))
if TanyaType == "e7.noautotarget" then
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.DisplayMessage("According to the rules of engagement I need your explicit orders to fire, Commander!", "Tanya")
end)
end
local escapeResponse1 = Reinforcements.Reinforce(USSR, { "e1", "e2", "e2" }, { RaxSpawn.Location, TrukWaypoint4.Location })
Utils.Do(escapeResponse1, function(units)
IdleHunt(units)
end)
Trigger.AfterDelay(DateTime.Seconds(10), function()
local escapeResponse2 = Reinforcements.Reinforce(USSR, { "e1", "e2", "e2" }, { RaxSpawn.Location, TrukWaypoint4.Location })
Utils.Do(escapeResponse2, function(units)
IdleHunt(units)
end)
end)
KillSams = Greece.AddObjective("Destroy all four SAM sites that block\nthe extraction helicopter.")
Trigger.OnKilled(Tanya, function() USSR.MarkCompletedObjective(USSRObj) end)
if not SpecialCameras and PrisonCamera and PrisonCamera.IsInWorld then
PrisonCamera.Destroy()
end
end
SendReinforcements = function()
GreeceReinforcementsArrived = true
Camera.Position = SpyLoadout.CenterPosition
Greece.Cash = Greece.Cash + ReinforceCash
Utils.Do(GreeceReinforcements, function(reinforcements)
Reinforcements.ReinforceWithTransport(Greece, InsertionTransport, reinforcements.types, reinforcements.entry, { SpyEntry.Location })
end)
Media.PlaySpeechNotification(Greece, "AlliedReinforcementsArrived")
ActivateAI()
end
ExtractUnits = function(extractionUnit, pos, after)
if extractionUnit.IsDead or not extractionUnit.HasPassengers then
return
end
extractionUnit.Move(pos)
extractionUnit.Destroy()
Trigger.OnRemovedFromWorld(extractionUnit, after)
end
InitTriggers = function()
Trigger.OnInfiltrated(Warfactory, function()
if Greece.IsObjectiveCompleted(InfWarfactory) then
return
elseif Truk.IsDead then
if not Greece.IsObjectiveCompleted(MainObj) then
USSR.MarkCompletedObjective(USSRObj)
end
return
end
Trigger.ClearAll(Spy)
Greece.MarkCompletedObjective(InfWarfactory)
WarfactoryInfiltrated()
end)
Trigger.OnKilled(Truk, function()
if not Greece.IsObjectiveCompleted(InfWarfactory) then
Greece.MarkFailedObjective(InfWarfactory)
elseif FollowTruk then
USSR.MarkCompletedObjective(USSRObj)
end
end)
Trigger.OnInfiltrated(Prison, function()
if Greece.IsObjectiveCompleted(MainObj) then
return
end
if not Greece.IsObjectiveCompleted(InfWarfactory) then
Media.DisplayMessage("Good work! But next time skip the heroics!", "Battlefield Control")
Greece.MarkCompletedObjective(InfWarfactory)
end
if not PrisonCamera then
if SpecialCameras then
PrisonCamera = Actor.Create("camera", true, { Owner = Greece, Location = SpyJumpOut.Location })
else
PrisonCamera = Actor.Create("camera.small", true, { Owner = Greece, Location = Prison.Location + CVec.New(1, 1) })
end
end
if SpecialCameras and SpyCameraA and not SpyCameraA.IsDead then
SpyCameraA.Destroy()
SpyCameraB.Destroy()
SpyCameraC.Destroy()
end
Trigger.ClearAll(Spy)
Trigger.AfterDelay(DateTime.Seconds(2), MissInfiltrated)
end)
Trigger.OnAllKilled(SamSites, function()
Greece.MarkCompletedObjective(KillSams)
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")
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.OnRemovedFromWorld(Tanya, function()
ExtractUnits(ExtractionHeli, exitPos, function()
Media.PlaySpeechNotification(Greece, "TanyaRescued")
Greece.MarkCompletedObjective(MainObj)
Trigger.AfterDelay(DateTime.Seconds(2), function()
SendReinforcements()
end)
if PrisonCamera and PrisonCamera.IsInWorld then
PrisonCamera.Destroy()
end
end)
end)
end)
end
Tick = function()
if FollowTruk and not Truk.IsDead then
Camera.Position = Truk.CenterPosition
end
if USSR.HasNoRequiredUnits() then
Greece.MarkCompletedObjective(KillAll)
end
if GreeceReinforcementsArrived and Greece.HasNoRequiredUnits() then
USSR.MarkCompletedObjective(USSRObj)
end
end
WorldLoaded = function()
Greece = Player.GetPlayer("Greece")
USSR = Player.GetPlayer("USSR")
GoodGuy = Player.GetPlayer("GoodGuy")
Trigger.OnObjectiveAdded(Greece, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
USSRObj = USSR.AddObjective("Deny the Allies.")
MainObj = Greece.AddObjective("Rescue Tanya.")
KillAll = Greece.AddObjective("Eliminate all Soviet units in this area.")
InfWarfactory = Greece.AddObjective("Infiltrate the Soviet warfactory.", "Secondary", false)
Trigger.OnObjectiveCompleted(Greece, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(Greece, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(Greece, function()
Media.PlaySpeechNotification(Greece, "Lose")
end)
Trigger.OnPlayerWon(Greece, function()
Media.PlaySpeechNotification(Greece, "Win")
end)
InitTriggers()
SendSpy()
ChurchFootprint()
if Map.LobbyOption("difficulty") == "easy" then
TanyaType = "e7"
ReinforceCash = 5000
USSR.Cash = 8000
SpecialCameras = true
elseif Map.LobbyOption("difficulty") == "normal" then
TanyaType = "e7.noautotarget"
ReinforceCash = 2250
USSR.Cash = 15000
SpecialCameras = true
else
TanyaType = "e7.noautotarget"
ReinforceCash = 1500
USSR.Cash = 25000
end
Trigger.AfterDelay(DateTime.Seconds(3), ActivatePatrols)
end

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
Sounds:
Notifications:
bombit: bombit1
laugh: laugh1
gotit: gotit1
lefty: lefty1
keepem: keepem1
tuffguy: tuffguy1
sking: sking1
guyokay: guyokay1
dogy: dogy1

View File

@@ -0,0 +1,175 @@
World:
LuaScript:
Scripts: allies05b.lua, allies05b-AI.lua, campaign-global.lua
MissionData:
BriefingVideo: ally5.vqa
WinVideo: tanya2.vqa
LossVideo: grvestne.vqa
StartVideo: tanya1.vqa
Briefing: Rescue Tanya.\n\nOnce disguised, your spy can move past any enemy unit, except dogs, without being detected. Direct him into the weapons factory located at a nearby Soviet Base where he will hijack a truck and free Tanya.\n\nWith Tanya's help, take out the air defenses on the island and a Chinook will arrive to rescue her.\n\nThen destroy all remaining Soviet buildings and units.
ScriptLobbyDropdown@difficulty:
ID: difficulty
Label: Difficulty
Values:
easy: Easy
normal: Normal
hard: Hard
Default: easy
Camera.Small:
Inherits: CAMERA
RevealsShroud:
Range: 4c0
TSLA:
Buildable:
Prerequisites: ~disabled
SAM:
Buildable:
Prerequisites: ~disabled
LST.IN:
Inherits: LST
RejectsOrders:
-Buildable:
-Selectable:
RenderSprites:
Image: lst
Interactable:
TRAN:
-Selectable:
RevealsShroud:
Range: 4c0
Targetable@GROUND:
TargetTypes: GroundActor
Interactable:
TRAN.IN:
Inherits: TRAN
RenderSprites:
Image: TRAN
Cargo:
Types: disabled
TRUK.mission:
Inherits: TRUK
Buildable:
Prerequisites: ~disabled
WithFacingSpriteBody:
-SpawnActorOnDeath:
RevealsShroud:
Range: 4c0
ValidRelationships: Ally, Enemy
RequiresCondition: hijacked
ExternalCondition@hijacked:
Condition: hijacked
RenderSprites:
Image: TRUK
TRUK:
Buildable:
Prerequisites: ~disabled
SPY:
Infiltrates:
Types: Mission Objectives
WEAP:
-InfiltrateForSupportPower:
Targetable:
TargetTypes: GroundActor, C4, DetonateAttack, Structure
WEAP.infiltratable:
Inherits: WEAP
Buildable:
Prerequisites: ~disabled
Targetable@Spy:
TargetTypes: GroundActor, C4, DetonateAttack, Structure, Mission Objectives
RenderSprites:
Image: WEAP
ProvidesPrerequisite:
Prerequisite: weap
MISS:
Tooltip:
Name: Prison
Targetable:
TargetTypes: GroundActor, C4, DetonateAttack, Structure, Mission Objectives
AttackOmni:
Armament:
Weapon: PrisonColt
AFLD:
AirstrikePower@spyplane:
Prerequisites: ~disabled
ParatroopersPower@paratroopers:
Prerequisites: ~disabled
FCOM:
MustBeDestroyed:
4TNK:
Buildable:
Prerequisites: ~disabled
MCV:
Buildable:
Prerequisites: ~disabled
MNLY:
Buildable:
Prerequisites: ~disabled
TTNK:
Buildable:
Prerequisites: ~disabled
FTRK:
Buildable:
Prerequisites: ~disabled
DTRK:
Buildable:
Prerequisites: ~disabled
QTNK:
Buildable:
Prerequisites: ~disabled
MSLO:
Buildable:
Prerequisites: ~disabled
MSUB:
Buildable:
Prerequisites: ~disabled
SS:
Buildable:
Prerequisites: ~disabled
IRON:
Buildable:
Prerequisites: ~disabled
STEK:
Buildable:
Prerequisites: ~disabled
E6:
Buildable:
Prerequisites: ~disabled
THF:
Buildable:
Prerequisites: ~disabled
SHOK:
Buildable:
Prerequisites: ~disabled
MIG:
Buildable:
Prerequisites: ~disabled

View File

@@ -0,0 +1,13 @@
PrisonColt:
ValidTargets: Ground, GroundActor
ReloadDelay: 7
Report: gun5.aud
Projectile: InstantHit
Warhead@1Dam: SpreadDamage
AffectsParent: true
ValidTargets: Ground, GroundActor
Pistol:
Range: 5c0
Warhead@1Dam: SpreadDamage
Damage: 1000

View File

@@ -5,6 +5,7 @@ Allied Campaign:
allies-03b allies-03b
allies-04 allies-04
allies-05a allies-05a
allies-05b
allies-06a allies-06a
allies-06b allies-06b
allies-07 allies-07