Let W = wizard
Let 0 = Cast range of spell, or AOE
Here is the problem:
I have a 2D tile map of squares. Let's say I want to have a wizard cast a spell that surrounds his body equally. For this, it would be as simple as using a flood fill or Dijkstra's algorithm, and it would look like this:
===0=== =00000= 000W000 =00000= ===0=== No problem! However, how will I implement a spell, that, for whatever reason, looks like a plus sign?
===0=== ===0=== 000W000 ===0=== ===0=== Or the spell goes longer in the direction the wizard is facing?
=00000= =00000= ==0W0== ==000== ======= Or two different locations?
======= =00==== ===W=== ====00= ======= Or, even more awkward, its a ranged splash spell where the player can choose where they want to cast it?
======= ======= ===W=== ======0 =====00 One way would be to have a list of all the locations relative to the wizard beforehand, and add them to the wizards location later. (E.g, for the affect to be 2 tiles north of the wizard, it would store (x+0, y+2), and later add them to the wizard's position, which could be at x=30, y=19, so the affect would be at x=30, y=21.)
A limitation to this, unfortunately, is that it doesn't take into account where the wizard is facing, and it feels inelegant to manually typing in all the locations that the AOE will affect.
Bottom line: How should I approach this problem and create a good, easily adjustable AOE system for a tile based map, that takes into account different AOE shapes and cast positions?