use of com.herocraftonline.heroes.characters.Hero in project MagicPlugin by elBukkit.
the class HeroesManager method setMana.
@Override
public void setMana(Player player, float amount) {
Hero hero = getHero(player);
if (hero == null)
return;
hero.setMana((int) amount);
}
use of com.herocraftonline.heroes.characters.Hero in project MagicPlugin by elBukkit.
the class HeroesManager method getClassName.
public String getClassName(Player player) {
Hero hero = getHero(player);
if (hero == null)
return "";
HeroClass heroClass = hero.getHeroClass();
if (heroClass == null)
return "";
return heroClass.getName();
}
use of com.herocraftonline.heroes.characters.Hero in project MagicPlugin by elBukkit.
the class HeroesManager method setCooldown.
public void setCooldown(Player player, long ms) {
Hero hero = getHero(player);
if (hero == null)
return;
long cooldown = System.currentTimeMillis() + ms;
Set<String> skills = getSkills(player, false, false);
for (String skill : skills) {
Long currentCooldown = hero.getCooldown(skill);
if (currentCooldown == null || currentCooldown < cooldown) {
hero.setCooldown(skill, cooldown);
}
}
}
use of com.herocraftonline.heroes.characters.Hero 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));
}
}
Aggregations