Implementation of ELO-Based 1 vs 1 ranked games #172
@ -187,10 +187,6 @@ public class FightTeam implements IFightTeam{
|
||||
}
|
||||
|
||||
public void setLeader(FightPlayer leader) {
|
||||
this.leader = leader;
|
||||
if(ready && leader != null)
|
||||
setReady(false);
|
||||
|
||||
if (leader == null){
|
||||
if(!players.isEmpty()) {
|
||||
setLeader(players.iterator().next());
|
||||
@ -202,6 +198,9 @@ public class FightTeam implements IFightTeam{
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.leader = leader;
|
||||
if(ready)
|
||||
setReady(false);
|
||||
|
||||
leader.setKit(KitManager.getKitByName(Config.LeaderDefault));
|
||||
Inventory inventory = leader.getPlayer().getInventory();
|
||||
|
@ -52,8 +52,12 @@ public class FightStatistics {
|
||||
int redElo = Elo.getElo(redLeader.getId(), gameMode);
|
||||
double blueWinExpectation = 1 / (1 + Math.pow(10, (blueElo - redElo) / 400f));
|
||||
double redWinExpectation = 1 / (1 + Math.pow(10, (redElo - blueElo) / 400f));
|
||||
Elo.setElo(blueLeader.getId(), gameMode, (int) Math.round(blueElo + K * (blueResult - blueWinExpectation)));
|
||||
Elo.setElo(redLeader.getId(), gameMode, (int) Math.round(redElo + K * (1 - blueResult - redWinExpectation)));
|
||||
int newBlueElo = (int) Math.round(blueElo + K * (blueResult - blueWinExpectation));
|
||||
int newRedElo = (int) Math.round(redElo + K * (1 - blueResult - redWinExpectation));
|
||||
Elo.setElo(blueLeader.getId(), gameMode, newBlueElo);
|
||||
Elo.setElo(redLeader.getId(), gameMode, newRedElo);
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§7ELO von " + Fight.getBlueTeam().getPrefix() + blueLeader.getUserName() + "§8: §7" + blueElo + "§8»§e" + newBlueElo);
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§7ELO von " + Fight.getRedTeam().getPrefix() + redLeader.getUserName() + "§8: §7" + redElo + "§8»§e" + newRedElo);
|
||||
}
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren