diff --git a/OpenRA.Mods.RA/Missions/Allies02Script.cs b/OpenRA.Mods.RA/Missions/Allies02Script.cs index 5658ac1295..497ae81cef 100644 --- a/OpenRA.Mods.RA/Missions/Allies02Script.cs +++ b/OpenRA.Mods.RA/Missions/Allies02Script.cs @@ -83,7 +83,6 @@ namespace OpenRA.Mods.RA.Missions Actor yakEntryPoint; Actor yakAttackPoint; Actor yak; - Actor procPoint; Actor einsteinChinook; @@ -282,7 +281,8 @@ namespace OpenRA.Mods.RA.Missions } world.AddFrameEndTask(w => { - if (!world.FindAliveCombatantActorsInCircle(allies2BasePoint.CenterLocation, 20).Any(a => a.HasTrait() && !a.HasTrait() && a.Owner == allies2)) + if (!world.FindAliveCombatantActorsInCircle(allies2BasePoint.CenterLocation, 20) + .Any(a => a.HasTrait() && !a.HasTrait() && (a.Owner == allies || a.Owner == allies2))) { objectives[MaintainPresenceID].Status = ObjectiveStatus.Failed; OnObjectivesUpdated(true); @@ -569,16 +569,7 @@ namespace OpenRA.Mods.RA.Missions sovietTownAttackPoint2 = actors["SovietTownAttackPoint2"]; yakEntryPoint = actors["YakEntryPoint"]; yakAttackPoint = actors["YakAttackPoint"]; - procPoint = actors["ProcPoint"]; - foreach (var actor in world.Actors.Where(a => a.Owner == allies).OrderBy(a => a.HasTrait())) - { - actor.ChangeOwner(allies2); - } - world.CreateActor(true, "proc", new TypeDictionary - { - new OwnerInit(allies2), - new LocationInit(procPoint.Location) - }); + SetupAlliedBase(actors); var shroud = w.WorldActor.Trait(); shroud.Explore(w, sam1.Location, 2); shroud.Explore(w, sam2.Location, 2); @@ -596,6 +587,32 @@ namespace OpenRA.Mods.RA.Missions Game.ConnectionStateChanged += StopMusic; } + void SetupAlliedBase(Dictionary actors) + { + world.AddFrameEndTask(w => + { + foreach (var actor in actors.Where(a => a.Value.Owner == allies)) + { + actor.Value.ChangeOwner(allies2); + if (actor.Value.Info.Name == "proc.nofreeactor") + { + CreateAlliedHarvester(actor.Value.Location); + } + } + }); + } + + void CreateAlliedHarvester(CPos location) + { + var actor = world.CreateActor("harv", new TypeDictionary + { + new LocationInit(location + new CVec(1, 2)), + new OwnerInit(allies2), + new FacingInit(64) + }); + actor.QueueActivity(new FindResources()); + } + void PlayMusic() { if (!Rules.InstalledMusic.Any()) diff --git a/mods/ra/maps/allies-02/map.yaml b/mods/ra/maps/allies-02/map.yaml index 3d2e4f7603..4119daa126 100644 --- a/mods/ra/maps/allies-02/map.yaml +++ b/mods/ra/maps/allies-02/map.yaml @@ -1481,9 +1481,9 @@ Actors: Actor290: apwr Location: 52,42 Owner: Soviets - ProcPoint: waypoint + Actor924: proc.nofreeactor Location: 25,95 - Owner: Neutral + Owner: Allies Actor455: fenc Location: 31,93 Owner: Allies @@ -1855,15 +1855,6 @@ Actors: Actor340: e1 Location: 77,58 Owner: Soviets - Actor630: 3tnk - Location: 35,65 - Owner: Soviets - Actor633: 3tnk - Location: 36,66 - Owner: Soviets - Actor634: 3tnk - Location: 37,65 - Owner: Soviets Actor55: wood Location: 79,94 Owner: Neutral @@ -2878,6 +2869,14 @@ Rules: Allies02Script: MissionObjectivesPanel: ObjectivesPanel: MISSION_OBJECTIVES + PROC.NoFreeActor: + Inherits: PROC + -FreeActor: + -Buildable: + RenderBuilding: + Image: PROC + ProvidesCustomPrerequisite: + Prerequisite: proc TRAN.Husk1: Burns: Damage: 0