Rename AttackBase.IsAttacking to IsAiming to make its uses and assumptions clear.
This commit is contained in:
@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Cnc.Traits.Render
|
|||||||
protected override void Tick(Actor self)
|
protected override void Tick(Actor self)
|
||||||
{
|
{
|
||||||
if (Info.AimSequence != null)
|
if (Info.AimSequence != null)
|
||||||
sequence = Attack.IsAttacking ? Info.AimSequence : Info.Sequence;
|
sequence = Attack.IsAiming ? Info.AimSequence : Info.Sequence;
|
||||||
|
|
||||||
var currentAmmo = ammoPool.GetAmmoCount();
|
var currentAmmo = ammoPool.GetAmmoCount();
|
||||||
if (reloadStages < 0)
|
if (reloadStages < 0)
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
foreach (var attack in attackTraits.Where(x => !x.IsTraitDisabled))
|
foreach (var attack in attackTraits.Where(x => !x.IsTraitDisabled))
|
||||||
{
|
{
|
||||||
var status = TickAttack(self, attack);
|
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))
|
if (attackStatus.HasFlag(AttackStatus.Attacking))
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ namespace OpenRA.Mods.Common.Projectiles
|
|||||||
// While the head is travelling, the tail must start to follow Duration ticks later.
|
// 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.
|
// Alternatively, also stop emitting the beam if source actor dies or is ordered to stop.
|
||||||
if ((headTicks >= info.Duration && !isTailTravelling) || args.SourceActor.IsDead ||
|
if ((headTicks >= info.Duration && !isTailTravelling) || args.SourceActor.IsDead ||
|
||||||
!actorAttackBase.IsAttacking || outOfWeaponRange)
|
!actorAttackBase.IsAiming || outOfWeaponRange)
|
||||||
StopTargeting();
|
StopTargeting();
|
||||||
|
|
||||||
if (isTailTravelling)
|
if (isTailTravelling)
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
readonly string attackOrderName = "Attack";
|
readonly string attackOrderName = "Attack";
|
||||||
readonly string forceAttackOrderName = "ForceAttack";
|
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(); } }
|
public IEnumerable<Armament> Armaments { get { return getArmaments(); } }
|
||||||
|
|
||||||
protected IFacing facing;
|
protected IFacing facing;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
|
|
||||||
DoAttack(self, Target);
|
DoAttack(self, Target);
|
||||||
IsAttacking = Target.IsValidFor(self);
|
IsAiming = Target.IsValidFor(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Activity GetAttackActivity(Actor self, Target newTarget, bool allowMove, bool forceAttack)
|
public override Activity GetAttackActivity(Actor self, Target newTarget, bool allowMove, bool forceAttack)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var sequence = wsb.Info.Sequence;
|
var sequence = wsb.Info.Sequence;
|
||||||
if (!string.IsNullOrEmpty(Info.AimSequence) && attack.IsAttacking)
|
if (!string.IsNullOrEmpty(Info.AimSequence) && attack.IsAiming)
|
||||||
sequence = Info.AimSequence;
|
sequence = Info.AimSequence;
|
||||||
|
|
||||||
var prefix = (armament.IsReloading && !string.IsNullOrEmpty(Info.ReloadPrefix)) ? Info.ReloadPrefix : "";
|
var prefix = (armament.IsReloading && !string.IsNullOrEmpty(Info.ReloadPrefix)) ? Info.ReloadPrefix : "";
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
if (Info.AimSequence == null)
|
if (Info.AimSequence == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var sequence = Attack.IsAttacking ? Info.AimSequence : Info.Sequence;
|
var sequence = Attack.IsAiming ? Info.AimSequence : Info.Sequence;
|
||||||
DefaultAnimation.ReplaceAnim(sequence);
|
DefaultAnimation.ReplaceAnim(sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var sequence = wst.Info.Sequence;
|
var sequence = wst.Info.Sequence;
|
||||||
if (!string.IsNullOrEmpty(info.AimSequence) && attack.IsAttacking)
|
if (!string.IsNullOrEmpty(info.AimSequence) && attack.IsAiming)
|
||||||
sequence = info.AimSequence;
|
sequence = info.AimSequence;
|
||||||
|
|
||||||
var prefix = (armament.IsReloading && !string.IsNullOrEmpty(info.ReloadPrefix)) ? info.ReloadPrefix : "";
|
var prefix = (armament.IsReloading && !string.IsNullOrEmpty(info.ReloadPrefix)) ? info.ReloadPrefix : "";
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (attack != null)
|
if (attack != null)
|
||||||
{
|
{
|
||||||
// Only realign while not attacking anything
|
// Only realign while not attacking anything
|
||||||
if (attack.IsAttacking)
|
if (attack.IsAiming)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (realignTick < Info.RealignDelay)
|
if (realignTick < Info.RealignDelay)
|
||||||
|
|||||||
Reference in New Issue
Block a user