Added final-wave per-arena setting.

This commit is contained in:
Garbage Mule 2011-10-25 17:31:48 +02:00
parent 9161bead55
commit c9b9587ce9
4 changed files with 11 additions and 2 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
name: MobArena
main: com.garbagemule.MobArena.MobArena
version: 0.94.3.23
version: 0.94.3.24
softdepend: [Spout,Permissions,MultiVerse,XcraftGate,Towny,Heroes,MagicSpells]
commands:
ma:

View File

@ -76,7 +76,7 @@ public class Arena
protected String logging;
// Wave/reward/entryfee fields
protected int spawnTaskId, sheepTaskId, waveDelay, waveInterval, specialModulo, spawnMonstersInt, maxIdleTime;
protected int spawnTaskId, sheepTaskId, waveDelay, waveInterval, specialModulo, spawnMonstersInt, maxIdleTime, finalWave;
protected MASpawnThread spawnThread;
protected Map<Integer,List<ItemStack>> everyWaveMap, afterWaveMap;
protected Map<Player,String> classMap;
@ -901,6 +901,7 @@ public class Arena
waveInterval = config.getInt(arenaPath + "wave-interval", 20) * 20;
specialModulo = config.getInt(arenaPath + "special-modulo", 4);
maxIdleTime = config.getInt(arenaPath + "max-idle-time", 0) * 20;
finalWave = config.getInt(arenaPath + "final-wave", 0);
everyWaveMap = MAUtils.getArenaRewardMap(config, configName, "every");
afterWaveMap = MAUtils.getArenaRewardMap(config, configName, "after");

View File

@ -74,6 +74,14 @@ public class MASpawnThread implements Runnable
// Detonate creepers if needed
detonateCreepers(arena.detCreepers);
// Check if this is the final wave, in which case, end instead of spawn
if (wave > 1 && wave == arena.finalWave)
{
for (Player p : arena.arenaPlayers)
arena.playerDeath(p);
return;
}
// Find the wave to spawn
spawnWave(wave);