Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pillbox, early dog attack to allies-02 #21249

Merged
merged 1 commit into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 44 additions & 4 deletions mods/ra/maps/allies-02/allies02.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,22 @@ RunInitialActivities = function()
Harvester.FindResources()
Trigger.OnKilled(Harvester, function() HarvesterKilled = true end)

ScheduleEarlyAttackers()

Trigger.OnAllKilled(PathGuards, function()
Greece.MarkCompletedObjective(SecureObjective)
SendTrucks()
end)

Trigger.OnAllKilled(SovietBase, function()
local livePathGuards = Utils.Where(PathGuards, function(pg) return not pg.IsDead end)

Utils.Do(USSR.GetGroundAttackers(), function(unit)
if not Utils.Any(PathGuards, function(pg) return pg == unit end) then
Trigger.OnIdle(unit, unit.Hunt)
if Utils.Any(livePathGuards, function(pg) return pg == unit end) then
return
end

Trigger.OnIdle(unit, unit.Hunt)
end)
end)

Expand Down Expand Up @@ -202,19 +208,53 @@ SendTrucks = function()
end
end
end)
Trigger.OnAnyKilled(trucks, ConvoyCasualites)
Trigger.OnAnyKilled(trucks, ConvoyCasualties)
end)
end
end

ConvoyCasualites = function()
ConvoyCasualties = function()
Media.PlaySpeechNotification(Greece, "ConvoyUnitLost")
if ConvoyUnharmed then
ConvoyUnharmed = false
Trigger.AfterDelay(DateTime.Seconds(1), function() Greece.MarkFailedObjective(ConvoyObjective) 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()
Greece = Player.GetPlayer("Greece")
England = Player.GetPlayer("England")
Expand Down
86 changes: 43 additions & 43 deletions mods/ra/maps/allies-02/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -307,97 +307,97 @@ Actors:
Actor97: dog
Location: 65,68
Owner: USSR
Facing: 256
Facing: 768
SubCell: 3
Actor98: dog
Location: 65,66
Owner: USSR
Facing: 128
Facing: 896
SubCell: 2
Actor99: dog
Location: 59,70
Owner: USSR
Facing: 640
Facing: 384
SubCell: 2
Actor100: e2
Location: 61,56
Owner: USSR
Facing: 128
Facing: 896
SubCell: 3
Actor101: e2
Location: 59,57
Owner: USSR
Facing: 896
Facing: 128
SubCell: 4
Actor102: e2
Location: 64,67
Owner: USSR
Facing: 384
Facing: 640
SubCell: 0
Actor103: e1
EarlyAttacker3: e1
Location: 78,74
Owner: USSR
Facing: 512
SubCell: 2
Facing: 512
Actor104: e1
Location: 80,74
Owner: USSR
Facing: 640
Facing: 384
SubCell: 0
Actor105: e1
Location: 56,68
Owner: USSR
Facing: 640
Facing: 384
SubCell: 3
Actor107: e1
Location: 73,60
Owner: USSR
Facing: 128
Facing: 896
SubCell: 2
Actor108: e1
Location: 74,61
Owner: USSR
Facing: 896
Facing: 128
SubCell: 1
Actor109: e1
Location: 72,60
Owner: USSR
Facing: 256
Facing: 768
SubCell: 0
Actor115: e1
Location: 60,64
Owner: USSR
Facing: 896
Facing: 128
SubCell: 3
Actor116: e2
Location: 68,45
Owner: USSR
Facing: 384
Facing: 640
SubCell: 0
Actor118: e1
Location: 57,69
Owner: USSR
Facing: 384
Facing: 640
SubCell: 1
Actor119: e2
Location: 60,70
Owner: USSR
Facing: 128
Facing: 896
SubCell: 0
Actor120: e1
Location: 89,48
Owner: Greece
Facing: 640
Facing: 384
SubCell: 1
Actor121: e1
Location: 87,48
Owner: Greece
Facing: 768
Facing: 256
SubCell: 4
Actor122: e1
Location: 87,48
Owner: Greece
Facing: 768
Facing: 256
SubCell: 1
Actor123: e1
Location: 88,48
Expand All @@ -409,34 +409,34 @@ Actors:
Owner: Greece
Facing: 512
SubCell: 1
Actor125: dog
EarlyAttacker4: dog
Location: 78,75
Owner: USSR
Facing: 640
SubCell: 1
Actor126: e1
Facing: 384
EarlyAttacker1: e1
Location: 71,61
Owner: USSR
Facing: 640
SubCell: 0
Actor127: dog
Facing: 384
EarlyAttacker2: dog
Location: 70,61
Owner: USSR
Facing: 384
SubCell: 4
Facing: 640
Actor136: e2
Location: 69,66
Owner: USSR
SubCell: 3
Actor137: e2
Location: 73,51
Owner: USSR
Facing: 896
Facing: 128
SubCell: 4
Actor138: medi
Location: 88,48
Owner: Greece
Facing: 640
Facing: 384
SubCell: 1
Actor139: fenc
Location: 57,75
Expand Down Expand Up @@ -562,56 +562,56 @@ Actors:
Harvester: harv
Location: 55,65
Owner: USSR
Facing: 640
Facing: 384
PathGuard1: e1
Location: 50,72
Owner: USSR
Facing: 640
Facing: 384
SubCell: 4
PathGuard2: e1
Location: 49,58
Owner: USSR
Facing: 768
Facing: 256
SubCell: 0
PathGuard3: e1
Location: 51,58
Owner: USSR
Facing: 128
Facing: 896
SubCell: 1
PathGuard4: e1
Location: 60,78
Owner: USSR
Facing: 768
Facing: 256
SubCell: 4
PathGuard5: e2
Location: 62,79
Owner: USSR
Facing: 640
Facing: 384
SubCell: 4
PathGuard6: e1
Location: 48,72
Owner: USSR
Facing: 384
Facing: 640
SubCell: 0
PathGuard7: e1
Location: 50,46
Owner: USSR
Facing: 128
Facing: 896
SubCell: 1
PathGuard8: e1
Location: 49,47
Owner: USSR
Facing: 256
Facing: 768
SubCell: 0
PathGuard9: e2
Location: 49,49
Owner: USSR
Facing: 640
Facing: 384
SubCell: 1
PathGuard10: e2
Location: 47,46
Owner: USSR
Facing: 384
Facing: 640
SubCell: 3
PathGuard11: e2
Location: 48,63
Expand All @@ -620,22 +620,22 @@ Actors:
PathGuard12: e1
Location: 49,63
Owner: USSR
Facing: 384
Facing: 640
SubCell: 2
PathGuard13: e1
Location: 74,81
Owner: USSR
Facing: 256
Facing: 768
SubCell: 3
PathGuard14: e2
Location: 75,83
Owner: USSR
Facing: 384
Facing: 640
SubCell: 0
PathGuard15: e1
Location: 57,82
Owner: USSR
Facing: 640
Facing: 384
SubCell: 1
TruckEntryPoint: waypoint
Location: 49,44
Expand Down
4 changes: 0 additions & 4 deletions mods/ra/maps/allies-02/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ HBOX:
Buildable:
Prerequisites: ~disabled

PBOX:
Buildable:
Prerequisites: ~disabled

GUN:
Buildable:
Prerequisites: ~disabled
Expand Down