Add Pillbox, early dog attack to allies-02

This commit is contained in:
JovialFeline
2023-12-09 15:51:17 -05:00
committed by Gustas
parent 8fda46e241
commit 09834d3954
3 changed files with 87 additions and 51 deletions

View File

@@ -58,16 +58,22 @@ RunInitialActivities = function()
Harvester.FindResources() Harvester.FindResources()
Trigger.OnKilled(Harvester, function() HarvesterKilled = true end) Trigger.OnKilled(Harvester, function() HarvesterKilled = true end)
ScheduleEarlyAttackers()
Trigger.OnAllKilled(PathGuards, function() Trigger.OnAllKilled(PathGuards, function()
Greece.MarkCompletedObjective(SecureObjective) Greece.MarkCompletedObjective(SecureObjective)
SendTrucks() SendTrucks()
end) end)
Trigger.OnAllKilled(SovietBase, function() Trigger.OnAllKilled(SovietBase, function()
local livePathGuards = Utils.Where(PathGuards, function(pg) return not pg.IsDead end)
Utils.Do(USSR.GetGroundAttackers(), function(unit) Utils.Do(USSR.GetGroundAttackers(), function(unit)
if not Utils.Any(PathGuards, function(pg) return pg == unit end) then if Utils.Any(livePathGuards, function(pg) return pg == unit end) then
Trigger.OnIdle(unit, unit.Hunt) return
end end
Trigger.OnIdle(unit, unit.Hunt)
end) end)
end) end)
@@ -202,12 +208,12 @@ SendTrucks = function()
end end
end end
end) end)
Trigger.OnAnyKilled(trucks, ConvoyCasualites) Trigger.OnAnyKilled(trucks, ConvoyCasualties)
end) end)
end end
end end
ConvoyCasualites = function() ConvoyCasualties = function()
Media.PlaySpeechNotification(Greece, "ConvoyUnitLost") Media.PlaySpeechNotification(Greece, "ConvoyUnitLost")
if ConvoyUnharmed then if ConvoyUnharmed then
ConvoyUnharmed = false ConvoyUnharmed = false
@@ -215,6 +221,40 @@ ConvoyCasualites = function()
end end
end end
ScheduleEarlyAttackers = function()
if Difficulty == "tough" then
Trigger.AfterDelay(DateTime.Seconds(12), SendEarlyAttackers)
return
end
Trigger.AfterDelay(DateTime.Seconds(6), function()
if not Greece.HasPrerequisites({ "anypower" }) then
ScheduleEarlyAttackers()
return
end
SendEarlyAttackers()
end)
end
SendEarlyAttackers = function()
local team = { EarlyAttacker1, EarlyAttacker2, EarlyAttacker3, EarlyAttacker4 }
local dogTargets = Greece.GetActorsByType("e1")
Utils.Do(team, function(member)
if member.IsDead then
return
end
-- Get attack dogs sprinting.
if member.Type == "dog" and #dogTargets > 0 then
member.Attack(Utils.Random(dogTargets))
end
Trigger.OnIdle(member, member.Hunt)
end)
end
WorldLoaded = function() WorldLoaded = function()
Greece = Player.GetPlayer("Greece") Greece = Player.GetPlayer("Greece")
England = Player.GetPlayer("England") England = Player.GetPlayer("England")

View File

@@ -307,97 +307,97 @@ Actors:
Actor97: dog Actor97: dog
Location: 65,68 Location: 65,68
Owner: USSR Owner: USSR
Facing: 256 Facing: 768
SubCell: 3 SubCell: 3
Actor98: dog Actor98: dog
Location: 65,66 Location: 65,66
Owner: USSR Owner: USSR
Facing: 128 Facing: 896
SubCell: 2 SubCell: 2
Actor99: dog Actor99: dog
Location: 59,70 Location: 59,70
Owner: USSR Owner: USSR
Facing: 640 Facing: 384
SubCell: 2 SubCell: 2
Actor100: e2 Actor100: e2
Location: 61,56 Location: 61,56
Owner: USSR Owner: USSR
Facing: 128 Facing: 896
SubCell: 3 SubCell: 3
Actor101: e2 Actor101: e2
Location: 59,57 Location: 59,57
Owner: USSR Owner: USSR
Facing: 896 Facing: 128
SubCell: 4 SubCell: 4
Actor102: e2 Actor102: e2
Location: 64,67 Location: 64,67
Owner: USSR Owner: USSR
Facing: 384 Facing: 640
SubCell: 0 SubCell: 0
Actor103: e1 EarlyAttacker3: e1
Location: 78,74 Location: 78,74
Owner: USSR Owner: USSR
Facing: 512
SubCell: 2 SubCell: 2
Facing: 512
Actor104: e1 Actor104: e1
Location: 80,74 Location: 80,74
Owner: USSR Owner: USSR
Facing: 640 Facing: 384
SubCell: 0 SubCell: 0
Actor105: e1 Actor105: e1
Location: 56,68 Location: 56,68
Owner: USSR Owner: USSR
Facing: 640 Facing: 384
SubCell: 3 SubCell: 3
Actor107: e1 Actor107: e1
Location: 73,60 Location: 73,60
Owner: USSR Owner: USSR
Facing: 128 Facing: 896
SubCell: 2 SubCell: 2
Actor108: e1 Actor108: e1
Location: 74,61 Location: 74,61
Owner: USSR Owner: USSR
Facing: 896 Facing: 128
SubCell: 1 SubCell: 1
Actor109: e1 Actor109: e1
Location: 72,60 Location: 72,60
Owner: USSR Owner: USSR
Facing: 256 Facing: 768
SubCell: 0 SubCell: 0
Actor115: e1 Actor115: e1
Location: 60,64 Location: 60,64
Owner: USSR Owner: USSR
Facing: 896 Facing: 128
SubCell: 3 SubCell: 3
Actor116: e2 Actor116: e2
Location: 68,45 Location: 68,45
Owner: USSR Owner: USSR
Facing: 384 Facing: 640
SubCell: 0 SubCell: 0
Actor118: e1 Actor118: e1
Location: 57,69 Location: 57,69
Owner: USSR Owner: USSR
Facing: 384 Facing: 640
SubCell: 1 SubCell: 1
Actor119: e2 Actor119: e2
Location: 60,70 Location: 60,70
Owner: USSR Owner: USSR
Facing: 128 Facing: 896
SubCell: 0 SubCell: 0
Actor120: e1 Actor120: e1
Location: 89,48 Location: 89,48
Owner: Greece Owner: Greece
Facing: 640 Facing: 384
SubCell: 1 SubCell: 1
Actor121: e1 Actor121: e1
Location: 87,48 Location: 87,48
Owner: Greece Owner: Greece
Facing: 768 Facing: 256
SubCell: 4 SubCell: 4
Actor122: e1 Actor122: e1
Location: 87,48 Location: 87,48
Owner: Greece Owner: Greece
Facing: 768 Facing: 256
SubCell: 1 SubCell: 1
Actor123: e1 Actor123: e1
Location: 88,48 Location: 88,48
@@ -409,21 +409,21 @@ Actors:
Owner: Greece Owner: Greece
Facing: 512 Facing: 512
SubCell: 1 SubCell: 1
Actor125: dog EarlyAttacker4: dog
Location: 78,75 Location: 78,75
Owner: USSR Owner: USSR
Facing: 640
SubCell: 1 SubCell: 1
Actor126: e1 Facing: 384
EarlyAttacker1: e1
Location: 71,61 Location: 71,61
Owner: USSR Owner: USSR
Facing: 640
SubCell: 0 SubCell: 0
Actor127: dog Facing: 384
EarlyAttacker2: dog
Location: 70,61 Location: 70,61
Owner: USSR Owner: USSR
Facing: 384
SubCell: 4 SubCell: 4
Facing: 640
Actor136: e2 Actor136: e2
Location: 69,66 Location: 69,66
Owner: USSR Owner: USSR
@@ -431,12 +431,12 @@ Actors:
Actor137: e2 Actor137: e2
Location: 73,51 Location: 73,51
Owner: USSR Owner: USSR
Facing: 896 Facing: 128
SubCell: 4 SubCell: 4
Actor138: medi Actor138: medi
Location: 88,48 Location: 88,48
Owner: Greece Owner: Greece
Facing: 640 Facing: 384
SubCell: 1 SubCell: 1
Actor139: fenc Actor139: fenc
Location: 57,75 Location: 57,75
@@ -562,56 +562,56 @@ Actors:
Harvester: harv Harvester: harv
Location: 55,65 Location: 55,65
Owner: USSR Owner: USSR
Facing: 640 Facing: 384
PathGuard1: e1 PathGuard1: e1
Location: 50,72 Location: 50,72
Owner: USSR Owner: USSR
Facing: 640 Facing: 384
SubCell: 4 SubCell: 4
PathGuard2: e1 PathGuard2: e1
Location: 49,58 Location: 49,58
Owner: USSR Owner: USSR
Facing: 768 Facing: 256
SubCell: 0 SubCell: 0
PathGuard3: e1 PathGuard3: e1
Location: 51,58 Location: 51,58
Owner: USSR Owner: USSR
Facing: 128 Facing: 896
SubCell: 1 SubCell: 1
PathGuard4: e1 PathGuard4: e1
Location: 60,78 Location: 60,78
Owner: USSR Owner: USSR
Facing: 768 Facing: 256
SubCell: 4 SubCell: 4
PathGuard5: e2 PathGuard5: e2
Location: 62,79 Location: 62,79
Owner: USSR Owner: USSR
Facing: 640 Facing: 384
SubCell: 4 SubCell: 4
PathGuard6: e1 PathGuard6: e1
Location: 48,72 Location: 48,72
Owner: USSR Owner: USSR
Facing: 384 Facing: 640
SubCell: 0 SubCell: 0
PathGuard7: e1 PathGuard7: e1
Location: 50,46 Location: 50,46
Owner: USSR Owner: USSR
Facing: 128 Facing: 896
SubCell: 1 SubCell: 1
PathGuard8: e1 PathGuard8: e1
Location: 49,47 Location: 49,47
Owner: USSR Owner: USSR
Facing: 256 Facing: 768
SubCell: 0 SubCell: 0
PathGuard9: e2 PathGuard9: e2
Location: 49,49 Location: 49,49
Owner: USSR Owner: USSR
Facing: 640 Facing: 384
SubCell: 1 SubCell: 1
PathGuard10: e2 PathGuard10: e2
Location: 47,46 Location: 47,46
Owner: USSR Owner: USSR
Facing: 384 Facing: 640
SubCell: 3 SubCell: 3
PathGuard11: e2 PathGuard11: e2
Location: 48,63 Location: 48,63
@@ -620,22 +620,22 @@ Actors:
PathGuard12: e1 PathGuard12: e1
Location: 49,63 Location: 49,63
Owner: USSR Owner: USSR
Facing: 384 Facing: 640
SubCell: 2 SubCell: 2
PathGuard13: e1 PathGuard13: e1
Location: 74,81 Location: 74,81
Owner: USSR Owner: USSR
Facing: 256 Facing: 768
SubCell: 3 SubCell: 3
PathGuard14: e2 PathGuard14: e2
Location: 75,83 Location: 75,83
Owner: USSR Owner: USSR
Facing: 384 Facing: 640
SubCell: 0 SubCell: 0
PathGuard15: e1 PathGuard15: e1
Location: 57,82 Location: 57,82
Owner: USSR Owner: USSR
Facing: 640 Facing: 384
SubCell: 1 SubCell: 1
TruckEntryPoint: waypoint TruckEntryPoint: waypoint
Location: 49,44 Location: 49,44

View File

@@ -66,10 +66,6 @@ HBOX:
Buildable: Buildable:
Prerequisites: ~disabled Prerequisites: ~disabled
PBOX:
Buildable:
Prerequisites: ~disabled
GUN: GUN:
Buildable: Buildable:
Prerequisites: ~disabled Prerequisites: ~disabled