Friday, July 5, 2013

Refactoring Continues

The foe data model has been refactored out to be based entirely on UnifiedActor. The upshot is that Foes now have access to a number of things that only PlayerCharacters had before (e.g. inventory, equipable slots, wielding combos, race, class (and multi-classing), gender, spellbooks), while PCs in turn have access to a few things that were once Foe-only (e.g. arbitrary body parts).

What remains of the refactoring is to generalise a number of features of Foes that get in the way of letting them just use items - notably the FoeAttacks. These will get refactored out into Natural Weapons associated with body parts, special abilities, and the existing spellbooks. A nice side effect of this is that PlayerCharacters will have access to natural weapons and multiple special abilities with a little more work. Yetis, I think, will get claw attacks.

After that it's on to writing some AI for foes to actually equip and use the items where possible. Each foe will get it's items from the configured loot table, and before combat get a chance to load out whatever slots it has available to best effect.

The indefatigable Rob A has done some invaluable testing and has filed a bunch of issues over in the tracked at SourceForge, which I will get onto after that.

No comments:

Post a Comment