Good progress on more infrastructure work; it’s almost at the point where there’s a playable game in there..

Here’s what’s newly implemented:

Item Powers

Weapons and Armor can now have up to 3 ItemPowers associated with them.  These powers are activated when the item is equipped and deactivated when the item is unequipped.  Here’s an example of some ItemPowers:

itempowers

Those are specified in an ItemDefn using the now-familiar Event/Action XML definition.  The first heals ItemPower heals the wielder/wearer every time they hit a target, the second burns the equipper whenever they move, and the third gives a 2.5x damage multiplier when the equipper damages a target.  While these examples aren’t very real-worldy, they do demonstrate the flexibility with which I can now create unique/special weapons and armor (without touching code).  My current thinking is that there will be many items with ‘standard’ powers (e.g. damage multipliers, stats modifiers, etc), a smaller number of items with ‘special’ powers (e.g. named “Vampiric” swords with buffs that drain life on hit), and later on I’ll also add in the concept of “Item Augmentation”, where a player can add practically any power they want (once unlocked) to any item they want.

Passive Skills

As the player plays the game, they will unlock Skills.  Skills fall into one of four categories; Offensive, Defensive, Support, and Passive.  The player will unlock numerous skills in each of those categories, but will only be able to “activate” one of them from each category at a time.  The first categories are active and triggered when a Skill button is clicked by the player.  The 4th category is always active whenever the skill is selected.  I’ve added in support for Passive skills, which primarily involved adding Action_ActivateSkill and Action_DeactivateSkill functions.  Thanks to the Event/Action architecture, I just add an action to fire the Skill’s Action when a “HasBeenActivated” event is fired on it, and the active skill is now a passive one.

Damage Modifier Passive Skills

These took a bit of work to hook up.  The third ItemPower above demonstrates a Damage Modifier buff; they can now also be added as Passive skills.  Many of the skills in the Passive category will be Damage Modifiers.

Data-driven class definitions

Character classes (warrior, rogue, …) were previously hardcoded in the code; they’re now defined in the XLS as PlayerClassDefns along with all the other defns.Here’s what that looks like with some test data:

classes

Items of interest:

  • Each class will start with three starting skills from the aforementioned Skill categories.  These are defined by id and automatically hooked up when the character player is instantiated
  • You can point at any tileset for the character; it doesn’t require anything custom.  One of the cool things about that is that it’ll allow me to create classes leveraging existing art for other mobs, and to support things like changing the player’s appearance with little code.
  • Adding new classes will be very easy now from a coding POV (requiring practically none) – they’ll be a balancing and art exercise.
  • Over time, I can also easily add the ability to choose the player’s Race if I wish; it’ll largely match the above, with “racial traits” (damage modifiers and other events) replacing StartingSkills.

Here’s what it looks like (for now) when you create a warrior, which per the picture above is now using the skeletonwarrior1 tileset:

warrioor

All the animations and everything work, which is pretty cool.

Up Next

Up next: I’m going to jump ahead a bit and add in the Attack/Defend flow along with weapons, armor, damage reduction, modifiers, etc; then I’ll ensure items and mobs are added in a level-appropriate way.  After that it’ll be implementing some basic monster AI and I’ll have a basically playable game.  I’m hoping to get there by the end of the coming weekend (maybe sooner!)

Advertisements