Search in sources :

Example 21 with DC_SpellObj

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;
}
Also used : DC_SpellObj(eidolons.entity.active.DC_SpellObj)

Example 22 with DC_SpellObj

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);
    }
}
Also used : DC_SpellObj(eidolons.entity.active.DC_SpellObj)

Aggregations

DC_SpellObj (eidolons.entity.active.DC_SpellObj)22 Unit (eidolons.entity.obj.unit.Unit)8 Ref (main.entity.Ref)6 ObjType (main.entity.type.ObjType)6 ArrayList (java.util.ArrayList)3 DC_UnitAction (eidolons.entity.active.DC_UnitAction)2 SPELL_GROUP (main.content.enums.entity.SpellEnums.SPELL_GROUP)2 PROPERTY (main.content.values.properties.PROPERTY)2 Obj (main.entity.obj.Obj)2 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)1 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 DC_QuickItemAction (eidolons.entity.active.DC_QuickItemAction)1 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)1 DC_Cell (eidolons.entity.obj.DC_Cell)1 DC_Obj (eidolons.entity.obj.DC_Obj)1 Action (eidolons.game.battlecraft.ai.elements.actions.Action)1 AiQuickItemAction (eidolons.game.battlecraft.ai.elements.actions.AiQuickItemAction)1 ArenaBattleMaster (eidolons.game.battlecraft.logic.battle.arena.ArenaBattleMaster)1 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)1