示例#1
0
        public TimeSkipInstance(Entity owner, int duration)
        {
            _owner = owner;

            Duration = duration;

            TimeSkipVisual.Start();
        }
示例#2
0
        public void Update()
        {
            Duration--;

            if (Duration == 22)
            {
                TimeSkipVisual vs = TimeSkipVisual.Start();
                vs.Animation.AnimationPlay += Animation_AnimationPlay;
            }
        }
示例#3
0
        private void TimeErase_OnActivate(Player player)
        {
            NPC.NewNPC((int)player.Center.X, (int)player.Center.Y, ModContent.NPCType <PlayerBaitNPC>());
            Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType <PlayerBaitProjectile>(), 0, 0, player.whoAmI);
            TBARMusic.AddTrackToQueue("Sounds/Music/KingCrimsonMusic", Global.SecondsToTicks(10));
            FakeTilesProjectile.Create(player.Center);
            TimeSkipVisual vs = TimeSkipVisual.Start();

            vs.Animation.AnimationPlay += Animation_AnimationPlay;
            TBAR.TimeSkipManager.AddEffect(new TimeSkipInstance(player, Global.SecondsToTicks(6)));
        }
示例#4
0
        private void Plr_OnRightClick(Player sender)
        {
            TBARPlayer plr = TBARPlayer.Get(sender);

            TBAR.Instance.PlaySound("Sounds/StandAbilityEffects/TimeSkip");
            TimeSkipVisual.Start();

            Entity target = null;

            if (plr.TargetedNPC() != null)
            {
                target = (Entity)plr.TargetedNPC();
            }

            if (plr.TargetedPlayer() != null)
            {
                target = (Entity)plr.TargetedPlayer();
            }

            if (target != null)
            {
                Vector2 destination = target.Center - new Vector2(((target.width / 2) + (sender.width * 2)) * (target.direction), sender.height);
                if (Collision.SolidCollision(destination, sender.width, sender.height))
                {
                    return;
                }

                sender.direction = target.direction;
                sender.Teleport(destination, 1);
            }
            else
            {
                if (Collision.SolidCollision(Main.MouseWorld, sender.width, sender.height))
                {
                    return;
                }

                sender.Teleport(Main.MouseWorld, 1);
            }

            plr.OnRightClick -= Plr_OnRightClick;
        }