/* * F_COMMON_HAND = 0, // 平胡 * F_THIRTEEN_INDEPEND, // 十三不靠 * F_THIRTEEN_ORPHANS, // 十三幺 * F_SEVEN_PAIRS, // 七对 * F_LUXURY_SEVEN_PAIRS, // 豪华七对 * * F_ALL_CONCEALED_HAND=5, // 门清 * F_SISTER_PAVE, // 姐妹 * F_DOUBLE_SISTER_PAVE, //双姐妹铺 * F_LACK_SUIT, // 缺一门 * F_CONNECTED_SEQUENCE, // 一条龙 * * F_COUPLES_HAND=10, // 对对胡 * F_SAME_COLOUR, // 清一色 * F_SAME_COUPLES, //清对对 * F_MIXED_ONE_SUIT, // 混一色 * F_HONOR_TILES, //字一色 * * F_GANG_KAI=15, // 杠上开花 * F_FOUR_LAIZI, // 四癞子胡牌 * F_COMMON_HAND_FOUR_LAIZI, // 天胡/地胡四癞子 * F_SOFT_LACK, //软缺 * F_FORCED_LACK, //硬缺 * * F_FOUR_IN_HAND=20, //四遇子 * F_VALUABLE_WIND, //值钱风 * F_ROBBING_KONG_WIN, //抢杠胡 * F_PEN_IN_WIND, //圈风 * F_ONSELF_WIND_JONG, //风圈将 * * F_DI_READ_HAND=25, //地听 * F_THREE_WIND, //三季风 * F_BROKEN_ORPHAS, //断幺 * F_ONLY_ORPHS, //独幺 * F_SEA_BOTTOM_DRAW, //海底捞月 * * F_WHOLE_BEG=30, //全求人 * F_ALL_ONE_NINE, //幺幺胡(全一九) * F_BIG_THREE, //大三元 * F_WHITE_BORADS_AS_JONG, //配子吃 * F_ONLY_TILE_WIN, //独一 * * F_TIAN_HU=35, //天胡 * F_DI_HU, //地胡 * F_FLOWER, //花牌 * F_CONTINUOUS_SIX, //六连 * F_DOUBLE_CONTINUOUS_SIX, //双六连 * * F_MEET=40, //见面 * F_ONE_NINE_JONG, //幺九将 * F_KE, //刻牌 * F_ONESELF_DOOR_WIND, //本门风 * F_DERLEAST_WIND, //本圈风 * * F_NO_ONE_NINE=45, //断一九 * F_FOUR_KONG, //四杠/十八罗汉 * F_FOUR_WIND_KONG, //大四喜 * F_SINGLE_HOIST, //单吊 * F_TOTAL_NUM // 计番种类总数 * */ /// <summary> /// 显示玩家的特殊胡牌牌型 /// </summary> /// <param name="index"></param> /// <param name="value"></param> /// <returns></returns> string ShowSpecialWinType(int index, sbyte[,] value) { GameResultPanelData grpd = GameData.Instance.GameResultPanelData; StringBuilder str = new StringBuilder(); for (int i = 0; i < NetMsg.F_TOTAL_NUM; i++) { // Debug.LogWarning("用户:"+index +"胡牌牌型:" + i + "value:" + value[index, i]); if (MahjongCommonMethod.Instance._cfgSpecialTypeCardName.data[i].index == 49 && MahjongCommonMethod.Instance.iPlayingMethod == 20001) { // if (value[index, i] > 0) str.AppendFormat(MahjongCommonMethod.Instance._cfgSpecialTypeCardName.data[i].name + (value[index, i] > 0 ? "+" : ""), grpd.resultType[0].byFanTiles[0]); str.Append(value[index, i]); str.Append(" "); } else if (value[index, i] != 0) { if (MahjongCommonMethod.Instance.iPlayingMethod == 20001 && i == 0) { str.Append(MahjongCommonMethod.Instance._cfgSpecialTypeCardName.data[i].name_a + (value[index, i] > 0 ? "+" : "")); } else { str.Append(MahjongCommonMethod.Instance._cfgSpecialTypeCardName.data[i].name + (value[index, i] > 0 ? "+" : "")); } str.Append(value[index, i]); str.Append(" "); } } return(str.ToString()); }
void Oncomplete_3() { if (isShowWinPanel) { GameResultPanelData grpd = GameData.Instance.GameResultPanelData; //更新面板的显示数据 grpd.isPanelShow = true; grpd.isShowRoundGameResult = true; SystemMgr.Instance.GameResultSystem.UpdateShow(); UIMainView.Instance.GameResultPanel.SpwanGameReult_Round(); } Destroy(gameObject); }
/// <summary> /// 点击继续按钮 /// </summary> void HandleBtnNextRound(int status) { PlayerPlayingPanelData pppd = GameData.Instance.PlayerPlayingPanelData; GameResultPanelData grpd = GameData.Instance.GameResultPanelData; //如果是手动点击继续,自动解除托管 if (status == 1) { if (pppd.iPlayerHostStatus > 0) { GameData.Instance.GameResultPanelData.iHandClick = 1; NetMsg.ClientCancleAutoStatusReq msg = new NetMsg.ClientCancleAutoStatusReq(); msg.iUserId = GameData.Instance.PlayerNodeDef.iUserId; msg.iSeatNum = (byte)pppd.bySeatNum; Network.NetworkMgr.Instance.GameServer.SendClientCancleAutoStatusReq(msg); } } else { GameData.Instance.GameResultPanelData.iHandClick = 2; } //如果玩家是托管,这个时候检测解散信息 if (pppd.iDissolveFlag == 1) { pppd.iDissolveFlag = 0; NetMsg.ClientDismissRoomRes msg = pppd.DismissRoomRes; //显示解散界面 int seatNum = pppd.GetOtherPlayerPos(msg.iUserId); //显示玩家发起解散房间 if (msg.cType == 1) { if (pppd.isBeginGame || pppd.iMethodId == 11) { //显示界面 UIMainView.Instance.PlayerPlayingPanel.DissolvePanel.SetActive(true); UIMainView.Instance.PlayerPlayingPanel.DissolvePanel.transform.localPosition = Vector3.zero; UIMainView.Instance.PlayerPlayingPanel.DissolvePanel.transform.localScale = Vector3.one; if (pppd.isBeginGame || pppd.isWatingPlayerDownOrUp) { //更新界面 UIMainView.Instance.PlayerPlayingPanel.DissolvePanel.GetComponent <DissvloeNoticePanel>().iseatNum = seatNum; UIMainView.Instance.PlayerPlayingPanel.DissolvePanel.GetComponent <DissvloeNoticePanel>().ShowAllPlayerMessage(); } } } else if (msg.cType == 3) { UIMainView.Instance.PlayerPlayingPanel.DissolvePanel.SetActive(false); System.Text.StringBuilder str = new System.Text.StringBuilder(); str.Append("由于玩家【"); str.Append(pppd.usersInfo[seatNum].szNickname); str.Append("】拒绝,房间解散失败,继续游戏"); UIMgr.GetInstance().GetUIMessageView().Show(str.ToString(), Ok); } } //判断玩家是解散结束还是正常结束 if (grpd.HandDissolve == 0 && !grpd.isEndGame) { if (!pppd.isAllAutoStatus && pppd.iDissolveStatus != 1) { //发送准备请求 NetMsg.ClientReadyReq msg = new NetMsg.ClientReadyReq(); msg.iUserId = GameData.Instance.PlayerPlayingPanelData.iUserId; Debug.Log("点击继续按钮,发送准备请求"); Network.NetworkMgr.Instance.GameServer.SendReadyReq(msg); } GameData.Instance.GameResultPanelData.isPanelShow = false; if (pppd.isBeginGame) { UIMainView.Instance.PlayerPlayingPanel.InitPanel(); } } //如果玩家是解散结束的 else { //关闭玩家的单局结算界面 grpd.isShowRoundGameResult = false; //显示总的结算数据 grpd.isShowRoomGameResult = true; UIMainView.Instance.GameResultPanel.SpwanAllGameResult(); UpdateShow(); } SystemMgr.Instance.GameResultSystem.UpdateShow(); }
/// <summary> /// 更新面板数据 /// </summary> public void UpdateShow() { GameResultPanelData grpd = GameData.Instance.GameResultPanelData; PlayerPlayingPanelData pppd = GameData.Instance.PlayerPlayingPanelData; if (grpd.isPanelShow) { gameObject.SetActive(true); if (MahjongLobby_AH.SDKManager.Instance.IOSCheckStaus == 1) { #if UNITY_IOS || UNITY_IPONE for (int i = 0; i < _btnShare.Length; i++) { _btnShare[i].SetActive(false); } #endif } else { for (int i = 0; i < _btnShare.Length; i++) { _btnShare[i].SetActive(true); } } //修改确定按钮的图片 //if(grpd.HandDissolve==0) //{ // okImage.sprite = ok_sprite[0]; //} //else //{ // okImage.sprite = ok_sprite[1]; //} //产生一局结算的结果 if (grpd.isShowRoundGameResult) { RoundGameReult.SetActive(true); GameBtn[0].SetActive(true); } else { RoundGameReult.SetActive(false); GameBtn[0].SetActive(false); } //产生房间游戏结算的结果 if (grpd.isShowRoomGameResult) { AllGameResult.SetActive(true); Title[0].SetActive(false); Title[1].SetActive(false); GameBtn[1].SetActive(true); RPButton.SetActive(true); } else { Title[0].SetActive(true); Title[1].SetActive(true); AllGameResult.SetActive(false); GameBtn[1].SetActive(false); RPButton.SetActive(false); } } else { gameObject.SetActive(false); } }
/// <summary> /// 产生四家的结算的预置体 /// </summary> public void SpwanGameReult_Round() { GameResultPanelData grpd = GameData.Instance.GameResultPanelData; //在每次产生之前先删除之前的预置体 GameResultPrefab[] prefab = RoundGameReult.transform.GetComponentsInChildren <GameResultPrefab>(); if (prefab.Length > 0) { for (int i = 0; i < prefab.Length; i++) { Destroy(prefab[i].gameObject); } } for (int i = 1; i < 5; i++) { GameObject go = null; //通过座位号判断玩家信息是否是赢家 if (grpd.byaWinSrat[i - 1] > 0) { go = Instantiate(Resources.Load <GameObject>("Game/GameResult/RoundPlayerResult_Win")); go.transform.SetParent(RoundGameReult.transform); go.transform.SetAsFirstSibling(); } else { go = Instantiate(Resources.Load <GameObject>("Game/GameResult/RoundPlayerResult_Normal")); go.transform.SetParent(RoundGameReult.transform); } go.transform.localScale = Vector3.one; go.transform.localEulerAngles = Vector3.zero; go.transform.localPosition = new Vector3(go.transform.localPosition.x, go.transform.localPosition.y, 0); GameResultPrefab gameRes = go.GetComponent <GameResultPrefab>(); gameRes.iseatNum = i; gameRes.MessageVlaue(); gameRes.SpwanPlayerCard(); } bool isHuangZhuang = true; //如果本次是荒庄,产生荒庄的图标 for (int i = 0; i < 4; i++) { if (grpd.byaWinSrat[i] > 0) { isHuangZhuang = false; } } //在这里处理如果玩家处于托管状态,30s后自动准备 PlayerPlayingPanelData pppd = GameData.Instance.PlayerPlayingPanelData; pppd.isAllAutoStatus = true; //是否是四个人的托管状态 for (int i = 0; i < pppd.iAllPlayerHostStatus.Length; i++) { if (pppd.iAllPlayerHostStatus[i] == 0) { pppd.isAllAutoStatus = false; break; } } if (!pppd.isAllAutoStatus) { AutoReady(); } if (isHuangZhuang) { UIMainView.Instance.PlayerPlayingPanel.SpwanSpeaiclTypeRemind(4, 9, false); } }
string nickNameColor_outline = "206774"; //失败玩家的昵称颜色描边 /// <summary> /// 更新玩家的信息 /// </summary> public void UpdatePlayerMessage() { StringBuilder str = new StringBuilder(); PlayerPlayingPanelData pppd = GameData.Instance.PlayerPlayingPanelData; GameResultPanelData grpd = GameData.Instance.GameResultPanelData; //更新玩家头像 MahjongCommonMethod.Instance.GetPlayerAvatar(headImage, pppd.usersInfo[iseatNum].szHeadimgurl); int Score = 0; if (pppd.playingMethodConf.byBillingMode == 3) { Score = pppd.playingMethodConf.byBillingNumber; } int multiple = 1; //分数是否要放大100倍 // if (pppd.playingMethodConf.byWinLimitBeginFan > 0) // { // multiple = 100; //} if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].sTotalPoint * multiple > Score) { //更新玩家的分数 PlayerScore.font = font[0]; PlayerScore.text = "+" + (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].sTotalPoint * multiple).ToString(); winBg.sprite = RoomResultBg_sprite[0]; //更新玩家的昵称 NickName.text = pppd.usersInfo[iseatNum].szNickname; //更新玩家的id iuserid.text = "ID:" + pppd.usersInfo[iseatNum].iUserId.ToString(); } else { PlayerScore.font = font[1]; PlayerScore.text = (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].sTotalPoint * multiple).ToString(); winBg.sprite = RoomResultBg_sprite[1]; //更新玩家的昵称 NickName.text = pppd.usersInfo[iseatNum].szNickname; NickName.color = new Color(0.86f, 1, 0.95f, 1); NickName.GetComponent <Outline>().effectColor = new Color(0.125f, 0.404f, 0.455f, 1f); //更新玩家的id iuserid.text = "<color=#206774>" + "ID:" + pppd.usersInfo[iseatNum].iUserId + "</color>"; } //更新玩家的具体数据 RoomResult[0].text = grpd.roomResultNotice.aRoomResultType[iseatNum - 1].wSelfDrawn.ToString(); RoomResult[1].text = grpd.roomResultNotice.aRoomResultType[iseatNum - 1].wExposedKong.ToString(); RoomResult[2].text = grpd.roomResultNotice.aRoomResultType[iseatNum - 1].wConcealedKong.ToString(); RoomResult[3].text = grpd.roomResultNotice.aRoomResultType[iseatNum - 1].wShoot.ToString(); RoomResult[4].text = grpd.roomResultNotice.aRoomResultType[iseatNum - 1].wTakeShoot.ToString(); //根据玩家的分数确定显示玩家的赢牌信息 bool score = true; //玩家分数 bool NormalWinCount = true; //接炮次数 for (int i = 0; i < 4; i++) { //如果玩家选择的是打锅玩法,玩法要大于最低的分数 if (pppd.playingMethodConf.byBillingMode == 2 || pppd.playingMethodConf.byBillingMode == 3) { if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].sTotalPoint * multiple <= pppd.playingMethodConf.byBillingNumber) { score = false; } } //判断得分是不是最高 if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].sTotalPoint * multiple <= 0 || grpd.roomResultNotice.aRoomResultType[iseatNum - 1].sTotalPoint * multiple < grpd.roomResultNotice.aRoomResultType[i].sTotalPoint * multiple) { score = false; } //判断点炮次数最多 if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].wShoot < grpd.roomResultNotice.aRoomResultType[i].wShoot || grpd.roomResultNotice.aRoomResultType[iseatNum - 1].wShoot < 2) { NormalWinCount = false; } } if (score) { multiply[1].gameObject.SetActive(false); roomWinMessage.gameObject.SetActive(true); if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBigWinnerCount < 4) { //大赢家 if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBigWinnerCount == 1) { multiply[0].gameObject.SetActive(false); Count.gameObject.SetActive(false); } else { multiply[0].gameObject.SetActive(true); Count.gameObject.SetActive(true); Count.text = grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBigWinnerCount.ToString(); } roomWinMessage.sprite = image_room[0]; } else if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBigWinnerCount < 7) { //雀王 if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBigWinnerCount == 4) { multiply[0].gameObject.SetActive(false); Count.gameObject.SetActive(false); } else { multiply[0].gameObject.SetActive(true); Count.gameObject.SetActive(true); Count.text = (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBigWinnerCount - 3).ToString(); } roomWinMessage.sprite = image_room[2]; } else { //雀神 if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBigWinnerCount == 7) { multiply[0].gameObject.SetActive(false); Count.gameObject.SetActive(false); } else { multiply[0].gameObject.SetActive(true); Count.gameObject.SetActive(true); Count.text = (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBigWinnerCount - 6).ToString(); } roomWinMessage.sprite = image_room[3]; } if (iseatNum == MahjongCommonMethod.Instance.mySeatid) { GameData.Instance.GameResultPanelData.isWinner = true; } } if (!score && NormalWinCount) { roomWinMessage.gameObject.SetActive(true); multiply[0].gameObject.SetActive(false); Count.text = grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBestGunnerCount.ToString(); if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBestGunnerCount < 4) { //最佳炮手 if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBestGunnerCount == 1) { multiply[1].gameObject.SetActive(false); Count.gameObject.SetActive(false); } else { multiply[1].gameObject.SetActive(true); Count.gameObject.SetActive(true); Count.text = (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBestGunnerCount).ToString(); } roomWinMessage.sprite = image_room[1]; } else if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBestGunnerCount < 7) { //炮王 if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBestGunnerCount == 4) { multiply[1].gameObject.SetActive(false); Count.gameObject.SetActive(false); } else { multiply[1].gameObject.SetActive(true); Count.gameObject.SetActive(true); Count.text = (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBestGunnerCount - 3).ToString(); } roomWinMessage.sprite = image_room[4]; } else { //炮神 if (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBestGunnerCount == 7) { multiply[1].gameObject.SetActive(false); Count.gameObject.SetActive(false); } else { multiply[1].gameObject.SetActive(true); Count.gameObject.SetActive(true); Count.text = (grpd.roomResultNotice.aRoomResultType[iseatNum - 1].byBestGunnerCount - 6).ToString(); } roomWinMessage.sprite = image_room[5]; } if (iseatNum == MahjongCommonMethod.Instance.mySeatid) { GameData.Instance.GameResultPanelData.isWinner = true; } } roomWinMessage.GetComponent <Image>().SetNativeSize(); }
/// <summary> /// 产生对应的手牌 /// </summary> public void SpwanPlayerCard() { GameResultPanelData grpd = GameData.Instance.GameResultPanelData; Vector3 initpos_0 = initPos.transform.localPosition; //普通麻将的初始位置 PlayerPlayingPanelData pppd = GameData.Instance.PlayerPlayingPanelData; int index = pppd.GetOtherPlayerShowPos(iseatNum + 1) - 1; if (initpos_0.y > 80) { initpos_0 = new Vector3(initpos_0.x, 80, 0); } int mahjongNum_0 = 0; //麻将产生数量 byte bLastTile = 0; //最后一张得到的牌 int winNum = 0; //显示胡牌的数量 //存储玩家的手牌 List <byte> mahvalue = new List <byte>(); for (int i = 0; i < 14; i++) { if (grpd.bHandleTiles[iseatNum - 1, i] != 0) { mahvalue.Add(grpd.bHandleTiles[iseatNum - 1, i]); } } //添加玩家最后获取的一张牌,会添加一个胡牌的标志图片 if (grpd.resultType[iseatNum - 1].lastTile.bySuit != 0 && grpd.byaWinSrat[iseatNum - 1] > 0) { bLastTile = (byte)(grpd.resultType[iseatNum - 1].lastTile.bySuit * 16 + grpd.resultType[iseatNum - 1].lastTile.byValue); if (!bSelfWin) { mahvalue.Add(bLastTile); } } mahvalue.Sort(iCompareList); //产生手牌 for (int i = 0; i < mahvalue.Count; i++) { if (mahvalue[i] != 0) { GameObject go = null; go = PoolManager.Spawn("Game/Ma/", PlayerPlayingPanelData.showVCardPre); go.transform.SetParent(playerCard.transform); go.transform.SetAsFirstSibling(); go.transform.localScale = Vector3.one; go.transform.localEulerAngles = Vector3.zero; go.transform.Find("Image/num").transform.localEulerAngles = Vector3.zero; go.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 0); go.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 0); go.transform.localPosition = initpos_0 + new Vector3(mahjongNum_0 * 42f, 0, 0); mahjongNum_0++; if (bLastTile == mahvalue[i] && winNum == 0 && grpd.byaWinSrat[iseatNum - 1] > 0) { go.transform.Find("win").gameObject.SetActive(true); winNum++; } go.transform.Find("point").gameObject.SetActive(false); UIMainView.Instance.PlayerPlayingPanel.ChangeCardNum(go.transform.Find("Image/num").GetComponent <Image>(), mahvalue[i]); } else { break; } } Vector3 initpos_1 = initPos_special.transform.localPosition; //特殊麻将的初始位置 int mahjongNum_1 = 0; //产生顺子牌 //Debug.LogError("产生顺子牌:" + grpd.resultType[iseatNum - 1].bySequenceNum); for (int i = 0; i < grpd.resultType[iseatNum - 1].bySequenceNum; i++) { GameObject go = null; byte value = 0; //顺子的第一个值 go = PoolManager.Spawn("Game/Ma/", PlayerPlayingPanelData.pegaUCardsPre); go.transform.SetParent(playerCard.transform); go.transform.SetAsFirstSibling(); go.transform.localScale = Vector3.one; go.transform.localEulerAngles = Vector3.zero; go.transform.localPosition = initpos_1 + new Vector3(mahjongNum_0 * 42f + 20f + mahjongNum_1 * 145f, 0, 0); //更新牌面 value = (byte)(grpd.resultType[iseatNum - 1].sequenceType[i].bySuit * 16 + grpd.resultType[iseatNum - 1].sequenceType[i].byFirstValue); UpdateCard(go, value, 0); mahjongNum_1++; } // Debug.LogError("grpd.resultType[iseatNum - 1].byTripletNum" + grpd.resultType[iseatNum - 1].byTripletNum); //产生刻子牌 for (int i = 0; i < grpd.resultType[iseatNum - 1].byTripletNum; i++) { GameObject go = null; byte value = 0; //对应牌的花色值 go = PoolManager.Spawn("Game/Ma/", PlayerPlayingPanelData.pegaUCardsPre); go.transform.SetParent(playerCard.transform); go.transform.SetAsFirstSibling(); go.transform.localScale = Vector3.one; go.transform.localEulerAngles = Vector3.zero; go.transform.localPosition = initpos_1 + new Vector3(mahjongNum_0 * 42f + 20f + mahjongNum_1 * 145f, 0, 0); //更新牌面的花色值 value = (byte)(grpd.resultType[iseatNum - 1].tripletType[i].bySuit * 16 + grpd.resultType[iseatNum - 1].tripletType[i].byValue); // Debug.LogError("刻子牌的花色值:" + value.ToString("X2")); UpdateCard(go, value, grpd.resultType[iseatNum - 1].tripletType[i].byPongKongType); mahjongNum_1++; } //Debug.LogError("吃抢的牌的数量:" + grpd.resultType[iseatNum - 1].byThirteenOrphansNum); //产生吃抢的牌 for (int i = 0; i < grpd.resultType[iseatNum - 1].byThirteenOrphansNum; i++) { byte value = 0; //对应牌的花色值 //更新牌面的花色值 value = (byte)(grpd.resultType[iseatNum - 1].thirteenOrphansType[i].bySuit * 16 + grpd.resultType[iseatNum - 1].thirteenOrphansType[i].byValue); GameObject go = null; go = PoolManager.Spawn("Game/Ma/", PlayerPlayingPanelData.showVCardPre); go.transform.SetParent(playerCard.transform); go.transform.SetAsFirstSibling(); go.transform.localScale = Vector3.one; go.transform.localEulerAngles = Vector3.zero; go.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 0); go.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 0); go.transform.localPosition = initpos_0 + new Vector3(mahjongNum_0 * 42f + 20f, 0, 0); UIMainView.Instance.PlayerPlayingPanel.ChangeCardNum(go.transform.Find("Image/num").GetComponent <Image>(), value, index); mahjongNum_0++; } }
bool bSelfWin; //是否自摸的标志位 #region 处理玩家一局结算 /// <summary> /// 更新界面的玩家信息 /// </summary> /// <param name="index"></param> public void MessageVlaue() { PlayerPlayingPanelData pppd = GameData.Instance.PlayerPlayingPanelData; GameResultPanelData grpd = GameData.Instance.GameResultPanelData; MahjongCommonMethod.Instance.GetPlayerAvatar(headImage, pppd.usersInfo[iseatNum].szHeadimgurl); NickName.text = pppd.usersInfo[iseatNum].szNickname; if (grpd.bResultPoint[iseatNum - 1] > 0) { PlayerScore.font = font[0]; PlayerScore.text = "+" + grpd.bResultPoint[iseatNum - 1].ToString(); } else if (grpd.bResultPoint[iseatNum - 1] < 0) { PlayerScore.font = font[1]; PlayerScore.text = grpd.bResultPoint[iseatNum - 1].ToString(); } else { PlayerScore.font = font[1]; PlayerScore.text = grpd.bResultPoint[iseatNum - 1].ToString(); } StringBuilder str = new StringBuilder(); //确定是否显示庄家标志图片 if (iseatNum == pppd.byDealerSeat) { Banker.gameObject.SetActive(true); } else { Banker.gameObject.SetActive(false); } #region 处理明暗杠 //获取明杠暗杠数量 for (int i = 0; i < grpd.resultType[iseatNum - 1].byTripletNum; i++) { if (grpd.resultType[iseatNum - 1].tripletType[i].byPongKongType == 2) { iMingGongNum++; } else if (grpd.resultType[iseatNum - 1].tripletType[i].byPongKongType == 3) { iAnGangGongNum++; } } //添加明杠 if (grpd.resultType[iseatNum - 1].cExposedKongPoint != 0) { str.Append("明杠"); int point = grpd.resultType[iseatNum - 1].cExposedKongPoint; if (point > 0) { str.Append("+"); } //添加被杠,额外扣分 if (pppd.playingMethodConf.byFanExtraExposedExtra > 0) { str.Append(point); } else { str.Append(point); } str.Append(" "); } //添加暗杠 if (grpd.resultType[iseatNum - 1].cConcealedKongPoint != 0) { str.Append("暗杠"); if (grpd.resultType[iseatNum - 1].cConcealedKongPoint > 0) { str.Append("+"); } str.Append(grpd.resultType[iseatNum - 1].cConcealedKongPoint); str.Append(" "); } #endregion int winCount_ = 0; //赢家的数量 //添加自摸 for (int i = 0; i < 4; i++) { // Debug.LogWarning(i + "自摸检测byaWinSrat[i]" + grpd.byaWinSrat[i]); if (grpd.byaWinSrat[i] > 0) { winCount_++; winSeat = i + 1; iDrawSeatNum = i + 1; } } //判断一局结束是否是自摸 没有放炮 有赢家 if (winCount_ > 0 && grpd.byShootSeat <= 0) { bSelfWin = true; } else { iDrawSeatNum = 0; } if (iDrawSeatNum == iseatNum) { winMessage_Image.gameObject.SetActive(true); winMessage_Image.sprite = image_round[1]; } //判断自己接炮胡 if (grpd.byaWinSrat[iseatNum - 1] > 0 && !bSelfWin) { winMessage_Image.gameObject.SetActive(true); winMessage_Image.sprite = image_round[0]; } //如果玩家点炮显示点炮信息 if (grpd.byShootSeat == iseatNum) { winMessage_Image.gameObject.SetActive(true); winMessage_Image.sprite = image_round[2]; } int iKongWin = 0; //判断是否荒庄 for (int i = 0; i < 4; i++) { // Debug.LogError(i + "grpd.byaWinSrat[i]" + grpd.byaWinSrat[i]); if (grpd.byaWinSrat[i] > 0) { iKongWin++; } } //判断抢杠胡收几家 bool isRobbingWin = false; if (iDrawSeatNum == 0 && pppd.playingMethodConf.byFanRobbingKongWin > 0) { for (int i = 0; i < 4; i++) { if (grpd.byaWinSrat[i] > 0 && grpd.resultType[i].lastTile.byRobbingKong == 1) { isRobbingWin = true; } } } //如果不是荒庄 显示底分倍数 if (iKongWin > 0) { str.Append(ShowSpecialWinType(iseatNum - 1, grpd.caFanResult)); if (iDrawSeatNum > 0)//自摸 { } else//放炮 { #region 放炮 //一炮多响 放炮收三家 //if (pppd.playingMethodConf.byWinPointMultiPay > 0 || pppd.playingMethodConf.byWinPointMultiShoot > 0) //{ // if (iseatNum == grpd.byShootSeat) // { // str.Append(ShowSpecialWinType(iseatNum - 1, grpd.caFanResult)); // for (int i = 0; i < 4; i++) // { // if (grpd.byaWinSrat[i] > 0) // { // str.Append(ShowSpecialWinType(i, grpd.caFanResult)); // } // } // } // else // { // if (grpd.byaWinSrat[iseatNum - 1] > 0) // { // str.Append(ShowSpecialWinType(iseatNum - 1, grpd.caFanResult)); // } // else // { // for (int i = 0; i < 4; i++) // { // if (grpd.byaWinSrat[i] > 0) // { // str.Append(ShowSpecialWinType(i, grpd.caFanResult)); // break; // } // } // } // } //}//放炮收一家 //else //{ // if (grpd.byaWinSrat[iseatNum - 1] > 0) // { // str.Append(ShowSpecialWinType(iseatNum - 1, grpd.caFanResult)); // } // if (iseatNum == grpd.byShootSeat) // { // for (int i = 0; i < 4; i++) // { // if (grpd.byaWinSrat[i] > 0) // { // str.Append(ShowSpecialWinType(i, grpd.caFanResult)); // break; // } // } // } //} #endregion 放炮 #region 点 if (pppd.playingMethodConf.byWinPoint > 0 && grpd.byShootSeat == 0) { int iValue = grpd.resultType[iseatNum - 1].lastTile.bySuit; int point = 0; if (iValue != 0 && grpd.byaWinSrat[iseatNum - 1] > 0) { int suit = iValue / 16; int value = iValue % 16; if (suit < 4) { if (value < 4) { point = 1; } else if (value > 3 && value < 7) { point = 2; } else { point = 3; } } else { point = 3; } } str.Append("点+"); str.Append(point); str.Append(" "); } #endregion #region 坎(三张一样的算一坎) //int kong_count = 0; //坎的数量 ////如果设置了坎,则计算坎的分数 //if (pppd.playingMethodConf.byWinKong > 0 && grpd.byaWinSrat[iseatNum - 1] > 0) //{ // byte[] temp = new byte[14]; // for (int i = 0; i < 14; i++) // { // temp[i] = grpd.bHandleTiles[winSeat - 1, i]; // } // byte[,] value = MahjongHelper.Instance.SwitchArray(temp); // for (int i = 0; i < 5; i++) // { // for (int j = 1; j < 10; j++) // { // //如果玩家手牌有三张相同的记为1坎 // if (value[i, j] > 2) // { // kong_count++; // } // } // } // //如果下地的三张是不是也要算入坎中 // //if (pppd.playingMethodConf.byWinKongFlagNum > 0) // //{ // // for (int i = 0; i < pppd.usersCardsInfo[0].listSpecialCards.Count; i++) // // { // // if (pppd.usersCardsInfo[0].listSpecialCards[i].type == 2 && pppd.usersCardsInfo[0].listSpecialCards[i].mahValue[0] / 16 > 3) // // { // // kong_count++; // // } // // } // //} // if (kong_count > 0) // { // str.Append("坎+" + kong_count); // str.Append(" "); // } //} #endregion #region 庄闲倍数 if (pppd.playingMethodConf.byWinPointDealerMultiple > 1 && pppd.playingMethodConf.byWinPointPlayerMultiple > 1) { string sZhuangContent = ""; if (pppd.lcDealerMultiple == 1) { sZhuangContent = "庄*3"; } else { sZhuangContent = "庄*" + pppd.playingMethodConf.byWinPointDealerMultiple; } string sXianContent = "闲*1"; //添加庄闲倍数 if (iDrawSeatNum > 0) { if (iDrawSeatNum == pppd.byDealerSeat) { str.Append(sZhuangContent); str.Append(" "); } else { if (iseatNum == pppd.byDealerSeat) { str.Append(sZhuangContent); str.Append(" "); } else { str.Append(sXianContent); str.Append(" "); } } } else { //如果接炮收三家 或者 抢杠胡收三家 if (pppd.playingMethodConf.byWinPointMultiPay == 1 || isRobbingWin) { if (iseatNum == pppd.byDealerSeat) { str.Append(sZhuangContent); } else { //如果庄家胡牌 if (grpd.byaWinSrat[pppd.byDealerSeat - 1] > 0) { str.Append(sZhuangContent); } else { str.Append(sXianContent); } } str.Append(" "); } else { if (grpd.byaWinSrat[iseatNum - 1] > 0 || iseatNum == grpd.byShootSeat) { if (iseatNum == pppd.byDealerSeat) { str.Append(sZhuangContent); } else { if (winSeat == pppd.byDealerSeat || grpd.byShootSeat == pppd.byDealerSeat) { str.Append(sZhuangContent); } else { str.Append(sXianContent); } } str.Append(" "); } } } } #endregion #region 自摸 if (iDrawSeatNum > 0 && MahjongCommonMethod.Instance.iPlayingMethod != 20001) { //平顺自摸不翻倍 if (pppd.playingMethodConf.byWinPointSelfDrawnMultiple == 1) { str.Append("自摸*" + pppd.playingMethodConf.byWinPointSelfDrawnMultiple); } else { str.Append("自摸*" + pppd.playingMethodConf.byWinPointSelfDrawnMultiple); } str.Append(" "); } #endregion #endregion #region 添加额外接炮放炮信息 Debug.Log("添加额外接炮放炮信息" + pppd.playingMethodConf.byWinPointMultiPay + "__" + pppd.playingMethodConf.byWinPointMultiPayExtraMode); //添加接炮的信息 if (pppd.playingMethodConf.byWinPointMultiPay > 0 && pppd.playingMethodConf.byWinPointMultiPayExtraMode > 0) { if (pppd.playingMethodConf.byWinPointMultiPayExtra > 0) { if (grpd.byaWinSrat[iseatNum - 1] > 0 && iDrawSeatNum == 0 && grpd.resultType[iseatNum - 1].cRobbingKongPoint == 0) { str.Append("接炮+" + pppd.playingMethodConf.byWinPointMultiPayExtra); str.Append(" "); } if (grpd.byShootSeat == iseatNum && grpd.resultType[iseatNum - 1].cRobbingKongPoint == 0) { str.Append("放炮-" + pppd.playingMethodConf.byWinPointMultiPayExtra); str.Append(" "); } } } #endregion #region 抢杠胡的额外杠分 ////添加抢杠胡的额外杠分 //if (isContainRob) //{ // if (pppd.playingMethodConf.byFanRobbingKongWin > 0 && grpd.byShootSeat != 0) // { // if (iseatNum == grpd.byShootSeat) // { // str.Append("抢杠胡-" + pppd.playingMethodConf.byFanRobbingKongWin * basePoint); // str.Append(" "); // } // if (iseatNum == winSeat) // { // str.Append("抢杠胡+" + pppd.playingMethodConf.byFanRobbingKongWin * basePoint); // str.Append(" "); // } // } //} #endregion } // Debug.LogError("补杠" + grpd.resultType[iseatNum - 1].cTripletToKongPoint); if (grpd.resultType[iseatNum - 1].cTripletToKongPoint != 0) { str.Append("补杠"); if (grpd.resultType[iseatNum - 1].cTripletToKongPoint > 0) { str.Append("+"); } str.Append(grpd.resultType[iseatNum - 1].cTripletToKongPoint); str.Append(" "); } } // Debug.Log("num" + num); //改变显示特殊牌型文字说明的长度 if (str.Length > 0) { winMessage.gameObject.SetActive(true); winMessage_text.gameObject.SetActive(true); winMessage_text.text = str.ToString(); if (winMessage_text.preferredWidth > 605f) { winMessage.rectTransform.sizeDelta = new Vector2(625f, 31f); } else { winMessage.rectTransform.sizeDelta = new Vector2(winMessage_text.preferredWidth + 20f, 31f); } winMessage.transform.localPosition = new Vector3(winMessage.transform.localPosition.x + (winMessage.rectTransform.rect.width - 60f) / 2f, 8f, 0); } }