feat: NPC 세금 처리 로직 및 관련 핸들러 추가, 대형 테스트 맵 수정

This commit is contained in:
2026-01-24 10:06:55 +00:00
parent cb04c930b8
commit 753abdaf47
7 changed files with 185 additions and 40 deletions
@@ -351,6 +351,32 @@ const resolveDefinition = (
fallback: GeneralActionDefinition
): GeneralActionDefinition => definitions.get(actionKey) ?? fallback;
const resolveNpcTaxRate = (cities: City[]): number => {
if (cities.length === 0) {
return 15;
}
let pop = 0;
let all = 0;
for (const city of cities) {
const popRatio = city.populationMax > 0 ? city.population / city.populationMax : 0;
pop += popRatio;
all += calcCityDevRatio(city);
}
pop /= cities.length;
all /= cities.length;
const avg = (pop + all) / 2;
if (avg > 0.95) {
return 25;
}
if (avg > 0.7) {
return 20;
}
if (avg > 0.5) {
return 15;
}
return 10;
};
export const createReservedTurnHandler = async (options: {
reservedTurns: InMemoryReservedTurnStore;
scenarioConfig: ScenarioConfig;