Merge pull request #7052 from Mailaender/gdi01-polishing

Fixed GDI01 secondary objectives and mission descriptions
This commit is contained in:
Oliver Brakmann
2014-12-24 14:30:40 +01:00
2 changed files with 19 additions and 23 deletions

View File

@@ -48,21 +48,11 @@ Reinforce = function(units)
ReinforceWithLandingCraft(units, lstStart.Location, lstEnd.Location, reinforcementsTarget.Location)
end
triggerAdded = false
CheckForBase = function()
baseBuildings = Map.ActorsInBox(Map.TopLeft, Map.BottomRight, function(actor)
return actor.Type == "fact" or actor.Type == "pyle" or actor.Type == "nuke"
end)
Utils.Do(baseBuildings, function(building)
if not triggerAdded and building.Type == "fact" then
Trigger.OnRemovedFromWorld(building, function()
player.MarkFailedObjective(gdiObjective2)
end)
triggerAdded = true
end
end)
return #baseBuildings >= 3
end
@@ -89,9 +79,8 @@ WorldLoaded = function()
Media.PlaySpeechNotification(player, "Lose")
end)
nodObjective = enemy.AddPrimaryObjective("Destroy all GDI troops")
gdiObjective1 = player.AddPrimaryObjective("Eliminate all Nod forces in the area")
gdiObjective2 = player.AddSecondaryObjective("Establish a beachhead")
secureAreaObjective = player.AddPrimaryObjective("Eliminate all Nod forces in the area")
beachheadObjective = player.AddSecondaryObjective("Establish a beachhead")
ReinforceWithLandingCraft(MCVReinforcements, lstStart.Location + CVec.New(2, 0), lstEnd.Location + CVec.New(2, 0), mcvTarget.Location)
Reinforce(InfantryReinforcements)
@@ -104,20 +93,17 @@ WorldLoaded = function()
Trigger.AfterDelay(DateTime.Seconds(60), function() Reinforce(VehicleReinforcements) end)
end
tick = 0
baseEstablished = false
Tick = function()
tick = tick + 1
if enemy.HasNoRequiredUnits() then
player.MarkCompletedObjective(gdiObjective1)
player.MarkCompletedObjective(secureAreaObjective)
end
if tick > DateTime.Seconds(5) and player.HasNoRequiredUnits() then
enemy.MarkCompletedObjective(nodObjective)
if DateTime.GameTime > DateTime.Seconds(5) and player.HasNoRequiredUnits() then
player.MarkFailedObjective(beachheadObjective)
player.MarkFailedObjective(secureAreaObjective)
end
if not baseEstablished and tick % DateTime.Seconds(1) == 0 and CheckForBase() then
baseEstablished = true
player.MarkCompletedObjective(gdiObjective2)
if DateTime.GameTime % DateTime.Seconds(1) == 0 and not player.IsObjectiveCompleted(beachheadObjective) and CheckForBase() then
player.MarkCompletedObjective(beachheadObjective)
end
end

View File

@@ -4,7 +4,7 @@ RequiresMod: cnc
Title: Storm the Beachhead
Description: Use the units provided to protect the Mobile Construction Vehicle. (MCV)\n\nYou should then deploy the MCV by double clicking on it.\n\nThen you can begin to build up a base. Start with a Power Plant.\n\nFinally, search out and destroy all enemy Nod units in the surrounding area.
Description: Use the units provided to protect the Mobile Construction Vehicle. (MCV)\n\nYou should then deploy the MCV by selecting it with a left-click and then right-clicking on it.\n\nThen you can begin to build up a base. Start with a Power Plant.\n\nFinally, search out and destroy all enemy Nod units in the surrounding area.
Author: Westwood Studios
@@ -485,6 +485,16 @@ Rules:
GenericVisibility: Enemy, Ally, Neutral
GenericStancePrefix: false
ShowOwnerRow: false
NUKE:
-Sellable:
Buildable:
BuildLimit: 1
PYLE:
-Sellable:
Buildable:
BuildLimit: 1
FACT:
-Sellable:
PROC:
Buildable:
Prerequisites: ~disabled