public void PreTimeSkipAI(Projectile projectile) { var IsTimeSkipped = TimeSkipManager.IsTimeSkipped && projectile.hostile && !(projectile.modProjectile is PunchBarrage); if (IsTimeSkipped) { if (TimeSkipManager.TimeSkippedFor % 4 == 0) { TimeSkipStates.Add ( new TimeSkipState(projectile.Center, projectile.velocity, projectile.scale, projectile.rotation, new Rectangle(0, projectile.frame, 0, 0), projectile.direction, projectile.ai) ); } } if (TimeSkipStates.Count > 12) { TimeSkipStates.RemoveAt(0); } if (IsTimeSkipped && TimeSkipManager.TimeSkippedFor <= 2 && TimeSkipStates.Count > 0) { projectile.Center = TimeSkipStates[0].Position; projectile.ai = TimeSkipStates[0].AI; projectile.scale = TimeSkipStates[0].Scale; projectile.direction = TimeSkipStates[0].Direction; } }
public void PreTimeSkipAI(NPC npc) { if (npc.type == NPCID.CultistBoss) { foreach (TimeSkipData dt in TimeSkipStates) { Main.NewText(dt); } } var IsTimeSkipped = TBAR.TimeSkipManager.IsTimeSkipped; if (IsTimeSkipped) { elapsedTime++; if (elapsedTime == 6) { TimeSkipStates.Add ( new TimeSkipData(npc.Center, npc.velocity, npc.scale, npc.rotation, npc.frame, npc.direction, npc.ai) ); elapsedTime = 0; } if (TimeSkipStates.Count > 12) { TimeSkipStates.RemoveAt(0); } if (TimeSkipStates.Count <= 0) { for (int i = 0; i < 13; i++) { TimeSkipStates.Add ( new TimeSkipData(npc.Center, npc.velocity, npc.scale, npc.rotation, npc.frame, npc.direction, npc.ai) ); } } } else { elapsedTime = 0; } if (!IsTimeSkipped && TimeSkipStates.Count > 0) { /* * npc.ai = TimeSkipStates[0].AI; * npc.Center = TimeSkipStates[0].Position; * npc.scale = TimeSkipStates[0].Scale; * npc.direction = TimeSkipStates[0].Direction; */ TimeSkipStates.Clear(); } }
public void PreTimeSkipAI(NPC npc) { var IsTimeSkipped = TimeSkipManager.IsTimeSkipped; int TimeSkipDuration = TimeSkipManager.TimeSkippedFor; if (IsTimeSkipped) { if (TimeSkipManager.TimeSkippedFor % 6 == 0) { TimeSkipStates.Add ( new TimeSkipState(npc.Center, npc.velocity, npc.scale, npc.rotation, npc.frame, npc.direction, npc.ai) ); } } if (IsTimeSkipped && TimeSkipStates.Count > 12) { TimeSkipStates.RemoveAt(0); } if (TimeSkipStates.Count <= 0 && IsTimeSkipped) { for (int i = 0; i < 13; i++) { TimeSkipStates.Add ( new TimeSkipState(npc.Center, npc.velocity, npc.scale, npc.rotation, npc.frame, npc.direction, npc.ai) ); } } if (IsTimeSkipped && TimeSkipDuration <= 2 && TimeSkipStates.Count > 0) { /* * npc.ai = TimeSkipStates[0].AI; * npc.Center = TimeSkipStates[0].Position; * npc.scale = TimeSkipStates[0].Scale; * npc.direction = TimeSkipStates[0].Direction; */ TimeSkipStates.Clear(); } }