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:
Scott_NZ
2013-04-28 04:10:35 +12:00
parent 7f37080a87
commit 6da0db0035
14 changed files with 388 additions and 1443 deletions

View File

@@ -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>(); var cargo = self.TraitOrDefault<Cargo>();
if (cargo == null) if (cargo == null)

View File

@@ -82,7 +82,7 @@ namespace OpenRA.Mods.RA
if (Info.InfiltrateTypes.Contains("Exploration") && target.HasTrait<InfiltrateForExploration>()) if (Info.InfiltrateTypes.Contains("Exploration") && target.HasTrait<InfiltrateForExploration>())
return true; return true;
if (Info.InfiltrateTypes.Contains("MissionObjective") && target.HasTrait<InfiltrateForMissionObjective>()) if (Info.InfiltrateTypes.Contains("MissionObjective") && target.HasTrait<InfiltrateAction>())
return true; return true;
return false; return false;

View File

@@ -96,6 +96,9 @@ namespace OpenRA.Mods.RA.Missions
CountdownTimer reinforcementsTimer; CountdownTimer reinforcementsTimer;
CountdownTimerWidget reinforcementsTimerWidget; CountdownTimerWidget reinforcementsTimerWidget;
CPos alliedBaseTopLeft;
CPos alliedBaseBottomRight;
const string InfantryQueueName = "Infantry"; const string InfantryQueueName = "Infantry";
const string VehicleQueueName = "Vehicle"; const string VehicleQueueName = "Vehicle";
static readonly string[] SovietInfantry = { "e1", "e2", "e3" }; static readonly string[] SovietInfantry = { "e1", "e2", "e3" };
@@ -104,7 +107,7 @@ namespace OpenRA.Mods.RA.Missions
const int SovietVehiclesUpgradeTicks = 1500 * 4; const int SovietVehiclesUpgradeTicks = 1500 * 4;
const int SovietGroupSize = 5; const int SovietGroupSize = 5;
const int ReinforcementsTicks = 1500 * 12; const int ReinforcementsTicks = 1500 * 16;
static readonly string[] Reinforcements = static readonly string[] Reinforcements =
{ {
"2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk",
@@ -242,13 +245,16 @@ namespace OpenRA.Mods.RA.Missions
else if (einstein.IsDead()) else if (einstein.IsDead())
MissionFailed("Einstein was killed."); MissionFailed("Einstein was killed.");
else if (!world.Actors.Any(a => (a.Owner == allies || a.Owner == allies2) && !a.IsDead() world.AddFrameEndTask(w =>
&& (a.HasTrait<Building>() && !a.HasTrait<Wall>()) || a.HasTrait<BaseBuilding>()))
{ {
objectives[MaintainPresenceID].Status = ObjectiveStatus.Failed; if (!w.FindAliveCombatantActorsInBox(alliedBaseTopLeft.ToPPos(), alliedBaseBottomRight.ToPPos())
OnObjectivesUpdated(true); .Any(a => (a.Owner == allies || a.Owner == allies2) && (a.HasTrait<Building>() && !a.HasTrait<Wall>()) || a.HasTrait<BaseBuilding>()))
MissionFailed("The Allied reinforcements have been defeated."); {
} objectives[MaintainPresenceID].Status = ObjectiveStatus.Failed;
OnObjectivesUpdated(true);
MissionFailed("The Allied reinforcements have been defeated.");
}
});
} }
void UpdateDeaths() 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)) foreach (var actor in world.Actors.Where(a => a.Owner == allies && a != allies.PlayerActor))
{ {
actor.ChangeOwner(allies2); actor.ChangeOwner(allies2);
if (actor.Info.Name == "pbox") Capturable.ChangeCargoOwner(actor, allies2);
{
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 });
}
if (actor.Info.Name == "proc") 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>()) foreach (var c in actor.TraitsImplementing<INotifyCapture>())
c.OnCapture(actor, actor, allies, allies2); c.OnCapture(actor, actor, allies, allies2);
} }
@@ -443,11 +445,13 @@ namespace OpenRA.Mods.RA.Missions
reinforcementsEntryPoint = actors["ReinforcementsEntryPoint"]; reinforcementsEntryPoint = actors["ReinforcementsEntryPoint"];
extractionLZ = actors["ExtractionLZ"]; extractionLZ = actors["ExtractionLZ"];
extractionLZEntryPoint = actors["ExtractionLZEntryPoint"]; extractionLZEntryPoint = actors["ExtractionLZEntryPoint"];
badgerEntryPoint1 = actors["BadgerEntryPoint1"]; badgerEntryPoint1 = actors["BadgerEntryPoint1"];
badgerEntryPoint2 = actors["BadgerEntryPoint2"]; badgerEntryPoint2 = actors["BadgerEntryPoint2"];
badgerDropPoint1 = actors["BadgerDropPoint1"]; badgerDropPoint1 = actors["BadgerDropPoint1"];
badgerDropPoint2 = actors["BadgerDropPoint2"]; badgerDropPoint2 = actors["BadgerDropPoint2"];
badgerDropPoint3 = actors["BadgerDropPoint3"]; badgerDropPoint3 = actors["BadgerDropPoint3"];
parabombPoint1 = actors["ParabombPoint1"]; parabombPoint1 = actors["ParabombPoint1"];
parabombPoint2 = actors["ParabombPoint2"]; parabombPoint2 = actors["ParabombPoint2"];
sovietBarracks = actors["SovietBarracks"]; sovietBarracks = actors["SovietBarracks"];
@@ -459,6 +463,9 @@ namespace OpenRA.Mods.RA.Missions
yakEntryPoint = actors["YakEntryPoint"]; yakEntryPoint = actors["YakEntryPoint"];
yakAttackPoint = actors["YakAttackPoint"]; yakAttackPoint = actors["YakAttackPoint"];
alliedBaseTopLeft = actors["AlliedBaseTopLeft"].Location;
alliedBaseBottomRight = actors["AlliedBaseBottomRight"].Location;
SetupAlliedBase(); SetupAlliedBase();
var shroud = allies1.Shroud; var shroud = allies1.Shroud;

View File

@@ -410,7 +410,7 @@ namespace OpenRA.Mods.RA.Missions
}; };
lab = actors["Lab"]; lab = actors["Lab"];
lab.AddTrait(new InfiltrateForMissionObjective(OnLabInfiltrated)); lab.AddTrait(new InfiltrateAction(OnLabInfiltrated));
lab.AddTrait(new TransformedAction(self => lab = self)); lab.AddTrait(new TransformedAction(self => lab = self));
reinforcementsEntryPoint = actors["ReinforcementsEntryPoint"]; reinforcementsEntryPoint = actors["ReinforcementsEntryPoint"];
@@ -466,7 +466,7 @@ namespace OpenRA.Mods.RA.Missions
{ {
OldOwner = self.Owner; OldOwner = self.Owner;
self.AddTrait(new InfiltrateForMissionObjective(OnTruckHijacked)); self.AddTrait(new InfiltrateAction(OnTruckHijacked));
} }
public void OnInfiltrate(Actor self, Actor spy) public void OnInfiltrate(Actor self, Actor spy)

View File

@@ -232,11 +232,11 @@ namespace OpenRA.Mods.RA.Missions
} }
} }
class InfiltrateForMissionObjective : IAcceptInfiltrator class InfiltrateAction : IAcceptInfiltrator
{ {
Action<Actor> a; Action<Actor> a;
public InfiltrateForMissionObjective(Action<Actor> a) public InfiltrateAction(Action<Actor> a)
{ {
this.a = a; this.a = a;
} }

View File

@@ -339,7 +339,7 @@ namespace OpenRA.Mods.RA.Missions
world.CreateActor("camera", greece, provingGroundsCameraPoint.Location, null); world.CreateActor("camera", greece, provingGroundsCameraPoint.Location, null);
superTankDome = actors["SuperTankDome"]; superTankDome = actors["SuperTankDome"];
superTankDome.AddTrait(new InfiltrateForMissionObjective(OnSuperTankDomeInfiltrated)); superTankDome.AddTrait(new InfiltrateAction(OnSuperTankDomeInfiltrated));
superTankDome.AddTrait(new TransformedAction(self => superTankDome = self)); superTankDome.AddTrait(new TransformedAction(self => superTankDome = self));
Game.MoveViewport(startEntryPoint.Location.ToFloat2()); Game.MoveViewport(startEntryPoint.Location.ToFloat2());

View File

@@ -1174,6 +1174,9 @@ Actors:
Actor346: t15 Actor346: t15
Location: 57,24 Location: 57,24
Owner: Neutral Owner: Neutral
Actor1000: camera.large
Location: 1,1
Owner: Soviets
Smudges: Smudges:
@@ -1295,6 +1298,13 @@ Rules:
BRIK: BRIK:
Buildable: Buildable:
Owner: None Owner: None
MRJ:
Buildable:
Owner: None
CAMERA.Large:
Inherits: CAMERA
RevealsShroud:
Range: 1000
Sequences: Sequences:

View File

@@ -341,6 +341,9 @@ Actors:
Actor29: kenn Actor29: kenn
Location: 23,28 Location: 23,28
Owner: Soviets Owner: Soviets
Actor1000: camera.large
Location: 1,1
Owner: Soviets
Smudges: Smudges:
@@ -391,6 +394,10 @@ Rules:
^Building: ^Building:
GivesBounty: GivesBounty:
Percentage: 0 Percentage: 0
CAMERA.Large:
Inherits: CAMERA
RevealsShroud:
Range: 1000
Sequences: Sequences:

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1422,6 +1422,9 @@ Actors:
ParadropBoxTopLeft: waypoint ParadropBoxTopLeft: waypoint
Location: 78,27 Location: 78,27
Owner: Neutral Owner: Neutral
Actor1000: camera.large
Location: 1,1
Owner: Soviets
Smudges: Smudges:
@@ -1540,6 +1543,9 @@ Rules:
CTNK: CTNK:
Buildable: Buildable:
Owner: None Owner: None
MRJ:
Buildable:
Owner: None
MGG: MGG:
Buildable: Buildable:
Owner: None Owner: None
@@ -1548,6 +1554,10 @@ Rules:
GAP: GAP:
Buildable: Buildable:
Owner: None Owner: None
CAMERA.Large:
Inherits: CAMERA
RevealsShroud:
Range: 1000
Sequences: Sequences:

View File

@@ -1793,6 +1793,9 @@ Actors:
Actor533: brl3 Actor533: brl3
Location: 54,88 Location: 54,88
Owner: Neutral Owner: Neutral
Actor1000: camera.large
Location: 1,1
Owner: Soviets
Smudges: Smudges:
@@ -1970,9 +1973,16 @@ Rules:
MGG: MGG:
Buildable: Buildable:
Owner: None Owner: None
MRJ:
Buildable:
Owner: None
GAP: GAP:
Buildable: Buildable:
Owner: None Owner: None
CAMERA.Large:
Inherits: CAMERA
RevealsShroud:
Range: 1000
Sequences: Sequences:
truk: truk:

View File

@@ -2523,6 +2523,12 @@ Actors:
waypoint99: waypoint waypoint99: waypoint
Location: 68,63 Location: 68,63
Owner: Neutral Owner: Neutral
Actor1000: camera.large
Location: 1,1
Owner: USSR
Actor1001: camera.large
Location: 1,1
Owner: Turkey
Smudges: Smudges:
@@ -2711,6 +2717,13 @@ Rules:
GAP: GAP:
Buildable: Buildable:
Owner: None Owner: None
MRJ:
Buildable:
Owner: None
CAMERA.Large:
Inherits: CAMERA
RevealsShroud:
Range: 1000
Sequences: Sequences:

View File

@@ -832,6 +832,9 @@ Actors:
waypoint98: waypoint waypoint98: waypoint
Location: 44,79 Location: 44,79
Owner: Neutral Owner: Neutral
Actor1000: camera.large
Location: 1,1
Owner: France
Smudges: Smudges:
@@ -925,6 +928,10 @@ Rules:
Image: V07 Image: V07
Soviet01ClassicContainsActors: Soviet01ClassicContainsActors:
Actors: c1, c6 Actors: c1, c6
CAMERA.Large:
Inherits: CAMERA
RevealsShroud:
Range: 1000
Sequences: Sequences: