From 6c9f6e80573569559f72c08ea30d17876b00c109 Mon Sep 17 00:00:00 2001 From: Take-John <105504345+takejohn@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:09:07 +0900 Subject: [PATCH] =?UTF-8?q?fix(mahjong):=20=E9=BA=BB=E9=9B=80=E3=82=92?= =?UTF-8?q?=E3=83=97=E3=83=AC=E3=82=A4=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20(#14268)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ビルドによる自動的なソース更新 * 麻雀関連のキーバリューペアを追加 * 役の定義をまとめてエクスポート * タイポ修正 * Revert "麻雀関連のキーバリューペアを追加" This reverts commit c349cdf70c69af89d93ed7db035efaaacf2c2785. * misskey-jsのビルドによる自動更新 --- locales/index.d.ts | 4 ++-- packages/misskey-js/src/autogen/endpoint.ts | 3 +++ packages/misskey-mahjong/src/common.yaku.ts | 6 ++++-- packages/misskey-mahjong/src/engine.master.ts | 1 + packages/misskey-mahjong/src/engine.player.ts | 1 + 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 74b830764f..f8136844e3 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -10257,9 +10257,9 @@ export interface Locale extends ILocale { */ "churen": string; /** - * 純正九連宝灯 + * 九連宝灯九面待 */ - "pure-churen": string; + "churen-9": string; /** * 天和 */ diff --git a/packages/misskey-js/src/autogen/endpoint.ts b/packages/misskey-js/src/autogen/endpoint.ts index 3e55913097..a05798b542 100644 --- a/packages/misskey-js/src/autogen/endpoint.ts +++ b/packages/misskey-js/src/autogen/endpoint.ts @@ -1343,4 +1343,7 @@ export const endpointReqTypes: Record t === target).length; } -export const NORAML_YAKU_DEFINITIONS: YakuDefiniyion[] = [{ +export const NORMAL_YAKU_DEFINITIONS: YakuDefiniyion[] = [{ name: 'tsumo', fan: 1, isYakuman: false, @@ -766,6 +766,8 @@ export const YAKUMAN_DEFINITIONS: YakuDefiniyion[] = [{ }, }]; +export const YAKU_DEFINITIONS = NORMAL_YAKU_DEFINITIONS.concat(YAKUMAN_DEFINITIONS); + export function calcYakus(state: EnvForCalcYaku): YakuName[] { const oneHeadFourMentsuPatterns: (FourMentsuOneJyantou | null)[] = analyzeFourMentsuOneJyantou(state.handTiles); if (oneHeadFourMentsuPatterns.length === 0) oneHeadFourMentsuPatterns.push(null); @@ -787,7 +789,7 @@ export function calcYakus(state: EnvForCalcYaku): YakuName[] { } const yakuPatterns = oneHeadFourMentsuPatterns.map(fourMentsuOneJyantou => { - return NORAML_YAKU_DEFINITIONS.map(yakuDef => { + return NORMAL_YAKU_DEFINITIONS.map(yakuDef => { const result = yakuDef.calc(state, fourMentsuOneJyantou); return result ? yakuDef : null; }).filter(yaku => yaku != null) as YakuDefiniyion[]; diff --git a/packages/misskey-mahjong/src/engine.master.ts b/packages/misskey-mahjong/src/engine.master.ts index 1dc14c292e..45c10cfc74 100644 --- a/packages/misskey-mahjong/src/engine.master.ts +++ b/packages/misskey-mahjong/src/engine.master.ts @@ -7,6 +7,7 @@ import CRC32 from 'crc-32'; import { TileType, House, Huro, TileId } from './common.js'; import * as Common from './common.js'; import { PlayerState } from './engine.player.js'; +import { YAKU_DEFINITIONS } from "./common.yaku.js"; //#region syntax suger function $(tid: TileId): Common.TileInstance { diff --git a/packages/misskey-mahjong/src/engine.player.ts b/packages/misskey-mahjong/src/engine.player.ts index cc5acab8a0..c16d81b046 100644 --- a/packages/misskey-mahjong/src/engine.player.ts +++ b/packages/misskey-mahjong/src/engine.player.ts @@ -6,6 +6,7 @@ import CRC32 from 'crc-32'; import { TileType, House, Huro, TileId } from './common.js'; import * as Common from './common.js'; +import { YAKU_DEFINITIONS } from './common.yaku.js'; //#region syntax suger function $(tid: TileId): Common.TileInstance {