ported first Nod mission to Lua
This commit is contained in:
47
mods/cnc/maps/nod01/mission.lua
Normal file
47
mods/cnc/maps/nod01/mission.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
RifleInfantryReinforcements = { "e1", "e1", }
|
||||
RocketInfantryReinforcements = { "e3", "e3", "e3" }
|
||||
|
||||
MissionAccomplished = function()
|
||||
Mission.MissionOver({ player }, nil, false)
|
||||
end
|
||||
|
||||
MissionFailed = function()
|
||||
Mission.MissionOver(nil, { player }, false)
|
||||
Media.PlayMovieFullscreen("nodlose.vqa")
|
||||
end
|
||||
|
||||
SendFirstInfantryReinforcements = function()
|
||||
Media.PlaySpeechNotification("Reinforce")
|
||||
Reinforcements.Reinforce(player, RifleInfantryReinforcements, StartSpawnPointRight.Location, StartRallyPoint.Location, 15)
|
||||
end
|
||||
|
||||
SendSecondInfantryReinforcements = function()
|
||||
Media.PlaySpeechNotification("Reinforce")
|
||||
Reinforcements.Reinforce(player, RifleInfantryReinforcements, StartSpawnPointLeft.Location, StartRallyPoint.Location, 15)
|
||||
end
|
||||
|
||||
SendLastInfantryReinforcements = function()
|
||||
Media.PlaySpeechNotification("Reinforce")
|
||||
Reinforcements.Reinforce(player, RocketInfantryReinforcements, VillageSpawnPoint.Location, VillageRallyPoint.Location, 15)
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
player = OpenRA.GetPlayer("Nod")
|
||||
enemy = OpenRA.GetPlayer("Villagers")
|
||||
|
||||
Media.PlayMovieFullscreen("nod1pre.vqa", function() Media.PlayMovieFullscreen("nod1.vqa") end)
|
||||
|
||||
Actor.OnKilled(Nikoomba, SendLastInfantryReinforcements)
|
||||
|
||||
OpenRA.RunAfterDelay(25 * 30, SendFirstInfantryReinforcements)
|
||||
OpenRA.RunAfterDelay(25 * 60, SendSecondInfantryReinforcements)
|
||||
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