PokerGameDesigner / ChainBomb_GDL.txt
Estazz's picture
Upload folder using huggingface_hub
711cab1 verified
(game "ChainBombLandlord"
; 游戏基本信息
(players 3)
(deck "Standard54")
(roles { (role "Landlord" 1) (role "Peasant" 2) })
(turn_order { "Landlord" "Peasant" "Peasant" }) ; 出牌顺序:{A1, B1, B2}
(player_seating { "P1" "P2" "P3" }) ; 玩家座次
; 准备阶段 (Setup)
(setup
(bidding true) ; 是否有叫地主环节
(deal 17) ; 每人发牌数量
(reserve 3) ; 留作底牌的数量
(deal_method "random") ; 发牌方式:随机
(initial_score 1) ; 初始积分数:默认为1
(initial_multiplier 1)
(zones
(hand
(default_visibility (state visible) (to owner))
(initial_cards 0))
(field
(default_visibility (state visible) (to all))
(initial_cards 0))
(discard_pile
(default_visibility (state visible) (to all))
(initial_cards 0))
(main_deck
(default_visibility (state hidden) (to none))
(initial_cards TotalCards))
(reserve_zone
(default_visibility (state hidden) (to none))
(initial_cards 0))
(public_pool
(default_visibility (state visible) (to all))
(initial_cards 0))
)
; 特殊发牌规则 - 连炸斗地主核心创新点
(special_dealing_rules
(chain_bomb_distribution
(enabled true) ; 启用连炸牌型分配
(total_probability 1.0) ; 总概率为100%
(counts { 1: 0.50 2: 0.35 3: 0.15 })
)
(additional_bomb_probability
(for_players_with_chain_bomb true) ; 仅对拥有二连炸的玩家
(counts { 1: 0.50 2: 0.50 })
)
(special_reserve_card_probability 0.50) ; 特殊底牌概率:50%
(special_reserve_card_composition
(triple_same_number 0.50) ; 同号三张:50%
(joker_with_pair 0.30) ; 大王/小王+1个对子:30%
(jokers_with_single 0.20) ; 大王、小王+任意单牌:20%
)
(consecutive_card_probability 0.75) ; 补牌时与上一张牌牌值相等概率:75%
)
)
; 牌型定义 (Card Combinations)
(combinations
(single) ; 单牌
(pair) ; 对子
(triple) ; 三张
(straight 5) ; 顺子 (至少5张)
(double_straight 3) ; 连对 (至少3对)
(triple_with_single) ; 三带一
(triple_with_pair) ; 三带二
(airplane 2) ; 飞机 (至少2个连续的三张)
(airplane_with_single 2) ; 飞机小翅膀 (至少2个连续的【三带一】)
(airplane_with_pair 2) ; 飞机大翅膀 (至少2个连续的【三带二】)
(bomb 4) ; 炸弹 (至少4张同点)
(bomb_with_single 2) ; 四带二单
(bomb_with_pair 2) ; 四带二对
(rocket) ; 王炸
(double_chain_bomb 2) ; 二连炸 (至少2个连续的炸弹)
(triple_chain_bomb 3) ; 三连炸 (至少3个连续的炸弹)
(quad_chain_bomb 4) ; 四连炸 (至少4个连续的炸弹)
(penta_chain_bomb 5) ; 五连炸 (至少5个连续的炸弹)
)
; 牌值与关系定义 (Card Values & Relationships)
(card_relations
(card_values 3 4 5 6 7 8 9 10 J Q K A 2 "LittleJoker" "BigJoker") ; 牌值大小顺序
(continuous_relations
(seqA 3 4 5 6 7 8 9 10 J Q K A))
(non_continuous_cards { "2" "LittleJoker" "BigJoker" }) ; 非连续牌(不与其他牌构成连续关系)
(same_value_relation "same_number") ; 同号关系:牌值相同的牌
)
; 出牌规则 (Play Rules)
(play_rules
(comparison_rule "same_type_only") ; 必须同牌型才能比较
(bomb_power "override") ; 炸弹可以压制其他牌型
(rocket_power "highest") ; 王炸是最大牌型
(bomb_multiplier "doubling")
(k_ending_rule "two_pass") ; 出炸弹时倍率翻倍
)
; 详细牌型比较规则
(comparison_rules
(single_card (compare_by "card_value")) ; 单牌:按牌值比较
(pair (compare_by "card_value")) ; 对子:按牌值比较
(triple (compare_by "card_value")) ; 三张:按牌值比较
(straight (require_same_length true) (compare_by "highest_card_value")) ; 顺子:长度相同时,按最大牌值比较
(double_straight (require_same_length true) (compare_by "highest_pair_value")) ; 连对:长度相同时,按最大对子牌值比较
(triple_with_single (compare_by "triple_card_value")) ; 三带一:按三张牌的牌值比较
(triple_with_pair (compare_by "triple_card_value")) ; 三带二:按三张牌的牌值比较
(airplane (require_same_length true) (compare_by "highest_triple_value")) ; 飞机:长度相同时,按最大三张牌值比较
(airplane_with_single (require_same_length true) (compare_by "highest_triple_value")) ; 飞机带单:长度相同时,按最大三张牌值比较
(airplane_with_pair (require_same_length true) (compare_by "highest_triple_value")) ; 飞机带对:长度相同时,按最大三张牌值比较
(bomb (compare_by "card_value")) ; 炸弹:按牌值比较
(bomb_with_single (compare_by "bomb_card_value")) ; 炸弹带单:按炸弹牌值比较
(bomb_with_pair (compare_by "bomb_card_value")) ; 炸弹带对:按炸弹牌值比较
(rocket (compare_by "highest")) ; 火箭:最大
(double_chain_bomb (compare_by "highest_bomb_value") (override_types { "bomb" "rocket" "triple_chain_bomb" "quad_chain_bomb" "penta_chain_bomb" }))
(triple_chain_bomb (compare_by "highest_bomb_value") (override_types { "bomb" "rocket" "double_chain_bomb" "quad_chain_bomb" "penta_chain_bomb" }))
(quad_chain_bomb (compare_by "highest_bomb_value") (override_types { "bomb" "rocket" "double_chain_bomb" "triple_chain_bomb" "penta_chain_bomb" }))
(penta_chain_bomb (compare_by "highest_bomb_value") (override_types { "*" })) ; 五连炸压制所有牌型
)
; 游戏阶段与流程 (Game Phases)
(resource_bounds
(same_rank_max 4)
(sequence_span_max 12)
(wildcard_policy none)
)
(invariants
(= (+ (zone hand) (zone field) (zone discard_pile) (zone main_deck) (zone reserve_zone) (zone public_pool)) TotalCards)
(>= (zone main_deck) 0) (>= (zone hand) 0) (>= (zone field) 0) (>= (zone discard_pile) 0) (>= (zone reserve_zone) 0) (>= (zone public_pool) 0)
(initiative_defined true)
(initiative_has_valid_mode true)
(initiative_has_deterministic_outcome true)
(all_mechanisms_have_phase_binding true)
(no_undefined_mechanic_names true)
(all_special_have_transfer_path true)
)
(phases
; 阶段1: 叫抢地主 (Bidding Phase)
(bid
(initial_player "random") ; 初始叫地主玩家是随机的
(decision_order "sequential") ; 依次选择
(decision_options { "yes" "no" }) ; 玩家选择:是/否
(rules
(single_yes_wins "immediate") ; 如果只有一人说"是",则立即获胜
(multiple_yes
(first_has_extra_choice true) ; 多人说"是"时,第一个有额外选择权
(on_first_yes
(first_player_wins "immediate") ; 如果第一个再次说"是",则获胜
(last_player_wins "if_first_says_no") ; 如果第一个说"否",则最后说"是"的人获胜
)
(multiplier_on_each_yes "doubling") ; 每次有玩家说"是",倍率翻倍
)
(special_rules
(霸王叫
(condition "has_chain_bomb_or_higher") ; 条件:起手拥有二连炸及以上牌型
(effect
(immediate_landlord true) ; 直接获得地主身份
(multiplier_increase 20) ; 牌桌倍率*20
)
)
)
)
(outcome
(assign_role "Landlord" to_winner) ; 获胜者成为地主
(assign_role "Peasant" to_others) ; 其余成为农民
(give_reserve_cards to "Landlord") ; 将3张底牌给地主
)
)
; 阶段2: 加倍 (Doubling Phase)
(double
(simultaneous true) ; 三位玩家同时行动
(decision_options { "no" "x2" "x4" }) ; 选项:不加倍、加倍、超级加倍
(rules
(Landlord
(x2 "all_players_double") ; 地主选x2,所有玩家倍率*2
(x4 "all_players_quadruple") ; 地主选x4,所有玩家倍率*4
)
(Peasant
(x2 "self_double") ; 农民选x2,仅自己倍率*2
(x4 "self_quadruple") ; 农民选x4,仅自己倍率*4
)
)
)
; 阶段2.5: 先手机制 (Initiative Phase)
(initiative
(mode "custom")
(details
(custom (description "Landlord role holder starts the game after bidding.")))
(constraints
(executed_after "deal")
(unique_card_required false)
(deterministic true)
(specified_first_player true)
)
)
; 阶段3: 行牌 (Playing Phase)
(play
(first_player "Landlord") ; 由地主先出牌
(turn_order "circular") ; 按照预设顺序循环
(rules
(must_follow_suit_or_pass "same_type_only") ; 必须出同类型牌或选择"不出"
(bomb_increases_multiplier "doubling") ; 出炸弹时倍率翻倍
(chain_bomb_increases_multiplier "doubling") ; 出连炸时倍率翻倍
(next_trick_starts_with_last_player true) ; 下一轮由上一轮最后出牌的玩家开始
)
)
; 阶段4: 结算 (Settlement Phase)
(settle
(trigger_condition "first_to_empty_hand") ; 触发条件:有人手牌为0
(win_condition
(team_with_empty_hand "wins") ; 手牌为空的队伍获胜
)
(scoring
(winner_reward "(* room_base player_multiplier)") ; 获胜者:房间底分 * 自身倍率
(loser_penalty "(* room_base player_multiplier)") ; 失败者:房间底分 * 自身倍率
)
(capping
(winner_max_gain "N_times_coin") ; 赢家最多获得N倍金币
(loser_max_loss "fixed_amount") ; 输家最多输固定金额
)
)
)
; === 全局动作(统一转移路径/可见性写法)===
(actions
(pass
(transfer_path none)
(visibility_change none))
(play
(type one_of {single pair triple straight double_straight
triple_with_single triple_with_pair
airplane airplane_with_single airplane_with_pair
bomb bomb_with_single bomb_with_pair rocket
double_chain_bomb triple_chain_bomb quad_chain_bomb
penta_chain_bomb})
(transfer_path from: hand to: field)
(visibility_change (state visible) (to all)))
)
; 特殊机制 (Special Mechanics)
(special_mechanics
(mechanic "ChainBombDistribution"
(
(enabled true)
(description "发牌阶段启用连炸与附加炸弹的分配规则。")
(phase "setup")
(timing "pre_game")
(trigger_condition "deal_cards")
(usage_limit "once_per_game")
(effect_description "根据概率为部分玩家分配二连炸及附加炸弹。")
(transfer_path from: main_deck to: hand)
)
)
(mechanic "ChainBombScoringBoost"
(
(enabled true)
(description "行牌阶段,出连炸提高倍率。")
(phase "play")
(timing "on_play")
(trigger_condition "play_chain_bomb")
(usage_limit "per_occurrence")
(effect_description "当出连炸时倍率翻倍,与炸弹倍率叠加。")
(transfer_path none)
)
)
)
)