DoubleX_RMMZ_TPBS_Countdown_States

Purpose
Lets you set some states to update its turn after some seconds in TPBS

Introduction
1. This plugin lets you set some states to have its turn count updated after a set amount of seconds in TPBS

Video


Games using this plugin
None so far

Notetags
  1.  
  2. *    ## Notetag Info
  3. *       1. Among all the same notetag types in the same data, only the 1st
  4. *          can be effective
  5. *       2. Each line can only have at most 1 notetag
  6. *       3. The following is the structure of all notetags in this plugin:
  7. *          - <doublex rmmz countdown states>
  8. *          - <countdown states>
  9. *          Where contents are in the form of type suffixes: entries
  10. *          Either of the above can be used, but the 1st one reduce the chance
  11. *          of causing other plugins to treat the notetags of this plugin as
  12. *          theirs, while the 2nd one is more user-friendly
  13. *          - type is one of the following:
  14. *            1. interval
  15. *          - suffixes is the list of suffixes in the form of:
  16. *            suffix1 suffix2 suffix3 ... suffixn
  17. *            Where each suffix is either of the following:
  18. *            val(The notetag value will be used as-is)
  19. *            switch(The value of the game switch with id as the notetag value
  20. *                   will be used)
  21. *            var(The value of the game variable with id as the notetag value
  22. *                will be used)
  23. *            (Advanced)script(The value of the game variable with id as the
  24. *                            notetag value will be used as the contents of
  25. *                            the functions to be called upon using the
  26. *                            notetag)
  27. *          - The this pointer of the script suffix is the battler involved
  28. *            (Game_Battler.prototype)
  29. *          - entries is the list of entries in the form of:
  30. *            entry1, entry2, entry3, ..., entryn
  31. *            Where entryi must conform with the suffixi specifications
  32. *----------------------------------------------------------------------------
  33. *    # State Notetags
  34. *      1. interval condSuffix intervalSuffix: condEntry, intervalEntry
  35. *         - Sets the state to be a countdown state having its turn counter
  36. *           updated with interval being the returned value of intervalEntry
  37. *           in TPBS if condEntry returns a truthy result
  38. *         - condSuffix can be val, switch or script
  39. *         - intervalEntry can be val, var or script
  40. *         - The result of condEntry can be anything as only whether it's
  41. *           truthy matters
  42. *         - If the result of condEntry is falsy, this notetag will be
  43. *           discarded upon such use cases
  44. *         - The result of intervalEntry must be a Number
  45. *         - intervalEntry being positive means the state turn counter will be
  46. *           decreased every intervalEntry seconds
  47. *         - intervalEntry being 0 means the state turn counter will be frozen
  48. *         - intervalEntry being negative means the state turn counter will be
  49. *           increased every intervalEntry seconds
  50. *         - E.g.:
  51. *           <countdown states interval switch val: 1, 2> will set the state
  52. *           to be a countdown state having its turn counter decreased every
  53. *           2 seconds if the game switch with id 1 is on
  54.  
Expand to see the code.


Author Notes
DoubleX RMMZ State Triggers can be useful when setting some events to happen upon updating the countdown state turn counters
[/SPOILER]

Prerequisites
Plugins:
1. DoubleX RMMZ Enhanced Codebase
Abilities:
1. Nothing special

Instructions
  1.  
  2. *      1. The default plugin parameters file name is
  3. *         DoubleX_RMMZ_TPBS_Countdown_States
  4. *         If you want to change that, you must edit the value of
  5. *         DoubleX_RMMZ.TPBS_Countdown_States.PLUGIN_NAME, which must be done
  6. *         via opening this plugin js file directly
  7.  
Expand to see the code.


Terms Of Use
  1.  
  2. *      1. Commercial use's always allowed and crediting me's always optional.
  3. *      2. You shall keep this plugin's Plugin Info part's contents intact.
  4. *      3. You shalln't claim that this plugin's written by anyone other than
  5. *         DoubleX or my aliases. I always reserve the right to deny you from
  6. *         using any of my plugins anymore if you've violated this.
  7. *      4. If you repost this plugin directly(rather than just linking back),
  8. *         you shall inform me of these direct repostings. I always reserve
  9. *         the right to request you to edit those direct repostings.
  10. *      5. CC BY 4.0, except those conflicting with any of the above, applies
  11. *         to this plugin, unless you've my permissions not needing follow so.
  12. *      6. I always reserve the right to deny you from using this plugin
  13. *         anymore if you've violated any of the above.
  14.  
Expand to see the code.


Contributors
  1.  
  2. *      Authors:
  3. *      1. DoubleX
  4. *      Plugin Development Collaborators:
  5. *      - None So Far
  6. *      Bug Reporters:
  7. *      - None So Far
  8. *      Compatibility Issue Raisers:
  9. *      - None So Far
  10. *      Feature Requesters:
  11. *      - None So Far
  12.  
Expand to see the code.


Changelog
  1.  
  2. *      { codebase: "1.1.0", plugin: "v1.00a" }(2020 Oct 30 GMT 1300):
  3. *      1. 1st version of this plugin finished
  4.  
Expand to see the code.


Download Link
Demo Link

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=80397