Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace test3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int choose;
- string[,] equiped = new string[1,3];
- equiped[0, 0] = "Нет оружия";
- equiped[0, 1] = "0";
- equiped[0, 2] = "0";
- int currentEquiped = 0;
- int stat = 0;
- do
- {
- Console.WriteLine("Это меню оружия");
- Console.WriteLine();
- Console.WriteLine("Сейчас на персонаже:");
- Console.WriteLine($"Экипировано: {equiped[currentEquiped, 0]}");
- Console.WriteLine($"Урон: {equiped[currentEquiped, 1]}");
- Console.WriteLine($"Скорострельность: {equiped[currentEquiped, 2]}");
- Console.WriteLine();
- Console.WriteLine("Ваш рюкзак");
- for (int i = 0; i < equiped.GetLength(0); i++)
- {
- Console.WriteLine($"{i + 1}. {equiped[i, 0]}");
- }
- Console.WriteLine();
- Console.WriteLine("Меню");
- Console.WriteLine("1. Добавить оружие");
- Console.WriteLine("2. Стастика оружия");
- Console.WriteLine("3. Экипировать оружие");
- Console.WriteLine("4. Выйти из инвентаря");
- choose = Convert.ToInt32(Console.ReadLine());
- Console.Clear();
- switch (choose)
- {
- case 1:
- Console.WriteLine("Меню добавления оружия\n");
- string[,] weapon = new string[equiped.GetLength(0) + 1, equiped.GetLength(1)];
- for (int i = 0; i < equiped.GetLength(0); i++)
- {
- for (int j = 0; j < equiped.GetLength(1); j++)
- {
- weapon[i, j] = equiped[i, j];
- }
- }
- Console.WriteLine("Введите название оружия: ");
- weapon[equiped.GetLength(0) - 1, 0] = Console.ReadLine();
- Console.WriteLine("Введите урон оружия: ");
- weapon[equiped.GetLength(0) - 1, 1] = Console.ReadLine();
- Console.WriteLine("Введите скорострельность: ");
- weapon[equiped.GetLength(0) - 1, 2] = Console.ReadLine();
- equiped = weapon;
- break;
- case 2:
- Console.WriteLine("Меню статистики оружия\n");
- Console.WriteLine("Выберите номер оружия: ");
- for (int i = 0; i < equiped.GetLength(0); i++)
- {
- Console.WriteLine($"{i + 1}. {equiped[i, 0]}");
- }
- stat = Convert.ToInt32(Console.ReadLine()) - 1;
- Console.WriteLine("Оружие: " + equiped[stat, 0]);
- Console.WriteLine("Урон: " + equiped[stat, 1]);
- Console.WriteLine("Скорострельность: " + equiped[stat, 2]);
- Console.ReadLine();
- break;
- case 3:
- Console.WriteLine("Меню экипировки оружия\n");
- Console.WriteLine("Выберите номер оружия: ");
- for (int i = 0; i < equiped.GetLength(0); i++)
- {
- Console.WriteLine($"{i + 1}. {equiped[i, 0]}");
- }
- currentEquiped = Convert.ToInt32(Console.ReadLine()) - 1;
- break;
- case 4:
- Console.WriteLine("До встречи");
- Console.ReadLine();
- break;
- }
- Console.Clear();
- } while (choose != 4);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement