Move IdleHunt function to campaign-global.lua
This commit is contained in:
@@ -23,14 +23,6 @@ else
|
||||
TanyaType = "e7.noautotarget"
|
||||
end
|
||||
|
||||
IdleHunt = function(actor)
|
||||
Trigger.OnIdle(actor, function(a)
|
||||
if a.IsInWorld then
|
||||
a.Hunt()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
ProduceUnits = function(factory, count)
|
||||
if ussr.IsProducing("e1") then
|
||||
Trigger.AfterDelay(DateTime.Seconds(5), function() ProduceUnits(factory, count) end)
|
||||
|
||||
@@ -34,14 +34,6 @@ else
|
||||
TanyaType = "e7.noautotarget"
|
||||
end
|
||||
|
||||
IdleHunt = function(actor)
|
||||
Trigger.OnIdle(actor, function(a)
|
||||
if a.IsInWorld then
|
||||
a.Hunt()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
Tick = function()
|
||||
if TeleportJeepCamera and Jeep.IsInWorld then
|
||||
JeepCamera.Teleport(Jeep.Location)
|
||||
|
||||
@@ -93,8 +93,6 @@ BuildBuilding = function(building)
|
||||
end)
|
||||
end
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
SetupAttackGroup = function()
|
||||
local units = { }
|
||||
|
||||
|
||||
@@ -26,8 +26,6 @@ HoldProduction = true
|
||||
BuildVehicles = true
|
||||
TrainInfantry = true
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
SetupAttackGroup = function()
|
||||
local units = { }
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@ SovietAircraftType = { "yak" }
|
||||
Planes = { }
|
||||
SovietProduction = { Conyard, USSRBarracks, USSRWarFactory }
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
ProductionInterval =
|
||||
{
|
||||
easy = DateTime.Seconds(25),
|
||||
|
||||
@@ -15,8 +15,6 @@ SovietAircraftType = { "yak" }
|
||||
Planes = { }
|
||||
SovietProduction = { Conyard, USSRBarracks, USSRWarFactory }
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
ProductionInterval =
|
||||
{
|
||||
easy = DateTime.Seconds(25),
|
||||
|
||||
@@ -158,8 +158,6 @@ ProduceAircraft = function()
|
||||
end)
|
||||
end
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
SendAttack = function(units, path)
|
||||
Utils.Do(units, function(unit)
|
||||
unit.Patrol(path, false)
|
||||
|
||||
@@ -170,8 +170,6 @@ ProduceAircraft = function()
|
||||
end)
|
||||
end
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
SendAttack = function(units, path)
|
||||
Utils.Do(units, function(unit)
|
||||
unit.Patrol(path, false)
|
||||
|
||||
@@ -28,8 +28,6 @@ ProductionInterval =
|
||||
hard = DateTime.Seconds(5)
|
||||
}
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
ParadropDelay = { DateTime.Seconds(30), DateTime.Minutes(1) }
|
||||
ParadropWaves = 6
|
||||
ParadropLZs = { ParaLZ1.CenterPosition, ParaLZ2.CenterPosition, ParaLZ3.CenterPosition, ParaLZ4.CenterPosition }
|
||||
|
||||
@@ -13,8 +13,6 @@ SovietVehicles = { "3tnk", "3tnk", "v2rl" }
|
||||
SovietAircraftType = { "mig" }
|
||||
Migs = { }
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
GroundWavesUpgradeDelay = DateTime.Minutes(12)
|
||||
GroundAttackUnitType = "Normal"
|
||||
GroundAttackUnits =
|
||||
|
||||
@@ -13,8 +13,6 @@ SovietVehicles = { "3tnk", "3tnk", "v2rl" }
|
||||
SovietAircraftType = { "mig" }
|
||||
Migs = { }
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
GroundWavesUpgradeDelay = DateTime.Minutes(12)
|
||||
GroundAttackUnitType = "Normal"
|
||||
GroundAttackUnits =
|
||||
|
||||
@@ -58,8 +58,6 @@ SovietAircraftType = { "yak" }
|
||||
SovietSSType = { "ss" }
|
||||
VehicleUnits = { "3tnk", "3tnk", "3tnk", "v2rl" }
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
SendInfantryAttackGroup = function()
|
||||
if #InfantryAttackGroup < InfantryAttackGroupSize then
|
||||
return
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
the License, or (at your option) any later version. For more
|
||||
information, see COPYING.
|
||||
]]
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
StartAnts = { StartAnt1, StartAnt2 }
|
||||
Hive1Killzone = { CPos.New(80,83), CPos.New(81,83), CPos.New(82,83), CPos.New(83,83), CPos.New(84,83), CPos.New(85,83), CPos.New(85,84), CPos.New(85,85), CPos.New(85,86), CPos.New(85,87), CPos.New(84,87), CPos.New(83,87), CPos.New(82,87), CPos.New(81,87), CPos.New(80,87), CPos.New(80,86), CPos.New(80,85), CPos.New(80,84) }
|
||||
Hive2Killzone = { CPos.New(84,50), CPos.New(85,50), CPos.New(86,50), CPos.New(87,50), CPos.New(88,50), CPos.New(89,50), CPos.New(89,51), CPos.New(89,52), CPos.New(89,53), CPos.New(89,54), CPos.New(88,54), CPos.New(87,54), CPos.New(86,54), CPos.New(85,54), CPos.New(84,54), CPos.New(84,53), CPos.New(84,52), CPos.New(84,51) }
|
||||
|
||||
@@ -72,14 +72,6 @@ ReinforcementsDelay = DateTime.Minutes(16)
|
||||
ReinforcementsUnits = { "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "1tnk", "1tnk", "jeep", "e1",
|
||||
"e1", "e1", "e1", "e3", "e3", "mcv", "truk", "truk", "truk", "truk", "truk", "truk" }
|
||||
|
||||
IdleHunt = function(actor)
|
||||
Trigger.OnIdle(actor, function(a)
|
||||
if a.IsInWorld then
|
||||
a.Hunt()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
SpawnAlliedReinforcements = function()
|
||||
if allies2.IsLocalPlayer then
|
||||
UserInterface.SetMissionText("")
|
||||
|
||||
@@ -184,13 +184,6 @@ SendSovietParadrop = function()
|
||||
Trigger.AfterDelay(sovietParadropTicks, SendSovietParadrop)
|
||||
end
|
||||
|
||||
IdleHunt = function(unit)
|
||||
Trigger.OnIdle(unit, unit.Hunt)
|
||||
Trigger.OnCapture(unit, function()
|
||||
Trigger.ClearAll(unit)
|
||||
end)
|
||||
end
|
||||
|
||||
AircraftTargets = function(yak)
|
||||
local targets = Utils.Where(Map.ActorsInWorld, function(a)
|
||||
return (a.Owner == allies1 or a.Owner == allies2) and a.HasProperty("Health") and yak.CanTarget(a)
|
||||
|
||||
@@ -52,8 +52,6 @@ lstReinforcements =
|
||||
}
|
||||
}
|
||||
|
||||
IdleHunt = function(actor) if not actor.IsDead then Trigger.OnIdle(actor, actor.Hunt) end end
|
||||
|
||||
VIPs = { }
|
||||
MissionStart = function()
|
||||
FlareBoy.Move(LightFlare.Location)
|
||||
|
||||
@@ -22,7 +22,6 @@ NWVillage = { NWChurch, NWHouse1, NWHouse2, NWHouse3 }
|
||||
SWVillage = { SWChurch, SWHouse1, SWHouse2, SWHouse3, SWHouse4 }
|
||||
MiddleVillage = { MiddleChurch, MiddleHouse1, MiddleHouse2, MiddleHouse3, MiddleHouse4 }
|
||||
EastVillage = { EastChurch, EastHouse1, EastHouse2, EastHouse3 }
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
MissionStart = function()
|
||||
Reinforcements.Reinforce(Allies, AlliedReinforcementsA, { AlliedSpawn.Location, AlliedBase.Location }, 5)
|
||||
|
||||
@@ -37,7 +37,6 @@ NorthWaterTeam = { "1tnk", "1tnk", "1tnk", "2tnk", "2tnk" }
|
||||
BoatofMammoths = { "4tnk", "4tnk", "4tnk", "4tnk", "4tnk" }
|
||||
EvacuateFootprint = { CPos.New(93,92), CPos.New(94,92), CPos.New(95,92), CPos.New(96,92), CPos.New(97,92), CPos.New(98,92), CPos.New(99,92) }
|
||||
TimerTicks = DateTime.Minutes(54)
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
AlliedReinforcements = function()
|
||||
Reinforcements.Reinforce(Greece, StartUnits, { AlliesEntry.Location, AlliesRally.Location }, 6)
|
||||
|
||||
@@ -216,10 +216,6 @@ InsertSpies = function()
|
||||
end
|
||||
end
|
||||
|
||||
IdleHunt = function(unit)
|
||||
Trigger.OnIdle(unit, unit.Hunt)
|
||||
end
|
||||
|
||||
StopHunt = function(unit)
|
||||
if not unit.IsDead then
|
||||
unit.Stop()
|
||||
|
||||
@@ -62,14 +62,6 @@ GroundPatrolUnits =
|
||||
{ "3tnk", "3tnk" }
|
||||
}
|
||||
|
||||
IdleHunt = function(actor)
|
||||
Trigger.OnIdle(actor, function(a)
|
||||
if a.IsInWorld then
|
||||
a.Hunt()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
ParadropSovietUnits = function()
|
||||
local powerproxy = Actor.Create("powerproxy.paratroopers", false, { Owner = soviets })
|
||||
local aircraft = powerproxy.TargetParatroopers(MCVDeployLocation.CenterPosition, Angle.New(812))
|
||||
|
||||
@@ -20,8 +20,6 @@ SovietSquad = { "e1", "e1", "e1", "e4", "e4" }
|
||||
V2Squad = { "v2rl", "v2rl" }
|
||||
SubEscapePath = { SubPath1, SubPath2, SubPath3 }
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
MissionStart = function()
|
||||
LZCamera = Actor.Create("camera", true, { Owner = Greece, Location = LZ.Location })
|
||||
Chalk1.TargetParatroopers(LZ.CenterPosition, Angle.New(740))
|
||||
|
||||
@@ -33,8 +33,6 @@ GroundWavesDelays =
|
||||
hard = 2
|
||||
}
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
SendBGAttackGroup = function()
|
||||
if #BGAttackGroup < BGAttackGroupSize then
|
||||
return
|
||||
|
||||
@@ -356,8 +356,6 @@ SpyTruckDrive = function()
|
||||
end)
|
||||
end
|
||||
|
||||
IdleHunt = function(actor) if not actor.IsDead then Trigger.OnIdle(actor, actor.Hunt) end end
|
||||
|
||||
PrisonEscape = function()
|
||||
local alarmed
|
||||
Trigger.OnEnteredFootprint(PrisonAlarm, function(unit, id)
|
||||
|
||||
@@ -20,8 +20,6 @@ MCVReinforcements =
|
||||
hard = { "1tnk", "1tnk", "mcv" }
|
||||
}
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
SetupTriggers = function()
|
||||
Trigger.OnEnteredFootprint(MammothStart, function(actor, mammothcam)
|
||||
if actor.Owner == Greece then
|
||||
|
||||
@@ -26,7 +26,6 @@ AlliedInfantry = { "e1", "e1", "e1", "e3" }
|
||||
AttackGroupSize = 4
|
||||
InfantryDelay = DateTime.Seconds(10)
|
||||
IdlingUnits = { }
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
MissionStart = function()
|
||||
LZCamera = Actor.Create("camera", true, { Owner = USSR, Location = LZ.Location })
|
||||
|
||||
@@ -12,8 +12,6 @@ Squad2 = { SecondSquad1, SecondSquad2, SecondSquad3 }
|
||||
PatrolMammothPath = { Patrol1.Location, Patrol2.Location, Patrol3.Location, Patrol4.Location, Patrol5.Location, Patrol6.Location, Patrol7.Location }
|
||||
ConvoyEscape = { CPos.New(113, 42), CPos.New(117, 71) }
|
||||
|
||||
IdleHunt = function(actor) if not actor.IsDead then Trigger.OnIdle(actor, actor.Hunt) end end
|
||||
|
||||
ConvoyUnits =
|
||||
{
|
||||
easy = { { "e2", "e2", "e2", "truk", "truk", "truk" }, { "3tnk", "3tnk", "truk", "truk", "truk" } },
|
||||
|
||||
@@ -23,8 +23,6 @@ ProductionInterval =
|
||||
hard = DateTime.Seconds(11)
|
||||
}
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
ParadropDelays =
|
||||
{
|
||||
easy = { DateTime.Minutes(3), DateTime.Minutes(4) },
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
the License, or (at your option) any later version. For more
|
||||
information, see COPYING.
|
||||
]]
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
IdlingUnits = function()
|
||||
local lazyUnits = Greece.GetGroundAttackers()
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
the License, or (at your option) any later version. For more
|
||||
information, see COPYING.
|
||||
]]
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
IdlingUnits = function()
|
||||
local lazyUnits = Greece.GetGroundAttackers()
|
||||
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
the License, or (at your option) any later version. For more
|
||||
information, see COPYING.
|
||||
]]
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
IdlingUnits = function()
|
||||
local lazyUnits = Utils.Where(Map.ActorsInWorld, function(actor)
|
||||
return actor.HasProperty("Hunt") and actor.Owner == Greece end)
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
the License, or (at your option) any later version. For more
|
||||
information, see COPYING.
|
||||
]]
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
IdlingUnits = function()
|
||||
local lazyUnits = enemy.GetGroundAttackers()
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
the License, or (at your option) any later version. For more
|
||||
information, see COPYING.
|
||||
]]
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
IdlingUnits = function()
|
||||
local lazyUnits = enemy.GetGroundAttackers()
|
||||
|
||||
|
||||
@@ -56,8 +56,6 @@ AlliedVehicles =
|
||||
Upgraded = { "2tnk", "arty" }
|
||||
}
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
WTransWaves = function()
|
||||
local way = Utils.Random(WTransWays)
|
||||
local units = Utils.Random(WTransUnits)
|
||||
|
||||
@@ -56,8 +56,6 @@ AlliedVehicles =
|
||||
Upgraded = { "2tnk", "arty" }
|
||||
}
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
WTransWaves = function()
|
||||
local way = Utils.Random(WTransWays)
|
||||
local units = Utils.Random(WTransUnits)
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
the License, or (at your option) any later version. For more
|
||||
information, see COPYING.
|
||||
]]
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
AttackGroup = { }
|
||||
AttackGroupSize = 12
|
||||
AlliedInfantry = { "e1", "e3" }
|
||||
|
||||
@@ -73,8 +73,6 @@ ProductionDelays =
|
||||
hard = 1
|
||||
}
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
SendCruiser = function()
|
||||
if NavalYard2.IsDead or NavalYard2.Owner ~= Greece then
|
||||
return
|
||||
|
||||
@@ -76,8 +76,6 @@ ProductionDelays =
|
||||
hard = 1
|
||||
}
|
||||
|
||||
IdleHunt = function(unit) if not unit.IsDead then Trigger.OnIdle(unit, unit.Hunt) end end
|
||||
|
||||
SendCruiser = function()
|
||||
if NavalYard2.IsDead or NavalYard2.Owner ~= Greece then
|
||||
return
|
||||
|
||||
@@ -37,14 +37,6 @@ TanyaTrigger = { CPos.New(59, 43), CPos.New(60, 43), CPos.New(61, 43), CPos.New(
|
||||
GreeceHarvestersAreDead = false
|
||||
AlloyFacilityDestroyed = false
|
||||
|
||||
IdleHunt = function(actor)
|
||||
Trigger.OnIdle(actor, function(a)
|
||||
if a.IsInWorld then
|
||||
a.Hunt()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
WorldLoaded = function()
|
||||
|
||||
--Players Setup
|
||||
|
||||
@@ -182,14 +182,6 @@ FinishTimer = function()
|
||||
Trigger.AfterDelay(DateTime.Seconds(10), function() UserInterface.SetMissionText("") end)
|
||||
end
|
||||
|
||||
IdleHunt = function(unit)
|
||||
Trigger.OnIdle(unit, function(a)
|
||||
if a.IsInWorld then
|
||||
a.Hunt()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
SendSovietParadrops = function(table)
|
||||
local aircraft = powerproxy.TargetParatroopers(table[2].CenterPosition, table[1])
|
||||
Utils.Do(aircraft, function(a)
|
||||
|
||||
@@ -43,14 +43,6 @@ ParaWaves =
|
||||
{ delay = AttackTicks * 3, type = "SovietSquad", target = SovietParaDrop1 }
|
||||
}
|
||||
|
||||
IdleHunt = function(unit)
|
||||
Trigger.OnIdle(unit, function(a)
|
||||
if a.IsInWorld then
|
||||
a.Hunt()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
GuardHarvester = function(unit, harvester)
|
||||
if not unit.IsDead then
|
||||
unit.Stop()
|
||||
|
||||
Reference in New Issue
Block a user