private void StopTime(Player player) { TBARPlayer p = TBARPlayer.Get(player); if (p.ShatteredTime) { return; } player.AddBuff(ModContent.BuffType <ShatteredTime>(), Global.SecondsToTicks(30)); bool isTimeStopped = TBAR.TimeStopManager.IsTimeStopped; string path = isTimeStopped ? "" : "Sounds/StarPlatinum/SP_TimeStopSignal"; TimeStopInstance ts = new TimeStopInstance(player, Global.SecondsToTicks(10), path) { EndSoundEffect = "Sounds/StarPlatinum/SP_TimeRestore" }; if (!isTimeStopped) { Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType <TimeStopVFX>(), 0, 0, player.whoAmI); TBAR.Instance.PlayVoiceLine("Sounds/StarPlatinum/SP_TimeStopCall"); } else { p.RepeatCount--; } TBAR.TimeStopManager.TryStopTime(ts); }
private void TimeStop(Player player) { TBARPlayer p = TBARPlayer.Get(player); if (p.ShatteredTime) { return; } player.AddBuff(ModContent.BuffType <ShatteredTime>(), Global.SecondsToTicks(30)); 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" }; if (!isTimeStopped) { Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType <TimeStopVFX>(), 0, 0, player.whoAmI); TBAR.Instance.PlaySound("Sounds/TheWorld/TimeStop"); } else { p.RepeatCount--; } TBAR.TimeStopManager.TryStopTime(ts); }
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); }