Skip to content

Instantly share code, notes, and snippets.

@TakkunMaker
Last active March 31, 2017 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TakkunMaker/6828e5d1fae5436c70802ba32dc5d87e to your computer and use it in GitHub Desktop.
Save TakkunMaker/6828e5d1fae5436c70802ba32dc5d87e to your computer and use it in GitHub Desktop.
//=============================================================================
// Garnet LevelUP Animation.js
//=============================================================================
/*:
* @plugindesc Adds an animation when level up.
* @author Takkun
*
* @help This plugin does not provide plugin commands.
*
* @param Animation ID
* @desc Set the animation that will be displayed when you level up (Based on the database).
* @default 41
* @param Recover All
* @desc Recover All status when level up (true/false).
* @default true
*/
//(function() {
(function() {
var GarnetlvlParams = PluginManager.parameters('Garnet LevelUP Animation');
var GarnetlvlAnimation = Number(GarnetlvlParams['Animation ID'] || 41);
var GarnetlvlRecover = Boolean(GarnetlvlParams['Recover All'] === "true" ? true : false);
Game_Actor.prototype.levelUp = function() {
$gamePlayer.requestAnimation(GarnetlvlAnimation);
this._level++;
this.currentClass().learnings.forEach(function(learning) {
if (learning.level === this._level) {
this.learnSkill(learning.skillId);
}
}, this);
if (GarnetlvlRecover == true) {
this.recoverAll();
}
};}
)();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment