Add Soviet attacks, scrap chinook timer since we might have pathing issues if Tanya is on the island and we have off-map attacks. Counter this by bringing back reinforcements timer
This commit is contained in:
@@ -15,6 +15,7 @@ using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
@@ -56,7 +57,16 @@ namespace OpenRA.Mods.RA.Missions
|
||||
Player allies2;
|
||||
Player soviets;
|
||||
|
||||
Actor sovietBarracks;
|
||||
Actor sovietWarFactory;
|
||||
|
||||
const string InfantryQueueName = "Infantry";
|
||||
const string VehicleQueueName = "Vehicle";
|
||||
static readonly string[] sovietInfantry = { "e1", "e2", "e3", "dog" };
|
||||
static readonly string[] sovietVehicles = { "3tnk", "v2rl" };
|
||||
|
||||
static readonly string[] reinforcements = { "1tnk", "1tnk", "jeep", "mcv" };
|
||||
|
||||
const string ChinookName = "tran";
|
||||
const string SignalFlareName = "flare";
|
||||
const string EngineerName = "e6";
|
||||
@@ -96,9 +106,13 @@ namespace OpenRA.Mods.RA.Missions
|
||||
{
|
||||
DisplayObjective();
|
||||
}
|
||||
if (world.FrameNumber == 200)
|
||||
if (world.FrameNumber == 25 * 10)
|
||||
{
|
||||
SendReinforcements();
|
||||
StartReinforcementsTimer();
|
||||
}
|
||||
if (world.FrameNumber % 25 == 0)
|
||||
{
|
||||
BuildSovietUnits();
|
||||
}
|
||||
if (!engineerMiss.Destroyed && engineer == null && AlliesControlMiss())
|
||||
{
|
||||
@@ -113,7 +127,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
DisplayObjective();
|
||||
SpawnSignalFlare();
|
||||
Sound.Play("flaren1.aud");
|
||||
StartChinookTimer();
|
||||
SendChinook();
|
||||
}
|
||||
}
|
||||
else if (currentObjective == 1)
|
||||
@@ -133,14 +147,48 @@ namespace OpenRA.Mods.RA.Missions
|
||||
}
|
||||
}
|
||||
|
||||
void InitializeSovietAI()
|
||||
void BuildSovietUnits()
|
||||
{
|
||||
if (!Game.IsHost)
|
||||
var powerManager = soviets.PlayerActor.Trait<PowerManager>();
|
||||
if (powerManager.ExcessPower < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var logic = world.LocalPlayer.PlayerActor.TraitsImplementing<IBot>().First(b => b.Info.Name == "Soviet AI");
|
||||
logic.Activate(soviets);
|
||||
if (!sovietBarracks.Destroyed)
|
||||
{
|
||||
BuildUnitIfQueueIdle(soviets, InfantryQueueName, sovietInfantry[world.SharedRandom.Next(sovietInfantry.Length)]);
|
||||
}
|
||||
if (!sovietWarFactory.Destroyed)
|
||||
{
|
||||
BuildUnitIfQueueIdle(soviets, VehicleQueueName, sovietVehicles[world.SharedRandom.Next(sovietVehicles.Length)]);
|
||||
}
|
||||
}
|
||||
|
||||
void InitializeSoviets()
|
||||
{
|
||||
var res = soviets.PlayerActor.Trait<PlayerResources>();
|
||||
res.GiveCash(100000);
|
||||
sovietBarracks.Trait<RallyPoint>().rallyPoint = allies2BasePoint.Location;
|
||||
sovietWarFactory.Trait<RallyPoint>().rallyPoint = allies2BasePoint.Location;
|
||||
sovietBarracks.Trait<PrimaryBuilding>().SetPrimaryProducer(sovietBarracks, true);
|
||||
sovietWarFactory.Trait<PrimaryBuilding>().SetPrimaryProducer(sovietWarFactory, true);
|
||||
}
|
||||
|
||||
IEnumerable<ProductionQueue> FindQueues(Player player, string category)
|
||||
{
|
||||
return world.ActorsWithTrait<ProductionQueue>()
|
||||
.Where(a => a.Actor.Owner == player && a.Trait.Info.Type == category)
|
||||
.Select(a => a.Trait);
|
||||
}
|
||||
|
||||
void BuildUnitIfQueueIdle(Player player, string category, string unit)
|
||||
{
|
||||
var queue = FindQueues(player, category).FirstOrDefault(q => q.CurrentItem() == null);
|
||||
if (queue == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
world.IssueOrder(Order.StartProduction(queue.self, unit, 1));
|
||||
}
|
||||
|
||||
void SpawnSignalFlare()
|
||||
@@ -148,17 +196,17 @@ namespace OpenRA.Mods.RA.Missions
|
||||
world.CreateActor(SignalFlareName, new TypeDictionary { new OwnerInit(allies1), new LocationInit(extractionLZ.Location) });
|
||||
}
|
||||
|
||||
void StartChinookTimer()
|
||||
void StartReinforcementsTimer()
|
||||
{
|
||||
var timer = new CountdownTimerWidget("Extraction arrives in", 1500 * 6, ChinookTimerExpired, new float2(128, 96));
|
||||
Sound.Play("timergo1.aud");
|
||||
var timer = new CountdownTimerWidget("Reinforcements arrive in", 1500 * 12, ReinforcementsTimerExpired, new float2(128, 96));
|
||||
Ui.Root.AddChild(timer);
|
||||
}
|
||||
|
||||
void ChinookTimerExpired(CountdownTimerWidget timer)
|
||||
void ReinforcementsTimerExpired(CountdownTimerWidget timer)
|
||||
{
|
||||
Sound.Play("reinfor1.aud");
|
||||
timer.Visible = false;
|
||||
SendChinook();
|
||||
SendReinforcements();
|
||||
}
|
||||
|
||||
void SendReinforcements()
|
||||
@@ -225,12 +273,14 @@ namespace OpenRA.Mods.RA.Missions
|
||||
extractionLZ = actors["ExtractionLZ"];
|
||||
extractionLZEntryPoint = actors["ExtractionLZEntryPoint"];
|
||||
engineerMiss = actors["EngineerMiss"];
|
||||
sovietBarracks = actors["SovietBarracks"];
|
||||
sovietWarFactory = actors["SovietWarFactory"];
|
||||
w.WorldActor.Trait<Shroud>().Explore(w, sam1.Location, 2);
|
||||
w.WorldActor.Trait<Shroud>().Explore(w, sam2.Location, 2);
|
||||
w.WorldActor.Trait<Shroud>().Explore(w, sam3.Location, 2);
|
||||
w.WorldActor.Trait<Shroud>().Explore(w, sam4.Location, 2);
|
||||
Game.MoveViewport(((w.LocalPlayer ?? allies1) == allies1 ? chinookHusk.Location : allies2BasePoint.Location).ToFloat2());
|
||||
InitializeSovietAI();
|
||||
InitializeSoviets();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -374,7 +374,7 @@ Actors:
|
||||
Actor529: brik
|
||||
Location: 55,71
|
||||
Owner: Soviets
|
||||
Actor287: barr
|
||||
SovietBarracks: barr
|
||||
Location: 54,57
|
||||
Owner: Soviets
|
||||
Actor256: e1
|
||||
@@ -647,7 +647,7 @@ Actors:
|
||||
Actor138: tc01
|
||||
Location: 104,82
|
||||
Owner: Neutral
|
||||
Actor170: weap
|
||||
SovietWarFactory: weap
|
||||
Location: 50,43
|
||||
Owner: Soviets
|
||||
Actor164: e1
|
||||
@@ -938,7 +938,7 @@ Actors:
|
||||
Actor401: brik
|
||||
Location: 50,72
|
||||
Owner: Soviets
|
||||
Actor54: barr
|
||||
Actor287: barr
|
||||
Location: 74,82
|
||||
Owner: Soviets
|
||||
Actor311: t10
|
||||
@@ -1427,11 +1427,11 @@ Actors:
|
||||
Actor452: tent
|
||||
Location: 36,97
|
||||
Owner: Allies2
|
||||
Actor453: proc
|
||||
Location: 27,96
|
||||
Actor478: gun
|
||||
Location: 37,95
|
||||
Owner: Allies2
|
||||
Actor457: weap
|
||||
Location: 30,104
|
||||
Actor170: weap
|
||||
Location: 23,103
|
||||
Owner: Allies2
|
||||
Actor459: powr
|
||||
Location: 38,101
|
||||
@@ -1448,9 +1448,9 @@ Actors:
|
||||
Actor83: dome
|
||||
Location: 36,108
|
||||
Owner: Allies2
|
||||
Allies2BasePoint: waypoint
|
||||
Location: 32,97
|
||||
Owner: Neutral
|
||||
Actor484: pbox.e1
|
||||
Location: 33,98
|
||||
Owner: Allies2
|
||||
Actor183: brik
|
||||
Location: 24,47
|
||||
Owner: Soviets
|
||||
@@ -1479,7 +1479,7 @@ Actors:
|
||||
Location: 30,87
|
||||
Owner: Soviets
|
||||
ReinforcementsEntryPoint: waypoint
|
||||
Location: 24,111
|
||||
Location: 31,111
|
||||
Owner: Neutral
|
||||
Actor456: cycl
|
||||
Location: 36,85
|
||||
@@ -1718,17 +1718,17 @@ Actors:
|
||||
Actor451: e1
|
||||
Location: 35,88
|
||||
Owner: Soviets
|
||||
Actor476: pbox.e1
|
||||
Location: 31,95
|
||||
Owner: Allies2
|
||||
Actor484: gun
|
||||
Location: 37,95
|
||||
Allies2BasePoint: waypoint
|
||||
Location: 31,107
|
||||
Owner: Neutral
|
||||
Actor54: proc
|
||||
Location: 25,95
|
||||
Owner: Allies2
|
||||
Actor470: cycl
|
||||
Location: 31,84
|
||||
Owner: Soviets
|
||||
Actor478: gun
|
||||
Location: 25,95
|
||||
Actor476: gun
|
||||
Location: 29,95
|
||||
Owner: Allies2
|
||||
Actor477: e2
|
||||
Location: 34,87
|
||||
@@ -1748,16 +1748,6 @@ Smudges:
|
||||
Rules:
|
||||
Player:
|
||||
-ConquestVictoryConditions:
|
||||
HackyAI@SovietAI:
|
||||
Name: Soviet AI
|
||||
BuildingFractions:
|
||||
UnitsToBuild:
|
||||
dog: 10%
|
||||
e1: 50%
|
||||
e2: 20%
|
||||
e3: 10%
|
||||
3tnk: 50%
|
||||
SquadSize: 10
|
||||
World:
|
||||
-CrateDrop:
|
||||
-SpawnMPUnits:
|
||||
|
||||
Reference in New Issue
Block a user