using Terraria;
using Terraria.ID;
namespace SoulHarvest.Common;
internal static class ReaperTargeting
{
internal static bool IsTrainingDummy(NPC npc)
=> npc.type == NPCID.TargetDummy;
/// <summary>
/// Weapon-created attacks are allowed to acquire and repeatedly strike the
/// vanilla training dummy. Passive world/domain scans deliberately use their
/// own stricter filter and must never call this helper for inclusion.
/// </summary>
internal static bool IsValidWeaponTarget(NPC npc)
{
if (!npc.active || npc.life <= 0 || npc.dontTakeDamage)
return false;
if (IsTrainingDummy(npc))
return true;
return !npc.friendly && !npc.immortal && npc.lifeMax > 5;
}
}
using Terraria;
using Terraria.ID;
namespace SoulHarvest.Common;
internal static class ReaperTargeting
{
internal static bool IsTrainingDummy(NPC npc)
=> npc.type == NPCID.TargetDummy;
/// <summary>
/// Weapon-created attacks are allowed to acquire and repeatedly strike the
/// vanilla training dummy. Passive world/domain scans deliberately use their
/// own stricter filter and must never call this helper for inclusion.
/// </summary>
internal static bool IsValidWeaponTarget(NPC npc)
{
if (!npc.active || npc.life <= 0 || npc.dontTakeDamage)
return false;
if (IsTrainingDummy(npc))
return true;
return !npc.friendly && !npc.immortal && npc.lifeMax > 5;
}
}