Monday, May 12, 2008

Combat and Player statistics

Been a fun couple of days, I've finally begun implementing the combat system into the game.

There are many great additions to the game that involve this, the first is the ability to select the enemy level and graphic as well as placing them on the particular layer via the Map Editor.

Secondly is the addition of both 'Player' and 'Monster' classes to keep track of their individual actions and stats. gone is the improvised player 'Animated Sprite' object and in its place is the 'PlayerAvatar' class that inherits from 'AnimatedSprite'. This class includes stats to track health, mana, experience as well as strength, dexterity, agility, constitution, intellect, spirit and charisma. It also keeps track of what abilitys and spells the player has, operates timers to calculate delays for such moves and if they are in combat, dead or alive. also included is a ressurection point to specify where to respawn when the player dies.

Monsters also have some different stats from the player including if they are aggressive or link and how close the player has to be to then before they agro.

I've also added Health, Mana and stamina regen timers and a calculation to work out how much experience the player gains for killing each one.

so far I've only added a 'base attack' ability to test combat, the ability is added to a working action bar which allows you to click on the quickslot with the mouse or use the shortcut key to activate the ability. Or you can just double click on the monster with the mouse to perform the base attack regardless of if it is on the actionbar or not.

both monsters and the player can die. the player respawns at the res point on death and monsters are removed from the game altogether.

I've added a target circle identify which monster the player is attacking and activate the isAnimating flag to show that something is happening, its not an actual attack animation yet but monsters will at least face the player during combat. Monsters cannot move as yet.

while at it I also added a 'sprint' command by holding the shift key that makes the player run faster yet consumes a small amount of stamina over time. Abilities also consume stamina yet spells will consume mana instead, so if the player runs out of stamina the player will have to wait for it to regen before attacking again.

check out the new video to see the basic combat system in action, pay special attention to the status bar in the bottom right corner as it now accurately updates for all stats. Also you will notice I added a custom cursor for the game but the video records the old cursor as well, that is not actually displayed ingame. only the custom cursor is.

No comments: