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.
// Keep attacking and exploring
RunAroundInAreaAndAttack();
if (Health > MaxHealth * 0.3f) // Above 30% health
{
RunAroundInAreaAndAttack();
}
else if (HasHealthPotion())
{
DrinkHealthPotion();
RunAwayFromNearestEnemy();
}
else
{
GoToArea("Liberated Settlement"); // Retreat to a safe area
}