heroes-of-nerevelon/lib/spell/target_test.lua
PeaAshMeter 4431934e6b Refactor spell target selection to use composable queries
Introduce SpellTargetQuery abstraction for flexible target filtering.
Replace fixed target types with query-based system supporting union,
intersection, and exclusion of target conditions. Update spells
accordingly.
2026-03-17 23:09:36 +03:00

14 lines
489 B
Lua

--- @alias SpellTargetTest fun(caster: Character, targetPosition: Vec3) : boolean
return {
any = function() return true end,
caster = function(caster, targetPosition)
local targetCharacterId = Tree.level.characterGrid:get(targetPosition)
return caster.id == targetCharacterId
end,
character = function(caster, targetPosition)
local targetCharacterId = Tree.level.characterGrid:get(targetPosition)
return not not targetCharacterId
end
}