Fix wincondition messages #249
@ -20,19 +20,22 @@
|
|||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
import de.steamwar.fightsystem.ArenaMode;
|
import de.steamwar.fightsystem.ArenaMode;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
import de.steamwar.fightsystem.states.FightState;
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
import de.steamwar.fightsystem.states.StateDependent;
|
import de.steamwar.fightsystem.states.StateDependent;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
public class EventTeamOffWincondition extends Wincondition{
|
public class EventTeamOffWincondition extends Wincondition{
|
||||||
|
|
||||||
public EventTeamOffWincondition(){
|
public EventTeamOffWincondition(){
|
||||||
super("TeamOffline", "§cDas Team ", " §cist offline!", "§cBeide Teams sind offline!");
|
super("TeamOffline");
|
||||||
new StateDependent(ArenaMode.Event, FightState.PreRunning) {
|
new StateDependent(ArenaMode.Event, FightState.PreRunning) {
|
||||||
@Override
|
@Override
|
||||||
public void enable() {
|
public void enable() {
|
||||||
if(Fight.getBlueTeam().allPlayersOut() && Fight.getRedTeam().allPlayersOut()){
|
if(Fight.getBlueTeam().allPlayersOut() && Fight.getRedTeam().allPlayersOut()){
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cBeide Teams sind offline!");
|
||||||
win(null);
|
win(null);
|
||||||
}else{
|
}else{
|
||||||
teamOff(Fight.getBlueTeam());
|
teamOff(Fight.getBlueTeam());
|
||||||
@ -49,6 +52,7 @@ public class EventTeamOffWincondition extends Wincondition{
|
|||||||
|
|
||||||
private void teamOff(FightTeam team){
|
private void teamOff(FightTeam team){
|
||||||
if(team.allPlayersOut()){
|
if(team.allPlayersOut()){
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDas Team " + team.getColoredName() + " §cist offline!");
|
||||||
win(Fight.getOpposite(team));
|
win(Fight.getOpposite(team));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,10 +20,12 @@
|
|||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
import de.steamwar.fightsystem.ArenaMode;
|
import de.steamwar.fightsystem.ArenaMode;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
import de.steamwar.fightsystem.states.FightState;
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -32,7 +34,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
public class RankedPlayerLeftWincondition extends Wincondition implements Listener {
|
public class RankedPlayerLeftWincondition extends Wincondition implements Listener {
|
||||||
|
|
||||||
public RankedPlayerLeftWincondition(){
|
public RankedPlayerLeftWincondition(){
|
||||||
super("LeaderQuit", "§cDer Leader von ", " §chat den Kampf verlassen!");
|
super("LeaderQuit");
|
||||||
new StateDependentListener(ArenaMode.Ranked, FightState.Setup, this);
|
new StateDependentListener(ArenaMode.Ranked, FightState.Setup, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,6 +46,7 @@ public class RankedPlayerLeftWincondition extends Wincondition implements Listen
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(team.isPlayerLeader(player)) {
|
if(team.isPlayerLeader(player)) {
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Leader von " + team.getColoredName() + " §chat den Kampf verlassen!");
|
||||||
win(Fight.getOpposite(team));
|
win(Fight.getOpposite(team));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ import de.steamwar.fightsystem.countdown.Countdown;
|
|||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
import de.steamwar.fightsystem.states.StateDependentCountdown;
|
import de.steamwar.fightsystem.states.StateDependentCountdown;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -37,23 +36,9 @@ public abstract class Wincondition {
|
|||||||
protected static final List<PrintableWincondition> printableWinconditions = new ArrayList<>();
|
protected static final List<PrintableWincondition> printableWinconditions = new ArrayList<>();
|
||||||
|
|
||||||
private final String windescription;
|
private final String windescription;
|
||||||
private final String preteammessage;
|
|
||||||
private final String postteammessage;
|
|
||||||
private final String tiemessage;
|
|
||||||
|
|
||||||
protected Wincondition(String windescription, String tiemessage) {
|
protected Wincondition(String windescription) {
|
||||||
this(windescription, null, null, tiemessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Wincondition(String windescription, String preteammessage, String postteammessage) {
|
|
||||||
this(windescription, preteammessage, postteammessage, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Wincondition(String windescription, String preteammessage, String postteammessage, String tiemessage) {
|
|
||||||
this.windescription = windescription;
|
this.windescription = windescription;
|
||||||
this.preteammessage = preteammessage;
|
|
||||||
this.tiemessage = tiemessage;
|
|
||||||
this.postteammessage = postteammessage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Countdown getTimeOverCountdown(){
|
public static Countdown getTimeOverCountdown(){
|
||||||
@ -62,17 +47,7 @@ public abstract class Wincondition {
|
|||||||
return timeOverCountdown.getCountdown();
|
return timeOverCountdown.getCountdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void win(FightTeam team, String postteammessage){
|
|
||||||
Bukkit.broadcastMessage(FightSystem.PREFIX + tiemessage + team.getColoredName() + postteammessage);
|
|
||||||
FightSystem.setSpectateState(team, windescription);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void win(FightTeam team){
|
protected void win(FightTeam team){
|
||||||
if(team != null){
|
|
||||||
Bukkit.broadcastMessage(FightSystem.PREFIX + preteammessage + team.getColoredName() + postteammessage);
|
|
||||||
}else{
|
|
||||||
Bukkit.broadcastMessage(FightSystem.PREFIX + tiemessage);
|
|
||||||
}
|
|
||||||
FightSystem.setSpectateState(team, windescription);
|
FightSystem.setSpectateState(team, windescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,10 +19,12 @@
|
|||||||
|
|
||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
import de.steamwar.fightsystem.states.FightState;
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -32,7 +34,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
public class WinconditionAllDead extends Wincondition implements Listener {
|
public class WinconditionAllDead extends Wincondition implements Listener {
|
||||||
|
|
||||||
public WinconditionAllDead(){
|
public WinconditionAllDead(){
|
||||||
super("AllDead", "§cDer letzte Spieler aus ");
|
super("AllDead");
|
||||||
new StateDependentListener(Winconditions.ALL_DEAD, FightState.Ingame, this);
|
new StateDependentListener(Winconditions.ALL_DEAD, FightState.Ingame, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +54,8 @@ public class WinconditionAllDead extends Wincondition implements Listener {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(team.allPlayersOut()) {
|
if(team.allPlayersOut()) {
|
||||||
win(Fight.getOpposite(team), message);
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer letzte Spieler aus " + team.getColoredName() + message);
|
||||||
|
win(Fight.getOpposite(team));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,10 +19,12 @@
|
|||||||
|
|
||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
import de.steamwar.fightsystem.states.FightState;
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -32,7 +34,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
public class WinconditionCaptainDead extends Wincondition implements Listener {
|
public class WinconditionCaptainDead extends Wincondition implements Listener {
|
||||||
|
|
||||||
public WinconditionCaptainDead(){
|
public WinconditionCaptainDead(){
|
||||||
super("LeaderDead", "§cDer Leader von ");
|
super("LeaderDead");
|
||||||
new StateDependentListener(Winconditions.CAPTAIN_DEAD, FightState.Ingame, this);
|
new StateDependentListener(Winconditions.CAPTAIN_DEAD, FightState.Ingame, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +54,8 @@ public class WinconditionCaptainDead extends Wincondition implements Listener {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(team.isPlayerLeader(player)) {
|
if(team.isPlayerLeader(player)) {
|
||||||
win(Fight.getOpposite(team), message);
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Leader von " + team.getColoredName() + message);
|
||||||
|
win(Fight.getOpposite(team));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,16 +20,17 @@
|
|||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
import de.steamwar.fightsystem.Config;
|
import de.steamwar.fightsystem.Config;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
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.states.FightState;
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
import de.steamwar.fightsystem.states.StateDependentCountdown;
|
import de.steamwar.fightsystem.states.StateDependentCountdown;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
public class WinconditionHeartRatioTimeout extends Wincondition {
|
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");
|
||||||
if(Config.ActiveWinconditions.contains(Winconditions.HEART_RATIO_TIMEOUT)){
|
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));
|
||||||
}
|
}
|
||||||
@ -39,12 +40,15 @@ public class WinconditionHeartRatioTimeout extends Wincondition {
|
|||||||
double blueHeartRatio = Fight.getBlueTeam().getHeartRatio();
|
double blueHeartRatio = Fight.getBlueTeam().getHeartRatio();
|
||||||
double redHeartRatio = Fight.getRedTeam().getHeartRatio();
|
double redHeartRatio = Fight.getRedTeam().getHeartRatio();
|
||||||
|
|
||||||
FightTeam team = null;
|
if(blueHeartRatio > redHeartRatio) {
|
||||||
if(blueHeartRatio > redHeartRatio)
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDie Zeit ist abgelaufen, und Team " + Fight.getBlueTeam().getColoredName() + " §chatte mehr verbleibende Leben!");
|
||||||
team = Fight.getBlueTeam();
|
win(Fight.getBlueTeam());
|
||||||
else if(blueHeartRatio < redHeartRatio)
|
}else if(blueHeartRatio < redHeartRatio){
|
||||||
team = Fight.getRedTeam();
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDie Zeit ist abgelaufen, und Team " + Fight.getRedTeam().getColoredName() + " §chatte mehr verbleibende Leben!");
|
||||||
|
win(Fight.getRedTeam());
|
||||||
win(team);
|
}else{
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDie Zeit ist abgelaufen, und beide Teams hatten die gleiche Anzahl an verbleibenden Leben!");
|
||||||
|
win(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,10 +20,12 @@
|
|||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
import de.steamwar.fightsystem.Config;
|
import de.steamwar.fightsystem.Config;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
import de.steamwar.fightsystem.states.FightState;
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
@ -36,7 +38,7 @@ public class WinconditionPercentSystem extends Wincondition implements Listener,
|
|||||||
private final Map<FightTeam, TeamPercent> teamMap = new HashMap<>();
|
private final Map<FightTeam, TeamPercent> teamMap = new HashMap<>();
|
||||||
|
|
||||||
public WinconditionPercentSystem() {
|
public WinconditionPercentSystem() {
|
||||||
super("Percent", "§cTeam ", " §chat den Gegnern");
|
super("Percent");
|
||||||
teamMap.put(Fight.getBlueTeam(), new TeamPercent(Fight.getBlueTeam()));
|
teamMap.put(Fight.getBlueTeam(), new TeamPercent(Fight.getBlueTeam()));
|
||||||
teamMap.put(Fight.getRedTeam(), new TeamPercent(Fight.getRedTeam()));
|
teamMap.put(Fight.getRedTeam(), new TeamPercent(Fight.getRedTeam()));
|
||||||
|
|
||||||
@ -82,6 +84,7 @@ public class WinconditionPercentSystem extends Wincondition implements Listener,
|
|||||||
destroyedBlocks += event.blockList().size();
|
destroyedBlocks += event.blockList().size();
|
||||||
percent = (double)destroyedBlocks * 100 / volume;
|
percent = (double)destroyedBlocks * 100 / volume;
|
||||||
if(percent >= Config.PercentWin) {
|
if(percent >= Config.PercentWin) {
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cTeam " + team.getColoredName() + " §chat zu viel Schaden erlitten!");
|
||||||
win(Fight.getOpposite(team));
|
win(Fight.getOpposite(team));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,16 +20,17 @@
|
|||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
import de.steamwar.fightsystem.Config;
|
import de.steamwar.fightsystem.Config;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
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.states.FightState;
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
import de.steamwar.fightsystem.states.StateDependentCountdown;
|
import de.steamwar.fightsystem.states.StateDependentCountdown;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
public class WinconditionPercentTimeout extends Wincondition {
|
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");
|
||||||
if(Config.ActiveWinconditions.contains(Winconditions.PERCENT_TIMEOUT)) {
|
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));
|
||||||
}
|
}
|
||||||
@ -39,11 +40,15 @@ public class WinconditionPercentTimeout extends Wincondition {
|
|||||||
double bluePercent = Wincondition.percentWincondition.getPercent(Fight.getBlueTeam());
|
double bluePercent = Wincondition.percentWincondition.getPercent(Fight.getBlueTeam());
|
||||||
double redPercent = Wincondition.percentWincondition.getPercent(Fight.getRedTeam());
|
double redPercent = Wincondition.percentWincondition.getPercent(Fight.getRedTeam());
|
||||||
|
|
||||||
FightTeam team = null;
|
if(bluePercent > redPercent) {
|
||||||
if(bluePercent > redPercent)
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDie Zeit ist abgelaufen, und Team " + Fight.getRedTeam().getColoredName() + " §chat weniger Schaden erlitten!");
|
||||||
team = Fight.getRedTeam();
|
win(Fight.getRedTeam());
|
||||||
else if(bluePercent < redPercent)
|
}else if(bluePercent < redPercent){
|
||||||
team = Fight.getBlueTeam();
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDie Zeit ist abgelaufen, und Team " + Fight.getBlueTeam().getColoredName() + " §chat weniger Schaden erlitten!");
|
||||||
win(team);
|
win(Fight.getBlueTeam());
|
||||||
|
}else{
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDie Zeit ist abgelaufen, und beide Teams hatten gleichen Schaden erlitten!");
|
||||||
|
win(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ public class WinconditionPoints extends Wincondition implements PrintableWincond
|
|||||||
private final Map<FightTeam, TeamPoints> teamMap = new HashMap<>();
|
private final Map<FightTeam, TeamPoints> teamMap = new HashMap<>();
|
||||||
|
|
||||||
public WinconditionPoints(){
|
public WinconditionPoints(){
|
||||||
super("Points", "§cDas Team ", " §chat mehr Punkte!", "§cBeide Teams haben gleich viele Punkte!");
|
super("Points");
|
||||||
|
|
||||||
teamMap.put(Fight.getBlueTeam(), new TeamPoints(Fight.getBlueTeam()));
|
teamMap.put(Fight.getBlueTeam(), new TeamPoints(Fight.getBlueTeam()));
|
||||||
teamMap.put(Fight.getRedTeam(), new TeamPoints(Fight.getRedTeam()));
|
teamMap.put(Fight.getRedTeam(), new TeamPoints(Fight.getRedTeam()));
|
||||||
@ -70,13 +70,16 @@ public class WinconditionPoints extends Wincondition implements PrintableWincond
|
|||||||
int redPoints = teamMap.get(Fight.getRedTeam()).getPoints();
|
int redPoints = teamMap.get(Fight.getRedTeam()).getPoints();
|
||||||
int bluePoints = teamMap.get(Fight.getBlueTeam()).getPoints();
|
int bluePoints = teamMap.get(Fight.getBlueTeam()).getPoints();
|
||||||
|
|
||||||
FightTeam team = null;
|
if(bluePoints < redPoints) {
|
||||||
if(redPoints > bluePoints)
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDas Team " + Fight.getRedTeam().getColoredName() + " §chat mehr Punkte!");
|
||||||
team = Fight.getRedTeam();
|
win(Fight.getRedTeam());
|
||||||
else if(redPoints < bluePoints)
|
}else if(bluePoints > redPoints){
|
||||||
team = Fight.getBlueTeam();
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDas Team " + Fight.getBlueTeam().getColoredName() + " §chat mehr Punkte!");
|
||||||
|
win(Fight.getBlueTeam());
|
||||||
win(team);
|
}else{
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cBeide Teams haben gleich viele Punkte!");
|
||||||
|
win(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
import de.steamwar.fightsystem.Config;
|
import de.steamwar.fightsystem.Config;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
import de.steamwar.fightsystem.states.FightState;
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
@ -40,7 +41,7 @@ public class WinconditionPumpkinTechKO extends Wincondition implements Printable
|
|||||||
private final Map<FightTeam, TeamPumpkin> teamMap = new HashMap<>();
|
private final Map<FightTeam, TeamPumpkin> teamMap = new HashMap<>();
|
||||||
|
|
||||||
public WinconditionPumpkinTechKO(){
|
public WinconditionPumpkinTechKO(){
|
||||||
super("PumpkinTechKO", "§cDas Team ", " §cist Tech K.O.!");
|
super("PumpkinTechKO");
|
||||||
teamMap.put(Fight.getRedTeam(), new TeamPumpkin(Fight.getRedTeam()));
|
teamMap.put(Fight.getRedTeam(), new TeamPumpkin(Fight.getRedTeam()));
|
||||||
teamMap.put(Fight.getBlueTeam(), new TeamPumpkin(Fight.getBlueTeam()));
|
teamMap.put(Fight.getBlueTeam(), new TeamPumpkin(Fight.getBlueTeam()));
|
||||||
|
|
||||||
@ -76,6 +77,7 @@ public class WinconditionPumpkinTechKO extends Wincondition implements Printable
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(pumpkins == 0) {
|
if(pumpkins == 0) {
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDas Team " + team.getColoredName() + " §cist Tech K.O.!");
|
||||||
win(Fight.getOpposite(team));
|
win(Fight.getOpposite(team));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public class WinconditionRelativePercent extends Wincondition implements Printab
|
|||||||
private final Map<FightTeam, TeamPercent> teamMap = new HashMap<>();
|
private final Map<FightTeam, TeamPercent> teamMap = new HashMap<>();
|
||||||
|
|
||||||
public WinconditionRelativePercent(){
|
public WinconditionRelativePercent(){
|
||||||
super("RelativePercent", null);
|
super("RelativePercent");
|
||||||
teamMap.put(Fight.getBlueTeam(), new TeamPercent(Fight.getBlueTeam()));
|
teamMap.put(Fight.getBlueTeam(), new TeamPercent(Fight.getBlueTeam()));
|
||||||
teamMap.put(Fight.getRedTeam(), new TeamPercent(Fight.getRedTeam()));
|
teamMap.put(Fight.getRedTeam(), new TeamPercent(Fight.getRedTeam()));
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ public class WinconditionRelativePercent extends Wincondition implements Printab
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(getPercent() >= Config.PercentWin){
|
if(getPercent() >= Config.PercentWin){
|
||||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Schiff von " + team.getColoredName() + " §cwurde zu stark beschädigt!");
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cTeam " + team.getColoredName() + " §chat zu viel Schaden erlitten!");
|
||||||
FightSystem.setSpectateState(Fight.getOpposite(team), "RelativePercent");
|
FightSystem.setSpectateState(Fight.getOpposite(team), "RelativePercent");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
import de.steamwar.fightsystem.Config;
|
import de.steamwar.fightsystem.Config;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
import de.steamwar.fightsystem.countdown.Countdown;
|
import de.steamwar.fightsystem.countdown.Countdown;
|
||||||
import de.steamwar.fightsystem.countdown.SWSound;
|
import de.steamwar.fightsystem.countdown.SWSound;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
@ -49,7 +50,7 @@ public class WinconditionTimeTechKO extends Wincondition {
|
|||||||
* Works only for z-Axis fight direction for performance reasons
|
* Works only for z-Axis fight direction for performance reasons
|
||||||
*/
|
*/
|
||||||
public WinconditionTimeTechKO(){
|
public WinconditionTimeTechKO(){
|
||||||
super("TechKO", "", " §chat den Gegner Tech K.O. gesetzt!");
|
super("TechKO");
|
||||||
|
|
||||||
if(Config.BlueToRedZ > 0) {
|
if(Config.BlueToRedZ > 0) {
|
||||||
smallerZteam = Fight.getBlueTeam();
|
smallerZteam = Fight.getBlueTeam();
|
||||||
@ -120,6 +121,7 @@ public class WinconditionTimeTechKO extends Wincondition {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void countdownFinished() {
|
public void countdownFinished() {
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cTeam " + team.getColoredName() + " §chat zu lange nicht geschossen!");
|
||||||
win(Fight.getOpposite(team));
|
win(Fight.getOpposite(team));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,20 +20,23 @@
|
|||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
import de.steamwar.fightsystem.Config;
|
import de.steamwar.fightsystem.Config;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
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;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
public class WinconditionTimeout extends Wincondition {
|
public class WinconditionTimeout extends Wincondition {
|
||||||
|
|
||||||
public WinconditionTimeout() {
|
public WinconditionTimeout() {
|
||||||
super("Timeout", "§cDie Zeit ist abgelaufen!");
|
super("Timeout");
|
||||||
if(Config.ActiveWinconditions.contains(Winconditions.TIMEOUT)){
|
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() {
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDie Zeit ist abgelaufen!");
|
||||||
win(null);
|
win(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
package de.steamwar.fightsystem.winconditions;
|
package de.steamwar.fightsystem.winconditions;
|
||||||
|
|
||||||
import de.steamwar.fightsystem.Config;
|
import de.steamwar.fightsystem.Config;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
import de.steamwar.fightsystem.fight.Fight;
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
import de.steamwar.fightsystem.fight.FightTeam;
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
import de.steamwar.fightsystem.listener.WaterRemover;
|
import de.steamwar.fightsystem.listener.WaterRemover;
|
||||||
@ -38,7 +39,7 @@ public class WinconditionWaterTechKO extends Wincondition implements PrintableWi
|
|||||||
private final Map<FightTeam, TeamWater> teamMap = new HashMap<>();
|
private final Map<FightTeam, TeamWater> teamMap = new HashMap<>();
|
||||||
|
|
||||||
public WinconditionWaterTechKO() {
|
public WinconditionWaterTechKO() {
|
||||||
super("WaterTechKO", "§cDas Team ", " §chat den Gegner Tech K.O. gesetzt!");
|
super("WaterTechKO");
|
||||||
teamMap.put(Fight.getBlueTeam(), new TeamWater(Fight.getBlueTeam()));
|
teamMap.put(Fight.getBlueTeam(), new TeamWater(Fight.getBlueTeam()));
|
||||||
teamMap.put(Fight.getRedTeam(), new TeamWater(Fight.getRedTeam()));
|
teamMap.put(Fight.getRedTeam(), new TeamWater(Fight.getRedTeam()));
|
||||||
|
|
||||||
@ -73,6 +74,7 @@ public class WinconditionWaterTechKO extends Wincondition implements PrintableWi
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(water == 0){
|
if(water == 0){
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cTeam " + team.getColoredName() + " §cwurde Tech K.O. gesetzt!");
|
||||||
win(Fight.getOpposite(team));
|
win(Fight.getOpposite(team));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren