예제 #1
0
        //玩家摸牌
        public static void MoPai(this FiveStarPlayer fiveStarPlayer, int card)
        {
            card = fiveStarPlayer.AIMoPaiDispose(card); //AI摸牌处理
            fiveStarPlayer.MoEndHand = card;            //记录摸的最后一张手牌
            fiveStarPlayer.Hands.Add(card);
            //广播给客户端摸牌消息 但是只有摸的人 牌才是对的
            Actor_FiveStar_MoPai actorFiveStarMoPai = new Actor_FiveStar_MoPai();

            actorFiveStarMoPai.SeatIndex = fiveStarPlayer.SeatIndex;
            actorFiveStarMoPai.Card      = card;
            fiveStarPlayer.FiveStarRoom.RecordMoCard(actorFiveStarMoPai);//记录摸牌消息
            fiveStarPlayer.SendMessageUser(actorFiveStarMoPai);
            actorFiveStarMoPai.Card = -1;
            fiveStarPlayer.SendMessageOtherUser(actorFiveStarMoPai);

            fiveStarPlayer.Hands.Sort();//每次检测前要把手牌排序一下
            if (fiveStarPlayer.IsCanOperate())
            {
                fiveStarPlayer.CanOperate(FiveStarOperateType.ChuCard);
            }
            else
            {
                fiveStarPlayer.CanChuPai();
            }
        }
예제 #2
0
        //操作完成后续
        public static void OperateFinishFollow(this FiveStarPlayer fiveStarPlayer, FiveStarOperateInfo operateInfo)
        {
            //执行碰 明杠 放冲胡 玩家 最后打牌要被数组移除
            switch (operateInfo.OperateType)
            {
            case FiveStarOperateType.Peng:
            case FiveStarOperateType.MingGang:
            case FiveStarOperateType.FangChongHu:
                fiveStarPlayer.FiveStarRoom.FiveStarPlayerDic[fiveStarPlayer.FiveStarRoom.CurrChuPaiIndex].PlayCardByEatOff();    //玩家打出牌被吃掉
                break;
            }
            //操作完成后续
            switch (operateInfo.OperateType)
            {
            case FiveStarOperateType.None:    //玩家不操作
                if (fiveStarPlayer.FiveStarRoom.QiOperateNextStep == FiveStarOperateType.MoCard)
                {
                    fiveStarPlayer.FiveStarRoom.PlayerMoPai();    //可出牌的人 和当前出牌的是同一个 证明 刚刚摸牌玩家已经出牌了 所以按正常流程摸牌
                }
                else if (fiveStarPlayer.FiveStarRoom.QiOperateNextStep == FiveStarOperateType.ChuCard)
                {
                    fiveStarPlayer.FiveStarRoom.FiveStarPlayerDic[fiveStarPlayer.FiveStarRoom.LastMoPaiSeatIndex].CanChuPai();     //最后摸牌的玩家可以出牌
                }
                break;

            case FiveStarOperateType.Peng:
                fiveStarPlayer.SendNewestHands(); //发送玩家最新的手牌信息
                fiveStarPlayer.CanChuPai();       //碰了就可以出牌
                break;

            case FiveStarOperateType.MingGang:
            case FiveStarOperateType.AnGang:
            case FiveStarOperateType.CaGang:
                fiveStarPlayer.SendNewestHands();                                  //发送玩家最新的手牌信息
                fiveStarPlayer.FiveStarRoom.PlayerMoPai(fiveStarPlayer.SeatIndex); //杠的话就摸一张牌
                break;
            }
        }