Skip to content

Commit

Permalink
fix: 一部の役判定の間違い
Browse files Browse the repository at this point in the history
  • Loading branch information
mugiply committed May 2, 2023
1 parent 3141815 commit 0e0d974
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,41 @@ describe('CgDonjaraFinishChecker', () => {
]);
});

it('ノーマルライブ - 3人公式 + 3人公式 + 3人公式', () => {
expect(
finishChecker.checkFinish([
// ももぺあべりー
'087', // 橘ありす
'015', // 櫻井桃華
'155', // 的場梨沙
// プチ*パフェアリー
'024', // 遊佐こずえ
'034', // 双葉杏
'104', // 佐城雪美
// fleeting bouquet
'124', // 結城晴
'026', // 一ノ瀬志希
'064', // 黒埼ちとせ
])
).toMatchObject([
{
name: 'ノーマルライブ',
score: 120000,
units: expect.arrayContaining([
expect.objectContaining({
label: 'プチ*パフェアリー',
}),
expect.objectContaining({
label: 'ももぺあべりー',
}),
expect.objectContaining({
label: 'fleeting bouquet',
}),
]),
},
]);
});

it('不成立 - 3人公式 + 3人公式 + 2人(Co-Da) + 1人(Pa-Da)', () => {
expect(
finishChecker.checkFinish([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ export class CgDonjaraFinishChecker {
!unit1.tileIdentifiers.every((id) => tiles.find((tile) => tile === id))
)
continue;
const idols1 = this.idols.filter((idol) =>
unit1.tileIdentifiers.find((tile) => tile === idol.identifier)
);
if (!idols1.every((idol) => idol.idolType === idols1[0].idolType))
continue;
const remainingTiles1 = tiles.filter(
(tile) => !unit1.tileIdentifiers.find((id) => id === tile)
);
Expand All @@ -271,6 +276,11 @@ export class CgDonjaraFinishChecker {
)
)
continue;
const idols2 = this.idols.filter((idol) =>
unit2.tileIdentifiers.find((tile) => tile === idol.identifier)
);
if (!idols2.every((idol) => idol.idolType === idols2[0].idolType))
continue;
const remainingTiles2 = remainingTiles1.filter(
(tile) => !unit2.tileIdentifiers.find((id) => id === tile)
);
Expand All @@ -281,6 +291,13 @@ export class CgDonjaraFinishChecker {
)
)
continue;

const idols3 = this.idols.filter((idol) =>
unit3.tileIdentifiers.find((tile) => tile === idol.identifier)
);
if (!idols3.every((idol) => idol.idolType === idols3[0].idolType))
continue;

results.push({
name: 'トリコロール',
score: 240000,
Expand Down

0 comments on commit 0e0d974

Please sign in to comment.