public MoveWithAfterImagesBattleEvent(BattleEntity entity, Vector2 finalPosition, double duration, AfterImageVFX afterImageData,
                                       Interpolation.InterpolationTypes xInterpolation = Interpolation.InterpolationTypes.Linear,
                                       Interpolation.InterpolationTypes yInterpolation = Interpolation.InterpolationTypes.Linear)
     : base(entity, finalPosition, duration, xInterpolation, yInterpolation)
 {
     AfterImageData = afterImageData;
 }
        protected override void OnStart()
        {
            base.OnStart();

            if (AfterImageData == null)
            {
                Debug.LogWarning($"{nameof(AfterImageData)} is null, so no after-images will be added");
                return;
            }

            if (Entities != null)
            {
                double duration = Duration;

                //Set duration to 0 if it's less so the after-images go away
                if (duration < 0)
                {
                    duration = 0;
                }

                for (int i = 0; i < Entities.Length; i++)
                {
                    //Add after-images for a duration
                    Entities[i].BManager.battleObjManager.AddBattleObject(new AfterImageVFX(Entities[i], AfterImageData.MaxAfterImages,
                                                                                            AfterImageData.FramesBehind, AfterImageData.AlphaValue, AfterImageData.AlphaSetting, AfterImageData.AnimSetting, duration));
                }
            }

            //Clear the data since we don't want to hold onto it
            AfterImageData.Entity = null;
            AfterImageData        = null;
        }
Beispiel #3
0
 private void RemoveAfterImages()
 {
     if (AfterImages != null)
     {
         User.BManager.battleObjManager.RemoveBattleObject(AfterImages);
         AfterImages = null;
     }
 }
Beispiel #4
0
 private void RemoveAfterImages()
 {
     if (AfterImages != null)
     {
         BattleObjManager.Instance.RemoveBattleObject(AfterImages);
         AfterImages = null;
     }
 }
Beispiel #5
0
        protected override void OnStart()
        {
            base.OnStart();

            //Add after-images to the user
            AfterImages = new AfterImageVFX(User, 4, 4, .2f,
                                            AfterImageVFX.AfterImageAlphaSetting.FadeOff, AfterImageVFX.AfterImageAnimSetting.Current);

            //Update as many times as there are after-images to add several after-images in place
            //This prevents them from suddenly popping in while the BattleEntity is walking towards the target
            for (int i = 0; i < AfterImages.MaxAfterImages; i++)
            {
                AfterImages.Update();
            }

            User.BManager.battleObjManager.AddBattleObject(AfterImages);
        }