Esempio n. 1
0
    // Update is called once per frame
    private bool UpdateCheck()
    {
        bool update = false;

        //check boost field
        if (BoostField.GetNumberOfCards() > 0)
        {
            boostMultiplier = 2;
            update          = true;
        }
        weatherCards = WeatherField.GetCardsInCardPile();
        foreach (GameObject card in weatherCards)
        {
            if (WeatherType == card.GetComponent <SpecialUnitCard>().GetUnitAbilityType())
            {
                weatherCardActive = true;
                update            = true;
                break;
            }
        }
        if (cardsInPile != UnitField.GetNumberOfCards() || update)
        {
            cardsInPile = UnitField.GetNumberOfCards();
            return(true);
        }
        else
        {
            return(false);
        }
    }
Esempio n. 2
0
    private void UpdateCounter()
    {
        int[]             cardsPower = new int[cardsInPile];
        List <GameObject> cards      = UnitField.GetCardsInCardPile();
        int index = 0;
        int sum   = 0;

        foreach (GameObject card in cards)
        {
            cardsPower[index] = card.GetComponent <CQBCard>().GetCurrentPower();
            index++;
        }
        if (weatherCardActive)
        {
            for (int i = 0; i < cardsInPile; i++)
            {
                cardsPower[i] = (cardsPower[i] / cardsPower[i]) * boostMultiplier;
                sum          += cardsPower[i];
            }
        }
        else
        {
            for (int i = 0; i < cardsInPile; i++)
            {
                cardsPower[i] *= boostMultiplier;
                sum           += cardsPower[i];
            }
        }
        this.pileTotal = sum;
    }
Esempio n. 3
0
    void Reset()
    {
        GameObject Outcome = GameObject.Find("Outcome");
        CardPile   Player  = GameObject.Find("Player Melee Field").GetComponentInChildren <CardPile>();
        CardPile   Enemy   = GameObject.Find("Enemy Melee Field").GetComponentInChildren <CardPile>();

        List <GameObject> cardpile = Player.GetCardsInCardPile();

        foreach (GameObject card in cardpile)
        {
        }
    }