Fix timeout scoreboard
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
0a0bf3ff11
Commit
fb5acefeac
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
|
import de.steamwar.fightsystem.Config;
|
||||||
import de.steamwar.fightsystem.countdown.TimeOverCountdown;
|
import de.steamwar.fightsystem.countdown.TimeOverCountdown;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
@ -29,8 +30,10 @@ public class WinconditionHeartRatioTimeout extends Wincondition {
|
|||||||
|
|
||||||
public WinconditionHeartRatioTimeout() {
|
public WinconditionHeartRatioTimeout() {
|
||||||
super("HeartTimeout", "§cDie Zeit ist abgelaufen, und Team ", " §chatte mehr verbleibende Leben!", "§cDie Zeit ist abgelaufen, und beide Teams hatten die gleiche Anzahl an verbleibenden Leben!");
|
super("HeartTimeout", "§cDie Zeit ist abgelaufen, und Team ", " §chatte mehr verbleibende Leben!", "§cDie Zeit ist abgelaufen, und beide Teams hatten die gleiche Anzahl an verbleibenden Leben!");
|
||||||
|
if(Config.ActiveWinconditions.contains(Winconditions.HEART_RATIO_TIMEOUT)){
|
||||||
timeOverCountdown = new StateDependentCountdown(Winconditions.HEART_RATIO_TIMEOUT, FightState.Running, new TimeOverCountdown(this::timeOver));
|
timeOverCountdown = new StateDependentCountdown(Winconditions.HEART_RATIO_TIMEOUT, FightState.Running, new TimeOverCountdown(this::timeOver));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void timeOver() {
|
protected void timeOver() {
|
||||||
double blueHeartRatio = Fight.getBlueTeam().getHeartRatio();
|
double blueHeartRatio = Fight.getBlueTeam().getHeartRatio();
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
|
import de.steamwar.fightsystem.Config;
|
||||||
import de.steamwar.fightsystem.countdown.TimeOverCountdown;
|
import de.steamwar.fightsystem.countdown.TimeOverCountdown;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
@ -29,8 +30,10 @@ public class WinconditionPercentTimeout extends Wincondition {
|
|||||||
|
|
||||||
public WinconditionPercentTimeout() {
|
public WinconditionPercentTimeout() {
|
||||||
super("PercentTimeout", "§cDie Zeit ist abgelaufen, und Team ", " §chatte weniger Schaden erlitten!", "§cDie Zeit ist abgelaufen, und beide Teams hatten gleichen Schaden!");
|
super("PercentTimeout", "§cDie Zeit ist abgelaufen, und Team ", " §chatte weniger Schaden erlitten!", "§cDie Zeit ist abgelaufen, und beide Teams hatten gleichen Schaden!");
|
||||||
|
if(Config.ActiveWinconditions.contains(Winconditions.PERCENT_TIMEOUT)) {
|
||||||
timeOverCountdown = new StateDependentCountdown(Winconditions.PERCENT_TIMEOUT, FightState.Running, new TimeOverCountdown(this::timeOver));
|
timeOverCountdown = new StateDependentCountdown(Winconditions.PERCENT_TIMEOUT, FightState.Running, new TimeOverCountdown(this::timeOver));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void timeOver() {
|
protected void timeOver() {
|
||||||
double bluePercent = Wincondition.percentWincondition.getPercent(Fight.getBlueTeam());
|
double bluePercent = Wincondition.percentWincondition.getPercent(Fight.getBlueTeam());
|
||||||
|
@ -49,7 +49,6 @@ public class WinconditionPoints extends Wincondition implements PrintableWincond
|
|||||||
teamMap.put(Fight.getRedTeam(), new TeamPoints(Fight.getRedTeam()));
|
teamMap.put(Fight.getRedTeam(), new TeamPoints(Fight.getRedTeam()));
|
||||||
|
|
||||||
new StateDependentListener(Winconditions.POINTS, FightState.Ingame, this);
|
new StateDependentListener(Winconditions.POINTS, FightState.Ingame, this);
|
||||||
timeOverCountdown = new StateDependentCountdown(Winconditions.POINTS, FightState.Running, new TimeOverCountdown(this::timeOver));
|
|
||||||
new StateDependent(Winconditions.POINTS, FightState.Ingame){
|
new StateDependent(Winconditions.POINTS, FightState.Ingame){
|
||||||
@Override
|
@Override
|
||||||
public void enable() {
|
public void enable() {
|
||||||
@ -62,6 +61,7 @@ public class WinconditionPoints extends Wincondition implements PrintableWincond
|
|||||||
}
|
}
|
||||||
}.register();
|
}.register();
|
||||||
if(Config.ActiveWinconditions.contains(Winconditions.POINTS)){
|
if(Config.ActiveWinconditions.contains(Winconditions.POINTS)){
|
||||||
|
timeOverCountdown = new StateDependentCountdown(Winconditions.POINTS, FightState.Running, new TimeOverCountdown(this::timeOver));
|
||||||
printableWinconditions.add(this);
|
printableWinconditions.add(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
|
import de.steamwar.fightsystem.Config;
|
||||||
import de.steamwar.fightsystem.countdown.TimeOverCountdown;
|
import de.steamwar.fightsystem.countdown.TimeOverCountdown;
|
||||||
import de.steamwar.fightsystem.states.FightState;
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
import de.steamwar.fightsystem.states.StateDependentCountdown;
|
import de.steamwar.fightsystem.states.StateDependentCountdown;
|
||||||
@ -27,8 +28,10 @@ public class WinconditionTimeout extends Wincondition {
|
|||||||
|
|
||||||
public WinconditionTimeout() {
|
public WinconditionTimeout() {
|
||||||
super("Timeout", "§cDie Zeit ist abgelaufen!");
|
super("Timeout", "§cDie Zeit ist abgelaufen!");
|
||||||
|
if(Config.ActiveWinconditions.contains(Winconditions.TIMEOUT)){
|
||||||
timeOverCountdown = new StateDependentCountdown(Winconditions.TIMEOUT, FightState.Running, new TimeOverCountdown(this::timeOver));
|
timeOverCountdown = new StateDependentCountdown(Winconditions.TIMEOUT, FightState.Running, new TimeOverCountdown(this::timeOver));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void timeOver() {
|
protected void timeOver() {
|
||||||
win(null);
|
win(null);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren