Table of Contents

Method RunAroundInAreaAndAttack

Namespace
GrindFest
Assembly
GrindFest.dll

RunAroundInAreaAndAttack()

Makes your hero run around and attack enemies in the area automatically.

public 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.

Basic farming loop:
// Keep attacking and exploring
RunAroundInAreaAndAttack();
Combat loop with health management:
if (Health > MaxHealth * 0.3f) // Above 30% health
{
    RunAroundInAreaAndAttack();
}
else if (HasHealthPotion())
{
    DrinkHealthPotion();
    RunAwayFromNearestEnemy();
}
else
{
    GoToArea("Liberated Settlement"); // Retreat to a safe area
}