public TimeSkipInstance(Entity owner, int duration) { _owner = owner; Duration = duration; TimeSkipVisual.Start(); }
public void Update() { Duration--; if (Duration == 22) { TimeSkipVisual vs = TimeSkipVisual.Start(); vs.Animation.AnimationPlay += Animation_AnimationPlay; } }
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))); }
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; }