SteamWar/FightSystem
Archiviert
13
1

Fixt kleinere FightScoreboard und Punktesystemprobleme #77

Zusammengeführt
Lixfel hat 2 Commits von RelativePercentFix nach master 2019-12-24 12:52:06 +01:00 zusammengeführt
4 geänderte Dateien mit 23 neuen und 18 gelöschten Zeilen

Datei anzeigen

@ -113,6 +113,9 @@ public class FightSystem extends JavaPlugin {
new WinconditionAllDead(); new WinconditionAllDead();
new WinconditionCaptainDead(); new WinconditionCaptainDead();
new WinconditionWaterTechKO(); new WinconditionWaterTechKO();
new WinconditionPercentSystem();
new WinconditionRelativePercent();
new WinconditionPoints();
if(Config.event()){ if(Config.event()){
new EventTeamOffWincondition(); new EventTeamOffWincondition();
@ -127,12 +130,9 @@ public class FightSystem extends JavaPlugin {
setAllPlayersGM(GameMode.SURVIVAL); setAllPlayersGM(GameMode.SURVIVAL);
new WinconditionTechKO();
new WinconditionTimeout(); new WinconditionTimeout();
new WinconditionEntern(); new WinconditionEntern();
new WinconditionPercentSystem(); new WinconditionTechKO();
new WinconditionRelativePercent();
new WinconditionPoints();
WaterRemover.init(); WaterRemover.init();

Datei anzeigen

@ -3,6 +3,7 @@ package de.steamwar.fightsystem.utils;
import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.Config;
import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.fight.Fight; import de.steamwar.fightsystem.fight.Fight;
import de.steamwar.fightsystem.fight.FightState;
import de.steamwar.fightsystem.fight.FightTeam; import de.steamwar.fightsystem.fight.FightTeam;
import de.steamwar.fightsystem.winconditions.WinconditionPercentSystem; import de.steamwar.fightsystem.winconditions.WinconditionPercentSystem;
import de.steamwar.fightsystem.winconditions.WinconditionPoints; import de.steamwar.fightsystem.winconditions.WinconditionPoints;
@ -62,7 +63,7 @@ public class FightScoreboard {
private static void generalScoreboard(){ private static void generalScoreboard(){
objective.setDisplayName("§6Kampf"); objective.setDisplayName("§6Kampf");
if (Config.Timeout) { if (Config.Timeout || Config.Points) {
int fightTime = FightSystem.getFightTime(); int fightTime = FightSystem.getFightTime();
if (fightTime >= 60) if (fightTime >= 60)
objective.getScore("§7Zeit: §a" + fightTime / 60 + "m " + fightTime % 60 + "s").setScore(3); objective.getScore("§7Zeit: §a" + fightTime / 60 + "m " + fightTime % 60 + "s").setScore(3);
@ -71,6 +72,8 @@ public class FightScoreboard {
} }
if (Config.Entern) if (Config.Entern)
objective.getScore("§7Entern: " + (FightSystem.isEntern() ? "§aja" : "§cnein")).setScore(2); objective.getScore("§7Entern: " + (FightSystem.isEntern() ? "§aja" : "§cnein")).setScore(2);
if(FightSystem.getFightState() == FightState.RUNNING){
if (Config.PercentSystem){ if (Config.PercentSystem){
objective.getScore(Fight.getRedTeam().getPrefix() + "Schaden: " + (Math.round(100.0 * WinconditionPercentSystem.getRedPercent()) / 100.0) + "%").setScore(1); objective.getScore(Fight.getRedTeam().getPrefix() + "Schaden: " + (Math.round(100.0 * WinconditionPercentSystem.getRedPercent()) / 100.0) + "%").setScore(1);
objective.getScore(Fight.getBlueTeam().getPrefix() + "Schaden: " + (Math.round(100.0 * WinconditionPercentSystem.getBluePercent()) / 100.0) + "%").setScore(0); objective.getScore(Fight.getBlueTeam().getPrefix() + "Schaden: " + (Math.round(100.0 * WinconditionPercentSystem.getBluePercent()) / 100.0) + "%").setScore(0);
@ -85,6 +88,7 @@ public class FightScoreboard {
objective.getScore(Fight.getBlueTeam().getPrefix() + "Punkte: " + WinconditionPoints.getBlue().getPoints()).setScore(0); objective.getScore(Fight.getBlueTeam().getPrefix() + "Punkte: " + WinconditionPoints.getBlue().getPoints()).setScore(0);
} }
} }
}
private static FightTeam getIndexDisplay() { private static FightTeam getIndexDisplay() {
index++; index++;

Datei anzeigen

@ -46,7 +46,7 @@ public class WinconditionPoints extends PlayerWincondition {
if(fightTeam.isPlayerLeader(player)) { if(fightTeam.isPlayerLeader(player)) {
enemy.points += 500; enemy.points += 500;
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Leader von " + fightTeam.getPrefix() + fightTeam.getColoredName() + message); Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Leader von " + fightTeam.getPrefix() + fightTeam.getColoredName() + message);
FightSystem.setSpectateState(Fight.getOpposite(fightTeam)); fightEnds();
}else if(fightTeam.getPlayers().size() <= 5) }else if(fightTeam.getPlayers().size() <= 5)
enemy.points += 300; enemy.points += 300;
else else

Datei anzeigen

@ -51,6 +51,7 @@ public class WinconditionRelativePercent{
TeamPercent(FightTeam team){ TeamPercent(FightTeam team){
this.team = team; this.team = team;
this.blockCount = currentBlocks(); this.blockCount = currentBlocks();
this.currentBlocks = blockCount;
Bukkit.getScheduler().runTaskTimerAsynchronously(FightSystem.getPlugin(), () -> { Bukkit.getScheduler().runTaskTimerAsynchronously(FightSystem.getPlugin(), () -> {
currentBlocks = currentBlocks(); currentBlocks = currentBlocks();