From 1d2361cdd3ecc9d1cb3d1b99fe634115d6b10f17 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Fri, 23 Jun 2017 21:13:58 +0200 Subject: [PATCH] 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. --- OpenRA.Mods.Common/Projectiles/AreaBeam.cs | 12 ++++++------ OpenRA.Mods.Common/Projectiles/Bullet.cs | 12 ++++++------ OpenRA.Mods.Common/Projectiles/InstantHit.cs | 6 +++--- OpenRA.Mods.Common/Projectiles/LaserZap.cs | 6 +++--- OpenRA.Mods.Common/Projectiles/Missile.cs | 6 +++--- OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs | 6 +++--- OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs | 6 +++--- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/OpenRA.Mods.Common/Projectiles/AreaBeam.cs b/OpenRA.Mods.Common/Projectiles/AreaBeam.cs index 7efdb001c9..a0d43e20b6 100644 --- a/OpenRA.Mods.Common/Projectiles/AreaBeam.cs +++ b/OpenRA.Mods.Common/Projectiles/AreaBeam.cs @@ -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.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); } } diff --git a/OpenRA.Mods.Common/Projectiles/Bullet.cs b/OpenRA.Mods.Common/Projectiles/Bullet.cs index 227245977a..ea81ca3bda 100644 --- a/OpenRA.Mods.Common/Projectiles/Bullet.cs +++ b/OpenRA.Mods.Common/Projectiles/Bullet.cs @@ -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.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); } } diff --git a/OpenRA.Mods.Common/Projectiles/InstantHit.cs b/OpenRA.Mods.Common/Projectiles/InstantHit.cs index ae5bc4765c..27922128a4 100644 --- a/OpenRA.Mods.Common/Projectiles/InstantHit.cs +++ b/OpenRA.Mods.Common/Projectiles/InstantHit.cs @@ -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.RulesetLoaded(Ruleset rules, WeaponInfo wi) { - if (BlockerScanRadius == WDist.Zero) + if (BlockerScanRadius < WDist.Zero) BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules); } } diff --git a/OpenRA.Mods.Common/Projectiles/LaserZap.cs b/OpenRA.Mods.Common/Projectiles/LaserZap.cs index d2ffa00644..5f77cba945 100644 --- a/OpenRA.Mods.Common/Projectiles/LaserZap.cs +++ b/OpenRA.Mods.Common/Projectiles/LaserZap.cs @@ -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.RulesetLoaded(Ruleset rules, WeaponInfo wi) { - if (BlockerScanRadius == WDist.Zero) + if (BlockerScanRadius < WDist.Zero) BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules); } } diff --git a/OpenRA.Mods.Common/Projectiles/Missile.cs b/OpenRA.Mods.Common/Projectiles/Missile.cs index 0b1a09b9d6..1513fe2eda 100644 --- a/OpenRA.Mods.Common/Projectiles/Missile.cs +++ b/OpenRA.Mods.Common/Projectiles/Missile.cs @@ -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.RulesetLoaded(Ruleset rules, WeaponInfo wi) { - if (BlockerScanRadius == WDist.Zero) + if (BlockerScanRadius < WDist.Zero) BlockerScanRadius = Util.MinimumRequiredBlockerScanRadius(rules); } } diff --git a/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs b/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs index ac544b208d..e40538f7ad 100644 --- a/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/CreateEffectWarhead.cs @@ -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.RulesetLoaded(Ruleset rules, WeaponInfo info) { - if (VictimScanRadius == WDist.Zero) + if (VictimScanRadius < WDist.Zero) VictimScanRadius = Util.MinimumRequiredVictimScanRadius(rules); } diff --git a/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs b/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs index fe9a22184d..5d9b05d297 100644 --- a/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs +++ b/OpenRA.Mods.Common/Warheads/SpreadDamageWarhead.cs @@ -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.RulesetLoaded(Ruleset rules, WeaponInfo info) { - if (VictimScanRadius == WDist.Zero) + if (VictimScanRadius < WDist.Zero) VictimScanRadius = Util.MinimumRequiredVictimScanRadius(rules); if (Range != null)