Refactored ticks to delay per issue #9810

This commit is contained in:
Jonathan Ling
2016-02-06 23:18:08 -05:00
committed by colonelpopcorn
parent 689f05c3ca
commit 2d4c3f715f
11 changed files with 58 additions and 31 deletions

View File

@@ -19,8 +19,8 @@ namespace OpenRA.Mods.Common.Traits
{
public class WithInfantryBodyInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires<IMoveInfo>, Requires<RenderSpritesInfo>
{
public readonly int MinIdleWaitTicks = 30;
public readonly int MaxIdleWaitTicks = 110;
public readonly int MinIdleDelay = 30;
public readonly int MaxIdleDelay = 110;
[SequenceReference] public readonly string MoveSequence = "run";
[SequenceReference] public readonly string AttackSequence = null;
@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Traits
if (Info.IdleSequences.Length > 0)
{
idleSequence = Info.IdleSequences.Random(self.World.SharedRandom);
idleDelay = self.World.SharedRandom.Next(Info.MinIdleWaitTicks, Info.MaxIdleWaitTicks);
idleDelay = self.World.SharedRandom.Next(Info.MinIdleDelay, Info.MaxIdleDelay);
}
}
else if (AllowIdleAnimation(self))