Beispiel #1
0
        public void Draw(GameTime gameTime, SpriteBatch sb)
        {
            Office.Draw(gameTime, sb);

            if (IsJumpscaring)
            {
                Monsters.DrawJumpscares(sb);
            }

            Laptop.Draw(gameTime, sb);

            float x = Main.WindowSize.X - hourFont.MeasureString(TimeShown).Length() - 10;

            sb.DrawString(hourFont, TimeShown, new Vector2(x, 10), Color.White);

            string batteryText  = BATTERY_DEFAULT_TEXT;
            Color  batteryColor = Color.White;

            if (Monsters.Redman.IsRedScreenOfDeathUp)
            {
                batteryColor = BATTERY_CHARGE_OFF_COLOR;
            }
            else if (LaptopBattery >= 1.0f)
            {
                batteryColor = BATTERY_CHARGED_COLOR;
            }
            else if (LaptopBattery <= 0.0f || (Laptop.IsRebooting && Main.UI.State == UIState.Laptop))
            {
                batteryColor = BATTERY_OUT_COLOR;
            }
            else
            {
                if (!Office.IsLightOn)
                {
                    batteryColor = BATTERY_CHARGE_OFF_COLOR;
                    batteryText  = BATTERY_CHARGE_OFF_TEXT;
                }
                else if (Main.UI.State == UIState.Office)
                {
                    batteryText = BATTERY_CHARGE_TEXT;
                }
            }

            bool goldenJumpscare = Monsters.GoldenFlumpty != null && Monsters.GoldenFlumpty.IsJumpscaring;

            if (!goldenJumpscare)
            {
                gameUISprites["Battery"].Draw(sb, BATTERY_OFFSET, batteryColor, Vector2.One);

                RectangleF sourceRect = new RectangleF(0, 0, LaptopBattery * BAR_SIZE.X, BAR_SIZE.Y);

                if (Monsters.Redman.IsRedScreenOfDeathUp)
                {
                    gameUISprites["BatteryRedman"].Draw(sb, BATTERY_REDMAN_OFFSET);
                }
                else
                {
                    gameUISprites["Bar"].Draw(sb, BATTERY_BAR_OFFSET, sourceRect, batteryColor);
                    sb.DrawString(uiFont, batteryText, BATTERY_TEXT_OFFSET, batteryColor);
                }

                Color exposureColor = Color.White;
                if (Monsters.IsExposed)
                {
                    exposureColor = EXPOSED_COLOR;
                }

                Vector2 shakeOffset = new Vector2(0, Monsters.IsExposed ? _exposureShakeOffset : 0);

                gameUISprites["Exposure"].Draw(sb, EXPOSURE_OFFSET + shakeOffset, exposureColor, Vector2.One);
                sourceRect = new RectangleF(0, 0, Exposure * BAR_SIZE.X, BAR_SIZE.Y);
                gameUISprites["Bar"].Draw(sb, EXPOSURE_BAR_OFFSET + shakeOffset, sourceRect, exposureColor);
                sb.DrawString(uiFont, EXPOSURE_TEXT, EXPOSURE_TEXT_OFFSET + shakeOffset, exposureColor);

                if (_flipUpEnabled)
                {
                    gameUISprites["CamFlipUp"].Draw(sb, FLIPUP_OFFSET, Util.MakeTransparency(FLIPUP_ALPHA), Vector2.One);
                }

                if (Monsters.Redman.IsVirusUp && Monsters.Redman.warningIconVisible && UI.State == UIState.Office)
                {
                    gameUISprites["RedmanWarning"].Draw(sb, REDMAN_OFFICE_WARNING_OFFSET);
                }
            }

            if (HasWon)
            {
                Color transparency = Util.MakeTransparency(_spamFadeTime / SPAM_FADE_TIME);
                Laptop.miscScreens["SixAM"].Draw(sb, Vector2.Zero, transparency, Vector2.One);
            }

            if (Bot.ShowsMouse)
            {
                gameUISprites["AIMouse"].Draw(sb, Bot.MousePos);
            }
        }