new setting to allow unlucky paratroopers
This commit is contained in:
@@ -99,7 +99,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
plane.CancelActivity();
|
||||
plane.QueueActivity(new FlyAttack(Target.FromCell(w, p)));
|
||||
plane.Trait<ParaDrop>().SetLZ(p);
|
||||
plane.Trait<ParaDrop>().SetLZ(p, true);
|
||||
plane.Trait<Cargo>().Load(plane, crate);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -24,6 +24,9 @@ namespace OpenRA.Mods.RA
|
||||
public readonly string ChuteSound = "chute1.aud";
|
||||
public readonly bool EjectInAir = false;
|
||||
public readonly bool EjectOnGround = false;
|
||||
|
||||
[Desc("Risks stuck units when they don't have the Paratrooper trait.")]
|
||||
public readonly bool AllowUnsuitableCell = false;
|
||||
}
|
||||
|
||||
public class EjectOnDeath : INotifyKilled
|
||||
@@ -47,7 +50,7 @@ namespace OpenRA.Mods.RA
|
||||
new TypeDictionary { new OwnerInit(self.Owner), new LocationInit(self.Location) });
|
||||
|
||||
|
||||
if (IsSuitableCell(self, pilot))
|
||||
if (info.AllowUnsuitableCell || IsSuitableCell(self, pilot))
|
||||
{
|
||||
if (cp.Z > 0)
|
||||
{
|
||||
|
||||
@@ -24,13 +24,15 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public class ParaDrop : ITick
|
||||
{
|
||||
bool checkForSuitableCell;
|
||||
readonly List<CPos> droppedAt = new List<CPos>();
|
||||
CPos lz;
|
||||
|
||||
public void SetLZ(CPos lz)
|
||||
public void SetLZ(CPos lz, bool checkLandingCell)
|
||||
{
|
||||
this.lz = lz;
|
||||
droppedAt.Clear();
|
||||
checkForSuitableCell = checkLandingCell;
|
||||
}
|
||||
|
||||
public void Tick(Actor self)
|
||||
@@ -45,7 +47,7 @@ namespace OpenRA.Mods.RA
|
||||
FinishedDropping(self);
|
||||
else
|
||||
{
|
||||
if (!IsSuitableCell(cargo.Peek(self), self.Location))
|
||||
if (checkForSuitableCell && !IsSuitableCell(cargo.Peek(self), self.Location))
|
||||
return;
|
||||
|
||||
// unload a dude here
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.RA.Scripting
|
||||
[Desc("Command transport to paradrop passengers near the target cell.")]
|
||||
public void Paradrop(CPos cell)
|
||||
{
|
||||
paradrop.SetLZ(cell);
|
||||
paradrop.SetLZ(cell, true);
|
||||
self.QueueActivity(new FlyAttack(Target.FromCell(self.World, cell)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@ namespace OpenRA.Mods.RA
|
||||
[Desc("In game ticks. Default value equates to 2 minutes.")]
|
||||
public readonly int FlareTime = 25 * 60 * 2;
|
||||
|
||||
[Desc("Risks stuck units when they don't have the Paratrooper trait.")]
|
||||
public readonly bool AllowImpassableCells = false;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new ParatroopersPower(init.self, this); }
|
||||
}
|
||||
|
||||
@@ -66,7 +69,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
a.CancelActivity();
|
||||
a.QueueActivity(new FlyAttack(Target.FromOrder(self.World, order)));
|
||||
a.Trait<ParaDrop>().SetLZ(order.TargetLocation);
|
||||
a.Trait<ParaDrop>().SetLZ(order.TargetLocation, !info.AllowImpassableCells);
|
||||
|
||||
var cargo = a.Trait<Cargo>();
|
||||
foreach (var i in items)
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
SuccessRate: 20
|
||||
EjectOnGround: yes
|
||||
EjectInAir: no
|
||||
AllowUnsuitableCell: no
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
Demolishable:
|
||||
@@ -99,6 +100,7 @@
|
||||
SuccessRate: 20
|
||||
EjectOnGround: yes
|
||||
EjectInAir: no
|
||||
AllowUnsuitableCell: no
|
||||
Huntable:
|
||||
LuaScriptEvents:
|
||||
Demolishable:
|
||||
@@ -235,6 +237,7 @@
|
||||
SuccessRate: 50
|
||||
EjectOnGround: no
|
||||
EjectInAir: yes
|
||||
AllowUnsuitableCell: yes
|
||||
GivesBounty:
|
||||
GpsDot:
|
||||
String: Plane
|
||||
|
||||
@@ -905,6 +905,7 @@ AFLD:
|
||||
LongDesc: A Badger drops a squad of infantry\nanywhere on the map.
|
||||
DropItems: E1,E1,E1,E3,E3
|
||||
SelectTargetSound: slcttgt1.aud
|
||||
AllowImpassableCells: false
|
||||
ProductionBar:
|
||||
SupportPowerChargeBar:
|
||||
PrimaryBuilding:
|
||||
|
||||
Reference in New Issue
Block a user