public static BTStatus LandAnimalFindFood(Animal agent)
 {
     // let animals wander to weird places while hungry, but if they are starving go home
     if (agent.Hunger > StarvingThreshold && MovementBehaviors.ShouldReturnHome(agent))
     {
         return(MovementBehaviors.WanderHome(agent));
     }
     else
     {
         return(MovementBehaviors.Wander(agent));
     }
 }
Exemple #2
0
 public override BTStatus Do(Animal agent)
 {
     // let animals wander to weird places while hungry, but if they are starving go home
     if (agent.Hunger > StarvingThreshold && MovementBehaviors.ShouldReturnHome(agent).Test)
     {
         var status = MovementBehaviors.WanderHome.Do(agent);
         return(this.Status(status, agent, "Starving, returning home."));
     }
     else
     {
         var status = MovementBehaviors.Wander.Do(agent);
         return(this.Status(status, agent, "Wandering looking for food"));
     }
 }