recreated GDI01 in Lua
This commit is contained in:
61
mods/cnc/maps/gdi01/mission.lua
Normal file
61
mods/cnc/maps/gdi01/mission.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
InfantryReinforcements = { "e1", "e1", "e1" }
|
||||
VehicleReinforcements = { "jeep" }
|
||||
NodPatrol = { "e1", "e1" }
|
||||
|
||||
MissionAccomplished = function()
|
||||
Mission.MissionOver({ player }, nil, false)
|
||||
Media.PlayMovieFullscreen("consyard.vqa")
|
||||
end
|
||||
|
||||
MissionFailed = function()
|
||||
Mission.MissionOver(nil, { player }, false)
|
||||
Media.PlayMovieFullscreen("gameover.vqa")
|
||||
end
|
||||
|
||||
SendNodPatrol = function()
|
||||
local patrol = Reinforcements.Reinforce(enemy, NodPatrol, nod0.Location, nod1.Location, 0)
|
||||
for i, soldier in ipairs(patrol) do
|
||||
Actor.Move(soldier, nod2.Location)
|
||||
Actor.Move(soldier, nod3.Location)
|
||||
Actor.Hunt(soldier)
|
||||
end
|
||||
end
|
||||
|
||||
SetGunboatPath = function()
|
||||
Actor.AttackMove(Gunboat, gunboatLeft.Location)
|
||||
Actor.AttackMove(Gunboat, gunboatRight.Location)
|
||||
end
|
||||
|
||||
ReinforceFromSea = function(passengers)
|
||||
local hovercraft, troops = Reinforcements.Insert(player, "lst", passengers, { lstStart.Location, lstEnd.Location }, { lstStart.Location })
|
||||
Media.PlaySpeechNotification("Reinforce")
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = OpenRA.GetPlayer("GoodGuy")
|
||||
enemy = OpenRA.GetPlayer("BadGuy")
|
||||
|
||||
Media.PlayMovieFullscreen("gdi1.vqa", function() Media.PlayMovieFullscreen("landing.vqa") end)
|
||||
|
||||
SendNodPatrol()
|
||||
|
||||
OpenRA.RunAfterDelay(25 * 5, function() ReinforceFromSea(InfantryReinforcements) end)
|
||||
OpenRA.RunAfterDelay(25 * 15, function() ReinforceFromSea(InfantryReinforcements) end)
|
||||
OpenRA.RunAfterDelay(25 * 30, function() ReinforceFromSea(VehicleReinforcements) end)
|
||||
OpenRA.RunAfterDelay(25 * 60, function() ReinforceFromSea(VehicleReinforcements) end)
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if Actor.IsIdle(Gunboat) then
|
||||
SetGunboatPath()
|
||||
end
|
||||
|
||||
if not Mission.MissionIsOver then
|
||||
if Mission.RequiredUnitsAreDestroyed(player) then
|
||||
MissionFailed()
|
||||
end
|
||||
if Mission.RequiredUnitsAreDestroyed(enemy) then
|
||||
MissionAccomplished()
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user