Files
card-game-engine/dsl-examples/xuezhandaodi.yaml
2026-07-04 22:20:01 +08:00

94 lines
2.4 KiB
YAML

game:
name: 四川麻将血战到底
type: mahjong
engine_type: mahjong
players: { min: 4, max: 4 }
requires:
- meldsolver.standard_win
- meldsolver.seven_pairs
- phase.mahjong_turn
- phase.parallel_elimination
- phase.priority_arbitration
- scoring.fan_exclusion
- scoring.pre_hooks
deck:
generator: mahjong
include_honors: false
include_flowers: false
total: 108
deal:
cards_per_player: 13
dealer_extra: 1
# 番型
fan_types:
- { name: 清一色, base_fan: 4, excludes: [缺一门, 无字] }
- { name: 对对胡, base_fan: 2, conflicts: [暗七对] }
- { name: 暗七对, base_fan: 4, conflicts: [对对胡] }
- { name: 带幺九, base_fan: 2, excludes: [缺一门] }
- { name: 杠上开花, base_fan: 1, excludes: [海底捞月] }
- { name: 海底捞月, base_fan: 1 }
- { name: 抢杠胡, base_fan: 1 }
- { name: 缺一门, base_fan: 0 }
- { name: 鸡胡, base_fan: 1 }
fan_stacking: add
max_fan: 999
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: check_ting
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: 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
parallel_elimination: true
on_eliminate: hu_paid
end_conditions:
- { type: last_one_standing, action: settle }
- { type: deck_exhausted, action: check_hua_zhu }
# 过水
fu_flag:
type: dirty_flag
set_on: can_win_but_pass
clear_on: next_discard_self
effect: block_win_on_current_tile
- name: settle
type: auto
action: calculate_scores
next: null
scoring:
mode: fan_table
pre_hooks:
- name: check_hua_zhu
condition: deck_exhausted
description: 检查未胡玩家是否三种花色都有
- name: check_ting
condition: deck_exhausted AND not hua_zhu
description: 检查是否听牌,不听牌赔听牌的人