버건디의 성 방패 9·2를 2019 규칙서 15쪽대로 고침, 추정·사이트가 정한 값을 규칙 화면에 표시

- 방패 9: 상품을 팔면 종류당 은화 1개 '대신' 장수만큼(전에는 기본 1개에 장수를 더해 3장에 4개, 수도원 3번이면 5개). 같은 효과면 방패가 수도원보다 우선이라 수도원 3번이 있어도 3장 = 3개
- 방패 2: 남이 일꾼을 얻는 모든 경로(일꾼 받기·하숙집·수도원 2·4번·일꾼 사기)에서 1개. 전에는 일꾼 받기만. gainWorkers 하나로 모음(방패로 받은 일꾼은 다시 퍼지지 않음)
- 회귀 테스트 2개(예전 코드에서 실패 확인), data.ts·설계 문서 방패 설명 고침
- 규칙 화면에 '원작과 다를 수 있는 부분': 핫스트릭(카드 구성·일부 티켓 값·꺾는 쪽 추정 등), 버건디의 성(가축·검은 수도원·수도원 16~23·2·3명 보급소 칸 추정), 젬블로(뒤집기 허용·판 구역·동점)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-16 00:39:47 +09:00
parent e34745fe50
commit f1f1104abd
7 changed files with 74 additions and 10 deletions

View File

@@ -614,3 +614,47 @@ describe('random playouts (invariants, JSON, determinism)', () => {
});
void perform;
describe('방패 9·2 (2019 규칙서 15쪽)', () => {
test('방패 9: 상품 3장 팔면 은화 3개(종류당 1개 대신), 수도원 3번이 있어도 방패가 우선', () => {
for (const placed of [{}, { [sp(1, -1)]: 'K-03' }]) {
let s = make({ shields: true });
const p = cur(s);
s = rig(s, { dice: [4, 4], silver: 0, workers: 0, placed });
s.players[p]!.shields = { 18: 9 };
s.players[p]!.goods = [{ die: 4, count: 3 }];
s = act(s, p, { type: 'useDie', die: 0, act: { kind: 'sell', goods: 4 } });
expect(s.players[p]!.silver).toBe(3);
}
});
test('방패 2: 남이 일꾼을 얻는 모든 경로(일꾼 받기·하숙집·수도원 4번)에서 1개씩', () => {
const setup = () => {
const s = make({ shields: true });
const a = cur(s);
const b = s.seats.find((x) => x !== a)!;
s.players[b]!.shields = { 18: 2 };
s.players[b]!.workers = 0;
return { s, a, b };
};
// 일꾼 받기
let { s, a, b } = setup();
s = rig(s, { dice: [2, 5], workers: 0 });
s = act(s, a, { type: 'useDie', die: 0, act: { kind: 'workers' } });
expect(s.players[a]!.workers).toBe(2);
expect(s.players[b]!.workers).toBe(1);
// 하숙집(일꾼 4개)
({ s, a, b } = setup());
const space = DUCHY_1.spaces.find((x) => x.color === 'building' && placeError(rig(s, { storage: ['B-boarding-1'] }), a, 'B-boarding-1', x.id, null) === null)!;
s = rig(s, { storage: ['B-boarding-1'], dice: [space.die as Die, space.die as Die], workers: 0 });
s = act(s, a, { type: 'useDie', die: 0, act: { kind: 'place', slot: 0, space: space.id } });
expect(s.players[a]!.workers).toBe(4);
expect(s.players[b]!.workers).toBe(1);
// 수도원 4번: 상품을 팔면 일꾼 1개
({ s, a, b } = setup());
s = rig(s, { dice: [4, 4], workers: 0, placed: { [sp(-1, 2)]: 'K-04' } });
s.players[a]!.goods = [{ die: 4, count: 2 }];
s = act(s, a, { type: 'useDie', die: 0, act: { kind: 'sell', goods: 4 } });
expect(s.players[a]!.workers).toBe(1);
expect(s.players[b]!.workers).toBe(1);
});
});

View File

@@ -138,14 +138,14 @@ export interface ShieldDef {
}
export const SHIELDS: readonly ShieldDef[] = [
{ n: 1, vp: 12, text: '모든 목초지를 하나로 쳐요' },
{ n: 2, vp: 12, text: '남이 "일꾼 받기"를 할 때마다 나도 일꾼 1개' },
{ n: 2, vp: 12, text: '남이 일꾼을 얻을 때마다(일꾼 받기·하숙집·수도원 등) 나도 일꾼 1개' },
{ n: 3, vp: 12, text: '방패 유지비를 일꾼으로도 내요' },
{ n: 4, vp: 12, text: '보관 칸 제한이 없어요' },
{ n: 5, vp: 12, text: '배를 놓을 때 상품 한 종류를 골라 모든 보급소에서 더 가져와요' },
{ n: 6, vp: 12, text: '한 사람을 골라 그 사람 공국의 수도원 효과를 나도 받아요(27번 제외)' },
{ n: 7, vp: 8, text: '새로 받는 색 보너스 점수 2배' },
{ n: 8, vp: 8, text: '광산 은화 2배' },
{ n: 9, vp: 8, text: '상품 1장 팔 때마다 은화 1개 더' },
{ n: 9, vp: 8, text: '상품을 팔면 종류당 은화 1개 대신 장수만큼 은화' },
{ n: 10, vp: 8, text: '게임 끝 점수형 수도원 점수 2배' },
{ n: 11, vp: 8, text: '성을 놓을 때 보너스 행동 대신 방패를 가져올 수 있어요' },
{ n: 12, vp: 8, text: '상품 판매 점수 2배' },

View File

@@ -350,7 +350,7 @@ function buildingEffect(s: CobState, p: PlayerId, kind: BuildingKind, full: bool
if (full) later.push({ kind: 'depotTake', colors: DEPOT_TAKE[kind]!, source: kind });
return;
case 'boarding':
pl.workers += 4;
gainWorkers(s, p, 4);
return;
case 'bank':
pl.silver += 2;
@@ -372,22 +372,33 @@ export function sellGoods(s: CobState, p: PlayerId, kind: Die): void {
if (i < 0) return;
const count = pl.goods[i]!.count;
pl.goods.splice(i, 1);
const silver = (has(s, p, 3) ? 2 : 1) + (hasShield(s, p, 9) ? count : 0);
// 방패 9: 1 silver per goods tile *instead of* per type; a shield beats a monastery with the same effect (2019 rules p.15).
const silver = hasShield(s, p, 9) ? count : has(s, p, 3) ? 2 : 1;
pl.silver += silver;
if (has(s, p, 4)) pl.workers += 1;
if (has(s, p, 4)) gainWorkers(s, p, 1);
const vp = count * GOODS_VP[boardN(s)]! * (hasShield(s, p, 12) ? 2 : 1);
pl.sold[kind - 1]! += count;
gainVp(s, p, vp);
log(s, { t: 'sell', p, goods: kind, count, vp, silver });
}
/**
* Every way a player gets workers goes through here, so 방패 2 ("whenever another player gets a worker, you also get a
* worker", 2019 rules p.15) sees them all: 일꾼 받기, 하숙집, 수도원 2·4, 일꾼 사기. The shield's own worker comes
* straight from the supply and does not trigger other holders again.
*/
function gainWorkers(s: CobState, p: PlayerId, n: number): void {
if (n <= 0) return;
s.players[p]!.workers += n;
for (const q of s.seats) if (q !== p && !s.players[q]!.conceded && hasShield(s, q, 2)) s.players[q]!.workers += 1;
}
function takeWorkers(s: CobState, p: PlayerId): void {
const pl = s.players[p]!;
const n = has(s, p, 14) ? 4 : 2;
pl.workers += n;
gainWorkers(s, p, n);
if (has(s, p, 13)) pl.silver += 1;
log(s, { t: 'workers', p, n });
for (const q of s.seats) if (q !== p && !s.players[q]!.conceded && hasShield(s, q, 2)) s.players[q]!.workers += 1;
}
function toStorage(s: CobState, p: PlayerId, tile: string, discard: number | undefined): void {
@@ -648,7 +659,7 @@ export function continuePhaseEnd(s: CobState, ctx: Ctx): void {
const silver = mines * (hasShield(s, p, 8) ? 2 : 1);
const workers = has(s, p, 2) ? mines : 0;
pl.silver += silver;
pl.workers += workers;
gainWorkers(s, p, workers);
if (silver || workers) log(s, { t: 'income', p, silver, workers });
}
s.phaseEndStep = 'place';
@@ -1094,7 +1105,7 @@ export function perform(s: CobState, p: PlayerId, a: CobAction, ctx: Ctx): void
}
case 'buyWorkers':
pl.silver -= 1;
pl.workers += 2;
gainWorkers(s, p, 2);
break;
case 'soloBuyVp':
pl.silver -= 1;