Project1
标题:
如何平分经验?
[打印本页]
作者:
沈大师
时间:
前天 19:29
标题:
如何平分经验?
RPG Maker MZ 的战后经验平分似乎是谁打死了怪谁获得经验,所以游戏进行到后面会导致主C的等级特别高,而辅助等级几乎只能停留在初始等级,
请问有没有能让战后经验平分的方法,十分感谢!
作者:
小秋橙
时间:
前天 22:37
不对啊,MZ默认好像是所有人获得同样多经验呀,就在 rmmz_managers.js 第 3000 行左右。楼主是不是用了别的插件导致的?
BattleManager.processVictory = function() {
$gameParty.removeBattleStates();
$gameParty.performVictory();
this.playVictoryMe();
this.replayBgmAndBgs();
this.makeRewards();
this.displayVictoryMessage();
this.displayRewards();
this.gainRewards();
this.endBattle(0);
};
BattleManager.makeRewards = function() {
this._rewards = {
gold: $gameTroop.goldTotal(),
exp: $gameTroop.expTotal(),
items: $gameTroop.makeDropItems()
};
};
BattleManager.displayVictoryMessage = function() {
$gameMessage.add(TextManager.victory.format($gameParty.name()));
};
BattleManager.displayRewards = function() {
this.displayExp();
this.displayGold();
this.displayDropItems();
};
BattleManager.displayExp = function() {
const exp = this._rewards.exp;
if (exp > 0) {
const text = TextManager.obtainExp.format(exp, TextManager.exp);
$gameMessage.add("\\." + text);
}
};
BattleManager.displayGold = function() {
const gold = this._rewards.gold;
if (gold > 0) {
$gameMessage.add("\\." + TextManager.obtainGold.format(gold));
}
};
BattleManager.displayDropItems = function() {
const items = this._rewards.items;
if (items.length > 0) {
$gameMessage.newPage();
for (const item of items) {
$gameMessage.add(TextManager.obtainItem.format(item.name));
}
}
};
BattleManager.gainRewards = function() {
this.gainExp();
this.gainGold();
this.gainDropItems();
};
BattleManager.gainExp = function() {
const exp = this._rewards.exp;
for (const actor of $gameParty.allMembers()) {
actor.gainExp(exp);
}
};
BattleManager.gainGold = function() {
$gameParty.gainGold(this._rewards.gold);
};
BattleManager.gainDropItems = function() {
const items = this._rewards.items;
for (const item of items) {
$gameParty.gainItem(item, 1);
}
};
复制代码
如果没有的话那就只有一个原因,那些辅助不在队伍里、或者在队伍里但是没有出战。需要修改以下代码来解决,在 rmmz_objects.js 第 4570 行左右。
Game_Actor.prototype.gainExp = function(exp) {
const newExp = this.currentExp() + Math.round(exp * this.finalExpRate());
this.changeExp(newExp, this.shouldDisplayLevelUp());
};
Game_Actor.prototype.finalExpRate = function() {
return this.exr * (this.isBattleMember() ? 1 : this.benchMembersExpRate());
};
Game_Actor.prototype.benchMembersExpRate = function() {
return $dataSystem.optExtraExp ? 1 : 0;
};
复制代码
也可以看一下是不是主C的 exr 属性(经验值倍率)太高了,比如有的插件会根据战斗内的杀敌数临时调整该属性。
作者:
沈大师
时间:
昨天 10:50
小秋橙 发表于 2025-7-25 22:37
不对啊,MZ默认好像是所有人获得同样多经验呀,就在 rmmz_managers.js 第 3000 行左右。楼主是不是用了别的 ...
我去看了一下,确实是插件的问题,太感谢了!
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1