Utilize Panic function with added OnDamaged trigger

This commit is contained in:
Smittytron
2020-06-20 10:13:24 -05:00
committed by Matthias Mailänder
parent 15a92f443d
commit e1523e939d
2 changed files with 16 additions and 1 deletions

View File

@@ -213,7 +213,7 @@ Actors:
Location: 41,54
Owner: France
Health: 52
Actor54: v07
HayHouse: v07
Location: 54,65
Owner: France
Health: 44
@@ -583,5 +583,8 @@ Actors:
YakEntry: waypoint
Location: 51,84
Owner: Neutral
CivSpawn: waypoint
Location: 55,65
Owner: Neutral
Rules: ra|rules/campaign-rules.yaml, ra|rules/campaign-tooltips.yaml, ra|rules/campaign-palettes.yaml, rules.yaml

View File

@@ -56,6 +56,17 @@ Paratroopers = function()
end)
end
PanicAttack = function()
if not HouseDamaged then
local panicTeam = Reinforcements.Reinforce(france, { "c3", "c6", "c9" }, { CivSpawn.Location }, 0)
Utils.Do(panicTeam, function(a)
a.Move(a.Location + CVec.New(-1,-1))
a.Panic()
end)
end
HouseDamaged = true
end
WorldLoaded = function()
player = Player.GetPlayer("USSR")
france = Player.GetPlayer("France")
@@ -90,6 +101,7 @@ WorldLoaded = function()
Paradrop = Actor.Create("powerproxy.paratroopers", false, { Owner = player })
Trigger.AfterDelay(DateTime.Seconds(2), InsertYaks)
Paratroopers()
Trigger.OnDamaged(HayHouse, PanicAttack)
end
Tick = function()