Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.15 KB | None | 0 0
  1. class Program
  2.     {
  3.         static void Main(string[] args)
  4.         {
  5.             int itemLevel = 0;
  6.             List<int> attackMultiply = new List<int>() { 100, 250, 650, 900, 1500, 2300, 3000, 3500, 4000, 5000};
  7.             Random generator = new Random();
  8.             int statsGet = 0, diceOne = 0, diceTwo = 0, diceThree = 0;
  9.             int statsDelta = 0;
  10.             int randomMin = 0;
  11.             Console.Write("Введите уровень предмета для генерации: 5, 10, 20, 30,40,50,60,70,80,90,100");
  12.             itemLevel = Convert.ToInt32(Console.ReadLine());
  13.             //Определяем редкость предмета
  14.             int diceSum = 0;
  15.             string typeRare = "";
  16.             int common = 0;
  17.             int rare = 0;
  18.             int legend = 0;
  19.             int mythical = 0;
  20.             int attack = 0;
  21.             switch (itemLevel)
  22.             {
  23.                 case 5:
  24.                     {
  25.                         statsGet = 100;
  26.                     }
  27.                     break;
  28.                 case 10:
  29.                     {
  30.                         statsGet = 250;
  31.                     }
  32.                     break;
  33.             }
  34.  
  35.             for (int index = 0; index < 1000; index++)
  36.             {
  37.                 diceOne = generator.Next(0, 7);
  38.                 diceTwo = generator.Next(6, 13);
  39.                 diceThree = generator.Next(12, 23); //min 18 max 40, 18 - 30, 31 - 33, 34 - 37, 38-40
  40.                 diceSum = diceOne + diceThree + diceTwo;
  41.                 if (diceSum < 30)
  42.                 {
  43.                     statsDelta = Convert.ToInt32(statsGet * 0.1) + 1;    //standart
  44.                     randomMin = 0;
  45.                     common++;
  46.                     typeRare = "Common";
  47.                 }
  48.                 else if (diceSum < 34)
  49.                 {
  50.                     statsDelta = Convert.ToInt32(statsGet * 0.25) + 1; //rare
  51.                     randomMin = Convert.ToInt32(statsGet * 0.1);
  52.                     rare++;
  53.                     typeRare = "Rare";
  54.                 }
  55.                 else if (diceSum < 38)
  56.                 {
  57.                     statsDelta = Convert.ToInt32(statsGet * 0.5) + 1; //legendary
  58.                     randomMin = Convert.ToInt32(statsGet * 0.25);
  59.                     legend++;
  60.                     typeRare = "Legendary";
  61.                 }
  62.                 else
  63.                 {
  64.                     statsDelta = statsGet+1; // mythical
  65.                     randomMin = Convert.ToInt32(statsGet * 0.5);
  66.                     mythical++;
  67.                     typeRare = "Mythical";
  68.                 }
  69.  
  70.                 //generate
  71.                 attack = generator.Next(randomMin, statsDelta);
  72.                 Console.WriteLine("Уровень предмета: " + itemLevel + " редкость предмета: " + typeRare + " атака предмета: " + (attack+statsGet));
  73.             }
  74.             Console.WriteLine("Дропы: обычный предмет - " + common + "\nредкие: " + rare + "\nлегендарные: " + legend + "\nмифики: " + mythical);
  75.             Console.ReadKey();
  76.         }
  77.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement