Files
card-game-engine/dsl-examples/nanchang.yaml
xiaoou d5329e5b0c feat: 精分独立计分模式(independent_bonus)
引擎原算法: (底分+精分)×倍数 → 精分被庄家/自摸放大
南昌实际: 底分×倍数 + 精分 → 精分不参与倍数

新增DSL字段 wildcard_rules.scoring.independent_bonus:
- false(默认): 精分混入底分(现有行为,向后兼容)
- true(南昌): 精分独立加在倍数之后

代码: ScoreEngine.Settle → multiplierPart(底分×倍数) + addPart(精分)
自摸: 精分只加给赢家一次(不计入倍数)
点炮: 精分计入pay总额(放炮者全额支付)
2026-07-05 01:37:57 +08:00

107 lines
2.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

game:
name: 南昌麻将
type: mahjong
engine_type: mahjong
players: { min: 4, max: 4 }
requires:
- deck.generator_mahjong
- meldsolver.standard_win
- meldsolver.seven_pairs
- meldsolver.wildcard
- meldsolver.all_orphans
- 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
# 南昌麻将的精(癞子)系统:骰子翻牌定精
# 翻到X则X+1为正精X+2为副精。字牌按序循环。
wildcard_rules:
type: random
meld_mode: any
random_count: 2
wildcard_encoding: 50
behavior: substitute
fan_calculation_policy: optimal
scoring:
per_wildcard_in_win: 2
independent_bonus: true
fan_types:
# 基础番型
- { name: 清一色, base_fan: 4, excludes: [缺一门, 无字] }
- { name: 混一色, base_fan: 2, excludes: [缺一门] }
- { name: 对对胡, base_fan: 2 }
- { name: 暗七对, base_fan: 4 }
# 特殊牌型
- { name: 带幺九, base_fan: 2, excludes: [缺一门] }
- { name: 缺一门, base_fan: 0 }
- { name: 无字, base_fan: 0 }
# 事件番型
- { name: 杠上开花, base_fan: 1, excludes: [海底捞月] }
- { name: 海底捞月, base_fan: 1 }
- { name: 抢杠胡, base_fan: 1 }
- { name: 天胡, base_fan: 10 }
- { name: 地胡, base_fan: 5 }
# 癞子相关
- { name: 癞子胡, base_fan: 1, condition: hand_contains_wildcard }
# 兜底
- { 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: 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: 999
self_draw_multiplier: 1 # 自摸每家付1倍
discard_win_multiplier: 1 # 放炮付1倍(南昌麻将放炮不翻倍)
dealer_multiplier: 2 # 庄家输赢×2