avoid code duplication
This commit is contained in:
committed by
abcdefg30
parent
05229e79ce
commit
34f3d2d5f1
@@ -149,14 +149,18 @@ SpawnAndAttack = function(types, entry)
|
|||||||
return units
|
return units
|
||||||
end
|
end
|
||||||
|
|
||||||
|
SendFrenchReinforcements = function()
|
||||||
|
local camera = Actor.Create("camera", true, { Owner = allies, Location = SovietRally1.Location })
|
||||||
|
Media.PlaySpeechNotification(allies, "AlliedReinforcementsArrived")
|
||||||
|
Reinforcements.Reinforce(allies, FrenchSquad, { FranceEntry.Location, FranceRally.Location })
|
||||||
|
Trigger.AfterDelay(DateTime.Seconds(3), function() camera.Destroy() end)
|
||||||
|
end
|
||||||
|
|
||||||
FrenchReinforcements = function()
|
FrenchReinforcements = function()
|
||||||
Camera.Position = SovietRally1.CenterPosition
|
Camera.Position = SovietRally1.CenterPosition
|
||||||
local camera = Actor.Create("camera", true, { Owner = allies, Location = SovietRally1.Location })
|
|
||||||
|
|
||||||
if drum1.IsDead or drum2.IsDead or drum3.IsDead then
|
if drum1.IsDead or drum2.IsDead or drum3.IsDead then
|
||||||
Media.PlaySpeechNotification(allies, "AlliedReinforcementsArrived")
|
SendFrenchReinforcements()
|
||||||
Reinforcements.Reinforce(allies, FrenchSquad, { FranceEntry.Location, FranceRally.Location })
|
|
||||||
Trigger.AfterDelay(DateTime.Seconds(3), function() camera.Destroy() end)
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -167,9 +171,7 @@ FrenchReinforcements = function()
|
|||||||
powerproxy.Destroy()
|
powerproxy.Destroy()
|
||||||
|
|
||||||
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
Trigger.AfterDelay(DateTime.Seconds(3), function()
|
||||||
Media.PlaySpeechNotification(allies, "AlliedReinforcementsArrived")
|
SendFrenchReinforcements()
|
||||||
Reinforcements.Reinforce(allies, FrenchSquad, { FranceEntry.Location, FranceRally.Location })
|
|
||||||
Trigger.AfterDelay(DateTime.Seconds(3), function() camera.Destroy() end)
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user