int32 ArenaTeam::WonAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change) { // Called when the team has won // Change in Matchmaker rating int32 mod = GetMatchmakerRatingMod(Own_MMRating, Opponent_MMRating, true); // Change in Team Rating rating_change = GetRatingMod(Stats.Rating, Opponent_MMRating, true); // Modify the team stats accordingly FinishGame(rating_change); // Update number of wins per season and week Stats.WeekWins += 1; Stats.SeasonWins += 1; // Return the rating change, used to display it on the results screen return mod; }
int32 ArenaTeam::LostAgainst(uint32 againstRating) { // called when the team has lost //'chance' calculation - to loose to the opponent float chance = GetChanceAgainst(m_stats.rating, againstRating); float K = (m_stats.rating < 1000) ? 48.0f : 32.0f; // calculate the rating modification (ELO system with k=32 or k=48 if rating<1000) int32 mod = (int32)ceil(K * (0.0f - chance)); // modify the team stats accordingly if(againstRating <= sWorld.getConfig(CONFIG_UINT32_LOSERNOCHANGE) || m_stats.rating <= sWorld.getConfig(CONFIG_UINT32_LOSERNOCHANGE)) mod = 0; else if (m_stats.rating <= sWorld.getConfig(CONFIG_UINT32_LOSERHALFCHANGE)) mod /= 2; FinishGame(mod); // return the rating change, used to display it on the results screen return mod; }