示例#1
0
文件: Intro.cs 项目: Zeludon/FEZ
 private void DoLoad()
 {
   this.GameState.Loading = true;
   this.Game.IsFixedTimeStep = false;
   this.GameState.SkipLoadBackground = true;
   if (!this.Fake)
     this.GameState.LoadLevel();
   else
     this.LevelManager.ChangeLevel(this.FakeLevel);
   if (!this.ZoomToHouse)
     ServiceHelper.AddComponent((IGameComponent) (this.IntroPanDown = new IntroPanDown(this.Game)));
   Logger.Log("Intro", "All components are loaded.");
   this.GameState.ScheduleLoadEnd = true;
   this.Game.IsFixedTimeStep = true;
   this.GameState.SkipLoadBackground = false;
   this.ChangePhase();
 }
示例#2
0
文件: Intro.cs 项目: Zeludon/FEZ
 private void UpdateLogo()
 {
   double totalSeconds = this.phaseTime.TotalSeconds;
   switch (this.screen)
   {
     case Intro.Screen.ESRB_PEGI:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           this.opacity = 1f;
           this.ChangePhase();
           return;
         case Intro.Phase.Wait:
           if (totalSeconds < 4.0)
             return;
           this.ChangePhase();
           return;
         case Intro.Phase.FadeOut:
           if (totalSeconds >= 0.25)
             this.ChangePhase();
           this.opacity = 1f - Easing.EaseIn(FezMath.Saturate(totalSeconds * 4.0), EasingType.Sine);
           return;
         default:
           return;
       }
     case Intro.Screen.XBLA:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           if (totalSeconds >= 0.125)
             this.ChangePhase();
           this.opacity = Easing.EaseIn(FezMath.Saturate(totalSeconds * 8.0), EasingType.Sine);
           return;
         case Intro.Phase.Wait:
           if (totalSeconds < 2.0)
             return;
           this.ChangePhase();
           return;
         case Intro.Phase.FadeOut:
           if (totalSeconds >= 0.25)
             this.ChangePhase();
           this.opacity = 1f - Easing.EaseIn(FezMath.Saturate(totalSeconds * 4.0), EasingType.Sine);
           return;
         default:
           return;
       }
     case Intro.Screen.MGS:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           if (totalSeconds >= 0.125)
             this.ChangePhase();
           this.opacity = Easing.EaseIn(FezMath.Saturate(totalSeconds * 8.0), EasingType.Sine);
           return;
         case Intro.Phase.Wait:
           if (totalSeconds < 2.0)
             return;
           this.ChangePhase();
           return;
         case Intro.Phase.FadeOut:
           if (totalSeconds >= 0.25)
             this.ChangePhase();
           this.opacity = Math.Min(this.opacity, 1f - Easing.EaseIn(FezMath.Saturate(totalSeconds * 4.0), EasingType.Sine));
           return;
         default:
           return;
       }
     case Intro.Screen.WhiteScreen:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           if (totalSeconds >= 0.125)
             this.ChangePhase();
           this.opacity = Easing.EaseIn(FezMath.Saturate(totalSeconds * 8.0), EasingType.Sine);
           return;
         case Intro.Phase.Wait:
           if (!Intro.PreloadStarted)
           {
             this.GameState.SkipLoadScreen = true;
             this.GameState.Loading = true;
             Worker<bool> worker = this.ThreadPool.Take<bool>(new Action<bool>(this.DoPreLoad));
             worker.Priority = ThreadPriority.AboveNormal;
             worker.Finished += (Action) (() =>
             {
               this.ThreadPool.Return<bool>(worker);
               this.GameState.ScheduleLoadEnd = true;
               this.GameState.SkipLoadScreen = false;
             });
             worker.Start(false);
             Intro.PreloadStarted = true;
           }
           if (!Intro.PreloadComplete)
             return;
           this.ChangePhase();
           return;
         case Intro.Phase.FadeOut:
           if (totalSeconds >= 0.25)
             this.ChangePhase();
           this.opacity = Math.Min(this.opacity, 1f - Easing.EaseIn(FezMath.Saturate(totalSeconds * 4.0), EasingType.Sine));
           return;
         default:
           return;
       }
     case Intro.Screen.Polytron:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           if (totalSeconds >= 1.5)
             this.ChangePhase();
           this.opacity = 0.0f;
           this.PolytronLogo.Opacity = 1f;
           return;
         case Intro.Phase.Wait:
           if (totalSeconds < 1.5)
             return;
           this.ChangePhase();
           return;
         case Intro.Phase.FadeOut:
           if (totalSeconds >= 0.25)
             this.ChangePhase();
           this.PolytronLogo.Opacity = 1f - Easing.EaseIn(FezMath.Saturate(totalSeconds * 4.0), EasingType.Sine);
           return;
         default:
           return;
       }
     case Intro.Screen.Trapdoor:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           if (totalSeconds >= 0.125)
             this.ChangePhase();
           this.opacity = Easing.EaseIn(FezMath.Saturate(totalSeconds * 8.0), EasingType.Sine);
           return;
         case Intro.Phase.Wait:
           if (totalSeconds < 1.5)
             return;
           this.ChangePhase();
           return;
         case Intro.Phase.FadeOut:
           if (totalSeconds >= 0.25)
             this.ChangePhase();
           this.opacity = Math.Min(this.opacity, 1f - Easing.EaseIn(FezMath.Saturate(totalSeconds * 4.0), EasingType.Sine));
           return;
         default:
           return;
       }
     case Intro.Screen.TrixelEngine:
       float num = 0.0f;
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           if (this.sTrixelIn != null)
           {
             SoundEffectExtensions.Emit(this.sTrixelIn);
             this.sTrixelIn = (SoundEffect) null;
           }
           if (totalSeconds >= 1.0)
             this.ChangePhase();
           num = (float) ((1.0 - (double) Easing.EaseOut(FezMath.Saturate(totalSeconds), EasingType.Quadratic)) * 6.0);
           this.opacity = Easing.EaseIn(FezMath.Saturate(totalSeconds * 2.0 - 0.5), EasingType.Quadratic);
           break;
         case Intro.Phase.Wait:
           if (totalSeconds >= 1.0)
           {
             this.ChangePhase();
             break;
           }
           else
             break;
         case Intro.Phase.FadeOut:
           if (this.sTrixelOut != null)
           {
             SoundEffectExtensions.Emit(this.sTrixelOut);
             this.sTrixelOut = (SoundEffect) null;
           }
           if (totalSeconds >= 0.5)
             this.ChangePhase();
           this.opacity = Math.Min(this.opacity, 1f - Easing.EaseIn(FezMath.Saturate(totalSeconds * 2.0), EasingType.Quadratic));
           num = Easing.EaseIn(FezMath.Saturate(totalSeconds * 2.0), EasingType.Quadratic) * -4f;
           break;
       }
       this.TrixelPlanes.Groups[0].Position = Vector3.Right * (0.5f + num);
       this.TrixelPlanes.Groups[1].Position = Vector3.Up * (0.5f + num);
       this.TrixelPlanes.Groups[2].Position = Vector3.Backward * num;
       break;
     case Intro.Screen.SaveIndicator:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           this.eDrone.VolumeFactor = FezMath.Saturate((float) totalSeconds / 0.125f);
           this.opacity = Easing.EaseIn(FezMath.Saturate(totalSeconds / 0.125), EasingType.Sine);
           if (totalSeconds < 0.125)
             return;
           this.ChangePhase();
           return;
         case Intro.Phase.Wait:
           if (totalSeconds < 2.625)
             return;
           this.ChangePhase();
           return;
         case Intro.Phase.FadeOut:
           this.opacity = Math.Min(this.opacity, 1f - Easing.EaseOut(FezMath.Saturate(totalSeconds / 0.25), EasingType.Sine));
           this.eDrone.VolumeFactor = (float) (1.0 - (double) FezMath.Saturate((float) totalSeconds / 0.25f) * 0.5);
           if (totalSeconds < 0.25)
             return;
           this.ChangePhase();
           return;
         default:
           return;
       }
     case Intro.Screen.Fez:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           if (totalSeconds >= 0.75)
             this.ChangePhase();
           this.opacity = Easing.EaseInOut(FezMath.Saturate(totalSeconds / 0.75), EasingType.Sine);
           this.promptOpacity = Easing.EaseIn(FezMath.Saturate((totalSeconds - 0.25) / 0.5), EasingType.Sine);
           return;
         case Intro.Phase.Wait:
           this.opacity = this.promptOpacity = 1f;
           if (this.InputManager.Jump != FezButtonState.Pressed && this.InputManager.Start != FezButtonState.Pressed)
             return;
           if (!this.Fake)
             this.InputManager.DetermineActiveController();
           this.SoundManager.PlayNewSong((string) null, 0.0f);
           this.FezLogo.TransitionStarted = true;
           SoundEffectExtensions.Emit(this.sTitleBassHit).Persistent = true;
           this.ChangePhase();
           return;
         case Intro.Phase.FadeOut:
           this.promptOpacity = this.opacity = 1f - Easing.EaseOut(FezMath.Saturate(totalSeconds / 1.0), EasingType.Sine);
           if (totalSeconds < 1.0)
             return;
           this.ChangePhase();
           return;
         default:
           return;
       }
     case Intro.Screen.SellScreen:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           this.GameState.SkipRendering = true;
           this.opacity = Easing.EaseInOut(FezMath.Saturate(totalSeconds - 14.0), EasingType.Sine);
           if (totalSeconds < 15.0)
             return;
           this.ChangePhase();
           return;
         case Intro.Phase.Wait:
           this.FezLogo.LogoTextureXFade = 1f - Easing.EaseIn((double) FezMath.Saturate((float) ((totalSeconds - 76.0) / 4.0)), EasingType.Sine);
           if (this.InputManager.Jump == FezButtonState.Pressed || this.InputManager.Start == FezButtonState.Pressed)
           {
             if (Fez.PublicDemo)
             {
               this.GameState.Restart();
               return;
             }
             else
             {
               SoundEffectExtensions.Emit(this.sExitGame);
               this.GameState.ReturnToArcade();
               this.Enabled = false;
               return;
             }
           }
           else if (!Fez.PublicDemo && (this.InputManager.CancelTalk == FezButtonState.Pressed || this.InputManager.Back == FezButtonState.Pressed))
           {
             this.GameState.SkipRendering = false;
             this.FezLogo.Inverted = false;
             if (!this.FadeBackToGame)
             {
               SoundEffectExtensions.Emit(this.sTitleBassHit);
             }
             else
             {
               this.SoundManager.PlayNewSong((string) null, 0.5f);
               this.SoundManager.UnshelfSong();
               this.SoundManager.Resume();
               this.SoundManager.UnmuteAmbienceTracks(true);
               this.scheduledBackToGame = true;
               this.FezLogo.DoubleTime = true;
               this.PlayerManager.Hidden = true;
               this.GameState.InCutscene = false;
               this.GameState.ForceTimePaused = false;
             }
             this.ChangePhase();
             return;
           }
           else
           {
             if (Fez.PublicDemo || this.InputManager.GrabThrow != FezButtonState.Pressed)
               return;
             SoundEffectExtensions.Emit(this.sConfirm);
             Guide.SimulateTrialMode = false;
             return;
           }
         case Intro.Phase.FadeOut:
           if (totalSeconds >= 2.0)
           {
             if (this.scheduledBackToGame)
             {
               this.PlayerManager.Hidden = false;
               this.PlayerManager.Ground = new MultipleHits<TrileInstance>();
               this.PlayerManager.Velocity = (float) (3.15000009536743 * (double) Math.Sign(this.CollisionManager.GravityFactor) * 0.150000005960464 * 0.0166666675359011) * -Vector3.UnitY;
               this.PhysicsManager.Update((IComplexPhysicsEntity) this.PlayerManager);
               this.PlayerManager.Velocity = (float) (3.15000009536743 * (double) Math.Sign(this.CollisionManager.GravityFactor) * 0.150000005960464 * 0.0166666675359011) * -Vector3.UnitY;
               this.PlayerManager.Action = ActionType.ExitDoor;
               ServiceHelper.RemoveComponent<Intro>(this);
             }
             else
               this.ChangePhase();
           }
           this.opacity = 1f - Easing.EaseInOut(FezMath.Saturate(totalSeconds / 2.0), EasingType.Sine);
           return;
         default:
           return;
       }
     case Intro.Screen.Zoom:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           this.ChangePhase();
           return;
         case Intro.Phase.Wait:
           if (!this.FezLogo.IsFullscreen)
             return;
           Intro.Starfield = this.FezLogo.Starfield;
           ServiceHelper.RemoveComponent<FezLogo>(this.FezLogo);
           this.ChangePhase();
           return;
         case Intro.Phase.FadeOut:
           this.ChangePhase();
           return;
         default:
           return;
       }
     case Intro.Screen.SignOutPrompt:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           if (totalSeconds >= 0.5)
             this.ChangePhase();
           this.opacity = FezMath.Saturate((float) totalSeconds * 2f);
           return;
         case Intro.Phase.Wait:
           if (this.InputManager.Jump != FezButtonState.Pressed && this.InputManager.Start != FezButtonState.Pressed)
             return;
           this.InputManager.DetermineActiveController();
           this.FezLogo.TransitionStarted = true;
           this.ChangePhase();
           return;
         case Intro.Phase.FadeOut:
           if (totalSeconds >= 0.5)
             this.ChangePhase();
           this.opacity = 1f - FezMath.Saturate((float) totalSeconds * 2f);
           return;
         default:
           return;
       }
     case Intro.Screen.SignInChooseDevice:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           if (this.Fake)
             this.ChangePhase();
           else
             this.GameState.SignInAndChooseStorage(new Action(this.ChangePhase));
           this.ChangePhase();
           return;
         case Intro.Phase.Wait:
           return;
         case Intro.Phase.FadeOut:
           this.ChangePhase();
           return;
         default:
           return;
       }
     case Intro.Screen.MainMenu:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           this.GameState.ForcedSignOut = false;
           if (!this.Fake)
           {
             if (!this.GameState.SaveData.HasNewGamePlus || this.GameState.SaveData.Level != null)
             {
               this.GameState.LoadSaveFile((Action) (() => Waiters.Wait(0.0, (Action) (() =>
               {
                 this.Enabled = true;
                 ServiceHelper.AddComponent((IGameComponent) (this.MainMenu = new MainMenu(this.Game)));
                 this.ChangePhase();
               }))));
               this.Enabled = false;
               return;
             }
             else
             {
               ServiceHelper.AddComponent((IGameComponent) (this.MainMenu = new MainMenu(this.Game)));
               this.ChangePhase();
               return;
             }
           }
           else
           {
             this.ChangePhase();
             return;
           }
         case Intro.Phase.Wait:
           if (this.Fake || this.MainMenu.StartedGame)
           {
             this.ZoomToHouse = true;
             Intro.Starfield.Enabled = true;
             SoundEffectExtensions.Emit(this.sStarZoom).Persistent = true;
             this.StartLoading();
             this.ChangePhase();
             return;
           }
           else if (this.MainMenu.HasBought)
           {
             this.GameState.ClearSaveFile();
             this.screen = Intro.Screen.SignInChooseDevice;
             this.phase = Intro.Phase.FadeIn;
             return;
           }
           else if (this.MainMenu.SellingTime)
           {
             this.GameService.EndTrial(true);
             ServiceHelper.RemoveComponent<MainMenu>(this.MainMenu);
             this.MainMenu = (MainMenu) null;
             this.Enabled = false;
             return;
           }
           else
           {
             if (!this.MainMenu.ContinuedGame)
               return;
             this.StartLoading();
             this.ChangePhase();
             return;
           }
         case Intro.Phase.FadeOut:
           this.ChangePhase();
           return;
         default:
           return;
       }
     case Intro.Screen.Warp:
       switch (this.phase)
       {
         case Intro.Phase.FadeIn:
           if (this.GameState.Loading)
             return;
           this.ChangePhase();
           return;
         case Intro.Phase.Wait:
           if (this.GameState.IsTrialMode)
           {
             ServiceHelper.AddComponent((IGameComponent) new TileTransition(ServiceHelper.Game)
             {
               ScreenCaptured = (Action) (() =>
               {
                 ServiceHelper.RemoveComponent<Intro>(this);
                 this.GameState.InCutscene = false;
                 this.GameState.ForceTimePaused = false;
               })
             });
             this.ChangePhase();
           }
           if (this.ZoomToHouse && Intro.Starfield != null && (Intro.Starfield.IsDisposed && this.IntroZoomIn == null))
             ServiceHelper.AddComponent((IGameComponent) (this.IntroZoomIn = new IntroZoomIn(this.Game)));
           if (this.ZoomToHouse && this.IntroZoomIn != null && this.IntroZoomIn.IsDisposed)
           {
             this.IntroZoomIn = (IntroZoomIn) null;
             this.GameState.SaveData.CanNewGamePlus = false;
             Logger.Log("Intro", "Intro is done and game is go!");
             ServiceHelper.RemoveComponent<Intro>(this);
           }
           if (this.GameState.IsTrialMode || this.ZoomToHouse || (this.IntroPanDown == null || this.IntroPanDown.DoPanDown))
             return;
           this.ChangePhase();
           return;
         case Intro.Phase.FadeOut:
           if (this.GameState.IsTrialMode || this.IntroPanDown != null && !this.IntroPanDown.IsDisposed)
             return;
           this.IntroPanDown = (IntroPanDown) null;
           Logger.Log("Intro", "Intro is done and game is go!");
           ServiceHelper.RemoveComponent<Intro>(this);
           return;
         default:
           return;
       }
   }
 }