Merge pull request #12198 from abcdefg30/hijack
Fix soviet units not stopping to hunt after being captured in Exodus
This commit is contained in:
@@ -72,6 +72,10 @@ MECH:
|
|||||||
Buildable:
|
Buildable:
|
||||||
Prerequisites: ~disabled
|
Prerequisites: ~disabled
|
||||||
|
|
||||||
|
HIJACKER:
|
||||||
|
Buildable:
|
||||||
|
Prerequisites: ~disabled
|
||||||
|
|
||||||
SPEN:
|
SPEN:
|
||||||
Buildable:
|
Buildable:
|
||||||
Prerequisites: ~disabled
|
Prerequisites: ~disabled
|
||||||
|
|||||||
@@ -139,17 +139,18 @@ end
|
|||||||
|
|
||||||
SovietGroupSize = 5
|
SovietGroupSize = 5
|
||||||
SpawnSovietUnits = function()
|
SpawnSovietUnits = function()
|
||||||
local spawnPoint = Utils.Random(SovietEntryPoints)
|
|
||||||
local rallyPoint = Utils.Random(SovietRallyPoints)
|
|
||||||
local route = { spawnPoint.Location, rallyPoint.Location }
|
|
||||||
|
|
||||||
local units = SovietUnits1
|
local units = SovietUnits1
|
||||||
if DateTime.GameTime >= SovietUnits2Ticks[Difficulty] then
|
if DateTime.GameTime >= SovietUnits2Ticks[Difficulty] then
|
||||||
units = SovietUnits2
|
units = SovietUnits2
|
||||||
end
|
end
|
||||||
|
|
||||||
local unit = { Utils.Random(units) }
|
local unitType = Utils.Random(units)
|
||||||
Reinforcements.Reinforce(soviets, unit, route)
|
local spawnPoint = Utils.Random(SovietEntryPoints)
|
||||||
|
local rallyPoint = Utils.Random(SovietRallyPoints)
|
||||||
|
local actor = Actor.Create(unitType, true, { Owner = soviets, Location = spawnPoint.Location })
|
||||||
|
actor.AttackMove(rallyPoint.Location)
|
||||||
|
IdleHunt(actor)
|
||||||
|
|
||||||
local delay = math.max(attackAtFrame - 5, minAttackAtFrame)
|
local delay = math.max(attackAtFrame - 5, minAttackAtFrame)
|
||||||
Trigger.AfterDelay(delay, SpawnSovietUnits)
|
Trigger.AfterDelay(delay, SpawnSovietUnits)
|
||||||
@@ -184,24 +185,9 @@ end
|
|||||||
|
|
||||||
IdleHunt = function(unit)
|
IdleHunt = function(unit)
|
||||||
Trigger.OnIdle(unit, unit.Hunt)
|
Trigger.OnIdle(unit, unit.Hunt)
|
||||||
end
|
Trigger.OnCapture(unit, function()
|
||||||
|
Trigger.ClearAll(unit)
|
||||||
ManageSovietUnits = function()
|
|
||||||
Utils.Do(SovietRallyPoints, function(rallyPoint)
|
|
||||||
local radius = WDist.FromCells(8)
|
|
||||||
local units = Map.ActorsInCircle(rallyPoint.CenterPosition, radius, function(actor)
|
|
||||||
return actor.Owner == soviets and actor.HasProperty("Hunt")
|
|
||||||
end)
|
|
||||||
|
|
||||||
if #units > SovietGroupSize then
|
|
||||||
Utils.Do(units, IdleHunt)
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local scatteredUnits = Utils.Where(soviets.GetGroundAttackers(), function(unit)
|
|
||||||
return not Map.IsNamedActor(unit) and unit.IsIdle and unit.HasProperty("Hunt")
|
|
||||||
end)
|
|
||||||
Utils.Do(scatteredUnits, IdleHunt)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
AircraftTargets = function()
|
AircraftTargets = function()
|
||||||
@@ -294,7 +280,6 @@ end
|
|||||||
|
|
||||||
Tick = function()
|
Tick = function()
|
||||||
if DateTime.GameTime % 100 == 0 then
|
if DateTime.GameTime % 100 == 0 then
|
||||||
ManageSovietUnits()
|
|
||||||
ManageSovietAircraft()
|
ManageSovietAircraft()
|
||||||
|
|
||||||
Utils.Do(humans, function(player)
|
Utils.Do(humans, function(player)
|
||||||
|
|||||||
Reference in New Issue
Block a user