use of com.herocraftonline.heroes.characters.Hero in project MagicPlugin by elBukkit.
the class HeroesManager method getSecondaryClassName.
public String getSecondaryClassName(Player player) {
Hero hero = getHero(player);
if (hero == null)
return "";
HeroClass heroClass = hero.getSecondClass();
if (heroClass == null)
return "";
return heroClass.getName();
}
use of com.herocraftonline.heroes.characters.Hero in project MagicPlugin by elBukkit.
the class HeroesManager method getSkills.
public Set<String> getSkills(Player player, boolean showUnuseable, boolean showPassive) {
if (skills == null)
return emptySkills;
Hero hero = getHero(player);
if (hero == null)
return emptySkills;
Set<String> skillSet = new HashSet<>();
HeroClass heroClass = hero.getHeroClass();
HeroClass secondClass = hero.getSecondClass();
addSkills(hero, heroClass, skillSet, showUnuseable, showPassive);
addSkills(hero, secondClass, skillSet, showUnuseable, showPassive);
return skillSet;
}
use of com.herocraftonline.heroes.characters.Hero in project MagicPlugin by elBukkit.
the class HeroesManager method removeMana.
@Override
public void removeMana(Player player, float amount) {
Hero hero = getHero(player);
if (hero == null)
return;
hero.setMana(Math.max(0, hero.getMana() - (int) amount));
}
use of com.herocraftonline.heroes.characters.Hero in project MagicPlugin by elBukkit.
the class HeroesSkillSpell method getRemainingCooldown.
@Override
public long getRemainingCooldown() {
if (isCasting || skill == null || mage == null)
return 0;
Player player = mage.getPlayer();
if (player == null)
return 0;
Hero hero = heroes.getHero(mage.getPlayer());
if (hero == null)
return 0;
Long cooldown = hero.getCooldown(skillKey);
if (cooldown == null)
return 0;
long now = System.currentTimeMillis();
return Math.max(0, cooldown - now);
}
use of com.herocraftonline.heroes.characters.Hero in project MagicPlugin by elBukkit.
the class HeroesSkillSpell method getRequiredCost.
@Nullable
@Override
public CastingCost getRequiredCost() {
if (isCasting || skill == null || mage == null)
return null;
Player player = mage.getPlayer();
if (player == null)
return null;
Hero hero = heroes.getHero(mage.getPlayer());
if (hero == null)
return null;
int mana = SkillConfigManager.getUseSetting(hero, skill, SkillSetting.MANA, 0, true);
if (mana == 0 || hero.getMana() > mana)
return null;
manaCost.setAmount(mana);
return manaCost;
}
Aggregations