fixed up weapon validity stuff
This commit is contained in:
@@ -117,9 +117,8 @@ namespace OpenRA
|
||||
if (weapon.Warheads.All( w => w.EffectivenessAgainst(target.Info.Traits.Get<OwnedActorInfo>().Armor) <= 0))
|
||||
return false;
|
||||
|
||||
/* todo: access to UnderWater is interesting */
|
||||
// if (projectile.UnderWater && !target.Info.Traits.Get<OwnedActorInfo>().WaterBound)
|
||||
// return false;
|
||||
if (weapon.Underwater && !target.Info.Traits.Get<OwnedActorInfo>().WaterBound)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -28,9 +28,6 @@ namespace OpenRA.Effects
|
||||
public class BulletInfo : IProjectileInfo
|
||||
{
|
||||
public readonly int Speed = 1;
|
||||
public readonly bool AA = false;
|
||||
public readonly bool AG = true;
|
||||
public readonly bool ASW = false;
|
||||
public readonly string Trail = null;
|
||||
public readonly bool Inaccurate = false;
|
||||
public readonly string Image = null;
|
||||
@@ -38,7 +35,6 @@ namespace OpenRA.Effects
|
||||
public readonly bool Arcing = false;
|
||||
public readonly int RangeLimit = 0;
|
||||
public readonly int Arm = 0;
|
||||
public readonly bool UnderWater = false;
|
||||
public readonly bool Shadow = false;
|
||||
public readonly bool Proximity = false;
|
||||
|
||||
@@ -119,7 +115,7 @@ namespace OpenRA.Effects
|
||||
}
|
||||
else
|
||||
yield return new Renderable(anim.Image, pos - .5f * anim.Image.size,
|
||||
Info.UnderWater ? "shadow" : Args.firedBy.Owner.Palette);
|
||||
Args.weapon.Underwater ? "shadow" : Args.firedBy.Owner.Palette);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,9 +35,6 @@ namespace OpenRA.Effects
|
||||
public readonly bool Proximity = false;
|
||||
public readonly string Trail = null;
|
||||
public readonly bool Inaccurate = false;
|
||||
public readonly bool AA = false;
|
||||
public readonly bool AG = true;
|
||||
public readonly bool ASW = false;
|
||||
public readonly string Image = null;
|
||||
public readonly int ROT = 5;
|
||||
public readonly int RangeLimit = 0;
|
||||
|
||||
@@ -81,7 +81,8 @@ namespace OpenRA.GameRules
|
||||
public readonly int ROF = 1;
|
||||
public readonly int Burst = 1;
|
||||
public readonly bool Charges = false;
|
||||
public readonly string[] ValidTargets = { "Vehicle", "Infantry" };
|
||||
public readonly bool Underwater = false;
|
||||
public readonly string[] ValidTargets = { "Vehicle", "Infantry", "Building", "Defense", "Ship" };
|
||||
|
||||
public IProjectileInfo Projectile;
|
||||
public List<WarheadInfo> Warheads = new List<WarheadInfo>();
|
||||
@@ -98,6 +99,8 @@ namespace OpenRA.GameRules
|
||||
case "Report": FieldLoader.LoadField(this, "Report", content.Nodes["Report"].Value); break;
|
||||
case "Burst": FieldLoader.LoadField(this, "Burst", content.Nodes["Burst"].Value); break;
|
||||
case "Charges": FieldLoader.LoadField(this, "Charges", content.Nodes["Charges"].Value); break;
|
||||
case "ValidTargets": FieldLoader.LoadField(this, "ValidTargets", content.Nodes["ValidTargets"].Value); break;
|
||||
case "Underwater": FieldLoader.LoadField(this, "Underwater", content.Nodes["Underwater"].Value); break;
|
||||
|
||||
case "Warhead":
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user