Beispiel #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();
        }
Beispiel #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);
        }