Example #1
0
        /// <summary>
        /// 比倍得分
        /// </summary>
        public void CompareGetScore_Onclick()
        {
            //圧大
            NPacket packet = NPacketPool.GetEnablePacket();

            packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_COMPARE_GS);
            packet.AddInt(0);
            GameEngine.Instance.Send(packet);
        }
Example #2
0
        public void BigBT_Onclick()
        {
            //圧大
            NPacket packet = NPacketPool.GetEnablePacket();

            packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_COMPARE_XZ);
            packet.AddInt(2);

            GameEngine.Instance.Send(packet);
            SetButtonBt(m_gBigBT, true);
            SetButtonBt(m_gLittleBT, true);
        }
Example #3
0
        /// <summary>
        /// 启动比倍
        /// </summary>
        public void Compare_Onclick()
        {
            CMusicManger._instance.PlaySound("CompareBT");
            m_gCompare.SetActive(true);
            m_bIsOpenComPare = true;
            CCompareManger._instance.ShowWindow();
            UIManger.Instance.m_bIsGetscore = false;
            if (!m_bIsCompareFree)
            {
                int tempIndex = 10 - UIManger.Instance.m_cUpdateCard.bCardType;
                int tempType  = UIManger.Instance.m_iPeiLvType;
                if (CPlayerInfo._instance.m_iRoomTimes == 0)
                {
                    CPlayerInfo._instance.m_iRoomTimes = 1;
                }
                int tempscore = (int)((UIManger.Instance.m_lAllScore - CPlayerInfo._instance.m_iGold) / (long)CPlayerInfo._instance.m_iRoomTimes);
                CCompareManger._instance.SetCompareCard(tempscore);
                CCompareManger._instance.SetCurrentCompare(0);
                CCompareManger._instance.SetHistoryCard();
                SetAllBTFalse();
                SetButtonBt(m_gBigBT, false);
                SetButtonBt(m_gLittleBT, false);
                SetButtonBt(m_gMoreThanBT, true);
            }
            else
            {
                if (CPlayerInfo._instance.m_iCreditNum >= CPokerPointsManger._instance.m_iBasePointBK && CPlayerInfo._instance.m_iCreditNum > 0)
                {
                    //空闲状态请求比倍
                    NPacket packet = NPacketPool.GetEnablePacket();
                    packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_COMPARE_FREE);
                    packet.AddInt(CPokerPointsManger._instance.m_iBasePointBK);
                    GameEngine.Instance.Send(packet);

                    SetAllBTFalse();
                    CPlayerInfo._instance.m_iGold     -= CPokerPointsManger._instance.m_iBasePointBK * CPlayerInfo._instance.m_iRoomTimes;
                    CPlayerInfo._instance.m_iCreditNum = (int)(CPlayerInfo._instance.m_iGold / CPlayerInfo._instance.m_iRoomTimes);
                }
                else
                {
                    CNomaney._instance.ShowWindow();
                }
            }
            CCompareManger._instance.m_gBig.SetActive(true);
            CCompareManger._instance.m_gBig.GetComponent <CBigSmallAnimation>().RectAnimarion();
            CCompareManger._instance.m_gSmall.SetActive(true);
            CCompareManger._instance.m_gSmall.GetComponent <CBigSmallAnimation>().RectAnimarion();
            CPushAnimation._instance.gameObject.SetActive(false);
            CCompareManger._instance.m_bIsWinPushDouble = false;
            UIManger.Instance.m_bIsPlayingGame          = true;
        }
Example #4
0
        /// <summary>
        /// 启动按钮响应
        /// </summary>
        public void StartBT_OnClick()
        {
            //第一次请求发牌
            if (!UIManger.Instance.m_bIsUpdateCard)
            {
                if (CPokerPointsManger._instance.m_iBasePointBK == 0 && CPokerPointsManger._instance.m_iBasePoints == 0)
                {
                    return;
                }
                if (CPokerPointsManger._instance.m_iBasePoints == UIManger.Instance.m_iGameStartPoint)
                {
                    CPokerPointsManger._instance.m_iBasePoints = CPokerPointsManger._instance.m_iBasePointBK;
                }

                CPlayerInfo._instance.m_iBet = CPokerPointsManger._instance.m_iBasePoints;
                CPokerPointsManger._instance.m_iBasePointBK = CPokerPointsManger._instance.m_iBasePoints;
                m_bIsFirstInput = true;
                //请求发牌
                NPacket packet = NPacketPool.GetEnablePacket();
                packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_START_DEAL_JX);

                //压分
                packet.AddLong(CPokerPointsManger._instance.m_iBasePoints);
                //此数据无效
                packet.AddInt(0);

                GameEngine.Instance.Send(packet);
                SetButtonBt(m_gStartBT, true);
                SetButtonBt(m_gInputScoreBT, true);
            }
            //第二次请求发牌
            else
            {
                NPacket packet = NPacketPool.GetEnablePacket();
                packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_UPDATE_CARD_JX);
                packet.AddBytes(UIManger.Instance.m_cUpdateCard.cCard.cbCard, UIManger.Instance.m_cUpdateCard.cCard.cbCard.Length);
                for (int i = 0; i < UIManger.Instance.m_cUpdateCard.cCard.bBarter.Length; i++)
                {
                    //牌的值
                    packet.AddBool(UIManger.Instance.m_cUpdateCard.cCard.bBarter[i]);
                }
                GameEngine.Instance.Send(packet);
                SetButtonBt(m_gStartBT, true);
            }
            SetButtonBt(m_gRecordBT, true);
            CBottomBTOnclick._instance.SetButtonBt(CBottomBTOnclick._instance.m_gMoreThanBT, true);
            CBottomBTOnclick._instance.m_bIsCompareFree = false;
            UIManger.Instance.m_bIsPlayingGame          = true;
        }
Example #5
0
 //清除
 public void ClearBT_OnClick()
 {
     if (m_bIsBetTime)
     {
         //获取游戏记录
         NPacket packet = NPacketPool.GetEnablePacket();
         packet.CreateHead(MainCmd.MDM_GF_GAME, SubCmd.SUB_C_BET_CLEAR);
         packet.AddInt(0);
         CGameEngine.Instance.Send(packet);
     }
     else
     {
         AddTiShi("非下注时间无法下注");
     }
 }