fix: 시나리오별 장비 매매 품목 범위를 보존

현재 시나리오 allItems를 API 선택지와 턴 실행 검증에 함께 적용한다. 빈 설정은 Ref 기본 장비 24종으로 복원하고 명시된 비급 시나리오는 기존 품목을 유지한다.
This commit is contained in:
2026-08-21 02:11:40 +00:00
parent 4ce2477103
commit 3b933a75b8
12 changed files with 301 additions and 28 deletions
@@ -61,6 +61,7 @@ export interface TurnCommandEnv {
npcSeizureMessageProb?: number;
maxResourceActionAmount: number;
itemCatalog?: Record<string, TurnCommandItemCatalogEntry>;
purchasableItemKeys?: ReadonlySet<string>;
generalActionModules?: RefOrderedActionStack<GeneralActionModule>;
warActionModules?: RefOrderedActionStack<WarActionModule>;
nationTraitModules?: Array<NationTraitModule>;
@@ -79,7 +79,11 @@ export class ActionDefinition<
if (!item) {
return null;
}
if (item.slot !== itemType || !item.buyable) {
if (
item.slot !== itemType ||
!item.buyable ||
(this.env.purchasableItemKeys !== undefined && !this.env.purchasableItemKeys.has(itemCode))
) {
return null;
}
return args;