Beispiel #1
0
    public static GOAPGoal Create(E_GOAPGoals type, Agent owner)
    {
        GOAPGoal g;

        switch (type)
        {
        case E_GOAPGoals.E_GOTO:
            g = new GOAPGoalGoTo(owner);
            break;

        case E_GOAPGoals.E_PLAY_ANIM:
            g = new GOAPGoalPlayAnim(owner);
            break;

        case E_GOAPGoals.E_IDLE_ANIM:
            g = new GOAPGoalIdleAction(owner);
            break;

        default:
            return(null);
        }

        g.InitGoal();
        return(g);
    }
Beispiel #2
0
    public GOAPGoal GetGoal(E_GOAPGoals type)
    {
        if (Goals.ContainsKey(type))
        {
            return(Goals[type]);
        }

        return(null);
    }
Beispiel #3
0
 /**
  * Adds the goal to the list of goals
  * @param the new goal
  */
 public GOAPGoal AddGoal(E_GOAPGoals newGoal)
 {
     if (!IsGoalInGoalSet(newGoal))
     {
         GOAPGoal goal = GOAPGoalFactory.Create(newGoal, Owner);
         m_GoalSet.Add(goal);
         return(goal);
     }
     return(null);
 }
Beispiel #4
0
    /**
     * Adds the goal to the list of goals
     * @param the new goal
     */

    public GOAPGoal AddGoal(E_GOAPGoals type)
    {
        if (Goals.ContainsKey(type) == false)
        {
            GOAPGoal goal = GOAPGoalFactory.Create(type, Owner);
            Goals.Add(type, goal);
            return(goal);
        }
        return(null);
    }
Beispiel #5
0
 /**
  * Checks whether the goal to be added is part of the agents goals already
  * @return true if the goal is part of the agent's goalset
  */
 bool IsGoalInGoalSet(E_GOAPGoals goalType)
 {
     for (int i = 0; i < m_GoalSet.Count; i++)
     {
         if (m_GoalSet [i].GoalType == goalType)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #6
0
 public GOAPGoal AddGoal(E_GOAPGoals newGoal)
 {
     return(GoapManager.AddGoal(newGoal));
 }
Beispiel #7
0
 public void AddGOAPGoal(E_GOAPGoals goal)
 {
     m_GoalManager.AddGoal(goal);
 }
Beispiel #8
0
    public static GOAPGoal Create(E_GOAPGoals type, AgentHuman owner)
    {
        GOAPGoal g;

        switch (type)
        {
        case E_GOAPGoals.Move:
            g = new GOAPGoalMove(owner);
            break;

        case E_GOAPGoals.Roll:
            g = new GOAPGoalRoll(owner);
            break;

        case E_GOAPGoals.CoverEnter:
            g = new GOAPGoalCoverEnter(owner);
            break;

        case E_GOAPGoals.CoverLeave:
            g = new GOAPGoalCoverLeave(owner);
            break;

        case E_GOAPGoals.CoverFire:
            g = new GOAPGoalCoverFire(owner);
            break;

        case E_GOAPGoals.CoverMove:
            g = new GOAPGoalCoverMove(owner);
            break;

        case E_GOAPGoals.CoverJumpOver:
            g = new GOAPGoalCoverJumpOver(owner);
            break;

        case E_GOAPGoals.WeaponReload:
            g = new GOAPGoalWeaponReload(owner);
            break;

/*			case E_GOAPGoals.WeaponChange:
 *              g = new GOAPGoalWeaponChange(owner);
 *              break;
 */
        case E_GOAPGoals.UseWorldObject:
            g = new GOAPGoalUseWorldObject(owner);
            break;

        case E_GOAPGoals.UseGadget:
            g = new GOAPGoalUseGadget(owner);
            break;

        case E_GOAPGoals.PlayAnim:
            g = new GOAPGoalPlayAnim(owner);
            break;

        case E_GOAPGoals.Melee:
            g = new GOAPGoalMelee(owner);
            break;

        default:
            Debug.LogError("GOAPGoalFactory Unknow goal " + type + " for " + owner.name);
            return(null);
        }

        g.InitGoal();
        return(g);
    }
Beispiel #9
0
 protected GOAPGoal(E_GOAPGoals type, Agent ai)
 {
     GoalType = type;
     Owner    = ai;
 }
Beispiel #10
0
    public static GOAPGoal Create(E_GOAPGoals type, Agent owner)
    {
        GOAPGoal g;

        switch (type)
        {
        case E_GOAPGoals.E_ORDER_ATTACK:
            g = new GOAPGoalOrderAttack(owner);
            break;

        case E_GOAPGoals.E_ORDER_DODGE:
            g = new GOAPGoalOrderDodge(owner);
            break;

        case E_GOAPGoals.E_ORDER_USE:
            g = new GOAPGoalOrderUseWorldObject(owner);
            break;

        case E_GOAPGoals.E_GOTO:

            g = new GOAPGoalGoTo(owner);
            break;

        case E_GOAPGoals.E_COMBAT_MOVE_RIGHT:
            g = new GOAPGoalCombatMoveToRight(owner);
            break;

        case E_GOAPGoals.E_COMBAT_MOVE_LEFT:
            g = new GOAPGoalCombatMoveToLeft(owner);
            break;

        case E_GOAPGoals.E_COMBAT_MOVE_FORWARD:
            g = new GOAPGoalCombatMoveForward(owner);
            break;

        case E_GOAPGoals.E_COMBAT_MOVE_BACKWARD:
            g = new GOAPGoalCombatMoveBackward(owner);
            break;

        case E_GOAPGoals.E_LOOK_AT_TARGET:
            g = new GOAPGoalLookAtTarget(owner);
            break;

        case E_GOAPGoals.E_KILL_TARGET:
            g = new GOAPGoalKillTarget(owner);
            break;

        case E_GOAPGoals.E_DODGE:
            g = new GOAPGoalDodge(owner);
            break;

        case E_GOAPGoals.E_DO_BLOCK:
            g = new GOAPGoalDoBlock(owner);
            break;

        case E_GOAPGoals.E_ALERT:
            g = new GOAPGoalAlert(owner);
            break;

        case E_GOAPGoals.E_CALM:
            g = new GOAPGoalCalm(owner);
            break;

        case E_GOAPGoals.E_USE_WORLD_OBJECT:
            g = new GOAPGoalUseWorldObject(owner);
            break;

        case E_GOAPGoals.E_PLAY_ANIM:
            g = new GOAPGoalPlayAnim(owner);
            break;

        case E_GOAPGoals.E_IDLE_ANIM:
            g = new GOAPGoalIdleAction(owner);
            break;

        case E_GOAPGoals.E_REACT_TO_DAMAGE:
            g = new GOAPGoalReactToDamage(owner);
            break;

        case E_GOAPGoals.E_TELEPORT:
            g = new GOAPGoalTeleport(owner);
            break;

        default:
            return(null);
        }

        g.InitGoal();
        return(g);
    }
Beispiel #11
0
 public GOAPGoal AddGoal(E_GOAPGoals newGoal)
 {
     GOAPManager.AddGoal(newGoal);
     return(null);
 }
Beispiel #12
0
 protected GOAPGoal(E_GOAPGoals type, AgentHuman owner)
 {
     GoalType = type;
     Owner    = owner;
 }