Add Counterstrike mission Fall of Greece 2: Evacuation

This commit is contained in:
Smittytron
2021-02-22 15:15:46 -06:00
committed by reaperrr
parent a27ef16911
commit d2039a14e1
7 changed files with 1562 additions and 0 deletions

View File

@@ -0,0 +1,130 @@
--[[
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 = { }
SovietInfantry = { "e1", "e2" }
SovietVehicles = { "3tnk", "3tnk", "v2rl" }
SovietAircraftType = { "yak" }
Yaks = { }
AttackPaths = { AttackRight, AttackLeft }
AttackGroupSizes =
{
easy = 8,
normal = 9,
hard = 10
}
ProductionInterval =
{
easy = DateTime.Seconds(20),
normal = DateTime.Seconds(10),
hard = DateTime.Seconds(5)
}
SendAttackGroup = function()
if #AttackGroup < AttackGroupSize then
return
end
local path = Utils.Random(AttackPaths)
Utils.Do(AttackGroup, function(unit)
if not unit.IsDead then
unit.AttackMove(path.Location)
Trigger.OnIdle(unit, unit.Hunt)
end
end)
AttackGroup = { }
end
ProduceInfantry = function()
if USSRRax.IsDead or USSRRax.Owner ~= USSR then
return
end
USSR.Build({ Utils.Random(SovietInfantry) }, function(units)
table.insert(AttackGroup, units[1])
SendAttackGroup()
Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceInfantry)
end)
end
ProduceVehicles = 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")], ProduceVehicles)
end)
end
ProduceAircraft = function()
if Airfield.IsDead or Airfield.Owner ~= USSR then
return
end
USSR.Build(SovietAircraftType, function(units)
local yak = units[1]
Yaks[#Yaks + 1] = yak
Trigger.OnKilled(yak, ProduceAircraft)
local alive = Utils.Where(Yaks, function(y) return not y.IsDead end)
if #alive < 2 then
Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft)
end
InitializeAttackAircraft(yak, Allies)
end)
end
ParadropDelays =
{
easy = { DateTime.Minutes(1), DateTime.Minutes(2) },
normal = { DateTime.Seconds(45), DateTime.Seconds(105) },
hard = { DateTime.Seconds(30), DateTime.Seconds(90) }
}
ParadropLZs = { ParaLZ1.CenterPosition, ParaLZ2.CenterPosition, ParaLZ3.CenterPosition, ParaLZ4.CenterPosition }
Paradrop = function()
if Airfield.IsDead or Airfield.Owner ~= USSR then
return
end
local aircraft = StandardDrop.TargetParatroopers(Utils.Random(ParadropLZs))
Utils.Do(aircraft, function(a)
Trigger.OnPassengerExited(a, function(t, p)
IdleHunt(p)
end)
end)
Trigger.AfterDelay(Utils.RandomInteger(ParadropDelay[1], ParadropDelay[2]), Paradrop)
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)
ParadropDelay = ParadropDelays[Difficulty]
AttackGroupSize = AttackGroupSizes[Difficulty]
Trigger.AfterDelay(DateTime.Seconds(30), ProduceInfantry)
Trigger.AfterDelay(DateTime.Minutes(3), ProduceVehicles)
Trigger.AfterDelay(DateTime.Minutes(4), Paradrop)
Trigger.AfterDelay(DateTime.Minutes(5), ProduceAircraft)
end

View File

@@ -0,0 +1,278 @@
--[[
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.
]]
Difficulty = Map.LobbyOption("difficulty")
AlliedReinforcementsA = { "jeep", "jeep" }
AlliedReinforcementsB = { "e1", "e1", "e1", "e3", "e3" }
AlliedReinforcementsC = { "jeep", "mcv" }
IslandPatrol = { SubPatrol1.Location, SubPatrol2.Location, SubPatrol3.Location, SubPatrol4.Location }
Submarines = { Sub1, Sub2, Sub3, Sub4, Sub5, Sub6, Sub7, Sub8 }
RifleSquad = { Rifle1, Rifle2, Rifle3 }
NWVillageTrigger = { CPos.New(31, 64), CPos.New(32, 64), CPos.New(34, 51), CPos.New(35, 51), CPos.New(36, 51) }
SWVillageTrigger = { CPos.New(44, 97), CPos.New(45, 97), CPos.New(46, 97), CPos.New(47, 97) }
MiddleVillageTrigger = { CPos.New(52, 70), CPos.New(53, 70), CPos.New(54, 70) }
EastVillageTrigger = { CPos.New(78, 61), CPos.New(79, 61), CPos.New(80, 61), CPos.New(81, 61), CPos.New(82, 61) }
CivilianTypes = { "c2", "c3", "c4", "c5", "c6", "c8", "c9", "c10", "c11" }
NWVillage = { NWChurch, NWHouse1, NWHouse2, NWHouse3 }
SWVillage = { SWChurch, SWHouse1, SWHouse2, SWHouse3, SWHouse4 }
MiddleVillage = { MiddleChurch, MiddleHouse1, MiddleHouse2, MiddleHouse3, MiddleHouse4 }
EastVillage = { EastChurch, EastHouse1, EastHouse2, EastHouse3 }
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
MissionStart = function()
Reinforcements.Reinforce(Allies, AlliedReinforcementsA, { AlliedSpawn.Location, AlliedBase.Location }, 5)
Trigger.AfterDelay(DateTime.Seconds(2), function()
AlliesArrived = true
Reinforcements.Reinforce(Allies, AlliedReinforcementsB, { AlliedSpawn.Location, AlliedBase.Location }, 2)
Utils.Do(RifleSquad, function(actor)
if not actor.IsDead then
actor.AttackMove(AlliedBase.Location)
actor.Hunt()
end
end)
end)
Sub1.Patrol(IslandPatrol, true, 1)
Trigger.AfterDelay(DateTime.Seconds(5), function()
Reinforcements.Reinforce(Allies, AlliedReinforcementsC, { AlliedSpawn.Location, AlliedBase.Location }, 5)
end)
Trigger.OnKilled(NWChurch, function()
if not NWChurchEmpty then
CiviliansKilled = CiviliansKilled + 5
end
end)
Trigger.OnKilled(EastChurch, function()
if not EastChurchEmpty then
CiviliansKilled = CiviliansKilled + 5
end
end)
Trigger.OnKilled(MiddleChurch, function()
if not MiddleChurchEmpty then
CiviliansKilled = CiviliansKilled + 5
end
end)
Trigger.OnKilled(SWChurch, function()
if not SWChurchEmpty then
CiviliansKilled = CiviliansKilled + 5
end
end)
Trigger.OnAllKilled(Submarines, function()
Allies.MarkCompletedObjective(ClearWaterway)
end)
end
VillageSetup = function()
local foot1Triggered
Trigger.OnEnteredFootprint(NWVillageTrigger, function(actor, id)
if actor.Owner == Allies and not foot1Triggered then
Trigger.RemoveFootprintTrigger(id)
foot1Triggered = true
Utils.Do(NWVillage, function(building)
building.Owner = Allies
end)
Civs1 = Reinforcements.Reinforce(Allies, Utils.Take(5, Utils.Shuffle(CivilianTypes)), { ChurchNorthwest.Location, VillageNorthwest.Location }, 0)
if not NWChurch.IsDead then
Utils.Do(Civs1, function(civ)
Trigger.OnKilled(civ, function()
CiviliansKilled = CiviliansKilled + 1
end)
end)
NWChurchEmpty = true
end
end
Trigger.AfterDelay(DateTime.Seconds(30), function()
local nwAttackers = Reinforcements.Reinforce(USSR, { "3tnk", "3tnk", "3tnk" }, { NWVillageAttack.Location, VillageNorthwest.Location }, 20)
Utils.Do(nwAttackers, IdleHunt)
end)
end)
local foot2Triggered
Trigger.OnEnteredFootprint(EastVillageTrigger, function(actor, id)
if actor.Owner == Allies and not foot2Triggered then
Trigger.RemoveFootprintTrigger(id)
foot2Triggered = true
Utils.Do(EastVillage, function(building)
building.Owner = Allies
end)
Civs2 = Reinforcements.Reinforce(Allies, Utils.Take(5, Utils.Shuffle(CivilianTypes)), { ChurchEast.Location, VillageEast.Location }, 0)
if not EastChurch.IsDead then
Utils.Do(Civs2, function(civ)
Trigger.OnKilled(civ, function()
CiviliansKilled = CiviliansKilled + 1
end)
end)
EastChurchEmpty = true
end
local villageDrop = FlamerDrop.TargetParatroopers(VillageEast.CenterPosition, Angle.North)
Utils.Do(villageDrop, function(a)
Trigger.OnPassengerExited(a, function(t, p)
IdleHunt(p)
end)
end)
end
end)
local foot3Triggered
Trigger.OnEnteredFootprint(MiddleVillageTrigger, function(actor, id)
if actor.Owner == Allies and not foot3Triggered then
Trigger.RemoveFootprintTrigger(id)
foot3Triggered = true
Utils.Do(MiddleVillage, function(building)
building.Owner = Allies
end)
Civs3 = Reinforcements.Reinforce(Allies, Utils.Take(5, Utils.Shuffle(CivilianTypes)), { ChurchMiddle.Location, VillageMiddle.Location }, 0)
if not MiddleChurch.IsDead then
Utils.Do(Civs3, function(civ)
Trigger.OnKilled(civ, function()
CiviliansKilled = CiviliansKilled + 1
end)
end)
MiddleChurchEmpty = true
end
local proxy = Actor.Create("powerproxy.parabombs", false, { Owner = USSR })
proxy.TargetAirstrike(ChurchMiddle.CenterPosition, Angle.NorthWest)
end
end)
local foot4Triggered
Trigger.OnEnteredFootprint(SWVillageTrigger, function(actor, id)
if actor.Owner == Allies and not foot4Triggered then
Trigger.RemoveFootprintTrigger(id)
foot4Triggered = true
Utils.Do(SWVillage, function(building)
building.Owner = Allies
end)
Civs4 = Reinforcements.Reinforce(Allies, Utils.Take(5, Utils.Shuffle(CivilianTypes)), { ChurchSouthwest.Location, VillageSouthwest.Location }, 0)
if not SWChurch.IsDead then
Utils.Do(Civs4, function(civ)
Trigger.OnKilled(civ, function()
CiviliansKilled = CiviliansKilled + 1
end)
end)
SWChurchEmpty = true
end
end
Trigger.AfterDelay(DateTime.Seconds(30), function()
local swAttackers = Reinforcements.Reinforce(USSR, { "3tnk", "3tnk", "3tnk", "ttnk", "e4", "e4", "e4" }, { SWVillageAttack.Location, VillageSouthwest.Location }, 20)
Utils.Do(swAttackers, IdleHunt)
end)
end)
end
CiviliansEvacuatedThreshold =
{
hard = 20,
normal = 15,
easy = 10
}
CiviliansKilledThreshold =
{
hard = 1,
normal = 6,
easy = 11
}
CiviliansEvacuated = 0
CiviliansKilled = 0
EvacuateCivilians = function()
Trigger.OnInfiltrated(SafeHouse, function()
CiviliansEvacuated = CiviliansEvacuated + 1
UserInterface.SetMissionText(CiviliansEvacuated .. "/" .. CiviliansEvacuatedThreshold .. " civilians evacuated.", TextColor)
end)
Trigger.OnKilled(SafeHouse, function()
USSR.MarkCompletedObjective(SovietObj)
end)
local enemyBase = Utils.Where(USSR.GetActors(), function(actor)
return
actor.HasProperty("Sell") and
actor.Type ~= "brik"
end)
Trigger.OnAllKilled(enemyBase, function()
Media.PlaySoundNotification(Allies, "AlertBleep")
Media.DisplayMessage("Alfa Niner this is Pegasus. We are on site and ready to assist with the evacuation.", "Chinook pilot")
Reinforcements.Reinforce(Allies, { "tran" }, { ChinookEntry.Location, ChinookLZ.Location })
end)
end
Tick = function()
USSR.Cash = 10000
if CiviliansEvacuated >= CiviliansEvacuatedThreshold then
Allies.MarkCompletedObjective(RescueCivilians)
end
if CiviliansKilled >= CiviliansKilledThreshold then
Allies.MarkFailedObjective(RescueCivilians)
end
if AlliesArrived and Allies.HasNoRequiredUnits() then
USSR.MarkCompletedObjective(SovietObj)
end
end
WorldLoaded = function()
Allies = Player.GetPlayer("Allies")
USSR = Player.GetPlayer("USSR")
Trigger.OnObjectiveAdded(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
if Map.LobbyOption("difficulty") == "easy" then
RescueCivilians = Allies.AddObjective("Evacuate at least half of the civilians to the island\nshelter.")
elseif Map.LobbyOption("difficulty") == "normal" then
RescueCivilians = Allies.AddObjective("Evacuate at least three quarters of the civilians to\nthe island shelter.")
else
RescueCivilians = Allies.AddObjective("Evacuate all civilians to the island shelter.")
end
ClearWaterway = Allies.AddObjective("Clear the area of enemy submarine activity.", "Secondary", false)
SovietObj = USSR.AddObjective("Defeat Allies.")
Trigger.OnObjectiveCompleted(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(Allies, function()
Media.PlaySpeechNotification(Allies, "Lose")
end)
Trigger.OnPlayerWon(Allies, function()
Media.PlaySpeechNotification(Allies, "Win")
end)
CiviliansEvacuatedThreshold = CiviliansEvacuatedThreshold[Difficulty]
CiviliansKilledThreshold = CiviliansKilledThreshold[Difficulty]
TextColor = Allies.Color
UserInterface.SetMissionText(CiviliansEvacuated .. "/" .. CiviliansEvacuatedThreshold .. " civilians evacuated.", TextColor)
StandardDrop = Actor.Create("paradrop", false, { Owner = USSR })
FlamerDrop = Actor.Create("flamerdrop", false, { Owner = USSR })
Camera.Position = DefaultCameraPosition.CenterPosition
MissionStart()
VillageSetup()
EvacuateCivilians()
ActivateAI()
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,107 @@
Player:
PlayerResources:
DefaultCash: 3500
World:
LuaScript:
Scripts: campaign-global.lua, evacuation.lua, evacuation-AI.lua
MissionData:
WinVideo: allymorf.vqa
LossVideo: snstrafe.vqa
Briefing: Soviet forces are moving into rural Athens, threatening the civilian population. Evacuate civilians from each of the four towns to the island in the northeast. \n\nThe civilians are hiding in the town churches, and will only come out when you enter the town. Get in, get them out of the town, and to the island.\n\nThe civilians are your primary objective here -- removing the Soviet threat is optional.
ScriptLobbyDropdown@difficulty:
ID: difficulty
Label: Difficulty
Values:
easy: Easy
normal: Normal
hard: Hard
Default: easy
PARADROP:
ParatroopersPower:
DropItems: E1, E1, E1, E2, E2
AlwaysVisible:
FLAMERDROP:
ParatroopersPower:
DropItems: E2, E2, E4, E4, E4
AlwaysVisible:
^CivInfantry:
Infiltrates:
Types: CivilianEntry
ValidRelationships: Ally
TECN:
-Infiltrates:
TECN2:
-Infiltrates:
GNRL:
-Infiltrates:
MISS:
Targetable:
TargetTypes: GroundActor, C4, DetonateAttack, Structure, CivilianEntry
QTNK:
Buildable:
Prerequisites: ~disabled
ATEK:
Buildable:
Prerequisites: ~disabled
STEK:
Buildable:
Prerequisites: ~disabled
E7:
Buildable:
Prerequisites: ~disabled
E7.noautotarget:
Buildable:
Prerequisites: ~disabled
PDOX:
Buildable:
Prerequisites: ~disabled
MSLO:
Buildable:
Prerequisites: ~disabled
MCV:
Buildable:
Prerequisites: ~disabled
TRUK:
Buildable:
Prerequisites: ~disabled
MRJ:
Buildable:
Prerequisites: ~disabled
HPAD:
Buildable:
Prerequisites: ~disabled
TTNK:
Buildable:
Prerequisites: ~disabled
CA:
Buildable:
Prerequisites: ~disabled
GAP:
Buildable:
Prerequisites: ~disabled
3TNK:
Buildable:
Prerequisites: ~vehicles.soviet

View File

@@ -35,6 +35,7 @@ Counterstrike Allied Missions:
sarin-gas-2-down-under
sarin-gas-3-controlled-burn
fall-of-greece-1-personal-war
fall-of-greece-2-evacuation
siberian-conflict-1-fresh-tracks
siberian-conflict-3-wasteland
Counterstrike Soviet Missions: