;================================================================
; mahjong/mahjong_ai 麻将游戏 人机 AI
; mahjong_bot.erb 基础 bot
;================================================================


;;;人机进行操作 应对自家摸牌
;;;- int seat 座次
;;;@return 没有返回值
@MahjongBotHandleDraw(seat)
    #DIM seat
    TWAIT RAND(1500, 2500), 1  ; 假装在思考
    SIF !mj_discard_by(seat, mj_to_code(MJ_HAND:seat:(RAND:(mj_count_hand(seat)))))  ; TODO 临时应对 随机打一张
        THROW %MJ_ENUM_SEAT:seat%家 %mj_get_hand_code(seat)%({mj_count_hand(seat)})  试图切掉「%mj_humanize(mj_to_code(MJ_LAST_DISCARD))%」失败
    PLAYSOUND "mahjong/default/dahai.wav"
    MJ_LOG_TEXT '= @"%MJ_ENUM_SEAT:seat%家切掉「%mj_humanize(mj_to_code(MJ_LAST_DISCARD))%」"
    RETURN


;;;人机进行操作 应对别家切牌
;;;- int seat 座次
;;;@return 0跳过 1吃牌 2碰/杠 3荣和
@MahjongBotHandleDiscard(seat)
    #DIM seat
    ; TODO 临时应对 从不鸣牌
    RESULTS '= ""
    RETURN 0
