Project1
标题:
求助一个关于鼠标冲刺的问题
[打印本页]
作者:
工藤~新一じ
时间:
2016-10-24 13:43
标题:
求助一个关于鼠标冲刺的问题
如题,想让鼠标行走和键盘行走一样,受到冲刺开关的影响。
ps:鼠标移动不收开关影响,默认冲刺。除非在地图禁止冲刺。
还请各位大大帮忙,实现这个功能后我打算发布我rmmv的处女作,哈哈。
作者:
工藤~新一じ
时间:
2016-10-24 23:08
在线等。。。求大大帮忙
作者:
Keroia
时间:
2016-10-27 09:23
我记得有人发过……
//=============================================================================
// Yanfly Engine Plugins - Dash Toggle
// YEP_DashToggle.js
//=============================================================================
var Imported = Imported || {};
Imported.YEP_DashToggle = true;
var Yanfly = Yanfly || {};
Yanfly.Dash = Yanfly.Dash || {};
//=============================================================================
/*:
* @plugindesc v1.02 RPG Maker MV lacks the ability to toggle dashing
* on and off. This plugin will let you do so~
* @author Yanfly Engine Plugins
*
* @help
* ============================================================================
* Introduction
* ============================================================================
* 这个插件可以解决鼠标冲刺开关的问题,系统自带的只能关闭键盘操作,鼠标奔跑不被实现.
* RPG Maker MV lacks the ability to toggle dashing on and off. This plugin
* will enable you to toggle dashing on and off as well as provide certain
* traits that will inhibit the party leader from being able to dash (such as
* an extra heavy weapon).
* MV缺乏冲刺的切换键。这个插件可以让你开启冲刺功能
* ============================================================================
* Notetags
* ============================================================================
*
* You can use these notetags to add a disabled dashing trait. If the leading
* party member has a trait that disables dashing, then the player cannot dash
* while that actor is in the lead.
* 你可以使用标签来关闭冲刺特性。如果领队关闭了,玩家将不能冲刺
* Actor, Class, Weapon, Armor, and State Notetag:
*
* <Disable Dashing>
* If the leading party member has a trait with this notetag, then the player
* cannot dash while that actor is in the lead.
* 关闭冲刺
* ============================================================================
* Plugin Commands
* ============================================================================
*
* You can use these plugin commands to enable or disable dashing mid-game!
* 你可以用这个插件命令来开启或关闭.通过制作事件,并在其中使用插件指令来实现控制
* Plugin Command
*
* EnableDashing
* - Enables the player to be able to dash. However, this will not take
* priority in maps that disable dashing altogether.
* 关闭
* DisableDashing
* - Disables the player from being able to dash.
* 开启
* ToggleDashing
* - This will enable/disable dashing. This will not take priority in maps
* that disable dashing altogether.
* 切换
* ============================================================================
* Changelog
* ============================================================================
*
* Version 1.02:
* - Added a failsafe to prevent crashes if there are no members in the party.
*
* Version 1.01:
* - Updated for RPG Maker MV version 1.1.0.
*
* Version 1.00:
* - Finished Plugin!
*/
//=============================================================================
//=============================================================================
// DataManager
//=============================================================================
Yanfly.Dash.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
DataManager.isDatabaseLoaded = function() {
if (!Yanfly.Dash.DataManager_isDatabaseLoaded.call(this)) return false;
if (!Yanfly._loaded_YEP_DashToggle) {
this.processDashNotetags1($dataActors);
this.processDashNotetags1($dataClasses);
this.processDashNotetags1($dataWeapons);
this.processDashNotetags1($dataArmors);
this.processDashNotetags1($dataStates);
Yanfly._loaded_YEP_DashToggle = true;
}
return true;
};
DataManager.processDashNotetags1 = function(group) {
for (var n = 1; n < group.length; n++) {
var obj = group[n];
var notedata = obj.note.split(/[\r\n]+/);
obj.disableDashing = false;
for (var i = 0; i < notedata.length; i++) {
var line = notedata[i];
if (line.match(/<(?:DISABLE DASHING|DISABLE DASH)>/i)) {
obj.disableDashing = true;
}
}
}
};
//=============================================================================
// Game_System
//=============================================================================
Yanfly.Dash.Game_System_initialize = Game_System.prototype.initialize;
Game_System.prototype.initialize = function() {
Yanfly.Dash.Game_System_initialize.call(this);
this.initDashToggle();
};
Game_System.prototype.initDashToggle = function() {
this._disableDashing = false;
};
Game_System.prototype.isDashDisabled = function() {
if (this._disableDashing === undefined) this.initDashToggle();
return this._disableDashing;
};
Game_System.prototype.setDashDisabled = function(value) {
if (this._disableDashing === undefined) this.initDashToggle();
this._disableDashing = value;
};
//=============================================================================
// Game_Actor
//=============================================================================
Yanfly.Dash.Game_Actor_refresh = Game_Actor.prototype.refresh;
Game_Actor.prototype.refresh = function() {
this._disableDashing = undefined;
Yanfly.Dash.Game_Actor_refresh.call(this);
};
Game_Actor.prototype.isDashDisabled = function() {
if (this._disableDashing !== undefined) return this._disableDashing;
if (this.actor().disableDashing) {
this._disableDashing = true;
return this._disableDashing;
}
if (this.currentClass().disableDashing) {
this._disableDashing = true;
return this._disableDashing;
}
var length = this.equips().length;
for (var i = 0; i < length; ++i) {
var obj = this.equips()[i];
if (obj && obj.disableDashing) {
this._disableDashing = true;
return this._disableDashing;
}
}
var length = this.states().length;
for (var i = 0; i < length; ++i) {
var obj = this.states()[i];
if (obj && obj.disableDashing) {
this._disableDashing = true;
return this._disableDashing;
}
}
this._disableDashing = false;
return this._disableDashing;
};
//=============================================================================
// Game_Map
//=============================================================================
Yanfly.Dash.Game_Map_isDashDisabled = Game_Map.prototype.isDashDisabled;
Game_Map.prototype.isDashDisabled = function() {
if ($gameSystem.isDashDisabled()) return true;
if ($gameParty.members()[0]) {
if ($gameParty.members()[0].isDashDisabled()) return true;
}
return Yanfly.Dash.Game_Map_isDashDisabled.call(this);
};
//=============================================================================
// Game_Interpreter
//=============================================================================
Yanfly.Dash.Game_Interpreter_pluginCommand =
Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
Yanfly.Dash.Game_Interpreter_pluginCommand.call(this, command, args);
if (command === 'EnableDashing') {
$gameSystem.setDashDisabled(false);
} else if (command === 'DisableDashing') {
$gameSystem.setDashDisabled(true);
} else if (command === 'ToggleDashing') {
$gameSystem.setDashDisabled(!$gameSystem.isDashDisabled());
}
};
//=============================================================================
// End of File
//=============================================================================
复制代码
作者:
翻滚牛宝宝
时间:
2016-10-27 09:38
本帖最后由 翻滚牛宝宝 于 2016-10-27 09:42 编辑
Game_Player.prototype.updateDashing = function() {
if (this.isMoving()) {
return;
}
if (this.canMove() && !this.isInVehicle() && !$gameMap.isDashDisabled()) {
this._dashing = this.isDashButtonPressed() //|| $gameTemp.isDestinationValid();
} else {
this._dashing = false;
}
};
复制代码
把Game_Player.prototype.updateDashing 第6行后面|| $gameTemp.isDestinationValid(); 那个注释掉或者删掉就好了(上面已经注释)
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1