Buff System

BlueMirage

Trust, but doubt.
Reaction score
39
Currently, I'm making a buff system. I didn't find anything similar to it in the Systems and Triggers section of TH, so I thought that some people would be able to find some use of it if I posted it. However, I am not sure if it works yet as I have not tried it at all yet, so I thought that it would be wise to ask if it was worth posting it at all, and how it could be improved. It's coded in vanilla JASS.

The system does (or is supposed to do) the following:

Create a generic event for "A buff is applied" and "A buff is removed".
"A buff is removed" will trigger both when a buff is removed manually, or when it expires as normal. This is done the same way Weep's Damage System activates an event and passes values.

Make it possible to get the remaining time of a buff.
Make it possible to get the currently expired time of the buff*.

Also, buffs have an "owner" and a "type". The owner of the buff determines if the buff is hostile or friendly. The type of the buff can be used for anything, it's just an attached string to the buff. Examples would be "Physical", "Fire" or "Ultimaterzorz". This might be useful because if every Fire spell in the map has a buff with the type "Fire", you would be able to create a spell that consumes all "Fire" debuffs on a unit for instant damage, or something like it.

Continuing...
Make it possible to remove buffs of specific types and owners.
Make it possible to change remaining duration, type, and owner after the buff has been created.

As a reminder, I'm posting this because I want to know if it would be worth posting this system on the site. What I would need help with would be fixing leaks (I'm terrible at realizing what leaks), and making this MUI. Currently, if two different units put the same buff on a unit, the latter one will not be recognized as an "Owner" of the buff.

*Currently, the system assumes that the duration of all buffs stacks, but not the effects. Since duration can stack, I made it so that the currently expired time of a buff can be longer than the original duration of the buff.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top