Пример #1
0
        public SelectionScreen(MogwaiController mogwaiController, int width, int height) : base(width, height)
        {
            _borderSurface = new Basic(width + 2, height + 2, Font);
            _borderSurface.DrawBox(new Rectangle(0, 0, _borderSurface.Width, _borderSurface.Height),
                                   new Cell(Color.DarkCyan, Color.Black), null, ConnectedLineThick);
            _borderSurface.Position = new Point(-1, -1);
            Children.Add(_borderSurface);

            _controlsConsole = new ControlsConsole(110, 1)
            {
                Position = new Point(0, 24)
            };
            _controlsConsole.Fill(Color.DarkCyan, Color.Black, null);
            Children.Add(_controlsConsole);

            _infoConsole = new MogwaiConsole("Info", "", 24, 38)
            {
                Position = new Point(113, -8)
            };
            Children.Add(_infoConsole);

            _debugConsole = new Console(24, 38)
            {
                Position = new Point(113, 22)
            };
            _debugConsole.Fill(Color.Beige, Color.TransparentBlack, null);
            _debugConsole.Print(1, 1, $"Debug Console [{Coloring.Gold("     ")}]:");
            _debugConsole.Print(1, 2, $"..armors: {Armors.Instance.AllBuilders().Count}");
            _debugConsole.Print(1, 3, $"..weapns: {Weapons.Instance.AllBuilders().Count}");
            _debugConsole.Print(1, 4, $"..mnstrs: {Monsters.Instance.AllBuilders().Count}");
            Children.Add(_debugConsole);


            _logConsole = new MogwaiConsole("Log", "", 110, 3)
            {
                Position = new Point(0, 27)
            };
            Children.Add(_logConsole);

            HeaderPosition  = 1;
            TrailerPosition = height - 2;

            CreateHeader();
            CreateTrailer();

            _controller    = mogwaiController;
            _transferFunds = 2;

            Init();
        }
Пример #2
0
        private void _listBox_SelectedItemChanged(object sender, ListBox.SelectedItemEventArgs e)
        {
            _itemConsole.Clear();

            if (e.Item is BaseItem baseItem)
            {
                _itemConsole.Print(1, 1,
                                   $"{Coloring.Orange(baseItem.Name)} [{Coloring.DarkGrey(baseItem.GetType().Name)}]");
                _itemConsole.Print(1, 2,
                                   $"Weight: {Coloring.Gainsboro(baseItem.Weight.ToString("######0.00").PadLeft(10))} lbs.",
                                   Color.Gainsboro);
                _itemConsole.Print(1, 3,
                                   $"Cost:   {Coloring.Gold(baseItem.Cost.ToString("######0.00").PadLeft(10))} Gold", Color.Gainsboro);
                if (baseItem is Weapon weapon)
                {
                    _itemConsole.Print(1, 5,
                                       $"{Coloring.DarkGrey("Damage:")}   {Coloring.Green(weapon.MinDmg.ToString())} - {Coloring.Green(weapon.MaxDmg.ToString())}",
                                       Color.Gainsboro);
                    _itemConsole.Print(1, 6,
                                       $"{Coloring.DarkGrey("Critical:")} {Coloring.Yellow(weapon.CriticalMinRoll)} / {Coloring.Yellow(weapon.CriticalMultiplier)}x ",
                                       Color.Gainsboro);
                    _itemConsole.Print(1, 7, $"{Coloring.DarkGrey("Range:")}    {weapon.Range}", Color.Gainsboro);
                    _itemConsole.Print(1, 8,
                                       $"{Coloring.DarkGrey("Damage:")}   {string.Join(",", weapon.WeaponDamageTypes)}",
                                       Color.Gainsboro);
                    _itemConsole.Print(1, 9, $"{Coloring.DarkGrey("Effort:")}   {weapon.WeaponEffortType}",
                                       Color.Gainsboro);
                }
                else if (baseItem is Armor armor)
                {
                    _itemConsole.Print(1, 5,
                                       $"{Coloring.DarkGrey("Armor:")}    {Coloring.Green(armor.ArmorBonus.ToString())}",
                                       Color.Gainsboro);
                    _itemConsole.Print(1, 6,
                                       $"{Coloring.DarkGrey("Penalty:")} {Coloring.Red(armor.ArmorCheckPenalty.ToString())}",
                                       Color.Gainsboro);
                    _itemConsole.Print(1, 7, $"{Coloring.DarkGrey("Max Dex:")}  {armor.MaxDexterityBonus}",
                                       Color.Gainsboro);
                    _itemConsole.Print(1, 8, $"{Coloring.DarkGrey("Spellf.:")}  {armor.ArcaneSpellFailureChance}",
                                       Color.Gainsboro);
                    _itemConsole.Print(1, 9, $"{Coloring.DarkGrey("Effort:")}   {armor.ArmorEffortType}",
                                       Color.Gainsboro);
                }
            }

            //_itemConsole.Print(1, 15, $"{baseItem.Description}", Color.Gainsboro);
        }
Пример #3
0
        public void Update()
        {
            _statsConsole.Clear();
            _rewardConsole.Clear();
            //_statsConsole.Fill(DefaultForeground, new Color(20, 20, 20, 50), null);
            switch (_mogwai.Adventure.AdventureState)
            {
            case AdventureState.Extended:
                ChangeImage("travel.png");
                break;

            case AdventureState.Completed:
                ChangeImage("victory.png");
                _statsConsole.Print(1, 1, $"Congratulations {Coloring.Name(_mogwai.Name)}, you're a true hero!", Color.Brown);
                _statsConsole.Print(1, 2, $" Promise me you'll always remember that you're", Color.Brown);
                _statsConsole.Print(1, 3, $"braver than you believe, stronger than you seem,", Color.Brown);
                _statsConsole.Print(1, 4, $"and smarter than you think.", Color.Brown);
                _statsConsole.Print(1, 6, $" You're history, {Coloring.Name(_mogwai.Name)}, HURRAY!", Color.Gold);
                _statsConsole.Print(1, 8, $"                         Book of Mogwai, Ch.1337", Color.DarkGray);
                _statsConsole.Print(1, 9, $"'they will stand up as one and fight as legions!'", Color.OrangeRed);

                AddStatistic(true);
                break;

            case AdventureState.Failed:
                ChangeImage("fail.png");
                //_statsConsole.Print(1, 1, $"         1         2         3         4         5         6");
                //_statsConsole.Print(1, 2, $"123456789012345678901234567890123456789012345678901234567890");
                _statsConsole.Print(1, 1, $"You died trying to free the world of this");
                _statsConsole.Print(1, 2, $"terrible injustice, {Coloring.Name(_mogwai.Name)}!");
                _statsConsole.Print(1, 3, $" The brave do not live forever but the cautious");
                _statsConsole.Print(1, 4, $"do not live at all.");
                _statsConsole.Print(1, 6, $" May your soul be free now, {Coloring.Name(_mogwai.Name)}!", Color.Gold);
                _statsConsole.Print(11, 8, $"             Book of Mogwai, Ch.7487", Color.DarkGray);
                _statsConsole.Print(11, 9, $"'A hero died and the world lost hope.'", Color.OrangeRed);
                AddStatistic(false);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }