Renames BlocksBullets to BlocksProjectiles and projectile High property to Blockable

This commit is contained in:
reaperrr
2015-03-10 22:46:58 +01:00
parent fb710f15bb
commit f9332c9efe
19 changed files with 76 additions and 76 deletions

View File

@@ -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<IBlocksBullets>())))
if (ticks++ >= length || (info.Blockable && world.ActorMap
.GetUnitsAt(world.Map.CellContaining(pos)).Any(a => a.HasTrait<IBlocksProjectiles>())))
Explode(world);
}

View File

@@ -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<IBlocksBullets>())) // Hit a wall
|| (info.Blockable && world.ActorMap.GetUnitsAt(cell).Any(a => a.HasTrait<IBlocksProjectiles>())) // 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

View File

@@ -246,7 +246,7 @@
<Compile Include="Traits\Attack\AttackWander.cs" />
<Compile Include="Traits\AutoHeal.cs" />
<Compile Include="Traits\AutoTarget.cs" />
<Compile Include="Traits\BlocksBullets.cs" />
<Compile Include="Traits\BlocksProjectiles.cs" />
<Compile Include="Traits\Buildable.cs" />
<Compile Include="Traits\Buildings\BaseBuilding.cs" />
<Compile Include="Traits\Buildings\BaseProvider.cs" />

View File

@@ -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<BlocksBullets> { }
public class BlocksBullets : IBlocksBullets { }
[Desc("This actor blocks bullets and missiles with 'Blockable' property.")]
public class BlocksProjectilesInfo : TraitInfo<BlocksProjectiles> { }
public class BlocksProjectiles : IBlocksProjectiles { }
}