じ☆ve冰风 发表于 2026-7-25 21:43:04

First plugin - recover all on level up

Script Name+Version Number:  DSR_plugin v0.1



Creator name: DSR
​


                 
​


Introduction
​


                Include script in plugin manager (placing .js file in the js/plugin folder naturally)
​


                By default, it will enable the recover all on level up.  Change parameter to false (or just turn plugin off or remove it) to disable this feature
​


                 
​


Features
​


                - When an actor levels up, all of their depleted HP MP (and whatever else) will be recovered
​


                 
​


Screenshots
​


                none
​


                 
​


How to Use
​


                See above.  Pretty much just plug and play, no dependencies and shouldn't interfere with other plugins.  No guarantees though.
​


                 
​


Demo
​


                none
​


                 
​


Script
​


                 
​

                Code:       
//=============================================================================
// DSR - plugin
// DSR_plugin.js
// I totally copied all the coding conventions from the Yanfly plugins,
// sorry for biting your style!  I hope you feel, as I do, that
// imitation is the sincerest form of flattery.
//=============================================================================
var Imported = Imported || {};
Imported.DSR_plugin = true;
var DSR = DSR || {};
DSR.plugin = DSR.plugin || {};
DSR.plugin.version = 0.1;
//=============================================================================
/*:
 * @plugindesc adds some functionality I wanted to see.
 * @author DSR
 * @param Restore all on level up
 * @desc run restore all on level up? true or false
 * Default: true
 * @default true
 * @help you're pretty much on your own with this one
 */
//=============================================================================
DSR.Parameters = PluginManager.parameters('DSR_plugin');
DSR.Param = DSR.Param || {};
DSR.Param.RestoreAllOnLevelUp = String(DSR.Parameters['Restore all on level up']);
DSR.Param.RestoreAllOnLevelUp = eval(DSR.Param.RestoreAllOnLevelUp);
DSR.plugin.levelUp = Game_Actor.prototype.levelUp;
Game_Actor.prototype.levelUp = function(){
DSR.plugin.levelUp.call(this);
if (DSR.Param.RestoreAllOnLevelUp) this.recoverAll();
};



FAQ
​


                 
​


                Q: Why did you make this plugin?
​


                A: I tried to find a built in way to make this happen, and couldn't find one (please tell me if I missed it) so this is what happened.
​


                 
​


                Q: Limitations on use?
​


                A: Free to use for any purpose, no matter how offensive to god, man, or nature.
​


                 
​


Credit and Thanks
​


                - Author: DSR
​


                - Mad props to Yanfly, as noted in the script I heavily emulated the conventions and style from the Yanfly series of plugins.
​


                 
​


Author's Notes
​


                None yet, please provide feedback.
​




本贴来自国际rpgmaker官方论坛作者:DSR处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/first-plugin-recover-all-on-level-up.72556/
页: [1]
查看完整版本: First plugin - recover all on level up