You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ycrpg/js/plugins/SF_ReserveMemberExp.js

72 lines
2.7 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

//=============================================================================
// SaltedFish Plugins - Exp For Reserve Member
// SF_ReserveMemberExp.js
//=============================================================================
"use strict";
var Imported = Imported || {};
Imported.SF_ReserveMemberExp = true;
var SF_Plugins = SF_Plugins || {};
//=============================================================================
/*:
* @plugindesc 支持队伍中的预备队员在战斗时,按照比例获得经验值
* @version 1.0
* @author SaltedFish
*
* @text 经验值比例
* @param Rate
* @desc 预备队员获得经验值的比例0-100 的整数,表示百分比
* @default 50
* @type number
* @min 0
* @max 100
* @decimals 0
*
* @help
* ============================================================================
* 介绍
* ============================================================================
*
* 这个插件支持队伍中的预备队员在战斗时,按照比例获得经验值
*
* ============================================================================
* 插件命令
* ============================================================================
*
* SF_ReserveMemberExp rate
* 设置预备队员获得经验值的比例rate 为 0-100 的整数,表示百分比
*/
//=============================================================================
(function () {
var SF_ReserveMemberExp = SF_Plugins.SF_ReserveMemberExp || {};
SF_Plugins.SF_ReserveMemberExp = SF_ReserveMemberExp;
SF_ReserveMemberExp.parameters = PluginManager.parameters("SF_ReserveMemberExp");
SF_ReserveMemberExp.rate = Number(SF_ReserveMemberExp.parameters["Rate"]);
SF_ReserveMemberExp.Game_System_initialize = Game_System.prototype.initialize;
Game_System.prototype.initialize = function () {
SF_ReserveMemberExp.Game_System_initialize.call(this);
this._reserveMemberExpRate = SF_ReserveMemberExp.rate;
};
SF_ReserveMemberExp.BattleManager_benchMembersExpRate = BattleManager.benchMembersExpRate;
BattleManager.benchMembersExpRate = function () {
var rate = SF_ReserveMemberExp.BattleManager_benchMembersExpRate.call(this);
var systemRate = $gameSystem._reserveMemberExpRate / 100;
return rate * systemRate;
};
SF_ReserveMemberExp.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
SF_ReserveMemberExp.Game_Interpreter_pluginCommand.call(this, command, args);
if (command === "SF_ReserveMemberExp") {
$gameSystem._reserveMemberExpRate = Number(args[0]);
}
};
})();