Exemple #1
0
 /// <summary>
 /// 打枪
 /// </summary>
 /// <param name="someone">打枪的目标人物</param>
 /// <param name="index">打枪的枪号索引</param>
 public void ShootSomeone(SssPlayer someone, int index)
 {
     YxDebug.Log(" ==== 射击的是" + index + "号枪 === ");
     ShootAnim.transform.localEulerAngles = _gunEulers[index];
     ShootAnim.transform.localPosition    = _gunPositions[index];
     ShootAnim.DoShoot(someone);
 }
Exemple #2
0
        IEnumerator DoFaPai(int[] seats)
        {
            var gdata       = App.GetGameData <SssGameData>();
            int seatsLength = seats.Length;
            int pokerCount  = seatsLength * 13;

            while (_pokerCounter < pokerCount && _dealing)
            {
                foreach (int seat in seats)
                {
                    GameObject poker = GetPoker(_pokerCounter + 1);
                    SssPlayer  user  = gdata.GetPlayer <SssPlayer>(seat, true);
                    Facade.Instance <MusicManager>().Play("sendcard");

                    user.UserCardList.Add(poker);
                    poker.transform.parent     = user.PokerParent;
                    poker.transform.localScale = Vector3.one * Scale;
                    MoveCard(poker, poker.transform.localPosition, user.GetTargetPos());
                    RotateCard(poker, new Vector3(0, 0, -70), Vector3.zero);
                    AlphaCard(poker, 0, 1);
                }
                yield return(new WaitForSeconds(SpaceTime));
            }

            //刷新一次扑克的父层级,保证扑克的正确渲染
            for (int i = 0; i < seats.Length; i++)
            {
                Transform parent = gdata.GetPlayer <SssPlayer>(i).PokerParent;
                parent.gameObject.SetActive(false);
                parent.gameObject.SetActive(true);
            }

            //扑克飞到手中再展开
            yield return(new WaitForSeconds(0.3f));

            foreach (int seat in seats)
            {
                SssPlayer user = gdata.GetPlayer <SssPlayer>(seat, true);
                user.Waitting();
                if (user.FinishChoise)
                {
                    user.MoveHandCardWithAnim();
                }
            }

            _dealing = false;
            StopAllCoroutines();
        }
        public void GetHistoryInfo(List <UserMatchInfo> matchInfos)
        {
            var             gdata       = App.GetGameData <SssGameData>();
            HistoryItemInfo historyInfo = new HistoryItemInfo
            {
                Users    = new List <HistoryUserInfo>(),
                RoundVal = gdata.CurRound,
            };

            int bankerSeat = gdata.BankerSeat;

            foreach (UserMatchInfo info in matchInfos)
            {
                SssPlayer user = gdata.GetPlayer <SssPlayer>(info.Seat, true);
                if (user.Info == null)
                {
                    continue;
                }

                HistoryUserInfo userInfo = new HistoryUserInfo();
                userInfo.SssUserInfo = user.GetInfo <SssUserInfo>();
                userInfo.Seat        = user.Info.Seat;
                userInfo.Pokers      = info.Cards.ToArray();
                userInfo.AddScore    = info.AddScore.ToArray();
                userInfo.NormalScore = info.NormalScores.ToArray();
                userInfo.Score       = info.TtScore;
                userInfo.DunType     = info.DunTypeList.ToArray();
                userInfo.Sprcial     = info.Special;
                userInfo.ShootInfo   = info.Shoot;
                userInfo.IsBanker    = gdata.IsBankerModel && bankerSeat == user.Info.Seat;
                historyInfo.Users.Add(userInfo);
            }

            SetGetShootTime(historyInfo.Users);
            HistoryList.Add(historyInfo);

            if (MaxCount == 0)   //如果是0,则不限制个数
            {
                return;
            }

            while (HistoryList.Count > MaxCount)
            {
                HistoryList.Remove(HistoryList[0]);
            }
        }
Exemple #4
0
        /// <summary>
        /// 为一个玩家创建13张牌,无过程
        /// </summary>
        public void FaPai(SssPlayer user)
        {
            int userCardsCount = user.UserCardList.Count;

            //如果玩家手牌够13张,则不需要发牌
            if (userCardsCount >= 13)
            {
                return;
            }

            int diff = 13 - userCardsCount;

            _dealing = false;
            StopAllCoroutines();
            for (int i = 0; i < diff; i++)    //每人补全发牌
            {
                GameObject poker = GetPoker((userCardsCount + i + 1) * 2);
                user.UserCardList.Add(poker);
            }
        }
Exemple #5
0
        public void ResultFlyChips(ISFSObject data)
        {
            var gdata = App.GetGameData <SssGameData>();

            ISFSArray resultArray = data.GetSFSArray("score");

            foreach (ISFSObject result in resultArray)
            {
                int seat = result.GetInt("seat");
                //显示玩家输赢的分数
                int score = result.GetInt("score");

                SssPlayer resultPanel = gdata.GetPlayer <SssPlayer>(seat, true);
                resultPanel.ShowResultLabel(score);

                if (result.ContainsKey("gold"))
                {
                    resultPanel.Coin = result.GetLong("gold");
                    //                    resultPanel.RefreshPanelInfo();
                }

                if (score == 0)
                {
                    continue;
                }

                if (score > 0)
                {
                    WinSeats.Add(seat);
                }
                else
                {
                    LoseSeats.Add(seat);
                }
            }

            DoResult();
        }
Exemple #6
0
 public void Reset()
 {
     gameObject.SetActive(false);
     _targetUser = null;
     OnFinish    = null;
 }
Exemple #7
0
 public void DoShoot(SssPlayer someone)
 {
     _targetUser = someone;
     gameObject.SetActive(true);
 }