Beispiel #1
0
    //=====================================================

    public static ChestReward GetChestReward(eChestType type,
                                             eTradingCardClassification cardClassification,
                                             eTradingCardRarity cardRarity,
                                             eTradingCardCondition cardCondition)
    {
        var reward = new ChestReward();

        var rewardCard = (type == eChestType.LARGE &&
                          cardClassification != eTradingCardClassification.NULL &&
                          cardRarity != eTradingCardRarity.NULL);

        // 50% chance of awarding a card or gem
        if (rewardCard == false && Random.Range(0, 99) % 2 == 0)
        {
            rewardCard = true;
        }

        if (rewardCard == true)
        {
            reward.Card          = TradingCardItemsManager.GetCard(type, cardClassification, cardRarity, cardCondition);
            reward.CardCondition = cardCondition;
            //Debug.Log( "SceneManager: Reward card" );
        }
        else
        {
            // Small, medium or large number of gems
            var maxGems = Convert.ToInt32(SettingsManager.GetSettingsItem("AWARD_GEMS_CHEST_" + type, -1));

            reward.Gems = Random.Range(maxGems / 2, maxGems);
            //Debug.Log( "SceneManager: Reward gems" );
        }

        return(reward);
    }
Beispiel #2
0
    //=====================================================
    // Returns common card from randomly selected card classification
    public static TradingCardSpreadsheetItem GetNPCReward()
    {
        var classification = (eTradingCardClassification)Random.Range(1, (int)eTradingCardClassification.NUM_ITEMS);

        return(TradingCardItemsManager.GetCard(eChestType.SMALL, classification, eTradingCardRarity.COMMON, eTradingCardCondition.MINT));
    }