Example #1
0
    def sendCards(self, table):
        defaultSendCards = SendCardsPolicy3PlayerDefault()
        defaultSendCards.sendCards(table)

        limitConf = matchutil.getMatchChampionLimitConf(table.roomId)
        if limitConf.get('open', 0) == 0:
            return

        limitCount = limitConf.get('shuffleCountLimit', 3)
        cardRule = cardrule.CardDiZhuLaizi3Player()
        for i in range(limitCount):
            for index, seat in enumerate(table.gameRound.seats):
                if seat.player.championLimitFlag:
                    # 达到条件并且手牌为 ≥两炸 或 飞机+王炸 重新发牌
                    reducedCards = cardrule.ReducedCards.reduceHandCards(
                        cardRule, seat.status.cards)
                    if (cardrule.CardFinder.findHuojian(cardRule, reducedCards) and cardrule.CardFinder.findFeijiCount(cardRule, reducedCards)) or \
                                    cardrule.CardFinder.findZhadanCount(cardRule, reducedCards) >= 2:
                        defaultSendCards.sendCards(table)
                        if ftlog.is_debug():
                            ftlog.debug(
                                'SendCardsPolicy3PlayerChampionLimit.sendCards userId=',
                                seat.player.userId, 'gameId=', table.gameId,
                                'roomId=', table.roomId, 'huojian=',
                                cardrule.CardFinder.findHuojian(
                                    cardRule, reducedCards), 'feijiCount=',
                                cardrule.CardFinder.findFeijiCount(
                                    cardRule, reducedCards), 'zhadanCount=',
                                cardrule.CardFinder.findZhadanCount(
                                    cardRule, reducedCards), 'cards=',
                                ''.join(
                                    cardRule.toHumanCards(seat.status.cards)))
                        break
Example #2
0
 def __init__(self):
     super(DDZDealerLaizi,
           self).__init__(sm=SM_LAIZI,
                          playMode=PLAY_MODE_LAIZI,
                          jiabeiMode=JiabeiMode.AFTER_FLIP_BASE_CARD,
                          roundIdGenPolicy=RoundIdGenRedis(),
                          callPolicy=CallPolicyLaizi(),
                          sendCardsPolicy=SendCardsPolicy3PlayerDefault(),
                          firstCallPolicy=FirstCallPolicyImpl(),
                          tuoguanPolicy=TuoguanPolicyDefault(),
                          buyinPolicy=DefaultBuyinPolicy(),
                          autoChupaiPolicy=AutoChupaiPolicyDefault(),
                          settlementPolicy=DefaultSettlementPolicy())
Example #3
0
 def __init__(self):
     super(DDZDealerNormalClassic,
           self).__init__(sm=SM_NORMAL,
                          playMode=PLAY_MODE_NORMAL_CLASSIC,
                          jiabeiMode=JiabeiMode.AFTER_FLIP_BASE_CARD,
                          roundIdGenPolicy=RoundIdGenRedis(),
                          callPolicy=CallPolicyClassic3Player(),
                          sendCardsPolicy=SendCardsPolicy3PlayerDefault(),
                          firstCallPolicy=FirstCallPolicyImpl(),
                          tuoguanPolicy=TuoguanPolicyDefault(),
                          buyinPolicy=DefaultBuyinPolicy(),
                          autoChupaiPolicy=AutoChupaiPolicyDefault(),
                          settlementPolicy=DefaultSettlementPolicy())
Example #4
0
 def __init__(self):
     super(DDZDealerNormalHappy,
           self).__init__(sm=SM_NORMAL,
                          playMode=PLAY_MODE_NORMAL_HAPPY,
                          jiabeiMode=JiabeiMode.AFTER_FLIP_BASE_CARD,
                          roundIdGenPolicy=RoundIdGenRedis(),
                          callPolicy=CallPolicyHappy3Player(),
                          sendCardsPolicy=SendCardsPolicy3PlayerDefault(),
                          firstCallPolicy=FirstCallPolicyRandom(),
                          tuoguanPolicy=TuoguanPolicyDefault(),
                          buyinPolicy=BuyinPolicyFriend(),
                          autoChupaiPolicy=AutoChupaiPolicyDefault(),
                          settlementPolicy=SettlementPolicyFriendTable())