SteamWar/FightSystem
Archiviert
13
1

Add ranked rework #336

Zusammengeführt
Lixfel hat 6 Commits von Ranked nach master 2022-03-10 12:07:24 +01:00 zusammengeführt
2 geänderte Dateien mit 2 neuen und 14 gelöschten Zeilen
Nur Änderungen aus Commit 14e64c3947 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

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

Datei anzeigen

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