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
@@ -252,6 +252,37 @@ describe('typed item lifecycle events', () => {
});
});
it('시나리오 상점 목록에 없는 전역 구매 가능 아이템을 거부한다', () => {
const itemKey = 'event_전투특기_격노';
const catalog: Record<string, TurnCommandItemCatalogEntry> = {
[itemKey]: {
slot: 'item',
name: '격노의 비급',
rawName: '격노의 비급',
cost: 100,
reqSecu: 0,
buyable: true,
unique: false,
},
};
const denied = new TradeItemAction({
...BASE_ENV,
itemCatalog: catalog,
purchasableItemKeys: new Set(),
});
const allowed = new TradeItemAction({
...BASE_ENV,
itemCatalog: catalog,
purchasableItemKeys: new Set([itemKey]),
});
expect(denied.parseArgs({ itemType: 'item', itemCode: itemKey })).toBeNull();
expect(allowed.parseArgs({ itemType: 'item', itemCode: itemKey })).toEqual({
itemType: 'item',
itemCode: itemKey,
});
});
it('계략 성공 capability만 소비하며 typed 결과로 소비 item을 반환한다', () => {
const general = makeGeneral('che_계략_이추');
const itemModules = createItemActionModules(createItemModuleRegistry([strategyItemModule]));