//============================================================================= // RPG Maker MZ - AreaReset // // Copyright 2025 Panzer-IV. All rights reserved. // This source code or any portion thereof must not be // reproduced or used without licensed in any manner whatsoever. //============================================================================= /*: * @target MZ * @plugindesc 範囲リセットプラグイン * @author 四号戦車 * @base PluginCommonBase * @orderAfter PluginCommonBase * @orderAfter DebugSwitch * * @help 範囲リセットプラグイン * * AreaReset * Version: 0.0.1 * * 変数やスイッチを指定番号の範囲で一斉ON/OFFします * * @command resetSwitches * @text スイッチの範囲操作 * @desc スイッチを範囲操作します * * @arg start * @text 開始番号 * @desc 捜査範囲の開始番号を指定して下さい * @type switch * @default 0 * * @arg end * @text 終了番号 * @desc 捜査範囲の終了番号を指定して下さい * @type switch * @default 0 * * @arg value * @text ON/OFF * @type boolean * @default false * * @command resetVariables * @text 変数の範囲操作 * @desc 変数を範囲操作します * * @arg start * @text 開始番号 * @desc 捜査範囲の開始番号を指定して下さい * @type variable * @default 0 * * @arg end * @text 終了番号 * @desc 捜査範囲の終了番号を指定して下さい * @type variable * @default 0 * * @arg value_number * @text 値(数値) * @desc 変数の値(数値) * テキストが入っていた場合無視されます * @type number * @default 0 * * @arg value_text * @text 値(テキスト) * @desc 変数の値(テキスト) * @type multiline_text * @default 0 * * @command resetMapEvents * @text セルフスイッチのリセット * @desc 現在のマップのセルフスイッチと * 一時消去を全てリセットします */ (() => { "use strict"; const pluginName = "AreaReset"; const script = document.currentScript; const param = PluginManagerEx.createParameter(script); //======================================================================== // 共通基盤 //======================================================================== //======================================================================== // プラグインコマンド //======================================================================== PluginManagerEx.registerCommand(script, 'resetSwitches', args => { const baseStart = Math.max(args.start, 1); const startPoint = Math.min(baseStart, args.end); const endPoint = Math.max(baseStart, args.end); for (let i = startPoint; i <= endPoint; i++) { $gameSwitches.setValue(i, args.value); } }); PluginManagerEx.registerCommand(script, 'resetVariables', args => { const baseStart = Math.max(args.start, 1); const startPoint = Math.min(baseStart, args.end); const endPoint = Math.max(baseStart, args.end); const value = (!!args.value_text && args.value_text !== '') ? args.value_text : args.value_number; for (let i = startPoint; i <= endPoint; i++) { $gameVariables.setValue(i, value); } }); PluginManagerEx.registerCommand(script, 'resetMapEvents', args => { // セルフスイッチのクリア $gameSelfSwitches.clear(); // 一時消去のクリア $gameMap.events().forEach(event => { event._erased = false; event.refresh(); }); }); })();