102 lines
No EOL
3.7 KiB
JavaScript
102 lines
No EOL
3.7 KiB
JavaScript
/*:
|
|
* @plugindesc 追加エフェクト用プラグイン(暗号化デプロイ対応版)
|
|
* ピクチャID 35,36 に股・顔の追加エフェクトを表示します。
|
|
* @target MZ
|
|
* @author ...
|
|
*
|
|
* @help PictureHeroineAdditionalEffects.js (暗号化対応版)
|
|
* 画像が暗号化され .png_ / .rpgmvp になっていても ImageManager が自動復号するため
|
|
* fs.existsSync() での存在確認を廃止し、常に showPicture() を実行します。
|
|
*
|
|
* 【2025-07-25】
|
|
* 既存ピクチャのトーンが null の場合にエラーが発生する問題を修正。
|
|
*
|
|
* 画像フォルダ : img/pictures/heroine/AddEF/
|
|
* ファイル名 : [変数10]_[変数11]_[変数17 or 18]
|
|
* 変数対応
|
|
* 10 : ベース (例 MS)
|
|
* 11 : アバター (例 NP)
|
|
* 17 : 股エフェクト文字列 (例 EFSG)
|
|
* 18 : 顔エフェクト文字列 (例 EFSF)
|
|
* 16 : 位置 ("field" なら X=100 / それ以外=0)
|
|
*
|
|
* @command UpdateAdditionalEffect1
|
|
* @text 股精液
|
|
* @desc 変数17 を更新し、ピクチャID 35 を再表示します。
|
|
*
|
|
* @arg values
|
|
* @type text
|
|
* @text 画像指定文字列
|
|
* @desc 変数17 にセットする文字列
|
|
* @default
|
|
*
|
|
* @command UpdateAdditionalEffect2
|
|
* @text 顔精液
|
|
* @desc 変数18 を更新し、ピクチャID 36 を再表示します。
|
|
*
|
|
* @arg values
|
|
* @type text
|
|
* @text 画像指定文字列
|
|
* @desc 変数18 にセットする文字列
|
|
* @default
|
|
*/
|
|
|
|
(() => {
|
|
"use strict";
|
|
const pluginName = "PictureHeroineAdditionalEffects";
|
|
|
|
//---------------------------------------------------------------------------
|
|
// ユーティリティ
|
|
//---------------------------------------------------------------------------
|
|
|
|
/**
|
|
* showAdditionalEffectPicture
|
|
* @param {number} variableId - 17 or 18
|
|
* @param {number} pictureId - 35 or 36
|
|
*/
|
|
function showAdditionalEffectPicture(variableId, pictureId) {
|
|
const base10 = $gameVariables.value(10) || "MS";
|
|
const base11 = $gameVariables.value(11) || "NP";
|
|
const effect = $gameVariables.value(variableId);
|
|
if (!effect) return; // 空文字は何も表示しない
|
|
|
|
const x = $gameVariables.value(16) === "field" ? 100 : 0;
|
|
const y = 0;
|
|
|
|
const basePath = "heroine/AddEF";
|
|
const name = `${base10}_${base11}_${effect}`; // 拡張子無し
|
|
|
|
// 既存トーンを保持
|
|
const oldPic = $gameScreen.picture(pictureId);
|
|
// ★エラー修正箇所
|
|
const tone = (oldPic && oldPic.tone()) || [0, 0, 0, 0];
|
|
|
|
// ImageManager が暗号化拡張子を自動判定するので存在チェック不要
|
|
$gameScreen.showPicture(pictureId, `${basePath}/${name}`, 0, x, y, 100, 100, 255, 0);
|
|
$gameScreen.picture(pictureId).tint(tone, 1);
|
|
}
|
|
|
|
//---------------------------------------------------------------------------
|
|
// プラグインコマンド
|
|
//---------------------------------------------------------------------------
|
|
|
|
PluginManager.registerCommand(pluginName, "UpdateAdditionalEffect1", args => {
|
|
try {
|
|
const values = args.values;
|
|
$gameVariables.setValue(17, values);
|
|
showAdditionalEffectPicture(17, 35);
|
|
} catch (e) {
|
|
console.error("UpdateAdditionalEffect1 エラー:", e);
|
|
}
|
|
});
|
|
|
|
PluginManager.registerCommand(pluginName, "UpdateAdditionalEffect2", args => {
|
|
try {
|
|
const values = args.values;
|
|
$gameVariables.setValue(18, values);
|
|
showAdditionalEffectPicture(18, 36);
|
|
} catch (e) {
|
|
console.error("UpdateAdditionalEffect2 エラー:", e);
|
|
}
|
|
});
|
|
})(); |