74 lines
No EOL
3.5 KiB
JavaScript
74 lines
No EOL
3.5 KiB
JavaScript
/*:
|
|
* @target MZ
|
|
* @plugindesc 勝利リザルト画面のデバッグ用プラグイン
|
|
* @author Gemini
|
|
* @help
|
|
* 戦闘勝利時の処理フローを開発者コンソールに出力します。
|
|
* 必ずプラグイン管理の一番下に配置してください。
|
|
*
|
|
* ゲームをテストプレイし、問題が発生した際にF12キーで
|
|
* 開発者コンソールを開き、どこでログが止まっているかを確認します。
|
|
*/
|
|
(() => {
|
|
'use strict';
|
|
console.log("勝利シーケンスのデバッグプラグインが有効です。");
|
|
|
|
// BattleManager.processVictory
|
|
const _BattleManager_processVictory = BattleManager.processVictory;
|
|
BattleManager.processVictory = function() {
|
|
console.log(`[フレーム: ${Graphics.frameCount}] --- BattleManager.processVictory 開始 ---`);
|
|
try {
|
|
_BattleManager_processVictory.apply(this, arguments);
|
|
} catch (e) {
|
|
console.error("BattleManager.processVictory でエラーが発生しました:", e);
|
|
}
|
|
console.log(`[フレーム: ${Graphics.frameCount}] --- BattleManager.processVictory 正常終了 ---`);
|
|
};
|
|
|
|
// BattleManager.displayVictoryMessage
|
|
const _BattleManager_displayVictoryMessage = BattleManager.displayVictoryMessage;
|
|
BattleManager.displayVictoryMessage = function() {
|
|
console.log(`[フレーム: ${Graphics.frameCount}] BattleManager.displayVictoryMessage 開始 (リザルト表示の起点)`);
|
|
try {
|
|
_BattleManager_displayVictoryMessage.apply(this, arguments);
|
|
} catch (e) {
|
|
console.error("BattleManager.displayVictoryMessage でエラーが発生しました:", e);
|
|
}
|
|
};
|
|
|
|
// Game_Actor.displayLevelUp (NRP_VictoryRewards_Customが上書きしている関数)
|
|
const _Game_Actor_displayLevelUp = Game_Actor.prototype.displayLevelUp;
|
|
Game_Actor.prototype.displayLevelUp = function(newSkills) {
|
|
console.log(`[フレーム: ${Graphics.frameCount}] ${this.name()} の Game_Actor.displayLevelUp 開始`);
|
|
try {
|
|
_Game_Actor_displayLevelUp.apply(this, arguments);
|
|
} catch (e) {
|
|
console.error("Game_Actor.displayLevelUp でエラーが発生しました:", e);
|
|
}
|
|
};
|
|
|
|
// Window_Message.startMessage
|
|
const _Window_Message_startMessage = Window_Message.prototype.startMessage;
|
|
Window_Message.prototype.startMessage = function() {
|
|
// NRP_VictoryRewards_Custom によって mIsRewardsMessage が true になっているか確認
|
|
if (this._isVictoryReward || window.mIsRewardsMessage) {
|
|
console.log(`[フレーム: ${Graphics.frameCount}] Window_Message.startMessage 開始 (リザルト表示中)`);
|
|
}
|
|
try {
|
|
_Window_Message_startMessage.apply(this, arguments);
|
|
} catch (e) {
|
|
console.error("Window_Message.startMessage でエラーが発生しました:", e);
|
|
}
|
|
};
|
|
|
|
// BattleManager.updateBattleEnd
|
|
const _BattleManager_updateBattleEnd = BattleManager.updateBattleEnd;
|
|
BattleManager.updateBattleEnd = function() {
|
|
console.log(`[フレーム: ${Graphics.frameCount}] --- BattleManager.updateBattleEnd 開始 (戦闘終了処理) ---`);
|
|
try {
|
|
_BattleManager_updateBattleEnd.apply(this, arguments);
|
|
} catch (e) {
|
|
console.error("BattleManager.updateBattleEnd でエラーが発生しました:", e);
|
|
}
|
|
};
|
|
})(); |