Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // Maliki's Level Based Experience Point Boost
- // MalLevelexpBoost.js
- // version 1.0
- //=============================================================================
- /*:
- * @plugindesc Version 1.0 Allows devs to implement a slight curve on Exp gain
- * based on actor level.
- * @author Maliki79
- * @help You need two steps to use this plugin:
- * 1: Create an Enemy troop
- * 2: Use a Script Call during turn 0 - 0 to set Enemy "Level" to base curve on.
- *
- * To use this, you first set an enemy troop level. (This plugin will not work
- * with individual enemy levels) By default, RPG Maker MV does not give enemies
- * levels, so we must set them per troop via a script call.
- *
- * $gameParty.setEnemyLevel(x);
- * with x being a positive integer.
- *
- * After battle, this number will be compared against each actor's level and a bonus
- * will be granted based on the difference.
- * For each level higher the troop is than an actor, 10% exp gain will be added.
- * Conversly, every level below will reduce the gain by 10%.
- * There is no cap to how much it is rasied, but the lowest it currently will go is
- * 10%.
- * (If there is no number set at the start of battle, the troop level will be set to
- * the actor team's average level.)
- *
- * Note that while you technically do not need it, without YF's VictoryAftermath
- * plugin, you won't see the difference in exp gain between actors.
- */
- Game_Party.prototype.averageLevel = function() {
- var level = 0;
- for (var i = 0; i < this.members().length; ++i) {
- var member = this.members()[i];
- if (member) level += member.level;
- }
- level /= this.members().length;
- return level;
- };
- var MalStartBattle = BattleManager.startBattle;
- BattleManager.startBattle = function() {
- MalStartBattle.call(this);
- $gameParty._troupeLevel = Number($gameParty.averageLevel());
- };
- Game_Party.prototype.setEnemyLevel = function(tLevel) {
- var level = Number(tLevel);
- this._troupeLevel = level;
- };
- BattleManager.gainExp = function() {
- var exp = this._rewards.exp;
- var diff = 0;
- $gameParty.allMembers().forEach(function(actor) {
- diff = 1 + (($gameParty._troupeLevel - actor._level) * 0.1);
- if (diff < 0.1) diff = 0.1;
- var finalNum = Math.round(exp * diff);
- actor.gainExp(finalNum);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement