Esempio n. 1
0
 private void ScheduleExplode()
 {
   Waiters.Wait((Func<bool>) (() => this.PlayerManager.Grounded), (Action) (() =>
   {
     this.WalkTo.Destination = (Func<Vector3>) (() => this.PlayerManager.Position * Vector3.UnitY + this.Origin * FezMath.XZMask);
     this.WalkTo.NextAction = ActionType.LookingUp;
     this.PlayerManager.Action = ActionType.WalkingTo;
     this.CurrentPhase = EldersHexahedron.Phase.HexaExplode;
     this.SincePhaseStarted = 0.0f;
     if (this.GameState.IsTrialMode)
       Waiters.Wait(1.0, (Action) (() => SoundEffectExtensions.Emit(this.sTrialWhiteOut)));
     Waiters.Interpolate(0.5, (Action<float>) (s => this.eHexDrone.Pitch = FezMath.Saturate(s)), (Action) (() => this.eHexDrone.FadeOutAndDie(0.1f)));
   })).AutoPause = true;
 }
Esempio n. 2
0
 private void Talk2()
 {
   Waiters.Interpolate(0.5, (Action<float>) (s => this.eAmbientHex.VolumeFactor = FezMath.Saturate((float) (0.25 * (1.0 - (double) s) + 0.25)) * 0.85f));
   this.Say(5, 7, (Action) (() =>
   {
     Waiters.Interpolate(0.5, (Action<float>) (s => this.eAmbientHex.VolumeFactor = FezMath.Saturate((float) (0.25 * (1.0 - (double) s))) * 0.85f));
     SoundEffectExtensions.Emit(this.sHexDisappear);
     this.SincePhaseStarted = 0.0f;
     this.CurrentPhase = EldersHexahedron.Phase.Disappear;
     this.eHexaTalk.FadeOutAndDie(0.1f);
     this.eHexaTalk = (SoundEmitter) null;
     this.PlayerManager.CanControl = false;
   }));
 }
Esempio n. 3
0
 private void HexaExplode(float elapsedTime)
 {
   this.AoInstance.Hidden = true;
   this.AoInstance.Visible = false;
   this.SmallCubes.Position = this.SolidCubes.Position = this.AoInstance.Position;
   if ((double) this.SincePhaseStarted > 0.25)
   {
     double num = (double) this.SincePhaseStarted / 13.0;
     if (this.sExplode != null)
     {
       SoundEffectExtensions.Emit(this.sExplode);
       this.sExplode = (SoundEffect) null;
     }
     this.ExplodeSpeed *= 0.95f;
     foreach (Group group in this.SolidCubes.Groups)
     {
       group.Position += ((EldersHexahedron.ShardProjectionData) group.CustomData).Direction * (float) (0.00499999988824129 + (double) this.ExplodeSpeed + (double) this.CameraSpinSpeed / 3.0);
       group.Rotation *= ((EldersHexahedron.ShardProjectionData) group.CustomData).Spin;
     }
     foreach (Group group in this.SmallCubes.Groups)
     {
       group.Position += ((EldersHexahedron.ShardProjectionData) group.CustomData).Direction * (float) (0.00499999988824129 + (double) this.ExplodeSpeed + (double) this.CameraSpinSpeed / 3.0);
       group.Rotation *= ((EldersHexahedron.ShardProjectionData) group.CustomData).Spin;
     }
   }
   this.CameraSpinSpeed *= 1.01f;
   if ((double) this.SincePhaseStarted < 10.0)
     this.CameraSpinSpeed = MathHelper.Min(this.CameraSpinSpeed, 0.004f);
   this.CameraSpins += this.CameraSpinSpeed;
   this.CameraSpins += this.ExplodeSpeed / 5f;
   this.CameraManager.Direction = Vector3.Normalize(new Vector3((float) Math.Sin((double) this.OriginalSpin + (double) this.CameraSpins * 6.28318548202515), 0.0f, (float) Math.Cos((double) this.OriginalSpin + (double) this.CameraSpins * 6.28318548202515)));
   this.CameraManager.SnapInterpolation();
   if (!this.GameState.IsTrialMode)
   {
     this.Glitches.ActiveGlitches = FezMath.Round((double) Easing.EaseIn((double) FezMath.Saturate(this.SincePhaseStarted / 13f), EasingType.Decic) * 400.0 + 2.0);
     this.Glitches.FreezeProbability = (double) this.SincePhaseStarted < 8.0 ? 0.0f : ((double) this.SincePhaseStarted < 10.0 ? 1.0 / 1000.0 : ((double) this.SincePhaseStarted < 11.0 ? 0.1f : 0.01f));
     if ((double) this.SincePhaseStarted > 13.0)
       this.Glitches.FreezeProbability = 1f;
   }
   if (this.GameState.IsTrialMode)
   {
     this.UpdateRays(elapsedTime * this.CameraSpinSpeed);
     this.UpdateRays(elapsedTime * this.CameraSpinSpeed);
   }
   else
   {
     for (int i = this.TrialRaysMesh.Groups.Count - 1; i >= 0; --i)
     {
       Group group = this.TrialRaysMesh.Groups[i];
       group.Material.Diffuse = new Vector3(FezMath.Saturate(1f - this.SincePhaseStarted));
       group.Scale *= new Vector3(1.5f, 1f, 1f);
       if (FezMath.AlmostEqual(group.Material.Diffuse.X, 0.0f))
         this.TrialRaysMesh.RemoveGroupAt(i);
     }
   }
   if (!this.GameState.IsTrialMode && (double) this.SincePhaseStarted > 15.0)
   {
     this.CurrentPhase = EldersHexahedron.Phase.ThatsIt;
     ServiceHelper.AddComponent((IGameComponent) new Reboot(this.Game, "GOMEZ_HOUSE"));
   }
   else
   {
     if (!this.GameState.IsTrialMode || (double) this.TrialTimeAccumulator <= 7.5)
       return;
     this.CurrentPhase = EldersHexahedron.Phase.ThatsIt;
     this.GameState.SkipLoadScreen = true;
     ServiceHelper.AddComponent((IGameComponent) new ScreenFade(this.Game)
     {
       FromColor = Color.White,
       ToColor = ColorEx.TransparentWhite,
       Duration = 2f
     });
     this.LevelManager.ChangeLevel("ARCH");
     Waiters.Wait((Func<bool>) (() => !this.GameState.Loading), (Action) (() =>
     {
       this.GameState.SkipLoadScreen = false;
       this.Visible = false;
       while (!this.PlayerManager.CanControl)
         this.PlayerManager.CanControl = true;
       this.SoundManager.MusicVolumeFactor = 1f;
     }));
   }
 }