This week was the week of spells. Or rather, the two weeks: this time, I was smart enough to split the work of spells up into two weeks. This week, I wanted to get the commands working, as well as implement the various settings for each spell. Next week will be getting the spells summoned through a menu in-game.
Click 'Read more' to read more about the code behind the magic!
For the first time, I created a "technical document" fully outlining each part of the mechanic. At GameHouse, I was never very good at this: there were always some edge cases I'd miss out on, or I had an assumption that I wasn't aware was an assumption.
First of all, characters have a Spell List.
Pretty self-explanatory: two lists of Game Objects, that can be accessed and spawned through the spell menu in-game. It's split up into "Spells" and "Rage Spells", each using their own resource. Regular spells are straight-forward: each character has AP, ability points, which is the equivalent of mana. Every spell costs a certain amount of AP, as a drawback for their power or utility over regular attacks.
Rage Spells are inspired by Lufia's Rage system, as well as Super Arts from fighting games. Rage Spells have the banner and text at the start, giving them a little extra flair. You can use these abilities by gaining "Rage Points", or RP. These are acquired by taking damage: every percentage of damage equates to 1 RP, with a maximum of 100.
Every spell object starts with the "Spell Data" component.
This component holds all the information about the spell itself. From top to bottom:
The "command chain" consists of several spell commands. Succeeding in one triggers the next command, until the end of the chain. If the command fails, the spell fails.
The different commands are pressing buttons, holding buttons, or mashing buttons. The components automatically add the necessary components, and the lists contain which button inputs the player will have to do.
Next week I'll work on making these spells work in-game. Calculating damage, turn progression, etc.