Rename AttackBase.IsAttacking to IsAiming to make its uses and assumptions clear.

This commit is contained in:
Paul Chote
2017-11-26 11:55:05 +00:00
committed by reaperrr
parent ea05221180
commit b898b5001a
9 changed files with 9 additions and 9 deletions

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
protected override void Tick(Actor self)
{
if (Info.AimSequence != null)
sequence = Attack.IsAttacking ? Info.AimSequence : Info.Sequence;
sequence = Attack.IsAiming ? Info.AimSequence : Info.Sequence;
var currentAmmo = ammoPool.GetAmmoCount();
if (reloadStages < 0)

View File

@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Activities
foreach (var attack in attackTraits.Where(x => !x.IsTraitDisabled))
{
var status = TickAttack(self, attack);
attack.IsAttacking = status == AttackStatus.Attacking || status == AttackStatus.NeedsToTurn;
attack.IsAiming = status == AttackStatus.Attacking || status == AttackStatus.NeedsToTurn;
}
if (attackStatus.HasFlag(AttackStatus.Attacking))

View File

@@ -208,7 +208,7 @@ namespace OpenRA.Mods.Common.Projectiles
// While the head is travelling, the tail must start to follow Duration ticks later.
// Alternatively, also stop emitting the beam if source actor dies or is ordered to stop.
if ((headTicks >= info.Duration && !isTailTravelling) || args.SourceActor.IsDead ||
!actorAttackBase.IsAttacking || outOfWeaponRange)
!actorAttackBase.IsAiming || outOfWeaponRange)
StopTargeting();
if (isTailTravelling)

View File

@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits
readonly string attackOrderName = "Attack";
readonly string forceAttackOrderName = "ForceAttack";
[Sync] public bool IsAttacking { get; internal set; }
[Sync] public bool IsAiming { get; internal set; }
public IEnumerable<Armament> Armaments { get { return getArmaments(); } }
protected IFacing facing;

View File

@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits
}
DoAttack(self, Target);
IsAttacking = Target.IsValidFor(self);
IsAiming = Target.IsValidFor(self);
}
public override Activity GetAttackActivity(Actor self, Target newTarget, bool allowMove, bool forceAttack)

View File

@@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Traits.Render
return;
var sequence = wsb.Info.Sequence;
if (!string.IsNullOrEmpty(Info.AimSequence) && attack.IsAttacking)
if (!string.IsNullOrEmpty(Info.AimSequence) && attack.IsAiming)
sequence = Info.AimSequence;
var prefix = (armament.IsReloading && !string.IsNullOrEmpty(Info.ReloadPrefix)) ? Info.ReloadPrefix : "";

View File

@@ -124,7 +124,7 @@ namespace OpenRA.Mods.Common.Traits.Render
if (Info.AimSequence == null)
return;
var sequence = Attack.IsAttacking ? Info.AimSequence : Info.Sequence;
var sequence = Attack.IsAiming ? Info.AimSequence : Info.Sequence;
DefaultAnimation.ReplaceAnim(sequence);
}

View File

@@ -96,7 +96,7 @@ namespace OpenRA.Mods.Common.Traits.Render
return;
var sequence = wst.Info.Sequence;
if (!string.IsNullOrEmpty(info.AimSequence) && attack.IsAttacking)
if (!string.IsNullOrEmpty(info.AimSequence) && attack.IsAiming)
sequence = info.AimSequence;
var prefix = (armament.IsReloading && !string.IsNullOrEmpty(info.ReloadPrefix)) ? info.ReloadPrefix : "";

View File

@@ -117,7 +117,7 @@ namespace OpenRA.Mods.Common.Traits
if (attack != null)
{
// Only realign while not attacking anything
if (attack.IsAttacking)
if (attack.IsAiming)
return;
if (realignTick < Info.RealignDelay)