Skip to content

Commit 553d061

Browse files
authored
Merge pull request #302 from flackr/assymetric-bluff
Avoid bluffs based on assymetric knowledge
2 parents 67393f6 + 9dca561 commit 553d061

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/conventions/h-group/clue-interpretation/connecting-cards.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export function resolve_bluff(game, target, connections, focusedCard, focusIdent
219219
if (!bluff_fail_reason && bluffCard.identity() !== undefined) {
220220
const nextCard = {suitIndex: bluffCard.suitIndex, rank: bluffCard.rank + 1};
221221
if ((clue.clue.type != CLUE.RANK || clue.clue.value == nextCard.rank) &&
222-
game.players[target].thoughts[focusedCard.order].inferred.has(nextCard))
222+
game.common.thoughts[focusedCard.order].inferred.has(nextCard))
223223
bluff_fail_reason = `blind play ${logCard(bluffCard)} connects to clue and inference on focused card`;
224224
}
225225

test/h-group/level-11.js

+16
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,22 @@ describe('bluff clues', () => {
480480
assert.equal(bluff_clues.length, 0);
481481
});
482482

483+
it(`doesn't bluff when bluff can't be recognized by all players`, () => {
484+
const game = setup(HGroup, [
485+
['xx', 'xx', 'xx', 'xx', 'xx'],
486+
['y1', 'b5', 'y2', 'y2', 'y4'],
487+
['p2', 'r2', 'b2', 'g4', 'y5'],
488+
], {
489+
level: { min: 11 }
490+
});
491+
492+
const { play_clues } = find_clues(game);
493+
const bluff_clues = play_clues[2].filter(clue => {
494+
return clue.type == CLUE.RANK && clue.target == 2 && clue.value == 2;
495+
});
496+
assert.equal(bluff_clues.length, 0);
497+
});
498+
483499
it(`doesn't bluff when bluff can't be known not to connect to focus`, () => {
484500
const game = setup(HGroup, [
485501
['xx', 'xx', 'xx', 'xx'],

0 commit comments

Comments
 (0)