Ejemplo n.º 1
0
    public void HitPlay()
    {
        SetTime(false);

        var temp = CardArithmetic.AutoPlay(mCardData, ControllerManage.Instance.mCombatController.mPlayCard);

        if (temp == null)
        {
            mPass.SetActive(true);
            ControllerManage.Instance.mCombatController.mPlayCard.Play();
            return;
        }
        for (int i = 0; i < temp.Count; i++)
        {
            mCardData.Remove(temp[i]);
            mCardList[i].SetData(temp[i]);
        }
        SetCount(mCardData.Count);
        if (mCardData.Count == 0)
        {
            EventManage.Instance.Broadcast(EventEnum.combat, "over");
            return;
        }
        ControllerManage.Instance.mCombatController.mPlayCard.Play(temp);
    }
Ejemplo n.º 2
0
    private void Processor2PlayCard()
    {
        if (mPlayCard == null)
        {
            mPlayCard = new PlayCard();
        }
        Player   playPlayer   = mPlayCard.player.GetComponent <Player>();;
        PlayerAI playPlayerAI = mPlayCard.player.GetComponent <PlayerAI>();

        //出牌
        if (mPlayCard.cardDataListToPlayer == null || mPlayCard.player == mPlayCard.cardDataListToPlayer)
        {
            if (playPlayer != null)
            {
                Debug.LogError("出牌:" + playPlayer.gameObject);
                playPlayer.PlayCardInit();
                playPlayer.mPlay.SetActive(true);
            }
            else if (playPlayerAI != null)
            {
                Debug.LogError("出牌:" + playPlayerAI.gameObject);
                playPlayerAI.mPass.SetActive(false);
                for (int i = 0; i < playPlayerAI.mCardList.Count; i++)
                {
                    playPlayerAI.mCardList[i].gameObject.SetActive(false);
                }
                playPlayerAI.SetTime(true);
                mTimerTask.Add(TimeManage.Instance.AddTimerTask(playPlayerAI.Play, Random.Range(1.4f, 3.4f)));
            }
        }
        else//打牌
        {
            if (playPlayer != null)
            {
                Debug.LogError("打牌:" + playPlayer.gameObject);
                playPlayer.PlayCardInit();
                if (CardArithmetic.AutoPlay(mCombatView.mPlayer.mCardData, mPlayCard) == null)
                {
                    playPlayer.mPass.SetActive(true);
                }
                else
                {
                    playPlayer.mAct.SetActive(true);
                }
            }
            else if (playPlayerAI != null)
            {
                Debug.LogError("打牌:" + playPlayerAI.gameObject);
                playPlayerAI.mPass.SetActive(false);
                for (int i = 0; i < playPlayerAI.mCardList.Count; i++)
                {
                    playPlayerAI.mCardList[i].gameObject.SetActive(false);
                }
                playPlayerAI.SetTime(true);
                mTimerTask.Add(TimeManage.Instance.AddTimerTask(playPlayerAI.HitPlay, Random.Range(1.4f, 3.4f)));
            }
        }
    }
Ejemplo n.º 3
0
    private void TipsPlay()
    {
        for (int i = 0; i < mCardList.Count; i++)
        {
            mCardList[i].transform.localPosition = new Vector3(mCardList[i].transform.localPosition.x, 0, 0);
        }
        var tips = CardArithmetic.AutoPlay(mCardData, ControllerManage.Instance.mCombatController.mPlayCard);

        for (int i = 0; i < mCardList.Count; i++)
        {
            for (int j = 0; j < tips.Count; j++)
            {
                if (tips[j] == mCardList[i].data)
                {
                    mCardList[i].transform.localPosition = new Vector3(mCardList[i].transform.localPosition.x, 24, 0);
                }
            }
        }
    }