mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 03:47:13 +08:00
Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com> Reviewed-on: http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite/pulls/57
33 lines
967 B
C#
33 lines
967 B
C#
using Data;
|
|
|
|
namespace Parsing
|
|
{
|
|
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)
|
|
{
|
|
return Managers.EntityManager.Instance.ExistsHostile(entity.currentDimensionId, entity.entityPrefab);
|
|
}
|
|
|
|
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 };
|
|
}
|
|
}
|
|
} |