Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1.         private void CalculateBet()
  2.         {
  3.             if (this.IsPlayerParticipating)
  4.             {
  5.                 if (this.CurrentRound.CurrentMatch == null)
  6.                 {
  7.                     this.BetOdd = 0f;
  8.                     return;
  9.                 }
  10.                 if (this.IsPlayerEliminated || !this.IsPlayerParticipating)
  11.                 {
  12.                     this.OverallExpectedDenars = 0;
  13.                     this.BetOdd = 0f;
  14.                     return;
  15.                 }
  16.                 float num = 50f;
  17.                 float num2 = 0f;
  18.                 float num3 = 0f;
  19.                 TournamentMatch[] matches = this.CurrentRound.Matches;
  20.                 for (int i = 0; i < matches.Length; i++)
  21.                 {
  22.                     foreach (TournamentTeam tournamentTeam in matches[i].Teams)
  23.                     {
  24.                         float num4 = 0f;
  25.                         foreach (TournamentParticipant tournamentParticipant in tournamentTeam.Participants)
  26.                         {
  27.                             num4 += (float)tournamentParticipant.Character.Level;
  28.                         }
  29.                         if (tournamentTeam.Participants.Any((TournamentParticipant x) => x.Character == CharacterObject.PlayerCharacter))
  30.                         {
  31.                             num4 += num;
  32.                             num3 = num4;
  33.                         }
  34.                         num2 += num4;
  35.                     }
  36.                 }
  37.                 float val = MathF.Clamp((float)Math.Sqrt((double)(num2 / num3)), 1.01f, 2f);
  38.                 this.BetOdd = Math.Min(val, 2f);
  39.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement