diff --git a/_core/lib/sw2/edit-chara-palette-option.pl b/_core/lib/sw2/edit-chara-palette-option.pl
index 2723a5055..8281fb888 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 83ccfd241..2b5bfb986 100644
--- a/_core/lib/sw2/palette-sub.pl
+++ b/_core/lib/sw2/palette-sub.pl
@@ -454,6 +454,69 @@ 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;
+
+ 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;
+ }
+ }
+ }
+ }
foreach (1 .. $::pc{weaponNum}){
next if $::pc{'weapon'.$_.'Acc'}.$::pc{'weapon'.$_.'Rate'}.
@@ -524,7 +587,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 .= "{出目修正}";
@@ -535,8 +600,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'}@{[extractWeaponMarks($::pc{'weapon'.$_.'Note'})]}$::pc{'weapon'.$_.'Usage'}";
$text .= "(${partName})" if $partName && $bot{BCD};
$text .= "\n";
}
@@ -567,7 +631,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";
}
}