查看: 2888|回复: 13

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

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

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

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

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

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

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

使用道具 举报

梦石
0
星屑
5274
在线时间
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 | 显示全部楼层
  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);
  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实用插件教程点击红字传送
回复

使用道具 举报

梦石
0
星屑
4669
在线时间
570 小时
注册时间
2018-11-12
回帖
120
发表于 2022-11-30 05:36:18 | 显示全部楼层
本帖最后由 cenhangkai 于 2022-11-30 21:46 编辑
  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. var parameters = PluginManager.parameters('CHK_ExpBox');

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

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

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

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

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

  174. Window_ExpBox.prototype.initialize = function() {
  175.         Window_Command.prototype.initialize.call(this, 0, 0);
  176.         this.refresh();
  177.         if (BJSD) this.opacity = 0;
  178. };
  179. Window_ExpBox.prototype.windowWidth = function() {
  180.     return 716-180;
  181. };
  182. Window_ExpBox.prototype.windowHeight = function() {
  183.     return 576;
  184. };
  185. Window_ExpBox.prototype.standardFontSize = function() {
  186.     return WZSD3;
  187. };
  188. Window_ExpBox.prototype.standardPadding = function() {
  189.         return 0;
  190. };
  191. Window_ExpBox.prototype.itemTextAlign = function() {
  192.     return 'center';
  193. };
  194. Window_ExpBox.prototype.itemRect = function(index) {
  195.     var rect = new Rectangle();
  196.     var maxCols = this.maxCols();
  197.     rect.width = this.itemWidth()-18*2;
  198.     rect.height = this.itemHeight();
  199.     rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX+18;
  200.     rect.y = Math.floor(index / maxCols) * rect.height - this._scrollY;
  201.         rect.y = rect.y+this.windowHeight()-rect.height*2-this.standardPadding()-this.standardFontSize();
  202.     return rect;
  203. };
  204. Window_ExpBox.prototype.makeCommandList = function() {
  205.     this.addCommand(JYCX3,    'FPexp');
  206.     this.addCommand(JLZS3,  'ZSitem');
  207. };
  208. Window_ExpBox.prototype.refresh = function() {
  209.         Window_Command.prototype.refresh.call(this);
  210.         if (!BJSD) {
  211.                 this.contents.paintOpacity = 77;
  212.                 this.contents.fillRect(2, 30, this.contentsWidth()-4, this.contentsHeight()-220, this.textColor(15));
  213.                 this.contents.paintOpacity = 200;
  214.                 this.contents.gradientFillRect(2, 2, this.contentsWidth()-4, 28, '#5d76ad', '#000000',90);
  215.                 this.contents.gradientFillRect(2, 30, (this.contentsWidth()-4)/2, 1, '#000000', '#5d5d5d');
  216.                 this.contents.gradientFillRect((this.contentsWidth()-4)/2+2, 30, (this.contentsWidth()-4)/2, 1, '#5d5d5d', '#000000');
  217.                 this.contents.paintOpacity = 255;
  218.         };
  219.         var item = JLZS1>0?$dataItems[JLZS1]:null;
  220.         var name = JLZS1>0?item.name:WZSD5;
  221.         this.changeTextColor(this.textColor(JLZS1>0?(item.meta.颜色?item.meta.颜色:16):6));
  222.         var s = JLZS1>0?$gameParty.numItems(item):$gameParty.gold();
  223.         var max = JLZS1>0?$gameParty.maxItems():$gameParty.maxGold();
  224.         if (s>=max) this.changeTextColor(this.textColor(18));
  225.         this.drawText('背包持有['+name+']:'+s+(s>=max?'(上限)':''), 0, 350, this.contentsWidth(), 'center');
  226.         this.contents.fontSize = 16;
  227.         this.changeTextColor(this.textColor(8));
  228.         this.drawText(WZSD1, 0, -3, this.contentsWidth(), 'center');
  229.         this.resetFontSettings();
  230.         var w = 200;
  231.         var h = 274;
  232.         var x = parseInt((this.contentsWidth()-w)/2);
  233.         var y = this.contentsHeight()-h-this.itemHeight()*2-18*2-126;
  234.         this.contents.paintOpacity = 155;
  235.         this.contents.fillRect(x, y, w, h, this.textColor(15));
  236.         this.contents.paintOpacity = 255;
  237.         var s = $gameSystem.EWexpBFB()/100;
  238.         h = parseInt(270 * s);
  239.         y = this.contentsHeight()-h-this.itemHeight()*2-18*2-130;
  240.         this.contents.gradientFillRect(x+2, y+2, w-4, h, this.textColor(24), this.textColor(3),90);
  241.         this.changeTextColor(this.textColor(24));
  242.         this.drawText($gameSystem.EWexp()+'('+$gameSystem.EWexpBFB()+'%)', 0, 35, this.contentsWidth(), 'center');
  243.         var yy = 388;
  244.         this.changeTextColor(this.textColor(8));
  245.         this.drawText('①战斗通关时敌人经验值的'+(JYCX1*100)+'%累计在此。', 18, yy, this.contentsWidth());
  246.         this.drawText('②经验值最高累计至'+(JYCX2/10000)+'万,超过无效。', 18, yy+this.standardFontSize(), this.contentsWidth());
  247.         this.drawText('③可将经验分配给指定角色,或折算['+name+']。', 18, yy+this.standardFontSize()*2, this.contentsWidth());
  248.         this.resetFontSettings();
  249. };
  250. //-----------------------------------------------------------------------------
  251. function Window_ExpActor() {
  252.     this.initialize.apply(this, arguments);
  253. }

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

  256. Window_ExpActor.prototype.initialize = function() {
  257.     Window_MenuStatus.prototype.initialize.call(this, 0, 0);
  258.         this.deactivate();
  259.         this.deselect();
  260.         if (BJSD) this.opacity = 0;
  261. };
  262. Window_ExpActor.prototype.windowWidth = function() {
  263.     return 180;
  264. };
  265. Window_ExpActor.prototype.windowHeight = function() {
  266.     return 576;
  267. };
  268. Window_ExpActor.prototype.drawItem = function(index) {
  269.     var actor = $gameParty.members()[index];
  270.     var rect = this.itemRect(index);
  271.     this.changePaintOpacity(!actor.isMaxLevel());
  272.         var h = parseInt((this.windowHeight()-18*2)/4);
  273.         this.contents._context.imageSmoothingEnabled = false;
  274.     this.drawActorFace(actor, rect.x+5, rect.y, h-10, h-10);
  275.         this.contents._context.imageSmoothingEnabled = true;
  276.         this.contents.fontSize = 16;
  277.         var y = rect.y+h;
  278.         this.drawText(actor.level+'级 '+actor.name(), rect.x, y-40, rect.width, 'center');
  279.         var nexp = actor.currentExp()-actor.expForLevel(actor.level);
  280.     var mexp = actor.nextLevelExp()-actor.expForLevel(actor.level);
  281.         var changdu = actor.isMaxLevel()? 1 : nexp/mexp;
  282.         var text = actor.isMaxLevel()? '∞' : nexp+'/'+mexp;
  283.         var yanse1 = actor.isMaxLevel()? '#bda461' : '#00731e';
  284.         var yanse2 = actor.isMaxLevel()? '#f5d682' : '#00ff43';
  285.         this.contents.gradientFillRect(rect.x, y-10, rect.width, 10, '#474747',this.textColor(15),90);
  286.         this.contents.gradientFillRect(rect.x+1, y-9, (rect.width-2)*changdu, 8, yanse2, yanse1,90);
  287.         this.contents.fontSize = 13;
  288.         this.drawText(text, rect.x, y-25, rect.width, 'center');
  289.     this.changePaintOpacity(true);
  290. };
  291. //-----------------------------------------------------------------------------
  292. function Window_ZsBox() {
  293.   this.initialize.apply(this, arguments);
  294. }
  295. Window_ZsBox.prototype = Object.create(Window_Command.prototype);
  296. Window_ZsBox.prototype.constructor = Window_ZsBox;

  297. Window_ZsBox.prototype.initialize = function() {
  298.         Window_Command.prototype.initialize.call(this, 0, 0);
  299.         this.x = Math.ceil((Graphics.width - this.width) / 2)-(536-this.width)/2;
  300.         this.y = Math.ceil((Graphics.height - this.height) / 2)-10;
  301.         this._ZsShu = 0;
  302.         this._Actor = null;
  303.         this.deactivate();
  304.         this.hide();
  305. };
  306. Window_ZsBox.prototype.windowWidth = function() {
  307.     return 716/2;
  308. };
  309. Window_ZsBox.prototype.windowHeight = function() {
  310.     return 576/4;
  311. };
  312. Window_ZsBox.prototype.standardFontSize = function() {
  313.     return WZSD4;
  314. };
  315. Window_ZsBox.prototype.maxCols = function() {
  316.         if (!this._Actor&&$gameSystem.EWexpBFB()<1&&!this._ZsShu) return 1;
  317.     return 5;
  318. };
  319. Window_ZsBox.prototype.itemTextAlign = function() {
  320.     return 'center';
  321. };
  322. Window_ZsBox.prototype.spacing = function() {
  323.     return 0;
  324. };
  325. Window_ZsBox.prototype.itemRect = function(index) {
  326.     var rect = new Rectangle();
  327.     var maxCols = this.maxCols();
  328.     rect.width = this.itemWidth();
  329.     rect.height = this.itemHeight();
  330.     rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX;
  331.     rect.y = Math.floor(index / maxCols) * rect.height - this._scrollY;
  332.         rect.y = rect.y+this.windowHeight()-rect.height-this.standardPadding()-this.standardFontSize();
  333.     return rect;
  334. };
  335. Window_ZsBox.prototype.makeCommandList = function() {
  336.         if (!this._Actor&&$gameSystem.EWexpBFB()<1&&!this._ZsShu) return this.addCommand('经验值不足1%无法折算!',    'ZJ4', false);
  337.         this.addCommand('+1%',    'ZJ1', $gameSystem.EWexpBFB()>=1);
  338.     this.addCommand('+10%',    'ZJ2', $gameSystem.EWexpBFB()>=10);
  339.         this.addCommand('全部',    'ZJ3', this._Actor?$gameSystem.EWexp()>0:$gameSystem.EWexpBFB()>=1);
  340.         this.addCommand('重置',    'ZJ4', this._ZsShu>0);
  341.         this.addCommand('确定',    'ZJok', this._ZsShu>0);
  342. };
  343. Window_ZsBox.prototype.refresh = function() {
  344.         Window_Command.prototype.refresh.call(this);
  345.         this.contents.paintOpacity = 255;
  346.         this.contents.fontSize = 20;
  347.         var text = this._Actor?'请输入给['+this._Actor.name()+']的额度。':'请输入想要折算的额度。';
  348.         this.drawText(text, 0, -5, this.contentsWidth(), 'center');
  349.         this.contents.fontSize = 18;
  350.         this.changeTextColor(this.textColor(24));
  351.         if (this._Actor) {
  352.                 var actor = this._Actor;
  353.                 var nexp = actor.currentExp()-actor.expForLevel(actor.level);
  354.                 var mexp = actor.nextLevelExp()-actor.expForLevel(actor.level);
  355.                 text = '距离升级还差'+(mexp-nexp)+'点经验。';
  356.         } else {
  357.                 var dw = JLZS1>0?'个。':'枚。';
  358.                 text = '经验值折算比例:1%'+'换'+Math.round(JYCX2*0.01/JLZS2)+dw;
  359.         };
  360.         this.drawText(text, 0, this.contents.fontSize, this.contentsWidth(), 'center');
  361.         this.changeTextColor(this.textColor(16));
  362.         text = '折算'+(JLZS1>0?$dataItems[JLZS1].name:WZSD5)+':'+this._ZsShu;
  363.         if (this._Actor) text = '给与经验:'+ this._ZsShu;
  364.         this.drawText(text, 0, this.contents.fontSize*2, this.contentsWidth(), 'center');
  365.         this.resetFontSettings();
  366. };
  367. //-----------------------------------------------------------------------------
  368. function Scene_ExpBox() {
  369.     this.initialize.apply(this, arguments);
  370. }
  371. Scene_ExpBox.prototype = Object.create(Scene_MenuBase.prototype);
  372. Scene_ExpBox.prototype.constructor = Scene_ExpBox;

  373. Scene_ExpBox.prototype.initialize = function() {
  374.     Scene_MenuBase.prototype.initialize.call(this);
  375. };
  376. Scene_ExpBox.prototype.create = function() {
  377.         Scene_MenuBase.prototype.create.call(this);
  378.         if (se1) AudioManager.playSe(se1);
  379.         this._ExpBoxWindow = new Window_ExpBox();
  380.         this._ExpBoxWindow.setHandler('FPexp',     this.onFpexpOk.bind(this));
  381.         this._ExpBoxWindow.setHandler('ZSitem',     this.onZSitemOk.bind(this));
  382.         this._ExpBoxWindow.setHandler('cancel', this.popScene.bind(this));
  383.         this.addWindow(this._ExpBoxWindow);
  384.         this._ExpActorWindow = new Window_ExpActor();
  385.         this._ExpActorWindow.setHandler('ok', this.onExpActorOk.bind(this));
  386.         this._ExpActorWindow.setHandler('cancel', this.onExpActorCancel.bind(this));
  387.         this.addChild(this._ExpActorWindow);
  388.         this._ZsBoxWindow = new Window_ZsBox();
  389.         this._ZsBoxWindow.setHandler('ZJ1', this.onZJ1Ok.bind(this));
  390.         this._ZsBoxWindow.setHandler('ZJ2', this.onZJ2Ok.bind(this));
  391.         this._ZsBoxWindow.setHandler('ZJ3', this.onZJ3Ok.bind(this));
  392.         this._ZsBoxWindow.setHandler('ZJ4', this.onZJ4Ok.bind(this));
  393.         this._ZsBoxWindow.setHandler('ZJok', this.onZJOk.bind(this));
  394.         this._ZsBoxWindow.setHandler('cancel', this.onZJCancel.bind(this));
  395.         this.addChild(this._ZsBoxWindow);
  396.         var w1 = this._ExpBoxWindow;
  397.         var w2 = this._ExpActorWindow;
  398.         w1.x = Math.ceil((Graphics.width - w1.width - w2.width) / 2);
  399.         w1.y = w2.y = Math.ceil((Graphics.height - w1.height) / 2);
  400.         w2.x = Math.ceil((Graphics.width - w2.width + w1.width) / 2);
  401. };
  402. Scene_ExpBox.prototype.createWindowLayer = function() {
  403.     var width = Graphics.boxWidth;
  404.     var height = Graphics.boxHeight;
  405.     var x = (Graphics.width - width) / 2;
  406.     var y = (Graphics.height - height) / 2;
  407.     this._windowLayer = new WindowLayer();
  408.     this._windowLayer.move(x, y, width, height);
  409.     this.addChild(this._windowLayer);
  410. };
  411. Scene_ExpBox.prototype.createBackground = function() {
  412.         Scene_MenuBase.prototype.createBackground.call(this);
  413.         if (BJSD) {
  414.                 this._ExpBoxBJ = new Sprite(ImageManager.loadPicture("lidexin1"));
  415.                 this.addChild(this._ExpBoxBJ);
  416.                 this._ExpBoxBJ.x = (Graphics.width-this._ExpBoxBJ.width)/2;
  417.                 this._ExpBoxBJ.y = (Graphics.height-this._ExpBoxBJ.height)/2;
  418.         };
  419. };
  420. Scene_ExpBox.prototype.onFpexpOk = function() {
  421.         this._ExpActorWindow.activate();
  422.         this._ExpActorWindow.refresh();
  423.         this._ExpActorWindow.select(0);
  424. };
  425. Scene_ExpBox.prototype.onZSitemOk = function() {
  426.         this._ZsBoxWindow.show();
  427.         this._ZsBoxWindow.activate();
  428.         this._ZsBoxWindow.refresh();
  429.         this._ZsBoxWindow.select(0);
  430. };
  431. Scene_ExpBox.prototype.onExpActorOk = function() {
  432.         this._ZsBoxWindow._Actor = $gameParty.members()[this._ExpActorWindow.index()];
  433.         this._ZsBoxWindow.show();
  434.         this._ZsBoxWindow.activate();
  435.         this._ZsBoxWindow.refresh();
  436.         this._ZsBoxWindow.select(0);//
  437. };
  438. Scene_ExpBox.prototype.onExpActorCancel = function() {
  439.         this._ZsBoxWindow._Actor = null;
  440.         this._ExpActorWindow.deselect();
  441.         this._ExpBoxWindow.activate();
  442.         this._ExpBoxWindow.refresh();
  443.         this._ExpBoxWindow.select(0);
  444. };
  445. Scene_ExpBox.prototype.onZJ1Ok = function() {
  446.         var zs = this._ZsBoxWindow._Actor?1:JLZS2;
  447.         var s = Math.round(JYCX2*0.01/zs);
  448.         this._ZsBoxWindow._ZsShu += s;
  449.         $gameSystem.BGEWexp(-s*zs);
  450.         this._ZsBoxWindow.activate();
  451.         this._ZsBoxWindow.refresh();
  452.         this._ExpBoxWindow.refresh();
  453. };
  454. Scene_ExpBox.prototype.onZJ2Ok = function() {
  455.         var zs = this._ZsBoxWindow._Actor?1:JLZS2;
  456.         var s = Math.round(JYCX2*0.1/zs);
  457.         this._ZsBoxWindow._ZsShu += s;
  458.         $gameSystem.BGEWexp(-s*zs);
  459.         this._ZsBoxWindow.activate();
  460.         this._ZsBoxWindow.refresh();
  461.         this._ExpBoxWindow.refresh();
  462. };
  463. Scene_ExpBox.prototype.onZJ3Ok = function() {
  464.         var zs = this._ZsBoxWindow._Actor?1:JLZS2;
  465.         var s = Math.round($gameSystem.EWexp()/zs);
  466.         this._ZsBoxWindow._ZsShu += s;
  467.         $gameSystem.BGEWexp(-s*zs);
  468.         this._ZsBoxWindow.activate();
  469.         this._ZsBoxWindow.refresh();
  470.         this._ZsBoxWindow.select(4);
  471.         this._ExpBoxWindow.refresh();
  472. };
  473. Scene_ExpBox.prototype.onZJ4Ok = function() {
  474.         var zs = this._ZsBoxWindow._Actor?1:JLZS2;
  475.         $gameSystem.BGEWexp(this._ZsBoxWindow._ZsShu*zs);
  476.         this._ZsBoxWindow._ZsShu = 0;
  477.         this._ZsBoxWindow.activate();
  478.         this._ZsBoxWindow.refresh();
  479.         this._ExpBoxWindow.refresh();
  480. };
  481. Scene_ExpBox.prototype.onZJOk = function() {
  482.         var s = this._ZsBoxWindow._ZsShu;
  483.         if (this._ZsBoxWindow._Actor) {
  484.                 if (se2) AudioManager.playSe(se2);
  485.                 var i = this._ZsBoxWindow._Actor;
  486.                 i.changeExp(i.currentExp()+s, false);
  487.         } else {
  488.                 if (se3) AudioManager.playSe(se3);
  489.                 if (JLZS1>0) {
  490.                         $gameParty.gainItem($dataItems[JLZS1], s);
  491.                 } else {
  492.                         $gameParty.gainGold(s);
  493.                 }
  494.         };
  495.         this._ZsBoxWindow._ZsShu = 0;
  496.         this.onZJCancel();
  497. };
  498. Scene_ExpBox.prototype.onZJCancel = function() {
  499.         if (this._ZsBoxWindow._ZsShu>0) {
  500.                 var zs = this._ZsBoxWindow._Actor?1:JLZS2;
  501.                 $gameSystem.BGEWexp(this._ZsBoxWindow._ZsShu*zs);
  502.                 this._ZsBoxWindow._ZsShu = 0;
  503.         };
  504.         this._ZsBoxWindow.refresh();
  505.         this._ZsBoxWindow.hide();
  506.         this._ZsBoxWindow.deselect();
  507.         if (this._ZsBoxWindow._Actor) {
  508.                 this._ExpActorWindow.activate();
  509.                 this._ExpActorWindow.refresh();
  510.                 this._ExpBoxWindow.refresh();
  511.         } else {
  512.                 this._ExpBoxWindow.activate();
  513.                 this._ExpBoxWindow.refresh();
  514.         };
  515. };
  516. //-----------------------------------------------------------------------------
  517. Game_System.prototype.EWexp = function() {
  518.         if (!this._DREWexp) this._DREWexp = 0;
  519.         return this._DREWexp.clamp(0, JYCX2);
  520. };
  521. Game_System.prototype.BGEWexp = function(s) {
  522.         var exp = this.EWexp();
  523.         s = Math.round(s);
  524.         if (exp+s>JYCX2) s = JYCX2-exp;
  525.         this._DREWexp += s;
  526. };
  527. Game_System.prototype.EWexpBFB = function() {
  528.         return parseInt(this.EWexp() / JYCX2 * 100).clamp(0, 100);
  529. };
  530. var _EWBattleManager_gainExp = BattleManager.gainExp;
  531. BattleManager.gainExp = function() {
  532.         _EWBattleManager_gainExp.call(this);
  533.         if (this._rewards && this._rewards.exp) $gameSystem.BGEWexp(parseInt(this._rewards.exp*JYCX1));
  534. };

  535. var _EWGame_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  536. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  537.     _EWGame_Interpreter_pluginCommand.call(this, command, args)
  538.     if (command === '打开储蓄池') SceneManager.push(Scene_ExpBox);
  539. };
复制代码

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

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

点评

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

使用道具 举报

梦石
0
星屑
5274
在线时间
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
星屑
5274
在线时间
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
星屑
4669
在线时间
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.

在本版发帖返回顶部