Question on Psi-Storm implementation:
I'm trying to figure out how Psi-Storm will work. I've created a class so that we can assign XML values that will correspond to how much each unit in the plot will take during a certain event. Examples could be:
1.) At the moment that the storm is first cast.
2.) All units in a stormed plot at the end of each players turn (only affects that player's units, only in turn-based game, see below)
3.) All units in a stormed plot at the end of each game turn (only for simultaneous games, see below)
4.) Whenever a unit moves into / leaves a plot that has a storm
The idea is that every plot will individually keep track of whether or not it has a storm on it. When it is cast, each plot will see that a storm is being cast, and do the first amount. However, dealing all the damage in one shot is way too overpowering, so it should be spread out over multiple turns (say, 2 or 3).
Next, I wanted to deal damage at the end of each turn. The problem is that there are two different "end of turns". The first is when a player finishes their turn. The second (end game turn) is after all player turns have ended.
I wanted to just do it so that at the end of the game turn, so any units found in a plot with storm still on it gets dealt damage, but I worry about the following scenario:
Team A has players 1 and 2, Team B has players 3 and 4. On this specific game turn, the order of the player goes 1,2,3,4. If player 3 casts a storm, he can move his units out of the way before the end of all player turns. Same with player 4. However, both players 1 and 2 will not have a turn to move their units, and thus they will be trapped in the storm getting the initial damage and the game turn damage.
Now, in a simultaneous game, because player turn order doesn't matter, I would think this would be ok (of course, you still get an advantage for casting your storm later in the simultaneous turn, since some units may be out of moves already, but I don't think that's that big a problem. Simultaneous mode is just weird anyway.
For the turn-based, the plan is that the player casts the storm. From then on, at the end of each player's turn, any unit that THAT player has left in the storm will be dealt damage. This allows for each player to have exactly one turn to move their units. After the nth turn (the duration of the storm), the storm disappears at the beginning of the turn of the player that cast it.
Also note that it is possible to place it at the beginning of a players turn rather than the end.
One problem is that a storm (which will be a group of plots somewhere around 2x2, 3x3 or some other shape around that size) is small enough that faster units (vultures, zerglings, perhaps even speed-upgraded zealots) could go right through one without stopping on that plot. They would start just above the storm, and end their turn just below, therefore going through the plot but because they didn't end their turn on it, they would be dealt no damage. Note that we could also limit it so that a unit only gets hit with a "moving into/out of a stormed plot" a limited number of times. Also, it can be made so that the affect only happens when the unit moves from a non-stormed plot to a stormed plot.
So, with all that said, before I start rambling on about code, I'm hoping to get some ideas over how the storm should work. When should units get damaged?
- Upon storms initial cast (I'm pretty certain this should be one).
- Upon beginning / end game turn.
- Upon end game / player turn.
- Whenever a unit moves into / out of a stormed plot (with or without limitations).
- Any other ideas.
Also, obviously each event can have it's own value. For example, we can set a very high initial value, a medium-level end-turn value, and a low-medium move value. I just think that whatever we choose, we should probably keep it easy to understand, rather than ridiculously complex, for both my sake and the players