diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index 0ed83fa185..a4e5561ee5 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -270,7 +270,7 @@ namespace OpenRA.Traits public interface INotifyBecomingIdle { void OnBecomingIdle(Actor self); } public interface INotifyIdle { void TickIdle(Actor self); } - public interface IBlocksBullets { } + public interface IBlocksProjectiles { } public interface IRenderInfantrySequenceModifier { bool IsModifyingSequence { get; } diff --git a/OpenRA.Mods.Common/Effects/Bullet.cs b/OpenRA.Mods.Common/Effects/Bullet.cs index 4562185ffc..fcdbf8fe24 100644 --- a/OpenRA.Mods.Common/Effects/Bullet.cs +++ b/OpenRA.Mods.Common/Effects/Bullet.cs @@ -28,10 +28,10 @@ namespace OpenRA.Mods.Common.Effects [Desc("Maximum offset at the maximum range")] public readonly WRange Inaccuracy = WRange.Zero; public readonly string Image = null; - [Desc("Check for whether an actor with BlocksBullets: trait blocks fire")] - public readonly bool High = false; public readonly string Palette = "effect"; public readonly bool Shadow = false; + [Desc("Is this blocked by actors with BlocksProjectiles trait.")] + public readonly bool Blockable = true; [Desc("Arc in WAngles, two values indicate variable arc.")] public readonly WAngle[] Angle = { WAngle.Zero }; public readonly int TrailInterval = 2; @@ -136,8 +136,8 @@ namespace OpenRA.Mods.Common.Effects if (info.ContrailLength > 0) trail.Update(pos); - if (ticks++ >= length || (!info.High && world.ActorMap - .GetUnitsAt(world.Map.CellContaining(pos)).Any(a => a.HasTrait()))) + if (ticks++ >= length || (info.Blockable && world.ActorMap + .GetUnitsAt(world.Map.CellContaining(pos)).Any(a => a.HasTrait()))) Explode(world); } diff --git a/OpenRA.Mods.Common/Effects/Missile.cs b/OpenRA.Mods.Common/Effects/Missile.cs index 8dd44700a3..fe463b725c 100644 --- a/OpenRA.Mods.Common/Effects/Missile.cs +++ b/OpenRA.Mods.Common/Effects/Missile.cs @@ -31,9 +31,9 @@ namespace OpenRA.Mods.Common.Effects public readonly WAngle MaximumPitch = WAngle.FromDegrees(30); [Desc("How many ticks before this missile is armed and can explode.")] public readonly int Arm = 0; - [Desc("Check for whether an actor with BlocksBullets: trait blocks fire")] - public readonly bool High = false; public readonly string Trail = null; + [Desc("Is the missile blocked by actors with BlocksProjectiles: trait.")] + public readonly bool Blockable = true; [Desc("Maximum offset at the maximum range")] public readonly WRange Inaccuracy = WRange.Zero; [Desc("Probability of locking onto and following target.")] @@ -176,7 +176,7 @@ namespace OpenRA.Mods.Common.Effects var shouldExplode = (pos.Z < 0) // Hit the ground || (dist.LengthSquared < info.CloseEnough.Range * info.CloseEnough.Range) // Within range || (info.RangeLimit != 0 && ticks > info.RangeLimit) // Ran out of fuel - || (!info.High && world.ActorMap.GetUnitsAt(cell).Any(a => a.HasTrait())) // Hit a wall + || (info.Blockable && world.ActorMap.GetUnitsAt(cell).Any(a => a.HasTrait())) // Hit a wall or other blocking obstacle || !world.Map.Contains(cell) // This also avoids an IndexOutOfRangeException in GetTerrainInfo below. || (!string.IsNullOrEmpty(info.BoundToTerrainType) && world.Map.GetTerrainInfo(cell).Type != info.BoundToTerrainType); // Hit incompatible terrain diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 260fe44cbd..10be6c4b9a 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -246,7 +246,7 @@ - + diff --git a/OpenRA.Mods.Common/Traits/BlocksBullets.cs b/OpenRA.Mods.Common/Traits/BlocksProjectiles.cs similarity index 71% rename from OpenRA.Mods.Common/Traits/BlocksBullets.cs rename to OpenRA.Mods.Common/Traits/BlocksProjectiles.cs index 113dbcf31b..e93add1764 100644 --- a/OpenRA.Mods.Common/Traits/BlocksBullets.cs +++ b/OpenRA.Mods.Common/Traits/BlocksProjectiles.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { // TODO: Add functionality like a customizable Height that is compared to projectile altitude - [Desc("This actor blocks bullets and missiles without 'High' property.")] - public class BlocksBulletsInfo : TraitInfo { } - public class BlocksBullets : IBlocksBullets { } + [Desc("This actor blocks bullets and missiles with 'Blockable' property.")] + public class BlocksProjectilesInfo : TraitInfo { } + public class BlocksProjectiles : IBlocksProjectiles { } } diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index 13cb4562a9..19eb076058 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -531,7 +531,7 @@ Crushable: CrushClasses: wall CrushSound: sandbag2.aud - BlocksBullets: + BlocksProjectiles: LineBuild: Range: 8 NodeTypes: wall diff --git a/mods/cnc/weapons/largecaliber.yaml b/mods/cnc/weapons/largecaliber.yaml index 7a190ec3c8..dc625c3821 100644 --- a/mods/cnc/weapons/largecaliber.yaml +++ b/mods/cnc/weapons/largecaliber.yaml @@ -120,7 +120,7 @@ ArtilleryShell: Report: TNKFIRE2.AUD Projectile: Bullet Speed: 204 - High: yes + Blockable: false Angle: 56 Inaccuracy: 1c256 ContrailLength: 30 diff --git a/mods/cnc/weapons/missiles.yaml b/mods/cnc/weapons/missiles.yaml index 0a6c881aee..947559cb7c 100644 --- a/mods/cnc/weapons/missiles.yaml +++ b/mods/cnc/weapons/missiles.yaml @@ -6,7 +6,7 @@ Rockets: ValidTargets: Ground, Air Projectile: Missile Arm: 0 - High: yes + Blockable: false Inaccuracy: 128 Image: DRAGON ROT: 15 @@ -40,7 +40,7 @@ BikeRockets: BurstDelay: 10 Projectile: Missile Arm: 0 - High: yes + Blockable: false Inaccuracy: 128 Image: DRAGON ROT: 10 @@ -74,7 +74,7 @@ OrcaAGMissiles: ValidTargets: Ground Projectile: Missile Arm: 0 - High: yes + Blockable: false Inaccuracy: 128 Image: DRAGON ROT: 20 @@ -107,7 +107,7 @@ OrcaAAMissiles: ValidTargets: Air Projectile: Missile Arm: 0 - High: yes + Blockable: false Inaccuracy: 128 Image: DRAGON ROT: 20 @@ -138,7 +138,7 @@ MammothMissiles: BurstDelay: 15 Projectile: Missile Arm: 0 - High: yes + Blockable: false Inaccuracy: 128 Image: DRAGON ROT: 20 @@ -177,7 +177,7 @@ MammothMissiles: ValidTargets: Ground Projectile: Bullet Arm: 5 - High: yes + Blockable: false Shadow: true Inaccuracy: 853 Angle: 62 @@ -211,7 +211,7 @@ MammothMissiles: ValidTargets: Ground, Air Projectile: Missile Arm: 0 - High: yes + Blockable: false Inaccuracy: 213 Image: DRAGON ROT: 10 @@ -243,7 +243,7 @@ BoatMissile: Report: ROCKET2.AUD Projectile: Missile Arm: 0 - High: yes + Blockable: false Inaccuracy: 213 Image: DRAGON ROT: 10 @@ -278,7 +278,7 @@ TowerMissle: ValidTargets: Ground Projectile: Missile Arm: 0 - High: yes + Blockable: false Inaccuracy: 128 Image: DRAGON ROT: 20 @@ -309,7 +309,7 @@ SAMMissile: ValidTargets: Air Projectile: Missile Arm: 0 - High: yes + Blockable: false Image: MISSILE ROT: 20 Speed: 426 @@ -338,7 +338,7 @@ HonestJohn: Report: ROCKET1.AUD Projectile: Bullet Arm: 10 - High: yes + Blockable: false Shadow: true Inaccuracy: 213 Image: patriot @@ -368,7 +368,7 @@ Patriot: Report: ROCKET2.AUD ValidTargets: Air Projectile: Missile - High: yes + Blockable: false Image: patriot Trail: smokey ContrailLength: 8 diff --git a/mods/cnc/weapons/other.yaml b/mods/cnc/weapons/other.yaml index d97f2312ca..ef5ac91b74 100644 --- a/mods/cnc/weapons/other.yaml +++ b/mods/cnc/weapons/other.yaml @@ -74,7 +74,7 @@ Grenade: Report: toss1.aud Projectile: Bullet Speed: 119 - High: yes + Blockable: false Angle: 62 Inaccuracy: 213 Image: BOMB diff --git a/mods/cnc/weapons/smallcaliber.yaml b/mods/cnc/weapons/smallcaliber.yaml index a3bc7676f6..3bd532ae16 100644 --- a/mods/cnc/weapons/smallcaliber.yaml +++ b/mods/cnc/weapons/smallcaliber.yaml @@ -38,7 +38,7 @@ HeliAGGun: Report: gun5.aud Projectile: Bullet Speed: 1c682 - High: True + Blockable: false Warhead@1Dam: SpreadDamage Spread: 256 Damage: 20 @@ -61,7 +61,7 @@ HeliAAGun: Report: gun5.aud Projectile: Bullet Speed: 1c682 - High: True + Blockable: false Warhead@1Dam: SpreadDamage Spread: 128 Damage: 20 @@ -183,7 +183,7 @@ APCGun.AA: ValidTargets: Air Projectile: Bullet Speed: 1c682 - High: true + Blockable: false Warhead@1Dam: SpreadDamage Spread: 128 Damage: 25 diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index e5180043b1..2eeb948938 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -486,7 +486,7 @@ wall: Type: Concrete Crushable: CrushClasses: Concretewall - BlocksBullets: + BlocksProjectiles: LineBuild: Range: 8 NodeTypes: wall, turret diff --git a/mods/d2k/weapons.yaml b/mods/d2k/weapons.yaml index 07ce4901ac..ceba9b92b3 100644 --- a/mods/d2k/weapons.yaml +++ b/mods/d2k/weapons.yaml @@ -104,7 +104,7 @@ Slung: ValidTargets: Ground Projectile: Bullet Speed: 320 - High: true + Blockable: false Shadow: yes Angle: 88 Inaccuracy: 384 @@ -209,7 +209,7 @@ TurretGun: Report: TURRET1.WAV Projectile: Bullet Speed: 704 - High: yes + Blockable: false Shadow: no Inaccuracy: 288 Image: 120mm @@ -238,7 +238,7 @@ TowerMissile: BurstDelay: 15 Projectile: Bullet Arm: 0 - High: yes + Blockable: false Shadow: yes Inaccuracy: 384 Image: MISSILE2 @@ -342,7 +342,7 @@ DevBullet: Projectile: Bullet Speed: 358 Arm: 5 - High: yes + Blockable: false Shadow: yes Inaccuracy: 1c416 Angle: 110 @@ -373,7 +373,7 @@ NerveGasMissile: Report: MISSLE1.WAV Projectile: Bullet Speed: 448 - High: true + Blockable: false Shadow: yes Angle: 110 Inaccuracy: 1c96 @@ -403,7 +403,7 @@ NerveGasMissile: Report: MORTAR1.WAV Projectile: Bullet Speed: 256 - High: true + Blockable: false Shadow: yes Angle: 62 Inaccuracy: 1c256 @@ -451,7 +451,7 @@ ChainGun: Report: 20MMGUN1.WAV Projectile: Bullet Speed: 1c256 - High: true + Blockable: false Warhead@1Dam: SpreadDamage Spread: 96 Damage: 20 @@ -659,7 +659,7 @@ Grenade: Report: Projectile: Bullet Speed: 204 - High: true + Blockable: false Angle: 62 Inaccuracy: 416 Image: BOMBS @@ -689,7 +689,7 @@ Shrapnel: Report: Projectile: Bullet Speed: 50, 125 - High: true + Blockable: false Angle: 91, 264 Inaccuracy: 416 Image: bombs diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index fcfe591d69..47b9c78a35 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -462,7 +462,7 @@ DestroyedSounds: sandbag2.aud Crushable: CrushClasses: wall - BlocksBullets: + BlocksProjectiles: LineBuild: Range: 8 NodeTypes: wall diff --git a/mods/ra/weapons/largecaliber.yaml b/mods/ra/weapons/largecaliber.yaml index fc76ac3d60..6979ee2a08 100644 --- a/mods/ra/weapons/largecaliber.yaml +++ b/mods/ra/weapons/largecaliber.yaml @@ -143,7 +143,7 @@ TurretGun: Report: TANK5.AUD Projectile: Bullet Speed: 204 - High: true + Blockable: false Angle: 62 Inaccuracy: 1c682 Image: 120MM @@ -176,7 +176,7 @@ TurretGun: Report: TURRET1.AUD Projectile: Bullet Speed: 204 - High: true + Blockable: false Angle: 62 Inaccuracy: 2c938 Image: 120MM diff --git a/mods/ra/weapons/missiles.yaml b/mods/ra/weapons/missiles.yaml index 2418d201a1..710f8ae344 100644 --- a/mods/ra/weapons/missiles.yaml +++ b/mods/ra/weapons/missiles.yaml @@ -9,7 +9,7 @@ Maverick: Projectile: Missile Speed: 256 Arm: 2 - High: true + Blockable: false ContrailLength: 10 Inaccuracy: 512 Image: DRAGON @@ -45,7 +45,7 @@ Dragon: Projectile: Missile Speed: 213 Arm: 2 - High: true + Blockable: false Trail: smokey ContrailLength: 10 Inaccuracy: 128 @@ -83,7 +83,7 @@ HellfireAG: Projectile: Missile Speed: 256 Arm: 2 - High: true + Blockable: false ContrailLength: 10 Inaccuracy: 128 Image: DRAGON @@ -120,7 +120,7 @@ HellfireAA: Projectile: Missile Speed: 384 Arm: 2 - High: true + Blockable: false ContrailLength: 10 Inaccuracy: 128 Image: DRAGON @@ -156,7 +156,7 @@ MammothTusk: Projectile: Missile Speed: 341 Arm: 2 - High: true + Blockable: false ContrailLength: 10 Inaccuracy: 128 Image: DRAGON @@ -194,7 +194,7 @@ Nike: ValidTargets: Air Projectile: Missile Arm: 3 - High: true + Blockable: false ContrailLength: 10 Image: MISSILE ROT: 25 @@ -224,7 +224,7 @@ RedEye: ValidTargets: Air Projectile: Missile Arm: 3 - High: true + Blockable: false ContrailLength: 10 Image: MISSILE ROT: 20 @@ -253,7 +253,7 @@ SubMissile: Report: MISSILE6.AUD Projectile: Bullet Speed: 102 - High: true + Blockable: false Angle: 165 Inaccuracy: 2c938 Image: MISSILE @@ -288,7 +288,7 @@ Stinger: ValidTargets: Air, Ground, Water Projectile: Missile Arm: 3 - High: true + Blockable: false ContrailLength: 10 Image: DRAGON ROT: 20 @@ -368,7 +368,7 @@ SCUD: Report: MISSILE1.AUD Projectile: Bullet Speed: 170 - High: true + Blockable: false Shadow: false Trail: smokey TrailDelay: 5 @@ -404,7 +404,7 @@ APTusk: Projectile: Missile Speed: 298 Arm: 2 - High: true + Blockable: false Trail: smokey ContrailLength: 10 Inaccuracy: 128 diff --git a/mods/ra/weapons/other.yaml b/mods/ra/weapons/other.yaml index 7d9d4a1bac..3ef43325cc 100644 --- a/mods/ra/weapons/other.yaml +++ b/mods/ra/weapons/other.yaml @@ -56,7 +56,7 @@ Napalm: Projectile: Bullet Image: BOMBLET Speed: 85 - High: yes + Blockable: false Warhead@1Dam: SpreadDamage Spread: 170 Damage: 100 @@ -83,7 +83,7 @@ Grenade: Report: grenade1.aud Projectile: Bullet Speed: 136 - High: true + Blockable: false Angle: 62 Inaccuracy: 554 Image: BOMB @@ -115,7 +115,7 @@ DepthCharge: Speed: 85 Image: BOMB Angle: 62 - High: true + Blockable: false Inaccuracy: 128 Warhead@1Dam: SpreadDamage Spread: 128 diff --git a/mods/ra/weapons/smallcaliber.yaml b/mods/ra/weapons/smallcaliber.yaml index 5cbae45870..e647411bae 100644 --- a/mods/ra/weapons/smallcaliber.yaml +++ b/mods/ra/weapons/smallcaliber.yaml @@ -30,7 +30,7 @@ ZSU-23: ValidTargets: Air Projectile: Bullet Speed: 3c340 - High: true + Blockable: false Warhead@1Dam: SpreadDamage Spread: 213 Damage: 12 @@ -162,7 +162,7 @@ ChainGun: Report: GUN13.AUD Projectile: Bullet Speed: 1c682 - High: true + Blockable: false Warhead@1Dam: SpreadDamage Spread: 128 Damage: 30 @@ -187,7 +187,7 @@ ChainGun.Yak: Report: GUN13.AUD Projectile: Bullet Speed: 1c682 - High: true + Blockable: false Warhead@1Dam: SpreadDamage Spread: 128 Damage: 40 @@ -300,7 +300,7 @@ FLAK-23: ValidTargets: Air, Ground, Water Projectile: Bullet Speed: 1c682 - High: true + Blockable: false Warhead@1Dam: SpreadDamage Spread: 213 Damage: 20 diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index decdcae1dc..f99c07b2ef 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -110,7 +110,7 @@ DestroyedSounds: crmble2.aud Crushable: CrushClasses: wall - BlocksBullets: + BlocksProjectiles: LineBuild: Range: 8 NodeTypes: wall diff --git a/mods/ts/weapons.yaml b/mods/ts/weapons.yaml index 458216e834..af13a66896 100644 --- a/mods/ts/weapons.yaml +++ b/mods/ts/weapons.yaml @@ -55,7 +55,7 @@ Grenade: Range: 4c512 Projectile: Bullet Speed: 85 - High: yes + Blockable: false Shadow: true Angle: 62 Inaccuracy: 554 @@ -91,7 +91,7 @@ Bazooka: Projectile: Missile Speed: 213 Arm: 3 - High: true + Blockable: false Shadow: true Inaccuracy: 128 Image: DRAGON @@ -134,7 +134,7 @@ MultiCluster: Projectile: Missile Speed: 170 Arm: 2 - High: yes + Blockable: false Shadow: true Inaccuracy: 128 Image: DRAGON @@ -249,7 +249,7 @@ CyCannon: ValidTargets: Ground Projectile: Bullet Speed: 192 - High: yes + Blockable: false Shadow: true Image: TORPEDO Warhead@1Dam: SpreadDamage @@ -406,7 +406,7 @@ HoverMissile: Projectile: Missile Speed: 213 Arm: 2 - High: yes + Blockable: false Shadow: true Inaccuracy: 128 Image: DRAGON @@ -480,7 +480,7 @@ MammothTusk: Burst: 2 Projectile: Missile Arm: 0 - High: yes + Blockable: false Shadow: true Inaccuracy: 128 Image: DRAGON @@ -640,7 +640,7 @@ BikeMissile: ValidTargets: Ground Projectile: Missile Arm: 2 - High: yes + Blockable: false Shadow: true Inaccuracy: 128 Image: DRAGON @@ -745,7 +745,7 @@ Dragon: Projectile: Missile Speed: 213 Arm: 2 - High: yes + Blockable: false Shadow: true Inaccuracy: 128 Image: DRAGON @@ -818,7 +818,7 @@ Dragon: Image: 120mm Angle: 165 Shadow: true - High: yes + Blockable: false Palette: ra MinRange: 5c0 Warhead@1Dam: SpreadDamage @@ -852,7 +852,7 @@ Hellfire: Projectile: Missile Speed: 256 Arm: 2 - High: yes + Blockable: false Shadow: true Inaccuracy: 128 Image: DRAGON @@ -924,7 +924,7 @@ Proton: Projectile: Missile Speed: 256 Arm: 2 - High: yes + Blockable: false Shadow: true Inaccuracy: 128 Image: TORPEDO @@ -1066,7 +1066,7 @@ RPGTower: Report: GLNCH4.AUD Projectile: Bullet Speed: 384 - High: yes + Blockable: false Shadow: true Angle: 62 Image: canister @@ -1101,7 +1101,7 @@ SAMTower: Projectile: Missile Speed: 298 Arm: 2 - High: yes + Blockable: false Shadow: true Inaccuracy: 128 Image: DRAGON @@ -1149,7 +1149,7 @@ EMPulseCannon: Report: PLSECAN2.AUD Projectile: Bullet Speed: 425 - High: yes + Blockable: false Shadow: true Angle: 62 Image: pulsball