Double_X

DoubleX RMMV Skill Progress v100a

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