Add boss name tags.
This commit is contained in:
@@ -179,6 +179,10 @@ public class MASpawnThread implements Runnable
|
|||||||
MABoss boss = monsterManager.addBoss(e, maxHealth);
|
MABoss boss = monsterManager.addBoss(e, maxHealth);
|
||||||
bw.addMABoss(boss);
|
bw.addMABoss(boss);
|
||||||
bw.activateAbilities(arena);
|
bw.activateAbilities(arena);
|
||||||
|
if (bw.getBossName() != null) {
|
||||||
|
e.setCustomName(bw.getBossName());
|
||||||
|
e.setCustomNameVisible(true);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SWARM:
|
case SWARM:
|
||||||
health = (int) (mul < 1D ? e.getMaxHealth() * mul : 1);
|
health = (int) (mul < 1D ? e.getMaxHealth() * mul : 1);
|
||||||
|
|||||||
@@ -230,6 +230,12 @@ public class WaveParser
|
|||||||
|
|
||||||
BossWave result = new BossWave(monster);
|
BossWave result = new BossWave(monster);
|
||||||
|
|
||||||
|
// Check if there's a specific boss name
|
||||||
|
String bossName = config.getString("name");
|
||||||
|
if (bossName != null && !bossName.equals("")) {
|
||||||
|
result.setBossName(bossName);
|
||||||
|
}
|
||||||
|
|
||||||
// Grab the boss health
|
// Grab the boss health
|
||||||
String hlth = config.getString("health");
|
String hlth = config.getString("health");
|
||||||
BossHealth health = BossHealth.fromString(hlth);
|
BossHealth health = BossHealth.fromString(hlth);
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ import com.garbagemule.MobArena.waves.enums.*;
|
|||||||
|
|
||||||
public class BossWave extends AbstractWave
|
public class BossWave extends AbstractWave
|
||||||
{
|
{
|
||||||
|
private String bossName;
|
||||||
|
|
||||||
private MACreature monster;
|
private MACreature monster;
|
||||||
private Set<MABoss> bosses;
|
private Set<MABoss> bosses;
|
||||||
|
|
||||||
@@ -52,6 +54,14 @@ public class BossWave extends AbstractWave
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getBossName() {
|
||||||
|
return bossName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBossName(String bossName) {
|
||||||
|
this.bossName = bossName;
|
||||||
|
}
|
||||||
|
|
||||||
public int getMaxHealth(int playerCount) {
|
public int getMaxHealth(int playerCount) {
|
||||||
if (useHealthMultiplier) {
|
if (useHealthMultiplier) {
|
||||||
return (playerCount + 1) * 20 * healthMultiplier;
|
return (playerCount + 1) * 20 * healthMultiplier;
|
||||||
|
|||||||
Reference in New Issue
Block a user