Ok, today I got my data structure sorted that will hold all the moves and move related accessories that the program will need upon confirmation of that turnās moves. It looks like a bunch of numbers (and, well, youāre not wrong), but lemme walk you through what they mean (from left to right):
ID of the owner of the move - obviously important when I need to do stuff like damage calculation, since Iāll need the ownerās attack stats + others. This is the ID of the object where those variables are stored
BattleID - most likely just for my reference, itās the slot that character is in (0-4 for players, 5-14 for enemies/npcs)
Character speed - the speed statistic, which Iāll need for sorting the data structure to determine who moves in what order
Attack type - an enum corresponding to the type of move (aka, whether itās an attack, defense, item, or escape attempt).
Everything below is needed only for attack and item type moves:
Attack/item ID - the unique ID in the respective database, needed to look up basically everything about what the attack does, including the associated script reference, animation, etc
Ally/enemy - whether the ability is targeting an ally or enemy, just as a quick binary value so I donāt need check if target id is less than 5 for allies or 5+ for enemies
Targets - This is a 2D array containing the object ids of all targets selected by the AOE, and the number of times they were selected. As attacks will be doing more damage if you have more of the enemy covered by the AOE, itās important to know this! It wonāt be double damage if you have 2 cells compared to one, but itāll be something extra as a bonus for good positioning!
X value - the x position on the enemy grid
Y value - the y position on the enemy grid
P value - the player index
Just a note for the last 3, Iāve captured the coordinates of the attack separately from the targets, as Iāll need to know these if an enemy dies mid-turn. If everyone shoots at the same robot and your first character defeats it, itād be quite annoying to have the rest of your characters shoot into space and not hit anything. Therefore, if an enemy dies and itās a single target attack, your attacks will automatically be directed at an enemy of the same type (if available and within the attackās potential radius). If itās an AOE, itāll just hit empty space!
...And after writing that, I realised I need to save all the valid cells to the move data structure, otherwise Iāll have to calculate the valid cells from scratch and I donāt want to do that! Iāll add that in tomorrow I guess and then work on shifting from one player to the next (and going backward too)!