Charged Items, Belt, Hotkeys
Published February 11, 2011
Another big foundational day. I did a lot of work on splitting out combat-actor functionality into components. A combatant who can participate in battle now has two main components that take care of the functionality: CombatantComponent handles casting spells, taking steps, using items, etc... and ControllerComponent handles making the higher-level decisions such as who to attack and how to attack them. This way, I share the functionality of CombatantComponent between the player and the mobs, while giving each a different Controller. The player's controller handles messages from the input system and converts them to commands to feed to the CombatantComponent, while the mobs' controller is (or, rather, will be; still a random walk) a tunable AI capable of making basic combat decisions with the help of some support systems.
I also formalized the Cast Spell/Use Item system. I now have the capability to set cast times, use charged-use items, set spells or items to a hotkeyed belt, etc... The combatant component tracks action state and provides for interrupting spell-casts via movement, cooldowns after spells are cast, casting times, etc... It's all working pretty nicely.
I'm really feeling the effects of having limited assets, though. No casting animations are done yet, so I just default to Walk for spellcasts. Also, I still have only Generic Red Projectile and Slightly Less Ugly Cloud of Smoke for special effects. But at least the foundation is there now to provide for more.