Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void CalculateBet()
- {
- if (this.IsPlayerParticipating)
- {
- if (this.CurrentRound.CurrentMatch == null)
- {
- this.BetOdd = 0f;
- return;
- }
- if (this.IsPlayerEliminated || !this.IsPlayerParticipating)
- {
- this.OverallExpectedDenars = 0;
- this.BetOdd = 0f;
- return;
- }
- float num = 50f;
- float num2 = 0f;
- float num3 = 0f;
- TournamentMatch[] matches = this.CurrentRound.Matches;
- for (int i = 0; i < matches.Length; i++)
- {
- foreach (TournamentTeam tournamentTeam in matches[i].Teams)
- {
- float num4 = 0f;
- foreach (TournamentParticipant tournamentParticipant in tournamentTeam.Participants)
- {
- num4 += (float)tournamentParticipant.Character.Level;
- }
- if (tournamentTeam.Participants.Any((TournamentParticipant x) => x.Character == CharacterObject.PlayerCharacter))
- {
- num4 += num;
- num3 = num4;
- }
- num2 += num4;
- }
- }
- float val = MathF.Clamp((float)Math.Sqrt((double)(num2 / num3)), 1.01f, 2f);
- this.BetOdd = Math.Min(val, 2f);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement