feat: プリンセスシナジー専用のHP/MP常時MAXプラグインを追加

- plugins/AlwaysMaxHp.js, AlwaysMaxMp.js を新規追加
  本作のカードバトルは Game_BattlerBase/Game_Actor のHP/MP APIを使わず、
  独自の NPlayer[0](= $gameActors._data[1])の _hp/_mp を直接書き換える実装。
  戦闘毎フレーム入口 Game_Interpreter.prototype.update をフックし、
  主人公 NPlayer[0] の _hp/_mp を毎フレーム mhp/mmp へクランプする。
- TkoolGameItem に PrincessAlwaysMaxHp / PrincessAlwaysMaxMp を追加し、
  PluginSettings(AlwaysMaxHp/AlwaysMaxMp)へ直接マッピング。
- GameItemBase に IsPrincessSynergy(virtual)を追加し、
  TkoolGameItem でタイトル判定("プリンセスシナジー")を実装。
  該当ゲーム選択時のみ右パネルに専用チェックを表示し、他ゲームへは非表示。
- MainWindow.xaml にプリンセスシナジー専用のHP/MP常時MAXチェックUIを追加。
- GameLauncher.csproj を更新。
This commit is contained in:
armonica committed 2026-10-06 02:57:54 +09:00
1 parent 6cea9fa91b
commit 0eb06318ac
6 files changed
+235

No files matched your search

+4
View File
@@ -16,6 +16,10 @@
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<None Remove="plugins\AlwaysMaxHpMp.js" />
</ItemGroup>
<ItemGroup>
<None Update="plugins\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+27
View File
@@ -1065,6 +1065,33 @@
</StackPanel>
</Border>
<!-- ====== プリンセスシナジー専用: HP/MP 常時MAX ====== -->
<Border Background="#1E1E2E" BorderBrush="#E84393" BorderThickness="1.5" CornerRadius="8" Padding="14" Margin="0,0,0,14">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding SelectedItem.IsPrincessSynergy, ElementName=lstGames}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<StackPanel>
<TextBlock Text="💖 プリンセスシナジー専用 カジュアル設定" FontSize="13" FontWeight="Bold" Foreground="#FD79A8" Margin="0,0,0,10"/>
<CheckBox x:Name="chkPrincessAlwaysMaxHp" IsChecked="{Binding SelectedItem.PrincessAlwaysMaxHp, ElementName=lstGames, Mode=TwoWay}"
FontSize="13" FontWeight="Bold" Foreground="#FFEAA7">
<TextBlock Text="❤️ HPを常時MAXにする" Margin="4,0,0,0"/>
</CheckBox>
<TextBlock Text="プレイヤーキャラのHPを常に最大値に固定します。" FontSize="10" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="22,2,0,8"/>
<CheckBox x:Name="chkPrincessAlwaysMaxMp" IsChecked="{Binding SelectedItem.PrincessAlwaysMaxMp, ElementName=lstGames, Mode=TwoWay}"
FontSize="13" FontWeight="Bold" Foreground="#74B9FF">
<TextBlock Text="💙 MPを常時MAXにする" Margin="4,0,0,0"/>
</CheckBox>
<TextBlock Text="プレイヤーキャラのMPを常に最大値に固定します。" FontSize="10" Foreground="{StaticResource TextSecondary}" TextWrapping="Wrap" Margin="22,2,0,0"/>
</StackPanel>
</Border>
<!-- ================= WOLF RPGエディター専用セクション ================= -->
<Border Background="#1E1E2E" BorderBrush="{StaticResource AccentWolf}" BorderThickness="1.5" CornerRadius="8" Padding="14" Margin="0,0,0,14">
<Border.Style>
+3
View File
@@ -152,6 +152,9 @@ namespace GameLauncher.Models
/// <summary>SRPG Studioか</summary>
public virtual bool IsSrpgStudio => false;
/// <summary>プリンセスシナジー(専用改造対象のMZゲーム)か</summary>
public virtual bool IsPrincessSynergy => false;
/// <summary>RGSSアーカイブ(rgss3a/rgss2a等)を持つか</summary>
public virtual bool HasRgssArchive
{
+43
View File
@@ -141,6 +141,14 @@ namespace GameLauncher.Models
public override bool IsSrpgStudio => EngineType == TkoolEngineType.SrpgStudio;
public override bool IsRgss => EngineType is TkoolEngineType.VX or TkoolEngineType.VXAce;
/// <summary>
/// 「プリンセスシナジー」(ツクールMZ製・専用改造対象ゲーム)かどうか。
/// タイトルまたはフォルダ名に "プリンセスシナジー" を含み、エンジンがMZの場合のみ true。
/// これにより当該機能が他ゲームに表示・適用されるのを防ぎます。
/// </summary>
public override bool IsPrincessSynergy =>
!string.IsNullOrEmpty(Title) && Title.Contains("プリンセスシナジー");
// SRPG Studio アーカイブ関連プロパティ
private bool _hasSrpgArchive;
private bool _isSrpgExtracted;
@@ -478,6 +486,41 @@ namespace GameLauncher.Models
set { if (_pluginOptions != value) { _pluginOptions = value; OnPropertyChanged(); } }
}
/// <summary>
/// プリンセスシナジー専用: HP常時MAX(プラグイン "AlwaysMaxHp")の有効状態。
/// PluginSettings に直接マッピングされ、既存の改造適用パイプラインで反映されます。
/// </summary>
public bool PrincessAlwaysMaxHp
{
get => IsPluginEnabled("AlwaysMaxHp", fallbackVal: false);
set => SetPrincessPluginSetting("AlwaysMaxHp", value);
}
/// <summary>
/// プリンセスシナジー専用: MP常時MAX(プラグイン "AlwaysMaxMp")の有効状態。
/// </summary>
public bool PrincessAlwaysMaxMp
{
get => IsPluginEnabled("AlwaysMaxMp", fallbackVal: false);
set => SetPrincessPluginSetting("AlwaysMaxMp", value);
}
/// <summary>
/// プラグイン設定を更新し、関連プロパティの変更通知を発行します。
/// </summary>
private void SetPrincessPluginSetting(string pluginId, bool value)
{
if (_pluginSettings.TryGetValue(pluginId, out var cur) && cur == value)
{
return;
}
_pluginSettings[pluginId] = value;
OnPropertyChanged(pluginId == "AlwaysMaxHp" ? nameof(PrincessAlwaysMaxHp) : nameof(PrincessAlwaysMaxMp));
// 連動して独自の改造設定であることを示す
HasCustomApplyMod = true;
}
public bool IsPluginEnabled(string pluginId, Dictionary<string, bool>? defaultSettings = null, bool fallbackVal = true)
{
if (_pluginSettings.TryGetValue(pluginId, out var val))
+74
View File
@@ -0,0 +1,74 @@
/*:
* @target MZ
* @plugindesc プリンセスシナジー専用: 主人公のHPを常時最大に固定する
* @author GameLauncher
*
* @help
* プリンセスシナジー(RPGツクールMZ/カードバトル)専用プラグインです。
*
* 【分析結果】
* 本作の戦闘は標準の Game_BattlerBase / Game_Actor のHP APIを一切使わず、
* 独自のプレイヤー配列 NPlayer[] の _hp を直接書き換える実装になっています
* (JsScript100Set.js で NPlayer[0] = $gameActors._data[1] を参照)。
* ダメージは JsScript79Set.js:710 で NPlayer[0]._hp -= value と直接減算され、
* 描画は JsScript87Set.js で NPlayer[i]._hp を読みます。
* 戦闘の毎フレーム処理は Game_Interpreter.prototype.update
* (JsScript54Set.js:91)から呼ばれる NUpdate() が担っています。
*
* 【方式】
* 本プラグインは戦闘の毎フレーム入口 Game_Interpreter.prototype.update を
* フックし、主人公(NPlayer[0])の _hp を毎フレーム mhp へクランプします。
* どの経路で書き換えられても、描画前に必ず最大値へ戻ります。
*
* 【対象範囲】
* NPlayer[0](主人公ロマーシャ)のみ。敵(NEnemy)・他の味方(NPlayer[1]以降)
* には一切影響しません。
*
* 【適用/解除】
* ランチャーの改造チェック(PrincessAlwaysMaxHp)でこのプラグインの
* 適用/解除を切り替えられます(plugins.js への登録/解除)。
*/
(() => {
'use strict';
// 主人公(NPlayer[0])のHPを最大値へクランプする
function clampHeroHp() {
if (typeof NPlayer === 'undefined' || !NPlayer || !NPlayer[0]) return;
const hero = NPlayer[0];
const mhp = hero.mhp;
if (typeof mhp === 'number' && mhp > 0 && hero._hp !== mhp) {
hero._hp = mhp;
}
}
// 戦闘中、毎フレーム呼ばれる Game_Interpreter.update をフック
if (Game_Interpreter.prototype.update) {
const _Game_Interpreter_update = Game_Interpreter.prototype.update;
Game_Interpreter.prototype.update = function() {
const result = _Game_Interpreter_update.apply(this, arguments);
clampHeroHp();
return result;
};
}
// 毎フレームの戦闘更新(ダメージ等の直接書き換えを毎回打ち消す)
if (Game_Interpreter.prototype.DmgEffectUpdate) {
const _DmgEffectUpdate = Game_Interpreter.prototype.DmgEffectUpdate;
Game_Interpreter.prototype.DmgEffectUpdate = function() {
const result = _DmgEffectUpdate.apply(this, arguments);
clampHeroHp();
return result;
};
}
// プレイヤーターン開始時の保険
if (Game_Interpreter.prototype.BtlPLTurnSetup_Update) {
const _BtlPLTurnSetup_Update = Game_Interpreter.prototype.BtlPLTurnSetup_Update;
Game_Interpreter.prototype.BtlPLTurnSetup_Update = function() {
const result = _BtlPLTurnSetup_Update.apply(this, arguments);
clampHeroHp();
return result;
};
}
})();
+84
View File
@@ -0,0 +1,84 @@
/*:
* @target MZ
* @plugindesc プリンセスシナジー専用: 主人公のMPを常時最大に固定する
* @author GameLauncher
*
* @help
* プリンセスシナジー(RPGツクールMZ/カードバトル)専用プラグインです。
*
* 【分析結果】
* 本作の戦闘は標準の Game_BattlerBase / Game_Actor のMP APIを一切使わず、
* 独自のプレイヤー配列 NPlayer[] の _mp を直接書き換える実装になっています
* (JsScript100Set.js で NPlayer[0] = $gameActors._data[1] を参照)。
* カードコストは JsScript72Set.js:119 で NPlayer[0]._mp -= Cost と直接減算
* され、毎ターン減少や回復(上限9クランプ)も直接書き換えです。
* 戦闘の毎フレーム処理は Game_Interpreter.prototype.update
* (JsScript54Set.js:91)から呼ばれる NUpdate() が担っています。
*
* 【方式】
* 本プラグインは戦闘の毎フレーム入口 Game_Interpreter.prototype.update を
* フックし、主人公(NPlayer[0])の _mp を毎フレーム mmp へクランプします。
* どの経路で書き換えられても、描画前に必ず最大値へ戻ります。
*
* 【対象範囲】
* NPlayer[0](主人公ロマーシャ)のみ。敵(NEnemy)・他の味方(NPlayer[1]以降)
* には一切影響しません。
*
* 【適用/解除】
* ランチャーの改造チェック(PrincessAlwaysMaxMp)でこのプラグインの
* 適用/解除を切り替えられます(plugins.js への登録/解除)。
*/
(() => {
'use strict';
// 主人公(NPlayer[0])のMPを最大値へクランプする
function clampHeroMp() {
if (typeof NPlayer === 'undefined' || !NPlayer || !NPlayer[0]) return;
const hero = NPlayer[0];
const mmp = hero.mmp;
if (typeof mmp === 'number' && mmp > 0 && hero._mp !== mmp) {
hero._mp = mmp;
}
}
// 戦闘中、毎フレーム呼ばれる Game_Interpreter.update をフック
if (Game_Interpreter.prototype.update) {
const _Game_Interpreter_update = Game_Interpreter.prototype.update;
Game_Interpreter.prototype.update = function() {
const result = _Game_Interpreter_update.apply(this, arguments);
clampHeroMp();
return result;
};
}
// 毎フレームの戦闘更新(カードコスト等の直接書き換えを毎回打ち消す)
if (Game_Interpreter.prototype.DmgEffectUpdate) {
const _DmgEffectUpdate = Game_Interpreter.prototype.DmgEffectUpdate;
Game_Interpreter.prototype.DmgEffectUpdate = function() {
const result = _DmgEffectUpdate.apply(this, arguments);
clampHeroMp();
return result;
};
}
// プレイヤーターン開始時の保険
if (Game_Interpreter.prototype.BtlPLTurnSetup_Update) {
const _BtlPLTurnSetup_Update = Game_Interpreter.prototype.BtlPLTurnSetup_Update;
Game_Interpreter.prototype.BtlPLTurnSetup_Update = function() {
const result = _BtlPLTurnSetup_Update.apply(this, arguments);
clampHeroMp();
return result;
};
}
// 本作のMP回復は上限9でクランプされるため、回復後にも最大値へ戻す
if (Game_Interpreter.prototype.MPKaihuku) {
const _MPKaihuku = Game_Interpreter.prototype.MPKaihuku;
Game_Interpreter.prototype.MPKaihuku = function() {
const result = _MPKaihuku.apply(this, arguments);
clampHeroMp();
return result;
};
}
})();