Change default and auto-calc of victim scans to -1

For all projectiles and warheads.

Not really a must for everything else, but for CreateEffectWarhead, the
ImpactTypes refactor (separate PR) makes it a bit harder to make the
warhead valid in every situation, so setting the victim scan to zero is the easiest way to disable scanning for actors completely.
This commit is contained in:
reaperrr
2017-06-23 21:13:58 +02:00
parent ca475fe133
commit 1d2361cdd3
7 changed files with 27 additions and 27 deletions

View File

@@ -69,13 +69,13 @@ namespace OpenRA.Mods.Common.Projectiles
[Desc("Beam color is the player's color.")]
public readonly bool UsePlayerColor = false;
[Desc("Scan radius for actors with projectile-blocking trait. If set to zero (default), it will automatically scale",
[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 = WDist.Zero;
public WDist BlockerScanRadius = new WDist(-1);
[Desc("Scan radius for actors damaged by beam. If set to zero (default), it will automatically scale to the largest health shape.",
[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 = WDist.Zero;
public WDist AreaVictimScanRadius = new WDist(-1);
public IProjectile Create(ProjectileArgs args)
{
@@ -85,10 +85,10 @@ namespace OpenRA.Mods.Common.Projectiles
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo wi)
{
if (BlockerScanRadius == WDist.Zero)
if (BlockerScanRadius < WDist.Zero)
BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules);
if (AreaVictimScanRadius == WDist.Zero)
if (AreaVictimScanRadius < WDist.Zero)
AreaVictimScanRadius = Util.MinimumRequiredVictimScanRadius(rules);
}
}

View File

@@ -93,22 +93,22 @@ namespace OpenRA.Mods.Common.Projectiles
public readonly int ContrailDelay = 1;
public readonly WDist ContrailWidth = new WDist(64);
[Desc("Scan radius for actors with projectile-blocking trait. If set to zero (default), it will automatically scale",
[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 = WDist.Zero;
public WDist BlockerScanRadius = new WDist(-1);
[Desc("Extra search radius beyond path for actors with ValidBounceBlockerStances. If set to zero (default), ",
[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 = WDist.Zero;
public WDist BounceBlockerScanRadius = new WDist(-1);
public IProjectile Create(ProjectileArgs args) { return new Bullet(this, args); }
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo wi)
{
if (BlockerScanRadius == WDist.Zero)
if (BlockerScanRadius < WDist.Zero)
BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules);
if (BounceBlockerScanRadius == WDist.Zero)
if (BounceBlockerScanRadius < WDist.Zero)
BounceBlockerScanRadius = Util.MinimumRequiredVictimScanRadius(rules);
}
}

View File

@@ -30,15 +30,15 @@ namespace OpenRA.Mods.Common.Projectiles
[Desc("The width of the projectile.")]
public readonly WDist Width = new WDist(1);
[Desc("Scan radius for actors with projectile-blocking trait. If set to zero (default), it will automatically scale",
[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 = WDist.Zero;
public WDist BlockerScanRadius = new WDist(-1);
public IProjectile Create(ProjectileArgs args) { return new InstantHit(this, args); }
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo wi)
{
if (BlockerScanRadius == WDist.Zero)
if (BlockerScanRadius < WDist.Zero)
BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules);
}
}

View File

@@ -74,9 +74,9 @@ namespace OpenRA.Mods.Common.Projectiles
[PaletteReference] public readonly string HitAnimPalette = "effect";
[Desc("Scan radius for actors with projectile-blocking trait. If set to zero (default), it will automatically scale",
[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 = WDist.Zero;
public WDist BlockerScanRadius = new WDist(-1);
public IProjectile Create(ProjectileArgs args)
{
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Projectiles
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo wi)
{
if (BlockerScanRadius == WDist.Zero)
if (BlockerScanRadius < WDist.Zero)
BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules);
}
}

View File

@@ -142,15 +142,15 @@ namespace OpenRA.Mods.Common.Projectiles
"not trigger fast enough, causing the missile to fly past the target.")]
public readonly WDist CloseEnough = new WDist(298);
[Desc("Scan radius for actors with projectile-blocking trait. If set to zero (default), it will automatically scale",
[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 = WDist.Zero;
public WDist BlockerScanRadius = new WDist(-1);
public IProjectile Create(ProjectileArgs args) { return new Missile(this, args); }
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo wi)
{
if (BlockerScanRadius == WDist.Zero)
if (BlockerScanRadius < WDist.Zero)
BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules);
}
}

View File

@@ -41,13 +41,13 @@ namespace OpenRA.Mods.Common.Warheads
[Desc("What impact types should this effect NOT apply to.", "Overrides ValidImpactTypes.")]
public readonly ImpactType InvalidImpactTypes = ImpactType.None;
[Desc("Scan radius for victims around impact. If set to zero (default), it will automatically scale to the largest health shape.",
[Desc("Scan radius for victims around impact. 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 = WDist.Zero;
public WDist VictimScanRadius = new WDist(-1);
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo info)
{
if (VictimScanRadius == WDist.Zero)
if (VictimScanRadius < WDist.Zero)
VictimScanRadius = Util.MinimumRequiredVictimScanRadius(rules);
}

View File

@@ -28,13 +28,13 @@ namespace OpenRA.Mods.Common.Warheads
[Desc("Ranges at which each Falloff step is defined. Overrides Spread.")]
public WDist[] Range = null;
[Desc("Extra search radius beyond maximum spread. If set to zero (default), it will automatically scale to the largest health shape.",
[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 = WDist.Zero;
public WDist VictimScanRadius = new WDist(-1);
void IRulesetLoaded<WeaponInfo>.RulesetLoaded(Ruleset rules, WeaponInfo info)
{
if (VictimScanRadius == WDist.Zero)
if (VictimScanRadius < WDist.Zero)
VictimScanRadius = Util.MinimumRequiredVictimScanRadius(rules);
if (Range != null)