added the second GDI mission
This commit is contained in:
60
mods/cnc/maps/gdi02/mission.lua
Normal file
60
mods/cnc/maps/gdi02/mission.lua
Normal file
@@ -0,0 +1,60 @@
|
||||
MobileConstructionVehicle = { "mcv" }
|
||||
EngineerReinforcements = { "e6", "e6", "e6" }
|
||||
VehicleReinforcements = { "jeep" }
|
||||
|
||||
AttackerSquadSize = 3
|
||||
|
||||
MissionAccomplished = function()
|
||||
Mission.MissionOver({ player }, nil, false)
|
||||
Media.PlayMovieFullscreen("flag.vqa")
|
||||
end
|
||||
|
||||
MissionFailed = function()
|
||||
Mission.MissionOver(nil, { player }, false)
|
||||
Media.PlayMovieFullscreen("gameover.vqa")
|
||||
end
|
||||
|
||||
ReinforceFromSea = function(passengers)
|
||||
local hovercraft, troops = Reinforcements.Insert(player, "oldlst", passengers, { lstStart.Location, lstEnd.Location }, { lstStart.Location })
|
||||
Media.PlaySpeechNotification("Reinforce")
|
||||
end
|
||||
|
||||
BridgeheadSecured = function()
|
||||
ReinforceFromSea(MobileConstructionVehicle)
|
||||
OpenRA.RunAfterDelay(25 * 15, NodAttack)
|
||||
OpenRA.RunAfterDelay(25 * 30, function() ReinforceFromSea(EngineerReinforcements) end)
|
||||
OpenRA.RunAfterDelay(25 * 60, function() ReinforceFromSea(VehicleReinforcements) end)
|
||||
end
|
||||
|
||||
NodAttack = function()
|
||||
local nodUnits = Mission.GetGroundAttackersOf(enemy)
|
||||
local nodUnitsLeft = table.getn(nodUnits)
|
||||
if (nodUnitsLeft > AttackerSquadSize * 2) then
|
||||
attackers = Utils.Skip(nodUnits, nodUnitsLeft - AttackerSquadSize)
|
||||
local attackSquad = Team.New(attackers)
|
||||
Team.Do(attackSquad, function(unit)
|
||||
Actor.AttackMove(unit, waypoint2.location)
|
||||
Actor.Hunt(unit)
|
||||
end)
|
||||
Team.AddEventHandler(attackSquad.OnAllKilled, OpenRA.RunAfterDelay(25 * 15, NodAttack))
|
||||
end
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = OpenRA.GetPlayer("GDI")
|
||||
enemy = OpenRA.GetPlayer("Nod")
|
||||
|
||||
Media.PlayMovieFullscreen("gdi2.vqa")
|
||||
|
||||
nodInBaseTeam = Team.New({ RushBuggy, RushRifle1, RushRifle2, RushRifle3 })
|
||||
Team.AddEventHandler(nodInBaseTeam.OnAllKilled, BridgeheadSecured)
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if Mission.RequiredUnitsAreDestroyed(player) then
|
||||
MissionFailed()
|
||||
end
|
||||
if Mission.RequiredUnitsAreDestroyed(enemy) then
|
||||
MissionAccomplished()
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user