设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1965|回复: 13
打印 上一主题 下一主题

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

[复制链接]

Lv3.寻梦者

梦石
0
星屑
4517
在线时间
677 小时
注册时间
2013-1-18
帖子
709
跳转到指定楼层
1
发表于 2022-11-29 11:42:28 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

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

这种想法能实现吗?

Lv4.逐梦者

梦石
0
星屑
17834
在线时间
2149 小时
注册时间
2015-7-4
帖子
916
2
发表于 2022-11-29 15:38:50 | 只看该作者
做成经验道具怎样?比如经验书,使用经验书执行公共事件,给对应队员加经验,一本100或1000经验,敌人数据库经验为0,只掉落经验书,可以掉落一捆经验书,使用后得到若干本,你要给谁使用就给谁使用。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
4517
在线时间
677 小时
注册时间
2013-1-18
帖子
709
3
 楼主| 发表于 2022-11-29 20:44:47 | 只看该作者
Fan723 发表于 2022-11-29 15:38
做成经验道具怎样?比如经验书,使用经验书执行公共事件,给对应队员加经验,一本100或1000经验,敌人数据 ...

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

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9233
在线时间
1832 小时
注册时间
2020-1-2
帖子
1082
4
发表于 2022-11-29 21:39:06 | 只看该作者
nhycs01 发表于 2022-11-29 20:44
嗯,这也是一个思路,但我更倾向于思路2,毕竟如果敌人经验为0,每次手动加经验估计会让玩家感到繁琐。 ...

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

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9233
在线时间
1832 小时
注册时间
2020-1-2
帖子
1082
5
发表于 2022-11-29 21:41:54 | 只看该作者
JAVASCRIPT 代码复制
  1. BattleManager.gainExp = function() {
  2.     var exp = this._rewards.exp;
  3.     $gameParty.allMembers().forEach(function(actor) {
  4.         actor.gainExp(exp);
  5.     });
  6. };

去掉actor.gainExp(exp);就不会获得经验然后 后面添加
$gameVariables.setValue(1, $gameVariables.value(1) + exp);
JAVASCRIPT 代码复制
  1. BattleManager.gainExp = function() {
  2.     var exp = this._rewards.exp;
  3.     $gameParty.allMembers().forEach(function(actor) {
  4.     $gameVariables.setValue(1, $gameVariables.value(1) + exp);
  5.     });
  6. };

那么就会将经验储存到变量1,经验=队伍人数*怪物经验因为
$gameParty.allMembers().forEach(function(actor)这句

点评

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

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
4256
在线时间
541 小时
注册时间
2018-11-12
帖子
113
6
发表于 2022-11-30 05:36:18 | 只看该作者
本帖最后由 cenhangkai 于 2022-11-30 21:46 编辑

JAVASCRIPT 代码复制
  1. /*:
  2.  * @plugindesc v1.1 经验储蓄池
  3.  * @author CHK
  4.  *
  5.  * @help
  6.  * 【救命!】
  7.  * ----------------------------------------------------------------
  8.  * [插件指令]
  9.  * 打开储蓄池
  10.  *
  11.  * ----------------------------------------------------------------
  12.  * [脚本]
  13.  * ①打开储蓄池:SceneManager.push(Scene_ExpBox);
  14.  * ②变更储蓄池的经验:$gameSystem.BGEWexp(X);
  15.  * 【例子-经验+100】$gameSystem.BGEWexp(100);
  16.  * 【例子-经验-100】$gameSystem.BGEWexp(-100);
  17.  *
  18.  * ----------------------------------------------------------------
  19.  * 插件如果有漏洞的话请在这个网站联系我ε=( o`ω′)ノ。
  20.  * [url]https://rpg.blue/thread-491758-1-1.html[/url]
  21.  *
  22.  *
  23.  * @param ---经验储蓄设定---
  24.  * @default
  25.  *
  26.  * @param 通关经验比例
  27.  * @desc 战斗通关给与的经验值按比例放入储蓄池中。
  28.  * 默认10%(%符号不用写)
  29.  * @default 10
  30.  *
  31.  * @param 储蓄上限
  32.  * @desc 储蓄池中保管的经验值上限。默认100万(单位万)
  33.  * @default 100
  34.  *
  35.  * @param [分配经验]命令名称
  36.  * @desc 默认[分配经验]
  37.  * @default 分配经验
  38.  *
  39.  *
  40.  *
  41.  *
  42.  *
  43.  * @param ---奖励折算设定---
  44.  * @default
  45.  *
  46.  * @param 折算奖励
  47.  * @desc 把储蓄池中的经验值折算为金币、或道具。
  48.  * 金币填写0,道具填写它的ID。默认0
  49.  * @default 0
  50.  *
  51.  * @param 转换比例
  52.  * @desc 将储蓄池中的经验按比例转换。默认100
  53.  * 【100】每100点经验给1枚金币或1个道具。
  54.  * @default 100
  55.  *
  56.  * @param [折算奖励]命令名称
  57.  * @desc 默认[折算奖励]
  58.  * @default 折算奖励
  59.  *
  60.  *
  61.  *
  62.  *
  63.  *
  64.  * @param ---声音设定---
  65.  * @default
  66.  *
  67.  * @param 打开-储蓄池时的声音
  68.  * @type file
  69.  * @dir audio/se/
  70.  * @desc 请确保游戏中有该se声音文件。清空就不播放声音。
  71.  * 默认Book1
  72.  * @default Book1
  73.  *
  74.  * @param 打开-声音的音量
  75.  * @desc 默认90
  76.  * @default 90
  77.  *
  78.  * @param 打开-声音的加速
  79.  * @desc 默认100
  80.  * @default 100
  81.  *
  82.  *
  83.  * @param 分配-成功时的声音
  84.  * @type file
  85.  * @dir audio/se/
  86.  * @desc 请确保游戏中有该se声音文件。清空就不播放声音。
  87.  * 默认Recovery
  88.  * @default Recovery
  89.  *
  90.  * @param 分配-声音的音量
  91.  * @desc 默认90
  92.  * @default 90
  93.  *
  94.  * @param 分配-声音的加速
  95.  * @desc 默认100
  96.  * @default 100
  97.  *
  98.  *
  99.  * @param 折算-成功时的声音
  100.  * @type file
  101.  * @dir audio/se/
  102.  * @desc 请确保游戏中有该se声音文件。清空就不播放声音。
  103.  * 默认Shop2
  104.  * @default Shop2
  105.  *
  106.  * @param 折算-声音的音量
  107.  * @desc 默认90
  108.  * @default 90
  109.  *
  110.  * @param 折算-声音的加速
  111.  * @desc 默认100
  112.  * @default 100
  113.  *
  114.  *
  115.  *
  116.  *
  117.  *
  118.  * @param ---文字设定---
  119.  * @default
  120.  *
  121.  * @param 储蓄池标题
  122.  * @desc 默认战斗经验储蓄池。
  123.  * @default 战斗经验储蓄池
  124.  *
  125.  * @param 标题字号大小
  126.  * @desc 默认24
  127.  * @default 24
  128.  *
  129.  * @param 命令字号大小
  130.  * @desc 默认24
  131.  * @default 24
  132.  *
  133.  * @param 结算字号大小
  134.  * @desc 默认24
  135.  * @default 24
  136.  *
  137.  * @param 金币名称
  138.  * @desc 默认金币
  139.  * @default 金币
  140.  *
  141.  * @param 背景图片
  142.  * @desc 填写图片的名字,不用写格式。默认无。
  143.  * 请把图片放在 img/pictures 的文件夹里。
  144.  * @default
  145.  */
  146.  
  147.  
  148. var parameters = PluginManager.parameters('CHK_ExpBox');
  149.  
  150. var JYCX1 = Number(parameters['通关经验比例'] || 10);
  151. JYCX1 *= 0.01;
  152. var JYCX2 = Number(parameters['储蓄上限'] || 100);
  153. JYCX2 *= 10000;
  154. var JYCX3 = String(parameters['[分配经验]命令名称'] || '分配经验');
  155.  
  156. var JLZS1 = Number(parameters['折算奖励'] || 0);
  157. var JLZS2 = Number(parameters['转换比例'] || 100);
  158. var JLZS3 = String(parameters['[折算奖励]命令名称'] || '折算奖励');
  159.  
  160. var name1 = String(parameters['打开-储蓄池时的声音']);
  161. var se1 = name1?{"name":name1,"volume":Number(parameters['打开-声音的音量']||90),"pitch":Number(parameters['打开-声音的加速']||100),"pan":0}:'';
  162. var name2 = String(parameters['分配-成功时的声音']);
  163. var se2 = name2?{"name":name2,"volume":Number(parameters['分配-声音的音量']||90),"pitch":Number(parameters['分配-声音的加速']||100),"pan":0}:'';
  164. var name3 = String(parameters['折算-成功时的声音']);
  165. var se3 = name3?{"name":name3,"volume":Number(parameters['折算-声音的音量']||90),"pitch":Number(parameters['折算-声音的加速']||100),"pan":0}:'';
  166.  
  167. var WZSD1 = String(parameters['储蓄池标题'] || '战斗经验储蓄池');
  168. var WZSD2 = Number(parameters['标题字号大小'] || 24);
  169. var WZSD3 = Number(parameters['命令字号大小'] || 24);
  170. var WZSD4 = Number(parameters['结算字号大小'] || 24);
  171. var WZSD5 = String(parameters['金币名称'] || '金币');
  172.  
  173. var BJSD = String(parameters['背景图片'] || '');
  174. if (BJSD) ImageManager.loadBitmap('img/pictures/', BJSD, 0, true);
  175. //-----------------------------------------------------------------------------
  176. function Window_ExpBox() {
  177.   this.initialize.apply(this, arguments);
  178. }
  179. Window_ExpBox.prototype = Object.create(Window_Command.prototype);
  180. Window_ExpBox.prototype.constructor = Window_ExpBox;
  181.  
  182. Window_ExpBox.prototype.initialize = function() {
  183.         Window_Command.prototype.initialize.call(this, 0, 0);
  184.         this.refresh();
  185.         if (BJSD) this.opacity = 0;
  186. };
  187. Window_ExpBox.prototype.windowWidth = function() {
  188.     return 716-180;
  189. };
  190. Window_ExpBox.prototype.windowHeight = function() {
  191.     return 576;
  192. };
  193. Window_ExpBox.prototype.standardFontSize = function() {
  194.     return WZSD3;
  195. };
  196. Window_ExpBox.prototype.standardPadding = function() {
  197.         return 0;
  198. };
  199. Window_ExpBox.prototype.itemTextAlign = function() {
  200.     return 'center';
  201. };
  202. Window_ExpBox.prototype.itemRect = function(index) {
  203.     var rect = new Rectangle();
  204.     var maxCols = this.maxCols();
  205.     rect.width = this.itemWidth()-18*2;
  206.     rect.height = this.itemHeight();
  207.     rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX+18;
  208.     rect.y = Math.floor(index / maxCols) * rect.height - this._scrollY;
  209.         rect.y = rect.y+this.windowHeight()-rect.height*2-this.standardPadding()-this.standardFontSize();
  210.     return rect;
  211. };
  212. Window_ExpBox.prototype.makeCommandList = function() {
  213.     this.addCommand(JYCX3,    'FPexp');
  214.     this.addCommand(JLZS3,  'ZSitem');
  215. };
  216. Window_ExpBox.prototype.refresh = function() {
  217.         Window_Command.prototype.refresh.call(this);
  218.         if (!BJSD) {
  219.                 this.contents.paintOpacity = 77;
  220.                 this.contents.fillRect(2, 30, this.contentsWidth()-4, this.contentsHeight()-220, this.textColor(15));
  221.                 this.contents.paintOpacity = 200;
  222.                 this.contents.gradientFillRect(2, 2, this.contentsWidth()-4, 28, '#5d76ad', '#000000',90);
  223.                 this.contents.gradientFillRect(2, 30, (this.contentsWidth()-4)/2, 1, '#000000', '#5d5d5d');
  224.                 this.contents.gradientFillRect((this.contentsWidth()-4)/2+2, 30, (this.contentsWidth()-4)/2, 1, '#5d5d5d', '#000000');
  225.                 this.contents.paintOpacity = 255;
  226.         };
  227.         var item = JLZS1>0?$dataItems[JLZS1]:null;
  228.         var name = JLZS1>0?item.name:WZSD5;
  229.         this.changeTextColor(this.textColor(JLZS1>0?(item.meta.颜色?item.meta.颜色:16):6));
  230.         var s = JLZS1>0?$gameParty.numItems(item):$gameParty.gold();
  231.         var max = JLZS1>0?$gameParty.maxItems():$gameParty.maxGold();
  232.         if (s>=max) this.changeTextColor(this.textColor(18));
  233.         this.drawText('背包持有['+name+']:'+s+(s>=max?'(上限)':''), 0, 350, this.contentsWidth(), 'center');
  234.         this.contents.fontSize = 16;
  235.         this.changeTextColor(this.textColor(8));
  236.         this.drawText(WZSD1, 0, -3, this.contentsWidth(), 'center');
  237.         this.resetFontSettings();
  238.         var w = 200;
  239.         var h = 274;
  240.         var x = parseInt((this.contentsWidth()-w)/2);
  241.         var y = this.contentsHeight()-h-this.itemHeight()*2-18*2-126;
  242.         this.contents.paintOpacity = 155;
  243.         this.contents.fillRect(x, y, w, h, this.textColor(15));
  244.         this.contents.paintOpacity = 255;
  245.         var s = $gameSystem.EWexpBFB()/100;
  246.         h = parseInt(270 * s);
  247.         y = this.contentsHeight()-h-this.itemHeight()*2-18*2-130;
  248.         this.contents.gradientFillRect(x+2, y+2, w-4, h, this.textColor(24), this.textColor(3),90);
  249.         this.changeTextColor(this.textColor(24));
  250.         this.drawText($gameSystem.EWexp()+'('+$gameSystem.EWexpBFB()+'%)', 0, 35, this.contentsWidth(), 'center');
  251.         var yy = 388;
  252.         this.changeTextColor(this.textColor(8));
  253.         this.drawText('①战斗通关时敌人经验值的'+(JYCX1*100)+'%累计在此。', 18, yy, this.contentsWidth());
  254.         this.drawText('②经验值最高累计至'+(JYCX2/10000)+'万,超过无效。', 18, yy+this.standardFontSize(), this.contentsWidth());
  255.         this.drawText('③可将经验分配给指定角色,或折算['+name+']。', 18, yy+this.standardFontSize()*2, this.contentsWidth());
  256.         this.resetFontSettings();
  257. };
  258. //-----------------------------------------------------------------------------
  259. function Window_ExpActor() {
  260.     this.initialize.apply(this, arguments);
  261. }
  262.  
  263. Window_ExpActor.prototype = Object.create(Window_MenuStatus.prototype);
  264. Window_ExpActor.prototype.constructor = Window_ExpActor;
  265.  
  266. Window_ExpActor.prototype.initialize = function() {
  267.     Window_MenuStatus.prototype.initialize.call(this, 0, 0);
  268.         this.deactivate();
  269.         this.deselect();
  270.         if (BJSD) this.opacity = 0;
  271. };
  272. Window_ExpActor.prototype.windowWidth = function() {
  273.     return 180;
  274. };
  275. Window_ExpActor.prototype.windowHeight = function() {
  276.     return 576;
  277. };
  278. Window_ExpActor.prototype.drawItem = function(index) {
  279.     var actor = $gameParty.members()[index];
  280.     var rect = this.itemRect(index);
  281.     this.changePaintOpacity(!actor.isMaxLevel());
  282.         var h = parseInt((this.windowHeight()-18*2)/4);
  283.         this.contents._context.imageSmoothingEnabled = false;
  284.     this.drawActorFace(actor, rect.x+5, rect.y, h-10, h-10);
  285.         this.contents._context.imageSmoothingEnabled = true;
  286.         this.contents.fontSize = 16;
  287.         var y = rect.y+h;
  288.         this.drawText(actor.level+'级 '+actor.name(), rect.x, y-40, rect.width, 'center');
  289.         var nexp = actor.currentExp()-actor.expForLevel(actor.level);
  290.     var mexp = actor.nextLevelExp()-actor.expForLevel(actor.level);
  291.         var changdu = actor.isMaxLevel()? 1 : nexp/mexp;
  292.         var text = actor.isMaxLevel()? '∞' : nexp+'/'+mexp;
  293.         var yanse1 = actor.isMaxLevel()? '#bda461' : '#00731e';
  294.         var yanse2 = actor.isMaxLevel()? '#f5d682' : '#00ff43';
  295.         this.contents.gradientFillRect(rect.x, y-10, rect.width, 10, '#474747',this.textColor(15),90);
  296.         this.contents.gradientFillRect(rect.x+1, y-9, (rect.width-2)*changdu, 8, yanse2, yanse1,90);
  297.         this.contents.fontSize = 13;
  298.         this.drawText(text, rect.x, y-25, rect.width, 'center');
  299.     this.changePaintOpacity(true);
  300. };
  301. //-----------------------------------------------------------------------------
  302. function Window_ZsBox() {
  303.   this.initialize.apply(this, arguments);
  304. }
  305. Window_ZsBox.prototype = Object.create(Window_Command.prototype);
  306. Window_ZsBox.prototype.constructor = Window_ZsBox;
  307.  
  308. Window_ZsBox.prototype.initialize = function() {
  309.         Window_Command.prototype.initialize.call(this, 0, 0);
  310.         this.x = Math.ceil((Graphics.width - this.width) / 2)-(536-this.width)/2;
  311.         this.y = Math.ceil((Graphics.height - this.height) / 2)-10;
  312.         this._ZsShu = 0;
  313.         this._Actor = null;
  314.         this.deactivate();
  315.         this.hide();
  316. };
  317. Window_ZsBox.prototype.windowWidth = function() {
  318.     return 716/2;
  319. };
  320. Window_ZsBox.prototype.windowHeight = function() {
  321.     return 576/4;
  322. };
  323. Window_ZsBox.prototype.standardFontSize = function() {
  324.     return WZSD4;
  325. };
  326. Window_ZsBox.prototype.maxCols = function() {
  327.         if (!this._Actor&&$gameSystem.EWexpBFB()<1&&!this._ZsShu) return 1;
  328.     return 5;
  329. };
  330. Window_ZsBox.prototype.itemTextAlign = function() {
  331.     return 'center';
  332. };
  333. Window_ZsBox.prototype.spacing = function() {
  334.     return 0;
  335. };
  336. Window_ZsBox.prototype.itemRect = function(index) {
  337.     var rect = new Rectangle();
  338.     var maxCols = this.maxCols();
  339.     rect.width = this.itemWidth();
  340.     rect.height = this.itemHeight();
  341.     rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX;
  342.     rect.y = Math.floor(index / maxCols) * rect.height - this._scrollY;
  343.         rect.y = rect.y+this.windowHeight()-rect.height-this.standardPadding()-this.standardFontSize();
  344.     return rect;
  345. };
  346. Window_ZsBox.prototype.makeCommandList = function() {
  347.         if (!this._Actor&&$gameSystem.EWexpBFB()<1&&!this._ZsShu) return this.addCommand('经验值不足1%无法折算!',    'ZJ4', false);
  348.         this.addCommand('+1%',    'ZJ1', $gameSystem.EWexpBFB()>=1);
  349.     this.addCommand('+10%',    'ZJ2', $gameSystem.EWexpBFB()>=10);
  350.         this.addCommand('全部',    'ZJ3', this._Actor?$gameSystem.EWexp()>0:$gameSystem.EWexpBFB()>=1);
  351.         this.addCommand('重置',    'ZJ4', this._ZsShu>0);
  352.         this.addCommand('确定',    'ZJok', this._ZsShu>0);
  353. };
  354. Window_ZsBox.prototype.refresh = function() {
  355.         Window_Command.prototype.refresh.call(this);
  356.         this.contents.paintOpacity = 255;
  357.         this.contents.fontSize = 20;
  358.         var text = this._Actor?'请输入给['+this._Actor.name()+']的额度。':'请输入想要折算的额度。';
  359.         this.drawText(text, 0, -5, this.contentsWidth(), 'center');
  360.         this.contents.fontSize = 18;
  361.         this.changeTextColor(this.textColor(24));
  362.         if (this._Actor) {
  363.                 var actor = this._Actor;
  364.                 var nexp = actor.currentExp()-actor.expForLevel(actor.level);
  365.                 var mexp = actor.nextLevelExp()-actor.expForLevel(actor.level);
  366.                 text = '距离升级还差'+(mexp-nexp)+'点经验。';
  367.         } else {
  368.                 var dw = JLZS1>0?'个。':'枚。';
  369.                 text = '经验值折算比例:1%'+'换'+Math.round(JYCX2*0.01/JLZS2)+dw;
  370.         };
  371.         this.drawText(text, 0, this.contents.fontSize, this.contentsWidth(), 'center');
  372.         this.changeTextColor(this.textColor(16));
  373.         text = '折算'+(JLZS1>0?$dataItems[JLZS1].name:WZSD5)+':'+this._ZsShu;
  374.         if (this._Actor) text = '给与经验:'+ this._ZsShu;
  375.         this.drawText(text, 0, this.contents.fontSize*2, this.contentsWidth(), 'center');
  376.         this.resetFontSettings();
  377. };
  378. //-----------------------------------------------------------------------------
  379. function Scene_ExpBox() {
  380.     this.initialize.apply(this, arguments);
  381. }
  382. Scene_ExpBox.prototype = Object.create(Scene_MenuBase.prototype);
  383. Scene_ExpBox.prototype.constructor = Scene_ExpBox;
  384.  
  385. Scene_ExpBox.prototype.initialize = function() {
  386.     Scene_MenuBase.prototype.initialize.call(this);
  387. };
  388. Scene_ExpBox.prototype.create = function() {
  389.         Scene_MenuBase.prototype.create.call(this);
  390.         if (se1) AudioManager.playSe(se1);
  391.         this._ExpBoxWindow = new Window_ExpBox();
  392.         this._ExpBoxWindow.setHandler('FPexp',     this.onFpexpOk.bind(this));
  393.         this._ExpBoxWindow.setHandler('ZSitem',     this.onZSitemOk.bind(this));
  394.         this._ExpBoxWindow.setHandler('cancel', this.popScene.bind(this));
  395.         this.addWindow(this._ExpBoxWindow);
  396.         this._ExpActorWindow = new Window_ExpActor();
  397.         this._ExpActorWindow.setHandler('ok', this.onExpActorOk.bind(this));
  398.         this._ExpActorWindow.setHandler('cancel', this.onExpActorCancel.bind(this));
  399.         this.addChild(this._ExpActorWindow);
  400.         this._ZsBoxWindow = new Window_ZsBox();
  401.         this._ZsBoxWindow.setHandler('ZJ1', this.onZJ1Ok.bind(this));
  402.         this._ZsBoxWindow.setHandler('ZJ2', this.onZJ2Ok.bind(this));
  403.         this._ZsBoxWindow.setHandler('ZJ3', this.onZJ3Ok.bind(this));
  404.         this._ZsBoxWindow.setHandler('ZJ4', this.onZJ4Ok.bind(this));
  405.         this._ZsBoxWindow.setHandler('ZJok', this.onZJOk.bind(this));
  406.         this._ZsBoxWindow.setHandler('cancel', this.onZJCancel.bind(this));
  407.         this.addChild(this._ZsBoxWindow);
  408.         var w1 = this._ExpBoxWindow;
  409.         var w2 = this._ExpActorWindow;
  410.         w1.x = Math.ceil((Graphics.width - w1.width - w2.width) / 2);
  411.         w1.y = w2.y = Math.ceil((Graphics.height - w1.height) / 2);
  412.         w2.x = Math.ceil((Graphics.width - w2.width + w1.width) / 2);
  413. };
  414. Scene_ExpBox.prototype.createWindowLayer = function() {
  415.     var width = Graphics.boxWidth;
  416.     var height = Graphics.boxHeight;
  417.     var x = (Graphics.width - width) / 2;
  418.     var y = (Graphics.height - height) / 2;
  419.     this._windowLayer = new WindowLayer();
  420.     this._windowLayer.move(x, y, width, height);
  421.     this.addChild(this._windowLayer);
  422. };
  423. Scene_ExpBox.prototype.createBackground = function() {
  424.         Scene_MenuBase.prototype.createBackground.call(this);
  425.         if (BJSD) {
  426.                 this._ExpBoxBJ = new Sprite(ImageManager.loadPicture("lidexin1"));
  427.                 this.addChild(this._ExpBoxBJ);
  428.                 this._ExpBoxBJ.x = (Graphics.width-this._ExpBoxBJ.width)/2;
  429.                 this._ExpBoxBJ.y = (Graphics.height-this._ExpBoxBJ.height)/2;
  430.         };
  431. };
  432. Scene_ExpBox.prototype.onFpexpOk = function() {
  433.         this._ExpActorWindow.activate();
  434.         this._ExpActorWindow.refresh();
  435.         this._ExpActorWindow.select(0);
  436. };
  437. Scene_ExpBox.prototype.onZSitemOk = function() {
  438.         this._ZsBoxWindow.show();
  439.         this._ZsBoxWindow.activate();
  440.         this._ZsBoxWindow.refresh();
  441.         this._ZsBoxWindow.select(0);
  442. };
  443. Scene_ExpBox.prototype.onExpActorOk = function() {
  444.         this._ZsBoxWindow._Actor = $gameParty.members()[this._ExpActorWindow.index()];
  445.         this._ZsBoxWindow.show();
  446.         this._ZsBoxWindow.activate();
  447.         this._ZsBoxWindow.refresh();
  448.         this._ZsBoxWindow.select(0);//
  449. };
  450. Scene_ExpBox.prototype.onExpActorCancel = function() {
  451.         this._ZsBoxWindow._Actor = null;
  452.         this._ExpActorWindow.deselect();
  453.         this._ExpBoxWindow.activate();
  454.         this._ExpBoxWindow.refresh();
  455.         this._ExpBoxWindow.select(0);
  456. };
  457. Scene_ExpBox.prototype.onZJ1Ok = function() {
  458.         var zs = this._ZsBoxWindow._Actor?1:JLZS2;
  459.         var s = Math.round(JYCX2*0.01/zs);
  460.         this._ZsBoxWindow._ZsShu += s;
  461.         $gameSystem.BGEWexp(-s*zs);
  462.         this._ZsBoxWindow.activate();
  463.         this._ZsBoxWindow.refresh();
  464.         this._ExpBoxWindow.refresh();
  465. };
  466. Scene_ExpBox.prototype.onZJ2Ok = function() {
  467.         var zs = this._ZsBoxWindow._Actor?1:JLZS2;
  468.         var s = Math.round(JYCX2*0.1/zs);
  469.         this._ZsBoxWindow._ZsShu += s;
  470.         $gameSystem.BGEWexp(-s*zs);
  471.         this._ZsBoxWindow.activate();
  472.         this._ZsBoxWindow.refresh();
  473.         this._ExpBoxWindow.refresh();
  474. };
  475. Scene_ExpBox.prototype.onZJ3Ok = function() {
  476.         var zs = this._ZsBoxWindow._Actor?1:JLZS2;
  477.         var s = Math.round($gameSystem.EWexp()/zs);
  478.         this._ZsBoxWindow._ZsShu += s;
  479.         $gameSystem.BGEWexp(-s*zs);
  480.         this._ZsBoxWindow.activate();
  481.         this._ZsBoxWindow.refresh();
  482.         this._ZsBoxWindow.select(4);
  483.         this._ExpBoxWindow.refresh();
  484. };
  485. Scene_ExpBox.prototype.onZJ4Ok = function() {
  486.         var zs = this._ZsBoxWindow._Actor?1:JLZS2;
  487.         $gameSystem.BGEWexp(this._ZsBoxWindow._ZsShu*zs);
  488.         this._ZsBoxWindow._ZsShu = 0;
  489.         this._ZsBoxWindow.activate();
  490.         this._ZsBoxWindow.refresh();
  491.         this._ExpBoxWindow.refresh();
  492. };
  493. Scene_ExpBox.prototype.onZJOk = function() {
  494.         var s = this._ZsBoxWindow._ZsShu;
  495.         if (this._ZsBoxWindow._Actor) {
  496.                 if (se2) AudioManager.playSe(se2);
  497.                 var i = this._ZsBoxWindow._Actor;
  498.                 i.changeExp(i.currentExp()+s, false);
  499.         } else {
  500.                 if (se3) AudioManager.playSe(se3);
  501.                 if (JLZS1>0) {
  502.                         $gameParty.gainItem($dataItems[JLZS1], s);
  503.                 } else {
  504.                         $gameParty.gainGold(s);
  505.                 }
  506.         };
  507.         this._ZsBoxWindow._ZsShu = 0;
  508.         this.onZJCancel();
  509. };
  510. Scene_ExpBox.prototype.onZJCancel = function() {
  511.         if (this._ZsBoxWindow._ZsShu>0) {
  512.                 var zs = this._ZsBoxWindow._Actor?1:JLZS2;
  513.                 $gameSystem.BGEWexp(this._ZsBoxWindow._ZsShu*zs);
  514.                 this._ZsBoxWindow._ZsShu = 0;
  515.         };
  516.         this._ZsBoxWindow.refresh();
  517.         this._ZsBoxWindow.hide();
  518.         this._ZsBoxWindow.deselect();
  519.         if (this._ZsBoxWindow._Actor) {
  520.                 this._ExpActorWindow.activate();
  521.                 this._ExpActorWindow.refresh();
  522.                 this._ExpBoxWindow.refresh();
  523.         } else {
  524.                 this._ExpBoxWindow.activate();
  525.                 this._ExpBoxWindow.refresh();
  526.         };
  527. };
  528. //-----------------------------------------------------------------------------
  529. Game_System.prototype.EWexp = function() {
  530.         if (!this._DREWexp) this._DREWexp = 0;
  531.         return this._DREWexp.clamp(0, JYCX2);
  532. };
  533. Game_System.prototype.BGEWexp = function(s) {
  534.         var exp = this.EWexp();
  535.         s = Math.round(s);
  536.         if (exp+s>JYCX2) s = JYCX2-exp;
  537.         this._DREWexp += s;
  538. };
  539. Game_System.prototype.EWexpBFB = function() {
  540.         return parseInt(this.EWexp() / JYCX2 * 100).clamp(0, 100);
  541. };
  542. var _EWBattleManager_gainExp = BattleManager.gainExp;
  543. BattleManager.gainExp = function() {
  544.         _EWBattleManager_gainExp.call(this);
  545.         if (this._rewards && this._rewards.exp) $gameSystem.BGEWexp(parseInt(this._rewards.exp*JYCX1));
  546. };
  547.  
  548. var _EWGame_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  549. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  550.     _EWGame_Interpreter_pluginCommand.call(this, command, args)
  551.     if (command === '打开储蓄池') SceneManager.push(Scene_ExpBox);
  552. };

//————————————————————————————————
【使用方法】把上述代码新建成插件,插件命名:CHK_ExpBox

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

点评

发表于 2022-11-30 08:00
回复 支持 1 反对 0

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
4517
在线时间
677 小时
注册时间
2013-1-18
帖子
709
7
 楼主| 发表于 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%,再选择重置,就会出现这样。



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

点评

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
81
在线时间
10 小时
注册时间
2022-8-14
帖子
1
8
发表于 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点数额。

等大佬有时间修复一下吧
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
4517
在线时间
677 小时
注册时间
2013-1-18
帖子
709
9
 楼主| 发表于 2022-11-30 22:37:30 | 只看该作者
cenhangkai 发表于 2022-11-30 05:36
/*:
* @plugindesc v1.1 经验储蓄池
* @author CHK

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

回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
4256
在线时间
541 小时
注册时间
2018-11-12
帖子
113
10
发表于 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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-25 07:03

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表