扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 138|回复: 0

[转载发布] 请问口袋妖怪的四技能怎么做?SRD的插件有BUG

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    2025-2-4 02:05
  • 签到天数: 110 天

    连续签到: 2 天

    [LV.6]常住居民II

    2327

    主题

    395

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10470
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13220

    灌水之王

    发表于 2024-2-24 08:20:08 | 显示全部楼层 |阅读模式
    角色最多四个技能,习得新技能后如果超出四个则选择一个删除,那么问题来了
    SRD_PKM_4MovesOnly这个插件其他的都正常,但是战斗经验会结算两次,这就很尴尬了,一是提示技能满的时候结算了一次,二是删除技能时又结算一次,请高手帮忙看看怎么回事?JAVASCRIPT 代码
    1. /*:
    2. * @plugindesc Pokemon Plugin: Restricts the maximum amount of skills an Actor can learn to 4.
    3. * @author SumRndmDde
    4. *
    5. * @param == Forget Window ==
    6. * @default
    7. *
    8. * @param Max Columns
    9. * @desc This will be the maximum amount of columns in the Skill Forget Window's list of Skills.
    10. * @default 1
    11. *
    12. * @param Spacing
    13. * @desc This will be the spacing of the choices in the Skill Forget Window's list of Skills.
    14. * @default 48
    15. *
    16. * @param Message Background
    17. * @desc This is the message background used for Show Text alerts.
    18. * '0' = normal, '1' = dim, '2' = none
    19. * @default 0
    20. *
    21. * @param == Alert Lines ==
    22. * @default
    23. *
    24. * @param Alert Line 1
    25. * @desc The first line for the alert dialogue when an Actor has learned too many Skills. \actor = Specific Actor Name
    26. * @default \actor has too many moves!
    27. *
    28. * @param Alert Line 2
    29. * @desc The second line for the alert dialogue when an Actor has learned too many Skills. \actor = Specific Actor Name
    30. * @default \!Please select one to remove.
    31. *
    32. * @param Alert Line 3
    33. * @desc The third line for the alert dialogue when an Actor has learned too many Skills. \actor = Specific Actor Name
    34. * @default
    35. *
    36. * @param Alert Line 4
    37. * @desc The fourth line for the alert dialogue when an Actor has learned too many Skills. \actor = Specific Actor Name
    38. * @default
    39. *
    40. * @param == End Lines ==
    41. * @default
    42. *
    43. * @param End Line 1
    44. * @desc The first line for the forgotten Skill dialogue.
    45. * \actor = Actor Name       \skill = Forgoten Skill Name
    46. * @default 1\..\..\..2\..\..\..and poof!
    47. *
    48. * @param End Line 2
    49. * @desc The second line for the forgotten Skill dialogue.
    50. * \actor = Actor Name       \skill = Forgoten Skill Name
    51. * @default \!\actor has forgotten \skill!
    52. *
    53. * @param End Line 3
    54. * @desc The third line for the forgotten Skill dialogue.
    55. * \actor = Actor Name       \skill = Forgoten Skill Name
    56. * @default
    57. *
    58. * @param End Line 4
    59. * @desc The fourth line for the forgotten Skill dialogue.
    60. * \actor = Actor Name       \skill = Forgoten Skill Name
    61. * @default
    62. *
    63. * @help
    64. *
    65. *
    66. *
    67. * Pokemon 4 Moves Only
    68. * Version 1.00
    69. * SumRndmDde
    70. *
    71. *
    72. * The name says it all.
    73. * This is a Plugin that restricts the maximum amount of Skills an Actor
    74. * can learn to 4.
    75. *
    76. * If the actor learns more than 4, then a screen will display, and the
    77. * Actor must select one Skill to delete.
    78. *
    79. * This is based off of the system used in Pokemon.
    80. *
    81. * Other things you may want to note are:
    82. *  - When initializing Actors, they're given their 4 most recent Skills
    83. *  - This Plugin does not affect Enemies
    84. *  - You can manipulate the dialogue surrounding the Skill deletion
    85. *  - You can set certain Skills to be un-deleteable
    86. *  - An Actor's most recently learned Skill can always be deleted
    87. *
    88. * If you wish to implement a system to delete un-deleteable Skills,
    89. * use the extension Plugin: SRD_PKM_MoveDeleter
    90. *
    91. * ==========================================================================
    92. * How to Use
    93. * ==========================================================================
    94. *
    95. * This Plugin is plug-in and play for the most part.
    96. *
    97. * However, there are a few things you may wish to customize:
    98. *
    99. *
    100. * ==========================================================================
    101. * Parameters
    102. * ==========================================================================
    103. *
    104. * You can manipulate the Parameters to change how the Skill Deletion
    105. * choices look, along with the dialogue used to inform the Player a Skill
    106. * must be deleted.
    107. *
    108. * Change "Message Background" to change the dialogue background to
    109. * normal, dim, etc.
    110. *
    111. * For the "Alert Lines" and the "End Lines", each line referes to a line
    112. * on the Show Text event that is displayed.
    113. *
    114. * ==========================================================================
    115. * Skill Notetags
    116. * ==========================================================================
    117. *
    118. *
    119. *
    120. * If you input this Notetag into a Skill's notebox, then that Skill cannot
    121. * be deleted during the Skill deletion process.
    122. *
    123. * There are two exceptions:
    124. *  - If the Skill is the 5th Skill to be learned, then it will ALWAYS be
    125. *    deleteable.
    126. *  - If you use the SRD_PKM_MoveDeleter extension Plugin, then you can
    127. *    call upon a screen to force any Actor to delete any Skill.
    128. *
    129. *
    130. * ==========================================================================
    131. *  End of Help File
    132. * ==========================================================================
    133. *
    134. * Welcome to the bottom of the Help file.
    135. *
    136. *
    137. * Thanks for reading!
    138. * If you have questions, or if you enjoyed this Plugin, please check
    139. * out my YouTube channel!
    140. *
    141. * [url]https://www.youtube.com/c/SumRndmDde[/url]
    142. *
    143. *
    144. * Until next time,
    145. *   ~ SumRndmDde
    146. */
    147. //Ugh, I think I'm gonna have to start actually making this
    148. //an extendable Plugin or somethin... :/
    149. var SRD = SRD || {};
    150. SRD.PKM = SRD.PKM || {};
    151. SRD.PKM.FourMovesOnly = {};
    152. var Imported = Imported || {};
    153. Imported.SRD_PKM_4MovesOnly = true;
    154. SRD.PKM.FourMovesOnly.maxColumns = Number(PluginManager.parameters('SRD_PKM_4MovesOnly')['Max Columns']);
    155. SRD.PKM.FourMovesOnly.spacing = Number(PluginManager.parameters('SRD_PKM_4MovesOnly')['Spacing']);
    156. SRD.PKM.FourMovesOnly.background = Number(PluginManager.parameters('SRD_PKM_4MovesOnly')['Message Background']);
    157. SRD.PKM.FourMovesOnly.alertLinesCount = 4;
    158. SRD.PKM.FourMovesOnly.alertLines = [];
    159. for(var i = 1; i  4){
    160.             if($gameParty.forgetSkillReadyActorId() === 0){
    161.                     var lines = [];
    162.                     for(var i = 0; i < SRD.PKM.FourMovesOnly.alertLinesCount; i++){
    163.                             lines[i] = SRD.PKM.FourMovesOnly.alertLines[i].replace(/\\actor/im, this._name);
    164.                     }
    165.                     for(var i = 0; i < SRD.PKM.FourMovesOnly.alertLinesCount; i++){
    166.                             if(lines[i].trim().length > 0){
    167.                                     $gameMessage.setBackground(SRD.PKM.FourMovesOnly.background);
    168.                                     $gameMessage.add(lines[i]);
    169.                             }
    170.                     }
    171.                     $gameParty.setForgetSkillReady(1);
    172.                     $gameParty.setForgetSkillReadyActorId(this._actorId);
    173.             }else{
    174.                     $gameParty.addForgetSkillReadyActorIds(this._actorId);
    175.             }
    176.     }
    177. };
    178. //-----------------------------------------------------------------------------
    179. // Game_Party
    180. //-----------------------------------------------------------------------------
    181. SRD.PKM.FourMovesOnly._Game_Party_initialize = Game_Party.prototype.initialize;
    182. Game_Party.prototype.initialize = function(){
    183.     SRD.PKM.FourMovesOnly._Game_Party_initialize.call(this);
    184.     this._skillForgetReady = 0;
    185.     this._skillForgetReadyActorId = 0;
    186.     this._skillForgetReadyActorIds = [];
    187.     this._canRemoveHMMoves = false;
    188. };
    189. Game_Party.prototype.forgetSkillReady = function(){
    190.     returnthis._skillForgetReady;
    191. };
    192. Game_Party.prototype.forgetSkillReadyActorId = function(){
    193.     returnthis._skillForgetReadyActorId;
    194. };
    195. Game_Party.prototype.setForgetSkillReady = function(isReady){
    196.     this._skillForgetReady = isReady;
    197. };
    198. Game_Party.prototype.getForgetSkillReady = function(){
    199.     returnthis._skillForgetReady;
    200. };
    201. Game_Party.prototype.setForgetSkillReadyActorId = function(actorId){
    202.     this._skillForgetReadyActorId = actorId;
    203. };
    204. Game_Party.prototype.addForgetSkillReadyActorIds = function(actorId){
    205.     this._skillForgetReadyActorIds.push(actorId);
    206. };
    207. Game_Party.prototype.getNextForgetSkillReadyActorId = function(){
    208.     var result = this._skillForgetReadyActorIds[0];
    209.     this._skillForgetReadyActorIds.splice(0, 1);
    210.     return result;
    211. };
    212. Game_Party.prototype.checkForgetSkillReadyActorId = function(){
    213.         returnthis._skillForgetReadyActorIds.length !== 0;
    214. };
    215. Game_Party.prototype.canRemoveHMMoves = function(){
    216.     returnthis._canRemoveHMMoves;
    217. };
    218. Game_Party.prototype.setCanRemoveHMMoves = function(canHM){
    219.     this._canRemoveHMMoves = canHM;
    220. };
    221. //-----------------------------------------------------------------------------
    222. // Scene_Base
    223. //-----------------------------------------------------------------------------
    224. SRD.PKM.FourMovesOnly._Scene_Base_update = Scene_Base.prototype.update;
    225. Scene_Base.prototype.update = function(){
    226.     SRD.PKM.FourMovesOnly._Scene_Base_update.call(this);
    227.     if($gameParty.forgetSkillReady() > 0 && !$gameMessage.isBusy()){
    228.             if($gameParty.forgetSkillReady() === 1){
    229.                     $gameParty.setForgetSkillReady(0);
    230.                         SceneManager.push(Scene_ForgetSkill);
    231.             }
    232.             if($gameParty.forgetSkillReady() === 2){
    233.                     $gameMessage.clear();
    234.                         var id = $gameParty.getNextForgetSkillReadyActorId();
    235.                     var actor = $gameActors.actor(id);
    236.                     var lines = [];
    237.                     for(var i = 0; i < SRD.PKM.FourMovesOnly.alertLinesCount; i++){
    238.                             lines[i] = SRD.PKM.FourMovesOnly.alertLines[i].replace(/\\actor/im, actor.name());
    239.                     }
    240.                     for(var i = 0; i < SRD.PKM.FourMovesOnly.alertLinesCount; i++){
    241.                             if(lines[i].trim().length > 0){
    242.                                     $gameMessage.setBackground(SRD.PKM.FourMovesOnly.background);
    243.                                     $gameMessage.add(lines[i]);
    244.                             }
    245.                     }
    246.                     $gameParty.setForgetSkillReady(1);
    247.                     $gameParty.setForgetSkillReadyActorId(actor.actorId());
    248.             }
    249.         }
    250. };
    251. //-----------------------------------------------------------------------------
    252. // Scene_ForgetSkill
    253. //-----------------------------------------------------------------------------
    254. function Scene_ForgetSkill(){
    255.     this.initialize.apply(this, arguments);
    256. }
    257. Scene_ForgetSkill.prototype = Object.create(Scene_ItemBase.prototype);
    258. Scene_ForgetSkill.prototype.constructor = Scene_ForgetSkill;
    259. Scene_ForgetSkill.prototype.initialize = function(){
    260.     Scene_ItemBase.prototype.initialize.call(this);
    261. };
    262. Scene_ForgetSkill.prototype.create = function(){
    263.     Scene_ItemBase.prototype.create.call(this);
    264.     this.createStatusWindow2();
    265.     this.createHelpWindow();
    266.     this.createStatusWindow();
    267.     this.createItemWindow();
    268.     this.refreshActor();
    269.     this.commandSkill();
    270. };
    271. Scene_ForgetSkill.prototype.createStatusWindow2 = function(){
    272.     this._statusWindow2 = new Window_ForgetSkillStatus2(0, 0, Graphics.boxWidth, 70);
    273.     this.addWindow(this._statusWindow2);
    274.     this._statusWindow2.refresh();
    275. }
    276. Scene_ForgetSkill.prototype.createHelpWindow = function(){
    277.         this._helpWindow = new Window_Help();
    278.     this._helpWindow.y = this._statusWindow2.y + this._statusWindow2.height;
    279.     this.addWindow(this._helpWindow);
    280. }
    281. Scene_ForgetSkill.prototype.createStatusWindow = function(){
    282.         var wx = 0;
    283.     var wy = this._helpWindow.y + this._helpWindow.height;
    284.     var ww = Graphics.boxWidth - wx;
    285.     var wh = 70;
    286.     this._statusWindow = new Window_ForgetSkillStatus(wx, wy, ww, wh);
    287.     this.addWindow(this._statusWindow);
    288.     this._statusWindow.refresh();
    289. };
    290. Scene_ForgetSkill.prototype.createItemWindow = function(){
    291.     var wx = 0;
    292.     var wy = this._statusWindow.y + this._statusWindow.height;
    293.     var ww = Graphics.boxWidth;
    294.     var wh = Graphics.boxHeight - wy;
    295.     this._itemWindow = new Window_ForgetSkillList(wx, wy, ww, wh);
    296.     this._itemWindow.setHelpWindow(this._helpWindow);
    297.     this._itemWindow.setHandler('ok', this.onItemOk.bind(this));
    298.     if($gameParty.canRemoveHMMoves()){
    299.             this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
    300.     }
    301.     this.addWindow(this._itemWindow);
    302. };
    303. Scene_ForgetSkill.prototype.actor = function(){
    304.     return $gameActors.actor($gameParty.forgetSkillReadyActorId());
    305. };
    306. Scene_ForgetSkill.prototype.user = function(){
    307.     returnthis.actor();
    308. };
    309. Scene_Skill.prototype.playSeForItem = function(){
    310. };
    311. Scene_ForgetSkill.prototype.refreshActor = function(){
    312.     var actor = this.actor();
    313.     this._statusWindow.setActor(actor);
    314.     this._itemWindow.setActor(actor);
    315. };
    316. Scene_ForgetSkill.prototype.commandSkill = function(){
    317.     this._itemWindow.activate();
    318.     this._itemWindow.selectLast();
    319. };
    320. Scene_ForgetSkill.prototype.onItemOk = function(){
    321.     this.actor().forgetSkill(this.item().id);
    322.     varname = this.actor().name();
    323.     var itemName = this.item().name;
    324.     $gameParty.setForgetSkillReadyActorId(0);
    325.     $gameParty.setCanRemoveHMMoves(false);
    326.     this.popScene();
    327.     var lines = [];
    328.     for(var i = 0; i < SRD.PKM.FourMovesOnly.endLinesCount; i++){
    329.             lines[i] = SRD.PKM.FourMovesOnly.endLines[i].replace(/\\actor/im, name);
    330.             lines[i] = lines[i].replace(/\\skill/im, itemName);
    331.     }
    332.     for(var i = 0; i < SRD.PKM.FourMovesOnly.endLinesCount; i++){
    333.             if(lines[i].trim().length > 0){
    334.                     $gameMessage.setBackground(SRD.PKM.FourMovesOnly.background);
    335.                     $gameMessage.add(lines[i]);
    336.             }
    337.     }
    338.     if($gameParty.checkForgetSkillReadyActorId()){
    339.             $gameParty.setForgetSkillReady(2);
    340.     }
    341. };
    342. Scene_ForgetSkill.prototype.onItemCancel = function(){
    343.     $gameParty.setForgetSkillReadyActorId(0);
    344.     $gameParty.setCanRemoveHMMoves(false);
    345.     this.popScene();
    346. };
    347. //-----------------------------------------------------------------------------
    348. // Window_ForgetSkillList
    349. //-----------------------------------------------------------------------------
    350. function Window_ForgetSkillList(){
    351.     this.initialize.apply(this, arguments);
    352. }
    353. Window_ForgetSkillList.prototype = Object.create(Window_SkillList.prototype);
    354. Window_ForgetSkillList.prototype.constructor = Window_ForgetSkillList;
    355. Window_ForgetSkillList.prototype.initialize = function(x, y, width, height){
    356.     Window_SkillList.prototype.initialize.call(this, x, y, width, height);
    357.     this._actor = null;
    358.     this._data = [];
    359. };
    360. Window_ForgetSkillList.prototype.setActor = function(actor){
    361.     if(this._actor !== actor){
    362.         this._actor = actor;
    363.         this.refresh();
    364.         this.resetScroll();
    365.     }
    366. };
    367. Window_ForgetSkillList.prototype.maxCols = function(){
    368.     return SRD.PKM.FourMovesOnly.maxColumns;
    369. };
    370. Window_ForgetSkillList.prototype.spacing = function(){
    371.     return SRD.PKM.FourMovesOnly.spacing;
    372. };
    373. Window_ForgetSkillList.prototype.maxItems = function(){
    374.     returnthis._data ? this._data.length : 1;
    375. };
    376. Window_ForgetSkillList.prototype.item = function(){
    377.     returnthis._data && this.index() >= 0 ? this._data[this.index()] : null;
    378. };
    379. Window_ForgetSkillList.prototype.isCurrentItemEnabled = function(){
    380.     returnthis.isEnabled(this._data[this.index()]);
    381. };
    382. Window_ForgetSkillList.prototype.isEnabled = function(item){
    383.     return !item.pkm_cannotDelete || item.id === this._actor.mostRecentSkillId() || $gameParty.canRemoveHMMoves();
    384. };
    385. Window_ForgetSkillList.prototype.makeItemList = function(){
    386.     if(this._actor){
    387.         this._data = this._actor.skills();
    388.     }else{
    389.         this._data = [];
    390.     }
    391. };
    392. Window_ForgetSkillList.prototype.selectLast = function(){
    393.     this.select(0);
    394. };
    395. Window_ForgetSkillList.prototype.updateHelp = function(){
    396.     this.setHelpWindowItem(this.item());
    397. };
    398. Window_ForgetSkillList.prototype.refresh = function(){
    399.     this.makeItemList();
    400.     this.createContents();
    401.     this.drawAllItems();
    402. };
    403. //-----------------------------------------------------------------------------
    404. // Window_ForgetSkillStatus
    405. //-----------------------------------------------------------------------------
    406. function Window_ForgetSkillStatus(){
    407.     this.initialize.apply(this, arguments);
    408. }
    409. Window_ForgetSkillStatus.prototype = Object.create(Window_Base.prototype);
    410. Window_ForgetSkillStatus.prototype.constructor = Window_ForgetSkillStatus;
    411. Window_ForgetSkillStatus.prototype.initialize = function(x, y, width, height){
    412.     Window_Base.prototype.initialize.call(this, x, y, width, height);
    413.     this._actor = null;
    414. };
    415. Window_ForgetSkillStatus.prototype.setActor = function(actor){
    416.     if(this._actor !== actor){
    417.         this._actor = actor;
    418.         this.refresh();
    419.     }
    420. };
    421. Window_ForgetSkillStatus.prototype.refresh = function(){
    422.     this.contents.clear();
    423.     if(this._actor){
    424.             var x = 0;
    425.             var x2 = x + 280;
    426.             var x3 = x2 + 280;
    427.             var y = 0;
    428.         var actor = this._actor;
    429.             this.drawActorName(actor, x, y);
    430.             this.drawActorLevel(actor, x2, y);
    431.             this.drawActorClass(actor, x3, y);
    432.     }
    433. };
    434. //-----------------------------------------------------------------------------
    435. // Window_ForgetSkillStatus2
    436. //-----------------------------------------------------------------------------
    437. function Window_ForgetSkillStatus2(){
    438.     this.initialize.apply(this, arguments);
    439. }
    440. Window_ForgetSkillStatus2.prototype = Object.create(Window_Base.prototype);
    441. Window_ForgetSkillStatus2.prototype.constructor = Window_ForgetSkillStatus;
    442. Window_ForgetSkillStatus2.prototype.initialize = function(x, y, width, height){
    443.     Window_Base.prototype.initialize.call(this, x, y, width, height);
    444. };
    445. Window_ForgetSkillStatus2.prototype.refresh = function(){
    446.     this.contents.clear();
    447.     this.drawText("请您选择一招武功废掉。。。。", 0, 0, (Graphics.boxWidth), 'center');
    448. };
    复制代码

                 本帖来自P1论坛作者燃烧绳命,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=396257  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-10 19:47 , Processed in 0.139916 second(s), 57 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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