Exemplo n.º 1
0
 public void IncomingDelivery(Actor self)
 {
     if (!IsTraitDisabled)
     {
         wsb.PlayCustomAnimationRepeating(self, Info.ActiveSequence);
     }
 }
Exemplo n.º 2
0
        void ITick.Tick(Actor self)
        {
            if (IsTraitDisabled)
            {
                return;
            }

            if (!animPlaying &&
                ((repairing && Info.PlayAnimationOn.HasFlag(ResupplyType.Repair)) ||
                 (rearming && Info.PlayAnimationOn.HasFlag(ResupplyType.Rearm))))
            {
                wsb.PlayCustomAnimationRepeating(self, Info.Sequence);
                animPlaying = true;
            }
            else if (animPlaying &&
                     (!repairing || !Info.PlayAnimationOn.HasFlag(ResupplyType.Repair)) &&
                     (!rearming || !Info.PlayAnimationOn.HasFlag(ResupplyType.Rearm)))
            {
                wsb.CancelCustomAnimation(self);
                animPlaying = false;
            }

            // If an actor died before finishing resupply, there will never be a ResupplyTick call
            // with ResupplyType.None (as activities tick before ITick), so reset here every tick
            // to prevent the animation from continuing after the resupplied actor died.
            repairing = false;
            rearming  = false;
        }
Exemplo n.º 3
0
		void UpdateAnimation(Actor self, MovementType types)
		{
			var playAnim = false;
			if (!IsTraitDisabled && (types & Info.ValidMovementTypes) != 0)
				playAnim = true;

			if (!playAnim && wsb.DefaultAnimation.CurrentSequence.Name == Info.MoveSequence)
			{
				wsb.CancelCustomAnimation(self);
				return;
			}

			if (playAnim && wsb.DefaultAnimation.CurrentSequence.Name != Info.MoveSequence)
				wsb.PlayCustomAnimationRepeating(self, Info.MoveSequence);
		}
Exemplo n.º 4
0
        void ITick.Tick(Actor self)
        {
            if (IsTraitDisabled)
            {
                return;
            }

            if (!animPlaying &&
                ((repairing && Info.PlayAnimationOn.HasFlag(ResupplyType.Repair)) ||
                 (rearming && Info.PlayAnimationOn.HasFlag(ResupplyType.Rearm))))
            {
                wsb.PlayCustomAnimationRepeating(self, Info.Sequence);
                animPlaying = true;
            }
            else if (animPlaying &&
                     (!repairing || !Info.PlayAnimationOn.HasFlag(ResupplyType.Repair)) &&
                     (!rearming || !Info.PlayAnimationOn.HasFlag(ResupplyType.Rearm)))
            {
                wsb.CancelCustomAnimation(self);
                animPlaying = false;
            }
        }