SteamWar/FightSystem
Archiviert
13
1

Add ranked rework
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-03-09 18:01:37 +01:00
Ursprung f4ffd17c55
Commit 14e64c3947
2 geänderte Dateien mit 2 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -45,7 +45,6 @@ public abstract class Countdown {
private final boolean level;
protected int time;
protected int timeElapsed;
private BukkitTask task = null;
public abstract void countdownFinished();
@ -111,13 +110,8 @@ public abstract class Countdown {
return time;
}
public int getTimeElapsed(){
return timeElapsed;
}
private void count() {
time--;
timeElapsed++;
show();
}

Datei anzeigen

@ -119,11 +119,9 @@ public class FightStatistics {
}
int remainingTime = 0;
int timeElapsed = 0;
Countdown timeOverCountdown = Wincondition.getTimeOverCountdown();
if (timeOverCountdown != null) {
remainingTime = timeOverCountdown.getTimeLeft();
timeElapsed = timeOverCountdown.getTimeElapsed();
}
try {
@ -149,18 +147,14 @@ public class FightStatistics {
}
replayLock = false;
calculateEloIfNeeded(timeElapsed, blueSchemRank, redSchemRank, blueResult, gameMode);
calculateEloIfNeeded(blueSchemRank, redSchemRank, blueResult, gameMode);
}
private void calculateEloIfNeeded(int timeElapsed, Integer blueSchemRank, Integer redSchemRank, double blueResult, String gameMode) {
private void calculateEloIfNeeded(Integer blueSchemRank, Integer redSchemRank, double blueResult, String gameMode) {
if (!Config.RankedEnabled) {
return;
}
if (timeElapsed < 30) { // Too short fights are not worth elo change
return;
}
if (blueSchemRank == null || redSchemRank == null) { // Schematics are not ranked
return;
}