Have the Soviets attack the town in Allies 04
This commit is contained in:
@@ -92,6 +92,11 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
Actor bridge;
|
Actor bridge;
|
||||||
bool attackingBridge;
|
bool attackingBridge;
|
||||||
|
|
||||||
|
bool attackingTown = true;
|
||||||
|
Actor townTopLeft;
|
||||||
|
Actor townBottomRight;
|
||||||
|
IEnumerable<Actor> townAttackers;
|
||||||
|
|
||||||
void MissionFailed(string text)
|
void MissionFailed(string text)
|
||||||
{
|
{
|
||||||
MissionUtils.CoopMissionFailed(world, text, allies1, allies2);
|
MissionUtils.CoopMissionFailed(world, text, allies1, allies2);
|
||||||
@@ -144,6 +149,26 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (attackingTown)
|
||||||
|
{
|
||||||
|
Game.Debug(townAttackers.Count().ToString());
|
||||||
|
foreach (var attacker in townAttackers.Where(a => a.IsIdle && !a.IsDead() && a.IsInWorld))
|
||||||
|
{
|
||||||
|
Game.Debug("foo " + attacker);
|
||||||
|
var enemies = world.Actors.Where(u => u.Owner == neutral
|
||||||
|
&& ((u.HasTrait<Building>() && !u.HasTrait<Wall>()) || u.HasTrait<Mobile>()) && u.IsInWorld && !u.IsDead());
|
||||||
|
|
||||||
|
var enemy = enemies.OrderBy(u => (self.CenterLocation - u.CenterLocation).LengthSquared).FirstOrDefault();
|
||||||
|
if (enemy != null)
|
||||||
|
attacker.QueueActivity(new AttackMove.AttackMoveActivity(attacker, new Attack(Target.FromActor(enemy), 3)));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
attackingTown = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var patrol in patrols)
|
foreach (var patrol in patrols)
|
||||||
patrol.DoPatrol();
|
patrol.DoPatrol();
|
||||||
|
|
||||||
@@ -159,7 +184,6 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
}
|
}
|
||||||
else if (lab.Destroyed)
|
else if (lab.Destroyed)
|
||||||
MissionFailed("The Soviet research laboratory was destroyed.");
|
MissionFailed("The Soviet research laboratory was destroyed.");
|
||||||
|
|
||||||
else if (!world.Actors.Any(a => (a.Owner == allies1 || a.Owner == allies2) && !a.IsDead()
|
else if (!world.Actors.Any(a => (a.Owner == allies1 || a.Owner == allies2) && !a.IsDead()
|
||||||
&& (a.HasTrait<Building>() && !a.HasTrait<Wall>()) || a.HasTrait<BaseBuilding>()))
|
&& (a.HasTrait<Building>() && !a.HasTrait<Wall>()) || a.HasTrait<BaseBuilding>()))
|
||||||
{
|
{
|
||||||
@@ -426,6 +450,12 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
.OrderBy(a => (a.Location - bridgeAttackPoint.Location).LengthSquared)
|
.OrderBy(a => (a.Location - bridgeAttackPoint.Location).LengthSquared)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
townTopLeft = actors["TownTopLeft"];
|
||||||
|
townBottomRight = actors["TownBottomRight"];
|
||||||
|
Game.Debug(world.FindAliveCombatantActorsInBox(townTopLeft.CenterLocation, townBottomRight.CenterLocation).JoinWith(","));
|
||||||
|
townAttackers = world.FindAliveCombatantActorsInBox(townTopLeft.CenterLocation, townBottomRight.CenterLocation)
|
||||||
|
.Where(a => a.Owner == soviets && a.HasTrait<IMove>() && a.HasTrait<AttackBase>()).ToArray();
|
||||||
|
|
||||||
OnObjectivesUpdated(false);
|
OnObjectivesUpdated(false);
|
||||||
SetupSubStances();
|
SetupSubStances();
|
||||||
|
|
||||||
|
|||||||
@@ -479,9 +479,9 @@ Actors:
|
|||||||
Actor12: sam
|
Actor12: sam
|
||||||
Location: 34,27
|
Location: 34,27
|
||||||
Owner: Soviets
|
Owner: Soviets
|
||||||
Actor143: e1
|
Actor297: v08
|
||||||
Location: 61,98
|
Location: 68,95
|
||||||
Owner: Soviets
|
Owner: Neutral
|
||||||
Actor142: fenc
|
Actor142: fenc
|
||||||
Location: 91,16
|
Location: 91,16
|
||||||
Owner: Soviets
|
Owner: Soviets
|
||||||
@@ -941,8 +941,8 @@ Actors:
|
|||||||
PatrolPoint22: waypoint
|
PatrolPoint22: waypoint
|
||||||
Location: 92,49
|
Location: 92,49
|
||||||
Owner: Neutral
|
Owner: Neutral
|
||||||
Actor297: v08
|
Actor515: wood
|
||||||
Location: 72,78
|
Location: 66,100
|
||||||
Owner: Neutral
|
Owner: Neutral
|
||||||
Actor298: t01
|
Actor298: t01
|
||||||
Location: 90,61
|
Location: 90,61
|
||||||
@@ -1088,8 +1088,8 @@ Actors:
|
|||||||
Actor347: v17
|
Actor347: v17
|
||||||
Location: 61,97
|
Location: 61,97
|
||||||
Owner: Neutral
|
Owner: Neutral
|
||||||
Actor348: v03
|
Actor348: v06
|
||||||
Location: 60,95
|
Location: 60,96
|
||||||
Owner: Neutral
|
Owner: Neutral
|
||||||
Actor349: v14
|
Actor349: v14
|
||||||
Location: 66,83
|
Location: 66,83
|
||||||
@@ -1166,8 +1166,8 @@ Actors:
|
|||||||
Actor373: tc03
|
Actor373: tc03
|
||||||
Location: 94,100
|
Location: 94,100
|
||||||
Owner: Neutral
|
Owner: Neutral
|
||||||
Actor374: v07
|
Actor374: wood
|
||||||
Location: 76,77
|
Location: 67,100
|
||||||
Owner: Neutral
|
Owner: Neutral
|
||||||
Actor375: e1
|
Actor375: e1
|
||||||
Location: 89,47
|
Location: 89,47
|
||||||
@@ -1730,6 +1730,60 @@ Actors:
|
|||||||
PatrolPoint34: waypoint
|
PatrolPoint34: waypoint
|
||||||
Location: 92,70
|
Location: 92,70
|
||||||
Owner: Neutral
|
Owner: Neutral
|
||||||
|
Actor516: wood
|
||||||
|
Location: 65,100
|
||||||
|
Owner: Neutral
|
||||||
|
Actor143: v11
|
||||||
|
Location: 72,95
|
||||||
|
Owner: Neutral
|
||||||
|
Actor517: wood
|
||||||
|
Location: 64,100
|
||||||
|
Owner: Neutral
|
||||||
|
Actor518: wood
|
||||||
|
Location: 63,100
|
||||||
|
Owner: Neutral
|
||||||
|
Actor519: wood
|
||||||
|
Location: 63,99
|
||||||
|
Owner: Neutral
|
||||||
|
Actor520: wood
|
||||||
|
Location: 63,98
|
||||||
|
Owner: Neutral
|
||||||
|
Actor521: v18
|
||||||
|
Location: 59,96
|
||||||
|
Owner: Neutral
|
||||||
|
Actor522: e4
|
||||||
|
Location: 70,97
|
||||||
|
Owner: Soviets
|
||||||
|
Actor523: e4
|
||||||
|
Location: 70,91
|
||||||
|
Owner: Soviets
|
||||||
|
Actor524: e4
|
||||||
|
Location: 70,82
|
||||||
|
Owner: Soviets
|
||||||
|
Actor525: e1
|
||||||
|
Location: 70,87
|
||||||
|
Owner: Soviets
|
||||||
|
Actor526: e1
|
||||||
|
Location: 70,93
|
||||||
|
Owner: Soviets
|
||||||
|
Actor528: e2
|
||||||
|
Location: 74,87
|
||||||
|
Owner: Soviets
|
||||||
|
Actor527: e2
|
||||||
|
Location: 73,97
|
||||||
|
Owner: Soviets
|
||||||
|
TownBottomLeft: waypoint
|
||||||
|
Location: 53,98
|
||||||
|
Owner: Neutral
|
||||||
|
TownBottomRight: waypoint
|
||||||
|
Location: 75,98
|
||||||
|
Owner: Neutral
|
||||||
|
TownTopRight: waypoint
|
||||||
|
Location: 75,80
|
||||||
|
Owner: Neutral
|
||||||
|
TownTopLeft: waypoint
|
||||||
|
Location: 53,80
|
||||||
|
Owner: Neutral
|
||||||
|
|
||||||
Smudges:
|
Smudges:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user