Merge pull request #6836 from pchote/polish-gdi0102

Closes #6757
Closes #6834
This commit is contained in:
Matthias Mailänder
2014-10-26 08:02:46 +01:00
11 changed files with 117 additions and 56 deletions

View File

@@ -1,3 +1,4 @@
MCVReinforcements = { "mcv" }
InfantryReinforcements = { "e1", "e1", "e1" }
VehicleReinforcements = { "jeep" }
NodPatrol = { "e1", "e1" }
@@ -15,9 +16,36 @@ SetGunboatPath = function(gunboat)
gunboat.AttackMove(gunboatRight.Location)
end
ReinforceWithLandingCraft = function(units, transportStart, transportUnload, rallypoint)
local transport = Actor.Create("oldlst", true, { Owner = player, Facing = 0, Location = transportStart })
local subcell = 0
Utils.Do(units, function(a)
transport.LoadPassenger(Actor.Create(a, false, { Owner = transport.Owner, Facing = transport.Facing, Location = transportUnload, SubCell = subcell }))
subcell = subcell + 1
end)
transport.ScriptedMove(transportUnload)
transport.CallFunc(function()
Utils.Do(units, function()
local a = transport.UnloadPassenger()
a.IsInWorld = true
a.MoveIntoWorld(transport.Location - CVec.New(0, 1))
if rallypoint ~= nil then
a.Move(rallypoint)
end
end)
end)
transport.Wait(5)
transport.ScriptedMove(transportStart)
transport.Destroy()
end
Reinforce = function(units)
Media.PlaySpeechNotification(player, "Reinforce")
Reinforcements.ReinforceWithTransport(player, "oldlst", units, { lstStart.Location, lstEnd.Location }, { lstStart.Location })
ReinforceWithLandingCraft(units, lstStart.Location, lstEnd.Location, reinforcementsTarget.Location)
end
triggerAdded = false
@@ -39,7 +67,6 @@ CheckForBase = function()
end
WorldLoaded = function()
Media.PlayMovieFullscreen("landing.vqa")
player = Player.GetPlayer("GDI")
enemy = Player.GetPlayer("Nod")
@@ -68,17 +95,20 @@ WorldLoaded = function()
end)
end)
nodObjective = enemy.AddPrimaryObjective("Destroy all GDI troops")
gdiObjective1 = player.AddPrimaryObjective("Eliminate all Nod forces in the area")
gdiObjective2 = player.AddSecondaryObjective("Establish a beachhead")
Media.PlayMovieFullscreen("landing.vqa", function()
nodObjective = enemy.AddPrimaryObjective("Destroy all GDI troops")
gdiObjective1 = player.AddPrimaryObjective("Eliminate all Nod forces in the area")
gdiObjective2 = player.AddSecondaryObjective("Establish a beachhead")
ReinforceWithLandingCraft(MCVReinforcements, lstStart.Location + CVec.New(2, 0), lstEnd.Location + CVec.New(2, 0), mcvTarget.Location)
Reinforce(InfantryReinforcements)
end)
Trigger.OnIdle(Gunboat, function() SetGunboatPath(Gunboat) end)
SendNodPatrol()
Trigger.AfterDelay(DateTime.Seconds(5), function() Reinforce(InfantryReinforcements) end)
Trigger.AfterDelay(DateTime.Seconds(15), function() Reinforce(InfantryReinforcements) end)
Trigger.AfterDelay(DateTime.Seconds(30), function() Reinforce(VehicleReinforcements) end)
Trigger.AfterDelay(DateTime.Seconds(10), function() Reinforce(InfantryReinforcements) end)
Trigger.AfterDelay(DateTime.Seconds(60), function() Reinforce(VehicleReinforcements) end)
end
@@ -90,7 +120,7 @@ Tick = function()
player.MarkCompletedObjective(gdiObjective1)
end
if player.HasNoRequiredUnits() then
if tick > DateTime.Seconds(5) and player.HasNoRequiredUnits() then
enemy.MarkCompletedObjective(nodObjective)
end

View File

@@ -327,40 +327,11 @@ Actors:
Owner: Nod
Health: 0.1875
Facing: 160
mcv: mcv
Location: 56,53
Owner: GDI
Health: 1
Facing: 0
Gunboat: boat
Location: 53,59
Location: 51,59
Owner: GDI
Health: 1
Facing: 64
Actor88: e1
Location: 56,55
Owner: GDI
Health: 1
Facing: 0
SubCell: 2
Actor89: e1
Location: 56,55
Owner: GDI
Health: 1
Facing: 0
SubCell: 4
Actor90: e1
Location: 56,55
Owner: GDI
Health: 1
Facing: 0
SubCell: 3
Actor91: e1
Location: 56,55
Owner: GDI
Health: 1
Facing: 0
SubCell: 1
Actor92: e1
Location: 57,45
Owner: Nod
@@ -448,6 +419,12 @@ Actors:
lstEnd: waypoint
Location: 54,57
Owner: Neutral
mcvTarget: waypoint
Location: 56,53
Owner: Neutral
reinforcementsTarget: waypoint
Location: 54,53
Owner: Neutral
Smudges:
@@ -545,6 +522,9 @@ Rules:
ATWR:
Buildable:
Prerequisites: ~disabled
BRIK:
Buildable:
Prerequisites: ~disabled
E2:
Buildable:
Prerequisites: ~disabled
@@ -575,9 +555,7 @@ Sequences:
idle: lst
Start: 0
Facings: 1
unload: lst
Start: 0
Facings: 1
ZOffset: -1024
VoxelSequences:

View File

@@ -5,9 +5,36 @@ VehicleReinforcements = { "jeep" }
AttackerSquadSize = 3
Reinforce = function(passengers)
Reinforcements.ReinforceWithTransport(player, "oldlst", passengers, { lstStart.Location, lstEnd.Location }, { lstStart.Location })
ReinforceWithLandingCraft = function(units, transportStart, transportUnload, rallypoint)
local transport = Actor.Create("oldlst", true, { Owner = player, Facing = 0, Location = transportStart })
local subcell = 0
Utils.Do(units, function(a)
transport.LoadPassenger(Actor.Create(a, false, { Owner = transport.Owner, Facing = transport.Facing, Location = transportUnload, SubCell = subcell }))
subcell = subcell + 1
end)
transport.ScriptedMove(transportUnload)
transport.CallFunc(function()
Utils.Do(units, function()
local a = transport.UnloadPassenger()
a.IsInWorld = true
a.MoveIntoWorld(transport.Location - CVec.New(0, 1))
if rallypoint ~= nil then
a.Move(rallypoint)
end
end)
end)
transport.Wait(5)
transport.ScriptedMove(transportStart)
transport.Destroy()
end
Reinforce = function(units)
Media.PlaySpeechNotification(player, "Reinforce")
ReinforceWithLandingCraft(units, lstStart.Location, lstEnd.Location)
end
BridgeheadSecured = function()
@@ -61,6 +88,15 @@ WorldLoaded = function()
gdiObjective1 = player.AddPrimaryObjective("Eliminate all Nod forces in the area")
gdiObjective2 = player.AddSecondaryObjective("Capture the Tiberium Refinery")
-- Work around limitations with the yaml merger that prevent MustBeDestroyed from working on the silos
siloARemoved = false
Trigger.OnCapture(SiloA, function() siloARemoved = true end)
Trigger.OnKilled(SiloA, function() siloARemoved = true end)
siloBRemoved = false
Trigger.OnCapture(SiloB, function() siloBRemoved = true end)
Trigger.OnKilled(SiloB, function() siloBRemoved = true end)
Trigger.OnCapture(NodRefinery, function() player.MarkCompletedObjective(gdiObjective2) end)
Trigger.OnKilled(NodRefinery, function() player.MarkFailedObjective(gdiObjective2) end)
@@ -71,7 +107,7 @@ Tick = function()
if player.HasNoRequiredUnits() then
enemy.MarkCompletedObjective(nodObjective)
end
if enemy.HasNoRequiredUnits() then
if enemy.HasNoRequiredUnits() and siloARemoved and siloBRemoved then
player.MarkCompletedObjective(gdiObjective1)
end
end

View File

@@ -302,12 +302,12 @@ Actors:
Owner: GDI
Health: 0.34375
Facing: 0
Actor79: silo
SiloA: silo
Location: 57,32
Owner: Nod
Health: 1
Facing: 0
Actor80: silo
SiloB: silo
Location: 59,32
Owner: Nod
Health: 1
@@ -800,6 +800,7 @@ Rules:
Buildable:
Prerequisites: ~disabled
SILO:
MustBeDestroyed:
Buildable:
Prerequisites: ~disabled
WEAP:
@@ -873,9 +874,7 @@ Sequences:
idle: lst
Start: 0
Facings: 1
unload: lst
Start: 0
Facings: 1
ZOffset: -1024
VoxelSequences:

View File

@@ -64,7 +64,7 @@ LST:
WithRoof:
WithCargo:
DisplayTypes: Infantry, Vehicle
LocalOffset: 0,0,0, -390,-256,0, 390,-256,0, -390,256,0, 390,256,0
LocalOffset: 390,-256,0, 390,256,0, 0,0,0, -390,-256,0, -390,256,0
Cargo:
Types: Infantry, Vehicle
MaxWeight: 5