I am trying to make a component-based ability system for my new turn based game i am working on. I not sure with the architecture and the approch i am following.
So here my idea:
Every Ability is a Prefab. 4 Ability Prefabs will be attached to every Character, those are their abilitys.
An Ability consists of an AbilityController.cs. This will have the name and some basic data for the ability. Then i will attach one or more AbilityTargetMode.cs. Here i can pick a target mode (enemySingle,enemyAll,enemyRandom,AllySelf,…) and attach one or more AbilityComponent.cs to every AbilityTargetMode. AbilityComponents are "Do Damage","Apply Poison" and so on.
The idea behind this is that i can build complex abilitys:
Do Damage to a random enemy and poison him, then heal self, then apply buff to all allys.
The structure for an ability would be:
-- Controller ---- TargetMode: EnemySingle ------ Component 1: Damage ------ Component 2: Poison ---- TargetMode: Self ------ Component 1: Heal ---- TargetMode: AlliesAll ------ Component 1 : Buff
And so on..
But im not sure about the whole system. Is it something that sounds right? Should i overthink something? And another problem that i have is that i do not know how to attach my Components and my target mode to my Controller/Prefab. Is it better to use scriptable objects? What are your thoughts on the system.