Allies 02 SP mode bug fixes

This commit is contained in:
Scott_NZ
2012-11-24 13:46:23 +13:00
parent 947b27a227
commit d15fb82b08
2 changed files with 39 additions and 23 deletions

View File

@@ -83,7 +83,6 @@ namespace OpenRA.Mods.RA.Missions
Actor yakEntryPoint; Actor yakEntryPoint;
Actor yakAttackPoint; Actor yakAttackPoint;
Actor yak; Actor yak;
Actor procPoint;
Actor einsteinChinook; Actor einsteinChinook;
@@ -282,7 +281,8 @@ namespace OpenRA.Mods.RA.Missions
} }
world.AddFrameEndTask(w => world.AddFrameEndTask(w =>
{ {
if (!world.FindAliveCombatantActorsInCircle(allies2BasePoint.CenterLocation, 20).Any(a => a.HasTrait<Building>() && !a.HasTrait<Wall>() && a.Owner == allies2)) if (!world.FindAliveCombatantActorsInCircle(allies2BasePoint.CenterLocation, 20)
.Any(a => a.HasTrait<Building>() && !a.HasTrait<Wall>() && (a.Owner == allies || a.Owner == allies2)))
{ {
objectives[MaintainPresenceID].Status = ObjectiveStatus.Failed; objectives[MaintainPresenceID].Status = ObjectiveStatus.Failed;
OnObjectivesUpdated(true); OnObjectivesUpdated(true);
@@ -569,16 +569,7 @@ namespace OpenRA.Mods.RA.Missions
sovietTownAttackPoint2 = actors["SovietTownAttackPoint2"]; sovietTownAttackPoint2 = actors["SovietTownAttackPoint2"];
yakEntryPoint = actors["YakEntryPoint"]; yakEntryPoint = actors["YakEntryPoint"];
yakAttackPoint = actors["YakAttackPoint"]; yakAttackPoint = actors["YakAttackPoint"];
procPoint = actors["ProcPoint"]; SetupAlliedBase(actors);
foreach (var actor in world.Actors.Where(a => a.Owner == allies).OrderBy(a => a.HasTrait<PowerManager>()))
{
actor.ChangeOwner(allies2);
}
world.CreateActor(true, "proc", new TypeDictionary
{
new OwnerInit(allies2),
new LocationInit(procPoint.Location)
});
var shroud = w.WorldActor.Trait<Shroud>(); var shroud = w.WorldActor.Trait<Shroud>();
shroud.Explore(w, sam1.Location, 2); shroud.Explore(w, sam1.Location, 2);
shroud.Explore(w, sam2.Location, 2); shroud.Explore(w, sam2.Location, 2);
@@ -596,6 +587,32 @@ namespace OpenRA.Mods.RA.Missions
Game.ConnectionStateChanged += StopMusic; Game.ConnectionStateChanged += StopMusic;
} }
void SetupAlliedBase(Dictionary<string, Actor> 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() void PlayMusic()
{ {
if (!Rules.InstalledMusic.Any()) if (!Rules.InstalledMusic.Any())

View File

@@ -1481,9 +1481,9 @@ Actors:
Actor290: apwr Actor290: apwr
Location: 52,42 Location: 52,42
Owner: Soviets Owner: Soviets
ProcPoint: waypoint Actor924: proc.nofreeactor
Location: 25,95 Location: 25,95
Owner: Neutral Owner: Allies
Actor455: fenc Actor455: fenc
Location: 31,93 Location: 31,93
Owner: Allies Owner: Allies
@@ -1855,15 +1855,6 @@ Actors:
Actor340: e1 Actor340: e1
Location: 77,58 Location: 77,58
Owner: Soviets 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 Actor55: wood
Location: 79,94 Location: 79,94
Owner: Neutral Owner: Neutral
@@ -2878,6 +2869,14 @@ Rules:
Allies02Script: Allies02Script:
MissionObjectivesPanel: MissionObjectivesPanel:
ObjectivesPanel: MISSION_OBJECTIVES ObjectivesPanel: MISSION_OBJECTIVES
PROC.NoFreeActor:
Inherits: PROC
-FreeActor:
-Buildable:
RenderBuilding:
Image: PROC
ProvidesCustomPrerequisite:
Prerequisite: proc
TRAN.Husk1: TRAN.Husk1:
Burns: Burns:
Damage: 0 Damage: 0