Example #1
0
        // Магазин,где игрок может приобрести комплект брони
        public void ArmorShopPay(Player player)
        {
            HelloPlayer(player);
            int i = 0;

            foreach (var t in Program.ArmorComplects)
            {
                Console.WriteLine("{5}: {0}, {1}, {2}, {3}, {4}", t.Head.Name, t.Body.Name, t.Arms.Name, t.Leggs.Name, t.Boots.Name, ++i);
            }

            Console.WriteLine();
            ArmorComplect armor = GetChoice();

            if (armor.GetCost(RealCosts["armor"]) == 0)
            {
                return;
            }

            if (player.HaveMoney(armor.GetCost(RealCosts["armor"])))
            {
                player.AddArmor(armor);
                Console.WriteLine("вы купили комплект брони");
            }
            else
            {
                Console.WriteLine("у вас недостаточно средств для покупки");
            }
        }
Example #2
0
 // Надеваем на игрока комплект брони
 public void AddArmor(ArmorComplect armor)
 {
     this.MaxMana    -= this.Armor.GetMana();
     this.Armor       = armor;
     this.MaxMana    += armor.GetMana();
     this.CurrentMana = this.MaxMana;
 }
Example #3
0
        // Заполнение всех комплектов брони
        static List <ArmorComplect> GetArmor(string path)
        {
            var result        = new List <ArmorComplect>();
            int countComplect = NamesArmor.GetLength(0);

            for (int i = 0; i < countComplect; i++)
            {
                var tempComplect = new ArmorComplect();
                // Устанавливаем в строго определенном порядке
                tempComplect.Head  = Armor.GetArmorFromFile(path + NamesArmor[i, 0]);
                tempComplect.Body  = Armor.GetArmorFromFile(path + NamesArmor[i, 1]);
                tempComplect.Arms  = Armor.GetArmorFromFile(path + NamesArmor[i, 2]);
                tempComplect.Leggs = Armor.GetArmorFromFile(path + NamesArmor[i, 3]);
                tempComplect.Boots = Armor.GetArmorFromFile(path + NamesArmor[i, 4]);
                result.Add(tempComplect);
            }
            return(result);
        }
Example #4
0
        // Базовые характеристики для любого типа
        public Player(string name, MainGameStructures.Position position)
        {
            this.Name            = name;
            this.Position        = position;
            this.Level           = 1;
            this.MagicLevel      = 1;
            this.Money           = 200;
            this.NextLevelBorder = 150;

            this.Swords = new List <Sword>();
            this.Armor  = new ArmorComplect();
            this.Spells = new List <Spell>();
            this.Tasks  = new List <Tuple <MainGameStructures.Position, Task> >();

            this.MedicineKits = new List <MainGameStructures.MedicineKit>()
            {
                new MainGameStructures.MedicineKit {
                    HpToAdd = 50
                },
                new MainGameStructures.MedicineKit {
                    HpToAdd = 50
                },
                new MainGameStructures.MedicineKit {
                    HpToAdd = 50
                },
                new MainGameStructures.MedicineKit {
                    HpToAdd = 50
                },
                new MainGameStructures.MedicineKit {
                    HpToAdd = 50
                },
                new MainGameStructures.MedicineKit {
                    HpToAdd = 150
                }
            };
            this.IsLive = true;
        }