Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. public void lvlUpdate(int l, int sr)
  2.         {
  3.             health = 3 * h;
  4.             attack = h;
  5.             deffens = h;
  6.  
  7.             int d = (l + sr) / 2 + (l + sr) % 2;
  8.  
  9.             if (r.Next() % 3 == 0)
  10.             {
  11.                 if (r.Next() % 3 == 0)
  12.                 {
  13.                     d -= r.Next(1, 3);
  14.                 }
  15.                 else
  16.                 {
  17.                     d += r.Next(1, 3);
  18.                 }
  19.             }
  20.  
  21.             if (d < 0) d = 0;
  22.             lvl = h + d;
  23.  
  24.             for (int i = 0; i < d; i++)
  25.             {
  26.                 switch (r.Next(1, 3))
  27.                 {
  28.                     case 1:
  29.                         attack++;
  30.                         break;
  31.                     case 2:
  32.                         deffens++;
  33.                         break;
  34.                 }
  35.             }
  36.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement