I’m currently developing a roguelike card game.
There I have stumbled upon a fundamental problem.
Specifically, it is about “how to implement the cards themselves”.
The game is very simple: there are multiple enemies, and the aim is to annihilate them all by playing cards and activating their effects, and some cards use mana.
In fact, the types of cards we are thinking of implementing are as follows
Attack type
5 damage to 1 enemy
5 damage to 2 enemies
5 damage to the whole enemy (cost 1)
10 damage to one enemy, HP recovery 5 (cost 2)
Recovery type
10 HP recovery
5 HP recovery for 3 turns (cost 1)
Magical type
Half damage for 3 turns (cost 1)
Recovers 5 HP and draws 2 cards (cost 1)
I’m personally looking into various ways to implement this, but since it is a card game, it is difficult to get the information I want.
At first, I tried to implement it using DataAsset, but since each card has a different effect, if I tried to cover everything, I would end up with more useless columns, as shown below, and it would become very difficult to handle when the number of card types increases.
Name | Type | Mana | Damage | Heal | TargetCount | Turn | Card | Diffence |
---|---|---|---|---|---|---|---|---|
Attack1 | Attack | 0 | 5 | 0 | 1 | 0 | 0 | 0 |
Attack2 | Attack | 0 | 5 | 0 | 2 | 0 | 0 | 0 |
Attack3 | Attack | 1 | 5 | 0 | All | 0 | 0 | 0 |
Attack3 | Attack | 1 | 10 | 5 | All | 0 | 0 | 0 |
Heal1 | Heal | 0 | 0 | 10 | 0 | 0 | 0 | 0 |
Heal2 | Heal | 0 | 0 | 5 | 0 | 3 | 2 | 0 |
Spell1 | Spell | 1 | 0 | 0 | 0 | 3 | 0 | 50 |
Spell2 | Spell | 1 | 0 | 5 | 0 | 0 | 2 | 0 |
I would like to know the suitable implementation method.
Thank you in advance.