Beispiel #1
0
 protected override void Update(Game game, float elapsedSeconds)
 {
     base.Update(game, elapsedSeconds);
     if (Root.WasMouseLeftClick && UX.MouseOverAction != null)
     {
         Root.WasMouseLeftClick = false;
         UX.MouseOverAction();
     }
 }
Beispiel #2
0
        private void DrawRespondToEmergencyButtons()
        {
            int y = 500;

            for (int i = 0; i < Campaign.Levels.Count; i++)
            {
                LevelSheet ls    = Campaign.Levels[i];
                bool       legal = Treasure.Instance.CheatMode || i <= (Treasure.Instance.LastCompletedLevel + 1);

                UX.DrawButton("Respond to emergency: {b}" + ls.Name + "{/b}",
                              new Rectangle(10, y, 600, 40),
                              () =>
                {
                    Root.PushPhase(new PrepareForMissionPhase(ls));
                }, disabled: !legal);

                y += 40;
            }
        }
Beispiel #3
0
        protected override void Draw(SpriteBatch sb, Game game, float elapsedSeconds)
        {
            Primitives.FillRectangle(Root.Screen, Color.LightBlue);
            Primitives.DrawImage(Assets.TextureFromCard(Illustration.MainTitle), new Rectangle(0, 0, Root.ScreenWidth, 400),
                                 null, true, false);
            Writer.DrawString("Welcome to the monastery, commander. Are you ready to serve?",
                              new Rectangle(50, 405, 1000, 140), Color.Black);

            DrawRespondToEmergencyButtons();
            int y = 410;

            /*
             * UX.DrawButton("Enter your monastery",
             *  new Rectangle(Root.ScreenWidth - 450, y, 400, 40),
             *  () => { Root.PushPhase(new MonasteryPhase()); },
             *  "The monastery is your base of operations. In the monastery, you can {b}review{/b} your rescue team and choose {b}new powers{/b} for your paladins.");
             * y += 40;
             * UX.DrawButton("Reset all progress",
             *  new Rectangle(Root.ScreenWidth - 450, y, 400, 40),
             *  () => {    Root.PushPhase(new MessageBoxPhase("You will reset back to level 1 with two starting paladins, as if you just started the game for the first time. Is that okay?",
             *      "Reset all progress?", GuiIcon.Question, MessageBoxButtons.YesNo, (str) =>
             *      {
             *          Treasure.Clear();
             *          Treasure.Instance.Save();
             *      }));
             *  },
             *  "You will reset back to level 1 with two starting paladins, as if you just started the game for the first time.");*/
            y += 40;
            UX.DrawButton("Help",
                          new Rectangle(Root.ScreenWidth - 450, y, 400, 40),
                          () => { Root.PushPhase(new HelpPhase()); },
                          Treasure.Instance.IsFirstLaunch ? "Maybe you should read these instructions before you respond to an emergency..."
                    : "Read about how to become a better commander of your rescue service.");
            y += 40;
            UX.DrawButton("Quit game",
                          new Rectangle(Root.ScreenWidth - 450, y, 400, 40),
                          () =>
            {
                Root.PushPhase(new MessageBoxPhase("Do you really want to quit?",
                                                   "Quit Game", GuiIcon.Question, MessageBoxButtons.YesNo, (str) => { Root.Quit(); }));
            },
                          "Please don't...");
        }
Beispiel #4
0
        private void DrawTopBar()
        {
            Rectangle rectTopbar = new Rectangle(0, 0, Root.ScreenWidth, 40);

            Primitives.FillRectangle(rectTopbar, Color.LightBlue);
            Primitives.DrawRectangle(new Rectangle(-3, -3, Root.ScreenWidth + 6, 43), Color.Black);
            Writer.DrawString("Wounded remaining: " +
                              Session.Characters.Count(ch => ch.Wounded && !ch.Dead) + "; dead: "
                              + Session.Characters.Count(ch => ch.Dead && !ch.Hostile) + "; hostiles: " +
                              Session.Characters.Count(ch => ch.Hostile && !ch.Dead) + "; fires: " +
                              Session.TilesOnFire + "; burnt out: " +
                              Session.TilesBurntOut, rectTopbar.Extend(-3, 0),
                              Color.Black, BitmapFontGroup.Mia24Font,
                              alignment: Writer.TextAlignment.Left);

            UX.DrawButton("1x", new Rectangle(Root.ScreenWidth - 640, 0, 80, rectTopbar.Height), () =>
            {
                TimeDilation = 1;
            }, "Play the game at the pace it's meant to be played.", TimeDilation == 1);

            UX.DrawButton("2x", new Rectangle(Root.ScreenWidth - 560, 0, 80, rectTopbar.Height), () =>
            {
                TimeDilation = 2;
            }, "If you want more action, speed the game up two times.", TimeDilation == 2);

            UX.DrawButton("3x", new Rectangle(Root.ScreenWidth - 480, 0, 80, rectTopbar.Height), () =>
            {
                TimeDilation = 3;
            }, "If you have very good reflexes and/or are impatient, speed the game up three times!", TimeDilation == 3);
            UX.DrawButton("Objectives", new Rectangle(Root.ScreenWidth - 400, 0, 190, rectTopbar.Height), () =>
            {
                Root.PushPhase(new ObjectivesPhase());
            });
            UX.DrawButton("Retreat", new Rectangle(Root.ScreenWidth - 200, 0, 190, rectTopbar.Height), () =>
            {
                Retreat();
            }, "Fail this emergency and return to your monastery.");
        }
        protected override void Draw(SpriteBatch sb, Game game, float elapsedSeconds)
        {
            base.Draw(sb, game, elapsedSeconds);
            Primitives.FillRectangle(Root.Screen, Color.CornflowerBlue);
            Writer.DrawString("Your rescue team:", new Rectangle(5, 5, 600, 40),
                              alignment: Writer.TextAlignment.Left);
            Rectangle paladinChoiceR = new Rectangle(5, 45, 400, Root.ScreenHeight - 300);

            UX.DrawPaladinChoice(paladinChoiceR, true, allPaladins, chosenPaladins);


            UX.DrawButton("Difficulty: Easy", new Rectangle(5, paladinChoiceR.Bottom + 5, paladinChoiceR.Width, 60),
                          () => { this.ChosenDifficulty = Difficulty.Easy; }, null, ChosenDifficulty == Difficulty.Easy);
            UX.DrawButton("Difficulty: Normal", new Rectangle(5, paladinChoiceR.Bottom + 65, paladinChoiceR.Width, 60),
                          () => { this.ChosenDifficulty = Difficulty.Normal; }, null, ChosenDifficulty == Difficulty.Normal);
            UX.DrawButton("Difficulty: Meaningful", new Rectangle(5, paladinChoiceR.Bottom + 125, paladinChoiceR.Width, 60),
                          () => { this.ChosenDifficulty = Difficulty.Meaningful; }, null, ChosenDifficulty == Difficulty.Meaningful);


            Rectangle missionDescRect = new Rectangle(410, 300, Root.ScreenWidth - 420, 500);

            Writer.DrawString("{b}Emergency: " + Ls.Name + "{/b}",
                              new Rectangle(missionDescRect.X, missionDescRect.Top - 200, missionDescRect.Width, 200),
                              font: BitmapFontGroup.MiaFont,
                              alignment: Writer.TextAlignment.Middle);
            Primitives.DrawAndFillRectangle(missionDescRect, Color.LightBlue, Color.DarkBlue);
            string desc = Ls.Intro + "\n\n{b}Difficulty: " + ChosenDifficulty + ".{/b} {i}" + DescribeDifficulty(ChosenDifficulty) + "{/i}";

            Writer.DrawString(desc, missionDescRect.Extend(-3, -3), degrading: true);



            bool   goAhead = true;
            string caption = "{b}Respond to this emergency{/b}";

            if (chosenPaladins.Count == 0)
            {
                goAhead = false;
                caption = "Select at least one paladin";
            }

            else if (chosenPaladins.Count < Ls.NumberOfPaladins)
            {
                goAhead = true;
                caption = "Respond to this emergency (understaffed)";
            }

            if (chosenPaladins.Count > Ls.NumberOfPaladins)
            {
                goAhead = false;
                caption = "You can't have more than " + Ls.NumberOfPaladins + " paladins.";
            }
            UX.DrawButton(
                caption, new Rectangle(410, Root.ScreenHeight - 80, 390, 75), () =>
            {
                Root.PopFromPhase();
                Root.PushPhase(new EmergencyPhase(Ls, chosenPaladins, ChosenDifficulty));
            }, null, disabled: !goAhead
                );
            UX.DrawButton(
                "Return to Main Menu", new Rectangle(800, Root.ScreenHeight - 80, 400, 75),
                () =>
            {
                Root.PopFromPhase();
            });
        }