//============================================================================= // ItemCommonParallel.js // ---------------------------------------------------------------------------- // (C)2017 Triacontane // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // ---------------------------------------------------------------------------- // Version // 1.1.0 2023/06/04 MZ向けに一部仕様を変更して再作成 // 1.0.1 2017/08/09 コモンイベントを呼び出さないアイテムを使用するとエラーが発生する問題を修正 // 1.0.0 2017/07/22 初版 // ---------------------------------------------------------------------------- // [Blog] : https://triacontane.blogspot.jp/ // [Twitter]: https://twitter.com/triacontane/ // [GitHub] : https://github.com/triacontane/ //============================================================================= /*: @target MZ @url https://github.com/triacontane/RPGMakerMV/tree/mz_master/ItemCommonParallel.js @plugindesc Item common event parallelization plugin @author Triacontane @license MIT License @help English Help Translator: munokura This is an unofficial English translation of the plugin help, created to support global RPG Maker users. Feedback is welcome to improve translation quality (see: https://github.com/munokura/triacontane-MZ-plugins ). Original plugin by Triacontane. Please check the latest official version at: https://triacontane.blogspot.com ----- ItemCommonParallel.js When a common event is invoked from the menu screen, such as by using an item, if the target trigger is "parallel processing," it will be executed in parallel. The switch specified as the trigger does not turn ON, but the specified common event is executed in parallel processing only once. If you invoke a common item from the menu screen while an event is running, the event will be executed immediately. Terms of Use: You may modify and redistribute this plugin without permission from the author, and there are no restrictions on its use (commercial, 18+, etc.). This plugin is now yours. */ /*:ja @plugindesc アイテムコモンイベントの並列化プラグイン @target MZ @url https://github.com/triacontane/RPGMakerMV/tree/mz_master/ItemCommonParallel.js @base PluginCommonBase @orderAfter PluginCommonBase @author トリアコンタン @help ItemCommonParallel.js アイテム使用などでメニュー画面からコモンイベントを呼び出したときに 対象のトリガーが「並列処理」の場合は、並列処理として実行します。 トリガーに指定したスイッチがONになるわけではなく、 指定したコモンイベントが1回だけ並列処理で実行されます。 イベント実行中にメニュー画面からアイテムコモンを実行した場合などに 即座にイベントが実行されるようになります。 利用規約: 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等) についても制限はありません。 このプラグインはもうあなたのものです。 */ (()=> { 'use strict'; //============================================================================= // Game_Temp // コモンイベント呼び出し要求時に対象が並列処理だった場合は対象スイッチを自動でONにする //============================================================================= const _Game_Temp_reserveCommonEvent = Game_Temp.prototype.reserveCommonEvent; Game_Temp.prototype.reserveCommonEvent = function(commonEventId) { _Game_Temp_reserveCommonEvent.apply(this, arguments); if (SceneManager.isInItemBase()) { this.reserveParallelCommonEvent(); } }; Game_Temp.prototype.reserveParallelCommonEvent = function() { const event = this.retrieveParallelCommonEvent(); if (event) { $gameMap.setupDynamicCommon(event.id); this._callParallelCommonEvent = true; } }; Game_Temp.prototype.retrieveParallelCommonEvent = function() { const event = $dataCommonEvents[this._commonEventQueue[this._commonEventQueue.length - 1]]; if (event && event.trigger === 2) { return this.retrieveCommonEvent(); } else { return null; } }; const _Game_Temp_isCommonEventReserved = Game_Temp.prototype.isCommonEventReserved; Game_Temp.prototype.isCommonEventReserved = function() { const result = _Game_Temp_isCommonEventReserved.apply(this, arguments); if (this._callParallelCommonEvent) { this._callParallelCommonEvent = false; return true; } else { return result; } }; //============================================================================= // SceneManager // 現在の画面がアイテム画面かどうかを返す //============================================================================= SceneManager.isInItemBase = function() { return this._scene instanceof Scene_ItemBase; }; })();