Use the OnPlayerDiscovered trigger in gdi05a

This commit is contained in:
Oliver Brakmann
2015-02-22 22:42:03 +02:00
committed by penev92
parent 16dee554c4
commit ff49cdcc5f
2 changed files with 23 additions and 21 deletions

View File

@@ -11,11 +11,6 @@ GdiTanks = { "mtnk", "mtnk" }
GdiApc = { "apc" }
GdiInfantry = { "e1", "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "e2" }
GdiBase = { GdiNuke1, GdiNuke2, GdiProc, GdiSilo1, GdiSilo2, GdiPyle, GdiWeap, GdiHarv }
GdiBaseDiscoveryTrigger =
{
CPos.New(39, 54), CPos.New(48, 42), CPos.New(49, 42), CPos.New(50, 42), CPos.New(51, 42),
CPos.New(52, 42), CPos.New(53, 42), CPos.New(54, 42), CPos.New(55, 42), CPos.New(56, 42)
}
NodSams = { Sam1, Sam2, Sam3, Sam4 }
CoreNodBase = { NodConYard, NodRefinery, HandOfNod, Airfield }
@@ -122,7 +117,11 @@ Grd3Action = function()
end
end
DiscoverGdiBase = function()
DiscoverGdiBase = function(actor, discoverer)
if baseDiscovered or not discoverer == gdi then
return
end
Utils.Do(GdiBase, function(actor)
actor.Owner = gdi
end)
@@ -145,12 +144,7 @@ SetupWorld = function()
Reinforcements.Reinforce(gdi, GdiApc, { GdiApcEntry.Location, GdiApcRallyPoint.Location }, DateTime.Seconds(1), function(actor) actor.Stance = "Defend" end)
Reinforcements.Reinforce(gdi, GdiInfantry, { GdiInfantryEntry.Location, GdiInfantryRallyPoint.Location }, 15, function(actor) actor.Stance = "Defend" end)
Trigger.OnEnteredFootprint(GdiBaseDiscoveryTrigger, function(actor, id)
if actor.Owner == gdi then
DiscoverGdiBase()
Trigger.RemoveFootprintTrigger(id)
end
end)
Trigger.OnPlayerDiscovered(gdiBase, DiscoverGdiBase)
Utils.Do(Map.NamedActors, function(actor)
if actor.Owner == nod and actor.HasProperty("StartBuildingRepairs") then
@@ -186,6 +180,7 @@ SetupWorld = function()
end
WorldLoaded = function()
gdiBase = Player.GetPlayer("AbandonedBase")
gdi = Player.GetPlayer("GDI")
nod = Player.GetPlayer("Nod")

View File

@@ -2,7 +2,7 @@ MapFormat: 7
RequiresMod: cnc
Title: Repair the GDI base
Title: Repair the GDI base (a)
Description: A GDI field base is under attack. They have fended off one attack but will not survive another.\n\nMove to the base, repair the structures and then launch a strike force to destroy the Nod base in the area.\n\nDestroy all Nod units and structures.
@@ -56,6 +56,11 @@ Players:
LockTeam: True
Allies: GDI
Enemies: Nod
PlayerReference@AbandonedBase:
Name: AbandonedBase
NonCombatant: True
ColorRamp: 31,222,183
Race: gdi
PlayerReference@Neutral:
Name: Neutral
OwnsWorld: True
@@ -684,36 +689,36 @@ Actors:
Owner: Neutral
GdiProc: proc
Location: 50,51
Owner: Neutral
Owner: AbandonedBase
Health: 0.3085938
FreeActor: False
GdiHarv: harv
Location: 48,53
Owner: Neutral
Owner: AbandonedBase
Facing: 64
GdiWeap: weap
Location: 50,54
Owner: Neutral
Owner: AbandonedBase
Health: 0.2695313
GdiNuke1: nuke
Location: 53,55
Owner: Neutral
Owner: AbandonedBase
Health: 0.2890625
GdiPyle: pyle
Location: 46,55
Owner: Neutral
Owner: AbandonedBase
Health: 0.25
GdiSilo1: silo
Location: 53,51
Owner: Neutral
Owner: AbandonedBase
Health: 0.3320313
GdiSilo2: silo
Location: 53,53
Owner: Neutral
Owner: AbandonedBase
Health: 0.25
GdiNuke2: nuke
Location: 48,56
Owner: Neutral
Owner: AbandonedBase
Health: 0.2070313
NodConYard: fact
Location: 9,29
@@ -796,6 +801,7 @@ Rules:
-ConquestVictoryConditions:
MissionObjectives:
EarlyGameOver: true
EnemyWatcher:
^Vehicle:
Tooltip:
GenericVisibility: Enemy
@@ -826,6 +832,7 @@ Rules:
Tooltip:
GenericVisibility: Enemy
ShowOwnerRow: false
AnnounceOnSeen:
^Wall:
Tooltip:
ShowOwnerRow: false