Refactor handling of hit radii in projectiles.
penev discovered that the RulesetLoaded functions of projectiles were never being called, meaning that their blocking calculations were not properly accounting for actors with large hitboxes. The best fix for this is to change FindActorsOnLine to always account for the largest actor's hit radius, rather than forcing callers to pass the largest radius. Per the comment in Util.cs, as a result, move this computation to ActorMap. I decided to simplify by not making a separate calculation for actors that block projectiles only; this may cause a small performance degradation as the search space is a bit larger. Similarly to this, I've removed the ability to specify a search radius manually. Because this is only a search radius, setting a value smaller than the largest eligible actor makes no sense; that would lead to completely inconsistent blocking. Setting a larger value, on the other hand, would make no difference. CreateEffectWarhead was the only place in core code any of these search radii were set, and that's because 0 was a mysterious magic value that made the warhead incapable of hitting actors. I replaced it with a boolean flag that more clearly indicates the actual behaviour. Fixes #14151.
This commit is contained in:
@@ -229,6 +229,8 @@ namespace OpenRA.Traits
|
|||||||
void RemovePosition(Actor a, IOccupySpace ios);
|
void RemovePosition(Actor a, IOccupySpace ios);
|
||||||
void UpdatePosition(Actor a, IOccupySpace ios);
|
void UpdatePosition(Actor a, IOccupySpace ios);
|
||||||
IEnumerable<Actor> ActorsInBox(WPos a, WPos b);
|
IEnumerable<Actor> ActorsInBox(WPos a, WPos b);
|
||||||
|
|
||||||
|
WDist LargestActorRadius { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IRenderModifier
|
public interface IRenderModifier
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.Common.Projectiles
|
namespace OpenRA.Mods.Common.Projectiles
|
||||||
{
|
{
|
||||||
public class AreaBeamInfo : IProjectileInfo, IRulesetLoaded<WeaponInfo>
|
public class AreaBeamInfo : IProjectileInfo
|
||||||
{
|
{
|
||||||
[Desc("Projectile speed in WDist / tick, two values indicate a randomly picked velocity per beam.")]
|
[Desc("Projectile speed in WDist / tick, two values indicate a randomly picked velocity per beam.")]
|
||||||
public readonly WDist[] Speed = { new WDist(128) };
|
public readonly WDist[] Speed = { new WDist(128) };
|
||||||
@@ -69,28 +69,11 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
[Desc("Beam color is the player's color.")]
|
[Desc("Beam color is the player's color.")]
|
||||||
public readonly bool UsePlayerColor = false;
|
public readonly bool UsePlayerColor = false;
|
||||||
|
|
||||||
[Desc("Scan radius for actors with projectile-blocking trait. If set to a negative value (default), it will automatically scale",
|
|
||||||
"to the blocker with the largest health shape. Only set custom values if you know what you're doing.")]
|
|
||||||
public WDist BlockerScanRadius = new WDist(-1);
|
|
||||||
|
|
||||||
[Desc("Scan radius for actors damaged by beam. If set to a negative value (default), it will automatically scale to the largest health shape.",
|
|
||||||
"Only set custom values if you know what you're doing.")]
|
|
||||||
public WDist AreaVictimScanRadius = new WDist(-1);
|
|
||||||
|
|
||||||
public IProjectile Create(ProjectileArgs args)
|
public IProjectile Create(ProjectileArgs args)
|
||||||
{
|
{
|
||||||
var c = UsePlayerColor ? args.SourceActor.Owner.Color.RGB : Color;
|
var c = UsePlayerColor ? args.SourceActor.Owner.Color.RGB : Color;
|
||||||
return new AreaBeam(this, args, c);
|
return new AreaBeam(this, args, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo wi)
|
|
||||||
{
|
|
||||||
if (BlockerScanRadius < WDist.Zero)
|
|
||||||
BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules);
|
|
||||||
|
|
||||||
if (AreaVictimScanRadius < WDist.Zero)
|
|
||||||
AreaVictimScanRadius = Util.MinimumRequiredVictimScanRadius(rules);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AreaBeam : IProjectile, ISync
|
public class AreaBeam : IProjectile, ISync
|
||||||
@@ -225,7 +208,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
// Check for blocking actors
|
// Check for blocking actors
|
||||||
WPos blockedPos;
|
WPos blockedPos;
|
||||||
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, tailPos, headPos,
|
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, tailPos, headPos,
|
||||||
info.Width, info.BlockerScanRadius, out blockedPos))
|
info.Width, out blockedPos))
|
||||||
{
|
{
|
||||||
headPos = blockedPos;
|
headPos = blockedPos;
|
||||||
target = headPos;
|
target = headPos;
|
||||||
@@ -235,7 +218,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
// Damage is applied to intersected actors every DamageInterval ticks
|
// Damage is applied to intersected actors every DamageInterval ticks
|
||||||
if (headTicks % info.DamageInterval == 0)
|
if (headTicks % info.DamageInterval == 0)
|
||||||
{
|
{
|
||||||
var actors = world.FindActorsOnLine(tailPos, headPos, info.Width, info.AreaVictimScanRadius);
|
var actors = world.FindActorsOnLine(tailPos, headPos, info.Width);
|
||||||
foreach (var a in actors)
|
foreach (var a in actors)
|
||||||
{
|
{
|
||||||
var adjustedModifiers = args.DamageModifiers.Append(GetFalloff((args.Source - a.CenterPosition).Length));
|
var adjustedModifiers = args.DamageModifiers.Append(GetFalloff((args.Source - a.CenterPosition).Length));
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.Common.Projectiles
|
namespace OpenRA.Mods.Common.Projectiles
|
||||||
{
|
{
|
||||||
public class BulletInfo : IProjectileInfo, IRulesetLoaded<WeaponInfo>
|
public class BulletInfo : IProjectileInfo
|
||||||
{
|
{
|
||||||
[Desc("Projectile speed in WDist / tick, two values indicate variable velocity.")]
|
[Desc("Projectile speed in WDist / tick, two values indicate variable velocity.")]
|
||||||
public readonly WDist[] Speed = { new WDist(17) };
|
public readonly WDist[] Speed = { new WDist(17) };
|
||||||
@@ -96,24 +96,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
public readonly int ContrailDelay = 1;
|
public readonly int ContrailDelay = 1;
|
||||||
public readonly WDist ContrailWidth = new WDist(64);
|
public readonly WDist ContrailWidth = new WDist(64);
|
||||||
|
|
||||||
[Desc("Scan radius for actors with projectile-blocking trait. If set to a negative value (default), it will automatically scale",
|
|
||||||
"to the blocker with the largest health shape. Only set custom values if you know what you're doing.")]
|
|
||||||
public WDist BlockerScanRadius = new WDist(-1);
|
|
||||||
|
|
||||||
[Desc("Extra search radius beyond path for actors with ValidBounceBlockerStances. If set to a negative value (default), ",
|
|
||||||
"it will automatically scale to the largest health shape. Only set custom values if you know what you're doing.")]
|
|
||||||
public WDist BounceBlockerScanRadius = new WDist(-1);
|
|
||||||
|
|
||||||
public IProjectile Create(ProjectileArgs args) { return new Bullet(this, args); }
|
public IProjectile Create(ProjectileArgs args) { return new Bullet(this, args); }
|
||||||
|
|
||||||
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo wi)
|
|
||||||
{
|
|
||||||
if (BlockerScanRadius < WDist.Zero)
|
|
||||||
BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules);
|
|
||||||
|
|
||||||
if (BounceBlockerScanRadius < WDist.Zero)
|
|
||||||
BounceBlockerScanRadius = Util.MinimumRequiredVictimScanRadius(rules);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Bullet : IProjectile, ISync
|
public class Bullet : IProjectile, ISync
|
||||||
@@ -214,7 +197,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
var shouldExplode = false;
|
var shouldExplode = false;
|
||||||
WPos blockedPos;
|
WPos blockedPos;
|
||||||
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, lastPos, pos, info.Width,
|
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, lastPos, pos, info.Width,
|
||||||
info.BlockerScanRadius, out blockedPos))
|
out blockedPos))
|
||||||
{
|
{
|
||||||
pos = blockedPos;
|
pos = blockedPos;
|
||||||
shouldExplode = true;
|
shouldExplode = true;
|
||||||
@@ -237,7 +220,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
|
|
||||||
if (flightLengthReached && shouldBounce)
|
if (flightLengthReached && shouldBounce)
|
||||||
{
|
{
|
||||||
shouldExplode |= AnyValidTargetsInRadius(world, pos, info.Width + info.BounceBlockerScanRadius, args.SourceActor, true);
|
shouldExplode |= AnyValidTargetsInRadius(world, pos, info.Width, args.SourceActor, true);
|
||||||
target += (pos - source) * info.BounceRangeModifier / 100;
|
target += (pos - source) * info.BounceRangeModifier / 100;
|
||||||
var dat = world.Map.DistanceAboveTerrain(target);
|
var dat = world.Map.DistanceAboveTerrain(target);
|
||||||
target += new WVec(0, 0, -dat.Length);
|
target += new WVec(0, 0, -dat.Length);
|
||||||
@@ -255,7 +238,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
|
|
||||||
// After first bounce, check for targets each tick
|
// After first bounce, check for targets each tick
|
||||||
if (remainingBounces < info.BounceCount)
|
if (remainingBounces < info.BounceCount)
|
||||||
shouldExplode |= AnyValidTargetsInRadius(world, pos, info.Width + info.BounceBlockerScanRadius, args.SourceActor, true);
|
shouldExplode |= AnyValidTargetsInRadius(world, pos, info.Width, args.SourceActor, true);
|
||||||
|
|
||||||
if (shouldExplode)
|
if (shouldExplode)
|
||||||
Explode(world);
|
Explode(world);
|
||||||
@@ -298,7 +281,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
|
|
||||||
bool AnyValidTargetsInRadius(World world, WPos pos, WDist radius, Actor firedBy, bool checkTargetType)
|
bool AnyValidTargetsInRadius(World world, WPos pos, WDist radius, Actor firedBy, bool checkTargetType)
|
||||||
{
|
{
|
||||||
foreach (var victim in world.FindActorsInCircle(pos, radius))
|
foreach (var victim in world.FindActorsOnCircle(pos, radius))
|
||||||
{
|
{
|
||||||
if (checkTargetType && !Target.FromActor(victim).IsValidFor(firedBy))
|
if (checkTargetType && !Target.FromActor(victim).IsValidFor(firedBy))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ using OpenRA.Traits;
|
|||||||
namespace OpenRA.Mods.Common.Projectiles
|
namespace OpenRA.Mods.Common.Projectiles
|
||||||
{
|
{
|
||||||
[Desc("Simple, invisible, usually direct-on-target projectile.")]
|
[Desc("Simple, invisible, usually direct-on-target projectile.")]
|
||||||
public class InstantHitInfo : IProjectileInfo, IRulesetLoaded<WeaponInfo>
|
public class InstantHitInfo : IProjectileInfo
|
||||||
{
|
{
|
||||||
[Desc("Maximum offset at the maximum range.")]
|
[Desc("Maximum offset at the maximum range.")]
|
||||||
public readonly WDist Inaccuracy = WDist.Zero;
|
public readonly WDist Inaccuracy = WDist.Zero;
|
||||||
@@ -35,12 +35,6 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
public WDist BlockerScanRadius = new WDist(-1);
|
public WDist BlockerScanRadius = new WDist(-1);
|
||||||
|
|
||||||
public IProjectile Create(ProjectileArgs args) { return new InstantHit(this, args); }
|
public IProjectile Create(ProjectileArgs args) { return new InstantHit(this, args); }
|
||||||
|
|
||||||
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo wi)
|
|
||||||
{
|
|
||||||
if (BlockerScanRadius < WDist.Zero)
|
|
||||||
BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InstantHit : IProjectile
|
public class InstantHit : IProjectile
|
||||||
@@ -74,7 +68,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
// Check for blocking actors
|
// Check for blocking actors
|
||||||
WPos blockedPos;
|
WPos blockedPos;
|
||||||
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, source, target.CenterPosition,
|
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, source, target.CenterPosition,
|
||||||
info.Width, info.BlockerScanRadius, out blockedPos))
|
info.Width, out blockedPos))
|
||||||
{
|
{
|
||||||
target = Target.FromPos(blockedPos);
|
target = Target.FromPos(blockedPos);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ using OpenRA.Traits;
|
|||||||
namespace OpenRA.Mods.Common.Projectiles
|
namespace OpenRA.Mods.Common.Projectiles
|
||||||
{
|
{
|
||||||
[Desc("Not a sprite, but an engine effect.")]
|
[Desc("Not a sprite, but an engine effect.")]
|
||||||
public class LaserZapInfo : IProjectileInfo, IRulesetLoaded<WeaponInfo>
|
public class LaserZapInfo : IProjectileInfo
|
||||||
{
|
{
|
||||||
[Desc("The width of the zap.")]
|
[Desc("The width of the zap.")]
|
||||||
public readonly WDist Width = new WDist(86);
|
public readonly WDist Width = new WDist(86);
|
||||||
@@ -74,21 +74,11 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
|
|
||||||
[PaletteReference] public readonly string HitAnimPalette = "effect";
|
[PaletteReference] public readonly string HitAnimPalette = "effect";
|
||||||
|
|
||||||
[Desc("Scan radius for actors with projectile-blocking trait. If set to a negative value (default), it will automatically scale",
|
|
||||||
"to the blocker with the largest health shape. Only set custom values if you know what you're doing.")]
|
|
||||||
public WDist BlockerScanRadius = new WDist(-1);
|
|
||||||
|
|
||||||
public IProjectile Create(ProjectileArgs args)
|
public IProjectile Create(ProjectileArgs args)
|
||||||
{
|
{
|
||||||
var c = UsePlayerColor ? args.SourceActor.Owner.Color.RGB : Color;
|
var c = UsePlayerColor ? args.SourceActor.Owner.Color.RGB : Color;
|
||||||
return new LaserZap(this, args, c);
|
return new LaserZap(this, args, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo wi)
|
|
||||||
{
|
|
||||||
if (BlockerScanRadius < WDist.Zero)
|
|
||||||
BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LaserZap : IProjectile, ISync
|
public class LaserZap : IProjectile, ISync
|
||||||
@@ -133,7 +123,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
// Check for blocking actors
|
// Check for blocking actors
|
||||||
WPos blockedPos;
|
WPos blockedPos;
|
||||||
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, source, target,
|
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, source, target,
|
||||||
info.Width, info.BlockerScanRadius, out blockedPos))
|
info.Width, out blockedPos))
|
||||||
{
|
{
|
||||||
target = blockedPos;
|
target = blockedPos;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.Common.Projectiles
|
namespace OpenRA.Mods.Common.Projectiles
|
||||||
{
|
{
|
||||||
public class MissileInfo : IProjectileInfo, IRulesetLoaded<WeaponInfo>
|
public class MissileInfo : IProjectileInfo
|
||||||
{
|
{
|
||||||
[Desc("Name of the image containing the projectile sequence.")]
|
[Desc("Name of the image containing the projectile sequence.")]
|
||||||
public readonly string Image = null;
|
public readonly string Image = null;
|
||||||
@@ -148,17 +148,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
"not trigger fast enough, causing the missile to fly past the target.")]
|
"not trigger fast enough, causing the missile to fly past the target.")]
|
||||||
public readonly WDist CloseEnough = new WDist(298);
|
public readonly WDist CloseEnough = new WDist(298);
|
||||||
|
|
||||||
[Desc("Scan radius for actors with projectile-blocking trait. If set to a negative value (default), it will automatically scale",
|
|
||||||
"to the blocker with the largest health shape. Only set custom values if you know what you're doing.")]
|
|
||||||
public WDist BlockerScanRadius = new WDist(-1);
|
|
||||||
|
|
||||||
public IProjectile Create(ProjectileArgs args) { return new Missile(this, args); }
|
public IProjectile Create(ProjectileArgs args) { return new Missile(this, args); }
|
||||||
|
|
||||||
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo wi)
|
|
||||||
{
|
|
||||||
if (BlockerScanRadius < WDist.Zero)
|
|
||||||
BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: double check square roots!!!
|
// TODO: double check square roots!!!
|
||||||
@@ -453,7 +443,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: It might be desirable to make lookahead more intelligent by outputting more information
|
// NOTE: It might be desirable to make lookahead more intelligent by outputting more information
|
||||||
// than just the highest point in the lookahead distance
|
// than just the highest point in the lookahead distance
|
||||||
void InclineLookahead(World world, int distCheck, out int predClfHgt, out int predClfDist, out int lastHtChg, out int lastHt)
|
void InclineLookahead(World world, int distCheck, out int predClfHgt, out int predClfDist, out int lastHtChg, out int lastHt)
|
||||||
{
|
{
|
||||||
predClfHgt = 0; // Highest probed terrain height
|
predClfHgt = 0; // Highest probed terrain height
|
||||||
@@ -849,7 +839,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
var shouldExplode = false;
|
var shouldExplode = false;
|
||||||
WPos blockedPos;
|
WPos blockedPos;
|
||||||
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, lastPos, pos, info.Width,
|
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(world, lastPos, pos, info.Width,
|
||||||
info.BlockerScanRadius, out blockedPos))
|
out blockedPos))
|
||||||
{
|
{
|
||||||
pos = blockedPos;
|
pos = blockedPos;
|
||||||
shouldExplode = true;
|
shouldExplode = true;
|
||||||
|
|||||||
@@ -90,29 +90,12 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
[PaletteReference]
|
[PaletteReference]
|
||||||
public readonly string HitAnimPalette = "effect";
|
public readonly string HitAnimPalette = "effect";
|
||||||
|
|
||||||
[Desc("Scan radius for actors damaged by beam. If set to zero (default), it will automatically scale to the largest health shape.",
|
|
||||||
"Only set custom values if you know what you're doing.")]
|
|
||||||
public WDist AreaVictimScanRadius = WDist.Zero;
|
|
||||||
|
|
||||||
[Desc("Scan radius for actors with projectile-blocking trait. If set to zero (default), it will automatically scale",
|
|
||||||
"to the blocker with the largest health shape. Only set custom values if you know what you're doing.")]
|
|
||||||
public WDist BlockerScanRadius = WDist.Zero;
|
|
||||||
|
|
||||||
public IProjectile Create(ProjectileArgs args)
|
public IProjectile Create(ProjectileArgs args)
|
||||||
{
|
{
|
||||||
var bc = BeamPlayerColor ? Color.FromArgb(BeamColor.A, args.SourceActor.Owner.Color.RGB) : BeamColor;
|
var bc = BeamPlayerColor ? Color.FromArgb(BeamColor.A, args.SourceActor.Owner.Color.RGB) : BeamColor;
|
||||||
var hc = HelixPlayerColor ? Color.FromArgb(HelixColor.A, args.SourceActor.Owner.Color.RGB) : HelixColor;
|
var hc = HelixPlayerColor ? Color.FromArgb(HelixColor.A, args.SourceActor.Owner.Color.RGB) : HelixColor;
|
||||||
return new Railgun(args, this, bc, hc);
|
return new Railgun(args, this, bc, hc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RulesetLoaded(Ruleset rules, WeaponInfo wi)
|
|
||||||
{
|
|
||||||
if (BlockerScanRadius == WDist.Zero)
|
|
||||||
BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules);
|
|
||||||
|
|
||||||
if (AreaVictimScanRadius == WDist.Zero)
|
|
||||||
AreaVictimScanRadius = Util.MinimumRequiredVictimScanRadius(rules);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Railgun : IProjectile
|
public class Railgun : IProjectile
|
||||||
@@ -156,7 +139,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
// Check for blocking actors
|
// Check for blocking actors
|
||||||
WPos blockedPos;
|
WPos blockedPos;
|
||||||
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(args.SourceActor.World, target, args.Source,
|
if (info.Blockable && BlocksProjectiles.AnyBlockingActorsBetween(args.SourceActor.World, target, args.Source,
|
||||||
info.BeamWidth, info.BlockerScanRadius, out blockedPos))
|
info.BeamWidth, out blockedPos))
|
||||||
target = blockedPos;
|
target = blockedPos;
|
||||||
|
|
||||||
// Note: WAngle.Sin(x) = 1024 * Math.Sin(2pi/1024 * x)
|
// Note: WAngle.Sin(x) = 1024 * Math.Sin(2pi/1024 * x)
|
||||||
@@ -205,7 +188,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
args.Weapon.Impact(Target.FromPos(target), args.SourceActor, args.DamageModifiers);
|
args.Weapon.Impact(Target.FromPos(target), args.SourceActor, args.DamageModifiers);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var actors = world.FindActorsOnLine(args.Source, target, info.BeamWidth, info.AreaVictimScanRadius);
|
var actors = world.FindActorsOnLine(args.Source, target, info.BeamWidth);
|
||||||
foreach (var a in actors)
|
foreach (var a in actors)
|
||||||
args.Weapon.Impact(Target.FromActor(a), args.SourceActor, args.DamageModifiers);
|
args.Weapon.Impact(Target.FromActor(a), args.SourceActor, args.DamageModifiers);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
.Any(Exts.IsTraitEnabled));
|
.Any(Exts.IsTraitEnabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool AnyBlockingActorsBetween(World world, WPos start, WPos end, WDist width, WDist overscan, out WPos hit)
|
public static bool AnyBlockingActorsBetween(World world, WPos start, WPos end, WDist width, out WPos hit)
|
||||||
{
|
{
|
||||||
var actors = world.FindActorsOnLine(start, end, width, overscan);
|
var actors = world.FindActorsOnLine(start, end, width);
|
||||||
var length = (end - start).Length;
|
var length = (end - start).Length;
|
||||||
|
|
||||||
foreach (var a in actors)
|
foreach (var a in actors)
|
||||||
|
|||||||
@@ -177,6 +177,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
readonly HashSet<Actor> removeActorPosition = new HashSet<Actor>();
|
readonly HashSet<Actor> removeActorPosition = new HashSet<Actor>();
|
||||||
readonly Predicate<Actor> actorShouldBeRemoved;
|
readonly Predicate<Actor> actorShouldBeRemoved;
|
||||||
|
|
||||||
|
public WDist LargestActorRadius { get; private set; }
|
||||||
|
|
||||||
public ActorMap(World world, ActorMapInfo info)
|
public ActorMap(World world, ActorMapInfo info)
|
||||||
{
|
{
|
||||||
this.info = info;
|
this.info = info;
|
||||||
@@ -192,6 +194,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
// PERF: Cache this delegate so it does not have to be allocated repeatedly.
|
// PERF: Cache this delegate so it does not have to be allocated repeatedly.
|
||||||
actorShouldBeRemoved = removeActorPosition.Contains;
|
actorShouldBeRemoved = removeActorPosition.Contains;
|
||||||
|
|
||||||
|
LargestActorRadius = map.Rules.Actors.SelectMany(a => a.Value.TraitInfos<HitShapeInfo>()).Max(h => h.Type.OuterRadius);
|
||||||
}
|
}
|
||||||
|
|
||||||
void INotifyCreated.Created(Actor self)
|
void INotifyCreated.Created(Actor self)
|
||||||
|
|||||||
@@ -188,19 +188,6 @@ namespace OpenRA.Mods.Common
|
|||||||
return world.SharedRandom.Next(range[0], range[1]);
|
return world.SharedRandom.Next(range[0], range[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Investigate caching this or moving it to ActorMapInfo
|
|
||||||
public static WDist MinimumRequiredVictimScanRadius(Ruleset rules)
|
|
||||||
{
|
|
||||||
return rules.Actors.SelectMany(a => a.Value.TraitInfos<HitShapeInfo>()).Max(h => h.Type.OuterRadius);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Investigate caching this or moving it to ActorMapInfo
|
|
||||||
public static WDist MinimumRequiredBlockerScanRadius(Ruleset rules)
|
|
||||||
{
|
|
||||||
return rules.Actors.Where(a => a.Value.HasTraitInfo<IBlocksProjectilesInfo>())
|
|
||||||
.SelectMany(a => a.Value.TraitInfos<HitShapeInfo>()).Max(h => h.Type.OuterRadius);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string FriendlyTypeName(Type t)
|
public static string FriendlyTypeName(Type t)
|
||||||
{
|
{
|
||||||
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(HashSet<>))
|
if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(HashSet<>))
|
||||||
|
|||||||
@@ -1796,6 +1796,24 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (engineVersion < 20180219)
|
||||||
|
{
|
||||||
|
if (node.Key.StartsWith("Warhead", StringComparison.Ordinal) && node.Value.Value == "CreateEffect")
|
||||||
|
{
|
||||||
|
var victimScanRadius = node.Value.Nodes.FirstOrDefault(n => n.Key == "VictimScanRadius");
|
||||||
|
if (victimScanRadius != null)
|
||||||
|
{
|
||||||
|
if (FieldLoader.GetValue<int>(victimScanRadius.Key, victimScanRadius.Value.Value) == 0)
|
||||||
|
node.Value.Nodes.Add(new MiniYamlNode("ImpactActors", "false"));
|
||||||
|
|
||||||
|
node.Value.Nodes.Remove(victimScanRadius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node.Key.StartsWith("Projectile"))
|
||||||
|
node.Value.Nodes.RemoveAll(n => n.Key == "BounceBlockerScanRadius" || n.Key == "BlockerScanRadius" || n.Key == "AreaVictimScanRadius");
|
||||||
|
}
|
||||||
|
|
||||||
UpgradeWeaponRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
|
UpgradeWeaponRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.Common.Warheads
|
namespace OpenRA.Mods.Common.Warheads
|
||||||
{
|
{
|
||||||
public class CreateEffectWarhead : Warhead, IRulesetLoaded<WeaponInfo>
|
public class CreateEffectWarhead : Warhead
|
||||||
{
|
{
|
||||||
[Desc("List of explosion sequences that can be used.")]
|
[Desc("List of explosion sequences that can be used.")]
|
||||||
[SequenceReference("Image")] public readonly string[] Explosions = new string[0];
|
[SequenceReference("Image")] public readonly string[] Explosions = new string[0];
|
||||||
@@ -45,22 +45,15 @@ namespace OpenRA.Mods.Common.Warheads
|
|||||||
"If that's the case, this warhead will consider the explosion position to have the 'Air' TargetType (in addition to any nearby actor's TargetTypes).")]
|
"If that's the case, this warhead will consider the explosion position to have the 'Air' TargetType (in addition to any nearby actor's TargetTypes).")]
|
||||||
public readonly WDist AirThreshold = new WDist(128);
|
public readonly WDist AirThreshold = new WDist(128);
|
||||||
|
|
||||||
[Desc("Scan radius for victims around impact. If set to a negative value (default), it will automatically scale to the largest health shape.",
|
[Desc("Whether to consider actors in determining whether the explosion should happen. If false, only terrain will be considered.")]
|
||||||
"Custom overrides should not be necessary under normal circumstances.")]
|
public readonly bool ImpactActors = true;
|
||||||
public WDist VictimScanRadius = new WDist(-1);
|
|
||||||
|
|
||||||
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo info)
|
|
||||||
{
|
|
||||||
if (VictimScanRadius < WDist.Zero)
|
|
||||||
VictimScanRadius = Util.MinimumRequiredVictimScanRadius(rules);
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly string[] TargetTypeAir = new string[] { "Air" };
|
static readonly string[] TargetTypeAir = new string[] { "Air" };
|
||||||
|
|
||||||
public ImpactType GetImpactType(World world, CPos cell, WPos pos, Actor firedBy)
|
public ImpactType GetImpactType(World world, CPos cell, WPos pos, Actor firedBy)
|
||||||
{
|
{
|
||||||
// Matching target actor
|
// Matching target actor
|
||||||
if (VictimScanRadius > WDist.Zero)
|
if (ImpactActors)
|
||||||
{
|
{
|
||||||
var targetType = GetDirectHitTargetType(world, cell, pos, firedBy, true);
|
var targetType = GetDirectHitTargetType(world, cell, pos, firedBy, true);
|
||||||
if (targetType == ImpactTargetType.ValidActor)
|
if (targetType == ImpactTargetType.ValidActor)
|
||||||
@@ -78,7 +71,7 @@ namespace OpenRA.Mods.Common.Warheads
|
|||||||
|
|
||||||
public ImpactTargetType GetDirectHitTargetType(World world, CPos cell, WPos pos, Actor firedBy, bool checkTargetValidity = false)
|
public ImpactTargetType GetDirectHitTargetType(World world, CPos cell, WPos pos, Actor firedBy, bool checkTargetValidity = false)
|
||||||
{
|
{
|
||||||
var victims = world.FindActorsInCircle(pos, VictimScanRadius);
|
var victims = world.FindActorsOnCircle(pos, WDist.Zero);
|
||||||
var invalidHit = false;
|
var invalidHit = false;
|
||||||
|
|
||||||
foreach (var victim in victims)
|
foreach (var victim in victims)
|
||||||
|
|||||||
@@ -28,15 +28,8 @@ namespace OpenRA.Mods.Common.Warheads
|
|||||||
[Desc("Ranges at which each Falloff step is defined. Overrides Spread.")]
|
[Desc("Ranges at which each Falloff step is defined. Overrides Spread.")]
|
||||||
public WDist[] Range = null;
|
public WDist[] Range = null;
|
||||||
|
|
||||||
[Desc("Extra search radius beyond maximum spread. If set to a negative value (default), it will automatically scale to the largest health shape.",
|
|
||||||
"Custom overrides should not be necessary under normal circumstances.")]
|
|
||||||
public WDist VictimScanRadius = new WDist(-1);
|
|
||||||
|
|
||||||
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo info)
|
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo info)
|
||||||
{
|
{
|
||||||
if (VictimScanRadius < WDist.Zero)
|
|
||||||
VictimScanRadius = Util.MinimumRequiredVictimScanRadius(rules);
|
|
||||||
|
|
||||||
if (Range != null)
|
if (Range != null)
|
||||||
{
|
{
|
||||||
if (Range.Length != 1 && Range.Length != Falloff.Length)
|
if (Range.Length != 1 && Range.Length != Falloff.Length)
|
||||||
@@ -58,9 +51,7 @@ namespace OpenRA.Mods.Common.Warheads
|
|||||||
if (debugVis != null && debugVis.CombatGeometry)
|
if (debugVis != null && debugVis.CombatGeometry)
|
||||||
world.WorldActor.Trait<WarheadDebugOverlay>().AddImpact(pos, Range, DebugOverlayColor);
|
world.WorldActor.Trait<WarheadDebugOverlay>().AddImpact(pos, Range, DebugOverlayColor);
|
||||||
|
|
||||||
// This only finds actors where the center is within the search radius,
|
var hitActors = world.FindActorsOnCircle(pos, Range[Range.Length - 1]);
|
||||||
// so we need to search beyond the maximum spread to account for actors with large health radius
|
|
||||||
var hitActors = world.FindActorsInCircle(pos, Range[Range.Length - 1] + VictimScanRadius);
|
|
||||||
|
|
||||||
foreach (var victim in hitActors)
|
foreach (var victim in hitActors)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common
|
|||||||
/// <param name="lineEnd">The position the line should end at</param>
|
/// <param name="lineEnd">The position the line should end at</param>
|
||||||
/// <param name="lineWidth">How close an actor's health radius needs to be to the line to be considered 'intersected' by the line</param>
|
/// <param name="lineWidth">How close an actor's health radius needs to be to the line to be considered 'intersected' by the line</param>
|
||||||
/// <returns>A list of all the actors intersected by the line</returns>
|
/// <returns>A list of all the actors intersected by the line</returns>
|
||||||
public static IEnumerable<Actor> FindActorsOnLine(this World world, WPos lineStart, WPos lineEnd, WDist lineWidth, WDist targetExtraSearchRadius)
|
public static IEnumerable<Actor> FindActorsOnLine(this World world, WPos lineStart, WPos lineEnd, WDist lineWidth)
|
||||||
{
|
{
|
||||||
// This line intersection check is done by first just finding all actors within a square that starts at the source, and ends at the target.
|
// This line intersection check is done by first just finding all actors within a square that starts at the source, and ends at the target.
|
||||||
// Then we iterate over this list, and find all actors for which their health radius is at least within lineWidth of the line.
|
// Then we iterate over this list, and find all actors for which their health radius is at least within lineWidth of the line.
|
||||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common
|
|||||||
var yDir = yDiff < 0 ? -1 : 1;
|
var yDir = yDiff < 0 ? -1 : 1;
|
||||||
|
|
||||||
var dir = new WVec(xDir, yDir, 0);
|
var dir = new WVec(xDir, yDir, 0);
|
||||||
var overselect = dir * (1024 + lineWidth.Length + targetExtraSearchRadius.Length);
|
var overselect = dir * (1024 + lineWidth.Length + world.ActorMap.LargestActorRadius.Length);
|
||||||
var finalTarget = lineEnd + overselect;
|
var finalTarget = lineEnd + overselect;
|
||||||
var finalSource = lineStart - overselect;
|
var finalSource = lineStart - overselect;
|
||||||
|
|
||||||
@@ -64,6 +64,14 @@ namespace OpenRA.Mods.Common
|
|||||||
return intersectedActors;
|
return intersectedActors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds all the actors of which their health radius is intersected by a specified circle.
|
||||||
|
/// </summary>
|
||||||
|
public static IEnumerable<Actor> FindActorsOnCircle(this World world, WPos origin, WDist r)
|
||||||
|
{
|
||||||
|
return world.FindActorsInCircle(origin, r + world.ActorMap.LargestActorRadius);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find the point (D) on a line (A-B) that is closest to the target point (C).
|
/// Find the point (D) on a line (A-B) that is closest to the target point (C).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: small_frag
|
Explosions: small_frag
|
||||||
ImpactSounds: xplos.aud
|
ImpactSounds: xplos.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
70mm:
|
70mm:
|
||||||
Inherits: ^BallisticWeapon
|
Inherits: ^BallisticWeapon
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
Warhead@2Eff: CreateEffect
|
Warhead@2Eff: CreateEffect
|
||||||
Explosions: poof
|
Explosions: poof
|
||||||
ImpactSounds: xplos.aud
|
ImpactSounds: xplos.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@3Smu: LeaveSmudge
|
Warhead@3Smu: LeaveSmudge
|
||||||
SmudgeType: Crater
|
SmudgeType: Crater
|
||||||
InvalidTargets: Vehicle, Structure, Wall, Husk, Trees, Creep
|
InvalidTargets: Vehicle, Structure, Wall, Husk, Trees, Creep
|
||||||
@@ -92,7 +92,7 @@ BuildingExplode:
|
|||||||
Warhead@1Eff: CreateEffect
|
Warhead@1Eff: CreateEffect
|
||||||
Explosions: building, building_napalm, med_frag, poof, small_building
|
Explosions: building, building_napalm, med_frag, poof, small_building
|
||||||
Delay: 1
|
Delay: 1
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@2Smu: LeaveSmudge
|
Warhead@2Smu: LeaveSmudge
|
||||||
SmudgeType: Crater
|
SmudgeType: Crater
|
||||||
Delay: 1
|
Delay: 1
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: small_frag
|
Explosions: small_frag
|
||||||
ImpactSounds: xplos.aud
|
ImpactSounds: xplos.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
ValidTargets: Ground, Water, Air
|
ValidTargets: Ground, Water, Air
|
||||||
|
|
||||||
Dragon:
|
Dragon:
|
||||||
@@ -130,7 +130,7 @@ MammothMissiles:
|
|||||||
Warhead@4EffAir: CreateEffect
|
Warhead@4EffAir: CreateEffect
|
||||||
Explosions: small_building
|
Explosions: small_building
|
||||||
ImpactSounds: xplos.aud
|
ImpactSounds: xplos.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
ValidTargets: Air
|
ValidTargets: Air
|
||||||
|
|
||||||
227mm:
|
227mm:
|
||||||
@@ -208,7 +208,7 @@ BoatMissile:
|
|||||||
Warhead@4EffAir: CreateEffect
|
Warhead@4EffAir: CreateEffect
|
||||||
Explosions: small_building
|
Explosions: small_building
|
||||||
ImpactSounds: xplos.aud
|
ImpactSounds: xplos.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
ValidTargets: Air
|
ValidTargets: Air
|
||||||
|
|
||||||
TowerMissile:
|
TowerMissile:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: small_napalm
|
Explosions: small_napalm
|
||||||
ImpactSounds: flamer2.aud
|
ImpactSounds: flamer2.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
Flamethrower:
|
Flamethrower:
|
||||||
Inherits: ^FlameWeapon
|
Inherits: ^FlameWeapon
|
||||||
@@ -144,4 +144,4 @@ Demolish:
|
|||||||
Warhead@2Eff: CreateEffect
|
Warhead@2Eff: CreateEffect
|
||||||
Explosions: building
|
Explosions: building
|
||||||
ImpactSounds: xplobig6.aud
|
ImpactSounds: xplobig6.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ Sniper:
|
|||||||
DamageTypes: Prone50Percent, TriggerProne, BulletDeath
|
DamageTypes: Prone50Percent, TriggerProne, BulletDeath
|
||||||
Warhead@2Eff: CreateEffect
|
Warhead@2Eff: CreateEffect
|
||||||
Explosions: piffs
|
Explosions: piffs
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
ValidTargets: Ground, Water, Air
|
ValidTargets: Ground, Water, Air
|
||||||
|
|
||||||
HighV:
|
HighV:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Atomic:
|
|||||||
Warhead@2Eff_impact: CreateEffect
|
Warhead@2Eff_impact: CreateEffect
|
||||||
Explosions: nuke_explosion
|
Explosions: nuke_explosion
|
||||||
ImpactSounds: nukexplo.aud
|
ImpactSounds: nukexplo.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@3Dam_areanukea: SpreadDamage
|
Warhead@3Dam_areanukea: SpreadDamage
|
||||||
Spread: 2c512
|
Spread: 2c512
|
||||||
Damage: 11000
|
Damage: 11000
|
||||||
@@ -41,7 +41,7 @@ Atomic:
|
|||||||
Warhead@6Eff_areanukea: CreateEffect
|
Warhead@6Eff_areanukea: CreateEffect
|
||||||
ImpactSounds: xplobig4.aud
|
ImpactSounds: xplobig4.aud
|
||||||
Delay: 3
|
Delay: 3
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@7Dam_areanukeb: SpreadDamage
|
Warhead@7Dam_areanukeb: SpreadDamage
|
||||||
Spread: 3c768
|
Spread: 3c768
|
||||||
Damage: 5000
|
Damage: 5000
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ Debris:
|
|||||||
InvalidTargets: Vehicle, Structure
|
InvalidTargets: Vehicle, Structure
|
||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: tiny_explosion
|
Explosions: tiny_explosion
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
Debris2:
|
Debris2:
|
||||||
Inherits: Debris
|
Inherits: Debris
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
InvalidTargets: Vehicle, Structure
|
InvalidTargets: Vehicle, Structure
|
||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: small_napalm
|
Explosions: small_napalm
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
110mm_Gun:
|
110mm_Gun:
|
||||||
Inherits: ^Cannon
|
Inherits: ^Cannon
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
InvalidTargets: Vehicle, Structure
|
InvalidTargets: Vehicle, Structure
|
||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: tiny_explosion
|
Explosions: tiny_explosion
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
ValidTargets: Ground, Air
|
ValidTargets: Ground, Air
|
||||||
|
|
||||||
^Missile:
|
^Missile:
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ OrniBomb:
|
|||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: large_explosion
|
Explosions: large_explosion
|
||||||
ImpactSounds: EXPLSML4.WAV
|
ImpactSounds: EXPLSML4.WAV
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
Crush:
|
Crush:
|
||||||
Warhead@1Dam: SpreadDamage
|
Warhead@1Dam: SpreadDamage
|
||||||
@@ -100,7 +100,7 @@ Demolish:
|
|||||||
Warhead@2Eff: CreateEffect
|
Warhead@2Eff: CreateEffect
|
||||||
Explosions: building
|
Explosions: building
|
||||||
ImpactSounds: EXPLLG2.WAV
|
ImpactSounds: EXPLLG2.WAV
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
Atomic:
|
Atomic:
|
||||||
Warhead@1Dam: SpreadDamage
|
Warhead@1Dam: SpreadDamage
|
||||||
@@ -121,7 +121,7 @@ Atomic:
|
|||||||
Warhead@2Eff: CreateEffect
|
Warhead@2Eff: CreateEffect
|
||||||
Explosions: nuke
|
Explosions: nuke
|
||||||
ImpactSounds: EXPLLG2.WAV
|
ImpactSounds: EXPLLG2.WAV
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
CrateNuke:
|
CrateNuke:
|
||||||
Inherits: Atomic
|
Inherits: Atomic
|
||||||
@@ -151,36 +151,36 @@ CrateExplosion:
|
|||||||
Warhead@2Eff: CreateEffect
|
Warhead@2Eff: CreateEffect
|
||||||
Explosions: large_explosion
|
Explosions: large_explosion
|
||||||
ImpactSounds: EXPLSML4.WAV
|
ImpactSounds: EXPLSML4.WAV
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
UnitExplodeSmall:
|
UnitExplodeSmall:
|
||||||
Warhead@1Eff: CreateEffect
|
Warhead@1Eff: CreateEffect
|
||||||
Explosions: self_destruct
|
Explosions: self_destruct
|
||||||
ImpactSounds: EXPLSML1.WAV
|
ImpactSounds: EXPLSML1.WAV
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
UnitExplodeMed:
|
UnitExplodeMed:
|
||||||
Warhead@1Eff: CreateEffect
|
Warhead@1Eff: CreateEffect
|
||||||
Explosions: building
|
Explosions: building
|
||||||
ImpactSounds: EXPLSML2.WAV
|
ImpactSounds: EXPLSML2.WAV
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
UnitExplodeLarge:
|
UnitExplodeLarge:
|
||||||
Warhead@1Eff: CreateEffect
|
Warhead@1Eff: CreateEffect
|
||||||
Explosions: large_explosion
|
Explosions: large_explosion
|
||||||
ImpactSounds: EXPLLG2.WAV
|
ImpactSounds: EXPLLG2.WAV
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
BuildingExplode:
|
BuildingExplode:
|
||||||
Warhead@1Eff: CreateEffect
|
Warhead@1Eff: CreateEffect
|
||||||
Explosions: building, self_destruct, large_explosion
|
Explosions: building, self_destruct, large_explosion
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
WallExplode:
|
WallExplode:
|
||||||
Warhead@1Eff: CreateEffect
|
Warhead@1Eff: CreateEffect
|
||||||
Explosions: wall_explosion
|
Explosions: wall_explosion
|
||||||
ImpactSounds: EXPLHG1.WAV
|
ImpactSounds: EXPLHG1.WAV
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
grenade:
|
grenade:
|
||||||
ReloadDelay: 50
|
ReloadDelay: 50
|
||||||
@@ -211,7 +211,7 @@ grenade:
|
|||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: med_explosion
|
Explosions: med_explosion
|
||||||
ImpactSounds: EXPLMD2.WAV
|
ImpactSounds: EXPLMD2.WAV
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
GrenDeath:
|
GrenDeath:
|
||||||
Warhead@1Dam: SpreadDamage
|
Warhead@1Dam: SpreadDamage
|
||||||
@@ -232,7 +232,7 @@ GrenDeath:
|
|||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: building
|
Explosions: building
|
||||||
ImpactSounds: EXPLSML4.WAV
|
ImpactSounds: EXPLSML4.WAV
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
SardDeath:
|
SardDeath:
|
||||||
Warhead@1Dam: SpreadDamage
|
Warhead@1Dam: SpreadDamage
|
||||||
@@ -254,7 +254,7 @@ SardDeath:
|
|||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: small_napalm
|
Explosions: small_napalm
|
||||||
ImpactSounds: EXPLSML2.WAV
|
ImpactSounds: EXPLSML2.WAV
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
SpiceExplosion:
|
SpiceExplosion:
|
||||||
Projectile: Bullet
|
Projectile: Bullet
|
||||||
@@ -284,7 +284,7 @@ SpiceExplosion:
|
|||||||
Size: 1
|
Size: 1
|
||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: med_explosion
|
Explosions: med_explosion
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
BloomExplosion:
|
BloomExplosion:
|
||||||
Report: EXPLMD1.WAV
|
Report: EXPLMD1.WAV
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
DamageTypes: Prone50Percent, TriggerProne, BulletDeath
|
DamageTypes: Prone50Percent, TriggerProne, BulletDeath
|
||||||
Warhead@2Eff: CreateEffect
|
Warhead@2Eff: CreateEffect
|
||||||
Explosions: piffs
|
Explosions: piffs
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
LMG:
|
LMG:
|
||||||
Inherits: ^MG
|
Inherits: ^MG
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ CrateNuke:
|
|||||||
Warhead@3Eff_impact: CreateEffect
|
Warhead@3Eff_impact: CreateEffect
|
||||||
Explosions: nuke
|
Explosions: nuke
|
||||||
ImpactSounds: kaboom1.aud
|
ImpactSounds: kaboom1.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@4Dam_areanuke1: SpreadDamage
|
Warhead@4Dam_areanuke1: SpreadDamage
|
||||||
Spread: 1c0
|
Spread: 1c0
|
||||||
Damage: 6000
|
Damage: 6000
|
||||||
@@ -224,7 +224,7 @@ CrateNuke:
|
|||||||
Warhead@6Eff_areanuke1: CreateEffect
|
Warhead@6Eff_areanuke1: CreateEffect
|
||||||
ImpactSounds: kaboom22.aud
|
ImpactSounds: kaboom22.aud
|
||||||
Delay: 5
|
Delay: 5
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@6Smu_areanuke1: LeaveSmudge
|
Warhead@6Smu_areanuke1: LeaveSmudge
|
||||||
SmudgeType: Scorch
|
SmudgeType: Scorch
|
||||||
InvalidTargets: Vehicle, Structure, Wall, Trees
|
InvalidTargets: Vehicle, Structure, Wall, Trees
|
||||||
@@ -255,7 +255,7 @@ MiniNuke:
|
|||||||
Warhead@3Eff_impact: CreateEffect
|
Warhead@3Eff_impact: CreateEffect
|
||||||
Explosions: nuke
|
Explosions: nuke
|
||||||
ImpactSounds: kaboom1.aud
|
ImpactSounds: kaboom1.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@4Dam_areanuke1: SpreadDamage
|
Warhead@4Dam_areanuke1: SpreadDamage
|
||||||
Spread: 2c0
|
Spread: 2c0
|
||||||
Damage: 6000
|
Damage: 6000
|
||||||
@@ -273,7 +273,7 @@ MiniNuke:
|
|||||||
Warhead@6Eff_areanuke1: CreateEffect
|
Warhead@6Eff_areanuke1: CreateEffect
|
||||||
ImpactSounds: kaboom22.aud
|
ImpactSounds: kaboom22.aud
|
||||||
Delay: 5
|
Delay: 5
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@7Dam_areanuke2: SpreadDamage
|
Warhead@7Dam_areanuke2: SpreadDamage
|
||||||
Spread: 3c0
|
Spread: 3c0
|
||||||
Damage: 6000
|
Damage: 6000
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
Inherits: ^AntiGroundMissile
|
Inherits: ^AntiGroundMissile
|
||||||
ValidTargets: Air
|
ValidTargets: Air
|
||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
Maverick:
|
Maverick:
|
||||||
Inherits: ^AntiGroundMissile
|
Inherits: ^AntiGroundMissile
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: napalm
|
Explosions: napalm
|
||||||
ImpactSounds: firebl3.aud
|
ImpactSounds: firebl3.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
FireballLauncher:
|
FireballLauncher:
|
||||||
Inherits: ^FireWeapon
|
Inherits: ^FireWeapon
|
||||||
@@ -195,4 +195,4 @@ MADTankDetonate:
|
|||||||
Warhead@3Eff: CreateEffect
|
Warhead@3Eff: CreateEffect
|
||||||
Explosions: med_explosion
|
Explosions: med_explosion
|
||||||
ImpactSounds: mineblo1.aud
|
ImpactSounds: mineblo1.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ Atomic:
|
|||||||
Warhead@4Eff_impact: CreateEffect
|
Warhead@4Eff_impact: CreateEffect
|
||||||
Explosions: nuke
|
Explosions: nuke
|
||||||
ImpactSounds: kaboom1.aud
|
ImpactSounds: kaboom1.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
ValidTargets: Ground, Water, Air
|
ValidTargets: Ground, Water, Air
|
||||||
Warhead@5Dam_areanuke1: SpreadDamage
|
Warhead@5Dam_areanuke1: SpreadDamage
|
||||||
Spread: 2c0
|
Spread: 2c0
|
||||||
@@ -73,7 +73,7 @@ Atomic:
|
|||||||
Warhead@8Eff_areanuke1: CreateEffect
|
Warhead@8Eff_areanuke1: CreateEffect
|
||||||
ImpactSounds: kaboom22.aud
|
ImpactSounds: kaboom22.aud
|
||||||
Delay: 5
|
Delay: 5
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@9Dam_areanuke2: SpreadDamage
|
Warhead@9Dam_areanuke2: SpreadDamage
|
||||||
Spread: 3c0
|
Spread: 3c0
|
||||||
Damage: 6000
|
Damage: 6000
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ MammothTusk:
|
|||||||
Concrete: 28
|
Concrete: 28
|
||||||
DamageTypes: Explosion
|
DamageTypes: Explosion
|
||||||
Warhead@2Eff: CreateEffect
|
Warhead@2Eff: CreateEffect
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Explosions: medium_twlt
|
Explosions: medium_twlt
|
||||||
ImpactSounds: expnew07.aud
|
ImpactSounds: expnew07.aud
|
||||||
InvalidImpactTypes: Water
|
InvalidImpactTypes: Water
|
||||||
@@ -147,4 +147,4 @@ RedEye2:
|
|||||||
Warhead@2Eff: CreateEffect
|
Warhead@2Eff: CreateEffect
|
||||||
Explosions: large_grey_explosion
|
Explosions: large_grey_explosion
|
||||||
ImpactSounds: expnew13.aud
|
ImpactSounds: expnew13.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|||||||
@@ -80,27 +80,27 @@ IonCannon:
|
|||||||
Explosions: ionbeam
|
Explosions: ionbeam
|
||||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||||
ImpactSounds: ion1.aud
|
ImpactSounds: ion1.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@5Effect: CreateEffect
|
Warhead@5Effect: CreateEffect
|
||||||
Explosions: ionbeam2
|
Explosions: ionbeam2
|
||||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@6Effect: CreateEffect
|
Warhead@6Effect: CreateEffect
|
||||||
Explosions: ionbeam3
|
Explosions: ionbeam3
|
||||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@7Effect: CreateEffect
|
Warhead@7Effect: CreateEffect
|
||||||
Explosions: ionbeam4
|
Explosions: ionbeam4
|
||||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@8Effect: CreateEffect
|
Warhead@8Effect: CreateEffect
|
||||||
Explosions: ionbeam5
|
Explosions: ionbeam5
|
||||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@9Effect: CreateEffect
|
Warhead@9Effect: CreateEffect
|
||||||
Explosions: ionbeam6
|
Explosions: ionbeam6
|
||||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
|
|
||||||
EMPulseCannon:
|
EMPulseCannon:
|
||||||
ReloadDelay: 100
|
ReloadDelay: 100
|
||||||
@@ -115,7 +115,7 @@ EMPulseCannon:
|
|||||||
Warhead@1Eff: CreateEffect
|
Warhead@1Eff: CreateEffect
|
||||||
Explosions: pulse_explosion
|
Explosions: pulse_explosion
|
||||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@emp: GrantExternalCondition
|
Warhead@emp: GrantExternalCondition
|
||||||
Range: 4c0
|
Range: 4c0
|
||||||
Duration: 250
|
Duration: 250
|
||||||
@@ -135,7 +135,7 @@ ClusterMissile:
|
|||||||
Explosions: large_explosion
|
Explosions: large_explosion
|
||||||
ExplosionPalette: effect-ignore-lighting-alpha75
|
ExplosionPalette: effect-ignore-lighting-alpha75
|
||||||
ImpactSounds: expnew19.aud
|
ImpactSounds: expnew19.aud
|
||||||
VictimScanRadius: 0
|
ImpactActors: false
|
||||||
Warhead@ResourceDestruction0: DestroyResource
|
Warhead@ResourceDestruction0: DestroyResource
|
||||||
Size: 1
|
Size: 1
|
||||||
Warhead@ClusterSmudges0: LeaveSmudge
|
Warhead@ClusterSmudges0: LeaveSmudge
|
||||||
|
|||||||
Reference in New Issue
Block a user