/* * -------------------------------------------------- * MNKR_ChangeActorImages.js * Ver.0.0.2 * Copyright (c) 2021 Munokura * This software is released under the MIT license. * http://opensource.org/licenses/mit-license.php * -------------------------------------------------- */ /*: @target MV @url https://raw.githubusercontent.com/munokura/MNKR-MV-plugins/master/MNKR_RandomActorName.js @plugindesc Changes the behavior of the specified actor in "Change actor image" to the variable value. @author munokura @license MIT License @help Ignores the actor specified in the "Change Actor Image" event command, and changes the behavior of the specified actor ID to the variable value. # Terms of Use MIT License. http://opensource.org/licenses/mit-license.php You may modify and redistribute this without permission from the author, and there are no restrictions on its use (commercial, 18+, etc.). @param raiseSwitch @text Enable switch @desc This plug-in will run when the specified switch is ON. If it is 0, it will always run. @type switch @default 0 @param actorIdVariableId @text Actor ID variable @desc Variable to store the actor ID to be changed. @type variable @default 0 */ /*:ja @target MV @url https://raw.githubusercontent.com/munokura/MNKR-MV-plugins/master/MNKR_RandomActorName.js @plugindesc 「アクターの画像変更」の指定アクターを変数値の挙動に変更します。 @author munokura @help イベントコマンド「アクターの画像変更」の指定アクターを無視し、 指定アクターIDを変数値の挙動に変更します。 # 利用規約 MITライセンスです。 http://opensource.org/licenses/mit-license.php 作者に無断で改変、再配布が可能で、 利用形態(商用、18禁利用等)についても制限はありません。 @param raiseSwitch @text 有効化スイッチ @desc 指定スイッチがONの時、このプラグインを動作させます。0の場合、常に動作します。 @type switch @default 0 @param actorIdVariableId @text アクターID変数 @desc 「アクターの画像変更」の対象になるアクターIDを入れる変数 @type variable @default 0 */ (() => { "use strict"; const pluginName = document.currentScript.src.split("/").pop().replace(/\.js$/, ""); const pluginParameters = PluginManager.parameters(pluginName); const PRM_raiseSwitch = Number(pluginParameters['raiseSwitch'] || 0); const PRM_actorIdVariableId = Number(pluginParameters['actorIdVariableId'] || 0); // Change Actor Images const _Game_Interpreter_command322 = Game_Interpreter.prototype.command322; Game_Interpreter.prototype.command322 = function () { const raise = PRM_raiseSwitch === 0 ? true : $gameSwitches.value(PRM_raiseSwitch); if (raise) { const actor = $gameActors.actor($gameVariables.value(PRM_actorIdVariableId)); if (actor) { actor.setCharacterImage(this._params[1], this._params[2]); actor.setFaceImage(this._params[3], this._params[4]); actor.setBattlerImage(this._params[5]); } $gamePlayer.refresh(); return true; } else { return _Game_Interpreter_command322.call(this); }; }; })();