コード例 #1
0
 public override void Update(GameTime gameTime)
 {
     if (!this.LevelManager.Loops || this.PlayerManager.Action == ActionType.FreeFalling || (this.GameState.Loading || this.GameState.InMap) || this.GameState.Paused)
     {
         return;
     }
     while ((double)this.PlayerManager.Position.Y < 0.0)
     {
         this.PlayerManager.Position += this.LevelManager.Size * Vector3.UnitY;
         IGameCameraManager cameraManager1 = this.CameraManager;
         Vector3            vector3_1      = cameraManager1.Center + this.LevelManager.Size * Vector3.UnitY;
         cameraManager1.Center = vector3_1;
         IGameCameraManager cameraManager2 = this.CameraManager;
         Vector3            vector3_2      = cameraManager2.ViewOffset + this.LevelManager.Size * Vector3.UnitY;
         cameraManager2.ViewOffset = vector3_2;
     }
     while ((double)this.PlayerManager.Position.Y > (double)this.LevelManager.Size.Y)
     {
         this.PlayerManager.Position -= this.LevelManager.Size * Vector3.UnitY;
         IGameCameraManager cameraManager1 = this.CameraManager;
         Vector3            vector3_1      = cameraManager1.Center - this.LevelManager.Size * Vector3.UnitY;
         cameraManager1.Center = vector3_1;
         IGameCameraManager cameraManager2 = this.CameraManager;
         Vector3            vector3_2      = cameraManager2.ViewOffset - this.LevelManager.Size * Vector3.UnitY;
         cameraManager2.ViewOffset         = vector3_2;
         this.PlayerManager.IgnoreFreefall = true;
     }
 }
コード例 #2
0
ファイル: TrixelParticleSystem.cs プロジェクト: Zeludon/FEZ
 public TrixelParticleSystem(Game game, TrixelParticleSystem.Settings settings)
   : base(game)
 {
   this.settings = settings;
   this.DrawOrder = 10;
   this.PhysicsManager = ServiceHelper.Get<IPhysicsManager>();
   this.CameraManager = ServiceHelper.Get<IGameCameraManager>();
   this.GameState = ServiceHelper.Get<IGameStateManager>();
   this.LightingPostProcess = ServiceHelper.Get<ILightingPostProcess>();
   this.CollisionManager = ServiceHelper.Get<ICollisionManager>();
 }
コード例 #3
0
 public TrixelParticleSystem(Game game, TrixelParticleSystem.Settings settings)
     : base(game)
 {
     this.settings            = settings;
     this.DrawOrder           = 10;
     this.PhysicsManager      = ServiceHelper.Get <IPhysicsManager>();
     this.CameraManager       = ServiceHelper.Get <IGameCameraManager>();
     this.GameState           = ServiceHelper.Get <IGameStateManager>();
     this.LightingPostProcess = ServiceHelper.Get <ILightingPostProcess>();
     this.CollisionManager    = ServiceHelper.Get <ICollisionManager>();
 }
コード例 #4
0
ファイル: TetraordialOoze.cs プロジェクト: conankzhang/fez
        public override void Update(GameTime gameTime)
        {
            if (this.GameState.Paused || this.GameState.Loading)
            {
                return;
            }
            this.Time += (float)gameTime.ElapsedGameTime.TotalSeconds;
            if (this.ActiveState != TetraordialOoze.State.Zoom)
            {
                return;
            }
            if ((double)this.Time == 0.0)
            {
                this.CameraManager.Center    = Vector3.Zero;
                this.CameraManager.Direction = Vector3.UnitZ;
                this.CameraManager.Radius    = 10f;
                this.CameraManager.SnapInterpolation();
            }
            if ((double)this.Time == 0.0)
            {
                this.NoiseMesh.Scale = new Vector3(1.87495f);
                this.TetraMesh.Scale = Vector3.One;
            }
            for (int index = 0; index < this.TetraMesh.Groups.Count / 10; ++index)
            {
                this.SwapTetraminos();
            }
            if (this.TetraMesh.Groups.Count < 10 && RandomHelper.Probability(0.100000001490116))
            {
                this.SwapTetraminos();
            }
            float amount = FezMath.Saturate(this.Time / 14f);

            if ((double)amount != 1.0)
            {
                this.NoiseMesh.Scale *= MathHelper.Lerp(1.0025f, 1.01625f, amount);
                IGameCameraManager cameraManager = this.CameraManager;
                double             num           = (double)cameraManager.Radius / (double)MathHelper.Lerp(1.0025f, 1.01625f, amount);
                cameraManager.Radius = (float)num;
                this.CameraManager.SnapInterpolation();
            }
            float num1 = MathHelper.Lerp(0.0f, 1f, Easing.EaseIn((double)FezMath.Saturate(amount * 4f), EasingType.Linear));

            foreach (Group group in this.TetraMesh.Groups)
            {
                group.Material.Opacity = num1;
            }
            this.NoiseMesh.Material.Opacity = 1f - FezMath.Saturate(amount * 1.5f);
            if ((double)amount != 1.0)
            {
                return;
            }
            this.ChangeState();
        }
コード例 #5
0
        public override void Update(GameTime gameTime)
        {
            if (this.GameState.Loading || this.GameState.Paused)
            {
                return;
            }
            float num1 = (float)gameTime.ElapsedGameTime.TotalSeconds;

            if ((double)num1 == 0.0 || (double)this.StepTime == 0.0)
            {
                this.Reset();
            }
            if ((double)this.preWaitTime > 2.0)
            {
                this.StepTime += num1;
                IGameCameraManager cameraManager = this.CameraManager;
                double             num2          = (double)cameraManager.Radius * 1.00499999523163;
                cameraManager.Radius   = (float)num2;
                this.PointsMesh.Scale *= 1.00125f;
            }
            else
            {
                this.StepTime     = 1.0 / 1000.0;
                this.preWaitTime += num1;
            }
            this.CameraManager.SnapInterpolation();
            this.CubesEffect.Emissive        = 1f - Easing.EaseInOut((double)FezMath.Saturate(this.StepTime / 10f), EasingType.Quadratic);
            this.CubesMesh.Material.Opacity  = 1f - Easing.EaseIn((double)FezMath.Saturate((float)(((double)this.StepTime - 23.0) / 3.0)), EasingType.Sine);
            this.PointsMesh.Material.Opacity = 1f - Easing.EaseIn((double)FezMath.Saturate((float)(((double)this.StepTime - 5.0) / 10.0)), EasingType.Sine);
            if (!this.sBluePlayed && (double)this.StepTime > 0.25)
            {
                SoundEffectExtensions.Emit(this.sBlueZoomOut);
                this.sBluePlayed = true;
            }
            if (!this.sProgPlayed && (double)this.StepTime > 7.5)
            {
                SoundEffectExtensions.Emit(this.sProgressiveAppear);
                this.sProgPlayed = true;
            }
            if (!this.sFadePlayed && (double)this.StepTime > 24.0)
            {
                SoundEffectExtensions.Emit(this.sFadeOut);
                this.sFadePlayed = true;
            }
            if ((double)this.StepTime <= 26.0)
            {
                return;
            }
            this.ChangeState();
        }
コード例 #6
0
        public override void Update(GameTime gameTime)
        {
            if (this.GameState.Loading || this.GameState.Paused || (this.GameState.InMap || !this.CameraManager.ActionRunning) || (this.Solved || this.CameraManager.ProjectionTransition || !FezMath.IsOrthographic(this.CameraManager.Viewpoint)))
            {
                return;
            }
            this.SinceHit += gameTime.ElapsedGameTime;
            Vector3 vector = (this.PlayerManager.Position - this.BellAo.Position - new Vector3(0.0f, 1f, 0.0f)) * FezMath.ScreenSpaceMask(this.CameraManager.Viewpoint);

            vector.X += vector.Z;
            Vector3 vector3_1 = FezMath.Abs(vector);

            if (this.InputManager.GrabThrow == FezButtonState.Pressed && ((double)vector3_1.X < 2.0 && (double)vector3_1.Y < 1.5) && (this.PlayerManager.CarriedInstance == null && this.PlayerManager.Grounded) && this.PlayerManager.Action != ActionType.ReadingSign)
            {
                if (this.wutex1 != null || this.wutex2 != null)
                {
                    if (this.stackedHits < 10)
                    {
                        ++this.stackedHits;
                    }
                }
                else
                {
                    this.PlayerManager.Action = ActionType.TurnToBell;
                    this.ScheduleTurnTo();
                }
            }
            if (this.wutex1 == null && this.wutex2 == null && this.stackedHits > 0)
            {
                this.ScheduleTurnTo();
                --this.stackedHits;
            }
            this.AngularVelocity *= MathHelper.Clamp((float)(0.995000004768372 - this.SinceHit.TotalSeconds * (1.0 / 400.0)), 0.0f, 1f);
            this.Angle           += this.AngularVelocity * 0.1f;
            this.AngularVelocity += -this.Angle * 0.01f;
            Vector3    scale;
            Quaternion rotation;
            Vector3    translation;

            (Matrix.CreateTranslation(0.0f, -3.5f, 0.0f) * Matrix.CreateFromYawPitchRoll(RandomHelper.Centered(FezMath.Saturate((3.0 - this.SinceHit.TotalSeconds) / 3.0) * 0.0125000001862645), this.Angle.X, this.Angle.Y) * Matrix.CreateTranslation(this.OriginalPosition.X, this.OriginalPosition.Y + 3.5f, this.OriginalPosition.Z)).Decompose(out scale, out rotation, out translation);
            this.BellAo.Position = translation;
            this.BellAo.Rotation = rotation;
            double             max           = FezMath.Saturate((1.5 - this.SinceHit.TotalSeconds) / 1.5) * 0.0750000029802322;
            IGameCameraManager cameraManager = this.CameraManager;
            Vector3            vector3_2     = cameraManager.InterpolatedCenter + new Vector3(RandomHelper.Between(-max, max), RandomHelper.Between(-max, max), RandomHelper.Between(-max, max));

            cameraManager.InterpolatedCenter = vector3_2;
        }
コード例 #7
0
        private void Draw()
        {
            if (!this.LevelManager.Loops || this.GameState.Loading)
            {
                return;
            }
            float num = this.LevelManager.Size.Y * ((double)this.PlayerManager.Position.Y < (double)this.LevelManager.Size.Y / 2.0 ? 1f : -1f);

            this.GameState.LoopRender = true;
            if (this.LoopVisible())
            {
                IGameCameraManager cameraManager1 = this.CameraManager;
                Vector3            vector3_1      = cameraManager1.ViewOffset + num * Vector3.UnitY;
                cameraManager1.ViewOffset = vector3_1;
                this.DrawLoop();
                IGameCameraManager cameraManager2 = this.CameraManager;
                Vector3            vector3_2      = cameraManager2.ViewOffset - num * Vector3.UnitY;
                cameraManager2.ViewOffset = vector3_2;
            }
            this.GameState.LoopRender = false;
        }
コード例 #8
0
        public override void Update(GameTime gameTime)
        {
            if (this.GameState.Loading || this.GameState.Paused)
            {
                return;
            }
            float num1 = (float)gameTime.ElapsedGameTime.TotalSeconds;

            this.StepTime += num1;
            if (this.ActiveState == ZoomOut.State.Wait)
            {
                if ((double)this.StepTime > 5.0)
                {
                    this.OldSfxVol = this.SoundManager.SoundEffectVolume;
                    this.ChangeState();
                }
            }
            else if (this.ActiveState == ZoomOut.State.Zooming)
            {
                IGameCameraManager cameraManager = this.CameraManager;
                double             num2          = (double)cameraManager.Radius * (double)MathHelper.Lerp(1f, 1.05f, Easing.EaseIn((double)FezMath.Saturate(this.StepTime / 35f), EasingType.Quadratic));
                cameraManager.Radius                = (float)num2;
                this.CameraManager.Center           = Vector3.Lerp(this.CameraManager.Center, this.LevelManager.Size / 2f, Easing.EaseInOut((double)FezMath.Saturate(this.StepTime / 35f), EasingType.Sine));
                this.SoundManager.SoundEffectVolume = 1f - FezMath.Saturate(this.StepTime / 33f);
                if ((double)this.StepTime > 33.0)
                {
                    this.ChangeState();
                }
            }
            if ((double)num1 == 0.0 || !Keyboard.GetState().IsKeyDown(Keys.R))
            {
                return;
            }
            this.ActiveState = ZoomOut.State.Zooming;
            this.ChangeState();
        }
コード例 #9
0
        public override void Update(GameTime gameTime)
        {
            if (this.GameState.Loading || this.GameState.Paused)
            {
                return;
            }
            if (this.FirstUpdate)
            {
                gameTime         = new GameTime();
                this.FirstUpdate = false;
            }
            this.PhaseTime += (float)gameTime.ElapsedGameTime.TotalSeconds;
            switch (this.ActivePhase)
            {
            case FinalRebuildHost.Phases.ZoomInNega:
                this.GameState.SkipRendering = true;
                if (gameTime.ElapsedGameTime.Ticks == 0L)
                {
                    this.Glitches.ActiveGlitches       = 0;
                    this.Glitches.FreezeProbability    = 0.0f;
                    this.CameraManager.PixelsPerTrixel = 0.5f;
                    this.CameraManager.SnapInterpolation();
                    this.PlayerManager.Position         = Vector3.Zero;
                    this.PlayerManager.LookingDirection = HorizontalDirection.Right;
                    this.SetHexVisible(false);
                    this.CollisionManager.GravityFactor = 1f;
                    SoundEffectExtensions.Emit(this.sZoomIn);
                    this.eAmbient = SoundEffectExtensions.Emit(this.sAmbientDrone, true, 0.0f, 0.0f);
                }
                float amount = Easing.EaseIn((double)FezMath.Saturate(this.PhaseTime / 10f), EasingType.Sine);
                if ((double)this.PhaseTime > 0.25)
                {
                    IGameCameraManager cameraManager = this.CameraManager;
                    double             num           = (double)cameraManager.Radius * (double)MathHelper.Lerp(0.99f, 1f, amount);
                    cameraManager.Radius = (float)num;
                }
                this.PlayerManager.Action   = (double)this.PhaseTime > 7.0 ? ActionType.StandWinking : ActionType.Standing;
                this.PlayerManager.Velocity = Vector3.Zero;
                float num1 = Easing.EaseIn((double)FezMath.Saturate(this.PhaseTime / 11f), EasingType.Sine);
                this.CameraManager.Center = this.PlayerManager.Position + new Vector3(0.0f, 0.125f, 0.0f) + new Vector3(0.0f, (float)(Math.Sin((double)this.PhaseTime) * 0.25 * (1.0 - (double)num1)), 0.0f);
                this.CameraManager.SnapInterpolation();
                this.GameState.SkipRendering = false;
                this.eAmbient.VolumeFactor   = num1;
                if ((double)this.PhaseTime <= 11.0)
                {
                    break;
                }
                Waiters.Wait(0.75, (Action)(() => SoundEffectExtensions.Emit(this.sHexAppear))).AutoPause = true;
                this.ChangePhase();
                break;

            case FinalRebuildHost.Phases.FlickerIn:
                this.GameState.SkipRendering = true;
                if (gameTime.ElapsedGameTime.Ticks == 0L)
                {
                    this.WhiteCube.Material.Diffuse    = Vector3.Zero;
                    this.WhiteCube.Rotation            = this.OriginalCubeRotation;
                    this.CameraManager.PixelsPerTrixel = 3f;
                    this.CameraManager.SnapInterpolation();
                    this.PlayerManager.Position = Vector3.Zero;
                    if (this.eAmbient != null)
                    {
                        this.eAmbient.VolumeFactor = 0.625f;
                    }
                    this.PhaseTime = -1f;
                }
                this.PlayerManager.Action   = ActionType.Standing;
                this.PlayerManager.Velocity = Vector3.Zero;
                this.CameraManager.Center   = this.PlayerManager.Position + new Vector3(0.0f, 4.5f, 0.0f);
                this.CameraManager.SnapInterpolation();
                this.GameState.SkipRendering = false;
                this.WhiteCube.Position      = this.PlayerManager.Position + new Vector3(0.0f, 6f, 0.0f);
                if ((double)this.PhaseTime <= 2.25)
                {
                    break;
                }
                this.ChangePhase();
                break;

            case FinalRebuildHost.Phases.SpinFill:
                this.GameState.SkipRendering = true;
                if (gameTime.ElapsedGameTime.Ticks == 0L)
                {
                    this.CameraManager.PixelsPerTrixel = 3f;
                    this.CameraManager.SnapInterpolation();
                    this.PlayerManager.Position     = Vector3.Zero;
                    this.WhiteCube.Material.Diffuse = Vector3.One;
                    for (int index = 0; index < this.SolidCubes.Groups.Count; ++index)
                    {
                        this.SolidCubes.Groups[index].CustomData = (object)null;
                    }
                }
                this.PlayerManager.Action   = ActionType.Standing;
                this.PlayerManager.Velocity = Vector3.Zero;
                this.CameraManager.Center   = this.PlayerManager.Position + new Vector3(0.0f, 4.5f, 0.0f);
                this.CameraManager.SnapInterpolation();
                this.GameState.SkipRendering = false;
                float num2 = Easing.EaseInOut((double)FezMath.Saturate(this.PhaseTime / 11f), EasingType.Sine);
                this.SolidCubes.Position = this.WhiteCube.Position = this.PlayerManager.Position + new Vector3(0.0f, 6f, 0.0f);
                this.SolidCubes.Rotation = this.WhiteCube.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitY, (float)((double)num2 * 6.28318548202515 * 3.0)) * this.OriginalCubeRotation;
                float num3  = Easing.EaseInOut((double)FezMath.Saturate(this.PhaseTime / 10f), EasingType.Quadratic);
                float pitch = MathHelper.Clamp((float)(((double)num3 - (double)this.lastStep) * 200.0 - 0.200000002980232), -1f, 1f);
                float num4  = 1f / (float)this.SolidCubes.Groups.Count;
                for (int index = 0; index < this.SolidCubes.Groups.Count; ++index)
                {
                    float num5 = (float)index / (float)this.SolidCubes.Groups.Count;
                    float num6 = Easing.EaseIn((double)FezMath.Saturate((num3 - num5) / num4), EasingType.Sine);
                    if ((double)num6 == 1.0)
                    {
                        this.SolidCubes.Groups[index].Material.Diffuse = Vector3.One;
                        this.SolidCubes.Groups[index].Enabled          = true;
                    }
                    else if ((double)num6 == 0.0)
                    {
                        this.SolidCubes.Groups[index].Enabled = false;
                    }
                    else
                    {
                        if ((double)num6 > 0.125 && this.SolidCubes.Groups[index].CustomData == null)
                        {
                            SoundEffectExtensions.Emit(this.sCubeAppear, pitch);
                            this.SolidCubes.Groups[index].CustomData = (object)true;
                        }
                        this.SolidCubes.Groups[index].Material.Diffuse = new Vector3((float)FezMath.AsNumeric(RandomHelper.Probability((double)num6)), (float)FezMath.AsNumeric(RandomHelper.Probability((double)num6)), (float)FezMath.AsNumeric(RandomHelper.Probability((double)num6)));
                        this.SolidCubes.Groups[index].Enabled          = RandomHelper.Probability((double)num6);
                    }
                }
                this.lastStep = num3;
                if ((double)this.PhaseTime <= 12.0)
                {
                    break;
                }
                this.eMotor   = SoundEffectExtensions.Emit(this.sMotorSpin1);
                this.eAku     = SoundEffectExtensions.Emit(this.sAku, true, 0.0f, 0.0f);
                this.lastStep = 0.0f;
                this.ChangePhase();
                break;

            case FinalRebuildHost.Phases.MotorStart1:
                this.GameState.SkipRendering = true;
                if (gameTime.ElapsedGameTime.Ticks == 0L)
                {
                    this.HexahedronAo.Position = this.SolidCubes.Position;
                    this.lastStep = 0.0f;
                    for (int index = 0; index < this.SolidCubes.Groups.Count; ++index)
                    {
                        this.SolidCubes.Groups[index].Enabled          = true;
                        this.SolidCubes.Groups[index].Material.Diffuse = Vector3.One;
                    }
                    this.SolidCubes.Rotation = Quaternion.Identity;
                    this.SolidCubes.Position = Vector3.Zero;
                    this.SolidCubes.CollapseToBufferWithNormal <VertexPositionNormalTextureInstance>();
                    this.SolidCubes.Position = this.PlayerManager.Position + new Vector3(0.0f, 6f, 0.0f);
                }
                this.PlayerManager.Action   = ActionType.Standing;
                this.PlayerManager.Velocity = Vector3.Zero;
                this.CameraManager.Center   = this.PlayerManager.Position + new Vector3(0.0f, 4.5f, 0.0f);
                this.CameraManager.SnapInterpolation();
                this.GameState.SkipRendering = false;
                float num7 = Easing.EaseIn((double)Easing.EaseOut((double)FezMath.Saturate(this.PhaseTime / 5f), EasingType.Sine), EasingType.Sextic);
                this.SetHexVisible((double)num7 - (double)this.lastStep > 0.00825);
                this.lastStep            = num7;
                this.SolidCubes.Rotation = this.WhiteCube.Rotation = this.HexahedronAo.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitY, (float)((double)num7 * 6.28318548202515 * 4.0)) * this.OriginalCubeRotation;
                if ((double)this.PhaseTime <= 5.0)
                {
                    break;
                }
                this.eMotor = SoundEffectExtensions.Emit(this.sMotorSpin2);
                this.ChangePhase();
                break;

            case FinalRebuildHost.Phases.MotorStart2:
                this.GameState.SkipRendering = true;
                if (gameTime.ElapsedGameTime.Ticks == 0L)
                {
                    this.HexahedronAo.Position = this.SolidCubes.Position;
                    this.lastStep = 0.0f;
                }
                this.PlayerManager.Action   = ActionType.Standing;
                this.PlayerManager.Velocity = Vector3.Zero;
                this.CameraManager.Center   = this.PlayerManager.Position + new Vector3(0.0f, 4.5f, 0.0f);
                this.CameraManager.SnapInterpolation();
                this.GameState.SkipRendering = false;
                float num8 = Easing.EaseIn((double)Easing.EaseOut((double)FezMath.Saturate(this.PhaseTime / 4f), EasingType.Sine), EasingType.Sextic);
                float num9 = num8 - this.lastStep;
                this.SetHexVisible((double)num9 > 0.01);
                this.lastStep = num8;
                if (this.GameState.SaveData.SecretCubes + this.GameState.SaveData.CubeShards < 64)
                {
                    this.Glitches.DisappearProbability = 0.05f;
                    float num5 = Easing.EaseIn((double)num9 / 0.00999999977648258, EasingType.Quartic);
                    this.Glitches.ActiveGlitches    = FezMath.Round((double)num5 * 7.0 + (double)(int)RandomHelper.Between(0.0, (double)num5 * 10.0));
                    this.Glitches.FreezeProbability = (float)((double)num9 / 0.00999999977648258 * (1.0 / 400.0));
                }
                this.SolidCubes.Rotation = this.WhiteCube.Rotation = this.HexahedronAo.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitY, (float)((double)num8 * 6.28318548202515 * 5.0)) * this.OriginalCubeRotation;
                if ((double)this.PhaseTime <= 4.0 + (this.GameState.SaveData.SecretCubes + this.GameState.SaveData.CubeShards >= 64 ? 0.5 : 0.0))
                {
                    break;
                }
                if (this.GameState.SaveData.SecretCubes + this.GameState.SaveData.CubeShards < 64)
                {
                    this.eMotor = SoundEffectExtensions.Emit(this.sMotorSpinCrash);
                    this.ChangePhase();
                    break;
                }
                else
                {
                    this.eMotor = SoundEffectExtensions.Emit(this.sMotorSpinAOK);
                    this.ChangePhaseTo(FinalRebuildHost.Phases.SmoothStart);
                    break;
                }

            case FinalRebuildHost.Phases.MotorStart3:
                this.GameState.SkipRendering = true;
                if (gameTime.ElapsedGameTime.Ticks == 0L)
                {
                    this.HexahedronAo.Position = this.SolidCubes.Position;
                }
                this.PlayerManager.Action   = ActionType.Standing;
                this.PlayerManager.Velocity = Vector3.Zero;
                this.CameraManager.Center   = this.PlayerManager.Position + new Vector3(0.0f, 4.5f, 0.0f);
                this.CameraManager.SnapInterpolation();
                this.GameState.SkipRendering = false;
                float num10 = Easing.EaseIn((double)this.PhaseTime / 6.0, EasingType.Sextic);
                float num11 = Math.Min(num10 - this.lastStep, 0.05f);
                this.SetHexVisible((double)num11 > 1.0 / 80.0);
                this.lastStep = num10;
                this.Glitches.DisappearProbability = 0.0375f;
                float num12 = Easing.EaseIn((double)num11 / 0.0375000014901161, EasingType.Quartic);
                this.Glitches.ActiveGlitches    = FezMath.Round((double)FezMath.Saturate(num12) * 500.0 + (double)(int)RandomHelper.Between(0.0, (double)FezMath.Saturate(num12) * 250.0));
                this.Glitches.FreezeProbability = Easing.EaseIn((double)num11 / 0.0500000007450581, EasingType.Quadratic) * 0.15f;
                this.SolidCubes.Rotation        = this.WhiteCube.Rotation = this.HexahedronAo.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitY, (float)((double)num10 * 6.28318548202515 * 20.0)) * this.OriginalCubeRotation;
                if ((double)this.PhaseTime <= 8.0)
                {
                    break;
                }
                this.ChangePhase();
                break;

            case FinalRebuildHost.Phases.Crash:
                this.Glitches.FreezeProbability = 1f;
                if ((double)this.PhaseTime <= 2.0)
                {
                    break;
                }
                if (this.eAku != null)
                {
                    this.eAku.FadeOutAndDie(0.0f);
                }
                if (this.eAmbient != null)
                {
                    this.eAmbient.FadeOutAndDie(0.0f, false);
                }
                this.Glitches.ActiveGlitches       = 0;
                this.Glitches.FreezeProbability    = 0.0f;
                this.Glitches.DisappearProbability = 0.0f;
                this.GlitchReboot();
                break;

            case FinalRebuildHost.Phases.SmoothStart:
                this.GameState.SkipRendering = true;
                if (gameTime.ElapsedGameTime.Ticks == 0L)
                {
                    this.HexahedronAo.Position = this.SolidCubes.Position;
                    this.lastStep = 0.0f;
                    for (int index = 0; index < this.SolidCubes.Groups.Count; ++index)
                    {
                        this.SolidCubes.Groups[index].Enabled = true;
                    }
                }
                this.PlayerManager.Action   = ActionType.Standing;
                this.PlayerManager.Velocity = Vector3.Zero;
                this.CameraManager.Center   = this.PlayerManager.Position + new Vector3(0.0f, 4.5f, 0.0f);
                this.CameraManager.SnapInterpolation();
                this.GameState.SkipRendering = false;
                float num13 = Easing.EaseInOut((double)FezMath.Saturate(this.PhaseTime / 10f), EasingType.Quadratic);
                this.SetHexVisible((double)num13 > 0.425000011920929);
                this.lastStep            = num13;
                this.SolidCubes.Rotation = this.WhiteCube.Rotation = this.HexahedronAo.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitY, (float)((double)num13 * 6.28318548202515 * 18.0)) * this.OriginalCubeRotation;
                if ((double)this.PhaseTime <= 10.0)
                {
                    break;
                }
                this.eAku.FadeOutAndDie(2f);
                SoundEffectExtensions.Emit(this.sRayWhiteout);
                this.ChangePhase();
                break;

            case FinalRebuildHost.Phases.ShineReboot:
                this.GameState.SkipRendering = true;
                if (gameTime.ElapsedGameTime.Ticks == 0L)
                {
                    this.HexahedronAo.Position = this.SolidCubes.Position;
                    this.SetHexVisible(true);
                    this.RaysMesh.ClearGroups();
                    this.HexahedronAo.Rotation = this.OriginalCubeRotation;
                    if (this.eAmbient != null)
                    {
                        this.eAmbient.FadeOutAndDie(0.0f, false);
                    }
                }
                this.PlayerManager.Action   = ActionType.Standing;
                this.PlayerManager.Velocity = Vector3.Zero;
                this.CameraManager.Center   = this.PlayerManager.Position + new Vector3(0.0f, 4.5f, 0.0f);
                this.CameraManager.SnapInterpolation();
                this.GameState.SkipRendering = false;
                this.UpdateRays((float)gameTime.ElapsedGameTime.TotalSeconds);
                if ((double)this.PhaseTime <= 4.0)
                {
                    break;
                }
                this.SmoothReboot();
                break;
            }
        }
コード例 #10
0
        public override void Update(GameTime gameTime)
        {
            if (this.GameState.Loading || this.GameState.Paused)
            {
                return;
            }
            float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;

            if ((double)elapsed == 0.0 || (double)this.StepTime == 0.0)
            {
                this.Reset();
                SoundEffectExtensions.Emit(this.sAppear);
            }
            this.StepTime += elapsed;
            if ((double)this.CameraManager.Radius < 11000.0)
            {
                IGameCameraManager cameraManager = this.CameraManager;
                double             num           = (double)cameraManager.Radius * 1.00625002384186;
                cameraManager.Radius = (float)num;
                this.CameraManager.SnapInterpolation();
            }
            if (!this.sMovePlayed && (double)this.StepTime >= 4.0)
            {
                SoundEffectExtensions.Emit(this.sStartMove);
                this.sMovePlayed = true;
            }
            if (!this.sProgPlayed && (double)this.StepTime >= 14.0)
            {
                SoundEffectExtensions.Emit(this.sProgressiveAppear);
                this.sProgPlayed = true;
            }
            if ((double)this.StepTime >= 29.0)
            {
                if (this.eNoise == null)
                {
                    this.eNoise = SoundEffectExtensions.Emit(this.sNoise, true, 0.0f, 0.0f);
                }
                this.eNoise.VolumeFactor = FezMath.Saturate((float)(((double)this.StepTime - 29.0) / 7.0));
            }
            if ((double)this.StepTime < 33.0)
            {
                this.UpdateDot(elapsed);
                float viewScale = SettingsManager.GetViewScale(this.GraphicsDevice);
                if ((double)this.CameraManager.Radius >= 500.0)
                {
                    float radius = this.CameraManager.Radius;
                    this.CameraManager.Radius = 600f * viewScale;
                    this.CameraManager.SnapInterpolation();
                    this.GraphicsDevice.SetRenderTarget(this.RtHandle.Target);
                    this.GraphicsDevice.Clear(ColorEx.TransparentWhite);
                    this.DrawDot();
                    this.GraphicsDevice.SetRenderTarget((RenderTarget2D)null);
                    this.CloneMesh.Texture    = (Dirtyable <Texture>)((Texture)this.RtHandle.Target);
                    this.CameraManager.Radius = radius;
                    this.CameraManager.SnapInterpolation();
                }
            }
            if ((double)this.StepTime <= 36.0)
            {
                return;
            }
            this.ChangeState();
        }
コード例 #11
0
ファイル: TombstonesHost.cs プロジェクト: conankzhang/fez
 private void RotateSkull()
 {
     this.InterpolatedRotation = Quaternion.Slerp(this.InterpolatedRotation, this.StopSkullRotations ? this.OriginalRotation : this.CameraManager.Rotation, 0.05f);
     if (this.InterpolatedRotation == this.CameraManager.Rotation)
     {
         if (this.eRumble.Cue.State != SoundState.Paused)
         {
             this.eRumble.Cue.Pause();
         }
         if (!this.StopSkullRotations)
         {
             return;
         }
         this.SkullRotates       = false;
         this.StopSkullRotations = false;
     }
     else
     {
         if (FezMath.AlmostEqual(this.InterpolatedRotation, this.CameraManager.Rotation) || FezMath.AlmostEqual(-this.InterpolatedRotation, this.CameraManager.Rotation))
         {
             this.InterpolatedRotation = this.CameraManager.Rotation;
         }
         this.SkullAo.Rotation = this.InterpolatedRotation * Quaternion.CreateFromAxisAngle(Vector3.UnitY, -1.570796f);
         Vector3 axis;
         float   angle1;
         TombstonesHost.ToAxisAngle(ref this.InterpolatedRotation, out axis, out angle1);
         float angle2 = this.lastAngle - angle1;
         if ((double)Math.Abs(angle2) > 0.100000001490116)
         {
             this.lastAngle = angle1;
         }
         else
         {
             for (int index = 0; index < this.SkullAttachedTriles.Length; ++index)
             {
                 TrileInstance instance = this.SkullAttachedTriles[index];
                 Vector4       vector   = this.SkullAttachedTrilesOriginalStates[index];
                 instance.Position = Vector3.Transform(FezMath.XYZ(vector) + new Vector3(0.5f) - this.SkullAo.Position, this.InterpolatedRotation) + this.SkullAo.Position - new Vector3(0.5f);
                 instance.Phi      = FezMath.WrapAngle(vector.W + ((double)axis.Y > 0.0 ? -1f : 1f) * angle1);
                 this.LevelMaterializer.GetTrileMaterializer(instance.Trile).UpdateInstance(instance);
             }
             if (Enumerable.Contains <TrileInstance>((IEnumerable <TrileInstance>) this.SkullTopLayer, this.PlayerManager.Ground.First))
             {
                 Vector3 position = this.PlayerManager.Position;
                 this.PlayerManager.Position = Vector3.Transform(this.PlayerManager.Position - this.SkullAo.Position, Quaternion.CreateFromAxisAngle(axis, angle2)) + this.SkullAo.Position;
                 IGameCameraManager cameraManager = this.CameraManager;
                 Vector3            vector3       = cameraManager.Center + this.PlayerManager.Position - position;
                 cameraManager.Center = vector3;
             }
             if ((double)Math.Abs(axis.Y) > 0.5)
             {
                 float num = angle2 * 5f;
                 IGameCameraManager cameraManager = this.CameraManager;
                 Vector3            vector3       = cameraManager.InterpolatedCenter + new Vector3(RandomHelper.Between(-(double)num, (double)num), RandomHelper.Between(-(double)num, (double)num), RandomHelper.Between(-(double)num, (double)num));
                 cameraManager.InterpolatedCenter = vector3;
                 if (this.eRumble.Cue.State == SoundState.Paused)
                 {
                     this.eRumble.Cue.Resume();
                 }
                 this.eRumble.VolumeFactor = FezMath.Saturate(Math.Abs(num) * 25f);
             }
             if (this.InterpolatedRotation == this.CameraManager.Rotation)
             {
                 this.RotateSkullTriles();
             }
             this.lastAngle = angle1;
         }
     }
 }