Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*:
  2.  * @plugindesc Heal up hp/mp from actors on lvl up
  3.  * @author Alejandro López
  4.  *
  5.  * @param % of HP
  6.  * @desc Percentage to heal up the health point on level up, set 0 to disable
  7.  * @default 100
  8.  *
  9.  * @param % of MP
  10.  * @desc Percentage to heal up the magic point on level up, set 0 to disable
  11.  * @default 100
  12.  *
  13.  * @param Value of HP
  14.  * @desc Value to heal up the health point on level up, set 0 to disable
  15.  * @default 0
  16.  *
  17.  * @param Value of MP
  18.  * @desc Value to heal up the magic point on level up, set 0 to disable
  19.  * @default 0
  20.  */
  21.  
  22. (function() {
  23.     var parameters = PluginManager.parameters('HealOnLvUp');
  24.  
  25.     Game_Actor.prototype.levelUp = function() {
  26.         this._level++;
  27.         this.currentClass().learnings.forEach(function(learning) {
  28.             if (learning.level === this._level) {
  29.                 this.learnSkill(learning.skillId);
  30.             }
  31.         }, this);
  32.         for (var i = 0; i < $gameActors.length; i++) {
  33.             $gameActors.actor(i).gainHP($gameActors.actor(i).mhp);
  34.             $gameActors.actor(i).gainHP($gameActors.actor(i).mmp);
  35.         };
  36.     };
  37.  
  38. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement