use of am2.api.spell.enums.SkillPointTypes in project ArsMagica2 by Mithion.
the class SkillData method getLearnState.
@Override
public LearnStates getLearnState(SkillTreeEntry entry, EntityPlayer player) {
SkillData sk = SkillData.For(player);
if (sk.isEntryKnown(entry)) {
return LearnStates.LEARNED;
}
SkillPointTypes pointType = SkillTreeManager.instance.getSkillPointTypeForPart(entry.registeredItem);
LearnStates state = entry.enabled ? (sk.getSpellPoints(pointType) > 0 ? LearnStates.CAN_LEARN : LearnStates.CANNOT_LEARN) : LearnStates.DISABLED;
if (state == LearnStates.CAN_LEARN) {
if (!RecursivePrerequisiteCheck(sk, entry)) {
state = LearnStates.CANNOT_LEARN;
}
}
if (sk.getPrimaryTree() != SkillTrees.None && entry.tree != SkillTrees.Talents && sk.getPrimaryTree() != entry.tree && entry.tier >= AMCore.config.getSkillTreeSecondaryTierCap()) {
state = LearnStates.LOCKED;
}
return state;
}
Aggregations