refac, wip: 벌점(connect, con) 변경
- 벌점: refreshScoreTotal - 순간벌점: refreshScore
This commit is contained in:
@@ -151,8 +151,8 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="bg1">벌점</div>
|
||||
<div class="general-connect-score">
|
||||
{{ formatConnectScore(general.connect) }} {{ general.connect.toLocaleString() }}점({{ general.con }})
|
||||
<div class="general-refresh-score-total">
|
||||
{{ formatRefreshScore(general.refreshScoreTotal) }} {{ general.refreshScoreTotal.toLocaleString() }}점({{ general.refreshScore }})
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -168,7 +168,7 @@ import { unwrap } from "@/util/unwrap";
|
||||
import type { GameConstStore } from "@/GameConstStore";
|
||||
import { formatGeneralTypeCall } from "@/utilGame/formatGeneralTypeCall";
|
||||
import { nextExpLevelRemain } from "@/utilGame/nextExpLevelRemain";
|
||||
import { formatConnectScore } from "@/utilGame/formatConnectScore";
|
||||
import { formatRefreshScore } from "@/utilGame/formatRefreshScore";
|
||||
import SammoBar from "@/components/SammoBar.vue";
|
||||
import { parseTime } from "@/util/parseTime";
|
||||
import { clamp } from "lodash-es";
|
||||
@@ -341,7 +341,7 @@ watch(
|
||||
grid-column: 2 / 4;
|
||||
}
|
||||
|
||||
.general-connect-score {
|
||||
.general-refresh-score-total {
|
||||
grid-column: 5 / 8;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -106,7 +106,7 @@ import type { GameConstStore } from "@/GameConstStore";
|
||||
import { unwrap } from "@/util/unwrap";
|
||||
import SimpleTooltipCell from "@/gridCellRenderer/SimpleTooltipCell.vue";
|
||||
import GridTooltipCell, { type GridCellInfo } from "@/gridCellRenderer/GridTooltipCell.vue";
|
||||
import { formatConnectScore } from "@/utilGame/formatConnectScore";
|
||||
import { formatRefreshScore } from "@/utilGame/formatRefreshScore";
|
||||
import { convertSearch초성 } from "@/util/convertSearch초성";
|
||||
import { isString } from "lodash-es";
|
||||
import { formatDefenceTrain } from "@/utilGame/formatDefenceTrain";
|
||||
@@ -353,7 +353,7 @@ type headerType =
|
||||
| "trainAtmos"
|
||||
| "specials"
|
||||
| "reservedCommandShort"
|
||||
| "killturnAndConnect"
|
||||
| "killturnAndRefresh"
|
||||
| "years"
|
||||
| "warResults";
|
||||
|
||||
@@ -1117,18 +1117,18 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
},
|
||||
],
|
||||
},
|
||||
killturnAndConnect: {
|
||||
groupId: "killturnAndConnect",
|
||||
killturnAndRefresh: {
|
||||
groupId: "killturnAndRefresh",
|
||||
headerName: "기타",
|
||||
children: [
|
||||
{
|
||||
colId: "killturnAndConnect",
|
||||
colId: "killturnAndRefresh",
|
||||
headerName: "삭/벌",
|
||||
cellRenderer: ({ data }: GenValueParams) => {
|
||||
if (data === undefined) {
|
||||
return "?";
|
||||
}
|
||||
return `${data.killturn.toLocaleString()}턴<br>${data.connect.toLocaleString()}점`;
|
||||
return `${data.killturn.toLocaleString()}턴<br>${data.refreshScoreTotal.toLocaleString()}점`;
|
||||
},
|
||||
cellClass: rightAlignClass,
|
||||
columnGroupShow: "closed",
|
||||
@@ -1149,14 +1149,14 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
columnGroupShow: "open",
|
||||
},
|
||||
{
|
||||
colId: "connect",
|
||||
colId: "refreshScoreTotal",
|
||||
headerName: "벌점",
|
||||
field: "connect",
|
||||
field: "refreshScoreTotal",
|
||||
cellRenderer: ({ data }: GenValueParams) => {
|
||||
if (data === undefined) {
|
||||
return "?";
|
||||
}
|
||||
return `${data.connect.toLocaleString()}점<br>(${formatConnectScore(data.connect)})`;
|
||||
return `${data.refreshScoreTotal.toLocaleString()}점<br>(${formatRefreshScore(data.refreshScoreTotal)})`;
|
||||
},
|
||||
...sortableNumber,
|
||||
width: 70,
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
<div>{{ general.killturn }} 턴</div>
|
||||
|
||||
<div class="bg1">벌점</div>
|
||||
<div class="general-connect-score">
|
||||
{{ formatConnectScore(general.connect) }} {{ general.connect.toLocaleString() }}점
|
||||
<div class="general-refresh-score-total">
|
||||
{{ formatRefreshScore(general.refreshScoreTotal) }} {{ general.refreshScoreTotal.toLocaleString() }}점
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -94,7 +94,7 @@ import type { NationStaticItem } from "@/defs";
|
||||
import { unwrap } from "@/util/unwrap";
|
||||
import type { GameConstStore } from "@/GameConstStore";
|
||||
import { formatGeneralTypeCall } from "@/utilGame/formatGeneralTypeCall";
|
||||
import { formatConnectScore } from "@/utilGame/formatConnectScore";
|
||||
import { formatRefreshScore } from "@/utilGame/formatRefreshScore";
|
||||
import { calcInjury } from "@/utilGame/calcInjury";
|
||||
import type { GameIActionInfo } from "@/defs/GameObj";
|
||||
import { isValidObjKey } from "@/utilGame/isValidObjKey";
|
||||
@@ -204,7 +204,7 @@ watch(
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.general-connect-score {
|
||||
.general-refresh-score-total {
|
||||
grid-column: 5 / 8;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -27,7 +27,7 @@ export type GeneralListItemP0 = {
|
||||
specialWar: GameObjClassKey;
|
||||
personal: GameObjClassKey;
|
||||
belong: number;
|
||||
connect: number;
|
||||
refreshScoreTotal: number;
|
||||
|
||||
officerLevel: number; //권한에따라 태수,군사,시종 노출 여부가 다름
|
||||
officerLevelText: string;
|
||||
@@ -46,7 +46,7 @@ export type GeneralListItemP0 = {
|
||||
};
|
||||
|
||||
export type GeneralListItemP1 = {
|
||||
con: number;
|
||||
refreshScore: number;
|
||||
specage: number;
|
||||
specage2: number;
|
||||
leadership_exp: number;
|
||||
|
||||
@@ -210,7 +210,7 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
||||
sort: null,
|
||||
},
|
||||
{
|
||||
colId: "killturnAndConnect_1",
|
||||
colId: "killturnAndRefresh_1",
|
||||
width: 70,
|
||||
hide: false,
|
||||
sort: null,
|
||||
@@ -222,7 +222,7 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
||||
sort: null,
|
||||
},
|
||||
{
|
||||
colId: "connect",
|
||||
colId: "refreshScoreTotal",
|
||||
width: 70,
|
||||
hide: true,
|
||||
sort: null,
|
||||
@@ -310,7 +310,7 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
||||
open: false,
|
||||
},
|
||||
{
|
||||
groupId: "killturnAndConnect",
|
||||
groupId: "killturnAndRefresh",
|
||||
open: true,
|
||||
},
|
||||
{
|
||||
@@ -522,7 +522,7 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
||||
sort: null,
|
||||
},
|
||||
{
|
||||
colId: "killturnAndConnect_1",
|
||||
colId: "killturnAndRefresh_1",
|
||||
width: 70,
|
||||
hide: false,
|
||||
sort: null,
|
||||
@@ -534,7 +534,7 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
||||
sort: null,
|
||||
},
|
||||
{
|
||||
colId: "connect",
|
||||
colId: "refreshScoreTotal",
|
||||
width: 70,
|
||||
hide: false,
|
||||
sort: "desc",
|
||||
@@ -623,7 +623,7 @@ export const defaultDisplaySetting: Record<"war" | "normal", GridDisplaySetting>
|
||||
open: false
|
||||
},
|
||||
{
|
||||
groupId: "killturnAndConnect",
|
||||
groupId: "killturnAndRefresh",
|
||||
open: true
|
||||
},
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ export type PublicGeneralItem = {
|
||||
dedicationStr: string,
|
||||
officerLevelStr: string,
|
||||
killturn: number,
|
||||
connect: number,
|
||||
refreshScoreTotal: number,
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export type GeneralListResponse = {
|
||||
PublicGeneralItem['leadership'], PublicGeneralItem['lbonus'], PublicGeneralItem['strength'], PublicGeneralItem['intel'],
|
||||
PublicGeneralItem['explevel'],
|
||||
PublicGeneralItem['experienceStr'], PublicGeneralItem['dedicationStr'], PublicGeneralItem['officerLevelStr'],
|
||||
PublicGeneralItem['killturn'], PublicGeneralItem['connect']
|
||||
PublicGeneralItem['killturn'], PublicGeneralItem['refreshScoreTotal']
|
||||
][],
|
||||
token?: Record<number, number>,
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ function printGeneralList(value: GeneralListResponse) {
|
||||
dedicationStr: rawGeneral[18],
|
||||
officerLevelStr: rawGeneral[19],
|
||||
killturn: rawGeneral[20],
|
||||
connect: rawGeneral[21],
|
||||
refreshScoreTotal: rawGeneral[21],
|
||||
reserved: 0
|
||||
};
|
||||
if (general.npc < 2) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import bs from "binary-search";
|
||||
|
||||
const connectMap: [number, string][] = [
|
||||
const refreshScoreMap: [number, string][] = [
|
||||
[0, "안함"],
|
||||
[50, "무관심"],
|
||||
[100, "보통"],
|
||||
@@ -13,11 +13,11 @@ const connectMap: [number, string][] = [
|
||||
[12800, "헐..."],
|
||||
];
|
||||
|
||||
export function formatConnectScore(connect: number) {
|
||||
const idx = bs(connectMap, connect, ([key], needle) => key - needle);
|
||||
export function formatRefreshScore(refreshScore: number) {
|
||||
const idx = bs(refreshScoreMap, refreshScore, ([key], needle) => key - needle);
|
||||
if (idx >= 0) {
|
||||
return connectMap[idx][1] ?? "?";
|
||||
return refreshScoreMap[idx][1] ?? "?";
|
||||
}
|
||||
const uidx = (~idx) - 1;
|
||||
return connectMap[uidx][1];
|
||||
return refreshScoreMap[uidx][1];
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
export { calcInjury } from './calcInjury';
|
||||
export { formatCityName } from './formatCityName';
|
||||
export { formatConnectScore } from './formatConnectScore';
|
||||
export { formatRefreshScore } from './formatRefreshScore';
|
||||
export { formatDefenceTrain } from './formatDefenceTrain';
|
||||
export { formatDexLevel } from './formatDexLevel';
|
||||
export { formatGeneralTypeCall } from './formatGeneralTypeCall';
|
||||
|
||||
Reference in New Issue
Block a user