2025-09-06 12:25:55 +08:00
|
|
|
using Data;
|
|
|
|
|
2025-08-28 16:20:24 +08:00
|
|
|
namespace Parsing
|
2025-08-27 19:56:49 +08:00
|
|
|
{
|
|
|
|
public static class ConditionFunctions
|
|
|
|
{
|
|
|
|
public static bool EntityHealth(Entity.Entity entity, int minHealth)
|
|
|
|
{
|
|
|
|
return entity.attributes.health >= minHealth;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static bool HasEnemyInSight(Entity.Entity entity)
|
|
|
|
{
|
2025-08-28 16:20:24 +08:00
|
|
|
return Managers.EntityManage.Instance.ExistsHostile(entity.currentDimensionId, entity.entityPrefab);
|
2025-08-27 19:56:49 +08:00
|
|
|
}
|
2025-09-06 12:25:55 +08:00
|
|
|
|
|
|
|
public static bool HasWeapon(Entity.Entity entity)
|
|
|
|
{
|
|
|
|
return entity.GetCurrentWeapon() != null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static bool HasRangedWeapon(Entity.Entity entity)
|
|
|
|
{
|
|
|
|
var weapon = entity.GetCurrentWeapon();
|
|
|
|
return weapon is { Type: WeaponType.Ranged };
|
|
|
|
}
|
|
|
|
public static bool HasMeleeWeapon(Entity.Entity entity)
|
|
|
|
{
|
|
|
|
var weapon = entity.GetCurrentWeapon();
|
|
|
|
return weapon is { Type: WeaponType.Melee };
|
|
|
|
}
|
2025-08-27 19:56:49 +08:00
|
|
|
}
|
|
|
|
}
|