Exemplo n.º 1
0
        public override void Update(GameTime gameTime)
        {
            if (this.GameState.Paused || this.GameState.InMap || (!this.CameraManager.ActionRunning || !FezMath.IsOrthographic(this.CameraManager.Viewpoint)) || (this.GameState.Loading || this.PlayerManager.Action == ActionType.FindingTreasure || this.GameState.FarawaySettings.InTransition))
            {
                return;
            }
            TimeSpan timeSpan = TimeSpan.FromTicks(TimeSpan.FromTicks((DateTime.UtcNow - DateTime.FromFileTimeUtc(this.GameState.SaveData.CreationTime)).Ticks).Ticks % 6048000000000L);

            if (this.RedAo.Enabled)
            {
                float angle = FezMath.CurveAngle(this.lastRedAngle, FezMath.WrapAngle((float)((double)FezMath.Round(timeSpan.TotalSeconds) / 60.0 * 6.28318548202515)), 0.1f);
                this.lastRedAngle   = angle;
                this.RedAo.Rotation = Quaternion.CreateFromAxisAngle(-Vector3.UnitZ, angle) * this.RedOriginalRotation;
                this.RedAo.Position = this.RedOriginalPosition + new Vector3(-(float)Math.Cos((double)angle), (float)Math.Sin((double)angle), 0.0f) * 1.45f;
                this.RedSecret      = this.TestSecretFor((double)angle >= 1.19579637050629 && (double)angle <= 1.69579637050629, this.RedAo, this.RedSecret, this.RedTopMost);
            }
            if (this.BlueAo.Enabled)
            {
                float num = FezMath.WrapAngle((float)(timeSpan.TotalMinutes / 60.0 * 6.28318548202515));
                this.BlueAo.Rotation = Quaternion.CreateFromAxisAngle(-Vector3.UnitX, num) * this.BlueOriginalRotation;
                this.BlueAo.Position = this.BlueOriginalPosition + new Vector3(0.0f, (float)Math.Sin((double)num), (float)Math.Cos((double)num)) * 1.45f;
                this.BlueSecret      = this.TestSecretFor(FezMath.AlmostEqual(num, 1.570796f, 0.125f), this.BlueAo, this.BlueSecret, this.BlueTopMost);
            }
            if (this.GreenAo.Enabled)
            {
                float num = FezMath.WrapAngle((float)(timeSpan.TotalHours / 24.0 * 6.28318548202515));
                this.GreenAo.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, num) * this.GreenOriginalRotation;
                this.GreenAo.Position = this.GreenOriginalPosition + new Vector3((float)Math.Cos((double)num), (float)Math.Sin((double)num), 0.0f) * 1.45f;
                this.GreenSecret      = this.TestSecretFor(FezMath.AlmostEqual(num, 1.570796f, 0.125f), this.GreenAo, this.GreenSecret, this.GreenTopMost);
            }
            if (!this.WhiteAo.Enabled)
            {
                return;
            }
            float num1 = FezMath.WrapAngle((float)(timeSpan.TotalDays / 7.0 * 6.28318548202515));

            this.WhiteAo.Rotation = Quaternion.CreateFromAxisAngle(Vector3.UnitX, num1) * this.WhiteOriginalRotation;
            this.WhiteAo.Position = this.WhiteOriginalPosition + new Vector3(0.0f, (float)Math.Sin((double)num1), -(float)Math.Cos((double)num1)) * 1.45f;
            this.WhiteSecret      = this.TestSecretFor(FezMath.AlmostEqual(num1, 1.570796f, 0.125f), this.WhiteAo, this.WhiteSecret, this.WhiteTopMost);
        }