Convert all spaces to tabs in the ts shellmap script

This commit is contained in:
abcdefg30
2019-09-13 11:03:29 +02:00
committed by teinarss
parent c7784cbc8e
commit 2d304efb73

View File

@@ -25,115 +25,115 @@ VGForceInterval = 15
ProducedUnitTypes = ProducedUnitTypes =
{ {
{ nodhand1, { "e1", "e3" } }, { nodhand1, { "e1", "e3" } },
{ gdibar1, { "e1", "e2" } } { gdibar1, { "e1", "e2" } }
} }
ProduceUnits = function(t) ProduceUnits = function(t)
local factory = t[1] local factory = t[1]
if not factory.IsDead then if not factory.IsDead then
local unitType = t[2][Utils.RandomInteger(1, #t[2] + 1)] local unitType = t[2][Utils.RandomInteger(1, #t[2] + 1)]
factory.Wait(Actor.BuildTime(unitType)) factory.Wait(Actor.BuildTime(unitType))
factory.Produce(unitType) factory.Produce(unitType)
factory.CallFunc(function() ProduceUnits(t) end) factory.CallFunc(function() ProduceUnits(t) end)
end end
end end
SetupFactories = function() SetupFactories = function()
Utils.Do(ProducedUnitTypes, function(pair) Utils.Do(ProducedUnitTypes, function(pair)
Trigger.OnProduction(pair[1], function(_, a) BindActorTriggers(a) end) Trigger.OnProduction(pair[1], function(_, a) BindActorTriggers(a) end)
end) end)
end end
SetupInvulnerability = function() SetupInvulnerability = function()
Utils.Do(Map.NamedActors, function(actor) Utils.Do(Map.NamedActors, function(actor)
if actor.HasProperty("AcceptsCondition") and actor.AcceptsCondition("unkillable") then if actor.HasProperty("AcceptsCondition") and actor.AcceptsCondition("unkillable") then
actor.GrantCondition("unkillable") actor.GrantCondition("unkillable")
end end
end) end)
end end
SendNodInfantry = function() SendNodInfantry = function()
local units = Reinforcements.Reinforce(nod, NForce, NForcePath, NForceInterval) local units = Reinforcements.Reinforce(nod, NForce, NForcePath, NForceInterval)
Utils.Do(units, function(unit) Utils.Do(units, function(unit)
BindActorTriggers(unit) BindActorTriggers(unit)
if unit.HasProperty("AttackMove") then if unit.HasProperty("AttackMove") then
unit.AttackMove(GDIBase.Location) unit.AttackMove(GDIBase.Location)
else else
unit.Move(GDIBase.Location) unit.Move(GDIBase.Location)
end end
end) end)
Trigger.AfterDelay(DateTime.Seconds(60), SendNodInfantry) Trigger.AfterDelay(DateTime.Seconds(60), SendNodInfantry)
end end
SendNodVehicles = function() SendNodVehicles = function()
local units = Reinforcements.Reinforce(nod, VNForce, VNForcePath, VNForceInterval) local units = Reinforcements.Reinforce(nod, VNForce, VNForcePath, VNForceInterval)
Utils.Do(units, function(unit) Utils.Do(units, function(unit)
BindActorTriggers(unit) BindActorTriggers(unit)
if unit.HasProperty("AttackMove") then if unit.HasProperty("AttackMove") then
unit.AttackMove(GDIBase.Location) unit.AttackMove(GDIBase.Location)
else else
unit.Move(GDIBase.Location) unit.Move(GDIBase.Location)
end end
end) end)
Trigger.AfterDelay(DateTime.Seconds(110), SendNodVehicles) Trigger.AfterDelay(DateTime.Seconds(110), SendNodVehicles)
end end
SendGDIInfantry = function() SendGDIInfantry = function()
local units = Reinforcements.Reinforce(gdi, GForce, GForcePath, GForceInterval) local units = Reinforcements.Reinforce(gdi, GForce, GForcePath, GForceInterval)
Utils.Do(units, function(unit) Utils.Do(units, function(unit)
BindActorTriggers(unit) BindActorTriggers(unit)
if unit.HasProperty("AttackMove") then if unit.HasProperty("AttackMove") then
unit.AttackMove(NodBase.Location) unit.AttackMove(NodBase.Location)
else else
unit.Move(NodBase.Location) unit.Move(NodBase.Location)
end end
end) end)
Trigger.AfterDelay(DateTime.Seconds(60), SendGDIInfantry) Trigger.AfterDelay(DateTime.Seconds(60), SendGDIInfantry)
end end
SendGDIVehicles = function() SendGDIVehicles = function()
local units = Reinforcements.Reinforce(gdi, VGForce, VGForcePath, VGForceInterval) local units = Reinforcements.Reinforce(gdi, VGForce, VGForcePath, VGForceInterval)
Utils.Do(units, function(unit) Utils.Do(units, function(unit)
BindActorTriggers(unit) BindActorTriggers(unit)
if unit.HasProperty("AttackMove") then if unit.HasProperty("AttackMove") then
unit.AttackMove(NodBase.Location) unit.AttackMove(NodBase.Location)
else else
unit.Move(NodBase.Location) unit.Move(NodBase.Location)
end end
end) end)
Trigger.AfterDelay(DateTime.Seconds(110), SendGDIVehicles) Trigger.AfterDelay(DateTime.Seconds(110), SendGDIVehicles)
end end
BindActorTriggers = function(a) BindActorTriggers = function(a)
if a.HasProperty("Hunt") then if a.HasProperty("Hunt") then
Trigger.OnIdle(a, a.Hunt) Trigger.OnIdle(a, a.Hunt)
end end
if a.HasProperty("HasPassengers") then if a.HasProperty("HasPassengers") then
Trigger.OnDamaged(a, function() Trigger.OnDamaged(a, function()
if a.HasPassengers then if a.HasPassengers then
a.Stop() a.Stop()
a.UnloadPassengers() a.UnloadPassengers()
end end
end) end)
end end
end end
WorldLoaded = function() WorldLoaded = function()
nod = Player.GetPlayer("Nod") nod = Player.GetPlayer("Nod")
gdi = Player.GetPlayer("GDI") gdi = Player.GetPlayer("GDI")
SetupFactories() SetupFactories()
SetupInvulnerability() SetupInvulnerability()
Utils.Do(ProducedUnitTypes, ProduceUnits) Utils.Do(ProducedUnitTypes, ProduceUnits)
SendNodInfantry() SendNodInfantry()
Trigger.AfterDelay(DateTime.Seconds(50), SendNodVehicles) Trigger.AfterDelay(DateTime.Seconds(50), SendNodVehicles)
SendGDIInfantry() SendGDIInfantry()
Trigger.AfterDelay(DateTime.Seconds(70), SendGDIVehicles) Trigger.AfterDelay(DateTime.Seconds(70), SendGDIVehicles)
end end