//=============================================================================
// Kanna Plugins - Set Player Position Mid-Game
// KANNA_SetPlayerPositionMidGame.js
//=============================================================================
var Imported = Imported || {};
Imported.KANNA_SetPlayerPositionMidGame = true;
var Kanna = Kanna || {};
Kanna.SPPMG = Kanna.SPPMG || {};
Kanna.SPPMG.version = 1.01
var Imported = Imported || {};
Imported.KANNA_SPPMG = true;
/*:
* @plugindesc 测试时在地图中随意地设置主角的位置
* @author 康娜酱
*
* @help 1.注意,不能重命名这个js文件
* 2.可按Ctrl键来「关上/启用」插件效果
* 3.仅在测试游戏时生效,即部署后失效
* 4.如有疑问,可加Q群632269521查询
*
* @param switchId
* @desc 启用效果的开关ID
* @type number
* @default 1
*
* @param fixDirection
* @desc 瞬移后是否自动朝向下方?
* 否 - false 是 - true
* @type boolean
* @default true
* @on 是
* @off 否
*/
Kanna.Parameters = PluginManager.parameters('KANNA_SetPlayerPositionMidGame');
Kanna.Param = Kanna.Param || {};
Kanna.Param.SPPMGSwitchId = Number(Kanna.Parameters['switchId'] || 1);
Kanna.Param.SPPMGFixDirection = String(Kanna.Parameters['fixDirection']);
Kanna.Param.SPPMGFixDirection = eval(Kanna.Param.SPPMGFixDirection);
console.log(Kanna.Param.SPPMGFixDirection);
Kanna.SPPMG.Game_Temp_setDestination = Game_Temp.prototype.setDestination;
Game_Temp.prototype.setDestination = function (x, y) {
Kanna.SPPMG.Game_Temp_setDestination.call(this, x, y);
if ($gameSwitches.value(Kanna.Param.SPPMGSwitchId)) {
$gamePlayer.locate(x, y);
if (Kanna.Param.SPPMGFixDirection) $gamePlayer.setDirection(2);
};
};
Kanna.SPPMG.Scene_Map_update = Scene_Map.prototype.update;
Scene_Map.prototype.update = function () {
Kanna.SPPMG.Scene_Map_update.call(this);
if ($gameTemp.isPlaytest() && Input.isTriggered('control')) {
var switchId = Kanna.Param.SPPMGSwitchId;
var reverse = !$gameSwitches.value(switchId);
$gameSwitches.setValue(switchId, reverse);
};
};
收起