public void startStageWeaponSetup()
 {
     if (Object.ReferenceEquals(activeQuest.getStage(activeQuest.getCurrentStageNum()).GetType(), typeof(Test)))
     {
         if (activeQuest.getCurrentStageNum() == activeQuest.getStageNum())
         {
             endStageWeaponSetup(null);
         }
         else
         {
             //activeQuest.setStage(getCurrentStageNum+1);
             endStageWeaponSetup(null);
             return;
         }
     }
     else
     {
         userInputState = state.ASKINGFORSTAGEWEAPONS;
         ui.askForCards(
             activeQuest.getSponsor(),
             activeQuest,
             GameState.state.ASKINGFORSTAGEWEAPONS,
             "Select weapons to enhance this stage",
             "Done",
             "null",
             false,
             true,
             false,
             false,
             false,
             false
             );
         ui.showCard(activeQuest.getCurrentStage());
     }
 }
Exemplo n.º 2
0
    public void foeReveal(ActiveQuest activeQuest)
    {
        if (enemyBP == null)
        {
            enemyBP = createHeaderMessage(panelPosX + panelWidth / 3, panelHeight / 2, new Vector3(0, 0, 0), " ");
        }
        Destroy(playerBP);
        clearGameObjectArray(cardsToShow);
        clearGameObjectArray(currButtons);
        showCards(activeQuest.getStageWeapons(activeQuest.getCurrentStageNum()), new Vector2(panelPosX + panelWidth / 10, panelPosY), new Vector2(10, 10));
        showCard(activeQuest.getCurrentStage());



        stageWinners    = new GameObject[activeQuest.getPlayerNum() + 1];
        stageWinners[0] = createHeaderMessage(panelPosX - panelWidth / 3, panelHeight / 2, new Vector3(0, 0, 0), "Winners");
        createButtonMessage(panelPosX, panelPosY - panelHeight / 10, "OK");
        for (int i = 1; i < activeQuest.getPlayerNum() + 1; i++)
        {
            stageWinners[i] = createHeaderMessage(panelPosX - panelWidth / 3, panelHeight / 2 - i * (panelHeight / 15), new Vector3(0, 0, 0), activeQuest.getPlayer(i - 1).getName());
        }
    }
    //AI submits cards for current quest stage (as a player).
    public override Card[] playQuestStage(ActiveQuest quest)
    {
        if (quest.getCurrentStage().getType().Equals("test"))
        {
            return(nextBid(quest));
        }
        Card[] submit   = null;
        int    BPhurdle = 0;

        int count = 0;

        //hand = sortHand ();
        //hand = sortHandByType ();

        Card [] weaponHand = getOnlyType("weapon");
        weaponHand = sortHand(weaponHand);

        Card [] amourHand = getOnlyType("amour");
        amourHand = sortHand(amourHand);

        Card [] allyHand = getOnlyType("ally");
        allyHand = sortHand(allyHand);


        int bp = 0;

        BPhurdle = quest.getCurrentStageNum() + 1 * 10;
        if (amourHand != null)
        {
            for (int i = 0; i < amourHand.Length; i++)
            {
                if (bp >= BPhurdle)
                {
                    player.discardCard(submit);
                    return(submit);
                }
                submit = hp.addCard(submit, amourHand[i]);
                if (quest.getCurrentStageNum() < quest.getStageNum() - 1)
                {
                    bp = bp + amourHand[i].getBP();
                }
            }
        }
        if (allyHand != null)
        {
            for (int i = 0; i < allyHand.Length; i++)
            {
                if (bp >= BPhurdle)
                {
                    player.discardCard(submit);
                    return(submit);
                }
                submit = hp.addCard(submit, allyHand[i]);
                if (quest.getCurrentStageNum() < quest.getStageNum() - 1)
                {
                    bp = bp + allyHand[i].getBP();
                }
            }
        }
        if (weaponHand != null)
        {
            for (int i = 0; i < weaponHand.Length; i++)
            {
                if (bp >= BPhurdle)
                {
                    player.discardCard(submit);
                    return(submit);
                }
                if (!hp.checkIfArrayContainsCard(submit, weaponHand[i]))
                {
                    submit = hp.addCard(submit, weaponHand[i]);
                    if (quest.getCurrentStageNum() < quest.getStageNum() - 1)
                    {
                        bp = bp + weaponHand[i].getBP();
                    }
                }
            }
        }
        player.discardCard(submit);
        return(submit);
    }