Adding PreSchemPaste countdown
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
9f4769594e
Commit
5e85488d80
@ -18,11 +18,14 @@ public class Config {
|
|||||||
|
|
||||||
private Config(){}
|
private Config(){}
|
||||||
|
|
||||||
//Fight sequence durations
|
//Fight sequence
|
||||||
public static final int NoPlayerOnlineDuration;
|
public static final int NoPlayerOnlineDuration;
|
||||||
|
public static final int PreSchemPasteDuration;
|
||||||
public static final int SetupDuration;
|
public static final int SetupDuration;
|
||||||
public static final int PreFightDuration;
|
public static final int PreFightDuration;
|
||||||
|
public static final int EnterPhaseBegin;
|
||||||
public static final int SpectatorDuration;
|
public static final int SpectatorDuration;
|
||||||
|
public static final boolean Entern;
|
||||||
|
|
||||||
//arena parameter
|
//arena parameter
|
||||||
public static final int SchemsizeX;
|
public static final int SchemsizeX;
|
||||||
@ -82,14 +85,12 @@ public class Config {
|
|||||||
public static final boolean PercentSystem;
|
public static final boolean PercentSystem;
|
||||||
public static final boolean RelativePercent;
|
public static final boolean RelativePercent;
|
||||||
public static final boolean Points;
|
public static final boolean Points;
|
||||||
public static final boolean Entern;
|
|
||||||
public static final boolean TechKO;
|
public static final boolean TechKO;
|
||||||
public static final boolean WaterTechKO;
|
public static final boolean WaterTechKO;
|
||||||
public static final boolean PumpkinTechKO;
|
public static final boolean PumpkinTechKO;
|
||||||
|
|
||||||
//win condition parameters
|
//win condition parameters
|
||||||
public static final int TimeoutTime;
|
public static final int TimeoutTime;
|
||||||
public static final int EnterPhaseBegin;
|
|
||||||
public static final double PercentWin;
|
public static final double PercentWin;
|
||||||
public static final List<String> IgnoredBlocks;
|
public static final List<String> IgnoredBlocks;
|
||||||
|
|
||||||
@ -126,6 +127,7 @@ public class Config {
|
|||||||
FileConfiguration worldconfig = YamlConfiguration.loadConfiguration(worldConfigFile);
|
FileConfiguration worldconfig = YamlConfiguration.loadConfiguration(worldConfigFile);
|
||||||
|
|
||||||
NoPlayerOnlineDuration = config.getInt("Times.NoPlayersOnlineDuration");
|
NoPlayerOnlineDuration = config.getInt("Times.NoPlayersOnlineDuration");
|
||||||
|
PreSchemPasteDuration = config.getInt("Times.PreSchemPasteDuration");
|
||||||
SetupDuration = config.getInt("Times.SetupDuration");
|
SetupDuration = config.getInt("Times.SetupDuration");
|
||||||
PreFightDuration = config.getInt("Times.PreFightDuration");
|
PreFightDuration = config.getInt("Times.PreFightDuration");
|
||||||
SpectatorDuration = config.getInt("Times.SpectatorDuration");
|
SpectatorDuration = config.getInt("Times.SpectatorDuration");
|
||||||
|
@ -108,7 +108,7 @@ public class FightSystem extends JavaPlugin {
|
|||||||
throw new SecurityException(fightState.name());
|
throw new SecurityException(fightState.name());
|
||||||
setFightState(FightState.PRE_SCHEM_SETUP);
|
setFightState(FightState.PRE_SCHEM_SETUP);
|
||||||
|
|
||||||
mainCountdown = new SetupOverCountdown();
|
mainCountdown = new PreSchemPasteCountdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setPostSchemState() {
|
public static void setPostSchemState() {
|
||||||
@ -275,8 +275,10 @@ public class FightSystem extends JavaPlugin {
|
|||||||
|
|
||||||
private static void setFightState(FightState state){
|
private static void setFightState(FightState state){
|
||||||
fightState = state;
|
fightState = state;
|
||||||
if(mainCountdown != null)
|
if(mainCountdown != null){
|
||||||
mainCountdown.disable();
|
mainCountdown.disable();
|
||||||
|
mainCountdown = null;
|
||||||
|
}
|
||||||
postStateChange();
|
postStateChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
package de.steamwar.fightsystem.countdown;
|
||||||
|
|
||||||
|
import de.steamwar.fightsystem.Config;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
|
import de.steamwar.fightsystem.fight.FightTeam;
|
||||||
|
|
||||||
|
public class PreSchemPasteCountdown extends Countdown {
|
||||||
|
|
||||||
|
public PreSchemPasteCountdown() {
|
||||||
|
super(Config.PreSchemPasteDuration, SWSound.BLOCK_NOTE_PLING, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
String countdownCounting() {
|
||||||
|
return "bis eine Public-Schematic gewählt wird!";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
void countdownFinished() {
|
||||||
|
checkTeam(Fight.getBlueTeam());
|
||||||
|
checkTeam(Fight.getRedTeam());
|
||||||
|
FightSystem.setPostSchemState();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkTeam(FightTeam team){
|
||||||
|
if(!team.hasSchematic())
|
||||||
|
team.pasteDummy();
|
||||||
|
}
|
||||||
|
}
|
@ -271,6 +271,9 @@ public class FightTeam implements IFightTeam{
|
|||||||
|
|
||||||
schematic = publics.get(new Random().nextInt(publics.size()));
|
schematic = publics.get(new Random().nextInt(publics.size()));
|
||||||
pasteSchematic();
|
pasteSchematic();
|
||||||
|
|
||||||
|
if(!Config.test() && leader != null)
|
||||||
|
leader.getPlayer().getInventory().clear(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSchematic(Schematic schematic){
|
public void setSchematic(Schematic schematic){
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren