Add complex card's effects in a card game

Hello godoneers,
I’m new to Godot, and programming in general. As an exercise, I’m creating a slay-the-spire-like game. I have created most of the basic mechanics. Play cards, mana, deck and discard pile.
Now, my cards are formed by an interface and a custom-resource data container. How can I implement effects?
For simple effects I can just use bool and just manage the effect in the resolution, that is easy.
(es. if card is_posonus == true: apply X poison else: deal X damage)
But for more complex effects? Can I just attach a script at the card database level and call it instead of trying to build a flexible effect framework? (es. in the card I have an enum with the type of target, the type of effect, and so on. it sounds like a bit out of my reach now and a bit limited)
and also for different triggers? (I was trying to add cards that work like traps: they trigger based on a specific situation. the player takes damage, an enemy tries to build armor, etc.)