Merge pull request #7896 from reaperrr/missile-hit

Tweaks RA and TD helicopter weapon minimum ranges
This commit is contained in:
Pavel Penev
2015-04-07 16:07:47 -07:00
6 changed files with 31 additions and 3 deletions

View File

@@ -57,6 +57,19 @@ namespace OpenRA.Mods.Common.Activities
if (!target.IsInRange(self.CenterPosition, attackHeli.GetMaximumRange())) if (!target.IsInRange(self.CenterPosition, attackHeli.GetMaximumRange()))
helicopter.SetPosition(self, helicopter.CenterPosition + helicopter.FlyStep(desiredFacing)); helicopter.SetPosition(self, helicopter.CenterPosition + helicopter.FlyStep(desiredFacing));
// Fly backwards from the target
// TODO: Same problem as with MaximumRange
if (target.IsInRange(self.CenterPosition, attackHeli.GetMinimumRange()))
{
// Facing 0 doesn't work with the following position change
var facing = 1;
if (desiredFacing != 0)
facing = desiredFacing;
else if (helicopter.Facing != 0)
facing = helicopter.Facing;
helicopter.SetPosition(self, helicopter.CenterPosition + helicopter.FlyStep(-facing));
}
attackHeli.DoAttack(self, target); attackHeli.DoAttack(self, target);
return this; return this;

View File

@@ -157,6 +157,15 @@ namespace OpenRA.Mods.Common.Traits
return Armaments.Any(a => a.Weapon.IsValidAgainst(t, self.World, self)); return Armaments.Any(a => a.Weapon.IsValidAgainst(t, self.World, self));
} }
public WRange GetMinimumRange()
{
if (IsTraitDisabled)
return WRange.Zero;
return Armaments.Where(a => !a.IsTraitDisabled)
.Select(a => a.Weapon.MinRange).Min();
}
public WRange GetMaximumRange() public WRange GetMaximumRange()
{ {
if (IsTraitDisabled) if (IsTraitDisabled)

View File

@@ -70,17 +70,18 @@ OrcaAGMissiles:
Burst: 2 Burst: 2
BurstDelay: 12 BurstDelay: 12
Range: 5c0 Range: 5c0
MinRange: 1c256
Report: BAZOOK1.AUD Report: BAZOOK1.AUD
ValidTargets: Ground ValidTargets: Ground
Projectile: Missile Projectile: Missile
Arm: 0 Arm: 1
Blockable: false Blockable: false
Inaccuracy: 128 Inaccuracy: 128
Image: DRAGON Image: DRAGON
RateOfTurn: 20 RateOfTurn: 20
Trail: smokey Trail: smokey
ContrailLength: 8 ContrailLength: 8
Speed: 298 Speed: 256
RangeLimit: 30 RangeLimit: 30
Warhead@1Dam: SpreadDamage Warhead@1Dam: SpreadDamage
Spread: 128 Spread: 128
@@ -103,6 +104,7 @@ OrcaAAMissiles:
Burst: 2 Burst: 2
BurstDelay: 12 BurstDelay: 12
Range: 5c0 Range: 5c0
MinRange: 1c256
Report: BAZOOK1.AUD Report: BAZOOK1.AUD
ValidTargets: Air ValidTargets: Air
Projectile: Missile Projectile: Missile

View File

@@ -34,6 +34,7 @@ HeliAGGun:
Burst: 2 Burst: 2
BurstDelay: 0 BurstDelay: 0
Range: 4c0 Range: 4c0
MinRange: 0c768
ValidTargets: Ground ValidTargets: Ground
Report: gun5.aud Report: gun5.aud
Projectile: Bullet Projectile: Bullet
@@ -57,6 +58,7 @@ HeliAAGun:
Burst: 2 Burst: 2
BurstDelay: 0 BurstDelay: 0
Range: 4c0 Range: 4c0
MinRange: 0c768
ValidTargets: Air ValidTargets: Air
Report: gun5.aud Report: gun5.aud
Projectile: Bullet Projectile: Bullet

View File

@@ -76,6 +76,7 @@ Dragon:
HellfireAG: HellfireAG:
ReloadDelay: 60 ReloadDelay: 60
Range: 4c0 Range: 4c0
MinRange: 1c256
Report: MISSILE6.AUD Report: MISSILE6.AUD
Burst: 2 Burst: 2
BurstDelay: 10 BurstDelay: 10
@@ -113,6 +114,7 @@ HellfireAG:
HellfireAA: HellfireAA:
ReloadDelay: 60 ReloadDelay: 60
Range: 4c0 Range: 4c0
MinRange: 1c256
Report: MISSILE6.AUD Report: MISSILE6.AUD
Burst: 2 Burst: 2
BurstDelay: 10 BurstDelay: 10

View File

@@ -164,7 +164,7 @@ Vulcan:
ChainGun: ChainGun:
ReloadDelay: 10 ReloadDelay: 10
Range: 5c0 Range: 5c0
MinRange: 1c0 MinRange: 0c768
Report: GUN13.AUD Report: GUN13.AUD
Projectile: Bullet Projectile: Bullet
Speed: 1c682 Speed: 1c682