From 49d170cfcf7412362bc93503d25b5a93fc03d075 Mon Sep 17 00:00:00 2001 From: ViVi Date: Fri, 27 Dec 2024 06:49:41 +0900 Subject: [PATCH 1/7] [SW2] Refactor: extract chat-palette additional form --- _core/lib/sw2.0/edit-chara.pl | 123 +------------------ _core/lib/sw2/edit-chara-palette-option.pl | 136 +++++++++++++++++++++ _core/lib/sw2/edit-chara.pl | 124 +------------------ 3 files changed, 140 insertions(+), 243 deletions(-) create mode 100644 _core/lib/sw2/edit-chara-palette-option.pl diff --git a/_core/lib/sw2.0/edit-chara.pl b/_core/lib/sw2.0/edit-chara.pl index 2abc3f8a8..fdcaf06f3 100644 --- a/_core/lib/sw2.0/edit-chara.pl +++ b/_core/lib/sw2.0/edit-chara.pl @@ -1570,127 +1570,8 @@ sub classInputBox { HTML sub chatPaletteFormOptional { - $pc{chatPaletteInsertNum} ||= 2; - $pc{paletteAttackNum} ||= 3; - $pc{paletteMagicNum} ||= 3; - my $html = <<"HTML"; -
-

プリセットの追加オプション

-
-

一般技能の判定の出力設定

-

その行の技能のレベルと、選択したボーナスの組み合わせが追加されます

- - -HTML - foreach ('TMPL',1 .. $pc{commonClassNum}){ - $html .= '' if $_ eq 'TMPL'; - } - $html .= <<"HTML"; -
-
-
- 追加挿入 -
    -HTML - foreach ('TMPL',1 .. $pc{chatPaletteInsertNum}){ - $html .= '' if $_ eq 'TMPL'; - } - $html .= <<"HTML"; -
- - @{[ input "chatPaletteInsertNum","hidden" ]} -
-
- 武器攻撃の追加オプション -

宣言特技などの名称と修正を入力すると、それにもとづいた命中判定および威力算出の行が追加されます。

- - - - -HTML - foreach ('TMPL',1 .. $pc{paletteAttackNum}){ - $html .= '' if $_ eq 'TMPL'; - } - $html .= <<"HTML"; -
- 名称(宣言特技名など) - 命中修正 - C値修正 - ダメージ
修正
-
出目修正 - 対象の武器 -
- - @{[ input "paletteAttackNum","hidden" ]} -
-
- 魔法の追加オプション -

宣言特技などの名称と修正を入力すると、それにもとづいた、行使判定および威力算出の行が追加されます。

- - - - -HTML - foreach ('TMPL',1 .. $pc{paletteMagicNum}){ - $html .= '' if $_ eq 'TMPL'; - } - $html .= <<"HTML"; -
- 名称(宣言特技名など) - 魔力修正 - 行使修正 - C値修正 - ダメージ
修正
-
対象の魔法 -
- - @{[ input "paletteMagicNum","hidden" ]} -
-HTML + require($::core_dir . '/lib/sw2/edit-chara-palette-option.pl'); + return palette::chatPaletteFormOptional(\%pc); } # ヘルプ my $text_rule = <<"HTML"; diff --git a/_core/lib/sw2/edit-chara-palette-option.pl b/_core/lib/sw2/edit-chara-palette-option.pl new file mode 100644 index 000000000..faf8361ca --- /dev/null +++ b/_core/lib/sw2/edit-chara-palette-option.pl @@ -0,0 +1,136 @@ +use strict; +use utf8; +use open ":utf8"; + +package palette; + +sub chatPaletteFormOptional { + my %pc = %{shift;}; + + require($::core_dir . '/lib/edit.pl'); + + $::pc{chatPaletteInsertNum} = ($pc{chatPaletteInsertNum} ||= 2); + $::pc{paletteAttackNum} = ($pc{paletteAttackNum} ||= 3); + $::pc{paletteMagicNum} = ($pc{paletteMagicNum} ||= 3); + my $html = <<"HTML"; +
+

プリセットの追加オプション

+
+

一般技能の判定の出力設定

+

その行の技能のレベルと、選択したボーナスの組み合わせが追加されます

+ + +HTML + foreach ('TMPL',1 .. $pc{commonClassNum}){ + $html .= '' if $_ eq 'TMPL'; + } + $html .= <<"HTML"; +
+
+
+ 追加挿入 +
    +HTML + foreach ('TMPL',1 .. $pc{chatPaletteInsertNum}){ + $html .= '' if $_ eq 'TMPL'; + } + $html .= <<"HTML"; +
+ + @{[ ::input "chatPaletteInsertNum","hidden" ]} +
+
+ 武器攻撃の追加オプション +

宣言特技などの名称と修正を入力すると、それにもとづいた命中判定および威力算出の行が追加されます。

+ + + + +HTML + foreach ('TMPL',1 .. $pc{paletteAttackNum}){ + $html .= '' if $_ eq 'TMPL'; + } + $html .= <<"HTML"; +
+ 名称(宣言特技名など) + 命中修正 + C値修正 + ダメージ
修正
+
出目修正 + 対象の武器 +
+ + @{[ ::input "paletteAttackNum","hidden" ]} +
+
+ 魔法の追加オプション +

宣言特技などの名称と修正を入力すると、それにもとづいた、行使判定および威力算出の行が追加されます。

+ + + + +HTML + foreach ('TMPL',1 .. $pc{paletteMagicNum}){ + $html .= '' if $_ eq 'TMPL'; + } + $html .= <<"HTML"; +
+ 名称(宣言特技名など) + 魔力修正 + 行使修正 + C値修正 + ダメージ
修正
+
対象の魔法 +
+ + @{[ ::input "paletteMagicNum","hidden" ]} +
+
+HTML +} + +1; diff --git a/_core/lib/sw2/edit-chara.pl b/_core/lib/sw2/edit-chara.pl index 3bc3f9d23..d5c8d68fb 100644 --- a/_core/lib/sw2/edit-chara.pl +++ b/_core/lib/sw2/edit-chara.pl @@ -1676,128 +1676,8 @@ sub classInputBox { HTML sub chatPaletteFormOptional { - $pc{chatPaletteInsertNum} ||= 2; - $pc{paletteAttackNum} ||= 3; - $pc{paletteMagicNum} ||= 3; - my $html = <<"HTML"; -
-

プリセットの追加オプション

-
-

一般技能の判定の出力設定

-

その行の技能のレベルと、選択したボーナスの組み合わせが追加されます

- - -HTML - foreach ('TMPL',1 .. $pc{commonClassNum}){ - $html .= '' if $_ eq 'TMPL'; - } - $html .= <<"HTML"; -
-
-
- 追加挿入 -
    -HTML - foreach ('TMPL',1 .. $pc{chatPaletteInsertNum}){ - $html .= '' if $_ eq 'TMPL'; - } - $html .= <<"HTML"; -
- - @{[ input "chatPaletteInsertNum","hidden" ]} -
-
- 武器攻撃の追加オプション -

宣言特技などの名称と修正を入力すると、それにもとづいた命中判定および威力算出の行が追加されます。

- - - - -HTML - foreach ('TMPL',1 .. $pc{paletteAttackNum}){ - $html .= '' if $_ eq 'TMPL'; - } - $html .= <<"HTML"; -
- 名称(宣言特技名など) - 命中修正 - C値修正 - ダメージ
修正
-
出目修正 - 対象の武器 -
- - @{[ input "paletteAttackNum","hidden" ]} -
-
- 魔法の追加オプション -

宣言特技などの名称と修正を入力すると、それにもとづいた、行使判定および威力算出の行が追加されます。

- - - - -HTML - foreach ('TMPL',1 .. $pc{paletteMagicNum}){ - $html .= '' if $_ eq 'TMPL'; - } - $html .= <<"HTML"; -
- 名称(宣言特技名など) - 魔力修正 - 行使修正 - C値修正 - ダメージ
修正
-
対象の魔法 -
- - @{[ input "paletteMagicNum","hidden" ]} -
-
-HTML + require($::core_dir . '/lib/sw2/edit-chara-palette-option.pl'); + return palette::chatPaletteFormOptional(\%pc); } # ヘルプ From 83ec62d81e87ce6c412e1c91ba0e8ef7a49d33bc Mon Sep 17 00:00:00 2001 From: ViVi Date: Mon, 17 Feb 2025 11:45:22 +0900 Subject: [PATCH 2/7] =?UTF-8?q?[SW2]=20=E3=82=86=E3=81=A8=E3=83=81?= =?UTF-8?q?=E3=83=A3adv.=E7=94=A8=E3=81=AE=E6=AD=A6=E5=99=A8=E6=94=BB?= =?UTF-8?q?=E6=92=83=E3=81=AE=E5=A8=81=E5=8A=9B=E8=A7=A3=E6=B1=BA=E3=82=B3?= =?UTF-8?q?=E3=83=9E=E3=83=B3=E3=83=89=E3=81=AB=E3=80=81=E6=AD=A6=E5=99=A8?= =?UTF-8?q?=E5=90=8D=E3=81=A8=E7=94=A8=E6=B3=95=E3=82=92=E6=98=8E=E8=A8=98?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _core/lib/sw2/palette-sub.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/_core/lib/sw2/palette-sub.pl b/_core/lib/sw2/palette-sub.pl index 178a70a5a..5bf8b7fdb 100644 --- a/_core/lib/sw2/palette-sub.pl +++ b/_core/lib/sw2/palette-sub.pl @@ -498,8 +498,7 @@ sub palettePreset { $text .= $bot{YTC} ? '首切' : $bot{BCD} ? 'r5' : ''; } $text .= " ダメージ"; - $text .= extractWeaponMarks($::pc{'weapon'.$_.'Name'}.$::pc{'weapon'.$_.'Note'}) unless $bot{BCD}; - $text .= "/$::pc{'weapon'.$_.'Name'}$::pc{'weapon'.$_.'Usage'}" if $bot{BCD}; + $text .= "/$::pc{'weapon'.$_.'Name'}$::pc{'weapon'.$_.'Usage'}"; $text .= "(${partName})" if $partName && $bot{BCD}; $text .= "\n"; } From c6111a684825caa5a977969d6af5b6601c00b142 Mon Sep 17 00:00:00 2001 From: ViVi Date: Mon, 17 Feb 2025 21:26:17 +0900 Subject: [PATCH 3/7] =?UTF-8?q?[SW2]=20=E3=82=86=E3=81=A8=E3=83=81?= =?UTF-8?q?=E3=83=A3adv.=E7=94=A8=E3=81=AE=E5=A8=81=E5=8A=9B=E8=A1=A8?= =?UTF-8?q?=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E8=A1=8C=E3=81=AB=E3=80=81?= =?UTF-8?q?=E6=AD=A6=E5=99=A8=E6=94=BB=E6=92=83=E3=81=AE=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=AE=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E3=82=92=E5=90=AB=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _core/lib/sw2/palette-sub.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_core/lib/sw2/palette-sub.pl b/_core/lib/sw2/palette-sub.pl index 178a70a5a..9562005ec 100644 --- a/_core/lib/sw2/palette-sub.pl +++ b/_core/lib/sw2/palette-sub.pl @@ -530,7 +530,7 @@ sub palettePreset { if($dmgTexts{$paNum} eq $dmgTexts{$paNum - 1}){ $activeName = $::pc{'paletteAttack'.($paNum - 1).'Name'} ? "+$::pc{'paletteAttack'.($paNum - 1).'Name'}" : ''; } - $text .= $bot{BCD} ? ($dmgTexts{$paNum} =~ s/(\n)/$activeName$1/gr) : $dmgTexts{$paNum}; + $text .= ($dmgTexts{$paNum} =~ s/(\n)/$activeName$1/gr); $text .= "\n"; } } From 898b30a5ad01bdf12a8eba5ef5ce2e76641ce2a9 Mon Sep 17 00:00:00 2001 From: ViVi Date: Tue, 18 Feb 2025 00:25:20 +0900 Subject: [PATCH 4/7] =?UTF-8?q?Fix:=20[SW2]=20=E6=AD=A6=E5=99=A8=E6=94=BB?= =?UTF-8?q?=E6=92=83=E3=81=AE=E5=A8=81=E5=8A=9B=E8=A1=A8=E3=82=B3=E3=83=9E?= =?UTF-8?q?=E3=83=B3=E3=83=89=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E3=80=81?= =?UTF-8?q?=E5=82=99=E8=80=83=E6=AC=84=E3=81=AB=E8=A8=98=E8=BF=B0=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E7=89=B9=E6=80=A7=EF=BC=88?= =?UTF-8?q?=E5=88=83=E6=AD=A6=E5=99=A8=EF=BC=8F=E6=89=93=E6=92=83=E6=AD=A6?= =?UTF-8?q?=E5=99=A8=EF=BC=89=E3=81=8C=E5=8F=8D=E6=98=A0=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _core/lib/sw2/palette-sub.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_core/lib/sw2/palette-sub.pl b/_core/lib/sw2/palette-sub.pl index 5bf8b7fdb..6eeab9f83 100644 --- a/_core/lib/sw2/palette-sub.pl +++ b/_core/lib/sw2/palette-sub.pl @@ -498,7 +498,7 @@ sub palettePreset { $text .= $bot{YTC} ? '首切' : $bot{BCD} ? 'r5' : ''; } $text .= " ダメージ"; - $text .= "/$::pc{'weapon'.$_.'Name'}$::pc{'weapon'.$_.'Usage'}"; + $text .= "/$::pc{'weapon'.$_.'Name'}@{[extractWeaponMarks($::pc{'weapon'.$_.'Note'})]}$::pc{'weapon'.$_.'Usage'}"; $text .= "(${partName})" if $partName && $bot{BCD}; $text .= "\n"; } From 7a424e52c35a810c5a0076759b3389d6263e8849 Mon Sep 17 00:00:00 2001 From: ViVi Date: Mon, 17 Feb 2025 22:52:25 +0900 Subject: [PATCH 5/7] =?UTF-8?q?[SW2]=20=E6=AD=A6=E5=99=A8=E6=94=BB?= =?UTF-8?q?=E6=92=83=E3=81=AE=E8=BF=BD=E5=8A=A0=E3=82=AA=E3=83=97=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6=E3=80=81?= =?UTF-8?q?=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E5=90=8C=E5=A3=AB?= =?UTF-8?q?=E3=82=92=E7=B5=84=E3=81=BF=E5=90=88=E3=82=8F=E3=81=9B=E3=82=8B?= =?UTF-8?q?=E8=A8=98=E6=B3=95=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _core/lib/sw2/edit-chara-palette-option.pl | 6 +++ _core/lib/sw2/palette-sub.pl | 48 ++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/_core/lib/sw2/edit-chara-palette-option.pl b/_core/lib/sw2/edit-chara-palette-option.pl index faf8361ca..e70ad155c 100644 --- a/_core/lib/sw2/edit-chara-palette-option.pl +++ b/_core/lib/sw2/edit-chara-palette-option.pl @@ -91,6 +91,12 @@ sub chatPaletteFormOptional { @{[ ::input "paletteAttackNum","hidden" ]} +
    +
  • + オプション名をで区切って列記すると、すでに定義されている他のオプションを参照して組み合わせられます。
    + その場合、組み合わせたオプションの修正値は、すべて空欄にしてください。
    + (例: 名称に魔力撃 | 全力攻撃Ⅱと記述すると、魔力撃という名称のオプションと全力攻撃Ⅱという名称のオプションを組み合わせた効果になります) +
魔法の追加オプション diff --git a/_core/lib/sw2/palette-sub.pl b/_core/lib/sw2/palette-sub.pl index 3a5273517..16547e42b 100644 --- a/_core/lib/sw2/palette-sub.pl +++ b/_core/lib/sw2/palette-sub.pl @@ -417,6 +417,54 @@ sub palettePreset { last; } } + + # オプションの組み合わせの解決 + { + my @fieldNames = ('Acc', 'Crit', 'Dmg', 'Roll'); + my %options = (); + + foreach my $paNum (1 .. $::pc{paletteAttackNum}) { + my $paName = $::pc{"paletteAttack${paNum}Name"}; + next if $paName eq ''; + next if $paName =~ /[||]/; + next unless grep { $::pc{"paletteAttack${paNum}${_}"} } @fieldNames; + + my %option = (); + foreach my $fieldName (@fieldNames) { + next unless $::pc{"paletteAttack${paNum}${fieldName}"}; + $option{$fieldName} = $::pc{"paletteAttack${paNum}${fieldName}"}; + } + + $options{$paName} = \%option; + } + + foreach my $paNum (1 .. $::pc{paletteAttackNum}) { + my $paName = $::pc{"paletteAttack${paNum}Name"}; + next if $paName eq ''; + next unless $paName =~ /[||]/; + next if grep { $::pc{"paletteAttack${paNum}${_}"} } @fieldNames; + + my %option = (); + $option{$_} = [] foreach @fieldNames; + + foreach my $referenceName (split(/\s*[||]\s*/, $paName)) { + next unless $options{$referenceName}; + my %referredOption = %{$options{$referenceName}}; + + foreach my $fieldName (keys %referredOption) { + my @list = @{$option{$fieldName}}; + push(@list, $referredOption{$fieldName}); + $option{$fieldName} = \@list; + } + } + + foreach my $fieldName (@fieldNames) { + my @list = @{$option{$fieldName}}; + next unless @list; + $::pc{"paletteAttack${paNum}${fieldName}"} = join('+', @list); + } + } + } foreach (1 .. $::pc{weaponNum}){ next if $::pc{'weapon'.$_.'Acc'}.$::pc{'weapon'.$_.'Rate'}. From f27ae4b159ff9c82b81810060f7eb4e01d46bb88 Mon Sep 17 00:00:00 2001 From: ViVi Date: Sun, 23 Nov 2025 08:13:11 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[SW2]=20=E6=AD=A6=E5=99=A8=E6=94=BB?= =?UTF-8?q?=E6=92=83=E3=81=AE=E8=BF=BD=E5=8A=A0=E3=82=AA=E3=83=97=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=AE=E3=80=8C=E5=87=BA=E7=9B=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=80=8D=E3=82=92=E6=9F=94=E8=BB=9F=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _core/lib/sw2/palette-sub.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_core/lib/sw2/palette-sub.pl b/_core/lib/sw2/palette-sub.pl index 28fe4eb90..71325ce25 100644 --- a/_core/lib/sw2/palette-sub.pl +++ b/_core/lib/sw2/palette-sub.pl @@ -487,7 +487,9 @@ sub palettePreset { $text .= "+{追加D修正}"; if($::pc{'paletteAttack'.$paNum.'Roll'}){ $::pc{'paletteAttack'.$paNum.'Roll'} =~ s/^+//; - $text .= "$+{クリレイ}\#$::pc{'paletteAttack'.$paNum.'Roll'}"; + $text .= "$+{クリレイ}"; + $text .= '#' if $::pc{'paletteAttack'.$paNum.'Roll'} =~ /^\d/; + $text .= $::pc{'paletteAttack'.$paNum.'Roll'}; } else { $text .= "{出目修正}"; From 91062a2dc5b468bfad1ea728ef6953b39451b93a Mon Sep 17 00:00:00 2001 From: ViVi Date: Sun, 23 Nov 2025 19:47:28 +0900 Subject: [PATCH 7/7] =?UTF-8?q?[SW2]=20=E6=AD=A6=E5=99=A8=E6=94=BB?= =?UTF-8?q?=E6=92=83=E3=81=AE=E8=BF=BD=E5=8A=A0=E3=82=AA=E3=83=97=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=AE=E7=B5=84=E3=81=BF=E5=90=88=E3=82=8F?= =?UTF-8?q?=E3=81=9B=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6=E3=80=81=E3=80=8C?= =?UTF-8?q?=E5=87=BA=E7=9B=AE=E4=BF=AE=E6=AD=A3=E3=80=8D=E3=81=AE=E7=B5=90?= =?UTF-8?q?=E5=90=88=E3=82=92=E5=8D=98=E7=B4=94=E5=8A=A0=E7=AE=97=E4=BB=A5?= =?UTF-8?q?=E5=A4=96=E3=81=AB=E5=AF=BE=E5=BF=9C=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _core/lib/sw2/palette-sub.pl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/_core/lib/sw2/palette-sub.pl b/_core/lib/sw2/palette-sub.pl index c2fd93c49..2b5bfb986 100644 --- a/_core/lib/sw2/palette-sub.pl +++ b/_core/lib/sw2/palette-sub.pl @@ -498,7 +498,22 @@ sub palettePreset { foreach my $fieldName (@fieldNames) { my @list = @{$option{$fieldName}}; next unless @list; - $::pc{"paletteAttack${paNum}${fieldName}"} = join('+', @list); + + if ($fieldName ne 'Roll') { + $::pc{"paletteAttack${paNum}${fieldName}"} = join('+', @list); + } + else { + # 「出目修正」は単純な '+' での結合では済まないケースがある. + + my $composed = $list[0]; + if ($#list > 0) { + foreach (1..$#list) { + $composed .= '+' if $list[$_] =~ /^\d/; + $composed .= $list[$_]; + } + } + $::pc{"paletteAttack${paNum}${fieldName}"} = $composed; + } } } }