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