use of eidolons.entity.active.DC_SpellObj in project Eidolons by IDemiurge.
the class LibraryManager method getVerbatimSpellVersion.
public static DC_SpellObj getVerbatimSpellVersion(Unit hero, Entity type) {
hero.initSpells(true);
boolean upgrade = type.isUpgrade();
String baseName = (upgrade) ? type.getProperty(G_PROPS.BASE_TYPE) : type.getName();
for (DC_SpellObj s : hero.getSpells()) {
// TODO refactor into checkUpgrade(spell, type)
if (StringMaster.compare(s.getSpellPool() + "", PROPS.VERBATIM_SPELLS.getName(), false)) {
if (s.isUpgrade()) {
if (s.getProperty(G_PROPS.BASE_TYPE).equalsIgnoreCase(baseName)) {
return s;
}
} else if (s.getName().equalsIgnoreCase(baseName)) {
return s;
}
}
}
return null;
}
use of eidolons.entity.active.DC_SpellObj in project Eidolons by IDemiurge.
the class SpellUpgradeMaster method removeUpgrades.
public static void removeUpgrades(Unit hero, Entity spell) {
DC_SpellObj spellObj = hero.getSpell(spell.getName());
if (spellObj != null) {
spellObj.removeProperty(PROPS.SPELL_UPGRADES);
spellObj.getType().removeProperty(PROPS.SPELL_UPGRADES);
}
}
Aggregations