ezmash

Heal on Level Up (MV)

Oct 25th, 2015
4,547
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Heal on Level Up
  3. // by Shaz
  4. // Last Update: 2015.10.25
  5. //=============================================================================
  6.  
  7. /*:
  8.  * @plugindesc Allows you to heal actors on level up
  9.  * @author Shaz
  10.  *
  11.  * @param All HP
  12.  * @desc Heal HP for all party members (Y/N)
  13.  * @default Y
  14.  *
  15.  * @param All MP
  16.  * @desc Heal MP for all party members (Y/N)
  17.  * @default Y
  18.  *
  19.  * @param All States
  20.  * @desc Remove states for all party members (Y/N)
  21.  * @default Y
  22.  *
  23.  * @help This plugin does not provide plugin commands
  24.  *
  25.  * If you only want to set SOME actors to have the above properties, add
  26.  * the following tags to the actor notebox:
  27.  * <LUHealHP>
  28.  * <LUHealMP>
  29.  * <LUHealStates>
  30.  */
  31.  
  32. (function() {
  33.  
  34.   var parameters = PluginManager.parameters('HealOnLevelUp');
  35.   var healHP = (parameters['All HP'].toUpperCase() || '') === 'Y';
  36.   var healMP = (parameters['All MP'].toUpperCase() || '') === 'Y';
  37.   var healStates = (parameters['All States'].toUpperCase() || '') === 'Y';
  38.  
  39.   var _Game_Actor_levelUp = Game_Actor.prototype.levelUp;
  40.   Game_Actor.prototype.levelUp = function() {
  41.     _Game_Actor_levelUp.call(this);
  42.  
  43.     if (healHP || this.actor().meta.LUHealHP) {
  44.       this._hp = this.mhp;
  45.     }
  46.  
  47.     if (healMP || this.actor().meta.LUHealMP) {
  48.       this._mp = this.mmp;
  49.     }
  50.  
  51.     if (healStates || this.actor().meta.LUHealStates) {
  52.       this.clearStates();
  53.     }
  54.   };
  55.  
  56.  
  57. })();
RAW Paste Data