Exemple #1
0
 private void StateCheck()
 {
     if (VectorMath.DistanceBetweenPositions(hobgoblin.Pos, hobgoblin.Target.Pos) < hobgoblin.PassiveDistance && VectorMath.LineOfSight(hobgoblin.world, hobgoblin.Pos, hobgoblin.Target.Pos))
     {
         hobgoblin.setState(hobgoblin.hunting);
     }
     else if (VectorMath.DistanceBetweenPositions(hobgoblin.Pos, hobgoblin.Target.Pos) >= hobgoblin.PassiveDistance && VectorMath.LineOfSight(hobgoblin.world, hobgoblin.Pos, hobgoblin.Target.Pos))
     {
         hobgoblin.setState(hobgoblin.command);
     }
 }
Exemple #2
0
 private void StateCheck()
 {
     if (VectorMath.DistanceBetweenPositions(hobgoblin.Pos, hobgoblin.Target.Pos) >= hobgoblin.CommandRadius || !VectorMath.LineOfSight(hobgoblin.world, hobgoblin.Pos, hobgoblin.Target.Pos))
     {
         hobgoblin.setState(hobgoblin.hunting);
     }
 }
Exemple #3
0
 private void StateCheck()
 {
     // CommandRadius should be PassiveDistance.
     if (VectorMath.DistanceBetweenPositions(hobgoblin.Pos, hobgoblin.Target.Pos) < hobgoblin.CommandRadius && VectorMath.LineOfSight(hobgoblin.world, hobgoblin.Pos, hobgoblin.Target.Pos))
     {
         hobgoblin.setState(hobgoblin.command);
     }
 }