From f183dcc72b53746e695b9861c5fb4da1dbff9809 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Wed, 25 Jun 2025 14:16:19 +0000 Subject: [PATCH] =?UTF-8?q?frontend:=20=EA=B8=B0=EC=88=A0=20=EC=A0=9C?= =?UTF-8?q?=ED=95=9C=20=ED=91=9C=EA=B8=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/components/MapViewer.vue | 8 +++++--- hwe/ts/components/NationBasicCard.vue | 7 +++++-- hwe/ts/defs/GameObj.ts | 3 +++ hwe/ts/utilGame/techLevel.ts | 9 ++++----- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/hwe/ts/components/MapViewer.vue b/hwe/ts/components/MapViewer.vue index 888219be..16db3ac0 100644 --- a/hwe/ts/components/MapViewer.vue +++ b/hwe/ts/components/MapViewer.vue @@ -170,7 +170,7 @@ import { joinYearMonth } from "@/util/joinYearMonth"; import { parseYearMonth } from "@/util/parseYearMonth"; import type { GameConstStore } from "@/GameConstStore"; import { unwrap_err } from "@/util/unwrap_err"; -import { getMaxRelativeTechLevel, TECH_LEVEL_YEAR_GAP } from "@/utilGame/techLevel"; +import { getMaxRelativeTechLevel } from "@/utilGame/techLevel"; import { deviceType } from "detect-it"; import MapCityBasic from "./MapCityBasic.vue"; import MapCityDetail from "./MapCityDetail.vue"; @@ -289,12 +289,14 @@ const titleTooltip = computed(()=>{ const { startYear, year } = mapData.value; const maxTechLevel = gameConstStore.value.gameConst.maxTechLevel; - const currentTechLimit = getMaxRelativeTechLevel(startYear, year, maxTechLevel); + const initialAllowedTechLevel = gameConstStore.value.gameConst.initialAllowedTechLevel; + const techLevelIncYear = gameConstStore.value.gameConst.techLevelIncYear; + const currentTechLimit = getMaxRelativeTechLevel(startYear, year, maxTechLevel, initialAllowedTechLevel, techLevelIncYear); if (currentTechLimit == maxTechLevel) { result.push(`기술등급 제한 : ${currentTechLimit}등급 (최종)`); } else { - const nextTechLimitYear = currentTechLimit * TECH_LEVEL_YEAR_GAP + startYear; + const nextTechLimitYear = currentTechLimit * techLevelIncYear + startYear; result.push(`기술등급 제한 : ${currentTechLimit}등급 (${nextTechLimitYear}년 해제)`); } diff --git a/hwe/ts/components/NationBasicCard.vue b/hwe/ts/components/NationBasicCard.vue index 16d62eab..aebc981d 100644 --- a/hwe/ts/components/NationBasicCard.vue +++ b/hwe/ts/components/NationBasicCard.vue @@ -124,9 +124,12 @@ watch( (nation) => { const { startyear, year } = global.value; console.log(gameConstStore); - maxTechLevel.value = getMaxRelativeTechLevel(startyear, year, gameConstStore.value.gameConst.maxTechLevel); + + const initialAllowedTechLevel = gameConstStore.value.gameConst.initialAllowedTechLevel; + const techLevelIncYear = gameConstStore.value.gameConst.techLevelIncYear; + maxTechLevel.value = getMaxRelativeTechLevel(startyear, year, gameConstStore.value.gameConst.maxTechLevel, initialAllowedTechLevel, techLevelIncYear); currentTechLevel.value = convTechLevel(nation.tech, maxTechLevel.value); - onTechLimit.value = isTechLimited(startyear, year, nation.tech, gameConstStore.value.gameConst.maxTechLevel); + onTechLimit.value = isTechLimited(startyear, year, nation.tech, gameConstStore.value.gameConst.maxTechLevel, initialAllowedTechLevel, techLevelIncYear); }, { immediate: true } ); diff --git a/hwe/ts/defs/GameObj.ts b/hwe/ts/defs/GameObj.ts index 95fac373..154ba3f2 100644 --- a/hwe/ts/defs/GameObj.ts +++ b/hwe/ts/defs/GameObj.ts @@ -57,6 +57,9 @@ export type GameConstType = { maxTechLevel: number; maxBetrayCnt: number; + techLevelIncYear: number; + initialAllowedTechLevel: number; + basePopIncreaseAmount: number; expandCityPopIncreaseAmount: number; expandCityDevelIncreaseAmount: number; diff --git a/hwe/ts/utilGame/techLevel.ts b/hwe/ts/utilGame/techLevel.ts index dc9012b8..11578ec9 100644 --- a/hwe/ts/utilGame/techLevel.ts +++ b/hwe/ts/utilGame/techLevel.ts @@ -1,11 +1,10 @@ import { clamp } from "lodash-es"; -export const TECH_LEVEL_YEAR_GAP = 5; export const TECH_LEVEL_STEP = 1000; -export function isTechLimited(startYear: number, year: number, tech: number, maxTechLevel: number): boolean { - const relMaxTech = getMaxRelativeTechLevel(startYear, year, maxTechLevel); +export function isTechLimited(startYear: number, year: number, tech: number, maxTechLevel: number, initialAllowedTechLevel: number, techLevelIncYear: number): boolean { + const relMaxTech = getMaxRelativeTechLevel(startYear, year, maxTechLevel, initialAllowedTechLevel, techLevelIncYear); const techLevel = convTechLevel(tech, maxTechLevel); return techLevel >= relMaxTech; @@ -16,7 +15,7 @@ export function convTechLevel(tech: number, maxTechLevel: number): number{ } -export function getMaxRelativeTechLevel(startYear: number, year: number, maxTechLevel: number): number { +export function getMaxRelativeTechLevel(startYear: number, year: number, maxTechLevel: number, initialAllowedTechLevel: number, techLevelIncYear: number): number { const relYear = year - startYear; - return clamp(Math.floor(relYear / TECH_LEVEL_YEAR_GAP) + 1, 1, maxTechLevel); + return clamp(Math.floor(relYear / techLevelIncYear) + initialAllowedTechLevel, 1, maxTechLevel); } \ No newline at end of file