/*:
* @target MZ
* @plugindesc 直接进入战斗而不显示遇敌提示框
* @author Doubao
* @url https://doubao.com
*
* @help
* 隐形遇敌战斗系统 - 直接进入战斗而不显示遇敌提示框
*
* 插件功能:
* - 当玩家与敌人相遇时,跳过遇敌提示框直接进入战斗
* - 保留遇敌动画效果
* - 支持配置是否播放遇敌BGM
*
* 使用方法:
* 1. 将此插件放置在插件管理器中
* 2. 根据需要调整插件参数
*
* @param playEncounterBgm
* @text 播放遇敌BGM
* @type boolean
* @default true
* @desc 遇敌时是否播放默认的遇敌BGM
*/
(() => {
'use strict';
const pluginName = 'StealthBattleSystem';
const parameters = PluginManager.parameters(pluginName);
const playEncounterBgm = parameters.playEncounterBgm === 'true';
// 跳过遇敌消息,直接进入战斗
const _Game_Player_performEncounterEffect = Game_Player.prototype.performEncounterEffect;
Game_Player.prototype.performEncounterEffect = function() {
if (playEncounterBgm) {
_Game_Player_performEncounterEffect.call(this);
} else {
this.requestBattleStart();
}
};
// 禁用默认的遇敌消息显示
const _Window_Message_updateEncounterEffect = Window_Message.prototype.updateEncounterEffect;
Window_Message.prototype.updateEncounterEffect = function() {
if (!playEncounterBgm) {
return false;
}
return _Window_Message_updateEncounterEffect.call(this);
};
// 防止显示默认的遇敌文本
const _BattleManager_displayStartMessages = BattleManager.displayStartMessages;
BattleManager.displayStartMessages = function() {
// 不调用父类方法,从而不显示默认的遇敌文本
// _BattleManager_displayStartMessages.call(this);
};
})();