For Seeker of Sand, I was the main programmer on it. I worked on numerous systems for the game to work. One thing I want highlight is the spell system. So to start, we wanted to create a system with a lot of spells and the capacity to create variations of spells easily. The first step is to divide the spell into large categories:
So first, I implemented a way to launch each type of spell with its rules, but we still needed a way to create and modify each spell easily. To answer that problem, we analyze our spell, and the main conclusion is that spells are mainly statistical, and there is some variation in the behavioral type.
To regroup all those statistics and some behavior, we took advantage of the scriptable object system of Unity to regroup all the stats in it. In order to facilitate working with those stats, we create our own statistics class that contains a float-based value, a float percent value to give another way to increase stats, and an enum to identify the type of stats. With this, it was easier to create a modular spell, and we also set up a basic layout for the different types of spells to avoid repetitive action.