public override void Update(GameTime gameTime) { if (this.GameState.Paused || this.GameState.InMap || (this.GameState.Loading || this.GameState.InMenuCube)) { return; } this.TimeAccumulator += (float)gameTime.ElapsedGameTime.TotalSeconds; this.WireHeart.Position = this.CrumblingHeart.Position = TempleOfLoveHost.HeartCenter + Vector3.UnitY * (float)Math.Sin((double)this.TimeAccumulator / 2.0) / 2f; this.WireHeart.Rotation *= Quaternion.CreateFromAxisAngle(Vector3.UnitY, (float)(gameTime.ElapsedGameTime.TotalSeconds / 2.0)); this.CrumblingHeart.Rotation = this.WireHeart.Rotation; if (this.GameState.SaveData.HasDoneHeartReboot && this.Phase == TempleOfLoveHost.Phases.None) { this.Phase = TempleOfLoveHost.Phases.CrumbleOut; } switch (this.Phase) { case TempleOfLoveHost.Phases.CrumbleOut: this.PhaseTime += (float)gameTime.ElapsedGameTime.TotalSeconds; foreach (Group group in this.CrumblingHeart.Groups) { Vector3 vector = (Vector3)group.CustomData; float y = (float)Math.Pow((double)Math.Max(this.PhaseTime - (float)(1.0 - ((double)vector.Y * 2.0 + (double)vector.Z + (double)vector.X)), 0.0f) * 0.875, 2.0); group.Position = new Vector3(0.0f, y, 0.0f) + vector * y / 5f; group.Rotation = Quaternion.CreateFromAxisAngle(Vector3.Normalize(vector), y / 10f); } this.WireHeartFactor = MathHelper.Lerp(this.WireHeartFactor, (float)(1 - FezMath.AsNumeric(RandomHelper.Probability((double)this.PhaseTime / 7.0))), (float)(0.125 + (double)this.PhaseTime / 7.0 * 0.200000002980232)); if ((double)this.PhaseTime <= 7.0) { break; } this.PhaseTime = 0.0f; this.WireHeartFactor = 0.0f; this.Phase = TempleOfLoveHost.Phases.ShineReboot; this.SoundManager.PlayNewSong((string)null, 4f); this.SoundManager.MuteAmbienceTracks(); this.SoundManager.KillSounds(4f); SoundEffectExtensions.Emit(this.sRayWhiteout); break; case TempleOfLoveHost.Phases.ShineReboot: this.PhaseTime += (float)gameTime.ElapsedGameTime.TotalSeconds; foreach (Group group in this.CrumblingHeart.Groups) { Vector3 vector = (Vector3)group.CustomData; float y = (float)Math.Pow((double)Math.Max(this.PhaseTime + 7f - (float)(1.0 - ((double)vector.Y * 2.0 + (double)vector.Z + (double)vector.X)), 0.0f) * 0.875, 2.0); group.Position = new Vector3(0.0f, y, 0.0f) + vector * y / 5f; group.Rotation = Quaternion.CreateFromAxisAngle(Vector3.Normalize(vector), y / 10f); } this.UpdateRays((float)gameTime.ElapsedGameTime.TotalSeconds); if ((double)this.PhaseTime <= 4.0) { break; } this.SmoothReboot(); break; } }
public override void Update(GameTime gameTime) { if (this.GameState.Paused || this.GameState.InMap || (this.GameState.Loading || this.GameState.InMenuCube)) return; this.TimeAccumulator += (float) gameTime.ElapsedGameTime.TotalSeconds; this.WireHeart.Position = this.CrumblingHeart.Position = TempleOfLoveHost.HeartCenter + Vector3.UnitY * (float) Math.Sin((double) this.TimeAccumulator / 2.0) / 2f; this.WireHeart.Rotation *= Quaternion.CreateFromAxisAngle(Vector3.UnitY, (float) (gameTime.ElapsedGameTime.TotalSeconds / 2.0)); this.CrumblingHeart.Rotation = this.WireHeart.Rotation; if (this.GameState.SaveData.HasDoneHeartReboot && this.Phase == TempleOfLoveHost.Phases.None) this.Phase = TempleOfLoveHost.Phases.CrumbleOut; switch (this.Phase) { case TempleOfLoveHost.Phases.CrumbleOut: this.PhaseTime += (float) gameTime.ElapsedGameTime.TotalSeconds; foreach (Group group in this.CrumblingHeart.Groups) { Vector3 vector = (Vector3) group.CustomData; float y = (float) Math.Pow((double) Math.Max(this.PhaseTime - (float) (1.0 - ((double) vector.Y * 2.0 + (double) vector.Z + (double) vector.X)), 0.0f) * 0.875, 2.0); group.Position = new Vector3(0.0f, y, 0.0f) + vector * y / 5f; group.Rotation = Quaternion.CreateFromAxisAngle(Vector3.Normalize(vector), y / 10f); } this.WireHeartFactor = MathHelper.Lerp(this.WireHeartFactor, (float) (1 - FezMath.AsNumeric(RandomHelper.Probability((double) this.PhaseTime / 7.0))), (float) (0.125 + (double) this.PhaseTime / 7.0 * 0.200000002980232)); if ((double) this.PhaseTime <= 7.0) break; this.PhaseTime = 0.0f; this.WireHeartFactor = 0.0f; this.Phase = TempleOfLoveHost.Phases.ShineReboot; this.SoundManager.PlayNewSong((string) null, 4f); this.SoundManager.MuteAmbienceTracks(); this.SoundManager.KillSounds(4f); SoundEffectExtensions.Emit(this.sRayWhiteout); break; case TempleOfLoveHost.Phases.ShineReboot: this.PhaseTime += (float) gameTime.ElapsedGameTime.TotalSeconds; foreach (Group group in this.CrumblingHeart.Groups) { Vector3 vector = (Vector3) group.CustomData; float y = (float) Math.Pow((double) Math.Max(this.PhaseTime + 7f - (float) (1.0 - ((double) vector.Y * 2.0 + (double) vector.Z + (double) vector.X)), 0.0f) * 0.875, 2.0); group.Position = new Vector3(0.0f, y, 0.0f) + vector * y / 5f; group.Rotation = Quaternion.CreateFromAxisAngle(Vector3.Normalize(vector), y / 10f); } this.UpdateRays((float) gameTime.ElapsedGameTime.TotalSeconds); if ((double) this.PhaseTime <= 4.0) break; this.SmoothReboot(); break; } }