diff --git a/hwe/a_genList.php b/hwe/a_genList.php index 750c1da5..a0a15c68 100644 --- a/hwe/a_genList.php +++ b/hwe/a_genList.php @@ -172,6 +172,7 @@ if ($gameStor->isunited) { data-general-strength='{$general['strength']}' data-general-intel='{$general['intel']}' data-is-npc='" . ($general['npc'] >= 2 ? 'true' : 'false') . "' + data-npc-type='{$general['npc']}' > $name diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index 49458ef1..0a7a4d93 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -337,6 +337,7 @@ $templates = new \League\Plates\Engine('templates'); 'ourGeneral' => $ourGeneral, 'iconPath' => GetImageURL($general['imgsvr']) . '/' . $general['picture'], 'isNPC' => $isNPC, + 'npc' => $general['npc'], 'wounded' => $wounded, 'name' => $name, 'nameText' => $nameText, diff --git a/hwe/templates/cityGeneral.php b/hwe/templates/cityGeneral.php index f342eae8..71947b3d 100644 --- a/hwe/templates/cityGeneral.php +++ b/hwe/templates/cityGeneral.php @@ -1,6 +1,7 @@ - NPC 장수 + NPC 장수 @@ -49,5 +50,5 @@ 재 야 - + \ No newline at end of file diff --git a/hwe/templates/generalList.php b/hwe/templates/generalList.php index 68ece9a2..37d08d11 100644 --- a/hwe/templates/generalList.php +++ b/hwe/templates/generalList.php @@ -22,6 +22,7 @@ ' data-general-id="" data-is-npc="=2?'true':'false'?>" + data-npc-type='' data-general-wounded="" data-general-name="" data-general-leadership="" diff --git a/hwe/ts/extKingdoms.ts b/hwe/ts/extKingdoms.ts index 51b5d72d..86b484b5 100644 --- a/hwe/ts/extKingdoms.ts +++ b/hwe/ts/extKingdoms.ts @@ -2,6 +2,7 @@ import $ from 'jquery'; import { unwrap } from '@util/unwrap'; import axios from 'axios'; import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest'; +import { getNpcColor } from './common_legacy'; declare const killturn: number; declare const autorun_user: undefined|null|{ @@ -20,7 +21,7 @@ type KingdomGeneral = { 지: number, 삭턴: number, 종류: UserType, - NPC: boolean, + NPC: number, } type UserType = "통" | "무" | "지" | "만능" | "평범" | "무능" | "무지"; @@ -132,7 +133,7 @@ $(function () { 장수.지 = parseInt($this.data('general-intel')); 장수.삭턴 = parseInt($tds.eq(-2).text()); 장수.종류 = getUserType(장수.통, 장수.무, 장수.지); - 장수.NPC = $this.data('is-npc'); + 장수.NPC = $this.data('npc-type'); if (!(국가 in 국가별)) { 국가별[국가] = { @@ -208,13 +209,13 @@ $(function () { //const 종능 = val.통 + val.무 + val.지; console.log(val); if (종류명 != '무능' && 종류명 != '무지') { - if (val.삭턴 >= realKillturn && !val.NPC) { + if (val.삭턴 >= realKillturn && val.NPC < 2) { 전투유저장수 += 1; 통솔합 += val.통; } - if (val.삭턴 > 5 && val.NPC) { + if (val.삭턴 > 5 && val.NPC >= 2) { 전투N장수 += 1; N장통솔합 += val.통; @@ -225,12 +226,13 @@ $(function () { const $obj2 = $(''); $obj.html(val.장수명); - if (!val.NPC && val.삭턴 < realKillturn) { + if (val.NPC < 2 && val.삭턴 < realKillturn) { $obj.css('text-decoration', 'line-through'); 삭턴장수 += 1; } - if (val.NPC) { - $obj.css('color', 'cyan'); + const colorNPC = getNpcColor(val.NPC); + if (colorNPC !== undefined) { + $obj.css('color', colorNPC); } if (val.벌점 >= 1500) $obj.css('color', 'yellow'); else if (val.벌점 >= 200) $obj.css('color', 'lightgreen');