Code cleanup in the Tiberian Dawn Lua scripts.

Uppercase global variables.
Declare local variables.
Remove unused variable.
This commit is contained in:
Matthias Mailänder
2022-09-09 10:13:24 +02:00
committed by Gustas
parent ca45e02265
commit b8e261ff2f
18 changed files with 108 additions and 115 deletions

View File

@@ -13,8 +13,8 @@ BikeReinforcments = { "bike" }
WorldLoaded = function() WorldLoaded = function()
Nod = Player.GetPlayer("Nod") Nod = Player.GetPlayer("Nod")
dinosaur = Player.GetPlayer("Dinosaur") Dinosaur = Player.GetPlayer("Dinosaur")
civilian = Player.GetPlayer("Civilian") Civilian = Player.GetPlayer("Civilian")
InvestigateObj = Nod.AddObjective("Investigate the nearby village for reports of\nstrange activity.") InvestigateObj = Nod.AddObjective("Investigate the nearby village for reports of\nstrange activity.")
@@ -22,9 +22,9 @@ WorldLoaded = function()
ReachVillageObj = Nod.AddObjective("Reach the village.") ReachVillageObj = Nod.AddObjective("Reach the village.")
Trigger.OnPlayerDiscovered(civilian, function(_, discoverer) Trigger.OnPlayerDiscovered(Civilian, function(_, discoverer)
if discoverer == Nod and not Nod.IsObjectiveCompleted(ReachVillageObj) then if discoverer == Nod and not Nod.IsObjectiveCompleted(ReachVillageObj) then
if not dinosaur.HasNoRequiredUnits() then if not Dinosaur.HasNoRequiredUnits() then
KillDinos = Nod.AddObjective("Kill all creatures in the area.") KillDinos = Nod.AddObjective("Kill all creatures in the area.")
end end
@@ -60,7 +60,7 @@ Tick = function()
Nod.MarkFailedObjective(InvestigateObj) Nod.MarkFailedObjective(InvestigateObj)
end end
if dinosaur.HasNoRequiredUnits() then if Dinosaur.HasNoRequiredUnits() then
if KillDinos then Nod.MarkCompletedObjective(KillDinos) end if KillDinos then Nod.MarkCompletedObjective(KillDinos) end
Nod.MarkCompletedObjective(InvestigateObj) Nod.MarkCompletedObjective(InvestigateObj)
end end

View File

@@ -32,8 +32,8 @@ WorldLoaded = function()
InitObjectives(GDI) InitObjectives(GDI)
secureAreaObjective = GDI.AddObjective("Eliminate all Nod forces in the area.") SecureAreaObjective = GDI.AddObjective("Eliminate all Nod forces in the area.")
beachheadObjective = GDI.AddObjective("Establish a beachhead.", "Secondary", false) BeachheadObjective = GDI.AddObjective("Establish a beachhead.", "Secondary", false)
ReinforceWithLandingCraft(GDI, MCVReinforcements, lstStart.Location + CVec.New(2, 0), lstEnd.Location + CVec.New(2, 0), mcvTarget.Location) ReinforceWithLandingCraft(GDI, MCVReinforcements, lstStart.Location + CVec.New(2, 0), lstEnd.Location + CVec.New(2, 0), mcvTarget.Location)
Reinforce(InfantryReinforcements) Reinforce(InfantryReinforcements)
@@ -46,15 +46,15 @@ end
Tick = function() Tick = function()
if Nod.HasNoRequiredUnits() then if Nod.HasNoRequiredUnits() then
GDI.MarkCompletedObjective(secureAreaObjective) GDI.MarkCompletedObjective(SecureAreaObjective)
end end
if DateTime.GameTime > DateTime.Seconds(5) and GDI.HasNoRequiredUnits() then if DateTime.GameTime > DateTime.Seconds(5) and GDI.HasNoRequiredUnits() then
GDI.MarkFailedObjective(beachheadObjective) GDI.MarkFailedObjective(BeachheadObjective)
GDI.MarkFailedObjective(secureAreaObjective) GDI.MarkFailedObjective(SecureAreaObjective)
end end
if DateTime.GameTime % DateTime.Seconds(1) == 0 and not GDI.IsObjectiveCompleted(beachheadObjective) and CheckForBase(GDI, GDIBaseBuildings) then if DateTime.GameTime % DateTime.Seconds(1) == 0 and not GDI.IsObjectiveCompleted(BeachheadObjective) and CheckForBase(GDI, GDIBaseBuildings) then
GDI.MarkCompletedObjective(beachheadObjective) GDI.MarkCompletedObjective(BeachheadObjective)
end end
end end

View File

@@ -7,7 +7,7 @@
information, see COPYING. information, see COPYING.
]] ]]
nodInBaseTeam = { RushBuggy, RushRifle1, RushRifle2, RushRifle3 } NodInBaseTeam = { RushBuggy, RushRifle1, RushRifle2, RushRifle3 }
MobileConstructionVehicle = { "mcv" } MobileConstructionVehicle = { "mcv" }
EngineerReinforcements = { "e6", "e6", "e6" } EngineerReinforcements = { "e6", "e6", "e6" }
VehicleReinforcements = { "jeep" } VehicleReinforcements = { "jeep" }
@@ -44,22 +44,22 @@ WorldLoaded = function()
InitObjectives(GDI) InitObjectives(GDI)
nodObjective = Nod.AddObjective("Destroy all GDI troops.") NodObjective = Nod.AddObjective("Destroy all GDI troops.")
gdiObjective1 = GDI.AddObjective("Eliminate all Nod forces in the area.") GDIObjective1 = GDI.AddObjective("Eliminate all Nod forces in the area.")
gdiObjective2 = GDI.AddObjective("Capture the Tiberium refinery.", "Secondary", false) GDIObjective2 = GDI.AddObjective("Capture the Tiberium refinery.", "Secondary", false)
Trigger.OnCapture(NodRefinery, function() GDI.MarkCompletedObjective(gdiObjective2) end) Trigger.OnCapture(NodRefinery, function() GDI.MarkCompletedObjective(GDIObjective2) end)
Trigger.OnKilled(NodRefinery, function() GDI.MarkFailedObjective(gdiObjective2) end) Trigger.OnKilled(NodRefinery, function() GDI.MarkFailedObjective(GDIObjective2) end)
Trigger.OnAllKilled(nodInBaseTeam, BridgeheadSecured) Trigger.OnAllKilled(NodInBaseTeam, BridgeheadSecured)
end end
Tick = function() Tick = function()
if GDI.HasNoRequiredUnits() then if GDI.HasNoRequiredUnits() then
Nod.MarkCompletedObjective(nodObjective) Nod.MarkCompletedObjective(NodObjective)
end end
if Nod.HasNoRequiredUnits() then if Nod.HasNoRequiredUnits() then
GDI.MarkCompletedObjective(gdiObjective1) GDI.MarkCompletedObjective(GDIObjective1)
end end
end end

View File

@@ -122,16 +122,16 @@ WorldLoaded = function()
end) end)
Trigger.OnEnteredFootprint(AutoTrigger, function(a, id) Trigger.OnEnteredFootprint(AutoTrigger, function(a, id)
if not autoTrigger and a.Owner == GDI then if not AutoTriggered and a.Owner == GDI then
autoTrigger = true AutoTriggered = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
BuildAuto() BuildAuto()
end end
end) end)
Trigger.OnEnteredFootprint(GDIHeliTrigger, function(a, id) Trigger.OnEnteredFootprint(GDIHeliTrigger, function(a, id)
if not gdiHeliTrigger and a.Owner == GDI then if not GDIHeliTriggered and a.Owner == GDI then
gdiHeliTrigger = true GDIHeliTriggered = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
Reinforcements.ReinforceWithTransport(GDI, "tran", nil, { GDIHeliEntry.Location, GDIHeliLZ.Location }) Reinforcements.ReinforceWithTransport(GDI, "tran", nil, { GDIHeliEntry.Location, GDIHeliLZ.Location })
end end

View File

@@ -110,16 +110,16 @@ WorldLoaded = function()
SetupWorld() SetupWorld()
Trigger.OnExitedFootprint(BhndTrigger, function(a, id) Trigger.OnExitedFootprint(BhndTrigger, function(a, id)
if not bhndTrigger and a.Owner == GDI then if not BhndTriggered and a.Owner == GDI then
bhndTrigger = true BhndTriggered = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
SendHeli(NodHeli) SendHeli(NodHeli)
end end
end) end)
Trigger.OnExitedFootprint(Atk1Trigger, function(a, id) Trigger.OnExitedFootprint(Atk1Trigger, function(a, id)
if not atk1Trigger and a.Owner == GDI then if not Atk1Triggered and a.Owner == GDI then
atk1Trigger = true Atk1Triggered = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
Build(NodxUnits, false, function(actor) Build(NodxUnits, false, function(actor)
@@ -131,8 +131,8 @@ WorldLoaded = function()
end) end)
Trigger.OnEnteredFootprint(Atk2Trigger, function(a, id) Trigger.OnEnteredFootprint(Atk2Trigger, function(a, id)
if not atk2Trigger and a.Owner == GDI then if not Atk2Triggered and a.Owner == GDI then
atk2Trigger = true Atk2Triggered = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
Build(NodxUnits, false, function(actor) Build(NodxUnits, false, function(actor)
@@ -144,24 +144,20 @@ WorldLoaded = function()
end) end)
Trigger.OnEnteredFootprint(AutoTrigger, function(a, id) Trigger.OnEnteredFootprint(AutoTrigger, function(a, id)
if not autoTrigger and a.Owner == GDI then if not AutoTriggered and a.Owner == GDI then
autoTrigger = true AutoTriggered = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
Build(AutoUnits, true, function(actor) Build(AutoUnits, true, function(actor)
Trigger.OnKilled(actor, NodUnitKilled) Trigger.OnKilled(actor, NodUnitKilled)
IdleHunt(actor) IdleHunt(actor)
end) end)
Trigger.AfterDelay(DateTime.Seconds(4), function()
IdleHunt(tank)
end)
end end
end) end)
Trigger.OnEnteredFootprint(GDIHeliTrigger, function(a, id) Trigger.OnEnteredFootprint(GDIHeliTrigger, function(a, id)
if not gdiHeliTrigger and a.Owner == GDI then if not GDIHeliTriggered and a.Owner == GDI then
gdiHeliTrigger = true GDIHeliTriggered = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
Reinforcements.ReinforceWithTransport(GDI, "tran", nil, { HeliEntry.Location, GDIHeliLZ.Location }) Reinforcements.ReinforceWithTransport(GDI, "tran", nil, { HeliEntry.Location, GDIHeliLZ.Location })
end end

View File

@@ -16,7 +16,6 @@ GDIReinforcementsPart2 = { "e2", "e2", "e2", "e2", "e2" }
TownAttackWave1 = { "bggy", "bggy" } TownAttackWave1 = { "bggy", "bggy" }
TownAttackWave2 = { "ltnk", "ltnk" } TownAttackWave2 = { "ltnk", "ltnk" }
TownAttackWave3 = { "e1", "e1", "e1", "e3", "e3", "e3" } TownAttackWave3 = { "e1", "e1", "e1", "e3", "e3", "e3" }
TownAttackWpts = { waypoint1, waypoint2 }
Civvie1Wpts = { CivvieWpts1, CivvieWpts2 } Civvie1Wpts = { CivvieWpts1, CivvieWpts2 }
Civvie2Wpts = { CivvieWpts3, CivvieWpts1, CivvieWpts4, CivvieWpts5, CivvieWpts6, CivvieWpts7, CivvieWpts8, CivvieWpts9, CivvieWpts10, CivvieWpts11 } Civvie2Wpts = { CivvieWpts3, CivvieWpts1, CivvieWpts4, CivvieWpts5, CivvieWpts6, CivvieWpts7, CivvieWpts8, CivvieWpts9, CivvieWpts10, CivvieWpts11 }
@@ -41,7 +40,6 @@ end
TownAttackAction = function(actor) TownAttackAction = function(actor)
Trigger.OnIdle(actor, TownAttackersIdleAction) Trigger.OnIdle(actor, TownAttackersIdleAction)
FollowWaypoints(actor, TownAttackWpts)
end end
AttackTown = function() AttackTown = function()
@@ -80,16 +78,16 @@ WorldLoaded = function()
EliminateNod = GDI.AddPrimaryObjective("Eliminate all Nod forces in the area.") EliminateNod = GDI.AddPrimaryObjective("Eliminate all Nod forces in the area.")
Trigger.OnExitedFootprint(TownAttackTrigger, function(a, id) Trigger.OnExitedFootprint(TownAttackTrigger, function(a, id)
if not townAttackTrigger and a.Owner == GDI then if not TownAttackTriggered and a.Owner == GDI then
townAttackTrigger = true TownAttackTriggered = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
AttackTown() AttackTown()
end end
end) end)
Trigger.OnEnteredFootprint(GDIReinforcementsTrigger, function(a, id) Trigger.OnEnteredFootprint(GDIReinforcementsTrigger, function(a, id)
if not gdiReinforcementsTrigger and a.Owner == GDI then if not GDIReinforcementsTriggered and a.Owner == GDI then
gdiReinforcementsTrigger = true GDIReinforcementsTriggered = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
SendGDIReinforcements() SendGDIReinforcements()
end end

View File

@@ -38,7 +38,7 @@ end
AttackPlayer = function() AttackPlayer = function()
Trigger.AfterDelay(DateTime.Seconds(40), function() Trigger.AfterDelay(DateTime.Seconds(40), function()
for type, count in pairs({ ['e3'] = 3, ['e4'] = 2 }) do for type, count in pairs({ ['e3'] = 3, ['e4'] = 2 }) do
atk1Actors = Utils.Take(count, Nod.GetActorsByType(type)) local atk1Actors = Utils.Take(count, Nod.GetActorsByType(type))
Utils.Do(atk1Actors, function(unit) Utils.Do(atk1Actors, function(unit)
unit.Move(waypoint6.Location) unit.Move(waypoint6.Location)
unit.Move(waypoint7.Location) unit.Move(waypoint7.Location)
@@ -52,7 +52,7 @@ AttackPlayer = function()
Trigger.AfterDelay(DateTime.Seconds(40), function() Trigger.AfterDelay(DateTime.Seconds(40), function()
for type, count in pairs({ ['e1'] = 3, ['e3'] = 2 }) do for type, count in pairs({ ['e1'] = 3, ['e3'] = 2 }) do
atk2Actors = Utils.Take(count, Nod.GetActorsByType(type)) local atk2Actors = Utils.Take(count, Nod.GetActorsByType(type))
Utils.Do(atk2Actors, function(unit) Utils.Do(atk2Actors, function(unit)
unit.Move(waypoint11.Location) unit.Move(waypoint11.Location)
unit.Move(waypoint12.Location) unit.Move(waypoint12.Location)
@@ -65,7 +65,7 @@ AttackPlayer = function()
Trigger.AfterDelay(DateTime.Seconds(80), function() Trigger.AfterDelay(DateTime.Seconds(80), function()
for type, count in pairs({ ['e3'] = 3, ['e4'] = 2 }) do for type, count in pairs({ ['e3'] = 3, ['e4'] = 2 }) do
atk3Actors = Utils.Take(count, Nod.GetActorsByType(type)) local atk3Actors = Utils.Take(count, Nod.GetActorsByType(type))
Utils.Do(atk3Actors, function(unit) Utils.Do(atk3Actors, function(unit)
unit.Move(waypoint6.Location) unit.Move(waypoint6.Location)
unit.Move(waypoint7.Location) unit.Move(waypoint7.Location)
@@ -79,7 +79,7 @@ AttackPlayer = function()
Trigger.AfterDelay(DateTime.Seconds(80), function() Trigger.AfterDelay(DateTime.Seconds(80), function()
for type, count in pairs({ ['e1'] = 3, ['e3'] = 2 }) do for type, count in pairs({ ['e1'] = 3, ['e3'] = 2 }) do
atk4Actors = Utils.Take(count, Nod.GetActorsByType(type)) local atk4Actors = Utils.Take(count, Nod.GetActorsByType(type))
Utils.Do(atk4Actors, function(unit) Utils.Do(atk4Actors, function(unit)
unit.Move(waypoint11.Location) unit.Move(waypoint11.Location)
unit.Move(waypoint12.Location) unit.Move(waypoint12.Location)
@@ -91,7 +91,7 @@ AttackPlayer = function()
end) end)
Trigger.AfterDelay(DateTime.Seconds(80), function() Trigger.AfterDelay(DateTime.Seconds(80), function()
atk5Actors = Utils.Take(2, Nod.GetActorsByType('bggy')) local atk5Actors = Utils.Take(2, Nod.GetActorsByType('bggy'))
Utils.Do(atk5Actors, function(unit) Utils.Do(atk5Actors, function(unit)
unit.Move(waypoint11.Location) unit.Move(waypoint11.Location)
unit.Move(waypoint12.Location) unit.Move(waypoint12.Location)

View File

@@ -91,10 +91,10 @@ GuardBase = function()
end end
ProduceHarvester = function(building) ProduceHarvester = function(building)
if not buildingHarvester then if not BuildingHarvester then
buildingHarvester = true BuildingHarvester = true
building.Build(HarvesterProductionType, function() building.Build(HarvesterProductionType, function()
buildingHarvester = false BuildingHarvester = false
end) end)
end end
end end

View File

@@ -94,10 +94,10 @@ ProduceHarvester = function(building)
if building.IsDead or building.Owner ~= Nod then if building.IsDead or building.Owner ~= Nod then
return return
end end
if not buildingHarvester then if not BuildingHarvester then
buildingHarvester = true BuildingHarvester = true
building.Build(HarvesterProductionType, function() building.Build(HarvesterProductionType, function()
buildingHarvester = false BuildingHarvester = false
end) end)
end end
end end
@@ -158,7 +158,6 @@ ProduceVehicle = function(building)
VehicleAttackGroup[#VehicleAttackGroup + 1] = unit[1] VehicleAttackGroup[#VehicleAttackGroup + 1] = unit[1]
if #VehicleAttackGroup >= VehicleGroupSize[Difficulty] then if #VehicleAttackGroup >= VehicleGroupSize[Difficulty] then
MoveAndHunt(VehicleAttackGroup, Path) MoveAndHunt(VehicleAttackGroup, Path)
VehicleAttackGroup = { } VehicleAttackGroup = { }
Trigger.AfterDelay(VehicleProductionCooldown[Difficulty], function() ProduceArty(building) end) Trigger.AfterDelay(VehicleProductionCooldown[Difficulty], function() ProduceArty(building) end)

View File

@@ -72,7 +72,7 @@ SendWaves = function(counter, Waves)
end end
SendHeli = function(heli) SendHeli = function(heli)
units = Reinforcements.ReinforceWithTransport(Nod, "tran", heli.types, heli.entry, { heli.entry[1] }) local units = Reinforcements.ReinforceWithTransport(Nod, "tran", heli.types, heli.entry, { heli.entry[1] })
Utils.Do(units[2], function(actor) Utils.Do(units[2], function(actor)
actor.Hunt() actor.Hunt()
Trigger.OnIdle(actor, actor.Hunt) Trigger.OnIdle(actor, actor.Hunt)
@@ -84,12 +84,12 @@ SendHeli = function(heli)
end end
MoveInitialArty = function(arty, waypoints) MoveInitialArty = function(arty, waypoints)
units = { arty } local units = { arty }
MoveAndIdle(units, waypoints) MoveAndIdle(units, waypoints)
end end
TankTerror = function(tank) TankTerror = function(tank)
units = { tank } local units = { tank }
MoveAndHunt(units, WaypointGroupVillageLeft) MoveAndHunt(units, WaypointGroupVillageLeft)
end end

View File

@@ -90,10 +90,10 @@ GuardBase = function()
end end
ProduceHarvester = function(building) ProduceHarvester = function(building)
if not buildingHarvester then if not BuildingHarvester then
buildingHarvester = true BuildingHarvester = true
building.Build(HarvesterProductionType, function() building.Build(HarvesterProductionType, function()
buildingHarvester = false BuildingHarvester = false
end) end)
end end
end end

View File

@@ -68,10 +68,10 @@ CheckForHarvester = function()
end end
ProduceHarvester = function(building) ProduceHarvester = function(building)
if not buildingHarvester then if not BuildingHarvester then
buildingHarvester = true BuildingHarvester = true
building.Build(HarvesterProductionType, function() building.Build(HarvesterProductionType, function()
buildingHarvester = false BuildingHarvester = false
end) end)
end end
end end

View File

@@ -119,8 +119,8 @@ SendReinforcementsWave = function(team)
end end
Trigger.OnEnteredFootprint(AbandonedBaseTrigger, function(a, id) Trigger.OnEnteredFootprint(AbandonedBaseTrigger, function(a, id)
if not abandonedBaseTrigger and a.Owner == Nod then if not AbandonedBaseTriggered and a.Owner == Nod then
abandonedBaseTrigger = true AbandonedBaseTriggered = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
FlareCamera = Actor.Create("camera", true, { Owner = Nod, Location = waypoint25.Location }) FlareCamera = Actor.Create("camera", true, { Owner = Nod, Location = waypoint25.Location })
@@ -141,8 +141,8 @@ Trigger.OnEnteredFootprint(AbandonedBaseTrigger, function(a, id)
end) end)
Trigger.OnEnteredFootprint(ReinforcementsTrigger, function(a, id) Trigger.OnEnteredFootprint(ReinforcementsTrigger, function(a, id)
if not reinforcementsTrigger and a.Owner == Nod and a.Type ~= "harv" then if not ReinforcementsTriggered and a.Owner == Nod and a.Type ~= "harv" then
reinforcementsTrigger = true ReinforcementsTriggered = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
Trigger.AfterDelay(DateTime.Seconds(5), function() Trigger.AfterDelay(DateTime.Seconds(5), function()

View File

@@ -68,10 +68,10 @@ CheckForHarvester = function()
end end
ProduceHarvester = function(building) ProduceHarvester = function(building)
if not buildingHarvester then if not BuildingHarvester then
buildingHarvester = true BuildingHarvester = true
building.Build(HarvesterProductionType, function() building.Build(HarvesterProductionType, function()
buildingHarvester = false BuildingHarvester = false
end) end)
end end
end end
@@ -139,23 +139,23 @@ Trigger.OnAllKilledOrCaptured(GDIBase, function()
Utils.Do(GDI.GetGroundAttackers(), IdleHunt) Utils.Do(GDI.GetGroundAttackers(), IdleHunt)
end) end)
Trigger.OnKilled(GDIProc, function(building) Trigger.OnKilled(GDIProc, function()
BuildBuilding(BaseProc, GDICYard) BuildBuilding(BaseProc, GDICYard)
end) end)
Trigger.OnKilled(GDINuke1, function(building) Trigger.OnKilled(GDINuke1, function()
BuildBuilding(BaseNuke1, GDICYard) BuildBuilding(BaseNuke1, GDICYard)
end) end)
Trigger.OnKilled(GDINuke2, function(building) Trigger.OnKilled(GDINuke2, function()
BuildBuilding(BaseNuke2, GDICYard) BuildBuilding(BaseNuke2, GDICYard)
end) end)
Trigger.OnKilled(GDINuke3, function(building) Trigger.OnKilled(GDINuke3, function()
BuildBuilding(BaseNuke3, GDICYard) BuildBuilding(BaseNuke3, GDICYard)
end) end)
Trigger.OnKilled(GDIPyle, function(building) Trigger.OnKilled(GDIPyle, function()
BuildBuilding(InfantryProduction, GDICYard) BuildBuilding(InfantryProduction, GDICYard)
end) end)

View File

@@ -121,32 +121,32 @@ SendReinforcementsWave = function(team)
end end
Trigger.OnEnteredFootprint(Atk1, function(a, id) Trigger.OnEnteredFootprint(Atk1, function(a, id)
if not atk1Trigger and a.Owner == Nod then if not Atk1Triggered and a.Owner == Nod then
atk1Trigger = true Atk1Triggered = true
SendAttackWave(GDI5) SendAttackWave(GDI5)
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
end end
end) end)
Trigger.OnEnteredFootprint(Atk2, function(a, id) Trigger.OnEnteredFootprint(Atk2, function(a, id)
if not atk2Trigger and a.Owner == Nod then if not Atk2Triggered and a.Owner == Nod then
atk2Trigger = true Atk2Triggered = true
SendAttackWave(GDI4) SendAttackWave(GDI4)
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
end end
end) end)
Trigger.OnEnteredFootprint(Atk3, function(a, id) Trigger.OnEnteredFootprint(Atk3, function(a, id)
if not atk3Trigger and a.Owner == Nod then if not Atk3Triggered and a.Owner == Nod then
atk3Trigger = true Atk3Triggered = true
SendAttackWave(GDI6) SendAttackWave(GDI6)
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
end end
end) end)
Trigger.OnEnteredFootprint(Atk4, function(a, id) Trigger.OnEnteredFootprint(Atk4, function(a, id)
if not atk4Trigger and a.Owner == Nod then if not Atk4Triggered and a.Owner == Nod then
atk4Trigger = true Atk4Triggered = true
SendReinforcementsWave(GDI1) SendReinforcementsWave(GDI1)
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
end end

View File

@@ -89,10 +89,10 @@ GuardBase = function()
end end
ProduceHarvester = function(building) ProduceHarvester = function(building)
if not buildingHarvester then if not BuildingHarvester then
buildingHarvester = true BuildingHarvester = true
building.Build(HarvesterProductionType, function() building.Build(HarvesterProductionType, function()
buildingHarvester = false BuildingHarvester = false
end) end)
end end
end end
@@ -158,27 +158,27 @@ Trigger.OnAllKilledOrCaptured(GDIBase, function()
Utils.Do(GDI.GetGroundAttackers(), IdleHunt) Utils.Do(GDI.GetGroundAttackers(), IdleHunt)
end) end)
Trigger.OnKilled(GDIProc, function(building) Trigger.OnKilled(GDIProc, function()
BuildBuilding(BaseProc, GDICYard) BuildBuilding(BaseProc, GDICYard)
end) end)
Trigger.OnKilled(GDINuke1, function(building) Trigger.OnKilled(GDINuke1, function()
BuildBuilding(BaseNuke1, GDICYard) BuildBuilding(BaseNuke1, GDICYard)
end) end)
Trigger.OnKilled(GDINuke2, function(building) Trigger.OnKilled(GDINuke2, function()
BuildBuilding(BaseNuke2, GDICYard) BuildBuilding(BaseNuke2, GDICYard)
end) end)
Trigger.OnKilled(GDINuke3, function(building) Trigger.OnKilled(GDINuke3, function()
BuildBuilding(BaseNuke3, GDICYard) BuildBuilding(BaseNuke3, GDICYard)
end) end)
Trigger.OnKilled(GDINuke4, function(building) Trigger.OnKilled(GDINuke4, function()
BuildBuilding(BaseNuke4, GDICYard) BuildBuilding(BaseNuke4, GDICYard)
end) end)
Trigger.OnKilled(GDIPyle, function(building) Trigger.OnKilled(GDIPyle, function()
BuildBuilding(InfantryProduction, GDICYard) BuildBuilding(InfantryProduction, GDICYard)
end) end)

View File

@@ -89,10 +89,10 @@ GuardBase = function()
end end
ProduceHarvester = function(building) ProduceHarvester = function(building)
if not buildingHarvester then if not BuildingHarvester then
buildingHarvester = true BuildingHarvester = true
building.Build(HarvesterProductionType, function() building.Build(HarvesterProductionType, function()
buildingHarvester = false BuildingHarvester = false
end) end)
end end
end end
@@ -158,30 +158,30 @@ Trigger.OnAllKilledOrCaptured(GDIBase, function()
Utils.Do(GDI.GetGroundAttackers(), IdleHunt) Utils.Do(GDI.GetGroundAttackers(), IdleHunt)
end) end)
Trigger.OnKilled(GDIProc, function(building) Trigger.OnKilled(GDIProc, function()
BuildBuilding(BaseProc, GDICYard) BuildBuilding(BaseProc, GDICYard)
end) end)
Trigger.OnKilled(GDINuke1, function(building) Trigger.OnKilled(GDINuke1, function()
BuildBuilding(BaseNuke1, GDICYard) BuildBuilding(BaseNuke1, GDICYard)
end) end)
Trigger.OnKilled(GDINuke2, function(building) Trigger.OnKilled(GDINuke2, function()
BuildBuilding(BaseNuke2, GDICYard) BuildBuilding(BaseNuke2, GDICYard)
end) end)
Trigger.OnKilled(GDINuke3, function(building) Trigger.OnKilled(GDINuke3, function()
BuildBuilding(BaseNuke3, GDICYard) BuildBuilding(BaseNuke3, GDICYard)
end) end)
Trigger.OnKilled(GDINuke4, function(building) Trigger.OnKilled(GDINuke4, function()
BuildBuilding(BaseNuke4, GDICYard) BuildBuilding(BaseNuke4, GDICYard)
end) end)
Trigger.OnKilled(GDIPyle, function(building) Trigger.OnKilled(GDIPyle, function()
BuildBuilding(InfantryProduction, GDICYard) BuildBuilding(InfantryProduction, GDICYard)
end) end)
Trigger.OnKilled(GDIWeap, function(building) Trigger.OnKilled(GDIWeap, function()
BuildBuilding(VehicleProduction, GDICYard) BuildBuilding(VehicleProduction, GDICYard)
end) end)

View File

@@ -93,10 +93,10 @@ GuardBase = function()
end end
ProduceHarvester = function(building) ProduceHarvester = function(building)
if not buildingHarvester then if not BuildingHarvester then
buildingHarvester = true BuildingHarvester = true
building.Build(HarvesterProductionType, function() building.Build(HarvesterProductionType, function()
buildingHarvester = false BuildingHarvester = false
end) end)
end end
end end
@@ -162,30 +162,30 @@ Trigger.OnAllKilledOrCaptured(GDIBase, function()
Utils.Do(GDI.GetGroundAttackers(), IdleHunt) Utils.Do(GDI.GetGroundAttackers(), IdleHunt)
end) end)
Trigger.OnKilled(GDIProc, function(building) Trigger.OnKilled(GDIProc, function()
BuildBuilding(BaseProc, GDICYard) BuildBuilding(BaseProc, GDICYard)
end) end)
Trigger.OnKilled(GDINuke1, function(building) Trigger.OnKilled(GDINuke1, function()
BuildBuilding(BaseNuke1, GDICYard) BuildBuilding(BaseNuke1, GDICYard)
end) end)
Trigger.OnKilled(GDINuke2, function(building) Trigger.OnKilled(GDINuke2, function()
BuildBuilding(BaseNuke2, GDICYard) BuildBuilding(BaseNuke2, GDICYard)
end) end)
Trigger.OnKilled(GDINuke3, function(building) Trigger.OnKilled(GDINuke3, function()
BuildBuilding(BaseNuke3, GDICYard) BuildBuilding(BaseNuke3, GDICYard)
end) end)
Trigger.OnKilled(GDINuke4, function(building) Trigger.OnKilled(GDINuke4, function()
BuildBuilding(BaseNuke4, GDICYard) BuildBuilding(BaseNuke4, GDICYard)
end) end)
Trigger.OnKilled(GDIPyle, function(building) Trigger.OnKilled(GDIPyle, function()
BuildBuilding(InfantryProduction, GDICYard) BuildBuilding(InfantryProduction, GDICYard)
end) end)
Trigger.OnKilled(GDIWeap, function(building) Trigger.OnKilled(GDIWeap, function()
BuildBuilding(VehicleProduction, GDICYard) BuildBuilding(VehicleProduction, GDICYard)
end) end)