Method RunAroundInAreaAndAttack
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
RunAroundInAreaAndAttack()
Makes your hero run around and attack enemies in the area automatically.
public static bool RunAroundInAreaAndAttack()
Returns
- bool
Returns true if the hero is currently engaged in attacking an enemy, false if the hero is running around.
Remarks
This method combines AttackNearestEnemy(float) and RunAroundInArea() into a single patrol-and-engage behavior. The hero will actively seek out and engage enemies, and explore the area when no enemies are in range.
// Keep attacking and exploring
Hero.RunAroundInAreaAndAttack();
if (Hero.Health > Hero.MaxHealth * 0.3f) // Above 30% health
{
Hero.RunAroundInAreaAndAttack();
}
else if (Hero.HasHealthPotion())
{
Hero.DrinkHealthPotion();
Hero.RunAwayFromNearestEnemy();
}
else
{
Hero.GoToArea("Liberated Settlement"); // Retreat to a safe area
}