Hit Reactor animation fix + deny spawn points

Fixed reactor sometimes not animating between state changes and
introduced mechanic to deny spawning mobs at spawn points.
This commit is contained in:
ronancpl
2017-04-17 15:44:12 -03:00
parent 6791a3d475
commit c17e4c93a3
16 changed files with 350 additions and 107 deletions
+7 -3
View File
@@ -31,7 +31,7 @@ public class SpawnPoint {
private long nextPossibleSpawn;
private int mobInterval = 5000;
private AtomicInteger spawnedMonsters = new AtomicInteger(0);
private boolean immobile;
private boolean immobile, denySpawn = false;
public SpawnPoint(final MapleMonster monster, Point pos, boolean immobile, int mobTime, int mobInterval, int team) {
this.monster = monster.getId();
@@ -50,11 +50,15 @@ public class SpawnPoint {
}
public void setDenySpawn(boolean val) {
spawnedMonsters.set((val == false) ? 0 : 1);
denySpawn = val;
}
public boolean getDenySpawn() {
return denySpawn;
}
public boolean shouldSpawn() {
if (mobTime < 0 || spawnedMonsters.get() > 0) {
if (denySpawn || mobTime < 0 || spawnedMonsters.get() > 0) {
return false;
}