Add ranked rework #336
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren