Filters
Filters works in a similar way as conditions, and also help determine the targets of an ability.
A filter always has a source array and a destination array (containing either Cards, Characters or Slots), and the function should add the valid targets to the destination array and return it.
The advantage of filters is that they are a bit more flexible than conditions, but are also less performant and more complex (because of array manipulation). Filters also cannot be used for the trigger or for some targets that let the player make a selection. Filters are best used with the All Cards, All Characters or All Slots targets.
In this example, the filter is used to find the character that has the highest hp. The ability target is set to All Characters, which means the source array contains all the cards on the board. And destination array will contain only the cards with the highest attack.
Similar to conditions and effects, you need to create a scriptable object from the Create->TcgEngine menu. Filters can be added on the ability data inside the filters_target array.
Last updated