Search in sources :

Example 6 with GOAL_TYPE

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

the class ActionSequenceConstructor method createActionSequences.

public List<ActionSequence> createActionSequences(UnitAI ai) {
    TimeLimitMaster.markTimeForAI(ai);
    List<ActionSequence> list = new ArrayList<>();
    getActionSequenceConstructor().setPrioritizedCells(null);
    boolean forced = false;
    if (ai.getCurrentOrder() != null)
        forced = true;
    for (GOAL_TYPE type : GoalManager.getGoalsForUnit(ai)) {
        List<ActionSequence> sequences = null;
        try {
            Goal goal = new // ???
            Goal(// ???
            type, // ???
            null, ai);
            goal.setForced(forced);
            sequences = createActionSequencesForGoal(goal, ai);
            list.addAll(sequences);
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
        }
        if (!TimeLimitMaster.checkTimeLimitForAi(ai)) {
            break;
        }
    }
    return list;
}
Also used : Goal(eidolons.game.battlecraft.ai.elements.goal.Goal) ArrayList(java.util.ArrayList) GOAL_TYPE(main.content.enums.system.AiEnums.GOAL_TYPE)

Aggregations

GOAL_TYPE (main.content.enums.system.AiEnums.GOAL_TYPE)6 Action (eidolons.game.battlecraft.ai.elements.actions.Action)3 ActionSequence (eidolons.game.battlecraft.ai.elements.actions.sequence.ActionSequence)3 DC_UnitAction (eidolons.entity.active.DC_UnitAction)2 Unit (eidolons.entity.obj.unit.Unit)2 Goal (eidolons.game.battlecraft.ai.elements.goal.Goal)2 ArrayList (java.util.ArrayList)2 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)1 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 DC_QuickItemAction (eidolons.entity.active.DC_QuickItemAction)1 UnitAI (eidolons.game.battlecraft.ai.UnitAI)1 Order (eidolons.game.battlecraft.ai.advanced.companion.Order)1 AiActionFactory (eidolons.game.battlecraft.ai.elements.actions.AiActionFactory)1 AiQuickItemAction (eidolons.game.battlecraft.ai.elements.actions.AiQuickItemAction)1 AiHandler (eidolons.game.battlecraft.ai.elements.generic.AiHandler)1 AiMaster (eidolons.game.battlecraft.ai.elements.generic.AiMaster)1 Task (eidolons.game.battlecraft.ai.elements.task.Task)1 ActionPath (eidolons.game.battlecraft.ai.tools.path.ActionPath)1 COMBAT_SCRIPT_FUNCTION (eidolons.game.battlecraft.logic.battle.mission.CombatScriptExecutor.COMBAT_SCRIPT_FUNCTION)1 ScriptExecutor (eidolons.game.battlecraft.logic.meta.scenario.script.ScriptExecutor)1