Example #1
0
    public override void selectCard(Sevens field)
    {
        if (isGameOut)
        {
            return;
        }
        if (!field.checkPlayNext(this, passes))
        {
            field.gameOver(this);
            field.view();
            Console.WriteLine($"{name}> もうだめ...\n");
            return;
        }

        Console.WriteLine($"【{name}】Cards: {deck.Count} Pass: {passes}");
        var items = new List <string>(deck.Select(v => v.name));

        if (0 < passes)
        {
            items.Add("PS:" + passes);
        }

        Console.Write("考え中...\r");
        System.Threading.Thread.Sleep(1000);

        var passCharge = 0;

        for (;;)
        {
            var cursor = TrumpDeck.rand.Next(items.Count);

            if (0 < passes && items.Count - 1 == cursor)
            {
                if (passCharge < 3)
                {
                    passCharge++;
                    continue;
                }
                passes--;
                Console.WriteLine($"パスー (残り{passes}回)\n");
                break;
            }
            else if (field.tryUseCard(this, deck[cursor]))
            {
                Console.WriteLine($"これでも食らいなっ >「{items[cursor]}」\n");
                if (deck.Count == 0)
                {
                    Console.WriteLine($"{name}> おっさき~\n");
                    field.gameClear(this);
                }
                break;
            }
            else
            {
                continue;
            }
        }
    }
Example #2
0
    public virtual void selectCard(Sevens field)
    {
        if (isGameOut)
        {
            return;
        }
        if (!field.checkPlayNext(this, passes))
        {
            field.gameOver(this);
            field.view();
            Console.WriteLine($"{name} GameOver...\n");
            return;
        }

        Console.WriteLine($"【{name}】Cards: {deck.Count} Pass: {passes}");
        var items = new List <string>(deck.Select(v => v.name));

        if (0 < passes)
        {
            items.Add("PS:" + passes);
        }

        for (;;)
        {
            var cursor = SelectCursors.SelectCursor(items);

            if (0 < passes && items.Count - 1 == cursor)
            {
                passes--;
                field.view();
                Console.WriteLine($"残りパスは{passes}回です。\n");
                break;
            }
            else if (field.tryUseCard(this, deck[cursor]))
            {
                field.view();
                Console.WriteLine($"俺の切り札!! >「{items[cursor]}」\n");
                if (deck.Count == 0)
                {
                    Console.WriteLine($"{name} Congratulations!!\n");
                    field.gameClear(this);
                }
                break;
            }
            else
            {
                Console.WriteLine("そのカードは出せないのじゃ…\n");
                continue;
            }
        }
    }