Add per-arena option: display-waves-as-level

If true, this option will cause wave numbers to be displayed as the
players' level to aid in wave tracking. It does NOT replace the
announcements, which can still be disabled by putting blank values
in the announcements-file.
This commit is contained in:
Andreas Troelsen 2013-02-26 20:12:58 +01:00
parent 68d0c51492
commit ef3b1b42cc
2 changed files with 11 additions and 1 deletions

View File

@ -34,3 +34,4 @@ player-time-in-arena: world
auto-ignite-tnt: false
auto-start-timer: 0
use-class-chests: false
display-waves-as-level: false

View File

@ -35,7 +35,7 @@ public class MASpawnThread implements Runnable
private MonsterManager monsterManager;
private int playerCount, monsterLimit;
private boolean waveClear, bossClear, preBossClear;
private boolean waveClear, bossClear, preBossClear, wavesAsLevel;
/**
* Create a new monster spawner for the input arena.
@ -65,6 +65,7 @@ public class MASpawnThread implements Runnable
waveClear = arena.getSettings().getBoolean("clear-wave-before-next", false);
bossClear = arena.getSettings().getBoolean("clear-boss-before-next", false);
preBossClear = arena.getSettings().getBoolean("clear-wave-before-boss", false);
wavesAsLevel = arena.getSettings().getBoolean("display-waves-as-level", false);
}
public void run() {
@ -126,6 +127,14 @@ public class MASpawnThread implements Runnable
Wave w = waveManager.next();
w.announce(arena, wave);
// Set the players' level to the wave number
if (wavesAsLevel) {
for (Player p : arena.getPlayersInArena()) {
p.setLevel(wave);
p.setExp(0.0f);
}
}
if (w.getType() == WaveType.UPGRADE) {
handleUpgradeWave(w);