Beispiel #1
0
        //玩家杠牌分数变化 和记录杠牌次数
        public static void PlayerGangPaiGetScore(this FiveStarRoom fiveStarRoom, int oprateSeateIndex, int oprateType)
        {
            if (oprateType != FiveStarOperateType.AnGang &&
                oprateType != FiveStarOperateType.CaGang &&
                oprateType != FiveStarOperateType.MingGang)
            {
                return;
            }

            fiveStarRoom.FiveStarPlayerDic[oprateSeateIndex].GangPaiCount++;//杠牌次数加1
            Actor_FiveStar_ScoreChange actorFiveStarScoreChange = new Actor_FiveStar_ScoreChange();

            for (int i = 0; i < fiveStarRoom.RoomNumber; i++)
            {
                actorFiveStarScoreChange.GetScore.Add(0);
            }
            fiveStarRoom.intData = 1;         //默认 不是杠上杠就是1
            if (fiveStarRoom.IsGangShangCard) //如果是杠上杠
            {
                fiveStarRoom.intData = 2;     //分数在乘以2
            }
            switch (oprateType)
            {
            case FiveStarOperateType.AnGang:
                fiveStarRoom.CaGangAnGangScoreChang(actorFiveStarScoreChange, oprateSeateIndex,
                                                    fiveStarRoom.RoomConfig.BottomScore * 2 * fiveStarRoom.intData);//分数变化
                break;

            case FiveStarOperateType.CaGang:
                fiveStarRoom.CaGangAnGangScoreChang(actorFiveStarScoreChange, oprateSeateIndex,
                                                    fiveStarRoom.RoomConfig.BottomScore * fiveStarRoom.intData);//分数变化
                break;

            case FiveStarOperateType.MingGang:
                actorFiveStarScoreChange.GetScore[oprateSeateIndex]             += fiveStarRoom.RoomConfig.BottomScore * 2 * fiveStarRoom.intData;
                actorFiveStarScoreChange.GetScore[fiveStarRoom.CurrChuPaiIndex] -= fiveStarRoom.RoomConfig.BottomScore * 2 * fiveStarRoom.intData;
                break;

            default:
                return;
            }
            fiveStarRoom.GangHuNum = 2;//标记为 刚杠过
            for (int i = 0; i < fiveStarRoom.RoomNumber; i++)
            {
                fiveStarRoom.FiveStarPlayerDic[i].SmallGangScore += actorFiveStarScoreChange.GetScore[i]; //记录杠牌得分
                fiveStarRoom.FiveStarPlayerDic[i].NowScoreChange(actorFiveStarScoreChange.GetScore[i]);   //现在的分数变化
                actorFiveStarScoreChange.NowScore.Add(fiveStarRoom.FiveStarPlayerDic[i].NowScore);
            }
            //广播分数变化消息
            fiveStarRoom.BroadcastMssagePlayers(actorFiveStarScoreChange);
        }