コード例 #1
0
        public void Run()
        {
            State = PlayerState.WorldMap;
            CW.Clear();
            ViewMap.DrawMap();

            while (true)
            {
                switch (State)
                {
                case PlayerState.WorldMap:
                    if (infoBoardSize < DrawInfoBox.Inputs.Count)
                    {
                        DIB.Draw(2, MapDraw.ViewSize.Y * 2 + 3);
                    }
                    if (movement.CheckMoveMent())
                    {
                        ViewMap.DrawMap();
                    }

                    break;

                case PlayerState.Dungeon:
                    if (infoBoardSize < DrawInfoBox.Inputs.Count)
                    {
                        DIB.Draw(2, MapDraw.ViewSize.Y * 2 + 3);
                    }
                    if (movement.MovementInDungeon())
                    {
                        ViewMap.DrawMap();
                    }
                    break;

                case PlayerState.Store:

                    break;

                case PlayerState.Combat:
                    switch (movement.CombatMenuNavigation())
                    {
                    case CombatMenuReturn.Menu:
                        CD.RedrawAcionMenu();
                        break;

                    case CombatMenuReturn.LogAndStatBlock:
                        CD.ReDrawLog();
                        CD.ReDrawStats();
                        break;

                    case CombatMenuReturn.Log:
                        CD.ReDrawLog();
                        break;

                    case CombatMenuReturn.StatAndMenu:
                        CD.RedrawAcionMenu();
                        CD.ReDrawStats();
                        break;

                    case CombatMenuReturn.All:
                        CD.Draw(new Cord {
                            X = 2, Y = 2
                        });
                        break;
                    }
                    break;

                case PlayerState.Inventory:
                    switch (movement.InventoryNavigation())
                    {
                    case InventoryMenuReturn.DrawInventoryContainer:
                        ID.DrawInventoryContainer();
                        break;

                    case InventoryMenuReturn.Everything:
                        ID.Draw();
                        break;

                    case InventoryMenuReturn.Gold:
                        ID.DrawGold();
                        break;

                    case InventoryMenuReturn.None:
                        //why did I make this?
                        break;

                    case InventoryMenuReturn.TabsAndDrawInventoryContainer:
                        ID.DrawInventoryContainer();
                        ID.DrawTabs();
                        break;
                    }
                    break;
                }
            }
        }
コード例 #2
0
ファイル: Navigation.cs プロジェクト: GoldiHD/AngelBorn
        public CombatMenuReturn CombatMenuNavigation()
        {
            switch (CW.ReadKey().Key)
            {
            case ConsoleKey.UpArrow:
                if (CombatDraw.IndexMenu > 0)
                {
                    CombatDraw.IndexMenu--;
                }
                return(CombatMenuReturn.Menu);

            case ConsoleKey.DownArrow:
                if (CombatDraw.ActiveMenuList.Count - 1 > CombatDraw.IndexMenu && CombatDraw.IndexMenu < 10)
                {
                    CombatDraw.IndexMenu++;
                }
                return(CombatMenuReturn.Menu);

            case ConsoleKey.Enter:
                switch (CombatDraw.MenuState)
                {
                case CombatDraw.ActionMenus.Ablilites:
                    throw new NotImplementedException();
                    break;

                case CombatDraw.ActionMenus.Items:
                    throw new NotImplementedException();
                    break;

                case CombatDraw.ActionMenus.Main:
                    switch (CombatDraw.IndexMenu)
                    {
                    case 0:
                        SingleTon.GetPlayerController().CBM.enemyFighting.SetDamage();
                        DrawInfoBox.AddToBox("You attacked " + SingleTon.GetPlayerController().CBM.enemyFighting.Name + " and dealt " + SingleTon.GetPlayerController().Skills.Vitallity.TakeDamage(SingleTon.GetPlayerController().CBM.enemyFighting.Damage) + ", " + SingleTon.GetPlayerController().CBM.enemyFighting.Name + " hits back and damages you " + SingleTon.GetPlayerController().CBM.enemyFighting.TakeDamage(SingleTon.GetPlayerController().Skills.Power.Buff + SingleTon.GetPlayerController().Skills.Power.ExtraAttack));
                        if (SingleTon.GetPlayerController().Skills.Vitallity.HealthCurrent == 0)
                        {
                        }
                        else if (SingleTon.GetPlayerController().CBM.enemyFighting.Health == 0)
                        {
                            if (SingleTon.GetCursorInstance().CurrentTile.MyType == TileType.Dungeon)
                            {
                                PlayManager.State = PlayerState.Dungeon;
                            }
                            else if (SingleTon.GetCursorInstance().CurrentTile.MyType == TileType.Normal)
                            {
                                PlayManager.State = PlayerState.WorldMap;
                            }
                            SingleTon.GetPlayerController().AddXP(SingleTon.GetPlayerController().CBM.enemyFighting.Xp);
                            SingleTon.GetPlayerController().Inventory.AddGold(SingleTon.GetPlayerController().CBM.enemyFighting.GetGold());
                            SingleTon.GetPlayerController().CBM.enemyFighting.EndCombat();
                            CW.Clear();
                            MapD.DrawMap();
                            return(CombatMenuReturn.None);
                        }
                        break;

                    case 1:
                        CombatDraw.MenuState = CombatDraw.ActionMenus.Items;
                        break;

                    case 2:
                        CombatDraw.MenuState = CombatDraw.ActionMenus.Ablilites;
                        break;

                    case 3:
                        DrawInfoBox.AddToBox("You tried to flee from " + SingleTon.GetPlayerController().CBM.enemyFighting.Name);
                        if (SingleTon.PercentChance(SingleTon.GetPlayerController().CBM.enemyFighting.FleeChance))
                        {
                            DrawInfoBox.AddToBox("You succeded and escaped " + SingleTon.GetPlayerController().CBM.enemyFighting.Name);
                            if (SingleTon.GetCursorInstance().CurrentTile.MyType == TileType.Dungeon)
                            {
                                PlayManager.State = PlayerState.Dungeon;
                            }
                            else if (SingleTon.GetCursorInstance().CurrentTile.MyType == TileType.Normal)
                            {
                                PlayManager.State = PlayerState.WorldMap;
                            }
                            CW.Clear();
                            MapD.DrawMap();
                            return(CombatMenuReturn.None);
                        }
                        else
                        {
                            DrawInfoBox.AddToBox("You failed and didn't escape " + SingleTon.GetPlayerController().CBM.enemyFighting.Name);
                        }
                        break;
                    }
                    break;
                }
                return(CombatMenuReturn.All);

            default:
                return(CombatMenuReturn.None);
            }
        }