Advertisement
Double_X

DoubleX RMMV Skill Progress v100a

Nov 4th, 2019 (edited)
774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*============================================================================
  2.  *    ## Plugin Info
  3.  *----------------------------------------------------------------------------
  4.  *    # Plugin Name
  5.  *      DoubleX RMMV Skill Progress
  6.  *----------------------------------------------------------------------------
  7.  *    # Introduction
  8.  *    1. This plugin lets users to set some skills to progress to some other
  9.  *       skills after gaining enough skill experience and meeting some
  10.  *       prerequisites, like progressing from Fire I to Fire II when the
  11.  *       actor's at least level 9 and gained 100 skill experience for Fire I
  12.  *    2. Skill experience's gained from using that skill as well as hitting
  13.  *       targets with that skill
  14.  *----------------------------------------------------------------------------
  15.  *    # Terms Of Use
  16.  *      1. Commercial use's always allowed and crediting me's always optional.
  17.  *      2. You shall keep this plugin's Plugin Info part's contents intact.
  18.  *      3. You shalln't claim that this plugin's written by anyone other than
  19.  *         DoubleX or my aliases. I always reserve the right to deny you from
  20.  *         using any of my plugins anymore if you've violated this.
  21.  *      4. If you repost this plugin directly(rather than just linking back),
  22.  *         you shall inform me of these direct repostings. I always reserve
  23.  *         the right to request you to edit those direct repostings.
  24.  *      5. CC BY 4.0, except those conflicting with any of the above, applies
  25.  *         to this plugin, unless you've my permissions not needing follow so.
  26.  *      6. I always reserve the right to deny you from using this plugin
  27.  *         anymore if you've violated any of the above.
  28.  *----------------------------------------------------------------------------
  29.  *    # Prerequisites
  30.  *      Abilities:
  31.  *      1. Nothing special for most ordinary cases
  32.  *      2. Little RMMV plugin development proficiency for more advanced uses
  33.  *      3. Some RMMV plugin development proficiency to fully utilize this
  34.  *         plugin in intended ways
  35.  *      4. Decent RMMV plugin development proficiency to fully utilize this
  36.  *         plugin with creative and unintended uses
  37.  *----------------------------------------------------------------------------
  38.  *    # Author Notes
  39.  *      1. DoubleX RMMV Skill Progress aims to give extreme control and
  40.  *         freedom to users by making it as flexible as I can with as little
  41.  *         damage to user-friendliness as I can
  42.  *      2. The configuration region is generally for more advanced uses, as
  43.  *         most ordinary cases should be covered by parameters and notetags
  44.  *      3. (Advanced)You might have to have a basic knowledge on what this
  45.  *         Plugin Implementation does to fully utilize this plugin in intended
  46.  *         ways and solid understanding on how this Plugin Implementation
  47.  *         works to fully utilize this plugin with creative and unintended
  48.  *         uses
  49.  *----------------------------------------------------------------------------
  50.  *    # Links
  51.  *      This plugin:
  52.  *      1. https://pastebin.com/6XdtFJYD
  53.  *      Video:
  54.  *      1. https://www.youtube.com/watch?v=ly6LlNpo8jc
  55.  *      DoubleX RMMV Skill Progress Unit Test:
  56.  *      1. https://pastebin.com/NzQVER8u
  57.  *      DoubleX RMMV Skill Progress Compatibility:
  58.  *      1. https://pastebin.com/PhPhgJry
  59.  *      Mentioned Patreon Supporters:
  60.  *      https://www.patreon.com/posts/71738797
  61.  *----------------------------------------------------------------------------
  62.  *    # Instructions
  63.  *      1. If you want to edit configurations instead of parameters, you must
  64.  *         open this js file to access its configuration region
  65.  *      2. The default plugin file name is doublex_rmmv_skill_progress_v100a
  66.  *         If you want to change that, you must edit the value of
  67.  *         DoubleX_RMMV.Skill_Progress_File, which must be done via opening
  68.  *         this plugin js file directly
  69.  *      3. If you wish to use DoubleX RMMV Skill Progress Unit Test, place it
  70.  *         right below this plugin
  71.  *----------------------------------------------------------------------------
  72.  *    # Author
  73.  *      DoubleX
  74.  *----------------------------------------------------------------------------
  75.  *    # Changelog
  76.  *      v1.00a(GMT 0400 13-Nov-2019):
  77.  *      1. 1st version of this plugin finished
  78.  *----------------------------------------------------------------------------
  79.  *    # Todo
  80.  *      1. Add <skill progress instant suffix1: entry1>, where a falsy result
  81.  *         from entry1 will let players to end progressing the skill at
  82.  *         anytime they choose instead of always immediately
  83.  *============================================================================*/
  84. /*:
  85.  * @plugindesc Lets you to set some skills to progress to some other skills
  86.  * after gaining enough skill experience and meeting some prerequisites
  87.  * @author DoubleX
  88.  *
  89.  * @param isEnabled
  90.  * @desc Sets whether this plugin will be enabled
  91.  * It'll be the contents of a function returning a Boolean
  92.  * @default return true;
  93.  *
  94.  * @param condNotePriority
  95.  * @desc Sets the data type priority of cond notetags
  96.  * It'll be the contents of a function returning an String Array
  97.  * @default return ["states", "armors", "weapons", "currentClass", "actor"];
  98.  *
  99.  * @param condNoteChainingRule
  100.  * @desc Sets how to use multiple cond notetags
  101.  * It'll be the contents of a function returning a String
  102.  * @default return "every";
  103.  *
  104.  * @param defaultMax
  105.  * @desc Sets the default max experience before chaining max notetags
  106.  * It'll be the contents of a function returning a positive Number
  107.  * @default return 10;
  108.  *
  109.  * @param maxNotePriority
  110.  * @desc Sets the data type priority of max notetags
  111.  * It'll be the contents of a function returning a String Array
  112.  * @default return ["states", "armors", "weapons", "currentClass", "actor"];
  113.  *
  114.  * @param maxNoteChainingRule
  115.  * @desc Sets how to use multiple max notetags
  116.  * It'll be the contents of a function returning a String
  117.  * @default return "/";
  118.  *
  119.  * @param defaultUseGain
  120.  * @desc Sets the default useGain before chaining useGain notetags
  121.  * It'll be the contents of a function returning a Number
  122.  * @default return 2;
  123.  *
  124.  * @param useGainNotePriority
  125.  * @desc Sets the data type priority of useGain notetags
  126.  * It'll be the contents of a function returning an String Array
  127.  * @default return ["states", "armors", "weapons", "currentClass", "actor"];
  128.  *
  129.  * @param useGainNoteChainingRule
  130.  * @desc Sets how to use multiple useGain notetags
  131.  * It'll be the contents of a function returning a String
  132.  * @default return "*";
  133.  *
  134.  * @param defaultHitGain
  135.  * @desc Sets the default hitGain before chaining hitGain notetags
  136.  * It'll be the contents of a function returning a Number
  137.  * @default return 1;
  138.  *
  139.  * @param hitGainNotePriority
  140.  * @desc Sets the data type priority of hitGain notetags
  141.  * It'll be the contents of a function returning an String Array
  142.  * @default return ["states", "armors", "weapons", "currentClass", "actor"];
  143.  *
  144.  * @param hitGainNoteChainingRule
  145.  * @desc Sets how to use multiple hitGain notetags
  146.  * It'll be the contents of a function returning a String
  147.  * @default return "*";
  148.  *
  149.  * @param nextNotePriority
  150.  * @desc Sets the data type priority of next notetags
  151.  * It'll be the contents of a function returning an String Array
  152.  * @default return ["actor", "currentClass"];
  153.  *
  154.  * @param nextNoteChainingRule
  155.  * @desc Sets how to use multiple next notetags
  156.  * It'll be the contents of a function returning a String
  157.  * @default return "every";
  158.  *
  159.  * @param defaultKeepCurrent
  160.  * @desc Set default keepCurrent before chaining keepCurrent notetags
  161.  * It'll be the contents of a function returning a Boolean
  162.  * @default return true;
  163.  *
  164.  * @param keepCurrentNotePriority
  165.  * @desc Sets the data type priority of keepCurrent notetags
  166.  * It'll be the contents of a function returning an String Array
  167.  * @default return ["actor", "currentClass"];
  168.  *
  169.  * @param keepCurrentNoteChainingRule
  170.  * @desc Sets how to use multiple keepCurrent notetags
  171.  * It'll be the contents of a function returning a String
  172.  * @default return "first";
  173.  *
  174.  * @param willEnd
  175.  * @desc Sets what will happen right before progressing a skill
  176.  * It'll be the contents of a function with its return value unused
  177.  * @default
  178.  *
  179.  * @param willEndNotePriority
  180.  * @desc Sets the data type priority of willEnd notetags
  181.  * It'll be the contents of a function returning an String Array
  182.  * @default return ["states", "armors", "weapons", "currentClass", "actor"];
  183.  *
  184.  * @param willEndNoteChainingRule
  185.  * @desc Sets how to use multiple willEnd notetags
  186.  * It'll be the contents of a function returning a String
  187.  * @default return "every";
  188.  *
  189.  * @param didEnd
  190.  * @desc Sets what will happen right after progressing a skill
  191.  * It'll be the contents of a function with its return value unused
  192.  * @default $gameTemp.reserveCommonEvent(1);
  193.  *
  194.  * @param didEndNotePriority
  195.  * @desc Sets the data type priority of didEnd notetags
  196.  * It'll be the contents of a function returning an String Array
  197.  * @default return ["states", "armors", "weapons", "currentClass", "actor"];
  198.  *
  199.  * @param didEndNoteChainingRule
  200.  * @desc Sets how to use multiple didEnd notetags
  201.  * It'll be the contents of a function returning a String
  202.  * @default return "every";
  203.  *
  204.  * @param cmdLineH
  205.  * @desc Sets the skill progress command window line height
  206.  * It'll be the contents of a function returning a Number
  207.  * @default return Window_Command.prototype.lineHeight.call(this);
  208.  *
  209.  * @param cmdFontSize
  210.  * @desc Sets the skill progress command window standard font size
  211.  * It'll be the contents of a function returning a Number
  212.  * @default return Window_Command.prototype.standardFontSize.call(this);
  213.  *
  214.  * @param cmdPadding
  215.  * @desc Sets the skill progress command window standard padding
  216.  * It'll be the contents of a function returning a Number
  217.  * @default return Window_Command.prototype.standardPadding.call(this);
  218.  *
  219.  * @param cmdTextPadding
  220.  * @desc Sets the skill progress command window text padding
  221.  * It'll be the contents of a function returning a Number
  222.  * @default return Window_Command.prototype.textPadding.call(this);
  223.  *
  224.  * @param cmdBackOpacity
  225.  * @desc Sets the skill progress command window standard back opacity
  226.  * It'll be the contents of a function returning a Number
  227.  * @default return Window_Command.prototype.standardBackOpacity.call(this);
  228.  *
  229.  * @param cmdTranslucentOpacity
  230.  * @desc Sets the skill progress command window translucent opacity
  231.  * It'll be the contents of a function returning a Number
  232.  * @default return Window_Command.prototype.translucentOpacity.call(this);
  233.  *
  234.  * @param cmdSpacing
  235.  * @desc Sets the skill progress command window spacing
  236.  * It'll be the contents of a function returning a Number
  237.  * @default return Window_Command.prototype.spacing.call(this);
  238.  *
  239.  * @param cmdWinW
  240.  * @desc Sets the skill progress command window width
  241.  * It'll be the contents of a function returning a Number
  242.  * @default return Window_Command.prototype.windowWidth.call(this);
  243.  *
  244.  * @param cmdWinH
  245.  * @desc Sets the skill progress command window height
  246.  * It'll be the contents of a function returning a Number
  247.  * @default return Window_Command.prototype.windowHeight.call(this);
  248.  *
  249.  * @param cmdWinX
  250.  * @desc Sets the skill progress command window x position
  251.  * It'll be the contents of a function returning a Number
  252.  * @default return 0;
  253.  *
  254.  * @param cmdWinY
  255.  * @desc Sets the skill progress command window y position
  256.  * It'll be the contents of a function returning a Number
  257.  * @default return 0;
  258.  *
  259.  * @param cmdView
  260.  * @desc Sets the skill progress command window view progress command text
  261.  * It'll be the contents of a function returning a String
  262.  * @default return "View Progress";
  263.  *
  264.  * @param cmdUse
  265.  * @desc Sets the skill progress command window use skill command text
  266.  * It'll be the contents of a function returning a String
  267.  * @default return "Use";
  268.  *
  269.  * @param statLineH
  270.  * @desc Sets the skill progress stat window line height
  271.  * It'll be the contents of a function returning a Number
  272.  * @default return Window_Selectable.prototype.lineHeight.call(this);
  273.  *
  274.  * @param statFontSize
  275.  * @desc Sets the skill progress stat window standard font size
  276.  * It'll be the contents of a function returning a Number
  277.  * @default return Window_Selectable.prototype.standardFontSize.call(this);
  278.  *
  279.  * @param statPadding
  280.  * @desc Sets the skill progress stat window standard padding
  281.  * It'll be the contents of a function returning a Number
  282.  * @default return Window_Selectable.prototype.standardPadding.call(this);
  283.  *
  284.  * @param statTextPadding
  285.  * @desc Sets the skill progress stat window text padding
  286.  * It'll be the contents of a function returning a Number
  287.  * @default return Window_Selectable.prototype.textPadding.call(this);
  288.  *
  289.  * @param statBackOpacity
  290.  * @desc Sets the skill progress stat window standard back opacity
  291.  * It'll be the contents of a function returning a Number
  292.  * @default return Window_Selectable.prototype.standardBackOpacity.call(this);
  293.  *
  294.  * @param statTranslucentOpacity
  295.  * @desc Sets the skill progress stat window translucent opacity
  296.  * It'll be the contents of a function returning a Number
  297.  * @default return Window_Selectable.prototype.translucentOpacity.call(this);
  298.  *
  299.  * @param statSpacing
  300.  * @desc Sets the skill progress stat window spacing
  301.  * It'll be the contents of a function returning a Number
  302.  * @default return Window_Selectable.prototype.spacing.call(this);
  303.  *
  304.  * @param statWinW
  305.  * @desc Sets the skill progress stat window width
  306.  * It'll be the contents of a function returning a Number
  307.  * @default return Graphics.boxWidth;
  308.  *
  309.  * @param statWinH
  310.  * @desc Sets the skill progress stat window height
  311.  * It'll be the contents of a function returning a Number
  312.  * @default return this.fittingHeight(2);
  313.  *
  314.  * @param statWinX
  315.  * @desc Sets the skill progress stat window x position
  316.  * It'll be the contents of a function returning a Number
  317.  * @default return 0;
  318.  *
  319.  * @param statWinY
  320.  * @desc Sets the skill progress stat window y position
  321.  * It'll be the contents of a function returning a Number
  322.  * @default return 0;
  323.  *
  324.  * @param condLineH
  325.  * @desc Sets the skill progress condition window line height
  326.  * It'll be the contents of a function returning a Number
  327.  * @default return Window_Selectable.prototype.lineHeight.call(this);
  328.  *
  329.  * @param condFontSize
  330.  * @desc Sets the skill progress condition window standard font size
  331.  * It'll be the contents of a function returning a Number
  332.  * @default return Window_Selectable.prototype.standardFontSize.call(this);
  333.  *
  334.  * @param condPadding
  335.  * @desc Sets the skill progress condition window standard padding
  336.  * It'll be the contents of a function returning a Number
  337.  * @default return Window_Selectable.prototype.standardPadding.call(this);
  338.  *
  339.  * @param condTextPadding
  340.  * @desc Sets the skill progress condition window text padding
  341.  * It'll be the contents of a function returning a Number
  342.  * @default return Window_Selectable.prototype.textPadding.call(this);
  343.  *
  344.  * @param condBackOpacity
  345.  * @desc Sets the skill progress condition window standard back opacity
  346.  * It'll be the contents of a function returning a Number
  347.  * @default return Window_Selectable.prototype.standardBackOpacity.call(this);
  348.  *
  349.  * @param condTranslucentOpacity
  350.  * @desc Sets the skill progress condition window translucent opacity
  351.  * It'll be the contents of a function returning a Number
  352.  * @default return Window_Selectable.prototype.translucentOpacity.call(this);
  353.  *
  354.  * @param condSpacing
  355.  * @desc Sets the skill progress condition window spacing
  356.  * It'll be the contents of a function returning a Number
  357.  * @default return Window_Selectable.prototype.spacing.call(this);
  358.  *
  359.  * @param condWinW
  360.  * @desc Sets the skill progress condition window width
  361.  * It'll be the contents of a function returning a Number
  362.  * @default return Graphics.boxWidth / 2;
  363.  *
  364.  * @param condWinH
  365.  * @desc Sets the skill progress condition window height
  366.  * It'll be the contents of a function returning a Number
  367.  * @default return Graphics.boxHeight - this.fittingHeight(2);
  368.  *
  369.  * @param condWinX
  370.  * @desc Sets the skill progress condition window x position
  371.  * It'll be the contents of a function returning a Number
  372.  * @default return 0;
  373.  *
  374.  * @param condWinY
  375.  * @desc Sets the skill progress condition window y position
  376.  * It'll be the contents of a function returning a Number
  377.  * @default return this.fittingHeight(2);
  378.  *
  379.  * @param nextLineH
  380.  * @desc Sets the skill progress next skill window line height
  381.  * It'll be the contents of a function returning a Number
  382.  * @default return Window_Selectable.prototype.lineHeight.call(this);
  383.  *
  384.  * @param nextFontSize
  385.  * @desc Sets the skill progress next skill window standard font size
  386.  * It'll be the contents of a function returning a Number
  387.  * @default return Window_Selectable.prototype.standardFontSize.call(this);
  388.  *
  389.  * @param nextPadding
  390.  * @desc Sets the skill progress next skill window standard padding
  391.  * It'll be the contents of a function returning a Number
  392.  * @default return Window_Selectable.prototype.standardPadding.call(this);
  393.  *
  394.  * @param nextTextPadding
  395.  * @desc Sets the skill progress next skill window text padding
  396.  * It'll be the contents of a function returning a Number
  397.  * @default return Window_Selectable.prototype.textPadding.call(this);
  398.  *
  399.  * @param nextBackOpacity
  400.  * @desc Sets the skill progress next skill window standard back opacity
  401.  * It'll be the contents of a function returning a Number
  402.  * @default return Window_Selectable.prototype.standardBackOpacity.call(this);
  403.  *
  404.  * @param nextTranslucentOpacity
  405.  * @desc Sets the skill progress next skill window translucent opacity
  406.  * It'll be the contents of a function returning a Number
  407.  * @default return Window_Selectable.prototype.translucentOpacity.call(this);
  408.  *
  409.  * @param nextSpacing
  410.  * @desc Sets the skill progress next skill window spacing
  411.  * It'll be the contents of a function returning a Number
  412.  * @default return Window_Selectable.prototype.spacing.call(this);
  413.  *
  414.  * @param nextWinW
  415.  * @desc Sets the skill progress next skill window width
  416.  * It'll be the contents of a function returning a Number
  417.  * @default return Graphics.boxWidth / 2;
  418.  *
  419.  * @param nextWinH
  420.  * @desc Sets the skill progress next skill window height
  421.  * It'll be the contents of a function returning a Number
  422.  * @default return Graphics.boxHeight - this.fittingHeight(2);
  423.  *
  424.  * @param nextWinX
  425.  * @desc Sets the skill progress next skill window x position
  426.  * It'll be the contents of a function returning a Number
  427.  * @default return Graphics.boxWidth / 2;
  428.  *
  429.  * @param nextWinY
  430.  * @desc Sets the skill progress next skill window y position
  431.  * It'll be the contents of a function returning a Number
  432.  * @default return this.fittingHeight(2);
  433.  *
  434.  * @param varIds
  435.  * @desc Sets the list of ids of game variables used by this plugin
  436.  * It'll be the contents of a function returning a Number Array
  437.  * @default return [];
  438.  *
  439.  * @param switchIds
  440.  * @desc Sets the list of ids of game switches used by this plugin
  441.  * It'll be the contents of a function returning a Number Array
  442.  * @default return [];
  443.  *
  444.  * @help
  445.  *============================================================================
  446.  *    ## Parameter/Configurations Info
  447.  *----------------------------------------------------------------------------
  448.  *    # General
  449.  *      The below points apply to all parameters/configurations unless stated
  450.  *      otherwise:
  451.  *      1. If the value of a parameter's empty, its configuration counterpart
  452.  *         will be used instead(Reference tag: PARAMETERS_CONFIGURATIONS)
  453.  *         - E.g.: Setting the parameter isEnabled as empty means that the
  454.  *                 configuration isEnabled will be used instead
  455.  *      2. (Advanced)The this pointer referring to the actor involved as the
  456.  *         function contexts are Game_Actor.prototype
  457.  *         (Reference tag: THIS_GAME_ACTOR)
  458.  *      3. (Advanced)Don't change the name nor the ordering of any function
  459.  *         arguments unless you really know what you're truly doing
  460.  *      4. (Advanced)The functions supposedly to return a value should be
  461.  *         Nullipotent
  462.  *      5. (Advanced)Returning highly nondeterministic values like random ones
  463.  *         will have to manually invalidate the corresponding cache first or
  464.  *         those values might be ignored due to the cached ones being used
  465.  *    # Function arguments
  466.  *      1. isEnabled
  467.  *         None
  468.  *      2. willEnd
  469.  *      3. didEnd
  470.  *      4. condNotePriority
  471.  *      5. condNoteChainingRule
  472.  *      6. defaultMax
  473.  *      7. maxNotePriority
  474.  *      8. maxNoteChainingRule
  475.  *      9. defaultUseGain
  476.  *      10. useGainNotePriority
  477.  *      11. useGainNoteChainingRule
  478.  *          skillId - The id of the skill involved
  479.  *      12. defaultHitGain
  480.  *          skillId - The id of the skill involved
  481.  *          target - The target hit by the skill involved
  482.  *          value - The damage of the hit involved
  483.  *      13. hitGainNotePriority
  484.  *      14. hitGainNoteChainingRule
  485.  *      15. nextNotePriority
  486.  *      16. nextNoteChainingRule
  487.  *      17. defaultKeepCurrent
  488.  *      18. keepCurrentNotePriority
  489.  *      19. kepCurrentNoteChainingRule
  490.  *      20. willEndNotePriority
  491.  *      21. willEndNoteChainingRule
  492.  *      22. didEndNotePriority
  493.  *      23. didEndNoteChainingRule
  494.  *          skillId - The id of the skill involved
  495.  *      24. cmdLineH
  496.  *      25. cmdFontSize
  497.  *      26. cmdPadding
  498.  *      27. cmdTextPadding
  499.  *      28. cmdBackOpacity
  500.  *      29. cmdTranslucentOpacity
  501.  *      30. cmdSpacing
  502.  *      31. cmdWinW
  503.  *      32. cmdWinH
  504.  *      33. cmdWinX
  505.  *      34. cmdWinY
  506.  *      35. cmdView
  507.  *      36. cmdUse
  508.  *      37. statLineH
  509.  *      38. statFontSize
  510.  *      39. statPadding
  511.  *      40. statTextPadding
  512.  *      41. statBackOpacity
  513.  *      42. statTranslucentOpacity
  514.  *      43. statSpacing
  515.  *      44. statWinW
  516.  *      45. statWinH
  517.  *      46. statWinX
  518.  *      47. statWinY
  519.  *      48. condLineH
  520.  *      49. condFontSize
  521.  *      50. condPadding
  522.  *      51. condTextPadding
  523.  *      52. condBackOpacity
  524.  *      53. condTranslucentOpacity
  525.  *      54. condSpacing
  526.  *      55. condWinW
  527.  *      56. condWinH
  528.  *      57. condWinX
  529.  *      58. condWinY
  530.  *      59. nextLineH
  531.  *      60. nextFontSize
  532.  *      61. nextPadding
  533.  *      62. nextTextPadding
  534.  *      63. nextBackOpacity
  535.  *      64. nextTranslucentOpacity
  536.  *      65. nextSpacing
  537.  *      66. nextWinW
  538.  *      67. nextWinH
  539.  *      68. nextWinX
  540.  *      69. nextWinY
  541.  *      70. varIds
  542.  *      71. switchIds
  543.  *          None
  544.  *    # Valid values
  545.  *      1. isEnabled
  546.  *         Any valid Javascript(It'll always be regarded as truthy/falsy)
  547.  *         It'll only be used as a prerequisite when checking whether the
  548.  *         skill involved can progress
  549.  *      2. willEnd
  550.  *      3. didEnd
  551.  *         Any valid Javascript
  552.  *      4. condNotePriority
  553.  *         Note that skills always have the highest priority
  554.  *         Any valid Javascript returning an Array having the below String:
  555.  *         - "states" States in the States category
  556.  *         - "armors" Armors in the Armors category
  557.  *         - "weapons" Weapons in the Weapons category
  558.  *         - "currentClass" Classes in the Classes category
  559.  *         - "actor" Actors in the Actors category
  560.  *         (Reference tag: NOTE_DATA_TYPES)
  561.  *         The effective notetag priority among data types are sorted
  562.  *         ascendingly in the array
  563.  *         The effective notetag priority among the same data type are the
  564.  *         same as the other priorities among there
  565.  *         Notetags of data belonging types not included in the array won't be
  566.  *         effective
  567.  *      5. condNoteChainingRule
  568.  *         Any valid Javascript returning any of the below String:
  569.  *         - "first"(Only the 1st notetag of the involved skill will be used)
  570.  *         - "every"(All effective notetags must return truthy to be regarded
  571.  *                   as truthy)
  572.  *         - "last"(Only the last effective notetag will be used)
  573.  *         - "some"(All effective notetags must return falsy to be regarded as
  574.  *                 falsy)
  575.  *         All invalid values will be regarded as "first"
  576.  *         (Reference tag: DEFAULT_CHAINING_RULE_FIRST)
  577.  *      6. defaultMax
  578.  *         Any valid Javascript returning a positive Number
  579.  *      7. maxNotePriority
  580.  *         Same as those mentioned in condNotePriority
  581.  *      8. maxNoteChainingRule
  582.  *         Any valid Javascript returning any of the below String:
  583.  *         - "first"(Only the 1st notetag of the involved skill will be used)
  584.  *         - "+"(The results of all effective notetags will be added)
  585.  *         - "-"(The results of all effective notetags will be subtracted)
  586.  *         - "*"(The results of all effective notetags will be multiplied)
  587.  *         - "/"(The results of all effective notetags will be divided)
  588.  *         - "%"(The results of all effective notetags will be remainders)
  589.  *         - (Advanced)"="(The results of effective notetags with higher
  590.  *                         priorities will be replaced by those with lower
  591.  *                         priorities, leading to maximum flexibilities)
  592.  *         - "last"(Only the last effective notetag will be used)
  593.  *         ("=" and "last" are different only for more advanced/creative uses)
  594.  *         (Reference tag: NOTE_OPERATORS)
  595.  *         All invalid values will be regarded as "first"
  596.  *         (Reference tag: DEFAULT_CHAINING_RULE_FIRST)
  597.  *      9. defaultUseGain
  598.  *         Any valid Javascript returning a Number
  599.  *      10. useGainNotePriority
  600.  *          Same as those mentioned in condNotePriority
  601.  *      11. useGainNoteChainingRule
  602.  *          Same as those mentioned in maxNoteChainingRule
  603.  *      12. defaultHitGain
  604.  *          Same as those mentioned in defaultUseGain
  605.  *      13. hitGainNotePriority
  606.  *          Same as those mentioned in condNotePriority
  607.  *      14. hitGainNoteChainingRule
  608.  *          Same as those mentioned in maxNoteChainingRule
  609.  *      15. nextNotePriority
  610.  *          Same as those mentioned in condNotePriority
  611.  *      16. nextNoteChainingRule
  612.  *          Any valid Javascript returning any of the below String:
  613.  *          - "first"(Only the 1st value of the 1st notetag of the involved
  614.  *                    skill will be used)
  615.  *          - "every"(All values of all effective notetags will be used)
  616.  *          - "last"(Only the last value of the last effective notetag will be
  617.  *                   used)
  618.  *          All invalid values will be regarded as "first"
  619.  *          (Reference tag: DEFAULT_CHAINING_RULE_FIRST)
  620.  *      17. defaultKeepCurrent
  621.  *          Any valid Javascript
  622.  *      18. keepCurrentNotePriority
  623.  *          Same as those mentioned in condNotePriority
  624.  *      19. keepCurrentNoteChainingRule
  625.  *          Same as those mentioned in condNoteChainingRule
  626.  *      20. willEndNotePriority
  627.  *          Same as those mentioned in condNotePriority
  628.  *      21. willEndNoteChainingRule
  629.  *          Same as those mentioned in nextNoteChainingRule
  630.  *      22. didEndNotePriority
  631.  *          Same as those mentioned in condNotePriority
  632.  *      23. didEndNoteChainingRule
  633.  *          Same as those mentioned in nextNoteChainingRule
  634.  *      24. cmdLineH
  635.  *      25. cmdFontSize
  636.  *          Any valid Javascript returning a positive Number
  637.  *      26. cmdPadding
  638.  *      27. cmdTextPadding
  639.  *          Any valid Javascript returning a nonnegative Number
  640.  *      28. cmdBackOpacity
  641.  *      29. cmdTranslucentOpacity
  642.  *          Any valid Javascript returning a Number ranging from 0 to 255
  643.  *      30. cmdSpacing
  644.  *          Any valid Javascript returning a nonnegative Number
  645.  *      31. cmdWinW
  646.  *      32. cmdWinH
  647.  *          Any valid Javascript returning a positive Number
  648.  *      33. cmdWinX
  649.  *      34. cmdWinY
  650.  *          Any valid Javascript returning a Number
  651.  *      35. cmdView
  652.  *      36. cmdUse
  653.  *          Any valid Javascript returning a String
  654.  *      37. statLineH
  655.  *      38. statFontSize
  656.  *          Any valid Javascript returning a positive Number
  657.  *      39. statPadding
  658.  *      40. statTextPadding
  659.  *          Any valid Javascript returning a nonnegative Number
  660.  *      41. statBackOpacity
  661.  *      42. statTranslucentOpacity
  662.  *          Any valid Javascript returning a Number ranging from 0 to 255
  663.  *      43. statSpacing
  664.  *          Any valid Javascript returning a nonnegative Number
  665.  *      44. statWinW
  666.  *      45. statWinH
  667.  *          Any valid Javascript returning a positive Number
  668.  *      46. statWinX
  669.  *      47. statWinY
  670.  *          Any valid Javascript returning a Number
  671.  *      48. condLineH
  672.  *      49. condFontSize
  673.  *          Any valid Javascript returning a positive Number
  674.  *      50. condPadding
  675.  *      51. condTextPadding
  676.  *          Any valid Javascript returning a nonnegative Number
  677.  *      52. condBackOpacity
  678.  *      53. condTranslucentOpacity
  679.  *          Any valid Javascript returning a Number ranging from 0 to 255
  680.  *      54. condSpacing
  681.  *          Any valid Javascript returning a nonnegative Number
  682.  *      55. condWinW
  683.  *      56. condWinH
  684.  *          Any valid Javascript returning a positive Number
  685.  *      57. condWinX
  686.  *      58. condWinY
  687.  *          Any valid Javascript returning a Number
  688.  *      59. nextLineH
  689.  *      60. nextFontSize
  690.  *          Any valid Javascript returning a positive Number
  691.  *      61. nextPadding
  692.  *      62. nextTextPadding
  693.  *          Any valid Javascript returning a nonnegative Number
  694.  *      63. nextBackOpacity
  695.  *      64. nextTranslucentOpacity
  696.  *          Any valid Javascript returning a Number ranging from 0 to 255
  697.  *      65. nextSpacing
  698.  *          Any valid Javascript returning a nonnegative Number
  699.  *      66. nextWinW
  700.  *      67. nextWinH
  701.  *          Any valid Javascript returning a positive Number
  702.  *      68. nextWinX
  703.  *      69. nextWinY
  704.  *          Any valid Javascript returning a Number
  705.  *      70. varIds
  706.  *          Any valid Javascript returning an Array of valid game variable ids
  707.  *          Refer to the configuration counterpart for the Object form
  708.  *      71. switchIds
  709.  *          Any valid Javascript returning an Array of valid game switch ids
  710.  *          Refer to the configuration counterpart for the Object form
  711.  *    # Examples
  712.  *      1. isEnabled
  713.  *         Setting isEnabled as return false; will disable this plugin
  714.  *      2. willEnd
  715.  *         Setting willEnd as an empty String will cause nothing extra to be
  716.  *         done right before ending a skill progression
  717.  *      3. didEnd
  718.  *         Setting didEnd as $gameTemp.reserveCommonEvent(1); will reserve the
  719.  *         common event with id 1 right after ending a skill progression(note
  720.  *         that reserving a common event doesn't always cause it to be run
  721.  *         immediately)
  722.  *      4. condNotePriority
  723.  *         Aside from the skills, which always have the highest priority,
  724.  *         setting condNotePriority as
  725.  *         return ["states", "armors", "weapons", "currentClass"];
  726.  *         will cause the cond notetags in the States category to have the
  727.  *         highest priorities, followed by the Armors, Weapons and Classes
  728.  *         categories, whereas no notetags in the Actors categories will be
  729.  *         effective
  730.  *      5. condNoteChainingRule
  731.  *         Setting condNoteChainingRule as return "every"; will cause the
  732.  *         result to be truthy if and only if all effective cond notetags
  733.  *         return truthy
  734.  *      6. defaultMax
  735.  *         Setting defaultMax as return 100; will cause the maximum experience
  736.  *         of skills before chaining any max notetags to be 100
  737.  *      7. maxNotePriority
  738.  *         Same as that of condNotePriority except that the example would be
  739.  *         applied to max notetags/maxNotePriority instead
  740.  *      8. maxNoteChainingRule
  741.  *         Setting maxNoteChainingRule as return "="; will cause the result of
  742.  *         effective notetags with higher priorities to be replaced by those
  743.  *         with lower priorities(this can be useful for more advanced uses
  744.  *         by reusing the cached values of all effective notetags with higher
  745.  *         priorities)
  746.  *      9. defaultUseGain
  747.  *         Setting defaultUseGain as return 1; will cause the experience gain
  748.  *         of the skill to be progressed upon use before chaining any useGain
  749.  *         notetags to be 1
  750.  *      10. useGainNotePriority
  751.  *          Same as that of condNotePriority except that the example would be
  752.  *          applied to useGain notetags/useGainNotePriority instead
  753.  *      11. useGainNoteChainingRule
  754.  *          Same as that of maxNoteChainingRule except that the example would
  755.  *          be applied to useGain notetags/useGainNoteChainingRule instead
  756.  *      12. defaultHitGain
  757.  *          Setting defaultHitGain as return 1; will cause the experience gain
  758.  *          of the skill to be progressed upon hitting a target before
  759.  *          chaining any hitGain notetags to be 1
  760.  *      13. hitGainNotePriority
  761.  *          Same as that of condNotePriority except that the example would be
  762.  *          applied to hitGain notetags/hitGainNotePriority instead
  763.  *      14. hitGainNoteChainingRule
  764.  *          Same as that of maxNoteChainingRule except that the example would
  765.  *          be applied to hitGain notetags/hitGainNoteChainingRule instead
  766.  *      15. nextNotePriority
  767.  *          Same as that of condNotePriority except that the example would be
  768.  *          applied to next notetags/nextNotePriority instead
  769.  *      16. nextNoteChainingRule
  770.  *          Setting nextNoteChainingRule as return "last"; will cause only the
  771.  *          last effective notetag to be used
  772.  *      17. defaultKeepCurrent
  773.  *          Setting defaultKeepCurrent as return true; will cause skill to be
  774.  *          kept after ending progressing before chaining any keepCurrent
  775.  *          notetags
  776.  *      18. keepCurrentNotePriority
  777.  *          Same as that of condNotePriority except that the example would be
  778.  *          applied to keepCurrent notetags/keepCurrentNotePriority instead
  779.  *      19. keepCurrentNoteChainingRule
  780.  *          Same as that of condNoteChainingRule except that the example would
  781.  *          be applied to keepCurrent notetags/keepCurrentNoteChainingRule
  782.  *          instead
  783.  *      20. willEndNotePriority
  784.  *          Same as that of condNotePriority except that the example would be
  785.  *          applied to willEnd notetags/willEndNotePriority instead
  786.  *      21. willEndNoteChainingRule
  787.  *          Setting willEndNoteChainingRule as return "every"; will cause
  788.  *          every effective notetags to be used
  789.  *      22. didEndNotePriority
  790.  *          Same as that of condNotePriority except that the example would be
  791.  *          applied to didEnd notetags/didEndNotePriority instead
  792.  *      23. didEndNoteChainingRule
  793.  *          Same as that of willEndNoteChainingRule except that the example
  794.  *          would be applied to didEnd notetags/didEndNoteChainingRule
  795.  *          instead
  796.  *      24. cmdLineH
  797.  *      25. cmdFontSize
  798.  *      26. cmdPadding
  799.  *      27. cmdTextPadding
  800.  *      28. cmdBackOpacity
  801.  *      29. cmdTranslucentOpacity
  802.  *      30. cmdSpacing
  803.  *      31. cmdWinW
  804.  *      32. cmdWinH
  805.  *          Setting it as returning the corresponding Window_Command.prototype
  806.  *          function results will use the corresponding default value
  807.  *      33. cmdWinX
  808.  *      34. cmdWinY
  809.  *          Setting them as return 0; will place the command window at the
  810.  *          upper right corner if no other plguin's used
  811.  *      35. cmdView
  812.  *          Setting it as return "View Progress"; will describe the view
  813.  *          progress command text as "View Progress"
  814.  *      36. cmdUse
  815.  *          Setting it as return "Use"; will describe the use skill command
  816.  *          stat as "Use"
  817.  *      37. statLineH
  818.  *      38. statFontSize
  819.  *      39. statPadding
  820.  *      40. statTextPadding
  821.  *      41. statBackOpacity
  822.  *      42. statTranslucentOpacity
  823.  *      43. statSpacing
  824.  *      44. statWinW
  825.  *      45. statWinH
  826.  *          Setting it as returning the corresponding
  827.  *          Window_Selectable.prototype function results will use the
  828.  *          corresponding default value
  829.  *      46. statWinX
  830.  *      47. statWinY
  831.  *          Setting them as return 0; will place the command window at the
  832.  *          upper right corner if no other plguin's used
  833.  *      48. condLineH
  834.  *      49. condFontSize
  835.  *      50. condPadding
  836.  *      51. condTextPadding
  837.  *      52. condBackOpacity
  838.  *      53. condTranslucentOpacity
  839.  *      54. condSpacing
  840.  *      55. condWinW
  841.  *      56. condWinH
  842.  *          Setting it as returning the corresponding
  843.  *          Window_Selectable.prototype function results will use the
  844.  *          corresponding default value
  845.  *      57. condWinX
  846.  *          Setting it as return Grapphics.boxWidth / 2; will place the
  847.  *          condition window at the right half if no other plguin's used
  848.  *      58. condWinY
  849.  *          Setting it as return Grapphics.boxHeight / 2; will place the
  850.  *          condition window at the lower half if no other plguin's used
  851.  *      59. nextLineH
  852.  *      60. nextFontSize
  853.  *      61. nextPadding
  854.  *      62. nextTextPadding
  855.  *      63. nextBackOpacity
  856.  *      64. nextTranslucentOpacity
  857.  *      65. nextSpacing
  858.  *      66. nextWinW
  859.  *      67. nextWinH
  860.  *          Setting it as returning the corresponding
  861.  *          Window_Selectable.prototype function results will use the
  862.  *          corresponding default value
  863.  *      68. nextWinX
  864.  *          Setting it as return Grapphics.boxWidth / 2; will place the
  865.  *          condition window at the right half if no other plguin's used
  866.  *      69. nextWinY
  867.  *          Setting it as return Grapphics.boxHeight / 2; will place the
  868.  *          condition window at the lower half if no other plguin's used
  869.  *      70. varIds
  870.  *          Setting it as return [1, 2]; will notify this plugin to update the
  871.  *          cache involving notes using these variables having these ids
  872.  *          whenever their value changes
  873.  *          Refer to the configuration counterpart for an Object form example
  874.  *      71. switchIds
  875.  *          Setting it as return []; will notify this plugin that no game
  876.  *          switches are used by the former
  877.  *          Refer to the configuration counterpart for an Object form example
  878.  *    # Configurations having no parameter counterparts
  879.  *      1. drawStat
  880.  *============================================================================
  881.  *    ## Notetag Info
  882.  *       1. Among all the same notetag types in the same data, all can be
  883.  *          effective(Reference tag: NOTETAG_MULTI)
  884.  *       2. Each line can only have at most 1 notetag
  885.  *          (Reference tag: LINE_MONO)
  886.  *       3. The following is the structure of all notetags in this plugin:
  887.  *          - <doublex rmmv skill progress contents>
  888.  *          - <skill progress contents>
  889.  *          (Reference tag: NOTE_STRUCTURE)
  890.  *          Where contents are in the form of type suffixes: entries
  891.  *          Either of the above can be used, but the 1st one reduce the chance
  892.  *          of causing other plugins to treat the notetags of this plugin as
  893.  *          theirs, while the 2nd one is more user-friendly
  894.  *          - type is one of the following:
  895.  *            cond(related to condNotePriority and condNoteChainingRule)
  896.  *            max(related to maxNotePriority and maxNoteChainingRule)
  897.  *            useGain(related to useGainNotePriority and
  898.  *                    useGainNoteChainingRule)
  899.  *            hitGain(related to hitGainNotePriority and
  900.  *                     hitGainNoteChainingRule)
  901.  *            next(related to nextNotePriority and nextNoteChainingRule)
  902.  *            keepCurrent(related to keepCurrentNotePriority and
  903.  *                        keepCurrentNoteChainingRule)
  904.  *            willEnd(related to willEndNotePriority and
  905.  *                    willEndNoteChainingRule)
  906.  *            didEnd(related to didEndNotePriority and didEndNoteChainingRule)
  907.  *            (Reference tag: NOTE_TYPE)
  908.  *          - suffixes is the list of suffixes in the form of:
  909.  *            suffix1 suffix2 suffix3 ... suffixn
  910.  *            Where each suffix is either of the following:
  911.  *            cfg(The notetag value will be the corresponding NOTEX in the
  912.  *                configuration region, which is inside this plugin js file)
  913.  *            val(The notetag value will be used as-is)
  914.  *            switch(The value of the game switch with id as the notetag value
  915.  *                   will be used)
  916.  *            event(The common event with id as the notetag value will be
  917.  *                  reserved upon using the notetag)
  918.  *            var(The value of the game variable with id as the notetag value
  919.  *                will be used)
  920.  *            (Advanced)script(The value of the game variable with id as the
  921.  *                            notetag value will be used as the contents of
  922.  *                            the functions to be called upon using the
  923.  *                            notetag, so the function arguments are exactly
  924.  *                            the same as the cfg counterpart)
  925.  *            (Reference tag: NOTE_SUFFIX)
  926.  *          - entries is the list of entries in the form of:
  927.  *            entry1, entry2, entry3, ..., entryn
  928.  *            Where entryi must conform with the suffixi specifications
  929.  *          - (Advanced)Each content type has a corresponding eval variant:
  930.  *            <skill progress type>
  931.  *            function content
  932.  *            </skill progress type>
  933.  *            and this counterpart:
  934.  *            <doublex rmmv skill progress type>
  935.  *            function content
  936.  *            </doublex rmmv skill progress type>
  937.  *            The functions arguments are exactly the same as the counterpart
  938.  *            with the cfg suffix
  939.  *            This eval variant only applies to notetags having only 1 suffix
  940.  *       4. (Advanced)The notetag results are cached as follows:
  941.  *          - The effective notetag list's divided into these parts:
  942.  *            Effective actor notetag list
  943.  *            Effective class notetag list
  944.  *            Effective weapon notetag list
  945.  *            Effective armor notetag list
  946.  *            Effective state notetag list
  947.  *            Effective skill notetag list
  948.  *            They'll be sorted according to the corresponding note priority
  949.  *            and their results will be chained according to the corresponding
  950.  *            note chaining rule
  951.  *            (Reference tag: NOTE_LIST_PART)
  952.  *          - Each of the above parts have its own effective notetag list
  953.  *            cache, which will be recached if it's possible that the
  954.  *            effective notetag list might have changed due to changing
  955.  *            weapons/armors/states/etc, which will automatically raise the
  956.  *            coresponding note change factor for the corresponding note
  957.  *            (Reference tag: NOTE_LIST_CACHE)
  958.  *          - Each of the above parts has its own intermediate result cache
  959.  *            based on the result chained from the effective notetags with
  960.  *            higher priorities, and this intermediate result cache will be
  961.  *            recached if the effective notetag list of that part or any of
  962.  *            those having higher priorities have their intermediate result
  963.  *            cache recached, or if the corresponding note priority/chain rule
  964.  *            has changed(this change should raise the priority/chain rule
  965.  *            factor manually)
  966.  *            (Reference tag: NOTE_RESULT_CACHE)
  967.  *          - If the actor's refreshed due to changes other than class,
  968.  *            weapons, armors, states and last used skill, all note change
  969.  *            factors for all notes will be automatically raised
  970.  *            (Reference tag: ACTOR_REFRESH_RECACHE_NOTE)
  971.  *          - If users changes some notetags from some data manually, then
  972.  *            the corresponding note change factor should be raised
  973.  *            immediately afterwards
  974.  *          - If the users are sure that the effective notetag list of a part
  975.  *            remains intact but its intermediate result cache might be
  976.  *            invalid, then the result factor of the corresponding note should
  977.  *            be raised immediately
  978.  *----------------------------------------------------------------------------
  979.  *    # Actor/Class/Weapon/Armor/State/Skill Notetag contents:
  980.  *      1. cond suffix1 suffix2: entry1, entry2
  981.  *         - Sets a prerequisite to be met for the skill to be progressed with
  982.  *           descriptions to be shown
  983.  *         - suffix1 and suffix2 can be cfg, val, switch, var or script
  984.  *         - (Advanced)Please refer to Cond Functions in the configuration
  985.  *           region for using cfg or script suffixes
  986.  *         - The result of entry1 can be anything as it's used as truthy/falsy
  987.  *           to check whether the prerequisite's met
  988.  *         - The result of entry2 can be any String as the condition
  989.  *           descriptions
  990.  *         - If the result of entry2 is falsy, the result of entry1 will also
  991.  *           be treated as falsy
  992.  *           (Reference tag: INVALID_COND_DESC)
  993.  *         - If there's no such effective notetag, the skill involved won't
  994.  *           progress
  995.  *         - E.g.:
  996.  *           <skill progress cond switch var: 1, 2> will set a prerequisite
  997.  *           for the skill to be progressed as the value of the game switch
  998.  *           with id 1, with descriptions to be shown as the value of the game
  999.  *           variable with id 2, provided that that variable stores a String
  1000.  *      2. max suffix1: entry1
  1001.  *         - Sets the maximum experience of the skill to be progressed
  1002.  *         - suffix1 can be cfg, val, var or script
  1003.  *         - (Advanced)Please refer to Max Functions in the configuration
  1004.  *           region for using cfg or script suffixes, or the eval variant
  1005.  *         - The result of entry1 can be any positive Number as the maximum
  1006.  *           experience
  1007.  *         - Having an invalid result is the same as not meeting prerequisites
  1008.  *           (Reference tag: INVALID_MAX)
  1009.  *         - If the maximum experience of the skill to be progressed's reduced
  1010.  *           to become not greater than its current experience, the skill will
  1011.  *           be ended progressing immediately
  1012.  *           (Reference tag: REDUCED_MAX_END_SKILL_PROGRESS)
  1013.  *         - E.g.:
  1014.  *           <skill progress max var: 1> will set the maximum experience of
  1015.  *           the skill to be progressed as the value of the game variable with
  1016.  *           id 1
  1017.  *      3. useGain suffix1: entry1
  1018.  *         - Sets the experience gain of the skill to be progressed upon using
  1019.  *           it
  1020.  *         - suffix1 can be cfg, val, var or script
  1021.  *         - (Advanced)Please refer to useGain Functions in the configuration
  1022.  *           region for using cfg or script suffixes, or the eval variant
  1023.  *         - The result of entry1 can be any Number as the experience gain
  1024.  *         - All invalid results will be regarded as 0
  1025.  *           (Reference tag: INVALID_GAIN)
  1026.  *         - E.g.:
  1027.  *           If the game variable with id 1 is "return this.luk;", then
  1028.  *           <skill progress useGain script: 1> will set the experience gain
  1029.  *           of the skill to be progressed upon using it as the luk of the
  1030.  *           user at that moment
  1031.  *      4. hitGain suffix1: entry1
  1032.  *         - Sets the experience gain of the skill to be progressed when the
  1033.  *           skill hits a target
  1034.  *         - suffix1 can be cfg, val, var or script
  1035.  *         - (Advanced)Please refer to hitGain Functions in the configuration
  1036.  *           region for using cfg or script suffixes, or the eval variant
  1037.  *         - The result of entry1 can be any Number as the experience gain
  1038.  *         - All invalid results will be regarded as 0
  1039.  *           (Reference tag: INVALID_GAIN)
  1040.  *         - E.g.:
  1041.  *           If HG1 in the configuration region is "return this.level;", then
  1042.  *           <skill progress hitGain cfg: HG1> will set the experience gain
  1043.  *           of the skill to be progressed when the skill hits a target as the
  1044.  *           level of the user at that moment
  1045.  *      5. next suffix1: entry1
  1046.  *         - Sets the skill to learn upon ending progressing the current one
  1047.  *         - suffix1 can be cfg, val, var or script
  1048.  *         - (Advanced)Please refer to Next Functions in the configuration
  1049.  *           region for using cfg or script suffixes, or the eval variant
  1050.  *         - The result of entry1 can be an Array of any valid id of the skills
  1051.  *           to learn
  1052.  *         - If the val suffix's used, the skill ids should be concatenated
  1053.  *           with the underscore, like 4_5 being skills with id 4 and 5
  1054.  *           (Reference tag: NUMBER_ARRAY)
  1055.  *         - If the var suffix's used, the variable referred by the entry
  1056.  *           should have skill ids concatenated with the underscore, like 4_5
  1057.  *           being skills with id 4 and 5
  1058.  *           (Reference tag: NUMBER_ARRAY)
  1059.  *         - Having an invalid result is the same as not meeting prerequisites
  1060.  *           (Reference tag: INVALID_NEXT)
  1061.  *         - E.g.:
  1062.  *           <skill progress next val: 4_5> will set the skills to learn upon
  1063.  *           ending progressing the current one as those with id 4 and 5
  1064.  *      6. keepCurrent suffix1: entry1
  1065.  *         - Sets whether the current skill will be kept instead of forgotten
  1066.  *           when it ends progressing
  1067.  *         - suffix1 can be cfg, val, switch, var or script
  1068.  *         - (Advanced)Please refer to keepCurrent Functions in the
  1069.  *           configuration region for using cfg or script suffixes, or the
  1070.  *           eval variant
  1071.  *         - The result of entry1 can be anything as it's used as truthy/falsy
  1072.  *           to sets whether the current skill will be kept
  1073.  *         - E.g.:
  1074.  *           <skill progress keepCurrent>
  1075.  *           return false;
  1076.  *           </skill progress keepCurrent>
  1077.  *           will set the current skill to be forgotten
  1078.  *      7. willEnd suffix1: entry1
  1079.  *         - Runs extra events just before ending progressing the skill
  1080.  *         - suffix1 can be cfg, event or script
  1081.  *         - (Advanced)Please refer to willEnd Functions in the configuration
  1082.  *           region for using cfg or script suffixes, or the eval variant
  1083.  *         - The entry1 is supposed to cause something to happen instead of
  1084.  *           returning anything
  1085.  *         - The willEnd parameter counterpart will always be run first
  1086.  *           (Reference tag: RUN_DEFAULT_FIRST)
  1087.  *         - E.g.:
  1088.  *           <skill progress willEnd event: 1> will reserve the common event
  1089.  *           with id 1 just after ending progressing the skill
  1090.  *      8. didEnd suffix1: entry1
  1091.  *         - Runs extra events just after ending progressing the skill
  1092.  *         - suffix1 can be cfg, event or script
  1093.  *         - (Advanced)Please refer to didEnd Functions in the configuration
  1094.  *           region for using cfg or script suffixes, or the eval variant
  1095.  *         - The entry1 is supposed to cause something to happen instead of
  1096.  *           returning anythinganything
  1097.  *         - The didEnd parameter counterpart will always be run first
  1098.  *           (Reference tag: RUN_DEFAULT_FIRST)
  1099.  *         - E.g.:
  1100.  *           If DE1 in the configuration region is unchanged,
  1101.  *           <skill progress didEnd cfg: DE1> will close the actor window
  1102.  *           when the skill involved ended progressing outside battles
  1103.  *           (Please refer to DE1 for details)
  1104.  *============================================================================
  1105.  *    ## Script Call Info
  1106.  *----------------------------------------------------------------------------
  1107.  *    # (Advanced)Configuration manipulations
  1108.  *      1. $gameSystem.skillProgress.params.param
  1109.  *         - Returns the stored value of param listed in the plugin manager or
  1110.  *           their configuration counterparts
  1111.  *         - E.g.:
  1112.  *           $gameSystem.skillProgress.params.isEnabled will return the
  1113.  *           contents of a function returning a Boolean indicating whether
  1114.  *           this plugin's enabled
  1115.  *      2. $gameSystem.skillProgress.params.param = funcContents
  1116.  *         - Sets the stored value of param listed in the plugin manager or
  1117.  *           their configuration counterpart as funcContents, which is the
  1118.  *           contents of a function
  1119.  *         - E.g.:
  1120.  *           $gameSystem.skillProgress.params.isEnabled = "return false;" will
  1121.  *           set the stored value of parameter isEnabled shown on the plugin
  1122.  *           manager or its configuration counterpart as "return false;",
  1123.  *           causing the corresponding function to always return false, thus
  1124.  *           always disabling this plugin
  1125.  *         - $gameSystem.skillProgress.params.param changes will be saved
  1126.  *         - DoubleX_RMMV.Skill_Progress.params.param = func, where func is
  1127.  *           the corresponding function having funcContents as its contents,
  1128.  *           should be explicitly called immediately afterwards
  1129.  *      3. $gameSystem.skillProgress.cfgs.cfg
  1130.  *         - Basically the same as $gameSystem.skillProgress.params.param,
  1131.  *           except that this script call applies to configurations found in
  1132.  *           the configuration region only
  1133.  *      4. $gameSystem.skillProgress.cfgs.cfg = funcContents
  1134.  *         - Basically the same as
  1135.  *           $gameSystem.skillProgress.params.param = funcContents, except that
  1136.  *           this script call applies to configurations found in the
  1137.  *           configuration region only
  1138.  *         - DoubleX_RMMV.Skill_Progress.cfgs.cfg = func, where func is the
  1139.  *           corresponding function having funcContents as its contents,
  1140.  *           should be explicitly called immediately afterwards
  1141.  *      5. $gameSystem.skillProgress.notes.note
  1142.  *         - Basically the same as $gameSystem.skillProgress.params.param,
  1143.  *           except that this script call applies to notetag values found in
  1144.  *           the configuration region
  1145.  *      6. $gameSystem.skillProgress.notes.note = funcContents
  1146.  *         - Basically the same as
  1147.  *           $gameSystem.skillProgress.params.param = funcContents, except
  1148.  *           that this script call applies to notetag values found in the
  1149.  *           configuration region
  1150.  *         - DoubleX_RMMV.Skill_Progress.notes.note = func, where func is the
  1151.  *           corresponding function having funcContents as its contents,
  1152.  *           should be explicitly called immediately afterwards
  1153.  *    # (Advanced)Actor/Class/Weapon/Armor/State/Skill notetag manipulations
  1154.  *      All meta.skillProgress changes can be saved if
  1155.  *      DoubleX RMMV Dynamic Data is used
  1156.  *      1. meta.skillProgress.note
  1157.  *         - note is either of the following:
  1158.  *           cond(corresponds to notetag content
  1159.  *                cond suffix1 suffix2: entry1, entry2)
  1160.  *           max(corresponds to notetag content max suffix1: entry1)
  1161.  *           useGain(corresponds to notetag content useGain suffix1: entry1)
  1162.  *           hitGain(corresponds to notetag content hitGain suffix1: entry1)
  1163.  *           next(corresponds to notetag content next suffix1: entry1)
  1164.  *           keepCurrent(corresponds to notetag content
  1165.  *                      keepCurrent suffix1: entry1)
  1166.  *           willEnd(corresponds to notetag content willEnd suffix1: entry1)
  1167.  *           didEnd(corresponds to notetag content didEnd suffix1: entry1)
  1168.  *         - Returns the Array of Objects in this form:
  1169.  *           { suffixi: suffixi, entryi: entryi }
  1170.  *           Which corresponds to <skill progress note suffixi: entryi>
  1171.  *         (Reference tag: MULTI_SUFFIX_ENTRY)
  1172.  *         - E.g.:
  1173.  *           $dataWeapons[3].meta.skillProgress.cond will return the Array of
  1174.  *           Object
  1175.  *           [{ suffix1: "switch", entry1: "1", suffix2: "var", entry2: "2" }]
  1176.  *           if the effective notetag of  weapon with id 3 is
  1177.  *           <skill progress cond switch var: 1, 2>
  1178.  *      2. meta.skillProgress.note = [{ suffixi: suffixi, entryi: entryi }]
  1179.  *         (Reference tag: MULTI_SUFFIX_ENTRY)
  1180.  *         - note is either of the following:
  1181.  *           cond(corresponds to notetag content
  1182.  *                cond suffix1 suffix2: entry1, entry2)
  1183.  *           max(corresponds to notetag content max suffix1: entry1)
  1184.  *           useGain(corresponds to notetag content useGain suffix1: entry1)
  1185.  *           hitGain(corresponds to notetag content hitGain suffix1: entry1)
  1186.  *           next(corresponds to notetag content next suffix1: entry1)
  1187.  *           keepCurrent(corresponds to notetag content
  1188.  *                       keepCurrent suffix1: entry1)
  1189.  *           willEnd(corresponds to notetag content willEnd suffix1: entry1)
  1190.  *           didEnd(corresponds to notetag content didEnd suffix1: entry1)
  1191.  *         - Sets the notetag to be the same as
  1192.  *           <skill progress note suffixi: entryi>
  1193.  *         - E.g.:
  1194.  *           $dataArmors[4].meta.skillProgress.cond =
  1195.  *           [{ suffix1: "switch", entry1: "1", suffix2: "var", entry2: "2" }]
  1196.  *           will set the max notetag of the armor with id 4 to be the same as
  1197.  *           <skill progress cond switch var: 1, 2>
  1198.  *    # Actor manipulations
  1199.  *      1. skillProgressCondDesc(skillId)
  1200.  *         - Returns the mapping with the condition descriptions as the keys
  1201.  *           and their statuses as the values for the skill with id skillId to
  1202.  *           progress for the actor involved
  1203.  *         - The mapping being empty means that the skill involved won't
  1204.  *           progress due to having no effective cond notetags and is thus
  1205.  *           treated as a normal skill
  1206.  *           (Reference tag: SKILL_COND_DESCS)
  1207.  *         - The mapping having only truthy values means that the prerequisites
  1208.  *           are met under the cond notetag chaining rule
  1209.  *           (Reference tag: SKILL_COND_DESCS)
  1210.  *         - (Advanced)It's supposed to return an Object
  1211.  *         - E.g.:
  1212.  *           $gameParty.aliveMembers()[0].skillProgressCondDesc(3) will return
  1213.  *           the mapping with the condition descriptions as the keys and their
  1214.  *           statuses as the values for the skill with id 3 to progress for
  1215.  *           the 1st alive party member
  1216.  *         - (Advanced)Using this script call might recache the return value
  1217.  *         - (Advanced)It's supposed to be Nullipotent other than possibly
  1218.  *           recaching the return value
  1219.  *      2. maxSkillProgress(skillId)
  1220.  *         - Returns the maximum experience needed to end progressing the
  1221.  *           skill with id skillId for the actor involved
  1222.  *         - (Advanced)It's supposed to return a positive Number
  1223.  *         - E.g.:
  1224.  *           If the maximum experience needed to end progressing the skill
  1225.  *           with id 3 is 400 for the 1st alive party member, then
  1226.  *           $gameParty.aliveMembers()[0].maxSkillProgress(3) will return 400
  1227.  *         - (Advanced)Using this script call might recache the return value
  1228.  *         - (Advanced)It's supposed to be Nullipotent other than possibly
  1229.  *           recaching the return value
  1230.  *      3. useGainSkillProgress(skillId)
  1231.  *         - Returns the experience gain of the skill with id skillId to be
  1232.  *           progressed upon use for the actor involved
  1233.  *         - (Advanced)It's supposed to return a Number
  1234.  *         - E.g.:
  1235.  *           If the experience gain of the skill with id 4 to be progressed
  1236.  *           upon use for the actor with id 1 is 100, then
  1237.  *           $gameActors.actor(1).useGainSkillProgress(4) will return 100
  1238.  *         - (Advanced)Using this script call might recache the return value
  1239.  *         - (Advanced)It's supposed to be Nullipotent other than possibly
  1240.  *           recaching the return value
  1241.  *      4. hitGainSkillProgress(skillId, target, value)
  1242.  *         - Returns the experience gain of the skill with id skillId to be
  1243.  *           progressed upon hitting target target with damage value for the
  1244.  *           actor involved
  1245.  *         - (Advanced)It's supposed to return a Number
  1246.  *         - E.g.:
  1247.  *           If the experience gain of the skill with id 5 to be progressed
  1248.  *           upon hitting the 1st enemy with 400 damage for the actor with id
  1249.  *           2 is 100, then
  1250.  *           $gameActors.actor(2).hitGainSkillProgress(
  1251.  *           5, $gameTroop.aliveMembers()[0], 400) will return 100
  1252.  *         - (Advanced)Using this script call might recache the return value
  1253.  *         - (Advanced)It's supposed to be Nullipotent other than possibly
  1254.  *           recaching the return value
  1255.  *      5. nextSkillProgress(skillId)
  1256.  *         - Returns the list of skill ids to be learned upon ending
  1257.  *           progressing that with id skillId for the actor involved
  1258.  *         - (Advanced)It's supposed to return a list of valid skill ids
  1259.  *         - E.g.:
  1260.  *           $gameParty.aliveMembers()[$gameParty.aliveMembers().length - 1].
  1261.  *           nextSkillProgress(6) will return the list of skill ids to be
  1262.  *           learnt upon ending progressing that with id 6 for the last alive
  1263.  *           party member
  1264.  *         - (Advanced)Using this script call might recache the return value
  1265.  *         - (Advanced)It's supposed to be Nullipotent other than possibly
  1266.  *           recaching the return value
  1267.  *      6. isKeepSkillProgress(skillId)
  1268.  *         - Returns whether the skill with id skillId will be kept or
  1269.  *           forgotten upon ending its progression for the actor involved
  1270.  *         - (Advanced)It's supposed to return a Boolean
  1271.  *         - E.g.:
  1272.  *           $gameParty.aliveMembers()[$gameParty.aliveMembers().length - 1].
  1273.  *           isKeepSkillProgress(4) will return whether the skill with id 4
  1274.  *           will be kept or forgotten upon ending its progression for the
  1275.  *           last alive party member
  1276.  *      7. currentSkillProgress(skillId)
  1277.  *         - Returns the current experience of the skill with id skillId to be
  1278.  *           progressed for the actor involved
  1279.  *         - (Advanced)It's supposed to return a nonnegative Number that is
  1280.  *           not greater than the maximum experience of the same skill
  1281.  *         - E.g.:
  1282.  *           $gameParty.aliveMembers()[0].currentSkillProgress(3) returns the
  1283.  *           current experience of the skill with id 3 to be progressed for
  1284.  *           the 1st alive party member
  1285.  *         - (Advanced)It's supposed to be Nullipotent
  1286.  *      8. setCurrentSkillProgress(skillId, value)
  1287.  *         - Sets the current experience of the skill with id skillId to be
  1288.  *           progressed for the actor involved as value
  1289.  *         - (Advanced)value is supposed to be a nonnegative Number that is
  1290.  *           not greater than the maximum experience of the same skill, so
  1291.  *           it'll be clamped if it's out of range and discarded if it's not
  1292.  *           a Number
  1293.  *           (Reference tag: CURRENT_EXP_RANGE)
  1294.  *         - E.g.:
  1295.  *           $gameParty.aliveMembers()[0].setCurrentSkillProgress(3, 100) sets
  1296.  *           the current experience of the skill with id 3 to be progressed
  1297.  *           for the 1st alive party member as 100
  1298.  *         - (Advanced)It's supposed to be Idempotent
  1299.  *      9. (Advanced)raiseAllSkillProgressNoteChangeFactors()
  1300.  *         - Applies the script call
  1301.  *           raiseSkillProgressNoteChangeFactor(note, factor) to all notes and
  1302.  *           factors
  1303.  *      10. (Advanced)raiseSkillProgressNoteChangeFactor(note, factor)
  1304.  *         - Notifies that the notetag note might need to be recached due to
  1305.  *           potential changes in factor factor
  1306.  *         - note is either of the following:
  1307.  *           "cond"(corresponds to notetag content
  1308.  *                  cond suffix1 suffix2: entry1 entry2)
  1309.  *           "max"(corresponds to notetag content max suffix1: entry1)
  1310.  *           "useGain"(corresponds to notetag content useGain suffix1: entry1)
  1311.  *           "hitGain"(corresponds to notetag content hitGain suffix1: entry1)
  1312.  *           "next"(corresponds to notetag content next suffix1: entry1)
  1313.  *           "keepCurrent"(corresponds to notetag content
  1314.  *                         keepCurrent suffix1: entry1)
  1315.  *           "willEnd"(corresponds to notetag content willEnd suffix1: entry1)
  1316.  *           "didEnd"(corresponds to notetag content didEnd suffix1: entry1)
  1317.  *         - factor is either of the following:
  1318.  *           "states"(Changes in state notetags)
  1319.  *           "armors"(Changes in armor notetags)
  1320.  *           "weapons"(Changes in weapon notetags)
  1321.  *           "currentClass"(Changes in class notetags)
  1322.  *           "actor"(Changes in actor notetags)
  1323.  *           "priority"(Changes in the corresponding note priorities)
  1324.  *           "chainingRule"(Changes in the corresponding note chaining rules)
  1325.  *           "result"(Changes in all intermediate results for the note)
  1326.  *         - It's supposed to be Idempotent
  1327.  *         - E.g.:
  1328.  *           $gameParty.aliveMembers()[0].raiseSkillProgressNoteChangeFactor(
  1329.  *           "cond", "states") will notify the 1st alive party member that the
  1330.  *           cond notetags might need to be recached due to potential changes
  1331.  *           in the states or their cond notetags
  1332.  *      11. (Advanced)skillProgressNoteResult(note, part)
  1333.  *         - Returns the cached intermediate result of part part in note note
  1334.  *           for the actor involved
  1335.  *         - note is either of the following:
  1336.  *           "cond"(corresponds to notetag content
  1337.  *                  cond suffix1 suffix2: entry1 entry2)
  1338.  *           "max"(corresponds to notetag content max suffix1: entry1)
  1339.  *           "useGain"(corresponds to notetag content useGain suffix1: entry1)
  1340.  *           "hitGain"(corresponds to notetag content hitGain suffix1: entry1)
  1341.  *           "next"(corresponds to notetag content next suffix1: entry1)
  1342.  *           "keepCurrent"(corresponds to notetag content
  1343.  *                         keepCurrent suffix1: entry1)
  1344.  *           "willEnd"(corresponds to notetag content willEnd suffix1: entry1)
  1345.  *           "didEnd"(corresponds to notetag content didEnd suffix1: entry1)
  1346.  *         - part is either of the following:
  1347.  *           "states"(All effective state notetags)
  1348.  *           "armors"(All effective armor notetags)
  1349.  *           "weapons"(All effective weapon notetags)
  1350.  *           "currentClass"(All effective class notetags)
  1351.  *           "actor"(All effective actor notetags)
  1352.  *         - It's supposed to be Nullipotent other than possible recaching
  1353.  *         - E.g.:
  1354.  *           $gameParty.aliveMembers()[0].skillProgressNoteResult(
  1355.  *           "cond", "states") will return the cached intermediate result of
  1356.  *           all effective cond notetags in states for the 1t alive party
  1357.  *           member
  1358.  *      12. (Advanced)invalidateSkillProgressNoteResult(note, part)
  1359.  *         - Invalidates the cached intermediate result of part part in note
  1360.  *           note for the actor involved
  1361.  *         - note is either of the following:
  1362.  *           "cond"(corresponds to notetag content
  1363.  *                  cond suffix1 suffix2: entry1 entry2)
  1364.  *           "max"(corresponds to notetag content max suffix1: entry1)
  1365.  *           "useGain"(corresponds to notetag content useGain suffix1: entry1)
  1366.  *           "hitGain"(corresponds to notetag content hitGain suffix1: entry1)
  1367.  *           "next"(corresponds to notetag content next suffix1: entry1)
  1368.  *           "keepCurrent"(corresponds to notetag content
  1369.  *                         keepCurrent suffix1: entry1)
  1370.  *           "willEnd"(corresponds to notetag content willEnd suffix1: entry1)
  1371.  *           "didEnd"(corresponds to notetag content didEnd suffix1: entry1)
  1372.  *         - part is either of the following:
  1373.  *           "states"(All effective state notetags)
  1374.  *           "armors"(All effective armor notetags)
  1375.  *           "weapons"(All effective weapon notetags)
  1376.  *           "currentClass"(All effective class notetags)
  1377.  *           "actor"(All effective actor notetags)
  1378.  *         - It's supposed to be Idempotent
  1379.  *         - E.g.:
  1380.  *           $gameParty.aliveMembers()[0].invalidateSkillProgressNoteResult(
  1381.  *           "cond", "states") will invalidate the cached intermediate result
  1382.  *           of all effective cond notetags in states for the 1t alive party
  1383.  *           member
  1384.  *============================================================================
  1385.  *    ## Plugin Command Info
  1386.  *       Don't use this plugin command for actors that don't exist yet unless
  1387.  *       you really know what you're truly doing
  1388.  *----------------------------------------------------------------------------
  1389.  *      1. skillProgressCondDesc actorId skillId
  1390.  *         - The same as the script call skillProgressCondDesc(skillId) in
  1391.  *           Actor manipulations for the actor with id actorId
  1392.  *      2. maxSkillProgress actorId skillId
  1393.  *         - The same as the script call maxSkillProgress(skillId) in Actor
  1394.  *           manipulations for the actor with id actorId
  1395.  *      3. useGainSkillProgress actorId skillId
  1396.  *         - The same as the script call useGainSkillProgress(skillId) in
  1397.  *           Actor manipulations for the actor with id actorId
  1398.  *      4. hitGainSkillProgress actorId skillId target value
  1399.  *         - The same as the script call
  1400.  *           hitGainSkillProgress(skillId, target, value) in Actor
  1401.  *           manipulations for the actor with id actorId
  1402.  *      5. nextSkillProgress actorId skillId
  1403.  *         - The same as the script call nextSkillProgress(skillId) in Actor
  1404.  *           manipulations for the actor with id actorId
  1405.  *      6. isKeepSkillProgress actorId skillId
  1406.  *         - The same as the script call isKeepSkillProgress(skillId) in Actor
  1407.  *           manipulations for the actor with id actorId
  1408.  *      7. currentSkillProgress actorId skillId
  1409.  *         - The same as the script call currentSkillProgress(skillId) in
  1410.  *           Actor manipulations for the actor with id actorId
  1411.  *      8. setCurrentSkillProgress actorId skillId value
  1412.  *         - The same as the script call
  1413.  *           setCurrentSkillProgress(skillId, value) in Actor manipulations
  1414.  *           for the actor with id actorId
  1415.  *      9. (Advanced)raiseAllSkillProgressNoteChangeFactors actorId
  1416.  *         - The same as the script call
  1417.  *           raiseAllSkillProgressNoteChangeFactors() in Actor manipulations
  1418.  *           for the actor with id actorId
  1419.  *      10. (Advanced)raiseSkillProgressNoteChangeFactor actorId note factor
  1420.  *         - The same as the script call
  1421.  *           raiseSkillProgressNoteChangeFactor(note, factor) in Actor
  1422.  *           manipulations for the actor with id actorId
  1423.  *      11. (Advanced)skillProgressNoteResult actorId note part
  1424.  *         - The same as the script call skillProgressNoteResult(note, part)
  1425.  *           in Actor manipulations for the actor with id actorId
  1426.  *      12. (Advanced)invalidateSkillProgressNoteResult actorId note part
  1427.  *         - The same as the script call
  1428.  *           invalidateSkillProgressNoteResult(note, part) in Actor
  1429.  *           manipulations for the actor with id actorId
  1430.  *============================================================================
  1431.  */
  1432.  
  1433. var DoubleX_RMMV = DoubleX_RMMV || {};
  1434. DoubleX_RMMV["Skill Progress"] = "v1.00a";
  1435.  
  1436. // The plugin file name must be the same as DoubleX_RMMV.Skill_Progress_File
  1437. DoubleX_RMMV.Skill_Progress_File = "doublex_rmmv_skill_progress_v100a";
  1438. //
  1439.  
  1440. /*============================================================================
  1441.  *    ## Plugin Configurations
  1442.  *       You only need to edit this part as it's about what this plugin does
  1443.  *----------------------------------------------------------------------------*/
  1444.  
  1445. DoubleX_RMMV.Skill_Progress = {
  1446.  
  1447. /*----------------------------------------------------------------------------
  1448.  *    Parameter counterparts
  1449.  *    - These configurations will only be used when their counterparts' empty
  1450.  *----------------------------------------------------------------------------*/
  1451.  
  1452.     params: {
  1453.  
  1454.         /**
  1455.          * The this pointer refers to the actor involved
  1456.          * Sets whether this plugin will be enabled
  1457.          * Nullipotent
  1458.          * @since v1.00a @version v1.00a
  1459.          * @returns {Boolean} The check result
  1460.          */
  1461.         isEnabled: function() { return true; /* Always enable this plugin */ },
  1462.  
  1463.         /**
  1464.          * The this pointer refers to the actor involved
  1465.          * Note that skills always have the highest priority
  1466.          * Sets the priority of effective cond notetags among all data types
  1467.          * Nullipotent
  1468.          * @since v1.00a @version v1.00a
  1469.          * @param {Id} skillId - The id of the skill involved
  1470.          * @returns {[String]} The requested data type priority queue
  1471.          */
  1472.         condNotePriority: function(skillId) {
  1473.             // States and Actors have the highest and lowest priorities
  1474.             return [
  1475.                 "states",
  1476.                 "armors",
  1477.                 "weapons",
  1478.                 "currentClass",
  1479.                 "actor"
  1480.             ];
  1481.             //
  1482.         }, // condNotePriority
  1483.  
  1484.         /**
  1485.          * The this pointer refers to the actor involved
  1486.          * Sets the rule to chain all effective cond notetag results
  1487.          * Nullipotent
  1488.          * @since v1.00a @version v1.00a
  1489.          * @param {Id} skillId - The id of the skill involved
  1490.          * @returns {String} The requested effective notetag chaining rule
  1491.          */
  1492.         condNoteChainingRule: function(skillId) {
  1493.             // All effective notetags must be truthy to have the conditions met
  1494.             return "every";
  1495.             //
  1496.         }, // condNoteChainingRule
  1497.  
  1498.         /**
  1499.          * The this pointer refers to the actor involved
  1500.          * Sets the default maximum experience of skills to be progressed
  1501.          * before chaining any max notetags
  1502.          * Nullipotent
  1503.          * @since v1.00a @version v1.00a
  1504.          * @param {Id} skillId - The id of the skill involved
  1505.          * @returns {Number} The requested default maximum experience
  1506.          */
  1507.         defaultMax: function(skillId) { return 10; },
  1508.  
  1509.         /**
  1510.          * The this pointer refers to the actor involved
  1511.          * Note that skills always have the highest priority
  1512.          * Sets the priority of effective max notetags among all data types
  1513.          * Nullipotent
  1514.          * @since v1.00a @version v1.00a
  1515.          * @param {Id} skillId - The id of the skill involved
  1516.          * @returns {[String]} The requested data type priority queue
  1517.          */
  1518.         maxNotePriority: function(skillId) {
  1519.             // States and Actors have the highest and lowest priorities
  1520.             return [
  1521.                 "states",
  1522.                 "armors",
  1523.                 "weapons",
  1524.                 "currentClass",
  1525.                 "actor"
  1526.             ];
  1527.             //
  1528.         }, // maxNotePriority
  1529.  
  1530.         /**
  1531.          * The this pointer refers to the actor involved
  1532.          * Sets the rule to chain all effective max notetag results
  1533.          * Nullipotent
  1534.          * @since v1.00a @version v1.00a
  1535.          * @param {Id} skillId - The id of the skill involved
  1536.          * @returns {String} The requested effective notetag chaining rule
  1537.          */
  1538.         maxNoteChainingRule: function(skillId) {
  1539.             // The previously chained results are divided by the next notetag
  1540.             return "/";
  1541.             //
  1542.         }, // maxNoteChainingRule
  1543.  
  1544.         /**
  1545.          * The this pointer refers to the actor involved
  1546.          * Sets the default experience gain of skills to be progressed upon use
  1547.          * before chaining any useGain notetags
  1548.          * Nullipotent
  1549.          * @since v1.00a @version v1.00a
  1550.          * @param {Id} skillId - The id of the skill involved
  1551.          * @returns {Number} The requested default use gain
  1552.          */
  1553.         defaultUseGain: function(skillId) { return 2; },
  1554.  
  1555.         /**
  1556.          * The this pointer refers to the actor involved
  1557.          * Note that skills always have the highest priority
  1558.          * Sets the priority of effective useGain notetags among all data types
  1559.          * Nullipotent
  1560.          * @since v1.00a @version v1.00a
  1561.          * @param {Id} skillId - The id of the skill involved
  1562.          * @returns {[String]} The requested data type priority queue
  1563.          */
  1564.         useGainNotePriority: function(skillId) {
  1565.             // States and Actors have the highest and lowest priorities
  1566.             return [
  1567.                 "states",
  1568.                 "armors",
  1569.                 "weapons",
  1570.                 "currentClass",
  1571.                 "actor"
  1572.             ];
  1573.             //
  1574.         }, // useGainNotePriority
  1575.  
  1576.         /**
  1577.          * The this pointer refers to the actor involved
  1578.          * Sets the rule to chain all effective useGain notetag results
  1579.          * Nullipotent
  1580.          * @since v1.00a @version v1.00a
  1581.          * @param {Id} skillId - The id of the skill involved
  1582.          * @returns {String} The requested effective notetag chaining rule
  1583.          */
  1584.         useGainNoteChainingRule: function(skillId) {
  1585.             // The previously chained results are multiplied by the next notetag
  1586.             return "*";
  1587.             //
  1588.         }, // useGainNoteChainingRule
  1589.  
  1590.         /**
  1591.          * The this pointer refers to the actor involved
  1592.          * Sets the default experience gain of skills to be progressed upon
  1593.          * hitting a target with damage before chaining any hitGain notetags
  1594.          * Nullipotent
  1595.          * @since v1.00a @version v1.00a
  1596.          * @param {Id} skillId - The id of the skill involved
  1597.          * @param {Game_Battler} target - The target hit by the skill involved
  1598.          * @param {Number} value - The damage of the hit involved
  1599.          * @returns {Number} The requested default hit gain
  1600.          */
  1601.         defaultHitGain: function(skillId, target, value) { return 1; },
  1602.  
  1603.         /**
  1604.          * The this pointer refers to the actor involved
  1605.          * Note that skills always have the highest priority
  1606.          * Sets the priority of effective hitGain notetags among all data types
  1607.          * Nullipotent
  1608.          * @since v1.00a @version v1.00a
  1609.          * @param {Id} skillId - The id of the skill involved
  1610.          * @returns {[String]} The requested data type priority queue
  1611.          */
  1612.         hitGainNotePriority: function(skillId) {
  1613.             // States and Actors have the highest and lowest priorities
  1614.             return [
  1615.                 "states",
  1616.                 "armors",
  1617.                 "weapons",
  1618.                 "currentClass",
  1619.                 "actor"
  1620.             ];
  1621.             //
  1622.         }, // hitGainNotePriority
  1623.  
  1624.         /**
  1625.          * The this pointer refers to the actor involved
  1626.          * Sets the rule to chain all effective hitGain notetag results
  1627.          * Nullipotent
  1628.          * @since v1.00a @version v1.00a
  1629.          * @param {Id} skillId - The id of the skill involved
  1630.          * @returns {String} The requested effective notetag chaining rule
  1631.          */
  1632.         hitGainNoteChainingRule: function(skillId) {
  1633.             // The previously chained results are multiplied by the next notetag
  1634.             return "*";
  1635.             //
  1636.         }, // hitGainNoteChainingRule
  1637.  
  1638.         /**
  1639.          * The this pointer refers to the actor involved
  1640.          * Note that skills always have the highest priority
  1641.          * Sets the priority of effective next notetags among all data types
  1642.          * Nullipotent
  1643.          * @since v1.00a @version v1.00a
  1644.          * @param {Id} skillId - The id of the skill involved
  1645.          * @returns {[String]} The requested data type priority queue
  1646.          */
  1647.         nextNotePriority: function(skillId) {
  1648.             // Actors and Classes have the highest and lowest priorities
  1649.             return ["actor", "currentClass"];
  1650.             //
  1651.         }, // nextNotePriority
  1652.  
  1653.         /**
  1654.          * The this pointer refers to the actor involved
  1655.          * Sets the rule to chain all effective next notetag results
  1656.          * Nullipotent
  1657.          * @since v1.00a @version v1.00a
  1658.          * @param {Id} skillId - The id of the skill involved
  1659.          * @returns {String} The requested effective notetag chaining rule
  1660.          */
  1661.         nextNoteChainingRule: function(skillId) {
  1662.             return "every"; // Only all effective notetags will be used
  1663.         }, // nextNoteChainingRule
  1664.  
  1665.         /**
  1666.          * The this pointer refers to the actor involved
  1667.          * Sets the default result of whether the skill ending progressing will
  1668.          * be kept before chaining any keepCurrent notetags
  1669.          * Nullipotent
  1670.          * @since v1.00a @version v1.00a
  1671.          * @param {Id} skillId - The id of the skill involved
  1672.          * @returns {Boolean} The requested default keep current
  1673.          */
  1674.         defaultKeepCurrent: function(skillId) { return true; },
  1675.  
  1676.         /**
  1677.          * The this pointer refers to the actor involved
  1678.          * Note that skills always have the highest priority
  1679.          * Sets the priority of effective keepCurrent notetags among all data
  1680.          * types
  1681.          * Nullipotent
  1682.          * @since v1.00a @version v1.00a
  1683.          * @param {Id} skillId - The id of the skill involved
  1684.          * @returns {[String]} The requested data type priority queue
  1685.          */
  1686.         keepCurrentNotePriority: function(skillId) {
  1687.             // Actors and Classes have the highest and lowest priorities
  1688.             return ["actor", "currentClass"];
  1689.             //
  1690.         }, // keepCurrentNotePriority
  1691.  
  1692.         /**
  1693.          * The this pointer refers to the actor involved
  1694.          * Sets the rule to chain all effective keepCurrent notetag results
  1695.          * Nullipotent
  1696.          * @since v1.00a @version v1.00a
  1697.          * @param {Id} skillId - The id of the skill involved
  1698.          * @returns {String} The requested effective notetag chaining rule
  1699.          */
  1700.         keepCurrentNoteChainingRule: function(skillId) {
  1701.             return "first"; // Only the 1st effective notetag will be used
  1702.         }, // keepCurrentNoteChainingRule
  1703.  
  1704.         /**
  1705.          * The this pointer refers to the actor involved
  1706.          * Sets what will happen right before progressing a skill
  1707.          * @since v1.00a @version v1.00a
  1708.          * @param {Id} skillId - The id of the skill involved
  1709.          */
  1710.         willEnd: function(skillId) { /* Does nothing extra */ },
  1711.  
  1712.         /**
  1713.          * The this pointer refers to the actor involved
  1714.          * Note that skills always have the highest priority
  1715.          * Sets the priority of effective willEnd notetags among all data
  1716.          * types
  1717.          * Nullipotent
  1718.          * @since v1.00a @version v1.00a
  1719.          * @param {Id} skillId - The id of the skill involved
  1720.          * @returns {[String]} The requested data type priority queue
  1721.          */
  1722.         willEndNotePriority: function(skillId) {
  1723.             // States and Actors have the highest and lowest priorities
  1724.             return [
  1725.                 "states",
  1726.                 "armors",
  1727.                 "weapons",
  1728.                 "currentClass",
  1729.                 "actor"
  1730.             ];
  1731.             //
  1732.         }, // willEndNotePriority
  1733.  
  1734.         /**
  1735.          * The this pointer refers to the actor involved
  1736.          * Sets the rule to chain all effective willEnd notetag results
  1737.          * Nullipotent
  1738.          * @since v1.00a @version v1.00a
  1739.          * @param {Id} skillId - The id of the skill involved
  1740.          * @returns {String} The requested effective notetag chaining rule
  1741.          */
  1742.         willEndNoteChainingRule: function(skillId) {
  1743.             return "every"; // All effective notetags will be used
  1744.         }, // willEndNoteChainingRule
  1745.  
  1746.         /**
  1747.          * The this pointer refers to the actor involved
  1748.          * Sets what will happen right after progressing a skill
  1749.          * @since v1.00a @version v1.00a
  1750.          * @param {Id} skillId - The id of the skill involved
  1751.          */
  1752.         didEnd: function(skillId) {
  1753.             // Reserves the common event with id 1(its setup might be delayed)
  1754.             $gameTemp.reserveCommonEvent(1);
  1755.             //
  1756.         }, // didEnd
  1757.  
  1758.         /**
  1759.          * The this pointer refers to the actor involved
  1760.          * Note that skills always have the highest priority
  1761.          * Sets the priority of effective didEnd notetags among all data
  1762.          * types
  1763.          * Nullipotent
  1764.          * @since v1.00a @version v1.00a
  1765.          * @param {Id} skillId - The id of the skill involved
  1766.          * @returns {[String]} The requested data type priority queue
  1767.          */
  1768.         didEndNotePriority: function(skillId) {
  1769.             // States and Actors have the highest and lowest priorities
  1770.             return [
  1771.                 "states",
  1772.                 "armors",
  1773.                 "weapons",
  1774.                 "currentClass",
  1775.                 "actor"
  1776.             ];
  1777.             //
  1778.         }, // didEndNotePriority
  1779.  
  1780.         /**
  1781.          * The this pointer refers to the actor involved
  1782.          * Sets the rule to chain all effective didEnd notetag results
  1783.          * Nullipotent
  1784.          * @since v1.00a @version v1.00a
  1785.          * @param {Id} skillId - The id of the skill involved
  1786.          * @returns {String} The requested effective notetag chaining rule
  1787.          */
  1788.         didEndNoteChainingRule: function(skillId) {
  1789.             return "every"; // All effective notetags will be used
  1790.         }, // didEndNoteChainingRule
  1791.  
  1792.         /**
  1793.          * The this pointer refers to the Window_SkillProgressCmd involved
  1794.          * Sets the skill progress command window line height
  1795.          * Hotspot/Nullipotent
  1796.          * @since v1.00a @version v1.00a
  1797.          * @returns {Number} The requested window line height
  1798.          */
  1799.         cmdLineH: function() {
  1800.             // Uses the default command window value
  1801.             return Window_Command.prototype.lineHeight.call(this);
  1802.             //
  1803.         }, // cmdLineH
  1804.  
  1805.         /**
  1806.          * The this pointer refers to the Window_SkillProgressCmd involved
  1807.          * Sets the skill progress command window standard font size
  1808.          * Hotspot/Nullipotent
  1809.          * @since v1.00a @version v1.00a
  1810.          * @returns {Number} The requested window standard font size
  1811.          */
  1812.         cmdFontSize: function() {
  1813.             // Uses the default command window value
  1814.             return Window_Command.prototype.standardFontSize.call(this);
  1815.             //
  1816.         }, // cmdFontSize
  1817.  
  1818.         /**
  1819.          * The this pointer refers to the Window_SkillProgressCmd involved
  1820.          * Sets the skill progress command window standard padding
  1821.          * Hotspot/Nullipotent
  1822.          * @since v1.00a @version v1.00a
  1823.          * @returns {Number} The requested window standard padding
  1824.          */
  1825.         cmdPadding: function() {
  1826.             // Uses the default command window value
  1827.             return Window_Command.prototype.standardPadding.call(this);
  1828.             //
  1829.         }, // cmdPadding
  1830.  
  1831.         /**
  1832.          * The this pointer refers to the Window_SkillProgressCmd involved
  1833.          * Sets the skill progress command window text padding
  1834.          * Hotspot/Nullipotent
  1835.          * @since v1.00a @version v1.00a
  1836.          * @returns {Number} The requested window text padding
  1837.          */
  1838.         cmdTextPadding: function() {
  1839.             // Uses the default command window value
  1840.             return Window_Command.prototype.textPadding.call(this);
  1841.             //
  1842.         }, // cmdTextPadding
  1843.  
  1844.         /**
  1845.          * The this pointer refers to the Window_SkillProgressCmd involved
  1846.          * Sets the skill progress command window standard back opacity
  1847.          * Hotspot/Nullipotent
  1848.          * @since v1.00a @version v1.00a
  1849.          * @returns {Number} The requested window standard back opacity
  1850.          */
  1851.         cmdBackOpacity: function() {
  1852.             // Uses the default command window value
  1853.             return Window_Command.prototype.standardBackOpacity.call(this);
  1854.             //
  1855.         }, // cmdBackOpacity
  1856.  
  1857.         /**
  1858.          * The this pointer refers to the Window_SkillProgressCmd involved
  1859.          * Sets the skill progress command window translucent opacity
  1860.          * Hotspot/Nullipotent
  1861.          * @since v1.00a @version v1.00a
  1862.          * @returns {Number} The requested window translucent opacity
  1863.          */
  1864.         cmdTranslucentOpacity: function() {
  1865.             // Uses the default command window value
  1866.             return Window_Command.prototype.translucentOpacity.call(this);
  1867.             //
  1868.         }, // cmdTranslucentOpacity
  1869.  
  1870.         /**
  1871.          * The this pointer refers to the Window_SkillProgressCmd involved
  1872.          * Sets the skill progress command window spacing
  1873.          * Hotspot/Nullipotent
  1874.          * @since v1.00a @version v1.00a
  1875.          * @returns {Number} The requested window spacing
  1876.          */
  1877.         cmdSpacing: function() {
  1878.             // Uses the default command window value
  1879.             return Window_Command.prototype.spacing.call(this);
  1880.             //
  1881.         }, // cmdSpacing
  1882.  
  1883.         /**
  1884.          * The this pointer refers to the Window_SkillProgressCmd involved
  1885.          * Sets the skill progress command window width
  1886.          * Hotspot/Nullipotent
  1887.          * @since v1.00a @version v1.00a
  1888.          * @returns {Number} The requested window width
  1889.          */
  1890.         cmdWinW: function() {
  1891.             // Uses the default command window value
  1892.             return Window_Command.prototype.windowWidth.call(this);
  1893.             //
  1894.         }, // cmdWinW
  1895.  
  1896.         /**
  1897.          * The this pointer refers to the Window_SkillProgressCmd involved
  1898.          * Sets the skill progress command window height
  1899.          * Hotspot/Nullipotent
  1900.          * @since v1.00a @version v1.00a
  1901.          * @returns {Number} The requested window height
  1902.          */
  1903.         cmdWinH: function() {
  1904.             // Uses the default command window value
  1905.             return Window_Command.prototype.windowHeight.call(this);
  1906.             //
  1907.         }, // cmdWinH
  1908.  
  1909.         /**
  1910.          * The this pointer refers to the Window_SkillProgressCmd involved
  1911.          * Sets the skill progress command window x position
  1912.          * Hotspot/Nullipotent
  1913.          * @since v1.00a @version v1.00a
  1914.          * @returns {Number} The requested window x position
  1915.          */
  1916.         cmdWinX: function() {
  1917.             return 0; // Places the window at the leftmost position
  1918.         }, // cmdWinX
  1919.  
  1920.         /**
  1921.          * The this pointer refers to the Window_SkillProgressCmd involved
  1922.          * Sets the skill progress command window y position
  1923.          * Hotspot/Nullipotent
  1924.          * @since v1.00a @version v1.00a
  1925.          * @returns {Number} The requested window y position
  1926.          */
  1927.         cmdWinY: function() {
  1928.             return 0; // Places the window at the uppermost position
  1929.         }, // cmdWinY
  1930.  
  1931.         /**
  1932.          * The this pointer refers to the Window_SkillProgressCmd involved
  1933.          * Sets the skill progress command window view progress command text
  1934.          * Hotspot/Nullipotent
  1935.          * @since v1.00a @version v1.00a
  1936.          * @returns {String} The requested command text
  1937.          */
  1938.         cmdView: function() { return "View Progress"; },
  1939.  
  1940.         /**
  1941.          * The this pointer refers to the Window_SkillProgressCmd involved
  1942.          * Sets the skill progress command window use skill command text
  1943.          * Hotspot/Nullipotent
  1944.          * @since v1.00a @version v1.00a
  1945.          * @returns {String} The requested command text
  1946.          */
  1947.         cmdUse: function() { return "Use"; },
  1948.  
  1949.         /**
  1950.          * The this pointer refers to the Window_SkillProgressStat involved
  1951.          * Sets the skill progress stat window line height
  1952.          * Hotspot/Nullipotent
  1953.          * @since v1.00a @version v1.00a
  1954.          * @returns {Number} The requested window line height
  1955.          */
  1956.         statLineH: function() {
  1957.             // Uses the default selectable window value
  1958.             return Window_Selectable.prototype.lineHeight.call(this);
  1959.             //
  1960.         }, // statLineH
  1961.  
  1962.         /**
  1963.          * The this pointer refers to the Window_SkillProgressStat involved
  1964.          * Sets the skill progress stat window standard font size
  1965.          * Hotspot/Nullipotent
  1966.          * @since v1.00a @version v1.00a
  1967.          * @returns {Number} The requested window standard font size
  1968.          */
  1969.         statFontSize: function() {
  1970.             // Uses the default selectable window value
  1971.             return Window_Selectable.prototype.standardFontSize.call(this);
  1972.             //
  1973.         }, // statFontSize
  1974.  
  1975.         /**
  1976.          * The this pointer refers to the Window_SkillProgressStat involved
  1977.          * Sets the skill progress stat window standard padding
  1978.          * Hotspot/Nullipotent
  1979.          * @since v1.00a @version v1.00a
  1980.          * @returns {Number} The requested window standard padding
  1981.          */
  1982.         statPadding: function() {
  1983.             // Uses the default selectable window value
  1984.             return Window_Selectable.prototype.standardPadding.call(this);
  1985.             //
  1986.         }, // statPadding
  1987.  
  1988.         /**
  1989.          * The this pointer refers to the Window_SkillProgressStat involved
  1990.          * Sets the skill progress stat window text padding
  1991.          * Hotspot/Nullipotent
  1992.          * @since v1.00a @version v1.00a
  1993.          * @returns {Number} The requested window text padding
  1994.          */
  1995.         statTextPadding: function() {
  1996.             // Uses the default selectable window value
  1997.             return Window_Selectable.prototype.textPadding.call(this);
  1998.             //
  1999.         }, // statTextPadding
  2000.  
  2001.         /**
  2002.          * The this pointer refers to the Window_SkillProgressStat involved
  2003.          * Sets the skill progress stat window standard back opacity
  2004.          * Hotspot/Nullipotent
  2005.          * @since v1.00a @version v1.00a
  2006.          * @returns {Number} The requested window standard back opacity
  2007.          */
  2008.         statBackOpacity: function() {
  2009.             // Uses the default selectable window value
  2010.             return Window_Selectable.prototype.standardBackOpacity.call(this);
  2011.             //
  2012.         }, // statBackOpacity
  2013.  
  2014.         /**
  2015.          * The this pointer refers to the Window_SkillProgressStat involved
  2016.          * Sets the skill progress stat window translucent opacity
  2017.          * Hotspot/Nullipotent
  2018.          * @since v1.00a @version v1.00a
  2019.          * @returns {Number} The requested window translucent opacity
  2020.          */
  2021.         statTranslucentOpacity: function() {
  2022.             // Uses the default selectable window value
  2023.             return Window_Selectable.prototype.translucentOpacity.call(this);
  2024.             //
  2025.         }, // statTranslucentOpacity
  2026.  
  2027.         /**
  2028.          * The this pointer refers to the Window_SkillProgressStat involved
  2029.          * Sets the skill progress stat window spacing
  2030.          * Hotspot/Nullipotent
  2031.          * @since v1.00a @version v1.00a
  2032.          * @returns {Number} The requested window spacing
  2033.          */
  2034.         statSpacing: function() {
  2035.             // Uses the default selectable window value
  2036.             return Window_Selectable.prototype.spacing.call(this);
  2037.             //
  2038.         }, // statSpacing
  2039.  
  2040.         /**
  2041.          * The this pointer refers to the Window_SkillProgressStat involved
  2042.          * Sets the skill progress stat window width
  2043.          * Hotspot/Nullipotent
  2044.          * @since v1.00a @version v1.00a
  2045.          * @returns {Number} The requested window width
  2046.          */
  2047.         statWinW: function() {
  2048.             return Graphics.boxWidth; // Uses the whole screen width
  2049.         }, // statWinW
  2050.  
  2051.         /**
  2052.          * The this pointer refers to the Window_SkillProgressStat involved
  2053.          * Sets the skill progress stat window height
  2054.          * Hotspot/Nullipotent
  2055.          * @since v1.00a @version v1.00a
  2056.          * @returns {Number} The requested window height
  2057.          */
  2058.         statWinH: function() {
  2059.             return this.fittingHeight(2); // Uses 2 lines of space
  2060.         }, // statWinH
  2061.  
  2062.         /**
  2063.          * The this pointer refers to the Window_SkillProgressStat involved
  2064.          * Sets the skill progress stat window x position
  2065.          * Hotspot/Nullipotent
  2066.          * @since v1.00a @version v1.00a
  2067.          * @returns {Number} The requested window x position
  2068.          */
  2069.         statWinX: function() {
  2070.             return 0; // Places the window at the leftmost position
  2071.         }, // statWinX
  2072.  
  2073.         /**
  2074.          * The this pointer refers to the Window_SkillProgressStat involved
  2075.          * Sets the skill progress stat window y position
  2076.          * Hotspot/Nullipotent
  2077.          * @since v1.00a @version v1.00a
  2078.          * @returns {Number} The requested window y position
  2079.          */
  2080.         statWinY: function() {
  2081.             return 0; // Places the window at the uppermost position
  2082.         }, // statWinY
  2083.  
  2084.         /**
  2085.          * The this pointer refers to the Window_SkillProgressCond involved
  2086.          * Sets the skill progress condition window line height
  2087.          * Hotspot/Nullipotent
  2088.          * @since v1.00a @version v1.00a
  2089.          * @returns {Number} The requested window line height
  2090.          */
  2091.         condLineH: function() {
  2092.             // Uses the default selectable window value
  2093.             return Window_Selectable.prototype.lineHeight.call(this);
  2094.             //
  2095.         }, // condLineH
  2096.  
  2097.         /**
  2098.          * The this pointer refers to the Window_SkillProgressCond involved
  2099.          * Sets the skill progress condition window standard font size
  2100.          * Hotspot/Nullipotent
  2101.          * @since v1.00a @version v1.00a
  2102.          * @returns {Number} The requested window standard font size
  2103.          */
  2104.         condFontSize: function() {
  2105.             // Uses the default selectable window value
  2106.             return Window_Selectable.prototype.standardFontSize.call(this);
  2107.             //
  2108.         }, // condFontSize
  2109.  
  2110.         /**
  2111.          * The this pointer refers to the Window_SkillProgressCond involved
  2112.          * Sets the skill progress condition window standard padding
  2113.          * Hotspot/Nullipotent
  2114.          * @since v1.00a @version v1.00a
  2115.          * @returns {Number} The requested window standard padding
  2116.          */
  2117.         condPadding: function() {
  2118.             // Uses the default selectable window value
  2119.             return Window_Selectable.prototype.standardPadding.call(this);
  2120.             //
  2121.         }, // condPadding
  2122.  
  2123.         /**
  2124.          * The this pointer refers to the Window_SkillProgressCond involved
  2125.          * Sets the skill progress condition window text padding
  2126.          * Hotspot/Nullipotent
  2127.          * @since v1.00a @version v1.00a
  2128.          * @returns {Number} The requested window text padding
  2129.          */
  2130.         condTextPadding: function() {
  2131.             // Uses the default selectable window value
  2132.             return Window_Selectable.prototype.textPadding.call(this);
  2133.             //
  2134.         }, // condTextPadding
  2135.  
  2136.         /**
  2137.          * The this pointer refers to the Window_SkillProgressCond involved
  2138.          * Sets the skill progress condition window standard back opacity
  2139.          * Hotspot/Nullipotent
  2140.          * @since v1.00a @version v1.00a
  2141.          * @returns {Number} The requested window standard back opacity
  2142.          */
  2143.         condBackOpacity: function() {
  2144.             // Uses the default selectable window value
  2145.             return Window_Selectable.prototype.standardBackOpacity.call(this);
  2146.             //
  2147.         }, // condBackOpacity
  2148.  
  2149.         /**
  2150.          * The this pointer refers to the Window_SkillProgressCond involved
  2151.          * Sets the skill progress condition window translucent opacity
  2152.          * Hotspot/Nullipotent
  2153.          * @since v1.00a @version v1.00a
  2154.          * @returns {Number} The requested window translucent opacity
  2155.          */
  2156.         condTranslucentOpacity: function() {
  2157.             // Uses the default selectable window value
  2158.             return Window_Selectable.prototype.translucentOpacity.call(this);
  2159.             //
  2160.         }, // condTranslucentOpacity
  2161.  
  2162.         /**
  2163.          * The this pointer refers to the Window_SkillProgressCond involved
  2164.          * Sets the skill progress condition window spacing
  2165.          * Hotspot/Nullipotent
  2166.          * @since v1.00a @version v1.00a
  2167.          * @returns {Number} The requested window spacing
  2168.          */
  2169.         condSpacing: function() {
  2170.             // Uses the default selectable window value
  2171.             return Window_Selectable.prototype.spacing.call(this);
  2172.             //
  2173.         }, // condSpacing
  2174.  
  2175.         /**
  2176.          * The this pointer refers to the Window_SkillProgressCond involved
  2177.          * Sets the skill progress condition window width
  2178.          * Hotspot/Nullipotent
  2179.          * @since v1.00a @version v1.00a
  2180.          * @returns {Number} The requested window width
  2181.          */
  2182.         condWinW: function() {
  2183.             return Graphics.boxWidth / 2; // Uses half of the screen width
  2184.         }, // condWinW
  2185.  
  2186.         /**
  2187.          * The this pointer refers to the Window_SkillProgressCond involved
  2188.          * Sets the skill progress condition window height
  2189.          * Hotspot/Nullipotent
  2190.          * @since v1.00a @version v1.00a
  2191.          * @returns {Number} The requested window height
  2192.          */
  2193.         condWinH: function() {
  2194.             // Uses the rest of the screen height
  2195.             return Graphics.boxHeight - this.fittingHeight(2);
  2196.             //
  2197.         }, // condWinH
  2198.  
  2199.         /**
  2200.          * The this pointer refers to the Window_SkillProgressCond involved
  2201.          * Sets the skill progress condition window x position
  2202.          * Hotspot/Nullipotent
  2203.          * @since v1.00a @version v1.00a
  2204.          * @returns {Number} The requested window x position
  2205.          */
  2206.         condWinX: function() {
  2207.             return 0; // Places the window at the leftmost position
  2208.         }, // condWinX
  2209.  
  2210.         /**
  2211.          * The this pointer refers to the Window_SkillProgressCond involved
  2212.          * Sets the skill progress condition window y position
  2213.          * Hotspot/Nullipotent
  2214.          * @since v1.00a @version v1.00a
  2215.          * @returns {Number} The requested window y position
  2216.          */
  2217.         condWinY: function() {
  2218.             // Places it directly below the stat window
  2219.             return this.fittingHeight(2);
  2220.             //
  2221.         }, // condWinY
  2222.  
  2223.         /**
  2224.          * The this pointer refers to the Window_SkillProgressNext involved
  2225.          * Sets the skill progress next skill window line height
  2226.          * Hotspot/Nullipotent
  2227.          * @since v1.00a @version v1.00a
  2228.          * @returns {Number} The requested window line height
  2229.          */
  2230.         nextLineH: function() {
  2231.             // Uses the default selectable window value
  2232.             return Window_Selectable.prototype.lineHeight.call(this);
  2233.             //
  2234.         }, // nextLineH
  2235.  
  2236.         /**
  2237.          * The this pointer refers to the Window_SkillProgressNext involved
  2238.          * Sets the skill progress next skill window standard font size
  2239.          * Hotspot/Nullipotent
  2240.          * @since v1.00a @version v1.00a
  2241.          * @returns {Number} The requested window standard font size
  2242.          */
  2243.         nextFontSize: function() {
  2244.             // Uses the default selectable window value
  2245.             return Window_Selectable.prototype.standardFontSize.call(this);
  2246.             //
  2247.         }, // nextFontSize
  2248.  
  2249.         /**
  2250.          * The this pointer refers to the Window_SkillProgressNext involved
  2251.          * Sets the skill progress next skill window standard padding
  2252.          * Hotspot/Nullipotent
  2253.          * @since v1.00a @version v1.00a
  2254.          * @returns {Number} The requested window standard padding
  2255.          */
  2256.         nextPadding: function() {
  2257.             // Uses the default selectable window value
  2258.             return Window_Selectable.prototype.standardPadding.call(this);
  2259.             //
  2260.         }, // nextPadding
  2261.  
  2262.         /**
  2263.          * The this pointer refers to the Window_SkillProgressNext involved
  2264.          * Sets the skill progress next skill window text padding
  2265.          * Hotspot/Nullipotent
  2266.          * @since v1.00a @version v1.00a
  2267.          * @returns {Number} The requested window text padding
  2268.          */
  2269.         nextTextPadding: function() {
  2270.             // Uses the default selectable window value
  2271.             return Window_Selectable.prototype.textPadding.call(this);
  2272.             //
  2273.         }, // nextTextPadding
  2274.  
  2275.         /**
  2276.          * The this pointer refers to the Window_SkillProgressNext involved
  2277.          * Sets the skill progress next skill window standard back opacity
  2278.          * Hotspot/Nullipotent
  2279.          * @since v1.00a @version v1.00a
  2280.          * @returns {Number} The requested window standard back opacity
  2281.          */
  2282.         nextBackOpacity: function() {
  2283.             // Uses the default selectable window value
  2284.             return Window_Selectable.prototype.standardBackOpacity.call(this);
  2285.             //
  2286.         }, // nextBackOpacity
  2287.  
  2288.         /**
  2289.          * The this pointer refers to the Window_SkillProgressNext involved
  2290.          * Sets the skill progress next skill window translucent opacity
  2291.          * Hotspot/Nullipotent
  2292.          * @since v1.00a @version v1.00a
  2293.          * @returns {Number} The requested window translucent opacity
  2294.          */
  2295.         nextTranslucentOpacity: function() {
  2296.             // Uses the default selectable window value
  2297.             return Window_Selectable.prototype.translucentOpacity.call(this);
  2298.             //
  2299.         }, // nextTranslucentOpacity
  2300.  
  2301.         /**
  2302.          * The this pointer refers to the Window_SkillProgressNext involved
  2303.          * Sets the skill progress next skill window spacing
  2304.          * Hotspot/Nullipotent
  2305.          * @since v1.00a @version v1.00a
  2306.          * @returns {Number} The requested window spacing
  2307.          */
  2308.         nextSpacing: function() {
  2309.             // Uses the default selectable window value
  2310.             return Window_Selectable.prototype.spacing.call(this);
  2311.             //
  2312.         }, // nextSpacing
  2313.  
  2314.         /**
  2315.          * The this pointer refers to the Window_SkillProgressNext involved
  2316.          * Sets the skill progress next skill window width
  2317.          * Hotspot/Nullipotent
  2318.          * @since v1.00a @version v1.00a
  2319.          * @returns {Number} The requested window width
  2320.          */
  2321.         nextWinW: function() {
  2322.             return Graphics.boxWidth / 2; // Uses half of the screen width
  2323.         }, // nextWinW
  2324.  
  2325.         /**
  2326.          * The this pointer refers to the Window_SkillProgressNext involved
  2327.          * Sets the skill progress next skill window height
  2328.          * Hotspot/Nullipotent
  2329.          * @since v1.00a @version v1.00a
  2330.          * @returns {Number} The requested window height
  2331.          */
  2332.         nextWinH: function() {
  2333.             // Uses the rest of the screen height
  2334.             return Graphics.boxHeight - this.fittingHeight(2);
  2335.             //
  2336.         }, // nextWinH
  2337.  
  2338.         /**
  2339.          * The this pointer refers to the Window_SkillProgressNext involved
  2340.          * Sets the skill progress next skill window x position
  2341.          * Hotspot/Nullipotent
  2342.          * @since v1.00a @version v1.00a
  2343.          * @returns {Number} The requested window x position
  2344.          */
  2345.         nextWinX: function() {
  2346.             return Graphics.boxWidth / 2; // Places it at the right half
  2347.         }, // nextWinX
  2348.  
  2349.         /**
  2350.          * The this pointer refers to the Window_SkillProgressNext involved
  2351.          * Sets the skill progress next skill y position
  2352.          * Hotspot/Nullipotent
  2353.          * @since v1.00a @version v1.00a
  2354.          * @returns {Number} The requested window y position
  2355.          */
  2356.         nextWinY: function() {
  2357.             // Places it directly below the stat window
  2358.             return this.fittingHeight(2);
  2359.             //
  2360.         }, // nextWinY
  2361.  
  2362.         /**
  2363.          * Sets the list of ids of game variables used by this plugin
  2364.          * Hotspot/Nullipotent
  2365.          * @since v1.00a @version v1.00a
  2366.          * @returns {[Number]} The requested list of game variable ids
  2367.          */
  2368.         varIds: function() {
  2369.             // Informs the plugin that no variables are used by this plugin
  2370.             return [];
  2371.             // Use this Array form or the following Object form instead -
  2372.             // (Advanced) Pinpoints the exact notes and factors using each id
  2373.             /* General form:
  2374.             return {
  2375.                 varIdi: { notes: [noteij, ...], factors: [factorij, ...] },
  2376.                 ...
  2377.             }
  2378.             Example:
  2379.             return {
  2380.                 1: { notes: ["cond", "max"], factors: ["actor", "armors"] },
  2381.                 2: { notes: ["next", "didEnd"], factors: ["states", "skills"] }
  2382.             };
  2383.             */
  2384.         }, // varIds
  2385.  
  2386.         /**
  2387.          * Sets the list of ids of game switches used by this plugin
  2388.          * Hotspot/Nullipotent
  2389.          * @since v1.00a @version v1.00a
  2390.          * @returns {[Number]} The requested list of game switch ids
  2391.          */
  2392.         switchIds: function() {
  2393.             // Informs the plugin that no switches are used by this plugin
  2394.             return [];
  2395.             // Use this Array form or the following Object form instead -
  2396.             // (Advanced) Pinpoints the exact notes and factors using each id
  2397.             /* General form:
  2398.             return {
  2399.                 switchIdi: { notes: [noteij, ...], factors: [factorij, ...] },
  2400.                 ...
  2401.             }
  2402.             Example:
  2403.             return {
  2404.                 1: { notes: ["cond", "max"], factors: ["actor", "armors"] },
  2405.                 2: { notes: ["next", "didEnd"], factors: ["states", "skills"] }
  2406.             };
  2407.             */
  2408.         } // switchIds
  2409.  
  2410.     }, // params
  2411.  
  2412. /*----------------------------------------------------------------------------
  2413.  *    Configurations
  2414.  *    - These configurations don't have any parameter counterparts
  2415.  *----------------------------------------------------------------------------*/
  2416.  
  2417.     cfgs: {
  2418.  
  2419.         /**
  2420.          * The this pointer refers to the Window_SkillProgressStat involved
  2421.          * This configuration has no parameter counterparts
  2422.          * Sets the skill progress stat window y position
  2423.          * Hotspot/Nullipotent
  2424.          * @since v1.00a @version v1.00a
  2425.          * @param {Number} current - The current skill progress status
  2426.          * @param {Number} max - The maximum skill progress status
  2427.          * @param {Number} isKeep - If the skill will be kept upon progress
  2428.          */
  2429.         drawStat: function(current, max, isKeep) {
  2430.             var line1Rect = this.itemRectForText(0);
  2431.             var line2Rect = this.itemRectForText(1);
  2432.             var line1Text = "Progress: " + current + "/" + max;
  2433.             var line2Text = "Is Kept After Progress: " + isKeep;
  2434.             this.drawText(line1Text, line1Rect.x, line1Rect.y, line1Rect.width);
  2435.             this.drawText(line2Text, line2Rect.x, line2Rect.y, line2Rect.width);
  2436.         }, // drawStat
  2437.  
  2438.     }, // cfgs
  2439.  
  2440. /*----------------------------------------------------------------------------
  2441.  *    Notetag values
  2442.  *    - These functions are used by notetags using function name as values
  2443.  *----------------------------------------------------------------------------*/
  2444.  
  2445.     notes: {
  2446.  
  2447.         /*--------------------------------------------------------------------
  2448.          *    Cond Functions
  2449.          *    - Setups CX used by this plugin's notetags
  2450.          *--------------------------------------------------------------------*/
  2451.         /* CX names can only use alphanumeric characters
  2452.          * The 1st character of CX can't be a number
  2453.          * The below CX are examples added to help you set your CX
  2454.          * You can freely use, rewrite and/or delete these examples
  2455.          */
  2456.  
  2457.         /**
  2458.          * The this pointer refers to the actor involved
  2459.          * Nullipotent
  2460.          * @since v1.00a @version v1.00a
  2461.          * @param {Id} skillId - The id of the skill involved
  2462.          * @param {{*}} datum - The datum having this notetag
  2463.          * @returns {Boolean} The check result
  2464.          */
  2465.         C1: function(skillId, datum) { return true; },
  2466.  
  2467.         /**
  2468.          * The this pointer refers to the actor involved
  2469.          * Nullipotent
  2470.          * @since v1.00a @version v1.00a
  2471.          * @param {Id} skillId - The id of the skill involved
  2472.          * @param {{*}} datum - The datum having this notetag
  2473.          * @returns {Boolean} The check result
  2474.          */
  2475.         C2: function(skillId, datum) { return false; },
  2476.  
  2477.         /**
  2478.          * The this pointer refers to the actor involved
  2479.          * Nullipotent
  2480.          * @since v1.00a @version v1.00a
  2481.          * @param {Id} skillId - The id of the skill involved
  2482.          * @param {{*}} datum - The datum having this notetag
  2483.          * @returns {Boolean} The check result
  2484.          */
  2485.         C3: function(skillId, datum) {
  2486.             // Returns the value in the game switch with id x
  2487.             return $gameSwitches.value(x);
  2488.             //
  2489.         }, // C3
  2490.  
  2491.         // Adds new CX here
  2492.  
  2493.  
  2494.         /*--------------------------------------------------------------------
  2495.          *    Max Functions
  2496.          *    - Setups MX used by this plugin's notetags
  2497.          *--------------------------------------------------------------------*/
  2498.         /* MX names can only use alphanumeric characters
  2499.          * The 1st character of MX can't be a number
  2500.          * The below MX are examples added to help you set your MX
  2501.          * You can freely use, rewrite and/or delete these examples
  2502.          */
  2503.  
  2504.         /**
  2505.          * The this pointer refers to the actor involved
  2506.          * Nullipotent
  2507.          * @since v1.00a @version v1.00a
  2508.          * @param {Id} skillId - The id of the skill involved
  2509.          * @param {{*}} datum - The datum having this notetag
  2510.          * @returns {Number} The maximum experience of the skill to be
  2511.          *                   progressed(Which should be positive) for the actor
  2512.          *                   involved
  2513.          */
  2514.         M1: function(skillId, datum) { return 400; },
  2515.  
  2516.         /**
  2517.          * The this pointer refers to the actor involved
  2518.          * Nullipotent
  2519.          * @since v1.00a @version v1.00a
  2520.          * @param {Id} skillId - The id of the skill involved
  2521.          * @param {{*}} datum - The datum having this notetag
  2522.          * @returns {Number} The maximum experience of the skill to be
  2523.          *                   progressed(Which should be positive) for the actor
  2524.          *                   involved
  2525.          */
  2526.         M2: function(skillId, datum) { return this.level; },
  2527.  
  2528.         /**
  2529.          * The this pointer refers to the actor involved
  2530.          * Nullipotent
  2531.          * @since v1.00a @version v1.00a
  2532.          * @param {Id} skillId - The id of the skill involved
  2533.          * @param {{*}} datum - The datum having this notetag
  2534.          * @returns {Number} The maximum experience of the skill to be
  2535.          *                   progressed(Which should be positive) for the actor
  2536.          *                   involved
  2537.          */
  2538.         M3: function(skillId, datum) {
  2539.             // Returns the value in the game variable with id x
  2540.             return $gameVariables.value(x);
  2541.             //
  2542.         }, // M3
  2543.  
  2544.         // Adds new MX here
  2545.  
  2546.  
  2547.         /*--------------------------------------------------------------------
  2548.          *    useGain Functions
  2549.          *    - Setups UGX used by this plugin's notetags
  2550.          *--------------------------------------------------------------------*/
  2551.         /* UGX names can only use alphanumeric characters
  2552.          * The 1st character of UGX can't be a number
  2553.          * The below UGX are examples added to help you set your UGX
  2554.          * You can freely use, rewrite and/or delete these examples
  2555.          */
  2556.  
  2557.         /**
  2558.          * The this pointer refers to the actor involved
  2559.          * Nullipotent
  2560.          * @since v1.00a @version v1.00a
  2561.          * @param {Id} skillId - The id of the skill involved
  2562.          * @param {{*}} datum - The datum having this notetag
  2563.          * @returns {Number} The experience gain of the skill to be progressed
  2564.          *                   upon use for the actor involved
  2565.          */
  2566.         UG1: function(skillId, datum) { return 100; },
  2567.  
  2568.         /**
  2569.          * The this pointer refers to the actor involved
  2570.          * Nullipotent
  2571.          * @since v1.00a @version v1.00a
  2572.          * @param {Id} skillId - The id of the skill involved
  2573.          * @param {{*}} datum - The datum having this notetag
  2574.          * @returns {Number} The experience gain of the skill to be progressed
  2575.          *                   upon use for the actor involved
  2576.          */
  2577.         UG2: function(skillId, datum) { return this.luk; },
  2578.  
  2579.         /**
  2580.          * The this pointer refers to the actor involved
  2581.          * Nullipotent
  2582.          * @since v1.00a @version v1.00a
  2583.          * @param {Id} skillId - The id of the skill involved
  2584.          * @param {{*}} datum - The datum having this notetag
  2585.          * @returns {Number} The experience gain of the skill to be progressed
  2586.          *                   upon use for the actor involved
  2587.          */
  2588.         UG3: function(skillId, datum) {
  2589.             // Returns the value in the game variable with id x
  2590.             return $gameVariables.value(x);
  2591.             //
  2592.         }, // UG3
  2593.  
  2594.         // Adds new UGX here
  2595.  
  2596.  
  2597.         /*--------------------------------------------------------------------
  2598.          *    hitGain Functions
  2599.          *    - Setups HGX used by this plugin's notetags
  2600.          *--------------------------------------------------------------------*/
  2601.         /* HGX names can only use alphanumeric characters
  2602.          * The 1st character of HGX can't be a number
  2603.          * The below HGX are examples added to help you set your HGX
  2604.          * You can freely use, rewrite and/or delete these examples
  2605.          */
  2606.  
  2607.         /**
  2608.          * The this pointer refers to the actor involved
  2609.          * Nullipotent
  2610.          * @since v1.00a @version v1.00a
  2611.          * @param {Id} skillId - The id of the skill involved
  2612.          * @param {{*}} datum - The datum having this notetag
  2613.          * @param {Game_Battler} target - The target hit by the skill involved
  2614.          * @param {Number} value - The damage of the hit involved
  2615.          * @returns {Number} The experience gain of the skill to be progressed
  2616.          *                   upon hitting the target involved with the damage
  2617.          *                   involved for the actor involved
  2618.          */
  2619.         HG1: function(skillId, datum, target, value) { return value; },
  2620.  
  2621.         /**
  2622.          * The this pointer refers to the actor involved
  2623.          * Nullipotent
  2624.          * @since v1.00a @version v1.00a
  2625.          * @param {Id} skillId - The id of the skill involved
  2626.          * @param {{*}} datum - The datum having this notetag
  2627.          * @param {Game_Battler} target - The target hit by the skill involved
  2628.          * @param {Number} value - The damage of the hit involved
  2629.          * @returns {Number} The experience gain of the skill to be progressed
  2630.          *                   upon hitting the target involved with the damage
  2631.          *                   involved for the actor involved
  2632.          */
  2633.         HG2: function(skillId, datum, target, value) {
  2634.             return this.luk - target.luk;
  2635.         }, // HG2
  2636.  
  2637.         /**
  2638.          * The this pointer refers to the actor involved
  2639.          * Nullipotent
  2640.          * @since v1.00a @version v1.00a
  2641.          * @param {Id} skillId - The id of the skill involved
  2642.          * @param {{*}} datum - The datum having this notetag
  2643.          * @param {Game_Battler} target - The target hit by the skill involved
  2644.          * @param {Number} value - The damage of the hit involved
  2645.          * @returns {Number} The experience gain of the skill to be progressed
  2646.          *                   upon hitting the target involved with the damage
  2647.          *                   involved for the actor involved
  2648.          */
  2649.         HG3: function(skillId, datum, target, value) {
  2650.             // Returns the value in the game variable with id x
  2651.             return $gameVariables.value(x);
  2652.             //
  2653.         }, // HG3
  2654.  
  2655.         // Adds new HGX here
  2656.  
  2657.  
  2658.         /*--------------------------------------------------------------------
  2659.          *    Next Functions
  2660.          *    - Setups NX used by this plugin's notetags
  2661.          *--------------------------------------------------------------------*/
  2662.         /* NX names can only use alphanumeric characters
  2663.          * The 1st character of NX can't be a number
  2664.          * The below NX are examples added to help you set your NX
  2665.          * You can freely use, rewrite and/or delete these examples
  2666.          */
  2667.  
  2668.         /**
  2669.          * The this pointer refers to the actor involved
  2670.          * Nullipotent
  2671.          * @since v1.00a @version v1.00a
  2672.          * @param {Id} skillId - The id of the skill involved
  2673.          * @param {{*}} datum - The datum having this notetag
  2674.          * @returns {[Id]} The list of ids of skills to be learnt upon ending
  2675.          *                 progressing the current one for the actor involved
  2676.          */
  2677.         N1: function(skillId, datum) {
  2678.             return [3]; /* Only the skill with id 3 will be learnt */
  2679.         }, // N1
  2680.  
  2681.         /**
  2682.          * The this pointer refers to the actor involved
  2683.          * Nullipotent
  2684.          * @since v1.00a @version v1.00a
  2685.          * @param {Id} skillId - The id of the skill involved
  2686.          * @param {{*}} datum - The datum having this notetag
  2687.          * @returns {[Id]} The list of ids of skills to be learnt upon ending
  2688.          *                 progressing the current one for the actor involved
  2689.          */
  2690.         N2: function(skillId, datum) {
  2691.             return [4, 5]; /* Only the skills with id 4 and 5 will be learnt */
  2692.         }, // N2
  2693.  
  2694.         /**
  2695.          * The this pointer refers to the actor involved
  2696.          * Nullipotent
  2697.          * @since v1.00a @version v1.00a
  2698.          * @param {Id} skillId - The id of the skill involved
  2699.          * @param {{*}} datum - The datum having this notetag
  2700.          * @returns {[Id]} The list of ids of skills to be learnt upon ending
  2701.          *                 progressing the current one for the actor involved
  2702.          */
  2703.         N3: function(skillId, datum) {
  2704.             // Returns the value in the game variable with id x
  2705.             return $gameVariables.value(x);
  2706.             //
  2707.         }, // N3
  2708.  
  2709.         // Adds new NX here
  2710.  
  2711.  
  2712.         /*--------------------------------------------------------------------
  2713.          *    keepCurrent Functions
  2714.          *    - Setups KCX used by this plugin's notetags
  2715.          *--------------------------------------------------------------------*/
  2716.         /* KCX names can only use alphanumeric characters
  2717.          * The 1st character of KCX can't be a number
  2718.          * The below KCX are examples added to help you set your KCX
  2719.          * You can freely use, rewrite and/or delete these examples
  2720.          */
  2721.  
  2722.         /**
  2723.          * The this pointer refers to the actor involved
  2724.          * Nullipotent
  2725.          * @since v1.00a @version v1.00a
  2726.          * @param {Id} skillId - The id of the skill involved
  2727.          * @param {{*}} datum - The datum having this notetag
  2728.          * @returns {Boolean} The check result
  2729.          */
  2730.         KC1: function(skillId, datum) { return true; },
  2731.  
  2732.         /**
  2733.          * The this pointer refers to the actor involved
  2734.          * Nullipotent
  2735.          * @since v1.00a @version v1.00a
  2736.          * @param {Id} skillId - The id of the skill involved
  2737.          * @param {{*}} datum - The datum having this notetag
  2738.          * @returns {Boolean} The check result
  2739.          */
  2740.         KC2: function(skillId, datum) { return false; },
  2741.  
  2742.         /**
  2743.          * The this pointer refers to the actor involved
  2744.          * Nullipotent
  2745.          * @since v1.00a @version v1.00a
  2746.          * @param {Id} skillId - The id of the skill involved
  2747.          * @param {{*}} datum - The datum having this notetag
  2748.          * @returns {Boolean} The check result
  2749.          */
  2750.         KC3: function(skillId, datum) {
  2751.             // Returns the value in the game switch with id x
  2752.             return $gameSwitches.value(x);
  2753.             //
  2754.         }, // KC3
  2755.  
  2756.         // Adds new KCX here
  2757.  
  2758.  
  2759.         /*--------------------------------------------------------------------
  2760.          *    willEnd Functions
  2761.          *    - Setups WEX used by this plugin's notetags
  2762.          *--------------------------------------------------------------------*/
  2763.         /* WEX names can only use alphanumeric characters
  2764.          * The 1st character of WEX can't be a number
  2765.          * The below WEX are examples added to help you set your WEX
  2766.          * You can freely use, rewrite and/or delete these examples
  2767.          */
  2768.  
  2769.         /**
  2770.          * The this pointer refers to the actor involved
  2771.          * @since v1.00a @version v1.00a
  2772.          * @param {Id} skillId - The id of the skill involved
  2773.          * @param {{*}} datum - The datum having this notetag
  2774.          */
  2775.         WE1: function(skillId, datum) { /* Does nothing extra */ },
  2776.  
  2777.         /**
  2778.          * The this pointer refers to the actor involved
  2779.          * @since v1.00a @version v1.00a
  2780.          * @param {Id} skillId - The id of the skill involved
  2781.          * @param {{*}} datum - The datum having this notetag
  2782.          */
  2783.         WE2: function(skillId, datum) {
  2784.             // Reserves the common event with id x(its setup might be delayed)
  2785.             $gameTemp.reserveCommonEvent(x);
  2786.             //
  2787.         }, // WE2
  2788.  
  2789.         /**
  2790.          * The this pointer refers to the actor involved
  2791.          * @since v1.00a @version v1.00a
  2792.          * @param {Id} skillId - The id of the skill involved
  2793.          * @param {{*}} datum - The datum having this notetag
  2794.          */
  2795.         WE3: function(skillId, datum) {
  2796.             // Shows that the actor has learnt new skills in battle
  2797.             if (!BattleManager._phase) return;
  2798.             var logWindow = SceneManager._scene._logWindow, name = this.name();
  2799.             this.nextSkillProgress(skillId).map(function(id) {
  2800.                 return $dataSkills[id].name;
  2801.             }).forEach(function(n) {
  2802.                 logWindow.push('addText', name + " has learnt " + n + "!");
  2803.                 logWindow.push('wait');
  2804.                 logWindow.push('clear');
  2805.             });
  2806.             //
  2807.         }, // WE3
  2808.  
  2809.         // Adds new WEX here
  2810.  
  2811.  
  2812.         /*--------------------------------------------------------------------
  2813.          *    didEnd Functions
  2814.          *    - Setups DEX used by this plugin's notetags
  2815.          *--------------------------------------------------------------------*/
  2816.         /* DEX names can only use alphanumeric characters
  2817.          * The 1st character of DEX can't be a number
  2818.          * The below DEX are examples added to help you set your DEX
  2819.          * You can freely use, rewrite and/or delete these examples
  2820.          */
  2821.  
  2822.         /**
  2823.          * The this pointer refers to the actor involved
  2824.          * @since v1.00a @version v1.00a
  2825.          * @param {Id} skillId - The id of the skill involved
  2826.          * @param {{*}} datum - The datum having this notetag
  2827.          */
  2828.         DE1: function(skillId, datum) {
  2829.             // Otherwise the actor might suddenly use another skill
  2830.             if (!BattleManager._phase) SceneManager._scene.onActorCancel();
  2831.             //
  2832.         },
  2833.  
  2834.         /**
  2835.          * The this pointer refers to the actor involved
  2836.          * @since v1.00a @version v1.00a
  2837.          * @param {Id} skillId - The id of the skill involved
  2838.          * @param {{*}} datum - The datum having this notetag
  2839.          */
  2840.         DE2: function(skillId, datum) {
  2841.             // Reserves the common event with id x(its setup might be delayed)
  2842.             $gameTemp.reserveCommonEvent(x);
  2843.             //
  2844.         }, // DE2
  2845.  
  2846.         /**
  2847.          * The this pointer refers to the actor involved
  2848.          * @since v1.00a @version v1.00a
  2849.          * @param {Id} skillId - The id of the skill involved
  2850.          * @param {{*}} datum - The datum having this notetag
  2851.          */
  2852.         DE3: function(skillId, datum) {
  2853.             // Adds 400 experience to the actor involved
  2854.             this.changeExp(400, true);
  2855.             //
  2856.         } // DE3
  2857.  
  2858.         // Adds new DEX here
  2859.  
  2860.  
  2861.     } // notes
  2862.  
  2863. }; // DoubleX_RMMV.Skill_Progress
  2864.  
  2865. /*============================================================================
  2866.  *    ## Plugin Implementations
  2867.  *       You need not edit this part as it's about how this plugin works
  2868.  *----------------------------------------------------------------------------
  2869.  *    # Plugin Support Info:
  2870.  *      1. Prerequisites
  2871.  *         - Decent RMMV plugin development proficiency to fully comprehend
  2872.  *           this plugin
  2873.  *      2. All reference tags are to have clear references between the
  2874.  *         Plugin Info and Plugin Implementations by searching them
  2875.  *      3. All intentionally hidden script calls can be found by searching
  2876.  *         ADVANCED_SCRIPT_CALLS_ONLY
  2877.  *----------------------------------------------------------------------------*/
  2878.  
  2879. /*----------------------------------------------------------------------------
  2880.  *    # New classes:
  2881.  *      - Implements the note result/running helper and UIs for skill progress
  2882.  *----------------------------------------------------------------------------*/
  2883.  
  2884. function Game_SkillProgressNotes() { this.initialize.apply(this, arguments); };
  2885.  
  2886. // These classes should be private and used by Game_SkillProgressNotes only
  2887. function Game_SkillProgressCache() { this.initialize.apply(this, arguments); };
  2888.  
  2889. function Game_SkillProgressPairs() { this.initialize.apply(this, arguments); };
  2890.  
  2891. function Game_SkillProgressRules() { this.initialize.apply(this, arguments); };
  2892. //
  2893.  
  2894. function Window_SkillProgressCmd() { this.initialize.apply(this, arguments); };
  2895.  
  2896. function Window_SkillProgressStat() { this.initialize.apply(this, arguments) };
  2897.  
  2898. function Window_SkillProgressCond() { this.initialize.apply(this, arguments) };
  2899.  
  2900. function Window_SkillProgressNext() { this.initialize.apply(this, arguments) };
  2901.  
  2902. /*----------------------------------------------------------------------------
  2903.  *    # Edit class: DataManager
  2904.  *      - Reads all notetags for progressing skills
  2905.  *----------------------------------------------------------------------------*/
  2906.  
  2907. (function(SP) {
  2908.  
  2909.     "use strict";
  2910.  
  2911.     SP.DataManager = { orig: {}, new: {} };
  2912.     var _DM = SP.DataManager.orig, _SP = SP.DataManager.new;
  2913.     // Refer to reference tag NOTE_STRUCTURE
  2914.     _SP._REG_EXP_ID = " *(?:doublex +rmmv +)?skill +progress +(\\w+)";
  2915.     _SP._REG_EXPS = {
  2916.         // It's too nasty to validate the notetags here so it's not done here
  2917.         base: new RegExp("<" + _SP._REG_EXP_ID +
  2918.                 " +(\\w+(?: +\\w+)*) *: +(\\w+(?: *, +\\w+)*) *>", "gmi"),
  2919.         evalStart: new RegExp("<" + _SP._REG_EXP_ID + " *>", "gmi"),
  2920.         evalEnd: new RegExp("< *\/" + _SP._REG_EXP_ID + " *>", "gmi")
  2921.         //
  2922.     };
  2923.     //
  2924.     _SP._areAllNotesLoaded = false;
  2925.  
  2926.     _DM.isDatabaseLoaded = DataManager.isDatabaseLoaded;
  2927.     _SP.isDatabaseLoaded = DataManager.isDatabaseLoaded = function() {
  2928.     // v1.00a - v1.00a; Extended
  2929.         // Edited to read all notetags of this plugin as well
  2930.         return _DM.isDatabaseLoaded.apply(this, arguments) &&
  2931.                 _SP._isDatabaseLoaded.call(this);
  2932.         //
  2933.     }; // DataManager.isDatabaseLoaded
  2934.  
  2935.     _DM.saveGame = DataManager.saveGame;
  2936.     _SP.saveGame = DataManager.saveGame = function(contents) {
  2937.     // v1.00a - v1.00a; Extended
  2938.         // Added to clear all actor effective notetags to simplify saving
  2939.         $gameParty.clearSkillProgressNotes();
  2940.         //
  2941.         var success = _DM.saveGame.apply(this, arguments);
  2942.         // Added to restores all actor effective notetags
  2943.         $gameParty.initSkillProgressNotes();
  2944.         //
  2945.         return success;
  2946.     }; // DataManager.saveGame
  2947.  
  2948.     _DM.extractSaveContents = DataManager.extractSaveContents;
  2949.     _SP.extractSaveContents = DataManager.extractSaveContents = function(contents) {
  2950.     // v1.00a - v1.00a; Extended
  2951.         _DM.extractSaveContents.apply(this, arguments);
  2952.         // Added to use the stored function contents
  2953.         _SP._extractSaveContents.call(this);
  2954.         //
  2955.     }; // DataManager.extractSaveContents
  2956.  
  2957.     /**
  2958.      * The this pointer is DataManager
  2959.      * DataManager.isDatabaseLoaded was Nullipotent but is now Idempotent
  2960.      * Idempotent
  2961.      * @since v1.00a @version v1.00a
  2962.      * @returns {Boolean} The database loaded flag
  2963.      * @todo: Make this function Nullipotent to preserve the contract integrity
  2964.      */
  2965.     _SP._isDatabaseLoaded = function() {
  2966.         // Ensures the notetags will only be read exactly once upon game start
  2967.         if (_SP._areAllNotesLoaded) return true;
  2968.         _SP._loadAllNotes.call(this);
  2969.         _SP._areAllNotesLoaded = true;
  2970.         return _SP._areAllNotesLoaded;
  2971.         //
  2972.     }; // _SP._isDatabaseLoaded
  2973.  
  2974.     /**
  2975.      * The this pointer is DataManager
  2976.      * Idempotent
  2977.      * @since v1.00a @version v1.00a
  2978.      */
  2979.     _SP._loadAllNotes = function() {
  2980.         _SP._data.call(this).forEach(_SP._loadNote, this);
  2981.     }; // _SP._loadAllNotes
  2982.  
  2983.     /**
  2984.      * The this pointer is DataManager
  2985.      * Nullipotent
  2986.      * @since v1.00a @version v1.00a
  2987.      * @returns {[{*}]} The list of data to have notetags loaded
  2988.      */
  2989.     _SP._data = function() {
  2990.         // The function's easy, simple and small enough to be inlined
  2991.         return [
  2992.             $dataActors,
  2993.             $dataClasses,
  2994.             $dataWeapons,
  2995.             $dataArmors,
  2996.             $dataStates,
  2997.             $dataSkills
  2998.         ].reduce(function(allData, data) {
  2999.             return allData.concat(data.filter(function(d) { return d; }));
  3000.         }, []);
  3001.         //
  3002.     }; // _SP._data
  3003.  
  3004.     /**
  3005.      * The this pointer is DataManager
  3006.      * Idempotent
  3007.      * @since v1.00a @version v1.00a
  3008.      * @param {{*}} datum - The datum to have notetags loaded
  3009.      */
  3010.     _SP._loadNote = function(datum) {
  3011.         // Script call/plugin command
  3012.         var lines = datum.note.split(/[\r\n]+/);
  3013.         _SP._loadEvalNote.call(this, datum.meta.skillProgress = {}, lines);
  3014.         lines.forEach(_SP._loadBaseNote.bind(this, datum.meta.skillProgress));
  3015.         //
  3016.     }; // _SP._loadNote
  3017.  
  3018.     /**
  3019.      * The this pointer is DataManager
  3020.      * Idempotent
  3021.      * @since v1.00a @version v1.00a
  3022.      * @param {{{String}}} skillProgress - The loaded note values
  3023.      * @param {[String]} lines - The list of lines being scanned for notetags
  3024.      *                           to be loaded
  3025.      */
  3026.     _SP._loadEvalNote = function(skillProgress, lines) {
  3027.         // It's tolerable and more performant than any declarative counterpart
  3028.         var isEval = false, type = "", funcLines = [];
  3029.         lines.forEach(function(line) {
  3030.             if (line.match(_SP._REG_EXPS.evalStart)) {
  3031.                 isEval = true;
  3032.                 type = RegExp.$1;
  3033.             } else if (line.match(_SP._REG_EXPS.evalEnd)) {
  3034.                 isEval = false;
  3035.                 // Refer to reference tag NOTETAG_MULTI
  3036.                 if (type !== RegExp.$1 || skillProgress[type]) return;
  3037.                 skillProgress[type] = (skillProgress[type] || []).concat(_SP.
  3038.                         _notePairs.call(this, ["eval"], [funcLines.join("\n")]));
  3039.                 //
  3040.             } else if (isEval) {
  3041.                 funcLines.push(line);
  3042.             }
  3043.         }, this);
  3044.         //
  3045.     }; //  _SP._loadEvalNote
  3046.  
  3047.     /**
  3048.      * The this pointer is DataManager
  3049.      * Idempotent
  3050.      * @since v1.00a @version v1.00a
  3051.      * @param {{{String}}} skillProgress - The loaded note values
  3052.      * @param {String} line - The line being scanned for notetags to be loaded
  3053.      */
  3054.     _SP._loadBaseNote = function(skillProgress, line) {
  3055.         // Refer to reference tag NOTETAG_MULTI and LINE_MONO
  3056.         if (!line.match(_SP._REG_EXPS.base)) return;
  3057.         var type = RegExp.$1, suffixes = RegExp.$2, entries = RegExp.$3;
  3058.         skillProgress[type] = (skillProgress[type] || []).concat(_SP._notePairs.
  3059.                 call(this, suffixes.split(/ +/), entries.split(/ *, +/)));
  3060.         //
  3061.     }; // _SP._loadBaseNote
  3062.  
  3063.     /**
  3064.      * The this pointer is DataManager
  3065.      * Idempotent
  3066.      * @since v1.00a @version v1.00a
  3067.      * @param {[String]} suffixes - The list of suffixes in the notetag
  3068.      * @param {[String]} entries - The list of entries in the notetag
  3069.      * @returns {{String}} The suffix-entry pair mapping
  3070.      */
  3071.     _SP._notePairs = function(suffixes, entries) {
  3072.         // So those excessive suffixes/entries will be discarded right here
  3073.         var l = Math.min(suffixes.length, entries.length);
  3074.         //
  3075.         // It's tolerable and more performant than any declarative counterpart
  3076.         for (var i = 0, pairs = {}; i < l; i++) {
  3077.             // Refer to reference tag MULTI_SUFFIX_ENTRY
  3078.             var count = i + 1;
  3079.             pairs["suffix" + count] = suffixes[i];
  3080.             pairs["entry" + count] = entries[i];
  3081.             //
  3082.         }
  3083.         return pairs;
  3084.         //
  3085.     }; // _SP._notePairs
  3086.  
  3087.     /**
  3088.      * The this pointer is DataManager
  3089.      * Idempotent
  3090.      * @since v1.00a @version v1.00a
  3091.      */
  3092.     _SP._extractSaveContents = function() {
  3093.         _SP._extractFuncContents.call(this, "params");
  3094.         _SP._extractFuncContents.call(this, "cfgs");
  3095.         _SP._extractFuncContents.call(this, "notes");
  3096.         $gameParty.initSkillProgressNotes();
  3097.     }; // _SP._extractSaveContents
  3098.  
  3099.     /**
  3100.      * The this pointer is DataManager
  3101.      * Idempotent
  3102.      * @since v1.00a @version v1.00a
  3103.      * @param {String} funcType - The params/notes label
  3104.      */
  3105.     _SP._extractFuncContents = function(funcType) {
  3106.         Object.keys($gameSystem.skillProgress[funcType]).forEach(
  3107.                 _SP._extractFuncContent.bind(this, funcType));
  3108.     }; // _SP._extractFuncContents
  3109.  
  3110.     /**
  3111.      * The this pointer is DataManager
  3112.      * Idempotent
  3113.      * @since v1.00a @version v1.00a
  3114.      * @param {String} funcType - The params/notes label
  3115.      * @param {String} funcName - The name of the stored function content
  3116.      */
  3117.     _SP._extractFuncContent = function(funcType, funcName) {
  3118.         SP[funcType][funcName] = $gameSystem.skillProgressFunc(funcType,
  3119.                 funcName, $gameSystem.skillProgress[funcType][funcName]);
  3120.     }; // _SP._extractFuncContent
  3121.  
  3122. })(DoubleX_RMMV.Skill_Progress);
  3123.  
  3124. /*----------------------------------------------------------------------------
  3125.  *    # Edit class: Game_System
  3126.  *      - Stores all params/configurations for progressing skills
  3127.  *----------------------------------------------------------------------------*/
  3128.  
  3129. (function(SP) {
  3130.  
  3131.     "use strict";
  3132.  
  3133.     SP.Game_System = { orig: {}, new: {} };
  3134.     var _GS = SP.Game_System.orig, _SP = SP.Game_System.new;
  3135.     var $ = Game_System.prototype;
  3136.     _SP._FUNCS = {
  3137.         params: function(funcName, content) {
  3138.             // This arg list covers rest cases so unused args' the only problem
  3139.             return new Function("skillId", "target", "value", content);
  3140.             //
  3141.         },
  3142.         cfgs: function(funcName, content) {
  3143.             return new Function("current", "max", "isKeep", content);
  3144.         },
  3145.         notes: function(funcName, content) {
  3146.             // This arg list covers all cases so unused args' the only problem
  3147.             return new Function("skillId", "datum", "target", "value", content);
  3148.             //
  3149.         }
  3150.     };
  3151.  
  3152.     _GS.initialize = $.initialize;
  3153.     _SP.initialize = $.initialize = function() { // v1.00a - v1.00a; Extended
  3154.         _GS.initialize.apply(this, arguments);
  3155.         _SP._init.call(this); // Added to setup parameters/notetags
  3156.     }; // $.initialize
  3157.  
  3158.     /*------------------------------------------------------------------------
  3159.      *    New public instance variables
  3160.      *------------------------------------------------------------------------*/
  3161.     // {{{*}}} skillProgress: The container of all other new variables
  3162.     //         {{*}} params: The container of all parameter/configuration values
  3163.     //         {{*}} notes: The container of all notetag function contents
  3164.  
  3165.     /**
  3166.      * Pure function
  3167.      * @interface @since v1.00a @version v1.00a
  3168.      * @param {String} funcType - The params/notes label
  3169.      * @param {String} funcName - The name of the stored function content
  3170.      * @param {String} funcContent - The stored function content
  3171.      * @returns {()} The requested function with the stored content
  3172.      */
  3173.     $.skillProgressFunc = function(funcType, funcName, content) {
  3174.         return _SP._FUNCS[funcType](funcName, content);
  3175.     }; // $.skillProgressFunc
  3176.  
  3177.     /**
  3178.      * The this pointer is Game_System.prototype
  3179.      * Idempotent
  3180.      * @since v1.00a @version v1.00a
  3181.      */
  3182.     _SP._init = function() {
  3183.         _SP._initContainers.call(this);
  3184.         _SP._storeParams.call(this);
  3185.         _SP._storeCfgNotes.call(this);
  3186.     }; // _SP._init
  3187.  
  3188.     /**
  3189.      * The this pointer is Game_System.prototype
  3190.      * Idempotent
  3191.      * @since v1.00a @version v1.00a
  3192.      */
  3193.     _SP._initContainers = function() {
  3194.         this.skillProgress = { params: {}, cfgs: {}, notes: {} };
  3195.     }; // _SP._initContainers
  3196.  
  3197.     /**
  3198.      * The this pointer is Game_System.prototype
  3199.      * Idempotent
  3200.      * @since v1.00a @version v1.00a
  3201.      */
  3202.     _SP._storeParams = function() {
  3203.         var params = _SP._rawParams.call(this);
  3204.         Object.keys(params).forEach(_SP._storeParam.bind(this, params));
  3205.     }; // _SP._storeParams
  3206.  
  3207.     /**
  3208.      * The this pointer is Game_System.prototype
  3209.      * Pure function
  3210.      * @since v1.00a @version v1.00a
  3211.      * @returns {{String}} The requested name-value mapping
  3212.      */
  3213.     _SP._rawParams = function() {
  3214.         return PluginManager.parameters(DoubleX_RMMV.Skill_Progress_File);
  3215.     }; // _SP._rawParams
  3216.  
  3217.     /**
  3218.      * The this pointer is Game_System.prototype
  3219.      * Idempotent
  3220.      * @since v1.00a @version v1.00a
  3221.      * @param {{String}} params - The parameter name-value map
  3222.      * @param {String} param - The parameter name
  3223.      */
  3224.     _SP._storeParam = function(params, param) {
  3225.         this.skillProgress.params[param] = _SP._param.call(this, params, param);
  3226.         SP.params[param] = this.skillProgressFunc("params", param,
  3227.                 this.skillProgress.params[param]);
  3228.     }; // _SP._storeParam
  3229.  
  3230.     /**
  3231.      * The this pointer is Game_System.prototype
  3232.      * Nullipotent
  3233.      * @since v1.00a @version v1.00a
  3234.      * @param {{String}} params - The parameter name-value map
  3235.      * @param {String} param - The parameter name
  3236.      * @retruns {String} The requested function contents as parameter values
  3237.      */
  3238.     _SP._param = function(params, param) {
  3239.         // Refer to reference tag PARAMETERS_CONFIGURATIONS
  3240.         return params[param] || _SP._funcContent.call(this, SP.params[param]);
  3241.         //
  3242.     }; // _SP._param
  3243.  
  3244.     /**
  3245.      * The this pointer is Game_System.prototype
  3246.      * Idempotent
  3247.      * @since v1.00a @version v1.00a
  3248.      */
  3249.     _SP._storeCfgNotes = function() {
  3250.         Object.keys(SP.cfgs).forEach(_SP._storeCfgNote.bind(this, "cfgs"));
  3251.         Object.keys(SP.notes).forEach(_SP._storeCfgNote.bind(this, "notes"));
  3252.     }; // _SP._storeCfgNotes
  3253.  
  3254.     /**
  3255.      * The this pointer is Game_System.prototype
  3256.      * Idempotent
  3257.      * @param {String} type - The configuration type label
  3258.      * @param {String} name - The name of the configuration/note
  3259.      * @since v1.00a @version v1.00a
  3260.      */
  3261.     _SP._storeCfgNote = function(type, name) {
  3262.         this.skillProgress[type][name] =
  3263.                 _SP._funcContent.call(this, SP[type][name]);
  3264.     }; // _SP._storeCfgNote
  3265.  
  3266.     /**
  3267.      * The this pointer is Game_System.prototype
  3268.      * Pure function
  3269.      * @since v1.00a @version v1.00a
  3270.      * @param {()} func - The function as the value of the configuration
  3271.      * @returns {String} The requested parameters in the configuration region
  3272.      */
  3273.     _SP._funcContent = function(func) {
  3274.         // Only the function contents are stored in save files
  3275.         return func.toString().
  3276.                 replace(/^[^{]*{\s*/, "").replace(/\s*}[^}]*$/, "");
  3277.         //
  3278.     }; // _SP._funcContent
  3279.  
  3280. })(DoubleX_RMMV.Skill_Progress);
  3281.  
  3282. /*----------------------------------------------------------------------------
  3283.  *    # Edit class: Game_Switches/Game_Variables
  3284.  *      - Raises the note change factors linked to the game switches/variables
  3285.  *----------------------------------------------------------------------------*/
  3286.  
  3287. (function(SP) {
  3288.  
  3289.     "use strict";
  3290.  
  3291.     var classes = {
  3292.         Game_Switches: { proto: Game_Switches.prototype, param: "switchIds" },
  3293.         Game_Variables: { proto: Game_Variables.prototype, param: "varIds" }
  3294.     };
  3295.     Object.keys(classes).forEach(function(klass) {
  3296.  
  3297.         SP[klass] = { orig: {}, new: {} };
  3298.         var _GSV = SP[klass].orig, _SP = SP[klass].new;
  3299.         var $ = classes[klass].proto, param = classes[klass].param;
  3300.  
  3301.         _GSV.setValue = $.setValue;
  3302.         _SP.setValue = $.setValue = function(id, val) {
  3303.         // v1.00a - v1.00a; Extended
  3304.             _GSV.setValue.apply(this, arguments);
  3305.             // Added to raise the change factors involving this id
  3306.             _SP._raiseChangeFactors.call(this, id);
  3307.             //
  3308.         }; // $.setValue
  3309.  
  3310.         /**
  3311.          * The this pointer is klass.prototype
  3312.          * Idempotent
  3313.          * @since v1.00a @version v1.00a
  3314.          * @param {Id} id - The id to have its involved change factors raised
  3315.          */
  3316.         _SP._raiseChangeFactors = function(id) {
  3317.             var ids = SP.params[param]();
  3318.             // Emphasizes the differences between the Array and Object forms
  3319.             if (Array.isArray(ids)) {
  3320.                 return _SP._raiseAllChangeFactors.call(this, id, ids);
  3321.             }
  3322.             _SP._raiseNoteChangeFactors.call(this, ids[id]);
  3323.             //
  3324.         }; // _SP._raiseChangeFactors
  3325.  
  3326.         /**
  3327.          * The this pointer is klass.prototype
  3328.          * Idempotent
  3329.          * @since v1.00a @version v1.00a
  3330.          * @param {Id} id - The id to have its involved change factors raised
  3331.          * @param {[Id]} ids - The list of ids used by this plugin
  3332.          */
  3333.         _SP._raiseAllChangeFactors = function(id, ids) {
  3334.             if (ids.indexOf(id) >= 0) $gameParty.members().forEach(function(m) {
  3335.                 m.raiseAllSkillProgressNoteChangeFactors();
  3336.             });
  3337.         }; // _SP._raiseAllChangeFactors
  3338.  
  3339.         /**
  3340.          * The this pointer is klass.prototype
  3341.          * Idempotent
  3342.          * @since v1.00a @version v1.00a
  3343.          * @param {{[String], [String]}} noteFactors - The notes and factors to
  3344.          *                                             be raised by this id
  3345.          */
  3346.         _SP._raiseNoteChangeFactors = function(noteFactors) {
  3347.             if (noteFactors) $gameParty.members().forEach(function(mem) {
  3348.                 noteFactors.notes.forEach(function(note) {
  3349.                     noteFactors.factors.forEach(mem.
  3350.                             raiseSkillProgressNoteChangeFactor.bind(mem, note));
  3351.                 });
  3352.             });
  3353.         }; // _SP._raiseNoteChangeFactors
  3354.  
  3355.     });
  3356.  
  3357. })(DoubleX_RMMV.Skill_Progress);
  3358.  
  3359. /*----------------------------------------------------------------------------
  3360.  *    # Edit class: Game_Action
  3361.  *      - Lets actors to progress skills when the skill hits targets
  3362.  *----------------------------------------------------------------------------*/
  3363.  
  3364. (function(SP) {
  3365.  
  3366.     "use strict";
  3367.  
  3368.     SP.Game_Action = { orig: {}, new: {} };
  3369.     var _GA = SP.Game_Action.orig, _SP = SP.Game_Action.new;
  3370.     var $ = Game_Action.prototype;
  3371.  
  3372.     _GA.executeDamage = $.executeDamage;
  3373.     _SP.executeDamage = $.executeDamage = function(target, value) {
  3374.     // v1.00a - v1.00a; Extended
  3375.         _GA.executeDamage.apply(this, arguments);
  3376.         // Added to progress the skill used when it hit targets for actors
  3377.         _SP._executeDamage.call(this, target, value);
  3378.         //
  3379.     }; // $.executeDamage
  3380.  
  3381.     /**
  3382.      * The this pointer is Game_Action.prototype
  3383.      * Idempotent
  3384.      * @since v1.00a @version v1.00a
  3385.      * @param {Game_Battler} target - The target hit by the skill involved
  3386.      * @param {Number} value - The damage of the hit involved
  3387.      */
  3388.     _SP._executeDamage = function(target, value) {
  3389.         var subject = this.subject();
  3390.         if (!subject.isActor()) return;
  3391.         subject.onHitGainSkillProgress(this.item().id, target, value);
  3392.     }; // _SP._executeDamage
  3393.  
  3394. })(DoubleX_RMMV.Skill_Progress);
  3395.  
  3396. /*----------------------------------------------------------------------------
  3397.  *    # Edit class: Game_Actor
  3398.  *      - Implements all actor script calls and skill progressions
  3399.  *----------------------------------------------------------------------------*/
  3400.  
  3401. (function(SP) {
  3402.  
  3403.     "use strict";
  3404.  
  3405.     SP.Game_Actor = { orig: {}, new: {} };
  3406.     var _GA = SP.Game_Actor.orig, _SP = SP.Game_Actor.new;
  3407.     var $ = Game_Actor.prototype;
  3408.     var $$ = Game_Battler.prototype, $$$ = Game_BattlerBase.prototype;
  3409.     // All these functions are actor script calls
  3410.     _SP._FORWARDED_FUNCS = {
  3411.         raiseAllSkillProgressNoteChangeFactors: "raiseAllChangeFactors",
  3412.         raiseSkillProgressNoteChangeFactor: "raiseChangeFactor",
  3413.         skillProgressNoteResult: "cachedPartResult",
  3414.         invalidateSkillProgressNoteResult: "invalidateResultCache"
  3415.     };
  3416.     _SP._RESULT_FUNCS = {
  3417.         /** @returns {[String?]} The mapping of condition description statuses */
  3418.         skillProgressCondDesc: "cond",
  3419.         //
  3420.         /** @returns {Number} The maximum experience of the skill involved */
  3421.         maxSkillProgress: "max",
  3422.         //
  3423.         /** @returns {Number} The exp gain of the skill involved upon use */
  3424.         useGainSkillProgress: "useGain",
  3425.         //
  3426.         /** @returns {Number} The exp gain of the skill involved upon hit */
  3427.         hitGainSkillProgress: "hitGain",
  3428.         //
  3429.         /** @returns {[Id]} - List of id of skills to be learnt upon progress */
  3430.         nextSkillProgress: "next",
  3431.         //
  3432.         /** @returns {Boolean} The check result */
  3433.         isKeepSkillProgress: "keepCurrent"
  3434.         //
  3435.     };
  3436.     //
  3437.  
  3438.     /*------------------------------------------------------------------------
  3439.      *    New private instance variables
  3440.      *------------------------------------------------------------------------*/
  3441.     // {{*}} _skillProgress: The container of all other new variables
  3442.     //       {Game_SkillProgressNotes} notes: The notetag results
  3443.     //       {{Boolean}} isEnded: Marks whether the skill has ended progress
  3444.     //       {{Number}} exps: The skill progress experience container
  3445.  
  3446.     // It's to avoid overwriting paySkillCost in Game_Actor/Battler from plugins
  3447.     _GA.paySkillCost = $.paySkillCost || $$.paySkillCost || $$$.paySkillCost;
  3448.     //
  3449.     _SP.paySkillCost = $.paySkillCost = function(skill) {
  3450.     // v1.00a - v1.00a; Extended
  3451.         // Added to trigger the skill progress upon using the skill
  3452.         _SP._onUseSkill.call(this, skill.id);
  3453.         //
  3454.         _GA.paySkillCost.apply(this, arguments);
  3455.     }; // $.paySkillCost
  3456.  
  3457.     ["addState", "removeState"].forEach(function(func) {
  3458.         // It's to avoid overwriting func in Game_Actor from other plugins
  3459.         _GA[func] = $[func] || $$[func];
  3460.         //
  3461.         _SP[func] = $[func] = function(stateId) { // v1.00a - v1.00a; Extended
  3462.             // Added to mark that state notetags might have changed
  3463.             this._skillProgress.notes.markChangeFactors(["states"]);
  3464.             //
  3465.             _GA[func].apply(this, arguments);
  3466.         }; // $[func]
  3467.     });
  3468.  
  3469.     _GA.initialize = $.initialize;
  3470.     _SP.initialize = $.initialize = function(actorId) {
  3471.     // v1.00a - v1.00a; Extended
  3472.         _SP._init.call(this); // Added to initialize all skill progress vars
  3473.         _GA.initialize.apply(this, arguments);
  3474.     }; // $.initialize
  3475.  
  3476.     _GA.refresh = $.refresh;
  3477.     _SP.refresh = $.refresh = function() { // v1.00a - v1.00a; Extended
  3478.         _GA.refresh.apply(this, arguments);
  3479.         // Added to refreshes all skill progress notetags lists/results
  3480.         _SP._refresh.call(this);
  3481.         //
  3482.     }; // $.refresh
  3483.  
  3484.     ["initEquips", "changeEquip", "forceChangeEquip"].forEach(function(func) {
  3485.         _GA[func] = $[func];
  3486.         // It's ok to skip the arguments in the signature as there's arguments
  3487.         _SP[func] = $[func] = function() { // v1.00a - v1.00a; Extended
  3488.             // Added to mark that weapon/armor notetags might have changed
  3489.             this._skillProgress.notes.markChangeFactors(["weapons", "armors"]);
  3490.             //
  3491.             _GA[func].apply(this, arguments);
  3492.         }; // $[func]
  3493.         //
  3494.     });
  3495.  
  3496.     _GA.changeClass = $.changeClass;
  3497.     _SP.changeClass = $.changeClass = function(classId, keepExp) {
  3498.     // v1.00a - v1.00a; Extended
  3499.         // Added to mark that class notetags might have changed
  3500.         this._skillProgress.notes.markChangeFactors(["currentClass"]);
  3501.         //
  3502.         _GA.changeClass.apply(this, arguments);
  3503.     }; // $.changeClass
  3504.  
  3505.     // Refer to _SP._RESULT_FUNCS and Game_SkillProgressNotes for signatures
  3506.     Object.keys(_SP._RESULT_FUNCS).forEach(function(func) {
  3507.         var note = _SP._RESULT_FUNCS[func];
  3508.         // It's ok to list unused arguments as long as they're consistent
  3509.         $[func] = function(skillId, target, value) {
  3510.             return this._skillProgress.notes.result(
  3511.                     note, skillId, target, value);
  3512.         }; // $[func]
  3513.         //
  3514.     });
  3515.  
  3516.     /**
  3517.      * Script Call/Nullipotent
  3518.      * @since v1.00a @version v1.00a
  3519.      * @param {Id} skillId - The id of the skill involved
  3520.      * @returns {Number} The current experience of the skill involved
  3521.      */
  3522.     $.currentSkillProgress = function(skillId) {
  3523.         // Clamping exp here would cause excessively unnecessary max exp queries
  3524.         return this._skillProgress.exps[skillId] || 0;
  3525.         //
  3526.     }; // $.currentSkillProgress
  3527.  
  3528.     /**
  3529.      * Script Call/Idempotent
  3530.      * @interface @since v1.00a @version v1.00a
  3531.      * @param {Id} skillId - The id of the skill involved
  3532.      * @param {Number} value - The new experience of the skill involved
  3533.      */
  3534.     $.setCurrentSkillProgress = function(skillId, value) {
  3535.         // Refer to reference tag CURRENT_EXP_RANGE and INVALID_GAIN
  3536.         if (isNaN(value) || this._skillProgress.isEnded[skillId]) return;
  3537.         //
  3538.         var max = this.maxSkillProgress(skillId);
  3539.         // Refer to reference tag CURRENT_EXP_RANGE and INVALID_GAIN
  3540.         this._skillProgress.exps[skillId] = value.clamp(0, max);
  3541.         //
  3542.         // Making isMaxSkillProgress would only cause unnecessary max exp query
  3543.         if (this.currentSkillProgress(skillId) < max) return;
  3544.         //
  3545.         _SP._onSkillProgress.call(this, skillId);
  3546.     }; // $.setCurrentSkillProgress
  3547.  
  3548.     // Refer to the Game_SkillProgressNotes counterparts
  3549.     Object.keys(_SP._FORWARDED_FUNCS).forEach(function(func) {
  3550.         var f = _SP._FORWARDED_FUNCS[func];
  3551.         // It's ok to skip the arguments in the signature as there's arguments
  3552.         $[func] = function() {
  3553.             return this._skillProgress.notes[f].apply(
  3554.                     this._skillProgress.notes, arguments);
  3555.         }; // $[func]
  3556.         //
  3557.     });
  3558.     //
  3559.  
  3560.     /**
  3561.      * Idempotent
  3562.      * @interface @since v1.00a @version v1.00a
  3563.      */
  3564.     $.initSkillProgressNotes = function() {
  3565.         this._skillProgress.notes = new Game_SkillProgressNotes(this);
  3566.     }; // $.initSkillProgressNotes
  3567.  
  3568.     /**
  3569.      * Idempotent
  3570.      * @interface @since v1.00a @version v1.00a
  3571.      */
  3572.     $.clearSkillProgressNotes = function() {
  3573.         // Avoids memory leaks
  3574.         this._skillProgress.notes.clear();
  3575.         delete this._skillProgress.notes;
  3576.         //
  3577.     }; // $.clearSkillProgressNotes
  3578.  
  3579.     ["Use", "Hit"].forEach(function(f) {
  3580.         // It's possible for the function itself to be extended/edited later
  3581.         var func = "_" + f.toLowerCase() + "GainSkillProgress";
  3582.         //
  3583.         /**
  3584.          * @interface @since v1.00a @version v1.00a
  3585.          * @param {Id} skillId - The id of the skill involved
  3586.          * @param {Game_Battler?} target - The target hit by the skill involved
  3587.          * @param {Number?} value - The damage of the hit involved
  3588.          */
  3589.         $["on" + f + "GainSkillProgress"] = function(skillId, target, value) {
  3590.             _SP._onCurrentSkillProgress.call(this, skillId,
  3591.                     _SP[func].call(this, skillId, target, value));
  3592.         }; // $["on" + f + "GainSkillProgress"]
  3593.     });
  3594.  
  3595.     /**
  3596.      * Nullipotent
  3597.      * @interface @since v1.00a @version v1.00a
  3598.      * @param {Id} skillId - The id of the skill involved
  3599.      * @returns {Boolean} The check result
  3600.      */
  3601.     $.canSkillProgress = function(skillId) {
  3602.         // An ended progressing skill should still be treated as progress
  3603.         return _SP._canSkillProgress.call(this, skillId) && _SP._isValidMax.
  3604.                 call(this, skillId) && _SP._isValidNext.call(this, skillId);
  3605.         //
  3606.     }; // $.canSkillProgress
  3607.  
  3608.     /**
  3609.      * Nullipotent
  3610.      * @interface @since v1.00a @version v1.00a
  3611.      * @param {Id} skillId - The id of the skill involved
  3612.      * @returns {Boolean} The check result
  3613.      */
  3614.     $.isSkillProgress = function(skillId) {
  3615.         if (!SP.params.isEnabled.call(this)) return false;
  3616.         // Refer to reference tag SKILL_COND_DESCS
  3617.         return Object.keys(this.skillProgressCondDesc(skillId)).length > 0;
  3618.         //
  3619.     }; // $.isSkillProgress
  3620.  
  3621.     /**
  3622.      * The this pointer is Game_Actor.prototype
  3623.      * Idempotent
  3624.      * @since v1.00a @version v1.00a
  3625.      * @param {Id} skillId - The id of the skill involved
  3626.      */
  3627.     _SP._onUseSkill = function(skillId) {
  3628.         // It'd be too demanding to ask advanced users to raise this manually
  3629.         this._skillProgress.notes.raisePartChangeFactors(["skills"], skillId);
  3630.         //
  3631.         this.onUseGainSkillProgress(skillId);
  3632.     }; // _SP._onUseSkill
  3633.  
  3634.     /**
  3635.      * The this pointer is Game_Actor.prototype
  3636.      * Idempotent
  3637.      * @since v1.00a @version v1.00a
  3638.      */
  3639.     _SP._init = function() {
  3640.         // The master container must be ready first before adding anything else
  3641.         this._skillProgress = { isEnded: {}, exps: {} };
  3642.         this.initSkillProgressNotes();
  3643.         //
  3644.     }; // _SP._init
  3645.  
  3646.     /**
  3647.      * The this pointer is Game_Actor.prototype
  3648.      * Idempotent
  3649.      * @since v1.00a @version v1.00a
  3650.      */
  3651.     _SP._refresh = function() {
  3652.         // Refer to reference tag ACTOR_REFRESH_RECACHE_NOTE
  3653.         this._skillProgress.notes.raiseMarkedChangeFactors();
  3654.         //
  3655.         // Refer to reference tag REDUCED_MAX_END_SKILL_PROGRESS
  3656.         _SP._checkUpdatedMaxSkillProgresses.call(this);
  3657.         //
  3658.     }; // _SP._refresh
  3659.  
  3660.     /**
  3661.      * The this pointer is Game_Actor.prototype
  3662.      * Idempotent
  3663.      * @since v1.00a @version v1.00a
  3664.      */
  3665.     _SP._checkUpdatedMaxSkillProgresses = function() {
  3666.         // The function's easy, simple and small enough to be inlined
  3667.         this.skills().map(function(skill) { return skill.id; }).forEach(
  3668.                 _SP._checkUpdatedMaxSkillProgress, this);
  3669.         //
  3670.     }; // _SP._checkUpdatedMaxSkillProgresses
  3671.  
  3672.     /**
  3673.      * The this pointer is Game_Actor.prototype
  3674.      * Idempotent
  3675.      * @since v1.00a @version v1.00a
  3676.      * @param {Id} skillId - The id of the skill involved
  3677.      */
  3678.     _SP._checkUpdatedMaxSkillProgress = function(skillId) {
  3679.         // It's possible for the current exp to be corrupted so it's checked too
  3680.         _SP._onCurrentSkillProgress.call(
  3681.                 this, skillId, this.currentSkillProgress(skillId));
  3682.         //
  3683.     }; // _SP._checkUpdatedMaxSkillProgress
  3684.  
  3685.     /**
  3686.      * The this pointer is Game_Actor.prototype
  3687.      * Idempotent
  3688.      * @since v1.00a @version v1.00a
  3689.      * @param {Id} skillId - The id of the skill involved
  3690.      * @param {Number} value - The new experience of the skill involved
  3691.      */
  3692.     _SP._onCurrentSkillProgress = function(skillId, value) {
  3693.         if (!this.canSkillProgress(skillId)) return;
  3694.         this.setCurrentSkillProgress(skillId, value);
  3695.     }; // _SP._onCurrentSkillProgress
  3696.  
  3697.     ["useGainSkillProgress", "hitGainSkillProgress"].forEach(function(func) {
  3698.         /**
  3699.          * The this pointer is Game_Actor.prototype
  3700.          * Nullipotent
  3701.          * @since v1.00a @version v1.00a
  3702.          * @param {Id} skillId - The id of the skill involved
  3703.          * @param {Game_Battler?} target - The target hit by the skill involved
  3704.          * @param {Number?} value - The damage of the hit involved
  3705.          * @returns {Number} The new experience of the skill involved
  3706.          */
  3707.         _SP["_" + func] = function(skillId, target, value) {
  3708.             return this.currentSkillProgress(skillId) +
  3709.                     this[func](skillId, target, value);
  3710.         }; // _SP["_" + func]
  3711.     });
  3712.  
  3713.     /**
  3714.      * The this pointer is Game_Actor.prototype
  3715.      * Idempotent
  3716.      * @since v1.00a @version v1.00a
  3717.      * @param {Id} skillId - The id of the skill involved
  3718.      */
  3719.     _SP._onSkillProgress = function(skillId) {
  3720.         this._skillProgress.notes.run(["willEnd"], skillId);
  3721.         _SP._progressSkill.call(this, skillId);
  3722.         this._skillProgress.notes.run(["didEnd"], skillId);
  3723.     }; // _SP._onSkillProgress
  3724.  
  3725.     /**
  3726.      * The this pointer is Game_Actor.prototype
  3727.      * Idempotent
  3728.      * @since v1.00a @version v1.00a
  3729.      * @param {Id} skillId - The id of the skill involved
  3730.      */
  3731.     _SP._progressSkill = function(skillId) {
  3732.         this.nextSkillProgress(skillId).forEach(this.learnSkill, this);
  3733.         if (!this.isKeepSkillProgress(skillId)) this.forgetSkill(skillId);
  3734.         // Otherwise increasing max might accidentally progress skill repeatedly
  3735.         this._skillProgress.isEnded[skillId] = true;
  3736.         //
  3737.     }; // _SP._progressSkill
  3738.  
  3739.     /**
  3740.      * The this pointer is Game_Actor.prototype
  3741.      * Nullipotent
  3742.      * @since v1.00a @version v1.00a
  3743.      * @param {Id} skillId - The id of the skill involved
  3744.      * @returns {Boolean} The check result
  3745.      */
  3746.     _SP._canSkillProgress = function(skillId) {
  3747.         // Not using isSkillProgress is to handle nondeterministic descs
  3748.         var descs = this.skillProgressCondDesc(skillId);
  3749.         //
  3750.         var keys = Object.keys(descs);
  3751.         // Refer to reference tag SKILL_COND_DESCS
  3752.         return keys.length > 0 && keys.every(function(desc) {
  3753.             return descs[desc];
  3754.         });
  3755.         //
  3756.     }; // _SP._canSkillProgress
  3757.  
  3758.     /**
  3759.      * The this pointer is Game_Actor.prototype
  3760.      * Nullipotent
  3761.      * @since v1.00a @version v1.00a
  3762.      * @param {Id} skillId - The id of the skill involved
  3763.      * @returns {Boolean} The check result
  3764.      */
  3765.     _SP._isValidMax = function(skillId) {
  3766.         // Refer to reference tag INVALID_MAX
  3767.         var max = this.maxSkillProgress(skillId);
  3768.         return !isNaN(max) && max > 0;
  3769.         //
  3770.     }; // _SP._isValidMax
  3771.  
  3772.     /**
  3773.      * The this pointer is Game_Actor.prototype
  3774.      * Nullipotent
  3775.      * @since v1.00a @version v1.00a
  3776.      * @param {Id} skillId - The id of the skill involved
  3777.      * @returns {Boolean} The check result
  3778.      */
  3779.     _SP._isValidNext = function(skillId) {
  3780.         // Refer to reference tag INVALID_NEXT
  3781.         var next = this.nextSkillProgress(skillId);
  3782.         if (!Array.isArray(next) || next.length <= 0) return false;
  3783.         return next.every(function(skillId) { return $dataSkills[skillId]; });
  3784.         //
  3785.     }; // _SP._isValidNext
  3786.  
  3787. })(DoubleX_RMMV.Skill_Progress);
  3788.  
  3789. /*----------------------------------------------------------------------------
  3790.  *    # Edit class: Game_Party
  3791.  *      - Clears actor notetag before save and inits them afterwards/upon load
  3792.  *----------------------------------------------------------------------------*/
  3793.  
  3794. (function() {
  3795.  
  3796.     "use strict";
  3797.  
  3798.     var $ = Game_Party.prototype;
  3799.  
  3800.     ["initSkillProgressNotes", "clearSkillProgressNotes"].forEach(function(f) {
  3801.         /**
  3802.          * Idempotent
  3803.          * @interface @since v1.00a @version v1.00a
  3804.          */
  3805.         $[f] = function() { this.members().forEach(function(m) { m[f](); }); };
  3806.     });
  3807.  
  3808. })();
  3809.  
  3810. /*----------------------------------------------------------------------------
  3811.  *    # New class: Game_SkillProgressNotes
  3812.  *      - Calculates the results from/Runs the effective notetag list
  3813.  *----------------------------------------------------------------------------*/
  3814.  
  3815. (function(SP) {
  3816.  
  3817.     "use strict";
  3818.  
  3819.     var $ = Game_SkillProgressNotes.prototype;
  3820.     var _SP = SP.Game_SkillProgressNotes = {};
  3821.     // Refer to reference tag DEFAULT_CHAINING_RULE_FIRST
  3822.     _SP._DEFAULT_CHAINING_RULE = "first";
  3823.     //
  3824.     _SP._IS_VALID_RESULT = function(result) {
  3825.         return result !== null && result !== undefined;
  3826.     }; // _SP._IS_VALID_RESULT
  3827.  
  3828.     /*------------------------------------------------------------------------
  3829.      *    New private instance variables
  3830.      *------------------------------------------------------------------------*/
  3831.     // {Game_Actor} _actor: The actor owning the effective notetag list
  3832.     // {Game_SkillProgressCache} _cache: The helper caching notetag list/result
  3833.     // {Game_SkillProgressPairs} _pairs: The helper checking/returning note pair
  3834.     // {Game_SkillProgressRules} _rules: The helper using the rule to chain note
  3835.  
  3836.     /**
  3837.      * Idempotent
  3838.      * @constructor @since v1.00a @version v1.00a
  3839.      * @param {Game_Actor} actor - The actor owning the effective notetag list
  3840.      */
  3841.     $.initialize = function(actor) {
  3842.         this._init(actor);
  3843.         this.raiseAllChangeFactors();
  3844.     }; // $.initialize
  3845.  
  3846.     /**
  3847.      * Idempotent
  3848.      * @interface @since v1.00a @version v1.00a
  3849.      */
  3850.     $.clear = function() {
  3851.         // Avoids memory leaks
  3852.         delete this._actor;
  3853.         this._pairs.clear(); // It's idempotent so it doesn't hurt to play safe
  3854.         this._rules.clear();
  3855.         //
  3856.     }; // $.clear
  3857.  
  3858.     [
  3859.         "markChangeFactors",
  3860.         "raiseMarkedChangeFactors",
  3861.         "raiseAllChangeFactors",
  3862.         "raisePartChangeFactors",
  3863.         "raiseChangeFactor",
  3864.         "cachedPartResult",
  3865.         "invalidateResultCache"
  3866.     ].forEach(function(f) {
  3867.         // Refer to the Game_SkillProgressCache counterparts
  3868.         $[f] = function() {
  3869.             return this._cache[f].apply(this._cache, arguments);
  3870.         }; // $[f]
  3871.         //
  3872.     });
  3873.  
  3874.     /**
  3875.      * Idempotent
  3876.      * @interface @since v1.00a @version v1.00a
  3877.      * @param {String} note - The note to have its end result retrieved
  3878.      * @param {Id} skillId - The id of the skill involved
  3879.      * @param {Game_Battler?} target - The target hit by the skill involved
  3880.      * @param {Number?} value - The damage of the hit involved
  3881.      * @returns {*} The requested result from all effective notetags involved
  3882.      */
  3883.     $.result = function(note, skillId, target, value) {
  3884.         // It's infeasible to cache target so value's not used here to miss it
  3885.         var cache = this._cache.result(note, skillId);
  3886.         //
  3887.         // It's possible for a cached result to be intentionally false
  3888.         if (_SP._IS_VALID_RESULT(cache)) return cache;
  3889.         //
  3890.         // It's better to return an invalid result than to spoil the cache
  3891.         if (!skillId) return this._pairs.default(note, skillId, target, value);
  3892.         return this._updatedResult(note, skillId, target, value);
  3893.         //
  3894.     }; // $.result
  3895.  
  3896.     /**
  3897.      * @interface @since v1.00a @version v1.00a
  3898.      * @param {[String]} notes - The list of notes to have their contents run
  3899.      * @param {Id} skillId - The id of the skill involved
  3900.      */
  3901.     $.run = function(notes, skillId) {
  3902.         notes.forEach(this._run.bind(this, skillId));
  3903.     }; // $.run
  3904.  
  3905.     /**
  3906.      * Idempotent
  3907.      * @since v1.00a @version v1.00a
  3908.      * @param {Game_Actor} actor - The actor owning the effective notetag list
  3909.      */
  3910.     $._init = function(actor) {
  3911.         this._actor = actor;
  3912.         // Not making these as explicit dependecies' to simplify its uses
  3913.         this._cache = new Game_SkillProgressCache();
  3914.         this._pairs = new Game_SkillProgressPairs(actor);
  3915.         this._rules = new Game_SkillProgressRules(this._pairs);
  3916.         //
  3917.     }; // $._init
  3918.  
  3919.     /**
  3920.      * Idempotent
  3921.      * @since v1.00a @version v1.00a
  3922.      * @param {String} note - The note to have its end result retrieved
  3923.      * @param {Id} skillId - The id of the skill involved
  3924.      * @param {Game_Battler?} target - The target hit by the skill involved
  3925.      * @param {Number?} value - The damage of the hit involved
  3926.      * @returns {*} The requested result from all effective notetags involved
  3927.      */
  3928.     $._updatedResult = function(note, skillId, target, value) {
  3929.         // Refer to reference tag NOTE_RESULT_CACHE
  3930.         var result = this._uncachedResult(note, skillId, target, value);
  3931.         this._cache.updateResultCaches(skillId, target, value, note, result);
  3932.         return result;
  3933.         //
  3934.     }; // $._updatedResult
  3935.  
  3936.     /**
  3937.      * Idempotent
  3938.      * @since v1.00a @version v1.00a
  3939.      * @param {String} note - The note to have its end result retrieved
  3940.      * @param {Id} skillId - The id of the skill involved
  3941.      * @param {Game_Battler?} target - The target hit by the skill involved
  3942.      * @param {Number?} value - The damage of the hit involved
  3943.      * @returns {*} The requested result from all effective notetags involved
  3944.      */
  3945.     $._uncachedResult = function(note, skillId, target, value) {
  3946.         var chainingRule = this._chainingRule(skillId, note);
  3947.         return this[this._updatedResultFunc(chainingRule)](
  3948.                 note, skillId, target, value, chainingRule);
  3949.     }; // $._uncachedResult
  3950.  
  3951.     /**
  3952.      * Pure Function
  3953.      * @since v1.00a @version v1.00a
  3954.      * @param {String} chainingRule - The effective notetag result chaining rule
  3955.      * @returns {String} The requested name of the function to be used
  3956.      */
  3957.     $._updatedResultFunc = function(chainingRule) {
  3958.         return this._rules.isAssociative(chainingRule) ?
  3959.                 "_associativeResult" : "_nonAssociativeResult";
  3960.     }; // $._updatedResultFunc
  3961.  
  3962.     /**
  3963.      * Idempotent
  3964.      * @since v1.00a @version v1.00a
  3965.      * @param {String} note - The note to have its end result retrieved
  3966.      * @param {Id} skillId - The id of the skill involved
  3967.      * @param {Game_Battler?} target - The target hit by the skill involved
  3968.      * @param {Number?} value - The damage of the hit involved
  3969.      * @param {String} chainRule - The effective notetag result chaining rule
  3970.      * @returns {*} The requested result from all effective notetags involved
  3971.      */
  3972.     $._associativeResult = function(note, skillId, target, value, chainRule) {
  3973.         var partResults =
  3974.                 this._partResults(note, skillId, target, value, chainRule);
  3975.         var defaultResult = this._pairs.default(note, skillId, target, value);
  3976.         return this._chainedResult(partResults, skillId, note, target, value,
  3977.                 chainRule, "parts", defaultResult);
  3978.     }; // $._associativeResult
  3979.  
  3980.     /**
  3981.      * Idempotent
  3982.      * @since v1.00a @version v1.00a
  3983.      * @param {String} note - The note to have its end result retrieved
  3984.      * @param {Id} skillId - The id of the skill involved
  3985.      * @param {Game_Battler?} target - The target hit by the skill involved
  3986.      * @param {Number?} value - The damage of the hit involved
  3987.      * @param {String} chainRule - The effective notetag result chaining rule
  3988.      * @returns {[[]]*} The requested results of all effective notetags parts
  3989.      */
  3990.     $._partResults = function(note, skillId, target, value, chainRule) {
  3991.         // Refer to reference tag NOTE_LIST_PART
  3992.         var partResults = this._priority(skillId, note).map(this._partResult.
  3993.                 bind(this, note, skillId, target, value, chainRule));
  3994.         //
  3995.         return partResults.filter(_SP._IS_VALID_RESULT);
  3996.     }; // $._partResults
  3997.  
  3998.     /**
  3999.      * Idempotent
  4000.      * @since v1.00a @version v1.00a
  4001.      * @param {String} note - The note to have its end result retrieved
  4002.      * @param {Id} skillId - The id of the skill involved
  4003.      * @param {Game_Battler?} target - The target hit by the skill involved
  4004.      * @param {Number?} value - The damage of the hit involved
  4005.      * @param {String} chainingRule - The effective notetag result chaining rule
  4006.      * @param {String} part - The note part to have its part result retrieved
  4007.      * @returns {*} The requested result from all effective notetags involved
  4008.      */
  4009.     $._partResult = function(note, skillId, target, value, chainingRule, part) {
  4010.         var cache = this._cache.partResult(note, part);
  4011.         // It's possible for a cached result to be intentionally false
  4012.         if (_SP._IS_VALID_RESULT(cache)) return cache;
  4013.         //
  4014.         return this._updatedPartResult(
  4015.                 note, skillId, target, value, chainingRule, part);
  4016.     }; // $._partResult
  4017.  
  4018.     /**
  4019.      * Idempotent
  4020.      * @since v1.00a @version v1.00a
  4021.      * @param {String} note - The note to have its end result retrieved
  4022.      * @param {Id} skillId - The id of the skill involved
  4023.      * @param {Game_Battler?} target - The target hit by the skill involved
  4024.      * @param {Number?} value - The damage of the hit involved
  4025.      * @param {String} rule - The effective notetag result chaining rule
  4026.      * @param {String} part - The note part to have its part result retrieved
  4027.      * @returns {*} The requested result from all effective notetags involved
  4028.      */
  4029.     $._updatedPartResult = function(note, skillId, target, value, rule, part) {
  4030.         // Refer to reference tag NOTE_RESULT_CACHE
  4031.         var result = this._uncachedPartResult(note, skillId, target, value,
  4032.                 rule, part);
  4033.         this._cache.updatePartResultCaches(note, skillId, part, result);
  4034.         return result;
  4035.         //
  4036.     }; // $._updatedPartResult
  4037.  
  4038.     /**
  4039.      * Idempotent
  4040.      * @since v1.00a @version v1.00a
  4041.      * @param {String} note - The note to have its end result retrieved
  4042.      * @param {Id} skillId - The id of the skill involved
  4043.      * @param {Game_Battler?} target - The target hit by the skill involved
  4044.      * @param {Number?} value - The damage of the hit involved
  4045.      * @param {String} rule - The effective notetag result chaining rule
  4046.      * @param {String} part - The note part to have its part result retrieved
  4047.      * @returns {*} The requested result from all effective notetags involved
  4048.      */
  4049.     $._uncachedPartResult = function(note, skillId, target, value, rule, part) {
  4050.         var list = this._listPart(skillId, note, part);
  4051.         // The 1st datum in the part list must be the initial value of the part
  4052.         return list.length <= 0 ? undefined : this._chainedResult(
  4053.                 list, skillId, note, target, value, rule, "list");
  4054.         //
  4055.     }; // $._uncachedPartResult
  4056.  
  4057.     /**
  4058.      * Idempotent
  4059.      * @since v1.00a @version v1.00a
  4060.      * @param {String} note - The note to have its end result retrieved
  4061.      * @param {Id} skillId - The id of the skill involved
  4062.      * @param {Game_Battler?} target - The target hit by the skill involved
  4063.      * @param {Number?} value - The damage of the hit involved
  4064.      * @param {String} rule - The effective notetag result chaining rule
  4065.      * @returns {*} The requested result from all effective notetags involved
  4066.      */
  4067.     $._nonAssociativeResult = function(note, skillId, target, value, rule) {
  4068.         var defaultResult = this._pairs.default(note, skillId, target, value);
  4069.         return this._chainedResult(this._list(skillId, note), skillId, note,
  4070.                 target, value, rule, "list", defaultResult);
  4071.     }; // $._nonAssociativeResult
  4072.  
  4073.     /**
  4074.      * Nullipotent
  4075.      * @since v1.00a @version v1.00a
  4076.      * @param {[{*}]} list - The effective notetag list to be chained
  4077.      * @param {Id} skillId - The id of the skill involved
  4078.      * @param {String} note - The note to have its end result retrieved
  4079.      * @param {Game_Battler?} target - The target hit by the skill involved
  4080.      * @param {Number?} value - The damage of the hit involved
  4081.      * @param {String} r - The effective notetag result chaining rule
  4082.      * @param {String} t - The type of the list to be chained(list/parts)
  4083.      * @param {*?} i - The initial result to chain the notetag list
  4084.      * @returns {*} The requested result from all effective notetags involved
  4085.      */
  4086.     $._chainedResult = function(list, skillId, note, target, value, r, t, i) {
  4087.         return this._rules.chainResultFunc(note, r, t)(
  4088.                 list, skillId, note, target, value, i);
  4089.     }; // $._chainedResult
  4090.  
  4091.     /**
  4092.      * @since v1.00a @version v1.00a
  4093.      * @param {Id} skillId - The id of the skill involved
  4094.      * @param {String} note - The note to have its contents run
  4095.      */
  4096.     $._run = function(skillId, note) {
  4097.         // Refer to reference tag RUN_DEFAULT_FIRST
  4098.         this._pairs.default(note, skillId);
  4099.         //
  4100.         if (!skillId) return; // It's better to be no-op than to spoil the cache
  4101.         var list = this._rules.chainedRunListFunc(
  4102.                 this._chainingRule(skillId, note))(this._list(skillId, note));
  4103.         // Binding run here would cause target and value to be index and list
  4104.         list.forEach(function(d) { this._pairs.run(skillId, note, d); }, this);
  4105.         //
  4106.     }; // $._run
  4107.  
  4108.     /**
  4109.      * Nullipotent
  4110.      * @since v1.00a @version v1.00a
  4111.      * @param {Id} skillId - The id of the skill involved
  4112.      * @param {String} note - The note to have its effective list returned
  4113.      * @returns {String} The requested effective notetag chaining rule
  4114.      */
  4115.     $._chainingRule = function(skillId, note) {
  4116.         // Refer to reference tag THIS_GAME_ACTOR
  4117.         return SP.params[note + "NoteChainingRule"].call(
  4118.                 this._actor, skillId) || _SP._DEFAULT_CHAINING_RULE;
  4119.         //
  4120.     }; // $._chainingRule
  4121.  
  4122.     /**
  4123.      * Idempotent
  4124.      * @since v1.00a @version v1.00a
  4125.      * @param {Id} skillId - The id of the skill involved
  4126.      * @param {String} note - The note to have its effective list returned
  4127.      * @returns {[{*}]} The list of data having the effective notetags involved
  4128.      */
  4129.     $._list = function(skillId, note) {
  4130.         // A valid cache must be an Array so a falsy cache must be discarded
  4131.         return this._cache.list(skillId, note) ||
  4132.                 this._updatedList(skillId, note);
  4133.         //
  4134.     }; // $._list
  4135.  
  4136.     /**
  4137.      * Idempotent
  4138.      * @since v1.00a @version v1.00a
  4139.      * @param {Id} skillId - The id of the skill involved
  4140.      * @param {String} note - The note to have its effective list returned
  4141.      * @returns {[{*}]} The list of data having the effective notetags involved
  4142.      */
  4143.     $._updatedList = function(skillId, note) {
  4144.         // Refer to reference tag NOTE_LIST_CACHE
  4145.         var list = this._uncachedList(skillId, note);
  4146.         this._cache.updateListCaches(skillId, note, list);
  4147.         return list;
  4148.         //
  4149.     }; // $._updatedList
  4150.  
  4151.     /**
  4152.      * Idempotent
  4153.      * @since v1.00a @version v1.00a
  4154.      * @param {Id} skillId - The id of the skill involved
  4155.      * @param {String} note - The note to have its effective list returned
  4156.      * @returns {[{*}]} The list of data having the effective notetags involved
  4157.      */
  4158.     $._uncachedList = function(skillId, note) {
  4159.         // Refer to reference tag NOTE_LIST_PART
  4160.         return this._priority(skillId, note).reduce(function(list, part) {
  4161.             // The function's easy, simple and small enough to be inlined
  4162.             return list.concat(this._listPart(skillId, note, part));
  4163.             //
  4164.         }.bind(this), []);
  4165.         //
  4166.     }; // $._uncachedList
  4167.  
  4168.     /**
  4169.      * Nullipotent
  4170.      * @since v1.00a @version v1.00a
  4171.      * @param {Id} skillId - The id of the skill involved
  4172.      * @param {String} note - The note to have its effective list returned
  4173.      * @returns {[String]} The requested data type priority queue
  4174.      */
  4175.     $._priority = function(skillId, note) {
  4176.         // Refer to reference tag NOTE_DATA_TYPES and THIS_GAME_ACTOR
  4177.         return ["skills"].concat(
  4178.                 SP.params[note + "NotePriority"].call(this._actor, skillId));
  4179.         //
  4180.     }; // $._priority
  4181.  
  4182.     /**
  4183.      * Idempotent
  4184.      * @since v1.00a @version v1.00a
  4185.      * @param {Id} skillId - The id of the skill involved
  4186.      * @param {String} note - The note to have its effective list returned
  4187.      * @param {String} part - The note part to have its effective list returned
  4188.      * @returns {[{*}]} The list of data having the effective notetags involved
  4189.      */
  4190.     $._listPart = function(skillId, note, part) {
  4191.         // A valid cache must be an Array so a falsy cache must be discarded
  4192.         return this._cache.listPart(note, part) ||
  4193.                 this._updatedListPart(skillId, note, part);
  4194.         //
  4195.     }; // $._listPart
  4196.  
  4197.     /**
  4198.      * Idempotent
  4199.      * @since v1.00a @version v1.00a
  4200.      * @param {Id} skillId - The id of the skill involved
  4201.      * @param {String} note - The note to have its effective list returned
  4202.      * @param {String} part - The note part to have its effective list returned
  4203.      * @returns {[{*}]} The list of data having the effective notetags involved
  4204.      */
  4205.     $._updatedListPart = function(skillId, note, part) {
  4206.         // Refer to reference tag NOTE_LIST_CACHE
  4207.         var list = this._uncachedListPart(skillId, note, part);
  4208.         this._cache.updatePartListCaches(skillId, note, part, list);
  4209.         return list;
  4210.         //
  4211.     }; // $._updatedListPart
  4212.  
  4213.     /**
  4214.      * Nullipotent
  4215.      * @since v1.00a @version v1.00a
  4216.      * @param {Id} skillId - The id of the skill involved
  4217.      * @param {String} note - The note to have its effective list returned
  4218.      * @param {String} part - The note part to have its effective list returned
  4219.      * @returns {[{*}]} The list of data having the effective notetags involved
  4220.      */
  4221.     $._uncachedListPart = function(skillId, note, part) {
  4222.         return this._partList(skillId, part).map(
  4223.                 this._pairs.validData.bind(this._pairs, note)).filter(
  4224.                 this._pairs.hasPairs.bind(this._pairs, note));
  4225.     }; // $._uncachedListPart
  4226.  
  4227.     /**
  4228.      * Nullipotent
  4229.      * @since v1.00a @version v1.00a
  4230.      * @param {Id} skillId - The id of the skill involved
  4231.      * @param {String} part - The note part to have its effective list returned
  4232.      * @returns {[{*}]} The list of data having the effective notetags involved
  4233.      */
  4234.     $._partList = function(skillId, part) {
  4235.         var list = part === "skills" ?
  4236.                 [$dataSkills[skillId]] : this._actor[part]();
  4237.         return Array.isArray(list) ? list : [list];
  4238.     }; // $._partList
  4239.  
  4240. })(DoubleX_RMMV.Skill_Progress);
  4241.  
  4242. /*----------------------------------------------------------------------------
  4243.  *    # New private class: Game_SkillProgressCache
  4244.  *      - Caches the effective notetag lists and their end results
  4245.  *----------------------------------------------------------------------------*/
  4246.  
  4247. (function(SP) {
  4248.  
  4249.     "use strict";
  4250.  
  4251.     var $ = Game_SkillProgressCache.prototype;
  4252.     var _SP = SP.Game_SkillProgressCache = {};
  4253.     // Otherwise the skill part might be mixed up by different skill ids
  4254.     _SP._FACTOR_PART_KEY = function(skillId, fp) {
  4255.         return skillId && fp === "skills" ? fp + skillId : fp;
  4256.     }; // _SP._FACTOR_PART_KEY
  4257.     //
  4258.     // Refer to reference tag NOTE_DATA_TYPES
  4259.     _SP._FACTORS = [
  4260.         "actor",
  4261.         "currentClass",
  4262.         "weapons",
  4263.         "armors",
  4264.         "skills",
  4265.         "states",
  4266.         "priority",
  4267.         "chainingRule",
  4268.         "result"
  4269.     ];
  4270.     //
  4271.     // Refer to reference tag NOTE_TYPE
  4272.     _SP._NOTES = [
  4273.         "cond",
  4274.         "max",
  4275.         "useGain",
  4276.         "hitGain",
  4277.         "next",
  4278.         "keepCurrent",
  4279.         "willEnd",
  4280.         "didEnd"
  4281.     ];
  4282.     //
  4283.  
  4284.     /*------------------------------------------------------------------------
  4285.      *    New private instance variables
  4286.      *------------------------------------------------------------------------*/
  4287.     // {{{*}}} _cachedLists: The mapping from a note to its notetag list
  4288.     // {{{*}}} _cachedResults: The mapping from a note to its cached result
  4289.     // {{{Boolean}}} _changeFactorMarks: The map of all change factor marks
  4290.     // {{{Boolean}}} _changeFactors: The map of all change factors for all notes
  4291.     // {{{Boolean}}} _isSameLists: The map of whether the list cache's valid
  4292.     // {{{Boolean}}} _isSameResults: The map of whether the result cache's valid
  4293.     // {{{*}}} _partLists: The mapping from a note to its notetag list parts
  4294.     // {{{*}}} _partResults: The mapping from a note to its cached result parts
  4295.     // (Advanced){Boolean} _hasUnknownChangeFactor: ADVANCED_SCRIPT_CALLS_ONLY
  4296.  
  4297.     /**
  4298.      * Idempotent
  4299.      * @constructor @since v1.00a @version v1.00a
  4300.      */
  4301.     $.initialize = function() {
  4302.         this._init();
  4303.         this.raiseAllChangeFactors();
  4304.     }; // $.initialize
  4305.  
  4306.     /**
  4307.      * Idempotent
  4308.      * @interface @since v1.00a @version v1.00a
  4309.      * @param {[String]} factors - The change factors to be marked for all notes
  4310.      */
  4311.     $.markChangeFactors = function(factors) {
  4312.         factors.forEach(this._markChangeFactor, this);
  4313.     }; // $.markChangeFactors
  4314.  
  4315.     /**
  4316.      * Idempotent
  4317.      * @interface @since v1.00a @version v1.00a
  4318.      */
  4319.     $.raiseMarkedChangeFactors = function() {
  4320.         // Not using raiseAllChangeFactors is to be flexible with creative uses
  4321.         _SP._NOTES.forEach(this._raiseMarkedNoteChangeFactors, this);
  4322.         //
  4323.     }; // $.raiseMarkedChangeFactors
  4324.  
  4325.     /**
  4326.      * Idempotent
  4327.      * @interface @since v1.00a @version v1.00a
  4328.      */
  4329.     $.raiseAllChangeFactors = function() {
  4330.         // They use separate containers so it must be called multiple times
  4331.         this._changeFactorMarks = this._allEmptyContainers();
  4332.         this._changeFactors = this._allRaisedChangeFactors();
  4333.         this._isSameLists = this._allEmptyContainers();
  4334.         this._isSameResults = this._allEmptyContainers();
  4335.         //
  4336.     }; // $.raiseAllChangeFactors
  4337.  
  4338.     /**
  4339.      * Idempotent
  4340.      * @interface @since v1.00a @version v1.00a
  4341.      * @param {[String]} factors - The list of change factors to be raised
  4342.      * @param {Id?} skillId - The id of the skill involved
  4343.      */
  4344.     $.raisePartChangeFactors = function(factors, skillId) {
  4345.         // The function's easy, simple and small enough to be inlined
  4346.         _SP._NOTES.forEach(function(note) {
  4347.             factors.forEach(function(factor) {
  4348.                 // The argument list must be in this order as it's script call
  4349.                 this.raiseChangeFactor(note, factor, skillId);
  4350.                 //
  4351.             }, this);
  4352.         }, this);
  4353.         //
  4354.     }; // $.raisePartChangeFactors
  4355.  
  4356.     /**
  4357.      * Idempotent
  4358.      * @interface @since v1.00a @version v1.00a
  4359.      * @param {String} note - The note to have its change factor raised
  4360.      * @param {String} factor - The change factor to be raised for the note
  4361.      * @param {Id?} skillId - The id of the skill involved
  4362.      */
  4363.     $.raiseChangeFactor = function(note, factor, skillId) {
  4364.         var key = _SP._FACTOR_PART_KEY(skillId, factor);
  4365.         this._changeFactors[note][key] = true;
  4366.         this._changeFactorMarks[note][key] = false;
  4367.         // The cache validity flags should be erased upon any factor change
  4368.         this._isSameLists[note] = {};
  4369.         this._isSameResults[note] = {};
  4370.         //
  4371.     }; // $.raiseChangeFactor
  4372.  
  4373.     /**
  4374.      * Nullipotent
  4375.      * @interface @since v1.00a @version v1.00a
  4376.      * @param {String} note - The note to having its part result caches
  4377.      * @param {String} part - The note part to have its part result cache
  4378.      * @returns {*} The requested effective notetag list part result cache
  4379.      */
  4380.     $.cachedPartResult = function(note, part) {
  4381.         return this._partResults[note][part];
  4382.     }; // $.cachedPartResult
  4383.  
  4384.     /**
  4385.      * Idempotent
  4386.      * @interface @since v1.00a @version v1.00a
  4387.      * @param {String} note - The note to have its part result cache invalidated
  4388.      * @param {String} part - The note part to have its result cache invalidated
  4389.      */
  4390.     $.invalidateResultCache = function(note, part) {
  4391.         delete this._partResults[note][part];
  4392.         // The cache validity flags should be erased upon any factor change
  4393.         this._isSameResults[note] = {};
  4394.         //
  4395.     }; // $.invalidateResultCache
  4396.  
  4397.     /**
  4398.      * Idempotent
  4399.      * @interface @since v1.00a @version v1.00a
  4400.      * @param {String} note - The note to have its end result retrieved
  4401.      * @param {Id} skillId - The id of the skill involved
  4402.      * @returns {*} The requested result from all effective notetags involved
  4403.      */
  4404.     $.result = function(note, skillId) {
  4405.         // It's infeasible to cache target so value's not used here to miss it
  4406.         if (!this._isSameResults[note][skillId]) return undefined;
  4407.         return this._cachedResults[note][skillId];
  4408.         //
  4409.     }; // $.result
  4410.  
  4411.     /**
  4412.      * Idempotent
  4413.      * @interface @since v1.00a @version v1.00a
  4414.      * @param {String} note - The note to have its end result retrieved
  4415.      * @param {String} part - The note part to have its part result retrieved
  4416.      * @returns {*} The requested result from all effective notetags involved
  4417.      */
  4418.     $.partResult = function(note, part) {
  4419.         // The skill change factor's raised upon changing skills so it's ok here
  4420.         if (this._changeFactors[note][part]) return undefined;
  4421.         return this.cachedPartResult(note, part);
  4422.         //
  4423.     }; // $.partResult
  4424.  
  4425.     /**
  4426.      * Idempotent
  4427.      * @interface @since v1.00a @version v1.00a
  4428.      * @param {String} note - The note to have its end result retrieved
  4429.      * @param {Id} skillId - The id of the skill involved
  4430.      * @param {String} part - The note part to have its part result retrieved
  4431.      * @param {*} result - The effective notetag list part result to be cached
  4432.      * @returns {*} The requested result from all effective notetags involved
  4433.      */
  4434.     $.updatePartResultCaches = function(note, skillId, part, result) {
  4435.         var key = _SP._FACTOR_PART_KEY(skillId, part);
  4436.         this._partResults[note][key] = result;
  4437.         this._changeFactors[note][key] = false;
  4438.     }; // $.updatePartResultCaches
  4439.  
  4440.     /**
  4441.      * Idempotent
  4442.      * @interface @since v1.00a @version v1.00a
  4443.      * @param {Id} skillId - The id of the skill involved
  4444.      * @param {Game_Battler?} target - The target hit by the skill involved
  4445.      * @param {Number?} value - The damage of the hit involved
  4446.      * @param {String} note - The note to have its end result retrieved
  4447.      * @param {*} result - The effective notetag list result to be cached
  4448.      * @returns {*} The requested result from all effective notetags involved
  4449.      */
  4450.     $.updateResultCaches = function(skillId, target, value, note, result) {
  4451.         // It's infeasible to cache target so value's used here to miss it later
  4452.         var key = target ?
  4453.                 JSON.stringify({ skillId: skillId, value: value }) : skillId;
  4454.         this._cachedResults[note][key] = result;
  4455.         //
  4456.         this._isSameResults[note][skillId] = true;
  4457.     }; // $.updateResultCaches
  4458.  
  4459.     /**
  4460.      * Idempotent
  4461.      * @interface @since v1.00a @version v1.00a
  4462.      * @param {Id} skillId - The id of the skill involved
  4463.      * @param {String} note - The note to have its effective list returned
  4464.      * @returns {[{*}]} The list of data having the effective notetags involved
  4465.      */
  4466.     $.list = function(skillId, note) {
  4467.         // A valid list must be truthy so this shorthand can be used
  4468.         return this._isSameLists[note][skillId]
  4469.                 && this._cachedLists[note][skillId];
  4470.         //
  4471.     }; // $.list
  4472.  
  4473.     /**
  4474.      * Idempotent
  4475.      * @interface @since v1.00a @version v1.00a
  4476.      * @param {String} note - The note to have its effective list returned
  4477.      * @param {String} part - The note part to have its effective list returned
  4478.      * @returns {[{*}]} The list of data having the effective notetags involved
  4479.      */
  4480.     $.listPart = function(note, part) {
  4481.         // The skill change factor's raised upon changing skills so it's ok here
  4482.         return !this._changeFactors[note][part] && this._partLists[note][part];
  4483.         //
  4484.     }; // $.listPart
  4485.  
  4486.     /**
  4487.      * Idempotent
  4488.      * @interface @since v1.00a @version v1.00a
  4489.      * @param {Id} skillId - The id of the skill involved
  4490.      * @param {String} note - The note to have its effective list returned
  4491.      * @param {String} part - The note part to have its effective list returned
  4492.      * @param {[{*}]} partList The list of data having the notetags involved
  4493.      */
  4494.     $.updatePartListCaches = function(skillId, note, part, partList) {
  4495.         var key = _SP._FACTOR_PART_KEY(skillId, part);
  4496.         // partList's supposed to be immutable so it's safe here
  4497.         this._partLists[note][key] = partList; // partList.clone();
  4498.         //
  4499.         this._changeFactors[note][key] = false;
  4500.     }; // $.updatePartListCaches
  4501.  
  4502.     /**
  4503.      * Idempotent
  4504.      * @interface @since v1.00a @version v1.00a
  4505.      * @param {Id} skillId - The id of the skill involved
  4506.      * @param {String} note - The note to have its effective list returned
  4507.      * @param {[{*}]} list - The list of data having the notetags involved
  4508.      */
  4509.     $.updateListCaches = function(skillId, note, list) {
  4510.         // list's supposed to be immutable so it's safe here
  4511.         this._cachedLists[note][skillId] = list; // list.clone();
  4512.         //
  4513.         this._isSameLists[note][skillId] = true;
  4514.     }; // $.updateListCaches
  4515.  
  4516.     /**
  4517.      * Idempotent
  4518.      * @since v1.00a @version v1.00a
  4519.      */
  4520.     $._init = function() {
  4521.         // They use separate containers so it must be called multiple times
  4522.         this._cachedLists = this._allEmptyContainers();
  4523.         this._cachedResults = this._allEmptyContainers();
  4524.         this._partLists = this._allEmptyContainers();
  4525.         this._partResults = this._allEmptyContainers();
  4526.         //
  4527.         // Set it as false only if you're sure this plugin's all change factors
  4528.         this._hasUnknownChangeFactor = true;
  4529.         //
  4530.     }; // $._init
  4531.  
  4532.     /**
  4533.      * Pure Function
  4534.      * @since v1.00a @version v1.00a
  4535.      * @returns {{{*}}} The requested mapping from a note to its container
  4536.      */
  4537.     $._allEmptyContainers = function() {
  4538.         // The function's easy, simple and small enough to be inlined
  4539.         return this._allNoteContainers(function() { return {}; });
  4540.         //
  4541.     }; // $._allEmptyContainers
  4542.  
  4543.     /**
  4544.      * Pure Function
  4545.      * @since v1.00a @version v1.00a
  4546.      * @returns {{{Boolean}}} The mapping of all change factors for all notes
  4547.      */
  4548.     $._allRaisedChangeFactors = function() {
  4549.         return this._allNoteContainers(this._raisedChangeFactors.bind(this));
  4550.     }; // $._allRaisedChangeFactors
  4551.  
  4552.     /**
  4553.      * Pure Function
  4554.      * @since v1.00a @version v1.00a
  4555.      * @returns {{Boolean}} The mapping of all change factors for all notes
  4556.      */
  4557.     $._raisedChangeFactors = function() {
  4558.         // The function's easy, simple and small enough to be inlined
  4559.         return _SP._FACTORS.reduce(function(factors, factor) {
  4560.             factors[factor] = true;
  4561.             return factors;
  4562.         }, {});
  4563.         //
  4564.     }; // $._raisedChangeFactors
  4565.  
  4566.     /**
  4567.      * Pure Function
  4568.      * @since v1.00a @version v1.00a
  4569.      * @param {()} noteContainerFunc - The function returning a container
  4570.      * @returns {{{*}}} The mapping of each note to its container
  4571.      */
  4572.     $._allNoteContainers = function(noteContainerFunc) {
  4573.         // The function's easy, simple and small enough to be inlined
  4574.         return _SP._NOTES.reduce(function(containers, note) {
  4575.             // The container must be created here to ensure its independence
  4576.             containers[note] = noteContainerFunc();
  4577.             //
  4578.             return containers;
  4579.         }, {});
  4580.         //
  4581.     }; // $._allNoteContainers
  4582.  
  4583.     /**
  4584.      * Idempotent
  4585.      * @since v1.00a @version v1.00a
  4586.      * @param {String} factor - The change factor to be marked for all notes
  4587.      */
  4588.     $._markChangeFactor = function(factor) {
  4589.         _SP._NOTES.forEach(this._markNoteChangeFactor.bind(this, factor));
  4590.     }; // $._markChangeFactor
  4591.  
  4592.     /**
  4593.      * Idempotent
  4594.      * @since v1.00a @version v1.00a
  4595.      * @param {String} factor - The change factor to be marked for the note
  4596.      * @param {String} note - The note to have its change factor marked
  4597.      */
  4598.     $._markNoteChangeFactor = function(factor, note) {
  4599.         this._changeFactorMarks[note][factor] = true;
  4600.     }; // $._markNoteChangeFactor
  4601.  
  4602.     /**
  4603.      * Idempotent
  4604.      * @since v1.00a @version v1.00a
  4605.      * @param {String} note - The note to have its marked change factors raised
  4606.      */
  4607.     $._raiseMarkedNoteChangeFactors = function(note) {
  4608.         this._raisedNoteChangeFactors(note).forEach(
  4609.                 this.raiseChangeFactor.bind(this, note));
  4610.         //
  4611.     }; // $._raiseMarkedNoteChangeFactors
  4612.  
  4613.     /**
  4614.      * Nullipotent
  4615.      * @since v1.00a @version v1.00a
  4616.      * @param {String} note - The note to have its marked change factors raised
  4617.      */
  4618.     $._raisedNoteChangeFactors = function(note) {
  4619.         var marks = this._changeFactorMarks[note];
  4620.         var factors = this._markedNoteChangeFactors(marks);
  4621.         // Falsy this._hasUnknownChangeFactor might reduce redundant recaches
  4622.         if (!this._hasUnknownChangeFactor || factors.length > 0) return factors;
  4623.         //
  4624.         // Raises all factors if none's marked to avoid missing possible changes
  4625.         return Object.keys(marks);
  4626.         //
  4627.     }; // $._raisedNoteChangeFactors
  4628.  
  4629.     /**
  4630.      * Pure Function
  4631.      * @since v1.00a @version v1.00a
  4632.      * @param {{Boolean}} marks - The map of all the note change factor marks
  4633.      */
  4634.     $._markedNoteChangeFactors = function(marks) {
  4635.         // The function's easy, simple and small enough to be inlined
  4636.         return Object.keys(marks).filter(function(f) { return marks[f]; });
  4637.         //
  4638.     }; // $._markedNoteChangeFactors
  4639.  
  4640. })(DoubleX_RMMV.Skill_Progress);
  4641.  
  4642. /*----------------------------------------------------------------------------
  4643.  *    # New private class: Game_SkillProgressPairs
  4644.  *      - Converts the effective notetag pairs to the referred functions
  4645.  *----------------------------------------------------------------------------*/
  4646.  
  4647. (function(SP) {
  4648.  
  4649.     "use strict";
  4650.  
  4651.     var $ = Game_SkillProgressPairs.prototype;
  4652.     var _SP = SP.Game_SkillProgressPairs = {};
  4653.     // Refer to reference tag NOTE_SUFFIX
  4654.     _SP._FUNCS = {
  4655.         cfg: function(type, entry) { return SP.notes[entry]; },
  4656.         val: function(type, entry) {
  4657.             var func = _SP._RESULTS[type];
  4658.             return func ? func.bind(_SP, entry) : function() { return entry; };
  4659.         },
  4660.         switch: function(type, entry) {
  4661.             return $gameSwitches.value.bind($gameSwitches, +entry);
  4662.         },
  4663.         event: function(type, entry) {
  4664.             return $gameTemp.reserveCommonEvent.bind($gameTemp, +entry);
  4665.         },
  4666.         var: function(type, entry) {
  4667.             var f = _SP._RESULTS[type];
  4668.             if (!f) return $gameVariables.value.bind($gameVariables, +entry);
  4669.             return function() { return f($gameVariables.value(+entry)); };
  4670.         },
  4671.         // Function contents' not supposed to change frequently so it's ok here
  4672.         script: function(type, entry) {
  4673.             return new Function("skillId", "datum", "target", "value",
  4674.                     $gameVariables.value(+entry));
  4675.         },
  4676.         eval: function(type, entry) {
  4677.             return new Function("skillId", "datum", "target", "value", entry);
  4678.         }
  4679.         //
  4680.     };
  4681.     //
  4682.     _SP._RESULTS = {
  4683.         boolean: function(result) { return result.toLowerCase() === "true"; },
  4684.         number: function(result) { return +result; },
  4685.         numberArray: function(result) {
  4686.             // Refer to reference tag NUMBER_ARRAY
  4687.             return result.split("_").map(function(r) { return +r; });
  4688.             //
  4689.         }
  4690.     };
  4691.     // Refer to reference tag NOTE_SUFFIX
  4692.     _SP._SUFFIXES = {
  4693.         run: ["cfg", "event", "script", "eval"],
  4694.         result: ["cfg", "val", "switch", "var", "script", "eval"]
  4695.     };
  4696.     //
  4697.     _SP._NUMBER_RESULT_NOTES = {
  4698.         hasPair: "_hasPair",
  4699.         pairFunc: "_pairFunc",
  4700.         result: "number",
  4701.         suffixes: _SP._SUFFIXES.result
  4702.     };
  4703.     _SP._BASE_RUN_NOTES = {
  4704.         hasPair: "_hasPair",
  4705.         pairFunc: "_pairFunc",
  4706.         suffixes: _SP._SUFFIXES.run
  4707.     };
  4708.     // Refer to reference tag NOTE_TYPE
  4709.     _SP._NOTES = {
  4710.         cond: {
  4711.             hasPair: "_hasCondPair",
  4712.             pairFunc: "_condPairFunc",
  4713.             suffixes: _SP._SUFFIXES.result
  4714.         },
  4715.         max: _SP._NUMBER_RESULT_NOTES,
  4716.         useGain: _SP._NUMBER_RESULT_NOTES,
  4717.         hitGain: _SP._NUMBER_RESULT_NOTES,
  4718.         next: {
  4719.             hasPair: "_hasPair",
  4720.             pairFunc: "_pairFunc",
  4721.             result: "numberArray",
  4722.             suffixes: _SP._SUFFIXES.result
  4723.         },
  4724.         keepCurrent: {
  4725.             hasPair: "_hasPair",
  4726.             pairFunc: "_pairFunc",
  4727.             result: "boolean",
  4728.             suffixes: _SP._SUFFIXES.result
  4729.         },
  4730.         willEnd: _SP._BASE_RUN_NOTES,
  4731.         didEnd: _SP._BASE_RUN_NOTES
  4732.     };
  4733.     //
  4734.     // Refer to reference tag NOTE_DEFAULT_RESULTS
  4735.     _SP._DEFAULT_RESULTS = {
  4736.         // Using {} would cause inconsistent mixObject result argument type
  4737.         cond: function() { return [] },
  4738.         //
  4739.         next: function() { return [] }
  4740.     };
  4741.     //
  4742.  
  4743.     var notes = {
  4744.         max: "defaultMax",
  4745.         useGain: "defaultUseGain",
  4746.         hitGain: "defaultHitGain",
  4747.         keepCurrent: "defaultKeepCurrent",
  4748.         willEnd: "willEnd",
  4749.         didEnd: "didEnd"
  4750.     };
  4751.     Object.keys(notes).forEach(function(note) {
  4752.         var param = notes[note];
  4753.         // The this pointer is Game_SkillProgressPairs.prototype
  4754.         _SP._DEFAULT_RESULTS[note] = function(skillId, target, value) {
  4755.             // It's possible that SP.params[param] changes midway
  4756.             return SP.params[param].call(this._actor, skillId, target, value);
  4757.             //
  4758.         };
  4759.         //
  4760.     });
  4761.  
  4762.     /*------------------------------------------------------------------------
  4763.      *    New private instance variables
  4764.      *------------------------------------------------------------------------*/
  4765.     // {Game_Actor} _actor: The actor owning the effective notetag list
  4766.  
  4767.     /**
  4768.      * Idempotent
  4769.      * @constructor @since v1.00a @version v1.00a
  4770.      * @param {Game_Actor} actor - The actor owning the effective notetag list
  4771.      */
  4772.     $.initialize = function(actor) { this._actor = actor; };
  4773.  
  4774.     /**
  4775.      * Idempotent
  4776.      * @interface @since v1.00a @version v1.00a
  4777.      */
  4778.     $.clear = function() { delete this._actor; /* Avoids memory leaks */ };
  4779.  
  4780.     /**
  4781.      * Pure Function
  4782.      * @interface @since v1.00a @version v1.00a
  4783.      * @param {String} note - The note to have its pairs retrieved
  4784.      * @param {Id} skillId - The id of the skill involved
  4785.      * @param {Game_Battler?} target - The target hit by the skill involved
  4786.      * @param {Number?} value - The damage of the hit involved
  4787.      * @returns {*} The default result of the note
  4788.      */
  4789.     $.default = function(note, skillId, target, value) {
  4790.         return _SP._DEFAULT_RESULTS[note].call(this, skillId, target, value);
  4791.     }; // $.default
  4792.  
  4793.     /**
  4794.      * Pure Function
  4795.      * @interface @since v1.00a @version v1.00a
  4796.      * @param {String} note - The note to have its pairs retrieved
  4797.      * @param {{*}?} datum - The datum having the notetag involved
  4798.      * @returns {{*}?} The datum having the notetag involved
  4799.      */
  4800.     $.validData = function(note, datum) {
  4801.         if (!datum) return datum;
  4802.         var skillProgress = datum.meta.skillProgress;
  4803.         var pairs = skillProgress[note];
  4804.         skillProgress[note] = pairs && pairs.filter(
  4805.                 this[_SP._NOTES[note].hasPair].bind(this, note));
  4806.         return datum;
  4807.     }; // $.validData
  4808.  
  4809.     /**
  4810.      * Pure Function
  4811.      * @interface @since v1.00a @version v1.00a
  4812.      * @param {String} note - The note to have its pairs retrieved
  4813.      * @param {{*}?} datum - The datum having the notetag involved
  4814.      * @returns {Boolean} The check result
  4815.      */
  4816.     $.hasPairs = function(note, datum) {
  4817.         var pairs = this._pairs(note, datum);
  4818.         return pairs && pairs.length > 0;
  4819.     }; // $.hasPairs
  4820.  
  4821.     /**
  4822.      * @interface @since v1.00a @version v1.00a
  4823.      * @param {Id} skillId - The id of the skill involved
  4824.      * @param {String} note - The note to have its contents run
  4825.      * @param {{*}} datum - The datum having the note to have its contents run
  4826.      * @param {Game_Battler?} target - The target hit by the skill involved
  4827.      * @param {Number?} value - The damage of the hit involved
  4828.      * @returns {[*]} The result of the notetag function involved
  4829.      */
  4830.     $.run = function(skillId, note, datum, target, value) {
  4831.         var results = this.pairs(note, datum).map(function(func) {
  4832.             return func(skillId, datum, target, value);
  4833.         });
  4834.         if (_SP._NOTES[note].result !== "numberArray") return results;
  4835.         return results.reduce(function(list, result) {
  4836.             return list.concat(result);
  4837.         }, []);
  4838.     }; // $.run
  4839.  
  4840.     /**
  4841.      * Pure Function
  4842.      * @interface @since v1.00a @version v1.00a
  4843.      * @param {String} note - The note to have its pairs retrieved
  4844.      * @param {{*}?} datum - The datum having the notetag involved
  4845.      * @returns {[(Id, {*}, Game_Battler?, Number?) -> *]} The functions referred
  4846.      *                                                    by the notetag pairs
  4847.      */
  4848.     $.pairs = function(note, datum) {
  4849.         var pairs = this._pairs(note, datum);
  4850.         return pairs ? pairs.map(
  4851.                 this[_SP._NOTES[note].pairFunc].bind(this, note)) : [];
  4852.     }; // $.pairs
  4853.  
  4854.     /**
  4855.      * Pure Function
  4856.      * @since v1.00a @version v1.00a
  4857.      * @param {String} note - The note to have its pairs retrieved
  4858.      * @param {{String}?} pair - The suffix-entry pair of the note involved
  4859.      * @returns {Boolean} The check result
  4860.      */
  4861.     $._hasCondPair = function(note, pair) {
  4862.         if (!pair || !pair.entry1 || !pair.entry2) return false;
  4863.         return [pair.suffix1, pair.suffix2].every(
  4864.                 this._isValidSuffix.bind(this, note));
  4865.     }; // $._hasCondPair
  4866.  
  4867.     /**
  4868.      * Pure Function
  4869.      * @since v1.00a @version v1.00a
  4870.      * @param {String} note - The note to have its pairs retrieved
  4871.      * @param {{String}?} pair - The suffix-entry pairs of the note involved
  4872.      * @returns {Boolean} The check result
  4873.      */
  4874.     $._hasPair = function(note, pair) {
  4875.         return pair && pair.entry1 && this._isValidSuffix(note, pair.suffix1);
  4876.     }; // $._hasPair
  4877.  
  4878.     /**
  4879.      * Pure Function
  4880.      * @since v1.00a @version v1.00a
  4881.      * @param {String} note - The note to have its pairs retrieved
  4882.      * @param {String} suffix - The notetag suffix to be checked against
  4883.      * @returns {Boolean} The check result
  4884.      */
  4885.     $._isValidSuffix = function(note, suffix) {
  4886.         return _SP._NOTES[note].suffixes.indexOf(suffix) >= 0;
  4887.     }; // $._isValidSuffix
  4888.  
  4889.     /**
  4890.      * Pure Function
  4891.      * @since v1.00a @version v1.00a
  4892.      * @param {String} note - The note to have their contents run
  4893.      * @param {{*}?} datum - The datum having the notetag involved
  4894.      * @returns {[{String}?]} The suffix-entry pairs of the note involved
  4895.      */
  4896.     $._pairs = function(note, datum) {
  4897.         // Refer to reference tag NOTETAG_MULTI
  4898.         return datum && datum.meta.skillProgress[note];
  4899.         //
  4900.     }; // $._pairs
  4901.  
  4902.     /**
  4903.      * Pure Function
  4904.      * @since v1.00a @version v1.00a
  4905.      * @param {String} note - The note to have its pairs retrieved
  4906.      * @param {{String}} pair - The suffix-entry pair of the note involved
  4907.      * @returns {(Id, {*}, ) -> String} The function referred by the cond pairs
  4908.      */
  4909.     $._condPairFunc = function(note, pair) {
  4910.         var descFunc = _SP._FUNCS[pair.suffix2]("string", pair.entry2);
  4911.         var condFunc = _SP._FUNCS[pair.suffix1]("boolean", pair.entry1);
  4912.         return function(skillId, datum) {
  4913.             // Refer to reference tag THIS_GAME_ACTOR
  4914.             var result = {}, desc = descFunc.call(this._actor, skillId, datum);
  4915.             //
  4916.             // Refer to reference tag INVALID_COND_DESC and THIS_GAME_ACTOR
  4917.             if (desc) result[desc] = condFunc.call(this._actor, skillId, datum);
  4918.             //
  4919.             return result;
  4920.         }.bind(this);
  4921.     }; // $._condPairFunc
  4922.  
  4923.     /**
  4924.      * Pure Function
  4925.      * @since v1.00a @version v1.00a
  4926.      * @param {String} note - The note to have its pairs retrieved
  4927.      * @param {{String}} pairs - The suffix-entry pairsof the note involved
  4928.      * @returns {(Id, {*}, Game_Battler?, Number?) -> *} The function referred
  4929.      *                                                  by the notetag pairs
  4930.      */
  4931.     $._pairFunc = function(note, pair) {
  4932.         // Refer to reference tag THIS_GAME_ACTOR
  4933.         return _SP._FUNCS[pair.suffix1](
  4934.                 _SP._NOTES[note].result, pair.entry1).bind(this._actor);
  4935.         //
  4936.     }; // $._pairFunc
  4937.  
  4938. })(DoubleX_RMMV.Skill_Progress);
  4939.  
  4940. /*----------------------------------------------------------------------------
  4941.  *    # New private class: Game_SkillProgressRules
  4942.  *      - Chains the effective notetag list into its results using the rules
  4943.  *----------------------------------------------------------------------------*/
  4944.  
  4945. (function(SP) {
  4946.  
  4947.     "use strict";
  4948.  
  4949.     var $ = Game_SkillProgressRules.prototype;
  4950.     var _SP = SP.Game_SkillProgressRules = {};
  4951.     _SP._CHAINED_RESULT_FUNC = {
  4952.         // The control coupling's to simplify the use of these functions
  4953.         concat: function(isSome) {
  4954.             return new Function("chainedResult", "result", isSome ? [
  4955.                 "var cr = chainedResult.concat(result);",
  4956.                 /** @todo Makes this much more effective and efficient */
  4957.                 "return cr.every(function(r) { return r; }) ? ",
  4958.                 "        cr : cr.map(function() { return null; });"
  4959.                 //
  4960.             ].join("\n") : "return chainedResult.concat(result);");
  4961.         },
  4962.         mixObject: function(isSome) {
  4963.             return new Function("chainedResult", "result", isSome ? [
  4964.                 "if (!result) return chainedResult;",
  4965.                 "result.forEach(function(r) {",
  4966.                 "    var key = Object.keys(r)[0];",
  4967.                 "    if (key) chainedResult[key] = r[key];",
  4968.                 "});",
  4969.                 "var keys = Object.keys(chainedResult);",
  4970.                 /** @todo Makes this much more effective and efficient */
  4971.                 "if (keys.some(function(k) { return !chainedResult[k]; })) {",
  4972.                 "    keys.forEach(function(k) { chainedResult[k] = null; });",
  4973.                 "}",
  4974.                 //
  4975.                 "return chainedResult;"
  4976.             ].join("\n") : [
  4977.                 "if (result) result.forEach(function(r) {",
  4978.                 "    var key = Object.keys(r)[0];",
  4979.                 "    if (key) chainedResult[key] = r[key];",
  4980.                 "});",
  4981.                 "return chainedResult;"
  4982.             ].join("\n"));
  4983.         },
  4984.         //
  4985.         operator: function(operator) {
  4986.             return new Function("chainedResult", "result", [
  4987.                 "return chainedResult " + operator + " result.reduce(function(cr, r) {",
  4988.                 "    return cr " + operator + "r;",
  4989.                 "});"
  4990.             ].join("\n"));
  4991.         }
  4992.     };
  4993.     _SP._CHAINED_RESULT_FUNCS = {
  4994.         every: {
  4995.             concat: _SP._CHAINED_RESULT_FUNC.concat(false),
  4996.             mixObject: _SP._CHAINED_RESULT_FUNC.mixObject(false),
  4997.             operator: _SP._CHAINED_RESULT_FUNC.operator("&&")
  4998.         },
  4999.         some: {
  5000.             concat: _SP._CHAINED_RESULT_FUNC.concat(true),
  5001.             mixObject: _SP._CHAINED_RESULT_FUNC.mixObject(true),
  5002.             operator: _SP._CHAINED_RESULT_FUNC.operator("||")
  5003.         }
  5004.     };
  5005.     // Refer to reference tag NOTE_OPERATORS
  5006.     ["+", "*", "-", "/", "%", "="].forEach(function(operator) {
  5007.         _SP._CHAINED_RESULT_FUNCS[operator] = {
  5008.             operator: _SP._CHAINED_RESULT_FUNC.operator(operator)
  5009.         };
  5010.     });
  5011.     //
  5012.     // The this pointer is Game_SkillProgressRules.prototype
  5013.     _SP._FIRST_LIST_MONO_FUNC = function(list, skillId, note) {
  5014.         if (list.length <= 0) return this._pairs.default(note, skillId);
  5015.         return this._pairs.run(skillId, note, list[0])[0];
  5016.     };
  5017.     _SP._LAST_LIST_MONO_FUNC = function(list, skillId, note) {
  5018.         if (list.length <= 0) return this._pairs.default(note, skillId);
  5019.         var pairs = this._pairs.run(skillId, note, list[list.length - 1]);
  5020.         return pairs[pairs.length - 1];
  5021.     };
  5022.     //
  5023.     // Refer to reference tag NOTE_TYPE
  5024.     _SP._NOTES = {
  5025.         cond: "mixObject",
  5026.         max: "operator",
  5027.         useGain: "operator",
  5028.         hitGain: "operator",
  5029.         next: "concat",
  5030.         keepCurrent: "operator"
  5031.     };
  5032.     //
  5033.     _SP._RESULT_CHAINING_RULE_FUNC = function(list, note, func, initialResult) {
  5034.         if (initialResult === null || initialResult === undefined) {
  5035.             // The initial value of concat must be an Array
  5036.             if (_SP._NOTES[note] === "concat") return list.reduce(func, []);
  5037.             //
  5038.             return list.reduce(func);
  5039.         }
  5040.         return list.reduce(func, initialResult);
  5041.     };
  5042.     _SP._RESULT_CHAINING_RULE_FUNCS = function(rule, type) {
  5043.         var func = _SP._CHAINED_RESULT_FUNCS[rule][type];
  5044.         return {
  5045.             // The this pointer is Game_SkillProgressRules.prototype
  5046.             list: function(list, skillId, note, target, value, initialResult) {
  5047.                 // The only important invariant is the pair execution order
  5048.                 return _SP._RESULT_CHAINING_RULE_FUNC(list.map(function(datum) {
  5049.                     return this._pairs.run(skillId, note, datum, target, value);
  5050.                 }, this), note, func, initialResult);
  5051.                 //
  5052.             },
  5053.             //
  5054.             // The function signature must be consistent to keep the API sane
  5055.             parts: function(list, skillId, note, target, value, initialResult) {
  5056.                 return _SP._RESULT_CHAINING_RULE_FUNC(
  5057.                         list, note, func, initialResult);
  5058.             }
  5059.             //
  5060.         }
  5061.     };
  5062.     _SP._MONO_RESULT_CHAINING_RULES = function(func) {
  5063.         var listParts = { list: func, parts: func };
  5064.         return { concat: listParts, mixObject: listParts, operator: listParts };
  5065.     };
  5066.     _SP._RESULT_CHAINING_RULES = {
  5067.         every: {
  5068.             concat: _SP._RESULT_CHAINING_RULE_FUNCS("every", "concat"),
  5069.             isAssociative: true,
  5070.             mixObject: _SP._RESULT_CHAINING_RULE_FUNCS("every", "mixObject"),
  5071.             operator: _SP._RESULT_CHAINING_RULE_FUNCS("every", "operator")
  5072.         },
  5073.         some: {
  5074.             concat: _SP._RESULT_CHAINING_RULE_FUNCS("some", "concat"),
  5075.             isAssociative: true,
  5076.             mixObject: _SP._RESULT_CHAINING_RULE_FUNCS("some", "mixObject"),
  5077.             operator: _SP._RESULT_CHAINING_RULE_FUNCS("some", "operator")
  5078.         },
  5079.         "+": {
  5080.             isAssociative: true,
  5081.             operator: _SP._RESULT_CHAINING_RULE_FUNCS("+", "operator")
  5082.         },
  5083.         "*": {
  5084.             isAssociative: true,
  5085.             operator: _SP._RESULT_CHAINING_RULE_FUNCS("*", "operator")
  5086.         },
  5087.         "-": { operator: _SP._RESULT_CHAINING_RULE_FUNCS("-", "operator") },
  5088.         "/": { operator: _SP._RESULT_CHAINING_RULE_FUNCS("/", "operator") },
  5089.         "%": { operator: _SP._RESULT_CHAINING_RULE_FUNCS("%", "operator") },
  5090.         // = is intended for unintended uses so it shouldn't be associative
  5091.         "=": { operator: _SP._RESULT_CHAINING_RULE_FUNCS("=", "operator") },
  5092.         //
  5093.         // Conforms with the chaining rule interface
  5094.         first: _SP._MONO_RESULT_CHAINING_RULES(_SP._FIRST_LIST_MONO_FUNC),
  5095.         last: _SP._MONO_RESULT_CHAINING_RULES(_SP._LAST_LIST_MONO_FUNC),
  5096.         //
  5097.     };
  5098.     _SP._RUN_CHAINING_RULES = {
  5099.         every: function(list) { return list; },
  5100.         first: function(list) { return [list[0]]; },
  5101.         last: function(list) { return [list[list.length - 1]]; }
  5102.     };
  5103.  
  5104.     /*------------------------------------------------------------------------
  5105.      *    New private instance variable
  5106.      *------------------------------------------------------------------------*/
  5107.     // {Game_SkillProgressPairs} _pairs: The helper checking/returning note pair
  5108.  
  5109.     /**
  5110.      * Idempotent
  5111.      * @constructor @since v1.00a @version v1.00a
  5112.      * @param {Game_SkillProgressPairs} pairs - The note pair checker/user
  5113.      */
  5114.     $.initialize = function(pairs) { this._pairs = pairs; };
  5115.  
  5116.     /**
  5117.      * Idempotent
  5118.      * @interface @since v1.00a @version v1.00a
  5119.      */
  5120.     $.clear = function() { this._pairs.clear(); /* Avoids memory leaks */ };
  5121.  
  5122.     /**
  5123.      * Pure Function
  5124.      * @interface @since v1.00a @version v1.00a
  5125.      * @param {String} chainingRule - The rule to chain effective notetag list
  5126.      * @returns {Boolean} The check result
  5127.      */
  5128.     $.isAssociative = function(chainingRule) {
  5129.         // It's understood that associativity means nothing when running a list
  5130.         return _SP._RESULT_CHAINING_RULES[chainingRule].isAssociative;
  5131.         //
  5132.     }; // $.isAssociative
  5133.  
  5134.     /**
  5135.      * Pure Function
  5136.      * @interface @since v1.00a @version v1.00a
  5137.      * @param {String} note - The note to have its effective results chained
  5138.      * @param {String} rule - The rule to chain the effective notetag list
  5139.      * @param {String} type - The type of the list to be chained(list/parts)
  5140.      * @returns {(Id, {*}, Game_Battler?, Number?) -> *} The function chaining
  5141.      *                                                  the notetag list
  5142.      */
  5143.     $.chainResultFunc = function(note, rule, type) {
  5144.         return _SP._RESULT_CHAINING_RULES[rule][_SP._NOTES[note]][type].
  5145.                 bind(this);
  5146.     }; // $.chainResultFunc
  5147.  
  5148.     /**
  5149.      * Pure Function
  5150.      * @interface @since v1.00a @version v1.00a
  5151.      * @param {String} rule - The rule to chain the effective notetag list
  5152.      * @returns {([{*}]) -> [{*}]} The function returning chained notetag list
  5153.      */
  5154.     $.chainedRunListFunc = function(rule) {
  5155.         return _SP._RUN_CHAINING_RULES[rule];
  5156.     }; // $.chainedRunListFunc
  5157.  
  5158. })(DoubleX_RMMV.Skill_Progress);
  5159.  
  5160. /*----------------------------------------------------------------------------
  5161.  *    # Edit class: Game_Interpreter
  5162.  *      - Intercepts plugin command coming from this plugin as script calls
  5163.  *----------------------------------------------------------------------------*/
  5164.  
  5165. (function(SP) {
  5166.  
  5167.     "use strict";
  5168.  
  5169.     SP.Game_Interpreter = { orig: {}, new: {} };
  5170.     var _GI = SP.Game_Interpreter.orig, $ = Game_Interpreter.prototype;
  5171.     var _SP = SP.Game_Interpreter.new;
  5172.     _SP._CMDS = [
  5173.         "skillProgressCondDesc",
  5174.         "maxSkillProgress",
  5175.         "useGainSkillProgress",
  5176.         "hitGainSkillProgress",
  5177.         "nextSkillProgress",
  5178.         "isKeepSkillProgress",
  5179.         "currentSkillProgress",
  5180.         "setCurrentSkillProgress",
  5181.         "raiseAllSkillProgressNoteChangeFactors",
  5182.         "raiseSkillProgressNoteChangeFactor",
  5183.         "skillProgressNoteResult",
  5184.         "invalidateSkillProgressNoteResult"
  5185.     ];
  5186.  
  5187.     _GI.pluginCommand = $.pluginCommand;
  5188.     _SP.pluginCommand = $.pluginCommand = function(command, args) {
  5189.     // v1.00a - v1.00a; Extended
  5190.         _GI.pluginCommand.apply(this, arguments);
  5191.         // Added to invoke the plugin command from this plugin
  5192.         _SP._pluginCmd.call(this, command, args);
  5193.         //
  5194.     }; // $.pluginCommand
  5195.  
  5196.     /**
  5197.      * The this pointer is Game_Interpreter.prototype
  5198.      * @since v1.00a @version v1.00a
  5199.      * @param {String} cmd - The plugin command name
  5200.      * @param {[*]} args - The plugin command arguments
  5201.      */
  5202.     _SP._pluginCmd = function(cmd, args) {
  5203.         _SP._isPluginCmd.call(this, cmd) && _SP._usePluginCmd.call(this, args);
  5204.     }; // _SP._pluginCmd
  5205.  
  5206.     /**
  5207.      * The this pointer is Game_Interpreter.prototype
  5208.      * Nullipotent
  5209.      * @since v1.00a @version v1.00a
  5210.      * @param {String} cmd - The plugin command name
  5211.      * @returns {Boolean} The check result
  5212.      */
  5213.     _SP._isPluginCmd = function(cmd) { return _SP._CMDS.indexOf(cmd) >= 0; };
  5214.  
  5215.     /**
  5216.      * Script call's just another way of using plugin commands
  5217.      * The this pointer is Game_Interpreter.prototype
  5218.      * @since v1.00a @version v1.00a
  5219.      * @param {String} cmd - The plugin command name
  5220.      * @param {[*]} args - The plugin command arguments
  5221.      */
  5222.     _SP._usePluginCmd = function(cmd, args) {
  5223.         // The 1st argument must always be the id of the actor involved
  5224.         $gameActors.actor(+args.shift())[cmd].apply(this, args);
  5225.         //
  5226.     }; // _SP._usePluginCmd
  5227.  
  5228. })(DoubleX_RMMV.Skill_Progress);
  5229.  
  5230. /*----------------------------------------------------------------------------
  5231.  *    # Edit class: Window_SkillList
  5232.  *      - Shows the progress of skills to be progressed for the actor involved
  5233.  *----------------------------------------------------------------------------*/
  5234.  
  5235. (function(SP) {
  5236.  
  5237.     "use strict";
  5238.  
  5239.     SP.Window_SkillList = { orig: {}, new: {} };
  5240.     var _WS = SP.Window_SkillList.orig, $ = Window_SkillList.prototype;
  5241.     var _SP = SP.Window_SkillList.new;
  5242.  
  5243.     _WS.isEnabled = $.isEnabled;
  5244.     _SP.isEnabled = $.isEnabled = function(item) { // v1.00a - v1.00a; Extended
  5245.         // Added to show the progress of skills to be progressed for the actor
  5246.         if (_SP._isSkillProgress.call(this, item)) return true;
  5247.         //
  5248.         return _WS.isEnabled.apply(this, arguments);
  5249.     }; // $.isEnabled
  5250.  
  5251.     /**
  5252.      * The this pointer is Window_SkillList.prototype
  5253.      * Nullipotent
  5254.      * @since v1.00a @version v1.00a
  5255.      * @param {{*}} item - The skill to be selected by the actor
  5256.      * @returns {Boolean} The check result
  5257.      */
  5258.     _SP._isSkillProgress = function(item) {
  5259.         return this._actor.isSkillProgress(item.id);
  5260.     }; // _SP._isSkillProgress
  5261.  
  5262. })(DoubleX_RMMV.Skill_Progress);
  5263.  
  5264. /*----------------------------------------------------------------------------
  5265.  *    # New class: Window_SkillProgressCmd
  5266.  *      - Lets players choose to use the skill or view its progresses
  5267.  *----------------------------------------------------------------------------*/
  5268.  
  5269. (function(SP) {
  5270.  
  5271.     "use strict";
  5272.  
  5273.     var $ = Window_SkillProgressCmd.prototype =
  5274.             Object.create(Window_Command.prototype);
  5275.     $.constructor = Window_SkillProgressCmd;
  5276.  
  5277.     /*------------------------------------------------------------------------
  5278.      *    New private instance variable
  5279.      *------------------------------------------------------------------------*/
  5280.     // {Game_Actor} _actor: The actor owning this window
  5281.  
  5282.     /**
  5283.      * Idempotent
  5284.      * @constructor @since v1.00a @version v1.00a
  5285.      * @param {Game_Actor} actor - The actor using this window
  5286.      */
  5287.     $.initialize = function(actor) {
  5288.         // This must be run first or _makeCmdList would use a null actor
  5289.         this._actor = actor;
  5290.         //
  5291.         Window_Command.prototype.initialize.call(
  5292.                 this, this.windowX(), this.windowY());
  5293.         this.openness = 0; // This must be run here or the game would crash
  5294.         // This must be run last or the parent would activate the window again
  5295.         this.deactivate();
  5296.         //
  5297.     }; // $.initialize
  5298.  
  5299.     /**
  5300.      * Hotspot/Nullipotent
  5301.      * @interface @since v1.00a @version v1.00a
  5302.      * @returns {Number} The requested window line height
  5303.      */
  5304.     $.lineHeight = function() { return SP.params.cmdLineH.call(this); };
  5305.  
  5306.     /**
  5307.      * Hotspot/Nullipotent
  5308.      * @interface @since v1.00a @version v1.00a
  5309.      * @returns {Number} The requested window standard font size
  5310.      */
  5311.     $.standardFontSize = function() {
  5312.         return SP.params.cmdFontSize.call(this);
  5313.     }; // $.standardFontSize
  5314.  
  5315.     /**
  5316.      * Hotspot/Nullipotent
  5317.      * @interface @since v1.00a @version v1.00a
  5318.      * @returns {Number} The requested window standard padding
  5319.      */
  5320.     $.standardPadding = function() { return SP.params.cmdPadding.call(this); };
  5321.  
  5322.     /**
  5323.      * Hotspot/Nullipotent
  5324.      * @interface @since v1.00a @version v1.00a
  5325.      * @returns {Number} The requested window text padding
  5326.      */
  5327.     $.textPadding = function() { return SP.params.cmdTextPadding.call(this); };
  5328.  
  5329.     /**
  5330.      * Hotspot/Nullipotent
  5331.      * @interface @since v1.00a @version v1.00a
  5332.      * @returns {Number} The requested window standard back opacity
  5333.      */
  5334.     $.standardBackOpacity = function() {
  5335.         return SP.params.cmdBackOpacity.call(this);
  5336.     }; // $.standardBackOpacity
  5337.  
  5338.     /**
  5339.      * Hotspot/Nullipotent
  5340.      * @interface @since v1.00a @version v1.00a
  5341.      * @returns {Number} The requested window translucent opacity
  5342.      */
  5343.     $.translucentOpacity = function() {
  5344.         return SP.params.cmdTranslucentOpacity.call(this);
  5345.     }; // $.translucentOpacity
  5346.  
  5347.     /**
  5348.      * Hotspot/Nullipotent
  5349.      * @interface @since v1.00a @version v1.00a
  5350.      * @returns {Number} The requested window spacing
  5351.      */
  5352.     $.spacing = function() { return SP.params.cmdSpacing.call(this); };
  5353.  
  5354.     /**
  5355.      * Hotspot/Nullipotent
  5356.      * @interface @since v1.00a @version v1.00a
  5357.      * @returns {Number} The requested window width
  5358.      */
  5359.     $.windowWidth = function() { return SP.params.cmdWinW.call(this); };
  5360.  
  5361.     /**
  5362.      * Hotspot/Nullipotent
  5363.      * @interface @since v1.00a @version v1.00a
  5364.      * @returns {Number} The requested window height
  5365.      */
  5366.     $.windowHeight = function() { return SP.params.cmdWinH.call(this); };
  5367.  
  5368.     /**
  5369.      * Idempotent
  5370.      * @interface @since v1.00a @version v1.00a
  5371.      */
  5372.     $.makeCommandList = function() {
  5373.         // It's just to play safe
  5374.         Window_Command.prototype.makeCommandList.call(this);
  5375.         //
  5376.         this._makeCmdList();
  5377.     }; // $.makeCommandList
  5378.  
  5379.     /**
  5380.      * Idempotent
  5381.      * @interface @since v1.00a @version v1.00a
  5382.      */
  5383.     $.setup = function() {
  5384.         this.refresh();
  5385.         this.select(0);
  5386.         this.activate();
  5387.         this.open();
  5388.         this.show();
  5389.     }; // $.setup
  5390.  
  5391.     /**
  5392.      * Hotspot/Nullipotent
  5393.      * @interface @since v1.00a @version v1.00a
  5394.      * @returns {Number} The requested window x position
  5395.      */
  5396.     $.windowX = function() { return SP.params.cmdWinX.call(this); };
  5397.  
  5398.     /**
  5399.      * Hotspot/Nullipotent
  5400.      * @interface @since v1.00a @version v1.00a
  5401.      * @returns {Number} The requested window y position
  5402.      */
  5403.     $.windowY = function() { return SP.params.cmdWinY.call(this); };
  5404.  
  5405.     /**
  5406.      * Idempotent
  5407.      * @since v1.00a @version v1.00a
  5408.      */
  5409.     $._makeCmdList = function() {
  5410.         // These commands must be available or this window wouldn't be setup
  5411.         this.addCommand(SP.params.cmdView.call(this), "viewSkillProgress");
  5412.         //
  5413.         // This window wouldn't open if the skill isn't usable to begin with
  5414.         this.addCommand(SP.params.cmdUse.call(this), "use");
  5415.         //
  5416.     }; // $._makeCmdList
  5417.  
  5418. })(DoubleX_RMMV.Skill_Progress);
  5419.  
  5420. /*----------------------------------------------------------------------------
  5421.  *    # New class: Window_SkillProgressStat
  5422.  *      - Shows the skill current over max progression and keep current status
  5423.  *----------------------------------------------------------------------------*/
  5424.  
  5425. (function(SP) {
  5426.  
  5427.     "use strict";
  5428.  
  5429.     Window_SkillProgressStat.prototype =
  5430.             Object.create(Window_Selectable.prototype);
  5431.     var $ = Window_SkillProgressStat.prototype;
  5432.     $.constructor = Window_SkillProgressStat;
  5433.  
  5434.     /**
  5435.      * Idempotent
  5436.      * @constructor @since v1.00a @version v1.00a
  5437.      * @param {Game_Actor} actor - The actor using this window
  5438.      */
  5439.     $.initialize = function(actor) {
  5440.         this._actor = actor;
  5441.         Window_Selectable.prototype.initialize.call(this, this.windowX(),
  5442.                 this.windowY(), this.windowWidth(), this.windowHeight());
  5443.         this.openness = 0; // This must be run here or the game would crash
  5444.         // This must be run last or the parent would activate the window again
  5445.         this.deactivate();
  5446.         //
  5447.     }; // $.initialize
  5448.  
  5449.     /**
  5450.      * Hotspot/Nullipotent
  5451.      * @interface @since v1.00a @version v1.00a
  5452.      * @returns {Number} The requested window line height
  5453.      */
  5454.     $.lineHeight = function() { return SP.params.statLineH.call(this); };
  5455.  
  5456.     /**
  5457.      * Hotspot/Nullipotent
  5458.      * @interface @since v1.00a @version v1.00a
  5459.      * @returns {Number} The requested window standard font size
  5460.      */
  5461.     $.standardFontSize = function() {
  5462.         return SP.params.statFontSize.call(this);
  5463.     }; // $.standardFontSize
  5464.  
  5465.     /**
  5466.      * Hotspot/Nullipotent
  5467.      * @interface @since v1.00a @version v1.00a
  5468.      * @returns {Number} The requested window standard padding
  5469.      */
  5470.     $.standardPadding = function() { return SP.params.statPadding.call(this); };
  5471.  
  5472.     /**
  5473.      * Hotspot/Nullipotent
  5474.      * @interface @since v1.00a @version v1.00a
  5475.      * @returns {Number} The requested window text padding
  5476.      */
  5477.     $.textPadding = function() { return SP.params.statTextPadding.call(this); };
  5478.  
  5479.     /**
  5480.      * Hotspot/Nullipotent
  5481.      * @interface @since v1.00a @version v1.00a
  5482.      * @returns {Number} The requested window standard back opacity
  5483.      */
  5484.     $.standardBackOpacity = function() {
  5485.         return SP.params.statBackOpacity.call(this);
  5486.     }; // $.standardBackOpacity
  5487.  
  5488.     /**
  5489.      * Hotspot/Nullipotent
  5490.      * @interface @since v1.00a @version v1.00a
  5491.      * @returns {Number} The requested window translucent opacity
  5492.      */
  5493.     $.translucentOpacity = function() {
  5494.         return SP.params.statTranslucentOpacity.call(this);
  5495.     }; // $.translucentOpacity
  5496.  
  5497.     /**
  5498.      * Hotspot/Nullipotent
  5499.      * @interface @since v1.00a @version v1.00a
  5500.      * @returns {Number} The requested window spacing
  5501.      */
  5502.     $.spacing = function() { return SP.params.statSpacing.call(this); };
  5503.  
  5504.     /**
  5505.      * Hotspot/Nullipotent
  5506.      * @interface @since v1.00a @version v1.00a
  5507.      * @returns {Number} The requested window width
  5508.      */
  5509.     $.windowWidth = function() { return SP.params.statWinW.call(this); };
  5510.  
  5511.     /**
  5512.      * Hotspot/Nullipotent
  5513.      * @interface @since v1.00a @version v1.00a
  5514.      * @returns {Number} The requested window height
  5515.      */
  5516.     $.windowHeight = function() { return SP.params.statWinH.call(this); };
  5517.  
  5518.     /**
  5519.      * Hotspot/Nullipotent
  5520.      * @interface @since v1.00a @version v1.00a
  5521.      * @returns {Number} The requested window x position
  5522.      */
  5523.     $.windowX = function() { return SP.params.statWinX.call(this); };
  5524.  
  5525.     /**
  5526.      * Hotspot/Nullipotent
  5527.      * @interface @since v1.00a @version v1.00a
  5528.      * @returns {Number} The requested window y position
  5529.      */
  5530.     $.windowY = function() { return SP.params.statWinY.call(this); };
  5531.  
  5532.     /**
  5533.      * Idempotent
  5534.      * @interface @since v1.00a @version v1.00a
  5535.      * @param {Id} skillId - The id of the skill involved
  5536.      */
  5537.     $.setup = function(skillId) { if (this.contents) this._setup(skillId); };
  5538.  
  5539.     /**
  5540.      * Idempotent
  5541.      * @since v1.00a @version v1.00a
  5542.      * @param {Id} skillId - The id of the skill involved
  5543.      */
  5544.     $._setup = function(skillId) {
  5545.         this.contents.clear();
  5546.         this._drawStat(skillId);
  5547.         this._appear();
  5548.     }; // $._setup
  5549.  
  5550.     /**
  5551.      * Idempotent
  5552.      * @since v1.00a @version v1.00a
  5553.      * @param {Id} skillId - The id of the skill involved
  5554.      */
  5555.     $._drawStat = function(skillId) {
  5556.         var current = this._actor.currentSkillProgress(skillId);
  5557.         var max = this._actor.maxSkillProgress(skillId);
  5558.         var isKeep = this._actor.isKeepSkillProgress(skillId);
  5559.         SP.cfgs.drawStat.call(this, current, max, isKeep);
  5560.     }; // $._drawStat
  5561.  
  5562.     /**
  5563.      * Idempotent
  5564.      * @since v1.00a @version v1.00a
  5565.      */
  5566.     $._appear = function() {
  5567.         this.show();
  5568.         this.activate();
  5569.         this.open();
  5570.     }; // $._appear
  5571.  
  5572. })(DoubleX_RMMV.Skill_Progress);
  5573.  
  5574. /*----------------------------------------------------------------------------
  5575.  *    # New class: Window_SkillProgressCond
  5576.  *      - Shows the list of prerequisites to be met for progressing the skill
  5577.  *----------------------------------------------------------------------------*/
  5578.  
  5579. (function(SP) {
  5580.  
  5581.     "use strict";
  5582.  
  5583.     Window_SkillProgressCond.prototype =
  5584.             Object.create(Window_Selectable.prototype);
  5585.     var $ = Window_SkillProgressCond.prototype;
  5586.     $.constructor = Window_SkillProgressCond;
  5587.  
  5588.     /**
  5589.      * Idempotent
  5590.      * @constructor @since v1.00a @version v1.00a
  5591.      * @param {Game_Actor} actor - The actor using this window
  5592.      */
  5593.     $.initialize = function(actor) {
  5594.         this._actor = actor;
  5595.         Window_Selectable.prototype.initialize.call(this, this.windowX(),
  5596.                 this.windowY(), this.windowWidth(), this.windowHeight());
  5597.         this.openness = 0; // This must be run here or the game would crash
  5598.         // This must be run last or the parent would activate the window again
  5599.         this.deactivate();
  5600.         //
  5601.     }; // $.initialize
  5602.  
  5603.     /**
  5604.      * Hotspot/Nullipotent
  5605.      * @interface @since v1.00a @version v1.00a
  5606.      * @returns {Number} The requested window line height
  5607.      */
  5608.     $.lineHeight = function() { return SP.params.condLineH.call(this); };
  5609.  
  5610.     /**
  5611.      * Hotspot/Nullipotent
  5612.      * @interface @since v1.00a @version v1.00a
  5613.      * @returns {Number} The requested window standard font size
  5614.      */
  5615.     $.standardFontSize = function() {
  5616.         return SP.params.condFontSize.call(this);
  5617.     }; // $.standardFontSize
  5618.  
  5619.     /**
  5620.      * Hotspot/Nullipotent
  5621.      * @interface @since v1.00a @version v1.00a
  5622.      * @returns {Number} The requested window standard padding
  5623.      */
  5624.     $.standardPadding = function() { return SP.params.condPadding.call(this); };
  5625.  
  5626.     /**
  5627.      * Hotspot/Nullipotent
  5628.      * @interface @since v1.00a @version v1.00a
  5629.      * @returns {Number} The requested window text padding
  5630.      */
  5631.     $.textPadding = function() { return SP.params.condTextPadding.call(this); };
  5632.  
  5633.     /**
  5634.      * Hotspot/Nullipotent
  5635.      * @interface @since v1.00a @version v1.00a
  5636.      * @returns {Number} The requested window standard back opacity
  5637.      */
  5638.     $.standardBackOpacity = function() {
  5639.         return SP.params.condBackOpacity.call(this);
  5640.     }; // $.standardBackOpacity
  5641.  
  5642.     /**
  5643.      * Hotspot/Nullipotent
  5644.      * @interface @since v1.00a @version v1.00a
  5645.      * @returns {Number} The requested window translucent opacity
  5646.      */
  5647.     $.translucentOpacity = function() {
  5648.         return SP.params.condTranslucentOpacity.call(this);
  5649.     }; // $.translucentOpacity
  5650.  
  5651.     /**
  5652.      * Hotspot/Nullipotent
  5653.      * @interface @since v1.00a @version v1.00a
  5654.      * @returns {Number} The requested window spacing
  5655.      */
  5656.     $.spacing = function() { return SP.params.condSpacing.call(this); };
  5657.  
  5658.     /**
  5659.      * Hotspot/Nullipotent
  5660.      * @interface @since v1.00a @version v1.00a
  5661.      * @returns {Number} The requested window width
  5662.      */
  5663.     $.windowWidth = function() { return SP.params.condWinW.call(this); };
  5664.  
  5665.     /**
  5666.      * Hotspot/Nullipotent
  5667.      * @interface @since v1.00a @version v1.00a
  5668.      * @returns {Number} The requested window height
  5669.      */
  5670.     $.windowHeight = function() { return SP.params.condWinH.call(this); };
  5671.  
  5672.     /**
  5673.      * Hotspot/Nullipotent
  5674.      * @interface @since v1.00a @version v1.00a
  5675.      * @returns {Number} The requested window x position
  5676.      */
  5677.     $.windowX = function() { return SP.params.condWinX.call(this); };
  5678.  
  5679.     /**
  5680.      * Hotspot/Nullipotent
  5681.      * @interface @since v1.00a @version v1.00a
  5682.      * @returns {Number} The requested window y position
  5683.      */
  5684.     $.windowY = function() { return SP.params.condWinY.call(this); };
  5685.  
  5686.     /**
  5687.      * Idempotent
  5688.      * @interface @since v1.00a @version v1.00a
  5689.      * @param {Id} skillId - The id of the skill involved
  5690.      */
  5691.     $.setup = function(skillId) { if (this.contents) this._setup(skillId); };
  5692.  
  5693.     /**
  5694.      * Idempotent
  5695.      * @since v1.00a @version v1.00a
  5696.      * @param {Id} skillId - The id of the skill involved
  5697.      */
  5698.     $._setup = function(skillId) {
  5699.         this.contents.clear();
  5700.         var descs = this._actor.skillProgressCondDesc(skillId);
  5701.         Object.keys(descs).forEach(function(desc, i) {
  5702.             this._drawDesc(desc, descs[desc], i);
  5703.         }, this);
  5704.         this._appear();
  5705.     }; // $._setup
  5706.  
  5707.     /**
  5708.      * Idempotent
  5709.      * @since v1.00a @version v1.00a
  5710.      * @param {String} desc - The condition description
  5711.      * @param {Boolean} isMet - The condition status
  5712.      * @param {Number} i - The index of the description in the list involved
  5713.      */
  5714.     $._drawDesc = function(desc, isMet, i) {
  5715.         this.changePaintOpacity(isMet);
  5716.         var rect = this.itemRect(i);
  5717.         this.drawText(desc, rect.x, rect.y, rect.width);
  5718.     }; // $._drawDesc
  5719.  
  5720.     /**
  5721.      * Idempotent
  5722.      * @since v1.00a @version v1.00a
  5723.      */
  5724.     $._appear = function() {
  5725.         this.show();
  5726.         this.activate();
  5727.         this.open();
  5728.     }; // $._appear
  5729.  
  5730. })(DoubleX_RMMV.Skill_Progress);
  5731.  
  5732. /*----------------------------------------------------------------------------
  5733.  *    # New class: Window_SkillProgressNext
  5734.  *      - Shows the list of skills to be learnt upon progressing the current
  5735.  *----------------------------------------------------------------------------*/
  5736.  
  5737. (function(SP) {
  5738.  
  5739.     "use strict";
  5740.  
  5741.     Window_SkillProgressNext.prototype =
  5742.             Object.create(Window_Selectable.prototype);
  5743.     var $ = Window_SkillProgressNext.prototype, $$ = Window_SkillList.prototype;
  5744.     $.constructor = Window_SkillProgressNext;
  5745.  
  5746.     /**
  5747.      * Idempotent
  5748.      * @constructor @since v1.00a @version v1.00a
  5749.      * @param {Game_Actor} actor - The actor using this window
  5750.      */
  5751.     $.initialize = function(actor) {
  5752.         this._actor = actor;
  5753.         Window_Selectable.prototype.initialize.call(this, this.windowX(),
  5754.                 this.windowY(), this.windowWidth(), this.windowHeight());
  5755.         this.openness = 0; // This must be run here or the game would crash
  5756.         // This must be run last or the parent would activate the window again
  5757.         this.deactivate();
  5758.         //
  5759.     }; // $.initialize
  5760.  
  5761.     /**
  5762.      * Hotspot/Nullipotent
  5763.      * @interface @since v1.00a @version v1.00a
  5764.      * @returns {Number} The requested window line height
  5765.      */
  5766.     $.lineHeight = function() { return SP.params.nextLineH.call(this); };
  5767.  
  5768.     /**
  5769.      * Hotspot/Nullipotent
  5770.      * @interface @since v1.00a @version v1.00a
  5771.      * @returns {Number} The requested window standard font size
  5772.      */
  5773.     $.standardFontSize = function() {
  5774.         return SP.params.nextFontSize.call(this);
  5775.     }; // $.standardFontSize
  5776.  
  5777.     /**
  5778.      * Hotspot/Nullipotent
  5779.      * @interface @since v1.00a @version v1.00a
  5780.      * @returns {Number} The requested window standard padding
  5781.      */
  5782.     $.standardPadding = function() { return SP.params.nextPadding.call(this); };
  5783.  
  5784.     /**
  5785.      * Hotspot/Nullipotent
  5786.      * @interface @since v1.00a @version v1.00a
  5787.      * @returns {Number} The requested window text padding
  5788.      */
  5789.     $.textPadding = function() { return SP.params.nextTextPadding.call(this); };
  5790.  
  5791.     /**
  5792.      * Hotspot/Nullipotent
  5793.      * @interface @since v1.00a @version v1.00a
  5794.      * @returns {Number} The requested window standard back opacity
  5795.      */
  5796.     $.standardBackOpacity = function() {
  5797.         return SP.params.nextBackOpacity.call(this);
  5798.     }; // $.standardBackOpacity
  5799.  
  5800.     /**
  5801.      * Hotspot/Nullipotent
  5802.      * @interface @since v1.00a @version v1.00a
  5803.      * @returns {Number} The requested window translucent opacity
  5804.      */
  5805.     $.translucentOpacity = function() {
  5806.         return SP.params.nextTranslucentOpacity.call(this);
  5807.     }; // $.translucentOpacity
  5808.  
  5809.     /**
  5810.      * Hotspot/Nullipotent
  5811.      * @interface @since v1.00a @version v1.00a
  5812.      * @returns {Number} The requested window spacing
  5813.      */
  5814.     $.spacing = function() { return SP.params.nextSpacing.call(this); };
  5815.  
  5816.     /**
  5817.      * Hotspot/Nullipotent
  5818.      * @interface @since v1.00a @version v1.00a
  5819.      * @returns {Number} The requested window width
  5820.      */
  5821.     $.windowWidth = function() { return SP.params.nextWinW.call(this); };
  5822.  
  5823.     /**
  5824.      * Hotspot/Nullipotent
  5825.      * @interface @since v1.00a @version v1.00a
  5826.      * @returns {Number} The requested window height
  5827.      */
  5828.     $.windowHeight = function() { return SP.params.nextWinH.call(this); };
  5829.  
  5830.     /**
  5831.      * Hotspot/Nullipotent
  5832.      * @interface @since v1.00a @version v1.00a
  5833.      * @returns {Number} The requested window x position
  5834.      */
  5835.     $.windowX = function() { return SP.params.nextWinX.call(this); };
  5836.  
  5837.     /**
  5838.      * Hotspot/Nullipotent
  5839.      * @interface @since v1.00a @version v1.00a
  5840.      * @returns {Number} The requested window y position
  5841.      */
  5842.     $.windowY = function() { return SP.params.nextWinY.call(this); };
  5843.  
  5844.     /**
  5845.      * Idempotent
  5846.      * @interface @since v1.00a @version v1.00a
  5847.      * @param {Id} skillId - The id of the skill involved
  5848.      */
  5849.     $.setup = function(skillId) { if (this.contents) this._setup(skillId); };
  5850.  
  5851.     /**
  5852.      * Idempotent
  5853.      * @since v1.00a @version v1.00a
  5854.      * @param {Id} skillId - The id of the skill involved
  5855.      */
  5856.     $._setup = function(skillId) {
  5857.         this.contents.clear();
  5858.         this._data = this._actor.nextSkillProgress(skillId).map(function(ids) {
  5859.             return $dataSkills[ids];
  5860.         });
  5861.         this._data.forEach(this._drawNext, this);
  5862.         this._appear();
  5863.     }; // $._setup
  5864.  
  5865.     /**
  5866.      * Idempotent
  5867.      * @since v1.00a @version v1.00a
  5868.      * @param {{}} skill - The data of the skill involved
  5869.      * @param {Number} i - The index of the id of the skill in the list involved
  5870.      */
  5871.     $._drawNext = function(skill, i) { $$.drawItem.call(this, i); };
  5872.  
  5873.     // Reuses the Window_SkillList one so it should be treated as private
  5874.     $.costWidth = function() { return $$.costWidth.call(this); };
  5875.  
  5876.     // Reuses the Window_SkillList one so it should be treated as private
  5877.     $.isEnabled = function(skill) { return $$.isEnabled.call(this, skill); };
  5878.  
  5879.     // Reuses the Window_SkillList one so it should be treated as private
  5880.     $.drawSkillCost = function(skill, x, y, width) {
  5881.         $$.drawSkillCost.call(this, skill, x, y, width);
  5882.     }; // $.drawSkillCost
  5883.  
  5884.     /**
  5885.      * Idempotent
  5886.      * @since v1.00a @version v1.00a
  5887.      */
  5888.     $._appear = function() {
  5889.         this.show();
  5890.         this.activate();
  5891.         this.open();
  5892.     }; // $._appear
  5893.  
  5894. })(DoubleX_RMMV.Skill_Progress);
  5895.  
  5896. /*----------------------------------------------------------------------------
  5897.  *    # Edit class: Scene_Skill
  5898.  *      - Shows the progress of skills to be progressed for the actor involved
  5899.  *----------------------------------------------------------------------------*/
  5900.  
  5901. (function(SP) {
  5902.  
  5903.     "use strict";
  5904.  
  5905.     SP.Scene_Skill = { orig: {}, new: {} };
  5906.     var _SS = SP.Scene_Skill.orig, _SP = SP.Scene_Skill.new;
  5907.     var _WS = SP.Window_SkillList.orig, $ = Scene_Skill.prototype;
  5908.  
  5909.     /*------------------------------------------------------------------------
  5910.      *    New private instance variables
  5911.      *------------------------------------------------------------------------*/
  5912.     // {{*}} _skillProgress: The container of all other new variables
  5913.     //       {Window_SkillProgressCmd} cmdWin: The skill progress command window
  5914.     //       {Window_SkillProgressCond} cmdWin: The skill progress cond window
  5915.     //       {Window_SkillProgressNext} cmdWin: The skill progress next window
  5916.  
  5917.     _SS.create = $.create;
  5918.     _SP.create = $.create = function() { // v1.00a - v1.00a; Extended
  5919.         _SS.create.apply(this, arguments);
  5920.         _SP._createWins.call(this); // Added to create the progress windows
  5921.     }; // $.create
  5922.  
  5923.     _SS.onItemOk = $.onItemOk;
  5924.     _SP.onItemOk = $.onItemOk = function() { // v1.00a - v1.00a; Extended
  5925.         // Edited to show the progress of the skill to be progressed or use it
  5926.         var enabled = _WS.isEnabled.call(this._itemWindow, this.item());
  5927.         var progress = _SP._isSkillProgress.call(this);
  5928.         if (enabled && progress) return this._skillProgress.cmdWin.setup();
  5929.         if (enabled && !progress) return _SS.onItemOk.apply(this, arguments);
  5930.         if (!enabled && progress) _SP._showSkillProgress.call(this);
  5931.         //
  5932.     }; // $.onItemOk
  5933.  
  5934.     /**
  5935.      * The this pointer is Scene_Skill.prototype
  5936.      * Idempotent
  5937.      * @since v1.00a @version v1.00a
  5938.      */
  5939.     _SP._createWins = function() {
  5940.         this._skillProgress = {};
  5941.         ["cmdWin", "statWin", "condWin", "nextWin"].forEach(
  5942.                 _SP._createWin, this);
  5943.     }; // _SP._createWins
  5944.  
  5945.     /**
  5946.      * The this pointer is Scene_Skill.prototype
  5947.      * Idempotent
  5948.      * @since v1.00a @version v1.00a
  5949.      * @param {String} win - The name of the window to be created
  5950.      */
  5951.     _SP._createWin = function(win) {
  5952.         this._skillProgress[win] = _SP["_" + win].call(this);
  5953.         this.addWindow(this._skillProgress[win]);
  5954.     }; // _SP._createWin
  5955.  
  5956.     /**
  5957.      * The this pointer is Scene_Skill.prototype
  5958.      * Nullipotent
  5959.      * @since v1.00a @version v1.00a
  5960.      * @returns {Window_SkillProgressCmd} The requested progress command window
  5961.      */
  5962.     _SP._cmdWin = function() {
  5963.         var win = new Window_SkillProgressCmd(this.user());
  5964.         win.setHandler("viewSkillProgress", _SP._showSkillProgress.bind(this));
  5965.         win.setHandler("use", _SP._onUse.bind(this));
  5966.         win.setHandler("cancel", _SP._onWinCancel.bind(this, "cmdWin"));
  5967.         win.deselect();
  5968.         return win;
  5969.     }; // _SP._cmdWin
  5970.  
  5971.     /**
  5972.      * The this pointer is Scene_Skill.prototype
  5973.      * Nullipotent
  5974.      * @since v1.00a @version v1.00a
  5975.      * @returns {Window_SkillProgressStat} The requested progress stat window
  5976.      */
  5977.     _SP._statWin = function() {
  5978.         return _SP._statCondNextWin.call(this, Window_SkillProgressStat);
  5979.     }; // _SP._statWin
  5980.  
  5981.     /**
  5982.      * The this pointer is Scene_Skill.prototype
  5983.      * Nullipotent
  5984.      * @since v1.00a @version v1.00a
  5985.      * @returns {Window_SkillProgressCond} The requested progress cond window
  5986.      */
  5987.     _SP._condWin = function() {
  5988.         return _SP._statCondNextWin.call(this, Window_SkillProgressCond);
  5989.     }; // _SP._condWin
  5990.  
  5991.     /**
  5992.      * The this pointer is Scene_Skill.prototype
  5993.      * Nullipotent
  5994.      * @since v1.00a @version v1.00a
  5995.      * @returns {Window_SkillProgressNext} The requested progress next window
  5996.      */
  5997.     _SP._nextWin = function() {
  5998.         return _SP._statCondNextWin.call(this, Window_SkillProgressNext);
  5999.     }; // _SP._nextWin
  6000.  
  6001.     /**
  6002.      * The this pointer is Scene_Skill.prototype
  6003.      * Nullipotent
  6004.      * @since v1.00a @version v1.00a
  6005.      * @param {Window_Selectable} Win - The progress cond/next win constructor
  6006.      * @returns {Window_Selectable} The requested progress cond/next window
  6007.      */
  6008.     _SP._statCondNextWin = function(Win) {
  6009.         var win = new Win(this.user());
  6010.         win.setHandler("cancel", _SP._onStatCondNextWinCancel.bind(this));
  6011.         win.deselect();
  6012.         return win;
  6013.     }; // _SP._statCondNextWin
  6014.  
  6015.     /**
  6016.      * The this pointer is Scene_Skill.prototype
  6017.      * Nullipotent
  6018.      * @since v1.00a @version v1.00a
  6019.      * @returns {Boolean} The check result
  6020.      */
  6021.     _SP._isSkillProgress = function() {
  6022.         return this.actor().isSkillProgress(this.item().id);
  6023.     }; // _SP._isSkillProgress
  6024.  
  6025.     /**
  6026.      * The this pointer is Scene_Skill.prototype
  6027.      * Idempotent
  6028.      * @since v1.00a @version v1.00a
  6029.      */
  6030.     _SP._showSkillProgress = function() {
  6031.         _SP._onWinCancel.call(this, "cmdWin");
  6032.         var skillId = this.item().id;
  6033.         ["statWin", "condWin", "nextWin"].forEach(function(win) {
  6034.             this._skillProgress[win].setup(skillId);
  6035.         }, this);
  6036.         // Otherwise the item window would handle the cancel button instead
  6037.         this._itemWindow.deactivate();
  6038.         //
  6039.     }; // _SP._showSkillProgress
  6040.  
  6041.     /**
  6042.      * The this pointer is Scene_Skill.prototype
  6043.      * Idempotent
  6044.      * @since v1.00a @version v1.00a
  6045.      */
  6046.     _SP._onUse = function() {
  6047.         _SP._onWinCancel.call(this, "cmdWin");
  6048.         // Otherwise the item window would be active when calling determineItem
  6049.         this._itemWindow.deactivate();
  6050.         //
  6051.         _SS.onItemOk.call(this);
  6052.     }; // _SP._onUse
  6053.  
  6054.     /**
  6055.      * The this pointer is Scene_Skill.prototype
  6056.      * Idempotent
  6057.      * @since v1.00a @version v1.00a
  6058.      */
  6059.     _SP._onStatCondNextWinCancel = function() {
  6060.         ["statWin", "condWin", "nextWin"].forEach(_SP._onWinCancel, this);
  6061.     }; // _SP._onStatCondNextWinCancel
  6062.  
  6063.     /**
  6064.      * The this pointer is Scene_Skill.prototype
  6065.      * Idempotent
  6066.      * @since v1.00a @version v1.00a
  6067.      * @param {String} win - The name of the window to be closed
  6068.      */
  6069.     _SP._onWinCancel = function(win) {
  6070.         this.hideSubWindow(this._skillProgress[win]);
  6071.         this._skillProgress[win].close();
  6072.     }; // _SP._onWinCancel
  6073.  
  6074. })(DoubleX_RMMV.Skill_Progress);
  6075.  
  6076. /*============================================================================*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement