Method GoToAndAttack
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
GoToAndAttack(Vector3, float)
Moves to a position while attacking any enemies that come within range.
public static GoToResult GoToAndAttack(Vector3 position, float distanceThreshold = 2)
Parameters
position
Vector3Target position to move to
distanceThreshold
floatHow close to get to the position
Returns
- GoToResult
GoToResult indicating movement status
Remarks
This is a convenience method that combines GoToAnd with AttackNearestEnemy. The hero will stop to attack enemies that are within 3 units while moving.
while (Hero.GoToAndAttack(dungeonEntrance) != GoToResult.Reached)
{
if (Hero.Health < Hero.MaxHealth * 0.3f)
{
Hero.DrinkHealthPotion();
Hero.RunAwayFromNearestEnemy();
}
}