Skip to content
Browse files

Add clear-wave-before-boss option.

  • Loading branch information...
1 parent 7e1b2c2 commit 9cca20aa921da3e6ec8399c543c2bcddd0ce8cc9 @garbagemule garbagemule committed
Showing with 9 additions and 2 deletions.
  1. +1 −0 resources/res/settings.yml
  2. +8 −2 src/com/garbagemule/MobArena/MASpawnThread.java
View
1 resources/res/settings.yml
@@ -4,6 +4,7 @@ protect: true
entry-fee: ''
clear-wave-before-next: false
clear-boss-before-next: false
+clear-wave-before-boss: false
lightning: true
auto-equip-armor: true
soft-restore: false
View
10 src/com/garbagemule/MobArena/MASpawnThread.java
@@ -35,7 +35,7 @@
private MonsterManager monsterManager;
private int playerCount, monsterLimit;
- private boolean waveClear, bossClear;
+ private boolean waveClear, bossClear, preBossClear;
/**
* Create a new monster spawner for the input arena.
@@ -64,6 +64,7 @@ public void reset() {
monsterLimit = arena.getSettings().getInt("monster-limit", 100);
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);
}
public void run() {
@@ -214,10 +215,15 @@ private boolean isWaveClear() {
return false;
}
- // Check for wave clear
+ // Check for wave and pre boss clear
if (waveClear && !monsterManager.getMonsters().isEmpty()) {
return false;
}
+
+ // Check for pre boss clear
+ if (preBossClear && waveManager.getNext().getType() == WaveType.BOSS && !monsterManager.getMonsters().isEmpty()) {
+ return false;
+ }
// Check for final wave
if (!monsterManager.getMonsters().isEmpty() && waveManager.getWaveNumber() == waveManager.getFinalWave()) {

0 comments on commit 9cca20a

Please sign in to comment.
Something went wrong with that request. Please try again.