Add new trait interface INotifyTransformed and use it in Allies 04 to make the transport remove its cargo capacity after it unloads its passengers
This commit is contained in:
@@ -68,6 +68,9 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
|
|
||||||
var a = w.CreateActor( ToActor, init );
|
var a = w.CreateActor( ToActor, init );
|
||||||
|
|
||||||
|
foreach (var nt in self.TraitsImplementing<INotifyTransformed>())
|
||||||
|
nt.OnTransformed(a);
|
||||||
|
|
||||||
if (selected)
|
if (selected)
|
||||||
w.Selection.Add(w, a);
|
w.Selection.Add(w, a);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -278,10 +278,14 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
allies2.PlayerActor.Trait<PlayerResources>().GiveCash(2500);
|
allies2.PlayerActor.Trait<PlayerResources>().GiveCash(2500);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
lst.AddTrait(new Allies04TransformedAction(self =>
|
||||||
|
{
|
||||||
|
self.QueueActivity(new Wait(10));
|
||||||
|
self.QueueActivity(new Move.Move(reinforcementsEntryPoint.Location));
|
||||||
|
self.QueueActivity(new RemoveSelf());
|
||||||
|
}));
|
||||||
lst.QueueActivity(new UnloadCargo(true));
|
lst.QueueActivity(new UnloadCargo(true));
|
||||||
lst.QueueActivity(new Wait(10));
|
lst.QueueActivity(new Transform(lst, "lst.unselectable.nocargo"));
|
||||||
lst.QueueActivity(new Move.Move(reinforcementsEntryPoint.Location));
|
|
||||||
lst.QueueActivity(new RemoveSelf());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Patrol
|
class Patrol
|
||||||
@@ -329,12 +333,16 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
lst.Trait<Cargo>().Load(lst, allies2Spy);
|
lst.Trait<Cargo>().Load(lst, allies2Spy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lst.AddTrait(new Allies04TransformedAction(self =>
|
||||||
|
{
|
||||||
|
self.QueueActivity(new Wait(10));
|
||||||
|
self.QueueActivity(new Move.Move(spyReinforcementsExitPoint.Location));
|
||||||
|
self.QueueActivity(new RemoveSelf());
|
||||||
|
}));
|
||||||
lst.QueueActivity(new Move.Move(spyReinforcementsUnloadPoint.Location));
|
lst.QueueActivity(new Move.Move(spyReinforcementsUnloadPoint.Location));
|
||||||
lst.QueueActivity(new Wait(10));
|
lst.QueueActivity(new Wait(10));
|
||||||
lst.QueueActivity(new UnloadCargo(true));
|
lst.QueueActivity(new UnloadCargo(true));
|
||||||
lst.QueueActivity(new Wait(10));
|
lst.QueueActivity(new Transform(lst, "lst.unselectable.nocargo"));
|
||||||
lst.QueueActivity(new Move.Move(spyReinforcementsExitPoint.Location));
|
|
||||||
lst.QueueActivity(new RemoveSelf());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupSubStances()
|
void SetupSubStances()
|
||||||
@@ -412,7 +420,7 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
patrols = new List<Patrol>
|
patrols = new List<Patrol>
|
||||||
{
|
{
|
||||||
new Patrol(world, new[] { "e1", "e1", "e1", "e1", "e1" }, soviets, patrolPoints1, 0),
|
new Patrol(world, new[] { "e1", "e1", "e1", "e1", "e1" }, soviets, patrolPoints1, 0),
|
||||||
new Patrol(world, new[] { "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints2, 4),
|
new Patrol(world, new[] { "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints2, 2),
|
||||||
new Patrol(world, new[] { "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints4, 0),
|
new Patrol(world, new[] { "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints4, 0),
|
||||||
new Patrol(world, new[] { "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints5, 0),
|
new Patrol(world, new[] { "e1", "dog.patrol", "dog.patrol" }, soviets, patrolPoints5, 0),
|
||||||
};
|
};
|
||||||
@@ -553,4 +561,19 @@ namespace OpenRA.Mods.RA.Missions
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Allies04TransformOnLabInfiltrate { }
|
class Allies04TransformOnLabInfiltrate { }
|
||||||
|
|
||||||
|
class Allies04TransformedAction : INotifyTransformed
|
||||||
|
{
|
||||||
|
Action<Actor> a;
|
||||||
|
|
||||||
|
public Allies04TransformedAction(Action<Actor> a)
|
||||||
|
{
|
||||||
|
this.a = a;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnTransformed(Actor toActor)
|
||||||
|
{
|
||||||
|
a(toActor);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,4 +45,5 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public interface INotifyParachuteLanded { void OnLanded(); }
|
public interface INotifyParachuteLanded { void OnLanded(); }
|
||||||
public interface INotifyTransform { void OnTransform(Actor self); }
|
public interface INotifyTransform { void OnTransform(Actor self); }
|
||||||
|
public interface INotifyTransformed { void OnTransformed(Actor toActor); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1089,9 +1089,6 @@ Actors:
|
|||||||
Actor349: v14
|
Actor349: v14
|
||||||
Location: 66,83
|
Location: 66,83
|
||||||
Owner: Neutral
|
Owner: Neutral
|
||||||
Actor350: v12
|
|
||||||
Location: 64,82
|
|
||||||
Owner: Neutral
|
|
||||||
Actor351: t11
|
Actor351: t11
|
||||||
Location: 62,100
|
Location: 62,100
|
||||||
Owner: Neutral
|
Owner: Neutral
|
||||||
@@ -1848,31 +1845,17 @@ Rules:
|
|||||||
Allies04TransformOnLabInfiltrate:
|
Allies04TransformOnLabInfiltrate:
|
||||||
ToActor: SPEN
|
ToActor: SPEN
|
||||||
LST.Unselectable:
|
LST.Unselectable:
|
||||||
Inherits: ^Ship
|
Inherits: LST
|
||||||
Valued:
|
|
||||||
Cost: 700
|
|
||||||
Tooltip:
|
|
||||||
Name: Transport
|
|
||||||
Health:
|
|
||||||
HP: 350
|
|
||||||
Armor:
|
|
||||||
Type: Heavy
|
|
||||||
Mobile:
|
|
||||||
ROT: 10
|
|
||||||
Speed: 8
|
|
||||||
RevealsShroud:
|
|
||||||
Range: 6
|
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
Image: LST
|
Image: LST
|
||||||
Cargo:
|
Tooltip:
|
||||||
Types: Infantry, Vehicle
|
Icon: lsticon
|
||||||
MaxWeight: 5
|
|
||||||
PipCount: 5
|
|
||||||
IronCurtainable:
|
|
||||||
RepairableNear:
|
|
||||||
AttackMove:
|
|
||||||
JustMove: true
|
|
||||||
-Selectable:
|
-Selectable:
|
||||||
|
LST.Unselectable.NoCargo:
|
||||||
|
Inherits: LST.Unselectable
|
||||||
|
Cargo:
|
||||||
|
MaxWeight: 0
|
||||||
|
PipCount: 0
|
||||||
SPY.Strong:
|
SPY.Strong:
|
||||||
Inherits: ^Infantry
|
Inherits: ^Infantry
|
||||||
RevealsShroud:
|
RevealsShroud:
|
||||||
|
|||||||
Reference in New Issue
Block a user