Examples of BossWave


Examples of com.garbagemule.MobArena.waves.types.BossWave

        if (monster == null) {
            Messenger.warning(WaveError.SINGLE_MONSTER_MISSING.format(name, arena.configName()));
            return null;
        }
       
        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
        String hlth = config.getString("health");
        BossHealth health = BossHealth.fromString(hlth);
        if (health != null) {
            result.setHealth(health);
        } else {
            try {
                int flatHealth;
                if (hlth != null) {
                    flatHealth = Integer.parseInt(hlth);
                } else {
                    flatHealth = config.getInt("health");
                }
                result.setFlatHealth(flatHealth);
            } catch (Exception e) {
                String warning = "Unable to parse health of boss '%s' in arena '%s'. Defaulting to medium. Value was '%s'";
                Messenger.warning(String.format(warning, name, arena.configName(), hlth));
                result.setHealth(BossHealth.MEDIUM);
            }
        }
       
        // And the abilities.
        String ablts = config.getString("abilities");
        if (ablts != null) {
            String[] parts = ablts.split(",");
            for (String ability : parts) {
                Ability a = AbilityManager.getAbility(ability.trim());
                if (a == null) {
                    Messenger.warning(WaveError.BOSS_ABILITY.format(ability.trim(), name, arena.configName()));
                    continue;
                }
               
                result.addBossAbility(a);
            }
        }
       
        // As well as the ability interval and ability announce.
        result.setAbilityInterval(config.getInt("ability-interval", 3) * 20);
        result.setAbilityAnnounce(config.getBoolean("ability-announce", true));
       
        // Rewards!
        String rew = config.getString("reward");
        if (rew != null) {
            ItemStack item = ItemParser.parseItem(rew);
            if (item != null) result.setReward(item);
        }

        // Drops!
        String drp = config.getString("drops");
        List<ItemStack> drops = ItemParser.parseItems(drp);
        result.setDrops(drops);
       
        return result;
    }
View Full Code Here

Examples of com.garbagemule.MobArena.waves.types.BossWave

                e.setHealth(health);

                // Switch on the type.
                switch (w.getType()){
                    case BOSS:
                        BossWave bw = (BossWave) w;
                        double maxHealth = bw.getMaxHealth(playerCount);
                        MABoss boss = monsterManager.addBoss(e, maxHealth);
                        boss.setReward(bw.getReward());
                        boss.setDrops(bw.getDrops());
                        bw.addMABoss(boss);
                        bw.activateAbilities(arena);
                        if (bw.getBossName() != null) {
                            e.setCustomName(bw.getBossName());
                            e.setCustomNameVisible(true);
                        }
                        break;
                    case SWARM:
                        health = (int) (mul < 1D ? e.getMaxHealth() * mul : 1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.