SteamWar/BungeeCore
Archiviert
13
2

Update some stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-04-01 13:26:05 +02:00
Ursprung 8ce2b9ab71
Commit b5528a6c60

Datei anzeigen

@ -82,19 +82,26 @@ public class FightEndsHandler implements SpigotHandler {
}
private void calculateEloOfTeam(int schemId, int eloSchemOwn, int eloSchemEnemy, int eloTeamOwn, int eloTeamEnemy, double result, List<Integer> players, String gameMode, boolean noPlayerRank) {
double winSchemExpectation = 1 / (1 + Math.pow(10, (eloSchemEnemy - eloSchemOwn) / 600f));
double winSchemExpectation = calsWinExpectation(eloSchemOwn, eloSchemEnemy);
SchemElo.setElo(schemId, (int) Math.round(eloSchemOwn + K * (result - winSchemExpectation)));
if (noPlayerRank) return;
double winTeamExpectation = 1 / (1 + Math.pow(10, (eloTeamEnemy - eloTeamOwn) / 600f));
double winTeamExpectation = calsWinExpectation(eloTeamOwn, eloTeamEnemy);
for (int player : players) {
int playerElo = UserElo.getEloOrDefault(player, gameMode);
int fights = UserElo.getFightsOfSeason(player, gameMode);
double multiplier = Math.max(1.2 - (fights / 200.0), 0.8);
UserElo.setElo(player, gameMode, (int) Math.round(playerElo + K * (result - winTeamExpectation) * multiplier));
UserElo.setElo(player, gameMode, (int) Math.round(playerElo + getK(fights) * (result - winTeamExpectation)));
}
}
private double calsWinExpectation(int eloOwn, int eloEnemy) {
return 1 / (1 + Math.pow(10, (eloEnemy - eloOwn) / 600f));
}
private double getK(int fights) {
return K * Math.max(1.2 - (fights / 200.0), 0.8);
}
private boolean teamComboExistedAlready(List<Integer> bluePlayers, List<Integer> redPlayers, String gameMode) {
long time = Timestamp.from(Instant.now()).getTime() - fightRange;
int page = 0;