fix(mahjong): 麻雀をプレイできない問題を修正 (#14268)

* ビルドによる自動的なソース更新

* 麻雀関連のキーバリューペアを追加

* 役の定義をまとめてエクスポート

* タイポ修正

* Revert "麻雀関連のキーバリューペアを追加"

This reverts commit c349cdf70c69af89d93ed7db035efaaacf2c2785.

* misskey-jsのビルドによる自動更新
This commit is contained in:
Take-John 2024-07-25 17:09:07 +09:00 committed by GitHub
parent 6b16b85203
commit 6c9f6e8057
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 4 deletions

4
locales/index.d.ts vendored
View file

@ -10257,9 +10257,9 @@ export interface Locale extends ILocale {
*/
"churen": string;
/**
*
*
*/
"pure-churen": string;
"churen-9": string;
/**
*
*/

View file

@ -1343,4 +1343,7 @@ export const endpointReqTypes: Record<keyof Endpoints, 'application/json' | 'mul
'reversi/show-game': 'application/json',
'reversi/surrender': 'application/json',
'reversi/verify': 'application/json',
'mahjong/create-room': 'application/json',
'mahjong/join-room': 'application/json',
'mahjong/show-room': 'application/json',
};

View file

@ -137,7 +137,7 @@ function countTiles(tiles: TileType[], target: TileType): number {
return tiles.filter(t => 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[];

View file

@ -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 {

View file

@ -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 {