I had no idea how to start implementing a combat system so I started working on top of the GDquest's 2D JRPG Combat
I wanted to implement more complex behaviours as examples:
- skill requires an specific number of allies and specific number of enemies
- skill effects that trigger under specific conditions
I ditched the Action subclasses like AttackAction and started building Action out of resources that control the behaviour of the skill: data, target_behaviour, triggers, effects, etc...
It's working fine but since I dont have much programming experience I would like to understand the thought process behind the original code.
One "annoyance" I found is that in ActiveTurnQueue.gd playturn() the action is hardcoded to be AttackAction and you need to use new() because its a Reference instead of a Resource, this adds some small complexity to the code and I don't see any benefits is there any reason to use a reference over a resource here?.
I also want to know what do you think about my approach I'm worried about maintenance and readability.
How would you tackle these skills that have unique functionalities and behaviours withing the GDquest code, I just thought about creating subclasses of the Action types (Action subclasses) that overwrite the functions would that work?
Would you create a subclass for every skill with a behaviour that doesn't fit in the current action types.