I've been working on an Action RPG Framework. It'll provide almost everything you need to create a game. If you define some turfs, items, enemies, and make a map, you'll have a game. It's not ready to be released, but here are some screenshots of what it contains:
To create the melee attack, you just need this code:
The framework provides the base /Ability object whose use() proc gets called when you use an ability. The melee_target proc is a helper proc that belongs to the Ability object.
The Combat object is a global instance of the /Combat type which contains all of the procs for attacking and dealing damage. It's default implementation is simple but you can use it to add effects like damage reduction from armor. Since all damage is handled in that object, you just have to implement damage reduction in one place.
I'm not sure to what extent enemy AI will be handled for you. Currently, the framework activates mobs when a client is near them and deactivates them when no clients are nearby. The actual AI is up to you but the framework can provide helper procs to make it easy to implement.
The framework provides the on-screen interface elements. You can customize how they look by changing the icon file they use. I expect that novice users will use these interface elements exactly as they are. They give you some flexibility (ex: you can easily change how large the inventory is), but if you want to make huge changes to them you'll have to implement your own on-screen inventory.
Here are the full lists of features I've implemented and features I'd like to implement before posting it:
Features it contains:
* Enemy AI foundation with some basic helper procs
* Deactivates mobs when no players are nearby
* Combat, damage, and death
* Health, mana, money, experience, and level vars
* The Ability object for skills, abilities, attacks, spells, etc.
- basic helper procs to use an ability, get a target, etc.
* On-screen health and mana meters
* On-screen inventory display (w/ ability to equip or use items)
* On-screen looting interface (w/ ability to pick up items)
* Ranged attacks
* On-screen money and experience display
* Inventory management (figuring out if you can hold an item)
* Support for stackable items
Features I'd like to add:
* On-screen shopkeeper interface
* On-screen townsperson interface
* Townsperson AI (limited wandering)
* Helper procs for more advanced enemy AI
* Better basic enemy AI
* Items that apply stat bonuses
* Saving and loading
* Examples of items you can use
* More graphics (overlays, weapons, etc.)
* Demos to show isolated features
* A comprehensive sample game
I'm still not sure how much will be handled by the framework and how much will be handled by the games that use the framework. The framework defines money, experience, and level vars. This way it can provide the interface to display them and the procs to update their values. But, if you don't want to have experience or level ups in your game, you're free to not use those vars.
The user will have to implement enemy AI and all attacks, but the library can make it easier to write them. The user will have to define all items but the library provides the inventory management, looting, stacked items, and equipping/unequipping. I'm not sure how the framework will handle bonuses from equipment. It doesn't define equipment slots but gives you an "equipment" list that's an associated list where equipment["slot"] is the item equipped in the slot named "slot". You're free to define whatever slots you need and it'll call the equip/unequip procs as you change your equipment.
Giving bonuses to equipment might be as easy as overriding the item's equip/unequip procs:
Currently, stats like power, strength, speed, and defense aren't defined by the framework. They're completely up to you. It defines health since it's a pretty safe bet you'll have health values, but who knows what stats you'll want to have. These stats will be used by abilities and the Combat object. An ability computes a damage value (this is where stats like strength would be taken into account) and uses the Combat object to inflict the damage. The combat object is where you'd take defensive stats into account. The procs of the Combat object are easy to override so this will be easy to add, it'd be something like: