Search in sources :

Example 1 with AI_LOGIC

use of main.content.enums.system.AiEnums.AI_LOGIC in project Eidolons by IDemiurge.

the class ToolTipMaster method getActionTargetingTooltip.

public static String getActionTargetingTooltip(DC_Obj target, DC_ActiveObj active) {
    if (active == null) {
        return "";
    }
    String tooltip = "";
    ACTION_TOOL_TIP_CASE _case = null;
    AI_LOGIC spellLogic = AI_SpellMaster.getSpellLogic(active);
    if (spellLogic == null) {
        if (active instanceof DC_UnitAction) {
            if (active.getActionGroup() == ActionEnums.ACTION_TYPE_GROUPS.ATTACK) {
                _case = ACTION_TOOL_TIP_CASE.DAMAGE;
            }
        }
    }
    if (spellLogic != null) {
        switch(spellLogic) {
            case BUFF_NEGATIVE:
            case BUFF_POSITIVE:
                _case = ACTION_TOOL_TIP_CASE.BUFF;
                break;
            case CUSTOM_HOSTILE:
            case CUSTOM_SUPPORT:
                _case = ACTION_TOOL_TIP_CASE.SPECIAL;
                break;
            case AUTO_DAMAGE:
            case DAMAGE:
            case DAMAGE_ZONE:
                _case = ACTION_TOOL_TIP_CASE.DAMAGE;
                break;
            case RESTORE:
                break;
        }
    }
    if (_case == null) {
        return "";
    }
    switch(_case) {
        case BUFF:
            break;
        case DAMAGE:
            boolean attack = !(active instanceof DC_SpellObj);
            int damage = FutureBuilder.precalculateDamage(active, target, attack);
            // ++ damage type
            // MIN-MAX is really in
            tooltip += "avrg. damage: " + damage;
            // order
            if (DamageCalculator.isLethal(damage, target)) {
                // TODO possibly lethal
                tooltip += "(lethal)";
            } else {
                if (attack) {
                    if (((Unit) target).canCounter(active)) {
                        // TODO precalc dmg?
                        tooltip += "(will retaliate)";
                    }
                }
            }
            break;
        case SPECIAL:
            break;
    }
    return tooltip;
}
Also used : AI_LOGIC(main.content.enums.system.AiEnums.AI_LOGIC) DC_SpellObj(eidolons.entity.active.DC_SpellObj) Unit(eidolons.entity.obj.unit.Unit) DC_UnitAction(eidolons.entity.active.DC_UnitAction)

Example 2 with AI_LOGIC

use of main.content.enums.system.AiEnums.AI_LOGIC in project Eidolons by IDemiurge.

the class AI_SpellMaster method getGoal.

public static GOAL_TYPE getGoal(DC_ActiveObj spell) {
    AI_LOGIC spellLogic = getSpellLogic(spell);
    spell.setSpellLogic(spellLogic);
    if (spellLogic == null) {
        LogMaster.log(1, "*** No spell logic for " + spell.getName());
        return AiEnums.GOAL_TYPE.OTHER;
    }
    switch(spellLogic) {
        case MOVE:
            return AiEnums.GOAL_TYPE.MOVE;
        case BUFF_NEGATIVE:
            return AiEnums.GOAL_TYPE.DEBUFF;
        case BUFF_POSITIVE:
            return AiEnums.GOAL_TYPE.BUFF;
        case SELF:
            return AiEnums.GOAL_TYPE.SELF;
        case DEBILITATE:
            return AiEnums.GOAL_TYPE.DEBILITATE;
        case RESTORE:
            return AiEnums.GOAL_TYPE.RESTORE;
        case DAMAGE:
            return AiEnums.GOAL_TYPE.ATTACK;
        case DAMAGE_ZONE:
            return AiEnums.GOAL_TYPE.ZONE_DAMAGE;
        case SUMMON:
            return AiEnums.GOAL_TYPE.SUMMONING;
        case AUTO_DAMAGE:
            return AiEnums.GOAL_TYPE.AUTO_DAMAGE;
        case CUSTOM_HOSTILE:
            return AiEnums.GOAL_TYPE.CUSTOM_HOSTILE;
        case CUSTOM_SUPPORT:
            return AiEnums.GOAL_TYPE.CUSTOM_SUPPORT;
        case COATING:
            return AiEnums.GOAL_TYPE.COATING;
        default:
            break;
    }
    return AiEnums.GOAL_TYPE.OTHER;
}
Also used : AI_LOGIC(main.content.enums.system.AiEnums.AI_LOGIC)

Aggregations

AI_LOGIC (main.content.enums.system.AiEnums.AI_LOGIC)2 DC_SpellObj (eidolons.entity.active.DC_SpellObj)1 DC_UnitAction (eidolons.entity.active.DC_UnitAction)1 Unit (eidolons.entity.obj.unit.Unit)1