21 lines
686 B
JavaScript
21 lines
686 B
JavaScript
/*:
|
|
* @target MZ
|
|
* @plugindesc [MZ] レベルアップ時にHP・MPを50%回復
|
|
* @author you
|
|
* @help
|
|
* アクターがレベルアップした際に、現在HP・MPを最大値の50%分だけ回復します。
|
|
* すでに満タンの場合は上限を超えません。
|
|
*
|
|
* 戦闘中・メニュー中いずれでも有効です。
|
|
*/
|
|
|
|
(() => {
|
|
const _Game_Actor_levelUp = Game_Actor.prototype.levelUp;
|
|
Game_Actor.prototype.levelUp = function() {
|
|
_Game_Actor_levelUp.call(this);
|
|
const hpRecover = Math.floor(this.mhp * 0.5);
|
|
const mpRecover = Math.floor(this.mmp * 0.5);
|
|
this.gainHp(hpRecover);
|
|
this.gainMp(mpRecover);
|
|
};
|
|
})();
|