Is there a way of storing multiple cards with unique special effects in the same file?

Godot Version

4.4

Question

So I have a card game that I’m working on, and even though many cards are simply “deal X damage”, “gain X mana”, many cards have special effects that can’t be streamlined. Things like “randomize the cost of your cards”, “place the next card you play on top of your deck”, etc…
Right now these cards are stored each as their own .gd file, inheriting from the base Card class. However, I don’t think this will scale very well, if in the future we want to have 100+ unique cards in the game.
I am trying to come up with a better, more scalable way to store all this. I have found some examples, but in other languages (like Android: Netrunner, stored in Clojure netrunner/src/clj/game/cards/agendas.clj at master · mtgred/netrunner · GitHub).
Which if I have to guess depends on a having a parser loading the entry according to the card’s name and going line by line parsing it and composing code to be called. Also it appears to be making some sort of binding or prerequisite functions at the start but they are probably defined elsewhere.

I haven’t done much work similar to this “meta” programming type of thing, so I have no idea how to start to approach it in Godot. Could there be an easier way than making my own custom parser?
I’m trying to write a prototype of this approach using a big file with a dictionary in it, somehow linking the cards-effects dictionary with the corresponding card’s resource (that contains the images, tooltip text, etc…). I can have an entry saying “card type: damage” and then a field “Damage: X” or similar, but that wouldn’t solve the case for the unique cards.

Slay the Spire uses a script file per-card, they outline a little bit of that system in a blog about trying out Godot.

https://caseyyano.com/on-evaluating-godot-b35ea86e8cf4

If you want unique effects then you want a programming language to represent them. As you point out you will not get unique effects with data alone.

It’s not too hard to start your own programming language, using a Bytecode Programming Pattern is a great start, but you are making a programming language, it will only do as much as you program it to, and you won’t have any debugging tools without building them. A bytecode/domain specific language might speed up your process of making cards if can manipulate your cards easier than GDScript could, though it is a lot of up-front work.