Combat Restructuring and Unseen Opponents
I made a pretty big change to the underlying architecture for combat today. As mentioned yesterday, I decided to move battles into their own class, so that the player's UI only displays battle info, and the battle manages itself. Now, each hex can have a battle, but only the one the player has joined is displayed in the UI.
I also reworked the player's options so they're easier to handle in-game. My early prototype had a growing tangle of if/else and switch statements to handle all the special cases of combat (checking range, visibility, cover, etc.). The new setup is much cleaner, and it should make it easier to add new combat moves. This is important, as there are a bunch left to add :)
I'm currently working on the concealment system in combat. Since creatures and/or the player can enter combat unseen, there needs to be some way to handle what the player and AI do in those situations. So far, I've made it such that moving closer/further from the target is impossible if it's unseen. One can still seek cover, though, or use a turn to try and spot the unseen creature.
Getting ready to look for an unseen opponent.
There are still details to work out, however. Does the creature remain visible forever after being spotted, or can it disappear again? Does anything happening in the battle affect visibility to creatures outside the battle hex, wandering the map? Can a creature remain concealed to one opponent after another opponent spots him?
I'll have to tackle those issues tomorrow. Some may not be solved until I can test it out. It's possible I will upload a build once basic combat is running, even though advanced moves and wounding aren't done. In theory, it should be an improvement over what's there in 0.940b now, and getting feedback from you guys is always helpful. We'll see!
Have a good one, and I'll catch you tomorrow!