Files
card-game-engine/dsl-examples/wuhan.yaml
xiaoou f57446bd84 fix(DSL): 武汉删死番型 '将', 国标加鸡胡兜底
武汉: '将' base_fan=0 是死番型(引擎不生成,无人exclude)→删除
国标: 缺少鸡胡兜底→添加 {name:鸡胡,base_fan:1,level:0}

两处均为纯DSL修复, 引擎代码零修改
2026-07-04 22:18:25 +08:00

100 lines
2.4 KiB
YAML

game:
name: 武汉麻将
type: mahjong
engine_type: mahjong
players: { min: 4, max: 4 }
requires:
- deck.generator_mahjong
- meldsolver.standard_win
- meldsolver.seven_pairs
- meldsolver.wildcard
- phase.mahjong_turn
- phase.priority_arbitration
- scoring.fan_exclusion
deck:
generator: mahjong
include_honors: true
include_flowers: false
total: 136
deal:
cards_per_player: 13
dealer_extra: 1
wildcard_rules:
type: fixed
tiles: [红中]
wildcard_encoding: 50
behavior: substitute
fan_calculation_policy: optimal
scoring:
per_wildcard_in_win: 1
win_condition:
pair_must_be_258: true
fan_types:
- { name: 碰碰胡, base_fan: 2 }
- { name: 清一色, base_fan: 8, excludes: [缺一门, 无字] }
- { name: 七对, base_fan: 8, excludes: [门前清, 单钓将] }
- { name: 将一色, base_fan: 16, excludes: [碰碰胡, 缺一门] }
- { name: 全求人, base_fan: 4 }
- { name: 杠上开花, base_fan: 1, excludes: [海底捞月] }
- { name: 海底捞月, base_fan: 1 }
- { name: 抢杠胡, base_fan: 1 }
- { name: 天胡, base_fan: 32 }
- { name: 地胡, base_fan: 16 }
- { name: 癞子胡, base_fan: 1, condition: hand_contains_wildcard }
- { name: 鸡胡, base_fan: 1 }
fan_stacking: add
max_fan: 100
phases:
- name: deal
type: auto
action: deal_cards
next: play
- name: play
type: mahjong_turn
turn_order: counter_clockwise
sub_phases:
draw:
type: auto
action: draw_card
on_empty_deck: exhausted
self_action:
options:
- { action: discard }
- { action: an_kong }
- { action: bu_kong, condition: has_punged_pair }
- { action: win, condition: can_win_tumo }
others_reaction:
options:
- { action: chi, priority: 1, condition: can_chi }
- { action: pung, priority: 2, condition: has_two_same }
- { action: ming_kong, priority: 3, condition: has_three_same }
- { action: win, priority: 4, condition: can_win }
- { action: pass, priority: 0 }
priority_policy: highest_wins
on_win: game_over
end_conditions:
- { type: player_wins, action: settle }
- { type: deck_exhausted, action: draw_game }
- name: settle
type: auto
action: calculate_scores
next: null
scoring:
mode: fan_table
max_cap: 100
pre_hooks:
- name: wildcard_count
description: 统计胡牌手牌中癞子数量,每张癞子+1番