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

Project1

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

[已经过期] 求助一个关于鼠标冲刺的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
80
在线时间
216 小时
注册时间
2011-9-17
帖子
151
跳转到指定楼层
1
发表于 2016-10-24 13:43:52 手机端发表。 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如题,想让鼠标行走和键盘行走一样,受到冲刺开关的影响。
ps:鼠标移动不收开关影响,默认冲刺。除非在地图禁止冲刺。

还请各位大大帮忙,实现这个功能后我打算发布我rmmv的处女作,哈哈。

Lv1.梦旅人

梦石
0
星屑
80
在线时间
216 小时
注册时间
2011-9-17
帖子
151
2
 楼主| 发表于 2016-10-24 23:08:30 | 只看该作者
在线等。。。求大大帮忙
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
145
在线时间
61 小时
注册时间
2016-7-10
帖子
12
3
发表于 2016-10-27 09:23:25 | 只看该作者
我记得有人发过……
  1. //=============================================================================
  2. // Yanfly Engine Plugins - Dash Toggle
  3. // YEP_DashToggle.js
  4. //=============================================================================

  5. var Imported = Imported || {};
  6. Imported.YEP_DashToggle = true;

  7. var Yanfly = Yanfly || {};
  8. Yanfly.Dash = Yanfly.Dash || {};

  9. //=============================================================================
  10. /*:
  11. * @plugindesc v1.02 RPG Maker MV lacks the ability to toggle dashing
  12. * on and off. This plugin will let you do so~
  13. * @author Yanfly Engine Plugins
  14. *
  15. * @help
  16. * ============================================================================
  17. * Introduction
  18. * ============================================================================
  19. * 这个插件可以解决鼠标冲刺开关的问题,系统自带的只能关闭键盘操作,鼠标奔跑不被实现.
  20. * RPG Maker MV lacks the ability to toggle dashing on and off. This plugin
  21. * will enable you to toggle dashing on and off as well as provide certain
  22. * traits that will inhibit the party leader from being able to dash (such as
  23. * an extra heavy weapon).
  24. * MV缺乏冲刺的切换键。这个插件可以让你开启冲刺功能
  25. * ============================================================================
  26. * Notetags
  27. * ============================================================================
  28. *
  29. * You can use these notetags to add a disabled dashing trait. If the leading
  30. * party member has a trait that disables dashing, then the player cannot dash
  31. * while that actor is in the lead.
  32. * 你可以使用标签来关闭冲刺特性。如果领队关闭了,玩家将不能冲刺
  33. * Actor, Class, Weapon, Armor, and State Notetag:
  34. *
  35. *   <Disable Dashing>
  36. *   If the leading party member has a trait with this notetag, then the player
  37. *   cannot dash while that actor is in the lead.
  38. * 关闭冲刺
  39. * ============================================================================
  40. * Plugin Commands
  41. * ============================================================================
  42. *
  43. * You can use these plugin commands to enable or disable dashing mid-game!
  44. * 你可以用这个插件命令来开启或关闭.通过制作事件,并在其中使用插件指令来实现控制
  45. * Plugin Command
  46. *
  47. *   EnableDashing
  48. *   - Enables the player to be able to dash. However, this will not take
  49. *   priority in maps that disable dashing altogether.
  50. * 关闭
  51. *   DisableDashing
  52. *   - Disables the player from being able to dash.
  53. * 开启
  54. *   ToggleDashing
  55. *   - This will enable/disable dashing. This will not take priority in maps
  56. *   that disable dashing altogether.
  57. * 切换
  58. * ============================================================================
  59. * Changelog
  60. * ============================================================================
  61. *
  62. * Version 1.02:
  63. * - Added a failsafe to prevent crashes if there are no members in the party.
  64. *
  65. * Version 1.01:
  66. * - Updated for RPG Maker MV version 1.1.0.
  67. *
  68. * Version 1.00:
  69. * - Finished Plugin!
  70. */
  71. //=============================================================================

  72. //=============================================================================
  73. // DataManager
  74. //=============================================================================

  75. Yanfly.Dash.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  76. DataManager.isDatabaseLoaded = function() {
  77.   if (!Yanfly.Dash.DataManager_isDatabaseLoaded.call(this)) return false;
  78.   if (!Yanfly._loaded_YEP_DashToggle) {
  79.     this.processDashNotetags1($dataActors);
  80.     this.processDashNotetags1($dataClasses);
  81.     this.processDashNotetags1($dataWeapons);
  82.     this.processDashNotetags1($dataArmors);
  83.     this.processDashNotetags1($dataStates);
  84.     Yanfly._loaded_YEP_DashToggle = true;
  85.   }
  86.   return true;
  87. };

  88. DataManager.processDashNotetags1 = function(group) {
  89.   for (var n = 1; n < group.length; n++) {
  90.     var obj = group[n];
  91.     var notedata = obj.note.split(/[\r\n]+/);

  92.     obj.disableDashing = false;

  93.     for (var i = 0; i < notedata.length; i++) {
  94.       var line = notedata[i];
  95.       if (line.match(/<(?:DISABLE DASHING|DISABLE DASH)>/i)) {
  96.         obj.disableDashing = true;
  97.       }
  98.     }
  99.   }
  100. };

  101. //=============================================================================
  102. // Game_System
  103. //=============================================================================

  104. Yanfly.Dash.Game_System_initialize = Game_System.prototype.initialize;
  105. Game_System.prototype.initialize = function() {
  106.     Yanfly.Dash.Game_System_initialize.call(this);
  107.     this.initDashToggle();
  108. };

  109. Game_System.prototype.initDashToggle = function() {
  110.     this._disableDashing = false;
  111. };

  112. Game_System.prototype.isDashDisabled = function() {
  113.     if (this._disableDashing === undefined) this.initDashToggle();
  114.     return this._disableDashing;
  115. };

  116. Game_System.prototype.setDashDisabled = function(value) {
  117.     if (this._disableDashing === undefined) this.initDashToggle();
  118.     this._disableDashing = value;
  119. };

  120. //=============================================================================
  121. // Game_Actor
  122. //=============================================================================

  123. Yanfly.Dash.Game_Actor_refresh = Game_Actor.prototype.refresh;
  124. Game_Actor.prototype.refresh = function() {
  125.     this._disableDashing = undefined;
  126.     Yanfly.Dash.Game_Actor_refresh.call(this);
  127. };

  128. Game_Actor.prototype.isDashDisabled = function() {
  129.     if (this._disableDashing !== undefined) return this._disableDashing;
  130.     if (this.actor().disableDashing) {
  131.       this._disableDashing = true;
  132.       return this._disableDashing;
  133.     }
  134.     if (this.currentClass().disableDashing) {
  135.       this._disableDashing = true;
  136.       return this._disableDashing;
  137.     }
  138.     var length = this.equips().length;
  139.     for (var i = 0; i < length; ++i) {
  140.       var obj = this.equips()[i];
  141.       if (obj && obj.disableDashing) {
  142.         this._disableDashing = true;
  143.         return this._disableDashing;
  144.       }
  145.     }
  146.     var length = this.states().length;
  147.     for (var i = 0; i < length; ++i) {
  148.       var obj = this.states()[i];
  149.       if (obj && obj.disableDashing) {
  150.         this._disableDashing = true;
  151.         return this._disableDashing;
  152.       }
  153.     }
  154.     this._disableDashing = false;
  155.     return this._disableDashing;
  156. };

  157. //=============================================================================
  158. // Game_Map
  159. //=============================================================================

  160. Yanfly.Dash.Game_Map_isDashDisabled = Game_Map.prototype.isDashDisabled;
  161. Game_Map.prototype.isDashDisabled = function() {
  162.     if ($gameSystem.isDashDisabled()) return true;
  163.     if ($gameParty.members()[0]) {
  164.       if ($gameParty.members()[0].isDashDisabled()) return true;
  165.     }
  166.     return Yanfly.Dash.Game_Map_isDashDisabled.call(this);
  167. };

  168. //=============================================================================
  169. // Game_Interpreter
  170. //=============================================================================

  171. Yanfly.Dash.Game_Interpreter_pluginCommand =
  172.     Game_Interpreter.prototype.pluginCommand;
  173. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  174.   Yanfly.Dash.Game_Interpreter_pluginCommand.call(this, command, args);
  175.   if (command === 'EnableDashing') {
  176.     $gameSystem.setDashDisabled(false);
  177.   } else if (command === 'DisableDashing') {
  178.     $gameSystem.setDashDisabled(true);
  179.   } else if (command === 'ToggleDashing') {
  180.     $gameSystem.setDashDisabled(!$gameSystem.isDashDisabled());
  181.   }
  182. };

  183. //=============================================================================
  184. // End of File
  185. //=============================================================================
复制代码
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1244
在线时间
898 小时
注册时间
2014-12-4
帖子
379
4
发表于 2016-10-27 09:38:21 | 只看该作者
本帖最后由 翻滚牛宝宝 于 2016-10-27 09:42 编辑
  1. Game_Player.prototype.updateDashing = function() {
  2.     if (this.isMoving()) {
  3.         return;
  4.     }
  5.     if (this.canMove() && !this.isInVehicle() && !$gameMap.isDashDisabled()) {
  6.         this._dashing = this.isDashButtonPressed() //|| $gameTemp.isDestinationValid();
  7.     } else {
  8.         this._dashing = false;
  9.     }
  10. };
复制代码

把Game_Player.prototype.updateDashing  第6行后面|| $gameTemp.isDestinationValid(); 那个注释掉或者删掉就好了(上面已经注释)
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-28 15:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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