Convert Attack*.FacingTolerance to WAngle.

This commit is contained in:
Paul Chote
2020-11-28 14:42:16 +00:00
committed by abcdefg30
parent d75fed3a00
commit 77ffc20a5f
14 changed files with 43 additions and 32 deletions

View File

@@ -18,8 +18,8 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Unit got to face the target")]
public class AttackFrontalInfo : AttackBaseInfo, Requires<IFacingInfo>
{
[Desc("Tolerance for attack angle. Range [0, 128], 128 covers 360 degrees.")]
public readonly new int FacingTolerance = 0;
[Desc("Tolerance for attack angle. Range [0, 512], 512 covers 360 degrees.")]
public readonly new WAngle FacingTolerance = WAngle.Zero;
public override object Create(ActorInitializer init) { return new AttackFrontal(init.Self, this); }
}
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
if (!base.CanAttack(self, target))
return false;
return TargetInFiringArc(self, target, 4 * Info.FacingTolerance);
return TargetInFiringArc(self, target, Info.FacingTolerance);
}
public override Activity GetAttackActivity(Actor self, AttackSource source, in Target newTarget, bool allowMove, bool forceAttack, Color? targetLineColor = null)