Jump to content

Adding Abilities? We can proposal?


Lion.Kanzen
 Share

Recommended Posts

Spoiler

This patch changes the Upgrade.js component into an "Abilities.js" component, that can do a lot more. In fact, perhaps a little too much, but I don't really see how this could be updated to support an arbitrary number of different and custom abilities in another, saner way.

To show the flexibility of this new component, I have removed Upgrade entirely, and I have also removed the Gate panel in the Gui, replaced by abilities (no difference from the user POV).
In principle, this can be used to create mostly any stateless ability (key being stateless), though this can have a temporary state while active (e.g. for a timer). Exemples would include self-destruct, damage around yourself, all the current cheats, transforming entities into other entities, activating spells, locking/unlocking gates, choosing seeds for farms, mounting/dismounting units and really whatever.

Current features include:
-a charging time (taken from upgrade.js)
-a cool down time
-incompatible abilities (in two shapes)
-supports arbitrary code and is extensible (might be dangerous, need 2nd opinion)
-GUI support

Ultimately, it should be easy-ish to extend this to allow God Powers like in AoM, since an ability can remain "ready" eternally once charged, and we could add GUI elements to click an ability, then click an entity and trigger it there or whatever really.
It should also be reasonably easy to extend this to have a limited number of uses per ability, and to have more advanced conditions to trigger abilities.

https://code.wildfiregames.com/D281

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...