Redesign Allies 02 base. Fix fail condition in Allies 02. Rename MissionUtils infil trait. Create cameras in missions to let enemy units attack properly
This commit is contained in:
@@ -84,7 +84,7 @@ namespace OpenRA.Mods.RA
|
||||
}
|
||||
}
|
||||
|
||||
void ChangeCargoOwner(Actor self, Player captor)
|
||||
public static void ChangeCargoOwner(Actor self, Player captor)
|
||||
{
|
||||
var cargo = self.TraitOrDefault<Cargo>();
|
||||
if (cargo == null)
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace OpenRA.Mods.RA
|
||||
if (Info.InfiltrateTypes.Contains("Exploration") && target.HasTrait<InfiltrateForExploration>())
|
||||
return true;
|
||||
|
||||
if (Info.InfiltrateTypes.Contains("MissionObjective") && target.HasTrait<InfiltrateForMissionObjective>())
|
||||
if (Info.InfiltrateTypes.Contains("MissionObjective") && target.HasTrait<InfiltrateAction>())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -96,6 +96,9 @@ namespace OpenRA.Mods.RA.Missions
|
||||
CountdownTimer reinforcementsTimer;
|
||||
CountdownTimerWidget reinforcementsTimerWidget;
|
||||
|
||||
CPos alliedBaseTopLeft;
|
||||
CPos alliedBaseBottomRight;
|
||||
|
||||
const string InfantryQueueName = "Infantry";
|
||||
const string VehicleQueueName = "Vehicle";
|
||||
static readonly string[] SovietInfantry = { "e1", "e2", "e3" };
|
||||
@@ -104,7 +107,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
const int SovietVehiclesUpgradeTicks = 1500 * 4;
|
||||
const int SovietGroupSize = 5;
|
||||
|
||||
const int ReinforcementsTicks = 1500 * 12;
|
||||
const int ReinforcementsTicks = 1500 * 16;
|
||||
static readonly string[] Reinforcements =
|
||||
{
|
||||
"2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk",
|
||||
@@ -242,13 +245,16 @@ namespace OpenRA.Mods.RA.Missions
|
||||
else if (einstein.IsDead())
|
||||
MissionFailed("Einstein was killed.");
|
||||
|
||||
else if (!world.Actors.Any(a => (a.Owner == allies || a.Owner == allies2) && !a.IsDead()
|
||||
&& (a.HasTrait<Building>() && !a.HasTrait<Wall>()) || a.HasTrait<BaseBuilding>()))
|
||||
world.AddFrameEndTask(w =>
|
||||
{
|
||||
if (!w.FindAliveCombatantActorsInBox(alliedBaseTopLeft.ToPPos(), alliedBaseBottomRight.ToPPos())
|
||||
.Any(a => (a.Owner == allies || a.Owner == allies2) && (a.HasTrait<Building>() && !a.HasTrait<Wall>()) || a.HasTrait<BaseBuilding>()))
|
||||
{
|
||||
objectives[MaintainPresenceID].Status = ObjectiveStatus.Failed;
|
||||
OnObjectivesUpdated(true);
|
||||
MissionFailed("The Allied reinforcements have been defeated.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void UpdateDeaths()
|
||||
@@ -323,13 +329,9 @@ namespace OpenRA.Mods.RA.Missions
|
||||
foreach (var actor in world.Actors.Where(a => a.Owner == allies && a != allies.PlayerActor))
|
||||
{
|
||||
actor.ChangeOwner(allies2);
|
||||
if (actor.Info.Name == "pbox")
|
||||
{
|
||||
actor.AddTrait(new TransformedAction(s => s.Trait<Cargo>().Load(s, world.CreateActor(false, "e1", allies2, null, null))));
|
||||
actor.QueueActivity(new Transform(actor, "hbox.e1") { SkipMakeAnims = true });
|
||||
}
|
||||
Capturable.ChangeCargoOwner(actor, allies2);
|
||||
if (actor.Info.Name == "proc")
|
||||
actor.QueueActivity(new Transform(actor, "proc") { SkipMakeAnims = true });
|
||||
actor.QueueActivity(new Transform(actor, "proc") { SkipMakeAnims = true }); // for harv spawn
|
||||
foreach (var c in actor.TraitsImplementing<INotifyCapture>())
|
||||
c.OnCapture(actor, actor, allies, allies2);
|
||||
}
|
||||
@@ -443,11 +445,13 @@ namespace OpenRA.Mods.RA.Missions
|
||||
reinforcementsEntryPoint = actors["ReinforcementsEntryPoint"];
|
||||
extractionLZ = actors["ExtractionLZ"];
|
||||
extractionLZEntryPoint = actors["ExtractionLZEntryPoint"];
|
||||
|
||||
badgerEntryPoint1 = actors["BadgerEntryPoint1"];
|
||||
badgerEntryPoint2 = actors["BadgerEntryPoint2"];
|
||||
badgerDropPoint1 = actors["BadgerDropPoint1"];
|
||||
badgerDropPoint2 = actors["BadgerDropPoint2"];
|
||||
badgerDropPoint3 = actors["BadgerDropPoint3"];
|
||||
|
||||
parabombPoint1 = actors["ParabombPoint1"];
|
||||
parabombPoint2 = actors["ParabombPoint2"];
|
||||
sovietBarracks = actors["SovietBarracks"];
|
||||
@@ -459,6 +463,9 @@ namespace OpenRA.Mods.RA.Missions
|
||||
yakEntryPoint = actors["YakEntryPoint"];
|
||||
yakAttackPoint = actors["YakAttackPoint"];
|
||||
|
||||
alliedBaseTopLeft = actors["AlliedBaseTopLeft"].Location;
|
||||
alliedBaseBottomRight = actors["AlliedBaseBottomRight"].Location;
|
||||
|
||||
SetupAlliedBase();
|
||||
|
||||
var shroud = allies1.Shroud;
|
||||
|
||||
@@ -410,7 +410,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
};
|
||||
|
||||
lab = actors["Lab"];
|
||||
lab.AddTrait(new InfiltrateForMissionObjective(OnLabInfiltrated));
|
||||
lab.AddTrait(new InfiltrateAction(OnLabInfiltrated));
|
||||
lab.AddTrait(new TransformedAction(self => lab = self));
|
||||
|
||||
reinforcementsEntryPoint = actors["ReinforcementsEntryPoint"];
|
||||
@@ -466,7 +466,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
{
|
||||
OldOwner = self.Owner;
|
||||
|
||||
self.AddTrait(new InfiltrateForMissionObjective(OnTruckHijacked));
|
||||
self.AddTrait(new InfiltrateAction(OnTruckHijacked));
|
||||
}
|
||||
|
||||
public void OnInfiltrate(Actor self, Actor spy)
|
||||
|
||||
@@ -232,11 +232,11 @@ namespace OpenRA.Mods.RA.Missions
|
||||
}
|
||||
}
|
||||
|
||||
class InfiltrateForMissionObjective : IAcceptInfiltrator
|
||||
class InfiltrateAction : IAcceptInfiltrator
|
||||
{
|
||||
Action<Actor> a;
|
||||
|
||||
public InfiltrateForMissionObjective(Action<Actor> a)
|
||||
public InfiltrateAction(Action<Actor> a)
|
||||
{
|
||||
this.a = a;
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
world.CreateActor("camera", greece, provingGroundsCameraPoint.Location, null);
|
||||
|
||||
superTankDome = actors["SuperTankDome"];
|
||||
superTankDome.AddTrait(new InfiltrateForMissionObjective(OnSuperTankDomeInfiltrated));
|
||||
superTankDome.AddTrait(new InfiltrateAction(OnSuperTankDomeInfiltrated));
|
||||
superTankDome.AddTrait(new TransformedAction(self => superTankDome = self));
|
||||
|
||||
Game.MoveViewport(startEntryPoint.Location.ToFloat2());
|
||||
|
||||
@@ -1174,6 +1174,9 @@ Actors:
|
||||
Actor346: t15
|
||||
Location: 57,24
|
||||
Owner: Neutral
|
||||
Actor1000: camera.large
|
||||
Location: 1,1
|
||||
Owner: Soviets
|
||||
|
||||
Smudges:
|
||||
|
||||
@@ -1295,6 +1298,13 @@ Rules:
|
||||
BRIK:
|
||||
Buildable:
|
||||
Owner: None
|
||||
MRJ:
|
||||
Buildable:
|
||||
Owner: None
|
||||
CAMERA.Large:
|
||||
Inherits: CAMERA
|
||||
RevealsShroud:
|
||||
Range: 1000
|
||||
|
||||
Sequences:
|
||||
|
||||
|
||||
@@ -341,6 +341,9 @@ Actors:
|
||||
Actor29: kenn
|
||||
Location: 23,28
|
||||
Owner: Soviets
|
||||
Actor1000: camera.large
|
||||
Location: 1,1
|
||||
Owner: Soviets
|
||||
|
||||
Smudges:
|
||||
|
||||
@@ -391,6 +394,10 @@ Rules:
|
||||
^Building:
|
||||
GivesBounty:
|
||||
Percentage: 0
|
||||
CAMERA.Large:
|
||||
Inherits: CAMERA
|
||||
RevealsShroud:
|
||||
Range: 1000
|
||||
|
||||
Sequences:
|
||||
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1422,6 +1422,9 @@ Actors:
|
||||
ParadropBoxTopLeft: waypoint
|
||||
Location: 78,27
|
||||
Owner: Neutral
|
||||
Actor1000: camera.large
|
||||
Location: 1,1
|
||||
Owner: Soviets
|
||||
|
||||
Smudges:
|
||||
|
||||
@@ -1540,6 +1543,9 @@ Rules:
|
||||
CTNK:
|
||||
Buildable:
|
||||
Owner: None
|
||||
MRJ:
|
||||
Buildable:
|
||||
Owner: None
|
||||
MGG:
|
||||
Buildable:
|
||||
Owner: None
|
||||
@@ -1548,6 +1554,10 @@ Rules:
|
||||
GAP:
|
||||
Buildable:
|
||||
Owner: None
|
||||
CAMERA.Large:
|
||||
Inherits: CAMERA
|
||||
RevealsShroud:
|
||||
Range: 1000
|
||||
|
||||
Sequences:
|
||||
|
||||
|
||||
@@ -1793,6 +1793,9 @@ Actors:
|
||||
Actor533: brl3
|
||||
Location: 54,88
|
||||
Owner: Neutral
|
||||
Actor1000: camera.large
|
||||
Location: 1,1
|
||||
Owner: Soviets
|
||||
|
||||
Smudges:
|
||||
|
||||
@@ -1970,9 +1973,16 @@ Rules:
|
||||
MGG:
|
||||
Buildable:
|
||||
Owner: None
|
||||
MRJ:
|
||||
Buildable:
|
||||
Owner: None
|
||||
GAP:
|
||||
Buildable:
|
||||
Owner: None
|
||||
CAMERA.Large:
|
||||
Inherits: CAMERA
|
||||
RevealsShroud:
|
||||
Range: 1000
|
||||
|
||||
Sequences:
|
||||
truk:
|
||||
|
||||
@@ -2523,6 +2523,12 @@ Actors:
|
||||
waypoint99: waypoint
|
||||
Location: 68,63
|
||||
Owner: Neutral
|
||||
Actor1000: camera.large
|
||||
Location: 1,1
|
||||
Owner: USSR
|
||||
Actor1001: camera.large
|
||||
Location: 1,1
|
||||
Owner: Turkey
|
||||
|
||||
Smudges:
|
||||
|
||||
@@ -2711,6 +2717,13 @@ Rules:
|
||||
GAP:
|
||||
Buildable:
|
||||
Owner: None
|
||||
MRJ:
|
||||
Buildable:
|
||||
Owner: None
|
||||
CAMERA.Large:
|
||||
Inherits: CAMERA
|
||||
RevealsShroud:
|
||||
Range: 1000
|
||||
|
||||
Sequences:
|
||||
|
||||
|
||||
@@ -832,6 +832,9 @@ Actors:
|
||||
waypoint98: waypoint
|
||||
Location: 44,79
|
||||
Owner: Neutral
|
||||
Actor1000: camera.large
|
||||
Location: 1,1
|
||||
Owner: France
|
||||
|
||||
Smudges:
|
||||
|
||||
@@ -925,6 +928,10 @@ Rules:
|
||||
Image: V07
|
||||
Soviet01ClassicContainsActors:
|
||||
Actors: c1, c6
|
||||
CAMERA.Large:
|
||||
Inherits: CAMERA
|
||||
RevealsShroud:
|
||||
Range: 1000
|
||||
|
||||
Sequences:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user