Exemple #1
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)));
        }
Exemple #2
0
        private void SlamDunk_OnActivate(Player player)
        {
            TBARPlayer p = TBARPlayer.Get(player);

            if (p.ShatteredTime)
            {
                return;
            }

            player.AddBuff(ModContent.BuffType <ShatteredTime>(), Global.SecondsToTicks(16));

            if (ActiveInstance != null && ActiveInstance is TheWorldProjectile tw)
            {
                tw.SetState("FlyUp");

                ScreenModifier           holdPos    = new ScreenModifier(player.Center, 15);
                ScreenModifier           holdPos2   = new ScreenModifier(new Vector2(tw.MousePosition.X, player.Center.Y), 160);
                SmoothStepScreenModifier smoothStep = new SmoothStepScreenModifier(player.Center, new Vector2(tw.MousePosition.X, player.Center.Y), 0.25f, 120);

                ScreenModifier.AddModifiersToPlayer(player, holdPos, smoothStep, holdPos2);
            }

            TBARMusic.AddTrackToQueue("Sounds/Music/TWTheme", Global.SecondsToTicks(11));

            bool   isTimeStopped = TBAR.TimeStopManager.IsTimeStopped;
            string path          = isTimeStopped ? "" : "Sounds/TheWorld/TheWorld_ZaWarudoSFX";

            TimeStopInstance ts = new TimeStopInstance(player, Global.SecondsToTicks(10), path)
            {
                EndSoundEffect = "Sounds/TheWorld/TheWorld_ZaWarudoReleaseSFX"
            };

            Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType <TimeStopVFX>(), 0, 0, player.whoAmI);

            TBAR.TimeStopManager.ForceStop(ts);
        }