Add general attack code to shellmap
This commit is contained in:
@@ -41,15 +41,19 @@ namespace OpenRA.Mods.RA.Missions
|
||||
Actor paradropEntry;
|
||||
static readonly string[] ParadropUnits = { "e1", "e1", "e1", "e2", "e2" };
|
||||
|
||||
Actor offmapAttackerSpawn1;
|
||||
Actor offmapAttackerSpawn2;
|
||||
Actor offmapAttackerSpawn3;
|
||||
Actor[] offmapAttackerSpawns;
|
||||
static readonly string[] OffmapAttackers = { "ftrk", "apc", "ttnk", "1tnk" };
|
||||
|
||||
Dictionary<string, Actor> mapActors;
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
MissionUtils.CapOre(soviets);
|
||||
if (world.FrameNumber % 20 == 0 && coastUnitsLeft-- > 0)
|
||||
if (world.FrameNumber % 100 == 0)
|
||||
{
|
||||
var u = world.CreateActor(CoastUnits.Random(world.SharedRandom), soviets, coastRP1.Location, null);
|
||||
u.QueueActivity(new Move.Move(coastRP2.Location, 0));
|
||||
var u = world.CreateActor(OffmapAttackers.Random(world.SharedRandom), soviets, offmapAttackerSpawns.Random(world.SharedRandom).Location, 128);
|
||||
u.QueueActivity(new AttackMove.AttackMoveActivity(u, new Move.Move(attackLocation.Location, 0)));
|
||||
}
|
||||
|
||||
@@ -58,6 +62,13 @@ namespace OpenRA.Mods.RA.Missions
|
||||
.Except(mapActors.Values))
|
||||
actor.QueueActivity(new AttackMove.AttackMoveActivity(actor, new Move.Move(attackLocation.Location, 0)));
|
||||
|
||||
if (world.FrameNumber % 20 == 0 && coastUnitsLeft-- > 0)
|
||||
{
|
||||
var u = world.CreateActor(CoastUnits.Random(world.SharedRandom), soviets, coastRP1.Location, null);
|
||||
u.QueueActivity(new Move.Move(coastRP2.Location, 0));
|
||||
u.QueueActivity(new AttackMove.AttackMoveActivity(u, new Move.Move(attackLocation.Location, 0)));
|
||||
}
|
||||
|
||||
if (--waitTicks <= 0)
|
||||
{
|
||||
if (++mul <= div)
|
||||
@@ -75,6 +86,8 @@ namespace OpenRA.Mods.RA.Missions
|
||||
MissionUtils.Paradrop(world, soviets, ParadropUnits, paradropEntry.Location, paradropLZ.Location);
|
||||
}
|
||||
}
|
||||
|
||||
MissionUtils.CapOre(soviets);
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
@@ -99,6 +112,11 @@ namespace OpenRA.Mods.RA.Missions
|
||||
var t5 = mapActors["ViewportTarget5"];
|
||||
viewportTargets = new[] { t1, t2, t3, t4, t5 }.Select(t => t.Location.ToInt2()).ToList();
|
||||
|
||||
offmapAttackerSpawn1 = mapActors["OffmapAttackerSpawn1"];
|
||||
offmapAttackerSpawn2 = mapActors["OffmapAttackerSpawn2"];
|
||||
offmapAttackerSpawn3 = mapActors["OffmapAttackerSpawn3"];
|
||||
offmapAttackerSpawns = new[] { offmapAttackerSpawn1, offmapAttackerSpawn2, offmapAttackerSpawn3 };
|
||||
|
||||
foreach (var actor in mapActors.Values.Where(a => a.Owner == allies || a.HasTrait<Bridge>()))
|
||||
{
|
||||
if (actor.Owner == allies && actor.HasTrait<AutoTarget>())
|
||||
|
||||
@@ -26,6 +26,7 @@ Players:
|
||||
OwnsWorld: True
|
||||
NonCombatant: True
|
||||
Race: allies
|
||||
Allies: Allies
|
||||
PlayerReference@Creeps:
|
||||
Name: Creeps
|
||||
NonCombatant: True
|
||||
@@ -34,6 +35,7 @@ Players:
|
||||
Name: Allies
|
||||
Race: allies
|
||||
ColorRamp: 161,134,200,30
|
||||
Allies: Neutral
|
||||
Enemies: Soviets
|
||||
PlayerReference@Soviets:
|
||||
Name: Soviets
|
||||
@@ -159,9 +161,9 @@ Actors:
|
||||
Actor38: v28
|
||||
Location: 59,68
|
||||
Owner: Neutral
|
||||
Actor39: v27.gun
|
||||
Actor39: v27
|
||||
Location: 63,68
|
||||
Owner: Allies
|
||||
Owner: Neutral
|
||||
Actor40: dome
|
||||
Location: 55,19
|
||||
Owner: Soviets
|
||||
@@ -180,9 +182,9 @@ Actors:
|
||||
Actor45: v28.gun
|
||||
Location: 47,63
|
||||
Owner: Allies
|
||||
Actor46: v22
|
||||
Actor46: v22.gun
|
||||
Location: 61,63
|
||||
Owner: Neutral
|
||||
Owner: Allies
|
||||
Actor47: v27
|
||||
Location: 55,65
|
||||
Owner: Neutral
|
||||
@@ -737,6 +739,15 @@ Actors:
|
||||
Actor212: flare
|
||||
Location: 43,79
|
||||
Owner: Neutral
|
||||
OffmapAttackerSpawn1: waypoint
|
||||
Location: 10,1
|
||||
Owner: Neutral
|
||||
OffmapAttackerSpawn2: waypoint
|
||||
Location: 84,1
|
||||
Owner: Neutral
|
||||
OffmapAttackerSpawn3: waypoint
|
||||
Location: 1,50
|
||||
Owner: Neutral
|
||||
|
||||
Smudges:
|
||||
|
||||
@@ -751,10 +762,10 @@ Rules:
|
||||
TRAN.Husk2:
|
||||
Burns:
|
||||
Damage: 0
|
||||
V27.Gun:
|
||||
Inherits: V27
|
||||
V22.Gun:
|
||||
Inherits: V22
|
||||
RenderBuilding:
|
||||
Image: V27
|
||||
Image: V22
|
||||
AutoTarget:
|
||||
Armament:
|
||||
Weapon: Dragon
|
||||
|
||||
Reference in New Issue
Block a user