public static void init(bool defeat = true)
        {
            currentMouseState = Mouse.GetState();
            menu_state        = MenuState.main;
            isNewGame         = defeat;
            brute             = new MenuBoss(Character.Type.Brute, new Vector2(LeaveMeAlone.WindowX / 2 - 400, LeaveMeAlone.WindowY - 400));
            mastermind        = new MenuBoss(Character.Type.Mastermind, new Vector2(LeaveMeAlone.WindowX / 2 - 100, LeaveMeAlone.WindowY - 400));
            operative         = new MenuBoss(Character.Type.Operative, new Vector2(LeaveMeAlone.WindowX / 2 + 200, LeaveMeAlone.WindowY - 400));
            LeaveMeAlone.Main_Song_Instance.Play();

            brute.idle();
            mastermind.idle();
            operative.idle();
        }
Exemple #2
0
        public static void Init(MenuBoss boss)
        {
            SkillTree.Init(boss.bossType);


            tutorial_state = TutorialState.BuySkill;

            selectedBoss = boss;
            skilltree    = SkillTree.skilltrees[selectedBoss.bossType];

            selectedBoss.MoveTo(new Vector2(0, 0));
            selectedBoss.idle();
            Console.WriteLine("" + Text.fonts.Keys.ToString());
            Console.Out.Flush();
            var test = Text.fonts;

            zeroAvailableRooms();
            UpgradeMenu.rerollRooms();

            selectedSkillSwapButton = new ButtonSkill();
            for (int x = 0; x < SelectedSkills.Length; x++)
            {
                SelectedSkills[x]             = new ButtonSkill();
                SelectedSkills[x].b           = new Button(Button.buttonPic, (int)baseSelectedSkillButtonPos.X, (int)baseSelectedSkillButtonPos.Y + 60 * x, 200, 50);
                SelectedSkills[x].b.text.font = Text.fonts["6809Chargen-12"];
                SelectedSkills[x].b.UpdateText("NONE");
            }

            hovertextpos  = new Vector2(30, 150);
            hovertext     = new Text("", new Vector2(hovertextpos.X + 10, hovertextpos.Y + 10), Text.fonts["RetroComputer-12"]);
            hovertextRect = new Rectangle((int)hovertextpos.X, (int)hovertextpos.Y, 500, 600);
            //250 x 150
            hovertextbackground = BattleManager.hovertextbackground;

            Vector2 statspos = new Vector2(30, boss.sTexture.Height + 10);

            statsTitle     = new Text("Stats", statspos, Text.fonts["RetroComputer-18"]);
            statsTitleRect = new Rectangle((int)statspos.X - 10, (int)statspos.Y - 5, (int)statsTitle.getMeasurements(300).X + 10, (int)statsTitle.font.MeasureString(statsTitle.message).Y + 15);
            statsText      = new Text(BattleManager.boss.StatsToString(), new Vector2(statspos.X, statspos.Y - 70), Text.fonts["RetroComputer-12"]);;
            statsTextRect  = new Rectangle((int)statsText.position.X, (int)statsText.position.Y - 100, (int)statsText.getMeasurements(300).X + 10, (int)statsText.getMeasurements(300).Y + 10);
            statsText.changeMessage("");

            texts["gold"]           = new Text("Gold: " + Resources.gold, new Vector2(150, 0), Text.fonts["6809Chargen-24"], Color.White);
            texts["level"]          = new Text("Level: " + BattleManager.boss.level, new Vector2(150, 50), Text.fonts["6809Chargen-24"], Color.White);
            texts["selectedskills"] = new Text("Selected Skills", new Vector2(baseSelectedSkillButtonPos.X, baseSelectedSkillButtonPos.Y - Text.fonts["6809Chargen-24"].MeasureString("Selected Skills").Y - 10), Text.fonts["6809Chargen-24"], Color.White);
            texts["skilltext"]      = new Text("Skills", new Vector2(baseSkillButtonPos.X + 100, baseSkillButtonPos.Y - 50), Text.fonts["6809Chargen-24"], Color.White);
            texts["roomtext"]       = new Text("Rooms", new Vector2(baseRoomButtonPos.X, baseRoomButtonPos.Y - 50), Text.fonts["6809Chargen-24"], Color.White);
        }
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            //RenderTarget2D target = new RenderTarget2D(GraphicsDevice, 1024, 576);
            //GraphicsDevice.SetRenderTarget(target);
            Text.loadContent(Content);
            Button.LoadContent(Content);
            MainMenu.loadContent(Content);
            MenuBoss.LoadContent(Content);
            //UpgradeMenu.loadContent(Content);

            PartyManager.Init();
            Resources.Init();
            SkillTree.LoadContent(Content);
            //SkillTree.Init();


            Character.load_content(Content);
            AnimatedEffect.LoadContent(Content);
            Status.LoadContent(Content);
            BattleManager.LoadContent(Content);
            SkillTree.LoadContent(Content);
            UpgradeMenu.loadContent(Content);
            LairManager.loadContent(Content);

            Menu_Song                   = Content.Load <SoundEffect>("Sounds/Epic_Loop");
            Menu_Song_Instance          = Menu_Song.CreateInstance();
            Menu_Song_Instance.IsLooped = true;
            Menu_Song_Instance.Volume   = .1f;

            Battle_Song                   = Content.Load <SoundEffect>("Sounds/VGameTune");
            Battle_Song_Instance          = Battle_Song.CreateInstance();
            Battle_Song_Instance.IsLooped = true;
            Battle_Song_Instance.Volume   = .1f;

            Main_Song                   = Content.Load <SoundEffect>("Sounds/LingeringChip");
            Main_Song_Instance          = Main_Song.CreateInstance();
            Main_Song_Instance.IsLooped = true;
            Main_Song_Instance.Volume   = .3f;
            //both songs have no duration

            EndGameText = new Text("And So,\n\nThrough much perserverence\nand a low interest mortgage\nour boss was finally\n\nLeft Alone.",
                                   new Vector2(300, 200), Text.fonts["6809Chargen-24"], Color.Cyan);
        }
        public static LeaveMeAlone.GameState Update(GameTime gameTime)
        {
            lastMouseState    = currentMouseState;
            currentMouseState = Mouse.GetState();
            if (menu_state == MenuState.main)
            {
                if (lastMouseState.LeftButton == ButtonState.Pressed && currentMouseState.LeftButton == ButtonState.Released)
                {
                    if (newGame.Intersects(currentMouseState.X, currentMouseState.Y))
                    {
                        menu_state = MenuState.opening;
                    }
                    else if (loadGame.Intersects(currentMouseState.X, currentMouseState.Y) && !isNewGame)
                    {
                        LeaveMeAlone.Main_Song_Instance.Stop();
                        LeaveMeAlone.Menu_Song_Instance.Play();
                        return(LeaveMeAlone.GameState.Upgrade);
                    }
                    else if (quit.Intersects(currentMouseState.X, currentMouseState.Y))
                    {
                        return(LeaveMeAlone.GameState.Quit);
                    }
                }
            }
            else if (menu_state == MenuState.opening)
            {
                if (lastMouseState.LeftButton == ButtonState.Pressed && currentMouseState.LeftButton == ButtonState.Released)
                {
                    if (next_intro.Intersects(currentMouseState.X, currentMouseState.Y))
                    {
                        line_number++;
                        opening_timer = 0;
                    }
                    if (skip_intro.Intersects(currentMouseState.X, currentMouseState.Y))
                    {
                        line_number = 1 + opening_monologue.Count();
                    }
                }
                if (line_number == 1 + opening_monologue.Count())
                {
                    menu_state = MenuState.boss;
                }
                else if (opening_timer > 300)
                {
                    if (line_number != opening_monologue.Count())
                    {
                        opening_timer = 0;
                    }
                    line_number++;
                }
                else
                {
                    opening_timer++;
                }
            }
            else
            {
                if (brute.Contains(new Vector2(currentMouseState.X, currentMouseState.Y)))
                {
                    bruteHover      = true;
                    mastermindHover = false;
                    operativeHover  = false;
                    brute.walk();
                    mastermind.idle();
                    operative.idle();
                    current = brute;
                }
                else if (mastermind.Contains(new Vector2(currentMouseState.X, currentMouseState.Y)))
                {
                    bruteHover      = false;
                    mastermindHover = true;
                    operativeHover  = false;
                    brute.idle();
                    mastermind.walk();
                    operative.idle();
                    current = mastermind;
                }
                else if (operative.Contains(new Vector2(currentMouseState.X, currentMouseState.Y)))
                {
                    bruteHover      = false;
                    mastermindHover = false;
                    operativeHover  = true;
                    brute.idle();
                    mastermind.idle();
                    operative.walk();
                    current = operative;
                }
                else
                {
                    current         = null;
                    bruteHover      = false;
                    mastermindHover = false;
                    operativeHover  = false;
                    brute.idle();
                    mastermind.idle();
                    operative.idle();
                }
                brute.Update(gameTime);
                mastermind.Update(gameTime);
                operative.Update(gameTime);
                if (lastMouseState.LeftButton == ButtonState.Pressed && currentMouseState.LeftButton == ButtonState.Released && canFinish)
                {
                    Vector2 mousePos = new Vector2(currentMouseState.X, currentMouseState.Y);
                    if (operative.Contains(mousePos) || brute.Contains(mousePos) || mastermind.Contains(mousePos))
                    {
                        BattleManager.boss = new Character(current.bossType, 1, new Vector2(BattleManager.bossLoc.X, BattleManager.bossLoc.Y));


                        BattleManager.heroes = PartyManager.CreateParty();

                        LeaveMeAlone.Main_Song_Instance.Stop();

                        UpgradeMenu.boughtRooms.Clear();
                        Resources.gold = 1000;
                        Resources.exp  = 0;
                        UpgradeMenu.Init(current);
                        LairManager.Init();
                        PartyManager.Init();
                        LairManager.EndOfGame   = false;
                        LairManager.TowerLevel  = 0;
                        LairManager.MaxLevel    = 3;
                        LairManager.LairRooms   = new List <Room>();
                        LairManager.boughtRooms = new List <UpgradeMenu.ButtonRoom>();

                        //return LeaveMeAlone.GameState.Upgrade;
                        return(LeaveMeAlone.GameState.Upgrade);
                    }
                }
                canFinish = true;
            }
            return(LeaveMeAlone.GameState.Main);
        }