Convert Altitude to world coords.
Removes the obsolete AltitudeInit: use CenterPositionInit instead.
This commit is contained in:
@@ -267,12 +267,12 @@ namespace OpenRA.Mods.RA.Missions
|
||||
{
|
||||
if (yak == null)
|
||||
{
|
||||
var altitude = Rules.Info[YakName].Traits.Get<PlaneInfo>().CruiseAltitude;
|
||||
yak = world.CreateActor(YakName, new TypeDictionary
|
||||
{
|
||||
new LocationInit(yakEntryPoint.Location),
|
||||
new CenterPositionInit(yakEntryPoint.CenterPosition + new WVec(WRange.Zero, WRange.Zero, altitude)),
|
||||
new OwnerInit(soviets),
|
||||
new FacingInit(Traits.Util.GetFacing(yakAttackPoint.Location - yakEntryPoint.Location, 0)),
|
||||
new AltitudeInit(Rules.Info[YakName].Traits.Get<PlaneInfo>().CruiseAltitude)
|
||||
new FacingInit(Traits.Util.GetFacing(yakAttackPoint.Location - yakEntryPoint.Location, 0))
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -73,13 +73,14 @@ namespace OpenRA.Mods.RA.Missions
|
||||
|
||||
public static void Paradrop(World world, Player owner, IEnumerable<string> units, CPos entry, CPos location)
|
||||
{
|
||||
var altitude = Rules.Info["badr"].Traits.Get<PlaneInfo>().CruiseAltitude;
|
||||
var badger = world.CreateActor("badr", new TypeDictionary
|
||||
{
|
||||
new LocationInit(entry),
|
||||
new CenterPositionInit(entry.CenterPosition + new WVec(WRange.Zero, WRange.Zero, altitude)),
|
||||
new OwnerInit(owner),
|
||||
new FacingInit(Util.GetFacing(location - entry, 0)),
|
||||
new AltitudeInit(Rules.Info["badr"].Traits.Get<PlaneInfo>().CruiseAltitude),
|
||||
new FacingInit(Util.GetFacing(location - entry, 0))
|
||||
});
|
||||
|
||||
badger.QueueActivity(new FlyAttack(Target.FromCell(location)));
|
||||
badger.Trait<ParaDrop>().SetLZ(location);
|
||||
var cargo = badger.Trait<Cargo>();
|
||||
@@ -91,13 +92,14 @@ namespace OpenRA.Mods.RA.Missions
|
||||
|
||||
public static void Parabomb(World world, Player owner, CPos entry, CPos location)
|
||||
{
|
||||
var altitude = Rules.Info["badr.bomber"].Traits.Get<PlaneInfo>().CruiseAltitude;
|
||||
var badger = world.CreateActor("badr.bomber", new TypeDictionary
|
||||
{
|
||||
new LocationInit(entry),
|
||||
new CenterPositionInit(entry.CenterPosition + new WVec(WRange.Zero, WRange.Zero, altitude)),
|
||||
new OwnerInit(owner),
|
||||
new FacingInit(Util.GetFacing(location - entry, 0)),
|
||||
new AltitudeInit(Rules.Info["badr.bomber"].Traits.Get<PlaneInfo>().CruiseAltitude),
|
||||
new FacingInit(Util.GetFacing(location - entry, 0))
|
||||
});
|
||||
|
||||
badger.Trait<AttackBomber>().SetTarget(location.CenterPosition);
|
||||
badger.QueueActivity(Fly.ToCell(location));
|
||||
badger.QueueActivity(new FlyOffMap());
|
||||
|
||||
@@ -104,12 +104,12 @@ namespace OpenRA.Mods.RA.Missions
|
||||
foreach (var airfield in airfields)
|
||||
{
|
||||
var entry = airfield.Location - new CVec(10, 0);
|
||||
var altitude = Rules.Info["yak"].Traits.Get<PlaneInfo>().CruiseAltitude;
|
||||
var yak = world.CreateActor("yak", new TypeDictionary
|
||||
{
|
||||
new CenterPositionInit(entry.CenterPosition + new WVec(WRange.Zero, WRange.Zero, altitude)),
|
||||
new OwnerInit(ussr),
|
||||
new LocationInit(entry),
|
||||
new FacingInit(Traits.Util.GetFacing(airfield.Location - entry, 0)),
|
||||
new AltitudeInit(Rules.Info["yak"].Traits.Get<PlaneInfo>().CruiseAltitude)
|
||||
new FacingInit(Traits.Util.GetFacing(airfield.Location - entry, 0))
|
||||
});
|
||||
|
||||
while (yak.Trait<LimitedAmmo>().TakeAmmo()) { }
|
||||
|
||||
Reference in New Issue
Block a user