查看: 2817|回复: 13

[有事请教] 如何制作【经验箱子】这一功能?

[复制链接]
梦石
0
星屑
5269
在线时间
733 小时
注册时间
2013-1-18
回帖
525
发表于 2022-11-29 11:42:28 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
思路一:每次战斗后,经验并不会分配给队友,而是自动存储到【经验箱子】里,由玩家手动分配(可以平均分配,也可以只分配给几个人或一个人)

思路二:每次战斗后,经验平均分配,但是会有一少部分额外经验自动存储到【经验箱子】里,由玩家手动分配(也可以平均分配,也可以只分配给几个人或一个人)

这种想法能实现吗?
梦石
0
星屑
22573
在线时间
2604 小时
注册时间
2015-7-4
回帖
917
发表于 2022-11-29 15:38:50 | 显示全部楼层
做成经验道具怎样?比如经验书,使用经验书执行公共事件,给对应队员加经验,一本100或1000经验,敌人数据库经验为0,只掉落经验书,可以掉落一捆经验书,使用后得到若干本,你要给谁使用就给谁使用。
回复

使用道具 举报

梦石
0
星屑
5269
在线时间
733 小时
注册时间
2013-1-18
回帖
525
 楼主| 发表于 2022-11-29 20:44:47 | 显示全部楼层
Fan723 发表于 2022-11-29 15:38
做成经验道具怎样?比如经验书,使用经验书执行公共事件,给对应队员加经验,一本100或1000经验,敌人数据 ...

嗯,这也是一个思路,但我更倾向于思路2,毕竟如果敌人经验为0,每次手动加经验估计会让玩家感到繁琐。
回复

使用道具 举报

梦石
0
星屑
10274
在线时间
1919 小时
注册时间
2020-1-2
回帖
1043
发表于 2022-11-29 21:39:06 | 显示全部楼层
nhycs01 发表于 2022-11-29 20:44
嗯,这也是一个思路,但我更倾向于思路2,毕竟如果敌人经验为0,每次手动加经验估计会让玩家感到繁琐。 ...

虽然知道如何做经验箱子就是不知道咋没去分配
B站没人气的夏目漠漠,直播间:5378938实用插件教程点击红字传送
回复

使用道具 举报

梦石
0
星屑
10274
在线时间
1919 小时
注册时间
2020-1-2
回帖
1043
发表于 2022-11-29 21:41:54 | 显示全部楼层
[pre lang="javascript"]BattleManager.gainExp = function() {
    var exp = this._rewards.exp;
    $gameParty.allMembers().forEach(function(actor) {
        actor.gainExp(exp);
    });
};[/pre]
去掉actor.gainExp(exp);就不会获得经验然后 后面添加
$gameVariables.setValue(1, $gameVariables.value(1) + exp);
[pre lang="javascript"]BattleManager.gainExp = function() {
    var exp = this._rewards.exp;
    $gameParty.allMembers().forEach(function(actor) {
    $gameVariables.setValue(1, $gameVariables.value(1) + exp);
    });
};[/pre]
那么就会将经验储存到变量1,经验=队伍人数*怪物经验因为
$gameParty.allMembers().forEach(function(actor)这句

点评

原本是想在状态添加分配经验的但是能力有限=。=  发表于 2022-11-29 21:43
B站没人气的夏目漠漠,直播间:5378938实用插件教程点击红字传送
回复

使用道具 举报

梦石
0
星屑
4649
在线时间
570 小时
注册时间
2018-11-12
回帖
120
发表于 2022-11-30 05:36:18 | 显示全部楼层
本帖最后由 cenhangkai 于 2022-11-30 21:46 编辑

[pre lang="javascript"]/*:
* @plugindesc v1.1 经验储蓄池
* @author CHK
*
* @help
* 【救命!】
* ----------------------------------------------------------------
* [插件指令]
* 打开储蓄池
*
* ----------------------------------------------------------------
* [脚本]
* ①打开储蓄池:SceneManager.push(Scene_ExpBox);
* ②变更储蓄池的经验:$gameSystem.BGEWexp(X);
* 【例子-经验+100】$gameSystem.BGEWexp(100);
* 【例子-经验-100】$gameSystem.BGEWexp(-100);
*
* ----------------------------------------------------------------
* 插件如果有漏洞的话请在这个网站联系我ε=( o`ω′)ノ。
* https://rpg.blue/thread-491758-1-1.html
*
*
* @param ---经验储蓄设定---
* @default
*
* @param 通关经验比例
* @desc 战斗通关给与的经验值按比例放入储蓄池中。
* 默认10%(%符号不用写)
* @default 10
*
* @param 储蓄上限
* @desc 储蓄池中保管的经验值上限。默认100万(单位万)
* @default 100
*
* @param [分配经验]命令名称
* @desc 默认[分配经验]
* @default 分配经验
*
*
*
*
*
* @param ---奖励折算设定---
* @default
*
* @param 折算奖励
* @desc 把储蓄池中的经验值折算为金币、或道具。
* 金币填写0,道具填写它的ID。默认0
* @default 0
*
* @param 转换比例
* @desc 将储蓄池中的经验按比例转换。默认100
* 【100】每100点经验给1枚金币或1个道具。
* @default 100
*
* @param [折算奖励]命令名称
* @desc 默认[折算奖励]
* @default 折算奖励
*
*
*
*
*
* @param ---声音设定---
* @default
*
* @param 打开-储蓄池时的声音
* @type file
* @dir audio/se/
* @desc 请确保游戏中有该se声音文件。清空就不播放声音。
* 默认Book1
* @default Book1
*
* @param 打开-声音的音量
* @desc 默认90
* @default 90
*
* @param 打开-声音的加速
* @desc 默认100
* @default 100
*
*
* @param 分配-成功时的声音
* @type file
* @dir audio/se/
* @desc 请确保游戏中有该se声音文件。清空就不播放声音。
* 默认Recovery
* @default Recovery
*
* @param 分配-声音的音量
* @desc 默认90
* @default 90
*
* @param 分配-声音的加速
* @desc 默认100
* @default 100
*
*
* @param 折算-成功时的声音
* @type file
* @dir audio/se/
* @desc 请确保游戏中有该se声音文件。清空就不播放声音。
* 默认Shop2
* @default Shop2
*
* @param 折算-声音的音量
* @desc 默认90
* @default 90
*
* @param 折算-声音的加速
* @desc 默认100
* @default 100
*
*
*
*
*
* @param ---文字设定---
* @default
*
* @param 储蓄池标题
* @desc 默认战斗经验储蓄池。
* @default 战斗经验储蓄池
*
* @param 标题字号大小
* @desc 默认24
* @default 24
*
* @param 命令字号大小
* @desc 默认24
* @default 24
*
* @param 结算字号大小
* @desc 默认24
* @default 24
*
* @param 金币名称
* @desc 默认金币
* @default 金币
*
* @param 背景图片
* @desc 填写图片的名字,不用写格式。默认无。
* 请把图片放在 img/pictures 的文件夹里。
* @default
*/


var parameters = PluginManager.parameters('CHK_ExpBox');

var JYCX1 = Number(parameters['通关经验比例'] || 10);
JYCX1 *= 0.01;
var JYCX2 = Number(parameters['储蓄上限'] || 100);
JYCX2 *= 10000;
var JYCX3 = String(parameters['[分配经验]命令名称'] || '分配经验');

var JLZS1 = Number(parameters['折算奖励'] || 0);
var JLZS2 = Number(parameters['转换比例'] || 100);
var JLZS3 = String(parameters['[折算奖励]命令名称'] || '折算奖励');

var name1 = String(parameters['打开-储蓄池时的声音']);
var se1 = name1?{"name":name1,"volume":Number(parameters['打开-声音的音量']||90),"pitch":Number(parameters['打开-声音的加速']||100),"pan":0}:'';
var name2 = String(parameters['分配-成功时的声音']);
var se2 = name2?{"name":name2,"volume":Number(parameters['分配-声音的音量']||90),"pitch":Number(parameters['分配-声音的加速']||100),"pan":0}:'';
var name3 = String(parameters['折算-成功时的声音']);
var se3 = name3?{"name":name3,"volume":Number(parameters['折算-声音的音量']||90),"pitch":Number(parameters['折算-声音的加速']||100),"pan":0}:'';

var WZSD1 = String(parameters['储蓄池标题'] || '战斗经验储蓄池');
var WZSD2 = Number(parameters['标题字号大小'] || 24);
var WZSD3 = Number(parameters['命令字号大小'] || 24);
var WZSD4 = Number(parameters['结算字号大小'] || 24);
var WZSD5 = String(parameters['金币名称'] || '金币');

var BJSD = String(parameters['背景图片'] || '');
if (BJSD) ImageManager.loadBitmap('img/pictures/', BJSD, 0, true);
//-----------------------------------------------------------------------------
function Window_ExpBox() {
  this.initialize.apply(this, arguments);
}
Window_ExpBox.prototype = Object.create(Window_Command.prototype);
Window_ExpBox.prototype.constructor = Window_ExpBox;

Window_ExpBox.prototype.initialize = function() {
        Window_Command.prototype.initialize.call(this, 0, 0);
        this.refresh();
        if (BJSD) this.opacity = 0;
};
Window_ExpBox.prototype.windowWidth = function() {
    return 716-180;
};
Window_ExpBox.prototype.windowHeight = function() {
    return 576;
};
Window_ExpBox.prototype.standardFontSize = function() {
    return WZSD3;
};
Window_ExpBox.prototype.standardPadding = function() {
        return 0;
};
Window_ExpBox.prototype.itemTextAlign = function() {
    return 'center';
};
Window_ExpBox.prototype.itemRect = function(index) {
    var rect = new Rectangle();
    var maxCols = this.maxCols();
    rect.width = this.itemWidth()-18*2;
    rect.height = this.itemHeight();
    rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX+18;
    rect.y = Math.floor(index / maxCols) * rect.height - this._scrollY;
        rect.y = rect.y+this.windowHeight()-rect.height*2-this.standardPadding()-this.standardFontSize();
    return rect;
};
Window_ExpBox.prototype.makeCommandList = function() {
    this.addCommand(JYCX3,    'FPexp');
    this.addCommand(JLZS3,  'ZSitem');
};
Window_ExpBox.prototype.refresh = function() {
        Window_Command.prototype.refresh.call(this);
        if (!BJSD) {
                this.contents.paintOpacity = 77;
                this.contents.fillRect(2, 30, this.contentsWidth()-4, this.contentsHeight()-220, this.textColor(15));
                this.contents.paintOpacity = 200;
                this.contents.gradientFillRect(2, 2, this.contentsWidth()-4, 28, '#5d76ad', '#000000',90);
                this.contents.gradientFillRect(2, 30, (this.contentsWidth()-4)/2, 1, '#000000', '#5d5d5d');
                this.contents.gradientFillRect((this.contentsWidth()-4)/2+2, 30, (this.contentsWidth()-4)/2, 1, '#5d5d5d', '#000000');
                this.contents.paintOpacity = 255;
        };
        var item = JLZS1>0?$dataItems[JLZS1]:null;
        var name = JLZS1>0?item.name:WZSD5;
        this.changeTextColor(this.textColor(JLZS1>0?(item.meta.颜色?item.meta.颜色:16):6));
        var s = JLZS1>0?$gameParty.numItems(item):$gameParty.gold();
        var max = JLZS1>0?$gameParty.maxItems():$gameParty.maxGold();
        if (s>=max) this.changeTextColor(this.textColor(18));
        this.drawText('背包持有['+name+']:'+s+(s>=max?'(上限)':''), 0, 350, this.contentsWidth(), 'center');
        this.contents.fontSize = 16;
        this.changeTextColor(this.textColor(8));
        this.drawText(WZSD1, 0, -3, this.contentsWidth(), 'center');
        this.resetFontSettings();
        var w = 200;
        var h = 274;
        var x = parseInt((this.contentsWidth()-w)/2);
        var y = this.contentsHeight()-h-this.itemHeight()*2-18*2-126;
        this.contents.paintOpacity = 155;
        this.contents.fillRect(x, y, w, h, this.textColor(15));
        this.contents.paintOpacity = 255;
        var s = $gameSystem.EWexpBFB()/100;
        h = parseInt(270 * s);
        y = this.contentsHeight()-h-this.itemHeight()*2-18*2-130;
        this.contents.gradientFillRect(x+2, y+2, w-4, h, this.textColor(24), this.textColor(3),90);
        this.changeTextColor(this.textColor(24));
        this.drawText($gameSystem.EWexp()+'('+$gameSystem.EWexpBFB()+'%)', 0, 35, this.contentsWidth(), 'center');
        var yy = 388;
        this.changeTextColor(this.textColor(8));
        this.drawText('①战斗通关时敌人经验值的'+(JYCX1*100)+'%累计在此。', 18, yy, this.contentsWidth());
        this.drawText('②经验值最高累计至'+(JYCX2/10000)+'万,超过无效。', 18, yy+this.standardFontSize(), this.contentsWidth());
        this.drawText('③可将经验分配给指定角色,或折算['+name+']。', 18, yy+this.standardFontSize()*2, this.contentsWidth());
        this.resetFontSettings();
};
//-----------------------------------------------------------------------------
function Window_ExpActor() {
    this.initialize.apply(this, arguments);
}

Window_ExpActor.prototype = Object.create(Window_MenuStatus.prototype);
Window_ExpActor.prototype.constructor = Window_ExpActor;

Window_ExpActor.prototype.initialize = function() {
    Window_MenuStatus.prototype.initialize.call(this, 0, 0);
        this.deactivate();
        this.deselect();
        if (BJSD) this.opacity = 0;
};
Window_ExpActor.prototype.windowWidth = function() {
    return 180;
};
Window_ExpActor.prototype.windowHeight = function() {
    return 576;
};
Window_ExpActor.prototype.drawItem = function(index) {
    var actor = $gameParty.members()[index];
    var rect = this.itemRect(index);
    this.changePaintOpacity(!actor.isMaxLevel());
        var h = parseInt((this.windowHeight()-18*2)/4);
        this.contents._context.imageSmoothingEnabled = false;
    this.drawActorFace(actor, rect.x+5, rect.y, h-10, h-10);
        this.contents._context.imageSmoothingEnabled = true;
        this.contents.fontSize = 16;
        var y = rect.y+h;
        this.drawText(actor.level+'级 '+actor.name(), rect.x, y-40, rect.width, 'center');
        var nexp = actor.currentExp()-actor.expForLevel(actor.level);
    var mexp = actor.nextLevelExp()-actor.expForLevel(actor.level);
        var changdu = actor.isMaxLevel()? 1 : nexp/mexp;
        var text = actor.isMaxLevel()? '∞' : nexp+'/'+mexp;
        var yanse1 = actor.isMaxLevel()? '#bda461' : '#00731e';
        var yanse2 = actor.isMaxLevel()? '#f5d682' : '#00ff43';
        this.contents.gradientFillRect(rect.x, y-10, rect.width, 10, '#474747',this.textColor(15),90);
        this.contents.gradientFillRect(rect.x+1, y-9, (rect.width-2)*changdu, 8, yanse2, yanse1,90);
        this.contents.fontSize = 13;
        this.drawText(text, rect.x, y-25, rect.width, 'center');
    this.changePaintOpacity(true);
};
//-----------------------------------------------------------------------------
function Window_ZsBox() {
  this.initialize.apply(this, arguments);
}
Window_ZsBox.prototype = Object.create(Window_Command.prototype);
Window_ZsBox.prototype.constructor = Window_ZsBox;

Window_ZsBox.prototype.initialize = function() {
        Window_Command.prototype.initialize.call(this, 0, 0);
        this.x = Math.ceil((Graphics.width - this.width) / 2)-(536-this.width)/2;
        this.y = Math.ceil((Graphics.height - this.height) / 2)-10;
        this._ZsShu = 0;
        this._Actor = null;
        this.deactivate();
        this.hide();
};
Window_ZsBox.prototype.windowWidth = function() {
    return 716/2;
};
Window_ZsBox.prototype.windowHeight = function() {
    return 576/4;
};
Window_ZsBox.prototype.standardFontSize = function() {
    return WZSD4;
};
Window_ZsBox.prototype.maxCols = function() {
        if (!this._Actor&&$gameSystem.EWexpBFB()<1&&!this._ZsShu) return 1;
    return 5;
};
Window_ZsBox.prototype.itemTextAlign = function() {
    return 'center';
};
Window_ZsBox.prototype.spacing = function() {
    return 0;
};
Window_ZsBox.prototype.itemRect = function(index) {
    var rect = new Rectangle();
    var maxCols = this.maxCols();
    rect.width = this.itemWidth();
    rect.height = this.itemHeight();
    rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX;
    rect.y = Math.floor(index / maxCols) * rect.height - this._scrollY;
        rect.y = rect.y+this.windowHeight()-rect.height-this.standardPadding()-this.standardFontSize();
    return rect;
};
Window_ZsBox.prototype.makeCommandList = function() {
        if (!this._Actor&&$gameSystem.EWexpBFB()<1&&!this._ZsShu) return this.addCommand('经验值不足1%无法折算!',    'ZJ4', false);
        this.addCommand('+1%',    'ZJ1', $gameSystem.EWexpBFB()>=1);
    this.addCommand('+10%',    'ZJ2', $gameSystem.EWexpBFB()>=10);
        this.addCommand('全部',    'ZJ3', this._Actor?$gameSystem.EWexp()>0:$gameSystem.EWexpBFB()>=1);
        this.addCommand('重置',    'ZJ4', this._ZsShu>0);
        this.addCommand('确定',    'ZJok', this._ZsShu>0);
};
Window_ZsBox.prototype.refresh = function() {
        Window_Command.prototype.refresh.call(this);
        this.contents.paintOpacity = 255;
        this.contents.fontSize = 20;
        var text = this._Actor?'请输入给['+this._Actor.name()+']的额度。':'请输入想要折算的额度。';
        this.drawText(text, 0, -5, this.contentsWidth(), 'center');
        this.contents.fontSize = 18;
        this.changeTextColor(this.textColor(24));
        if (this._Actor) {
                var actor = this._Actor;
                var nexp = actor.currentExp()-actor.expForLevel(actor.level);
                var mexp = actor.nextLevelExp()-actor.expForLevel(actor.level);
                text = '距离升级还差'+(mexp-nexp)+'点经验。';
        } else {
                var dw = JLZS1>0?'个。':'枚。';
                text = '经验值折算比例:1%'+'换'+Math.round(JYCX2*0.01/JLZS2)+dw;
        };
        this.drawText(text, 0, this.contents.fontSize, this.contentsWidth(), 'center');
        this.changeTextColor(this.textColor(16));
        text = '折算'+(JLZS1>0?$dataItems[JLZS1].name:WZSD5)+':'+this._ZsShu;
        if (this._Actor) text = '给与经验:'+ this._ZsShu;
        this.drawText(text, 0, this.contents.fontSize*2, this.contentsWidth(), 'center');
        this.resetFontSettings();
};
//-----------------------------------------------------------------------------
function Scene_ExpBox() {
    this.initialize.apply(this, arguments);
}
Scene_ExpBox.prototype = Object.create(Scene_MenuBase.prototype);
Scene_ExpBox.prototype.constructor = Scene_ExpBox;

Scene_ExpBox.prototype.initialize = function() {
    Scene_MenuBase.prototype.initialize.call(this);
};
Scene_ExpBox.prototype.create = function() {
        Scene_MenuBase.prototype.create.call(this);
        if (se1) AudioManager.playSe(se1);
        this._ExpBoxWindow = new Window_ExpBox();
        this._ExpBoxWindow.setHandler('FPexp',     this.onFpexpOk.bind(this));
        this._ExpBoxWindow.setHandler('ZSitem',     this.onZSitemOk.bind(this));
        this._ExpBoxWindow.setHandler('cancel', this.popScene.bind(this));
        this.addWindow(this._ExpBoxWindow);
        this._ExpActorWindow = new Window_ExpActor();
        this._ExpActorWindow.setHandler('ok', this.onExpActorOk.bind(this));
        this._ExpActorWindow.setHandler('cancel', this.onExpActorCancel.bind(this));
        this.addChild(this._ExpActorWindow);
        this._ZsBoxWindow = new Window_ZsBox();
        this._ZsBoxWindow.setHandler('ZJ1', this.onZJ1Ok.bind(this));
        this._ZsBoxWindow.setHandler('ZJ2', this.onZJ2Ok.bind(this));
        this._ZsBoxWindow.setHandler('ZJ3', this.onZJ3Ok.bind(this));
        this._ZsBoxWindow.setHandler('ZJ4', this.onZJ4Ok.bind(this));
        this._ZsBoxWindow.setHandler('ZJok', this.onZJOk.bind(this));
        this._ZsBoxWindow.setHandler('cancel', this.onZJCancel.bind(this));
        this.addChild(this._ZsBoxWindow);
        var w1 = this._ExpBoxWindow;
        var w2 = this._ExpActorWindow;
        w1.x = Math.ceil((Graphics.width - w1.width - w2.width) / 2);
        w1.y = w2.y = Math.ceil((Graphics.height - w1.height) / 2);
        w2.x = Math.ceil((Graphics.width - w2.width + w1.width) / 2);
};
Scene_ExpBox.prototype.createWindowLayer = function() {
    var width = Graphics.boxWidth;
    var height = Graphics.boxHeight;
    var x = (Graphics.width - width) / 2;
    var y = (Graphics.height - height) / 2;
    this._windowLayer = new WindowLayer();
    this._windowLayer.move(x, y, width, height);
    this.addChild(this._windowLayer);
};
Scene_ExpBox.prototype.createBackground = function() {
        Scene_MenuBase.prototype.createBackground.call(this);
        if (BJSD) {
                this._ExpBoxBJ = new Sprite(ImageManager.loadPicture("lidexin1"));
                this.addChild(this._ExpBoxBJ);
                this._ExpBoxBJ.x = (Graphics.width-this._ExpBoxBJ.width)/2;
                this._ExpBoxBJ.y = (Graphics.height-this._ExpBoxBJ.height)/2;
        };
};
Scene_ExpBox.prototype.onFpexpOk = function() {
        this._ExpActorWindow.activate();
        this._ExpActorWindow.refresh();
        this._ExpActorWindow.select(0);
};
Scene_ExpBox.prototype.onZSitemOk = function() {
        this._ZsBoxWindow.show();
        this._ZsBoxWindow.activate();
        this._ZsBoxWindow.refresh();
        this._ZsBoxWindow.select(0);
};
Scene_ExpBox.prototype.onExpActorOk = function() {
        this._ZsBoxWindow._Actor = $gameParty.members()[this._ExpActorWindow.index()];
        this._ZsBoxWindow.show();
        this._ZsBoxWindow.activate();
        this._ZsBoxWindow.refresh();
        this._ZsBoxWindow.select(0);//
};
Scene_ExpBox.prototype.onExpActorCancel = function() {
        this._ZsBoxWindow._Actor = null;
        this._ExpActorWindow.deselect();
        this._ExpBoxWindow.activate();
        this._ExpBoxWindow.refresh();
        this._ExpBoxWindow.select(0);
};
Scene_ExpBox.prototype.onZJ1Ok = function() {
        var zs = this._ZsBoxWindow._Actor?1:JLZS2;
        var s = Math.round(JYCX2*0.01/zs);
        this._ZsBoxWindow._ZsShu += s;
        $gameSystem.BGEWexp(-s*zs);
        this._ZsBoxWindow.activate();
        this._ZsBoxWindow.refresh();
        this._ExpBoxWindow.refresh();
};
Scene_ExpBox.prototype.onZJ2Ok = function() {
        var zs = this._ZsBoxWindow._Actor?1:JLZS2;
        var s = Math.round(JYCX2*0.1/zs);
        this._ZsBoxWindow._ZsShu += s;
        $gameSystem.BGEWexp(-s*zs);
        this._ZsBoxWindow.activate();
        this._ZsBoxWindow.refresh();
        this._ExpBoxWindow.refresh();
};
Scene_ExpBox.prototype.onZJ3Ok = function() {
        var zs = this._ZsBoxWindow._Actor?1:JLZS2;
        var s = Math.round($gameSystem.EWexp()/zs);
        this._ZsBoxWindow._ZsShu += s;
        $gameSystem.BGEWexp(-s*zs);
        this._ZsBoxWindow.activate();
        this._ZsBoxWindow.refresh();
        this._ZsBoxWindow.select(4);
        this._ExpBoxWindow.refresh();
};
Scene_ExpBox.prototype.onZJ4Ok = function() {
        var zs = this._ZsBoxWindow._Actor?1:JLZS2;
        $gameSystem.BGEWexp(this._ZsBoxWindow._ZsShu*zs);
        this._ZsBoxWindow._ZsShu = 0;
        this._ZsBoxWindow.activate();
        this._ZsBoxWindow.refresh();
        this._ExpBoxWindow.refresh();
};
Scene_ExpBox.prototype.onZJOk = function() {
        var s = this._ZsBoxWindow._ZsShu;
        if (this._ZsBoxWindow._Actor) {
                if (se2) AudioManager.playSe(se2);
                var i = this._ZsBoxWindow._Actor;
                i.changeExp(i.currentExp()+s, false);
        } else {
                if (se3) AudioManager.playSe(se3);
                if (JLZS1>0) {
                        $gameParty.gainItem($dataItems[JLZS1], s);
                } else {
                        $gameParty.gainGold(s);
                }
        };
        this._ZsBoxWindow._ZsShu = 0;
        this.onZJCancel();
};
Scene_ExpBox.prototype.onZJCancel = function() {
        if (this._ZsBoxWindow._ZsShu>0) {
                var zs = this._ZsBoxWindow._Actor?1:JLZS2;
                $gameSystem.BGEWexp(this._ZsBoxWindow._ZsShu*zs);
                this._ZsBoxWindow._ZsShu = 0;
        };
        this._ZsBoxWindow.refresh();
        this._ZsBoxWindow.hide();
        this._ZsBoxWindow.deselect();
        if (this._ZsBoxWindow._Actor) {
                this._ExpActorWindow.activate();
                this._ExpActorWindow.refresh();
                this._ExpBoxWindow.refresh();
        } else {
                this._ExpBoxWindow.activate();
                this._ExpBoxWindow.refresh();
        };
};
//-----------------------------------------------------------------------------
Game_System.prototype.EWexp = function() {
        if (!this._DREWexp) this._DREWexp = 0;
        return this._DREWexp.clamp(0, JYCX2);
};
Game_System.prototype.BGEWexp = function(s) {
        var exp = this.EWexp();
        s = Math.round(s);
        if (exp+s>JYCX2) s = JYCX2-exp;
        this._DREWexp += s;
};
Game_System.prototype.EWexpBFB = function() {
        return parseInt(this.EWexp() / JYCX2 * 100).clamp(0, 100);
};
var _EWBattleManager_gainExp = BattleManager.gainExp;
BattleManager.gainExp = function() {
        _EWBattleManager_gainExp.call(this);
        if (this._rewards && this._rewards.exp) $gameSystem.BGEWexp(parseInt(this._rewards.exp*JYCX1));
};

var _EWGame_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
    _EWGame_Interpreter_pluginCommand.call(this, command, args)
    if (command === '打开储蓄池') SceneManager.push(Scene_ExpBox);
};[/pre]
//————————————————————————————————
【使用方法】把上述代码新建成插件,插件命名:CHK_ExpBox

随手写的,希望对楼主有所帮助。
//————————————————————————————————
【更新日志】2022.11.30 晚上9点
①修复小数点的BUG;
②分配经验值时,按下[全部],可以1点都不保留的给对应角色了;
③折算金币/道具时,不足总经验1%时,会提示无法折算。

点评

6  发表于 2022-11-30 08:00
回复 1 0

使用道具 举报

梦石
0
星屑
5269
在线时间
733 小时
注册时间
2013-1-18
回帖
525
 楼主| 发表于 2022-11-30 09:18:00 | 显示全部楼层
本帖最后由 nhycs01 于 2022-11-30 11:05 编辑
cenhangkai 发表于 2022-11-30 05:36
//————————————————————————————————
【使用方法】把上述代码新建成插件 ...


感谢大佬神一般的插件!
我刚刚试了一下,感觉很棒,但是发现一个问题:
我测试储存了2000经验,但是发现无法分配,也无法折算,是我哪里设置不对吗?插件是按照默认的设置进行的,没有改动过。


-----------------------------------------------------------------------------------------------------------------------------------
这个问题感谢楼下解释了,不过我又发现一个问题,请大佬看看吧!


我设置了1万的上限,然后储存了20%的经验,也就是2000
然后我选择分配经验,选了4次1%,然后再选1次10%,再选择重置,就会出现这样。

1.png

这时候再点一下全部,就会这样

2.png

点评

已收到漏洞反馈,并重新上传了代码。  发表于 2022-11-30 21:48
回复

使用道具 举报

梦石
0
星屑
81
在线时间
10 小时
注册时间
2022-8-14
回帖
1
发表于 2022-11-30 10:37:02 | 显示全部楼层
nhycs01 发表于 2022-11-30 09:18
感谢大佬神一般的插件!
我刚刚试了一下,感觉很棒,但是发现一个问题:
我测试储存了2000经验,但是发现 ...

默认100万的储存上限,最低使用需要有1%的数额,也就是1万,未达到时就不能使用相关功能,同时分配的计算是数个1%相加,不足1%的部分会被剩下来。

就是说9999时不能使用,10003时可使用 1% 或者 全部 这两个选项,但不论哪个都会剩下不足1%那部分的3点数额。

100003时 1% , 10% , 全部 三个选项都能使用,但最后也同样是会剩下那3点数额。

等大佬有时间修复一下吧
回复

使用道具 举报

梦石
0
星屑
5269
在线时间
733 小时
注册时间
2013-1-18
回帖
525
 楼主| 发表于 2022-11-30 22:37:30 | 显示全部楼层
cenhangkai 发表于 2022-11-30 05:36
/*:
* @plugindesc v1.1 经验储蓄池
* @author CHK

感谢大佬神速更新,这回暂时没有问题了!这个插件太棒了!
我还有一个小小问题,因为我用了MOG的自定义主菜单,想把这个插件直接加到菜单里。
但是MOG的添加按钮需要填写关键字,请问这个大佬这个插件的关键字我应该填什么?

回复

使用道具 举报

梦石
0
星屑
4649
在线时间
570 小时
注册时间
2018-11-12
回帖
120
发表于 2022-11-30 23:08:24 | 显示全部楼层
nhycs01 发表于 2022-11-30 22:37
感谢大佬神速更新,这回暂时没有问题了!这个插件太棒了!
我还有一个小小问题,因为我用了MOG的自定义主 ...

var _EWWindow_MenuCommand_makeCommandLis = Window_MenuCommand.prototype.makeCommandList;
Window_MenuCommand.prototype.makeCommandList = function() {
        _EWWindow_MenuCommand_makeCommandLis.call(this);
        this.addCommand(WZSD1, 'ExpBox');
};

var _EWScene_Menu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function() {
        _EWScene_Menu_createCommandWindow.call(this);
        this._commandWindow.setHandler('ExpBox', this.openExpBox.bind(this));
};
Scene_Menu.prototype.openExpBox = function() {
        SceneManager.push(Scene_ExpBox);
};

//——————————————————————
1.将上述代码复制粘贴到在 CHK_ExpBox 插件最下面 ;
2.MOG自定义菜单的插件参数:【自定义关键字】Button_ExpBox

点评

感谢大佬,我成功了!膜拜!  发表于 2022-11-30 23:36

评分

参与人数 1赞 +1 收起 理由
nhycs01 + 1 认可答案

查看全部评分

回复 1 0

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部