From 900eefc93c452dab5cc8e0c0882ba1faf854c3f4 Mon Sep 17 00:00:00 2001 From: ViVi Date: Sat, 9 Dec 2023 11:01:15 +0900 Subject: [PATCH] =?UTF-8?q?[DX3]=20=E4=BE=B5=E8=9D=95=E7=8E=87=E3=82=92?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E3=81=AB=E3=81=99=E3=82=8B=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NPC向け --- _core/lib/dx3/edit-chara.js | 28 ++++++++++++++++++++ _core/lib/dx3/edit-chara.pl | 25 ++++++++++-------- _core/lib/dx3/view-chara.pl | 4 +++ _core/skin/dx3/css/chara.css | 15 +++++++++++ _core/skin/dx3/css/edit.css | 46 +++++++++++++++++++++++++++++++-- _core/skin/dx3/sheet-chara.html | 45 ++++++++++++++++++++------------ 6 files changed, 133 insertions(+), 30 deletions(-) diff --git a/_core/lib/dx3/edit-chara.js b/_core/lib/dx3/edit-chara.js index 9f59fa4ef..94f7b067f 100644 --- a/_core/lib/dx3/edit-chara.js +++ b/_core/lib/dx3/edit-chara.js @@ -14,6 +14,7 @@ window.onload = function() { checkStage(); checkWorks(); checkSyndrome(); + encroachModeChanged(); calcStt(); calcEffect(); calcMagic(); @@ -445,6 +446,33 @@ function encroachBonusSet(enc){ } } +function encroachModeChanged() { + const checkbox = document.querySelector('input[name="encroachFixed"]'); + const fixed = checkbox != null && checkbox.checked; + + const lifePathNode = document.getElementById('lifepath'); + lifePathNode.classList.toggle('encroach-fixed', fixed); + + const awakenInputCell = lifePathNode.querySelector('tbody.awaken tr > td:nth-child(2)'); + const awakenNoteCell = lifePathNode.querySelector('tbody.awaken tr > td:last-child'); + const impulseInputCell = lifePathNode.querySelector('tbody.impulse tr:first-child > td:nth-child(2)'); + const impulseNoteCell = lifePathNode.querySelector('tbody.impulse tr:first-child > td:last-child'); + + if (fixed) { + awakenInputCell.setAttribute('colspan', '2'); + awakenNoteCell.setAttribute('colspan', '2'); + impulseInputCell.setAttribute('colspan', '2'); + impulseNoteCell.setAttribute('colspan', '2'); + } else { + awakenInputCell.removeAttribute('colspan'); + awakenNoteCell.removeAttribute('colspan'); + impulseInputCell.removeAttribute('colspan'); + impulseNoteCell.removeAttribute('colspan'); + } + + calcEncroach(); +} + // ロイス ---------------------------------------- function emoP(num){ form["lois"+num+"EmoNegaCheck"].checked = false; } function emoN(num){ form["lois"+num+"EmoPosiCheck"].checked = false; } diff --git a/_core/lib/dx3/edit-chara.pl b/_core/lib/dx3/edit-chara.pl index 266ae188b..cf6c77d6e 100644 --- a/_core/lib/dx3/edit-chara.pl +++ b/_core/lib/dx3/edit-chara.pl @@ -506,33 +506,36 @@ 邂逅/欲望 @{[input "lifepathEncounter"]} @{[input "lifepathEncounterNote",'','','placeholder="備考"']} - + 覚醒 - 侵蝕値 - + 侵蝕値 + @{[input "lifepathAwakenNote",'','','placeholder="備考"']} - + 衝動 - 侵蝕値 - + 侵蝕値 + @{[input "lifepathImpulseNote",'','','placeholder="備考"']} - @{[input "lifepathUrgeCheck",'checkbox']}変異暴走 + @{[input "lifepathUrgeCheck",'checkbox']}変異暴走 効果 @{[input "lifepathUrgeNote",'','','placeholder="効果"']} - + その他の修正 @{[input "lifepathOtherEncroach",'number','calcEncroach']} @{[input "lifepathOtherNote",'','','placeholder="備考"']} - + - 侵蝕率基本値 - + 侵蝕率基本値 + + + @{[input "encroachFixedValue", 'number', 'calcEncroach']} + @{[ checkbox 'encroachFixed', '侵蝕率を固定にする(NPC向け)', 'encroachModeChanged' ]} diff --git a/_core/lib/dx3/view-chara.pl b/_core/lib/dx3/view-chara.pl index 1e8a7b34d..ca5a6fda3 100644 --- a/_core/lib/dx3/view-chara.pl +++ b/_core/lib/dx3/view-chara.pl @@ -269,6 +269,10 @@ $SHEET->param(breed => isNoiseText(removeTags $breedPrefix) ? $breedPrefix : $breedPrefix ? "$breedPrefixブリード" : ''); ### 侵蝕率基本値 -------------------------------------------------- +if ($pc{encroachFixed}) { + $pc{'lifepathOtherEncroach'} = undef; + $pc{'lifepathOtherNote'} = undef; +} $SHEET->param(hasEncroachOffset => $pc{'lifepathOtherEncroach'} || $pc{'lifepathOtherNote'} ? 1 : 0); ### 能力値 -------------------------------------------------- diff --git a/_core/skin/dx3/css/chara.css b/_core/skin/dx3/css/chara.css index 3c123e0d9..b36e4cf94 100644 --- a/_core/skin/dx3/css/chara.css +++ b/_core/skin/dx3/css/chara.css @@ -357,6 +357,18 @@ body { font-size: 87%; } } +#lifepath.encroach-fixed table { + tbody.awaken .encroach, + tbody.impulse .encroach, + table tbody.encroach-offset, + tbody.neutral-encroach .suffix { + display: none; + } + + tbody.neutral-encroach { + background-color: var(--box-even-rows-bg-color); + } +} /* // Status / Skills @@ -1213,6 +1225,9 @@ body { opacity: 0.8; } } +#enc-bonus.encroach-fixed p .encroach-prefix { + display: none; +} #enc-bonus table { border-top: 1px; border-bottom: hidden; diff --git a/_core/skin/dx3/css/edit.css b/_core/skin/dx3/css/edit.css index 9f2b5a7dc..fe3c30331 100644 --- a/_core/skin/dx3/css/edit.css +++ b/_core/skin/dx3/css/edit.css @@ -140,8 +140,10 @@ body:not(.mode-crc) .crc-only { #lifepath table { table-layout: auto; & th:nth-child(1) { width: 5em; } - & td:nth-child(2) { width: 6em; } - & th:nth-child(3) { width: 4em; } + & td:nth-child(2), + & tbody.impulse tr:nth-child(2) th:nth-child(1) { width: 6em; } + & th:nth-child(3), + & tbody.impulse tr:nth-child(2) th:nth-child(2) { width: 4em; } & td.center { width: 4em; } & td:last-child { width: auto; } } @@ -158,6 +160,39 @@ body:not(.mode-crc) .crc-only { transform: scale(1.4) translateY(.1em); margin-right: .2em; } +#lifepath table th.small { + border-bottom-style: solid; +} +#lifepath.encroach-fixed { + table { + tbody.awaken .encroach, + tbody.impulse .encroach, + tbody.encroach-offset, + tbody.neutral-encroach th .suffix, + tbody.neutral-encroach td .calculated-value { + display: none; + } + + tbody.neutral-encroach { + background-color: var(--box-even-rows-bg-color); + } + } +} +#lifepath:not(.encroach-fixed) { + table tbody.neutral-encroach { + td input[name="encroachFixedValue"] { + display: none; + } + } +} +#lifepath table tbody.neutral-encroach td:last-child { + text-align: left; + + .check-button { + border: none; + font-size: 80%; + } +} @media screen and (width <= 735px){ #lifepath table, #lifepath tbody, @@ -203,6 +238,13 @@ body:not(.mode-crc) .crc-only { #lifepath tbody:nth-child(5) tr:nth-child(2) th:nth-child(2) { display: none; } + #lifepath tbody.neutral-encroach:nth-child(n+7) tr { + grid-template-columns: 6em 1fr auto; + } + #lifepath tbody.neutral-encroach:nth-child(n+7) tr td:last-child { + font-size: 80%; + vertical-align: middle; + } } diff --git a/_core/skin/dx3/sheet-chara.html b/_core/skin/dx3/sheet-chara.html index fae11b6fa..221811cce 100644 --- a/_core/skin/dx3/sheet-chara.html +++ b/_core/skin/dx3/sheet-chara.html @@ -176,7 +176,7 @@

経験点

作成
-
+

ライフパス

@@ -198,32 +198,34 @@

ライフパス

- + - - - + - - - - + - +
覚醒 - 侵蝕値 + colspan="2">覚醒 + 侵蝕値
-
colspan="2"> + +
衝動 - 侵蝕値 + colspan="2">衝動 + 侵蝕値
style="border-bottom:hidden"> + colspan="2" style="border-bottom:hidden"> +
/変異暴走
その他の修正 -
侵蝕率基本値 +
侵蝕率基本値 + +
@@ -587,11 +589,11 @@

経験点計算

-
+
class="encroach-fixed">
侵蝕率効果表

- 現在侵蝕率: + 現在侵蝕率: checked> checked>

@@ -631,7 +633,16 @@

経験点計算

let thBonus = document.createElement("th"); thBonus.textContent = 'ダイス' ; document.getElementById('enc-table-dices').prepend(thBonus); let thLevel = document.createElement("th"); thLevel.textContent = 'Efct.Lv'; document.getElementById('enc-table-level').prepend(thLevel); - encroachBonusSet(document.getElementById('current-encroach').value); + let encroachValue; + + if (document.getElementById('enc-bonus').classList.contains('encroach-fixed')) { + const valueText = document.querySelector('#enc-bonus .encroach-fixed-value').textContent; + encroachValue = /^\d+$/.test(valueText) ? parseInt(valueText) : -1; + } else { + encroachValue = document.getElementById('current-encroach').value; + } + + encroachBonusSet(encroachValue); } function encroachBonusSet(enc){ for (let v of array){ document.getElementById('enc-col'+v).classList.remove('current'); }