Ejemplo n.º 1
0
    /// <summary>
    /// 全てのプレイヤーは最下位と同じ枚数になるように
    /// 捨て場にカードを置く(山札計10枚以上)
    /// </summary>
    public void PlayerSkill3()
    {
        int v = 100; //枚数比較用
        int s = 0;   //一番少ない人

        for (int i = 0; i < 4; i++)
        {
            if (v >= MasterList.instance.list[i].Count)
            {
                v = MasterList.instance.list[i].Count;
                s = i;
            }
        }

        Debug.Log("最小枚数は" + v);


        if (MasterList.instance.list[0].Count +
            MasterList.instance.list[1].Count +
            MasterList.instance.list[2].Count +
            MasterList.instance.list[3].Count == 0)
        {
            EPanel();
        }
        else
        {
            int h;
            for (int i = s + 1; i < s + 4; i++)
            {
                h = i % 4;
                Debug.Log(h + "player");
                int d = MasterList.instance.list[h].Count;

                //スキルを使った人以外の手札を捨て札に加算
                for (int t = 0; t < (d - v); t++)
                {
                    int y = MasterList.instance.list[h][0];
                    deck.DiscardCount.Add(y);
                    MasterList.instance.list[h].RemoveAt(0);
                }
                if (MasterList.instance.list[h].Count > v)
                {
                    cardAnime.skillDamagePlayer = h;
                }
                Debug.Log("Player" + (h + 1) + "がスキル対象で" + (d - v) + "枚捨てた");
            }
            cardAnime.skillPlayer = s;
            draw.TextChange();
            cardAnime.AnimePlayerSkill3();
        }
    }