In my previous posts about inventory and quest task design, pspeed introduced the idea of “ObjectActions” or so-called “Methods” which are a piece of groovy scripts that can be registered for a specific object type and I can run them by their names.
For example, I can have a fireball spell that has a “Cast” method registered to that spell. When the “Cast” method runs it will do the game logic there (i.e it will initialize necessary entities,…)
or I can have a sword item in player inventory that has an “Attack” method registered to that sword type. When it is called I am going to do the attack logic there.
Here is where I am so far.
In this post, I want to know how I can add the idea of “Skills” to this approach. I see skills as the ability to use an item.
Say I have a sword item and I can do an Attack with this sword but I can do this attack in many ways, a quick sword attack, a heavy sword attack or a jump and slash, and may more. I am calling theme melee attack skills.
I want these skills to get unlocked for the player as he gains more experience with that item. Also, I want them to get applied automatically when using an item. For example, when I do an Attack action with a sword I want it automatically decide if it should do a light attack or heavy attack, or a jump-slash,…
But not sure how should I implement this skill system. Any idea?
The way I see, each skill is an entity that is buffed to the player.
And say when I call the “Attack” method on sword item, there I can check all available skills and select one, is this right? Should I do all this inside the “Attack” method?
Do you have any suggestions?
Will appreciate any help