Esempio n. 1
0
    /// <summary>
    /// 播放玩家操作提示
    /// </summary>
    /// <param name="playerAct"></param>
    private void PlayAct(PlayerActType playerAct)
    {
        var selfInfoVO      = battleProxy.playerIdInfoDic[playerInfoProxy.userID];
        var actPlayerInfoVO = battleProxy.playerIdInfoDic[battleProxy.GetPlayerActS2C().userId];
        var actIndex        = (actPlayerInfoVO.sit - selfInfoVO.sit + GlobalData.SIT_NUM) % GlobalData.SIT_NUM;

        if (actIndex != 0)
        {
            View.headItemList[actIndex].GetComponent <HeadItem>().PlayAct(playerAct);
        }
        if (actIndex == 0)
        {
            View.operateView.HidenPlayActTip();
            View.headItemList[actIndex].GetComponent <HeadItem>().BaoIcon(playerAct);
        }
        else if (playerAct != PlayerActType.PASS && !battleProxy.huTypes.Contains(playerAct))
        {
            View.operateView.HidenPlayActTip();
        }
        if (playerAct == PlayerActType.CHI_HU || playerAct == PlayerActType.QIANG_AN_GANG_HU ||
            playerAct == PlayerActType.QIANG_PENG_GANG_HU || playerAct == PlayerActType.QIANG_ZHI_GANG_HU ||
            playerAct == PlayerActType.SELF_HU)
        {
            for (int i = 0; i < 4; i++)
            {
                View.headItemList[i].GetComponent <HeadItem>().baoImg.gameObject.SetActive(false);
            }
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 显示玩家操作提示
    /// </summary>
    public void ShowPlayActTip()
    {
        gameObject.GetComponent <Animator>().Stop();
        var             selfInfoVO  = battleProxy.playerIdInfoDic[playerInfoProxy.userID];
        PlayerInfoVOS2C tipPlayerVO = null;

        if (battleProxy.GetPlayerActTipS2C() == null && battleProxy.GetPlayerActS2C() == null)
        {
            return;
        }
        if (battleProxy.curGuide == GuideType.ACT_TIP)
        {
            tipPlayerVO = battleProxy.playerIdInfoDic[battleProxy.GetPlayerActTipS2C().optUserId];
            bool isPengGang = false;
            foreach (PlayerActType item in battleProxy.hidenActTypes)
            {
                if (battleProxy.GetPlayerActTipS2C().acts.Contains(item))
                {
                    isPengGang = true;
                    break;
                }
            }
            if (isPengGang && battleProxy.playerIdInfoDic.ContainsKey(battleProxy.GetPlayerActTipS2C().targetUserId))
            {
                tipPlayerVO = battleProxy.playerIdInfoDic[battleProxy.GetPlayerActTipS2C().targetUserId];
                //var nextSitId = GlobalData.GetNextSit(tipPlayerVO.sit, 1);
                //tipPlayerVO = battleProxy.playerSitInfoDic[nextSitId];
            }
        }
        else if (battleProxy.curGuide == GuideType.ACT)
        {
            tipPlayerVO = battleProxy.playerIdInfoDic[battleProxy.GetPlayerActS2C().userId];
            if (battleProxy.GetPlayerActS2C().act == PlayerActType.PASS)
            {
                return;
            }
        }
        if (tipPlayerVO == null)
        {
            return;
        }
        var sitIndex = (tipPlayerVO.sit - selfInfoVO.sit + GlobalData.SIT_NUM) % GlobalData.SIT_NUM;

        arrowContainer.localEulerAngles = new Vector3(0, 0, 180 + sitIndex * 90);
        arrowIcon.color  = Color.white;
        masterIcon.color = new Color(1, 1, 1, 0);
        remainTimeId     = Timer.Instance.AddDeltaTimer(1, 0, 1, UpdateTipRemain);
        remainTimeTxt.gameObject.SetActive(true);
        UpdateTipRemain();
    }
Esempio n. 3
0
    /// <summary>
    /// 播放直接暗杠
    /// </summary>
    public void PlayCommonAnGang()
    {
        List <GameObject> gangCards = new List <GameObject>();

        if (getCard != null)
        {
            gangCards.Add(getCard);
            getCard.transform.DOKill();
        }
        getCard = null;
        if (_data.userId == playerInfoProxy.userID || battleProxy.isReport)//自己暗杠找到真正的牌暗杠
        {
            for (int i = 0; i < handCards.Count;)
            {
                if (BattleAreaUtil.GetMeshCardValue(handCards[i]) == battleProxy.GetPlayerActS2C().actCard)
                {
                    gangCards.Add(handCards[i]);
                    handCards.RemoveAt(i);
                }
                else
                {
                    i++;
                }
            }
        }
        else//不是自己暗杠随机找牌暗杠
        {
            var randomIndex = UnityEngine.Random.Range(0, handCards.Count - 3);
            gangCards.Add(handCards[randomIndex]);
            gangCards.Add(handCards[randomIndex + 1]);
            gangCards.Add(handCards[randomIndex + 2]);
            handCards.RemoveAt(randomIndex);
            handCards.RemoveAt(randomIndex);
            handCards.RemoveAt(randomIndex);
            foreach (GameObject gangCard in gangCards)
            {
                ResourcesMgr.Instance.SetCardMesh(gangCard, battleProxy.GetPlayerActS2C().actCard);
            }
        }
        foreach (GameObject card in gangCards)
        {
            card.transform.SetParent(pengGangCardContainer);
        }
        pengGangCards.Add(gangCards);
        BattleAreaUtil.ResortCard(this);
    }
Esempio n. 4
0
    /// <summary>
    /// 手牌 变灰-正常
    /// </summary>
    /// <param name="card"></param>
    private void SetCardColor(List <int> card, bool isGray)
    {
        var selfInfoVO      = battleProxy.playerIdInfoDic[playerInfoProxy.userID];
        var actPlayerInfoVO = battleProxy.playerIdInfoDic[battleProxy.GetPlayerActS2C().userId];
        var actIndex        = (actPlayerInfoVO.sit - selfInfoVO.sit + GlobalData.SIT_NUM) % GlobalData.SIT_NUM;

        if (isGray)
        {
            View.battleAreaItems[actIndex].SetHandCardsGray(card, false);
            PlayerPrefs.SetInt(battleProxy.GetPlayerActS2C().userId.ToString(), 1);
        }
        else
        {
            View.battleAreaItems[actIndex].RecoveryHandCardsColor();
            PlayerPrefs.SetInt(battleProxy.GetPlayerActS2C().userId.ToString(), 0);
        }
    }