Merge pull request #10365 from reaperrr/fix-missile-effects
Misc Missile and CreateEffectWarhead tweaks
This commit is contained in:
@@ -76,6 +76,9 @@ namespace OpenRA.Mods.Common.Effects
|
|||||||
[Desc("Vertical rate of turn.")]
|
[Desc("Vertical rate of turn.")]
|
||||||
public readonly int VerticalRateOfTurn = 6;
|
public readonly int VerticalRateOfTurn = 6;
|
||||||
|
|
||||||
|
[Desc("Gravity applied while in free fall.")]
|
||||||
|
public readonly int Gravity = 10;
|
||||||
|
|
||||||
[Desc("Run out of fuel after being activated this many ticks. Zero for unlimited fuel.")]
|
[Desc("Run out of fuel after being activated this many ticks. Zero for unlimited fuel.")]
|
||||||
public readonly int RangeLimit = 0;
|
public readonly int RangeLimit = 0;
|
||||||
|
|
||||||
@@ -152,8 +155,7 @@ namespace OpenRA.Mods.Common.Effects
|
|||||||
readonly ProjectileArgs args;
|
readonly ProjectileArgs args;
|
||||||
readonly Animation anim;
|
readonly Animation anim;
|
||||||
|
|
||||||
// NOTE: Might be desirable to unhardcode the number -10
|
readonly WVec gravity;
|
||||||
readonly WVec gravity = new WVec(0, 0, -10);
|
|
||||||
|
|
||||||
int ticks;
|
int ticks;
|
||||||
|
|
||||||
@@ -191,6 +193,7 @@ namespace OpenRA.Mods.Common.Effects
|
|||||||
|
|
||||||
pos = args.Source;
|
pos = args.Source;
|
||||||
hFacing = args.Facing;
|
hFacing = args.Facing;
|
||||||
|
gravity = new WVec(0, 0, -info.Gravity);
|
||||||
targetPosition = args.PassiveTarget;
|
targetPosition = args.PassiveTarget;
|
||||||
|
|
||||||
var world = args.SourceActor.World;
|
var world = args.SourceActor.World;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Warheads
|
|||||||
if (dat.Length > airMargin.Length)
|
if (dat.Length > airMargin.Length)
|
||||||
return isDirectHit ? ImpactType.AirHit : ImpactType.Air;
|
return isDirectHit ? ImpactType.AirHit : ImpactType.Air;
|
||||||
|
|
||||||
if (dat.Length <= 0 && world.Map.GetTerrainInfo(cell).IsWater)
|
if (dat.Length <= airMargin.Length && world.Map.GetTerrainInfo(cell).IsWater)
|
||||||
return isDirectHit ? ImpactType.WaterHit : ImpactType.Water;
|
return isDirectHit ? ImpactType.WaterHit : ImpactType.Water;
|
||||||
|
|
||||||
if (isDirectHit)
|
if (isDirectHit)
|
||||||
@@ -77,8 +77,8 @@ namespace OpenRA.Mods.Common.Warheads
|
|||||||
if (healthInfo == null)
|
if (healthInfo == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If the impact position is within any actor's health radius, we have a direct hit
|
// If the impact position is within any actor's HitShape, we have a direct hit
|
||||||
if ((unit.CenterPosition - pos).LengthSquared <= healthInfo.Shape.OuterRadius.LengthSquared)
|
if ((unit.CenterPosition - pos).LengthSquared <= healthInfo.Shape.DistanceFromEdge(pos, unit).LengthSquared)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user