Search in sources :

Example 1 with PassiveSkill

use of com.herocraftonline.heroes.characters.skill.PassiveSkill in project MagicPlugin by elBukkit.

the class HeroesSkillSpell method addLore.

@Override
public void addLore(Messages messages, Mage mage, com.elmakers.mine.bukkit.api.wand.Wand wand, List<String> lore) {
    if (mage == null || !mage.isPlayer())
        return;
    Hero hero = heroes.getHero(mage.getPlayer());
    if (hero == null)
        return;
    if (skill instanceof PassiveSkill) {
        lore.add(messages.get("skills.passive_description", "Passive"));
    }
    int level = SkillConfigManager.getUseSetting(hero, skill, SkillSetting.LEVEL, 1, true);
    String levelDescription = controller.getMessages().get("spell.level_description").replace("$level", Integer.toString(level));
    if (levelDescription != null && levelDescription.length() > 0) {
        lore.add(ChatColor.GOLD + levelDescription);
    }
    String description = getDescription();
    if (description == null || description.isEmpty()) {
        description = skill.getDescription(hero);
    }
    if (description != null && description.length() > 0) {
        InventoryUtils.wrapText(description, lore);
    }
    int cooldown = SkillConfigManager.getUseSetting(hero, skill, SkillSetting.COOLDOWN, 0, true);
    if (cooldown > 0) {
        String cooldownDescription = getCooldownDescription(messages, cooldown, mage, wand);
        if (cooldownDescription != null && !cooldownDescription.isEmpty()) {
            lore.add(messages.get("cooldown.description").replace("$time", cooldownDescription));
        }
    }
    int mana = SkillConfigManager.getUseSetting(hero, skill, SkillSetting.MANA, 0, true);
    if (mana > 0) {
        String manaDescription = messages.get("costs.heroes_mana").replace("$amount", Integer.toString(mana));
        lore.add(ChatColor.YELLOW + messages.get("wand.costs_description").replace("$description", manaDescription));
    }
}
Also used : PassiveSkill(com.herocraftonline.heroes.characters.skill.PassiveSkill) Hero(com.herocraftonline.heroes.characters.Hero)

Aggregations

Hero (com.herocraftonline.heroes.characters.Hero)1 PassiveSkill (com.herocraftonline.heroes.characters.skill.PassiveSkill)1