added hunt to every movement
This commit is contained in:
@@ -74,7 +74,7 @@ end
|
|||||||
DfndTriggerFunction = function()
|
DfndTriggerFunction = function()
|
||||||
local list = GDI.GetGroundAttackers()
|
local list = GDI.GetGroundAttackers()
|
||||||
Utils.Do(list, function(unit)
|
Utils.Do(list, function(unit)
|
||||||
unit.Hunt()
|
IdleHunt(unit)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -127,30 +127,35 @@ Atk1Movement = function(unit)
|
|||||||
Utils.Do(Atk1Waypoints, function(waypoint)
|
Utils.Do(Atk1Waypoints, function(waypoint)
|
||||||
unit.AttackMove(waypoint.Location)
|
unit.AttackMove(waypoint.Location)
|
||||||
end)
|
end)
|
||||||
|
IdleHunt(unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
Atk2Movement = function(unit)
|
Atk2Movement = function(unit)
|
||||||
Utils.Do(Atk2Waypoints, function(waypoint)
|
Utils.Do(Atk2Waypoints, function(waypoint)
|
||||||
unit.AttackMove(waypoint.Location)
|
unit.AttackMove(waypoint.Location)
|
||||||
end)
|
end)
|
||||||
|
IdleHunt(unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
Atk3Movement = function(unit)
|
Atk3Movement = function(unit)
|
||||||
Utils.Do(Atk3Waypoints, function(waypoint)
|
Utils.Do(Atk3Waypoints, function(waypoint)
|
||||||
unit.AttackMove(waypoint.Location)
|
unit.AttackMove(waypoint.Location)
|
||||||
end)
|
end)
|
||||||
|
IdleHunt(unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
Atk4Movement = function(unit)
|
Atk4Movement = function(unit)
|
||||||
Utils.Do(Atk4Waypoints, function(waypoint)
|
Utils.Do(Atk4Waypoints, function(waypoint)
|
||||||
unit.AttackMove(waypoint.Location)
|
unit.AttackMove(waypoint.Location)
|
||||||
end)
|
end)
|
||||||
|
IdleHunt(unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
Pat1Movement = function(unit)
|
Pat1Movement = function(unit)
|
||||||
Utils.Do(Pat1Waypoints, function(waypoint)
|
Utils.Do(Pat1Waypoints, function(waypoint)
|
||||||
unit.Move(waypoint.Location)
|
unit.Move(waypoint.Location)
|
||||||
end)
|
end)
|
||||||
|
IdleHunt(unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
WorldLoaded = function()
|
WorldLoaded = function()
|
||||||
@@ -246,7 +251,6 @@ checkProduction = function(player)
|
|||||||
for i = 1, unitsToProduce, 1 do
|
for i = 1, unitsToProduce, 1 do
|
||||||
UnitsType[i] = UnitToRebuild
|
UnitsType[i] = UnitToRebuild
|
||||||
end
|
end
|
||||||
|
|
||||||
Barracks.Build(UnitsType)
|
Barracks.Build(UnitsType)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -262,3 +266,9 @@ getStartUnits = function()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
IdleHunt = function(unit)
|
||||||
|
if not unit.IsDead then
|
||||||
|
Trigger.OnIdle(unit, unit.Hunt)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -74,26 +74,26 @@ end
|
|||||||
HuntTriggerFunction = function()
|
HuntTriggerFunction = function()
|
||||||
local list = GDI.GetGroundAttackers()
|
local list = GDI.GetGroundAttackers()
|
||||||
Utils.Do(list, function(unit)
|
Utils.Do(list, function(unit)
|
||||||
unit.Hunt()
|
IdleHunt(unit)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
Gdi5Movement = function(unit)
|
Gdi5Movement = function(unit)
|
||||||
unit.Hunt()
|
IdleHunt(unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
Gdi1Movement = function(unit)
|
Gdi1Movement = function(unit)
|
||||||
Utils.Do(Gdi1Waypoints, function(waypoint)
|
Utils.Do(Gdi1Waypoints, function(waypoint)
|
||||||
unit.AttackMove(waypoint.Location)
|
unit.AttackMove(waypoint.Location)
|
||||||
end)
|
end)
|
||||||
unit.Hunt()
|
IdleHunt(unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
Gdi3Movement = function(unit)
|
Gdi3Movement = function(unit)
|
||||||
Utils.Do(Gdi3Waypoints, function(waypoint)
|
Utils.Do(Gdi3Waypoints, function(waypoint)
|
||||||
unit.AttackMove(waypoint.Location)
|
unit.AttackMove(waypoint.Location)
|
||||||
end)
|
end)
|
||||||
unit.Hunt()
|
IdleHunt(unit)
|
||||||
end
|
end
|
||||||
|
|
||||||
WorldLoaded = function()
|
WorldLoaded = function()
|
||||||
@@ -232,4 +232,10 @@ end
|
|||||||
InsertNodUnits = function()
|
InsertNodUnits = function()
|
||||||
Reinforcements.Reinforce(Nod, NodUnits, { UnitsEntry.Location, UnitsRally.Location }, 15)
|
Reinforcements.Reinforce(Nod, NodUnits, { UnitsEntry.Location, UnitsRally.Location }, 15)
|
||||||
Reinforcements.Reinforce(Nod, { "mcv" }, { McvEntry.Location, McvRally.Location })
|
Reinforcements.Reinforce(Nod, { "mcv" }, { McvEntry.Location, McvRally.Location })
|
||||||
|
end
|
||||||
|
|
||||||
|
IdleHunt = function(unit)
|
||||||
|
if not unit.IsDead then
|
||||||
|
Trigger.OnIdle(unit, unit.Hunt)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user