Beispiel #1
0
        public void FreshTableCard()
        {
            if (IsGameStart && _rejoin)
            {
                var sendObj = SFSObject.NewInstance();
                sendObj.PutIntArray("color1", _color1);
                sendObj.PutIntArray("color2", _color2);
                sendObj.PutIntArray("color3", _color3);
                sendObj.PutIntArray("color4", _color4);
                GetPlayerInfo <JlGameUserInfo>().IsCurSpeaker = _curSpeaker == SelfSeat;
                sendObj.PutBoolArray("killDragon", _killDragon);
                sendObj.PutBoolArray("isDragon", _isDragon);
                EventObj.SendEvent("TableViewEvent", "Rejoin", sendObj);

                var time = _cd - (_ct - _st);
                if (time > 600)
                {
                    time = _mrcd;
                    GetPlayer <JlGamePlayer>(_curSpeaker, true).SetCountNum((int)time, true);
                }
                else
                {
                    GetPlayer <JlGamePlayer>(_curSpeaker, true).SetCountNum((int)time);
                }
                YxClockManager.BeginWaitPlayer(_curSpeaker, time);
            }
            else
            {
                EventObj.SendEvent("TableViewEvent", "Reset", null);
                if (!GetPlayer <JlGamePlayer>().ReadyState)
                {
                    EventObj.SendEvent("TableViewEvent", "Ready", null);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 显示指定玩家说话
        /// </summary>
        /// <param name="speaker"></param>
        /// <param name="cd"></param>
        public void Speaker(int speaker, float cd = -1)
        {
            var speakerPanel = App.GameData.GetPlayer <PlayerPanel>(speaker, true);

            if (speakerPanel.Info == null)
            {
                YxDebug.Log("座位上没有玩家!");
                return;
            }

            YxClockManager.BeginWaitPlayer(speaker, cd <= 0
                ? App.GetGameData <GangwuGameData>().SpeakCd
                : cd);
        }
Beispiel #3
0
        public void OnWhoSpeak(ISFSObject data)
        {
            var cd          = data.GetInt(JlGameRequestConstKey.KeyCdTime);
            var seat        = data.GetInt(RequestKey.KeySeat);
            var activeCards = data.ContainsKey(JlGameRequestConstKey.KeyActiveCards) ? data.GetIntArray(JlGameRequestConstKey.KeyActiveCards) : null;
            var foldNum     = data.ContainsKey(JlGameRequestConstKey.KeyFoldNum) ? data.GetInt(JlGameRequestConstKey.KeyFoldNum) : -1;
            var handNum     = data.ContainsKey(JlGameRequestConstKey.KeyHandNum) ? data.GetInt(JlGameRequestConstKey.KeyHandNum) : -1;

//            YxDebug.LogArray(activeCards);

            if (cd > 600)
            {
                var count = YxClockManager.WaitPlayerCountDown;
                if (count != null)
                {
                    count.Loop = true;
                }
                cd = _mrcd;
                GetPlayer <JlGamePlayer>(seat, true).SetCountNum(cd, true);
            }
            else
            {
                GetPlayer <JlGamePlayer>(seat, true).SetCountNum(cd);
            }

            YxClockManager.BeginWaitPlayer(seat, cd);


            if (seat == SelfSeat)
            {
                GetPlayer <JlGameSelfPlayer>(SelfSeat, true).FreshHandCard(activeCards);

                EventObj.SendEvent("SoundEvent", "RemindSound",
                                   activeCards != null && activeCards.Length == 0
                        ? new JlGameSound.SoundData(JlGameSound.EnAudio.FoldCard,
                                                    GetPlayerInfo <JlGameUserInfo>(seat, true).SexI)
                        : new JlGameSound.SoundData(JlGameSound.EnAudio.OutCard,
                                                    GetPlayerInfo <JlGameUserInfo>(seat, true).SexI));
            }
            else
            {
                GetPlayer <JlGameSelfPlayer>(SelfSeat, true).NoCanClickCard();
            }

            if (foldNum != -1 && handNum != -1)
            {
                GetPlayer <JlGamePlayer>(seat, true).FreshFoldCardShow(foldNum, handNum);
            }
        }
Beispiel #4
0
        /// <summary>
        /// 显示指定玩家说话
        /// </summary>
        /// <param name="speaker"></param>
        /// <param name="cd"></param>
        /// <param name="waitTime"></param>
        IEnumerator Speaker(int speaker, float cd = -1, float waitTime = 0f)
        {
            yield return(new WaitForSeconds(waitTime));

            var gdata = App.GetGameData <TexasGameData>();

            YxClockManager.BeginWaitPlayer(speaker, cd <= 0 ? gdata.SpeakCd : cd);
            if (speaker == gdata.SelfSeat)
            {
                SpeakMagr.ShowSpeak();
            }
            else
            {
                SpeakMagr.ShowSelfType();
            }
        }
        /// <summary>
        /// 显示指定玩家说话
        /// </summary>
        /// <param name="speaker"></param>
        /// <param name="cd"></param>
        /// <param name="rt"></param>
        public void Speaker(int speaker, float cd = -1, GameRequestType rt = GameRequestType.None)
        {
            var gdata = App.GetGameData <FillpitGameData>();

            if (gdata.GetPlayerInfo(speaker, true) == null)
            {
                YxDebug.Log("座位上没有玩家!");
                return;
            }

            //设置等待
            bool loop = cd > 300;

            cd = loop ? 35 : cd <= 0 ? gdata.SpeakCd : cd;
            YxClockManager.BeginWaitPlayer(speaker, cd, isLoop: loop);

            if (speaker == gdata.SelfSeat)
            {
                SpeakMgr.ShowSpeak(rt);
            }
        }