Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // ExpRatebyParameters
- //=============================================================================
- /*:
- * @plugindesc Parameters can increase EXP rate.
- *
- *
- * <Musashi MV_Plugin>
- * @param Parameter
- * @desc Which parameter the experience rate is based on. Goes from 0(MHP) to 7(Luck).
- * @default 4
- * @param Rate
- * @desc Percentual increased by each parameter point (1 = +1% exp for every parameter point)
- * @default 1
- */
- (function() {
- var _Game_Actor_gainExp_update = Game_Actor.prototype.gainExp.update;
- Game_Actor.prototype.gainExp = function(exp) {
- var newExp = this.currentExp() + Math.round(exp * this.finalExpRate() * this.attributeRate());
- this.changeExp(newExp, this.shouldDisplayLevelUp());
- };
- Game_Actor.prototype.attributeRate = function() {
- var parameters = $plugins.filter(function(p) { return p.description.contains('<Musashi MV_Plugin>'); })[0].parameters;
- //Choose parameter / 0 = MHP, 1 = MMP, 2 = ATK, 3 = DEF, 4 = MATK, 5 = MDEF, 6 = AGI, 7 = Luck
- var paramInt = Number(parameters['Attribute'] || 4);
- // 0.01 = 1%
- paramPercentage = Number(parameters['Rate']/100 || 0.01);
- var rateParam = this.param(paramInt) * paramPercentage;
- return this.exr * (1 + rateParam);
- };
- })();
Advertisement
Add Comment
Please, Sign In to add comment