コード例 #1
0
 public static FixedRewardsMgr Get()
 {
     if (s_instance == null)
     {
         s_instance = new FixedRewardsMgr();
         ApplicationMgr.Get().WillReset += new System.Action(s_instance.WillReset);
     }
     if (!s_instance.m_registeredForAdventureProgressUpdates)
     {
         s_instance.m_registeredForAdventureProgressUpdates = AdventureProgressMgr.Get().RegisterProgressUpdatedListener(new AdventureProgressMgr.AdventureProgressUpdatedCallback(s_instance.OnAdventureProgressUpdate));
     }
     if (!s_instance.m_registeredForProfileNotices)
     {
         NetCache.Get().RegisterNewNoticesListener(new NetCache.DelNewNoticesListener(s_instance.OnNewNotices));
         s_instance.m_registeredForProfileNotices = true;
     }
     if (!s_instance.m_registeredForCompletedAchieves)
     {
         AchieveManager.Get().RegisterNewlyCompletedAchievesListener(new AchieveManager.NewlyAcompletedAchievesCallback(s_instance.OnNewlyCompletedAchieves));
         s_instance.m_registeredForCompletedAchieves = true;
     }
     if (!s_instance.m_registeredForAccountLicenseUpdates)
     {
         AccountLicenseMgr.Get().RegisterAccountLicensesChangedListener(new AccountLicenseMgr.AccountLicensesChangedCallback(s_instance.OnAccountLicensesUpdate));
         s_instance.m_registeredForAccountLicenseUpdates = true;
     }
     return(s_instance);
 }
コード例 #2
0
    public List <CardRewardData> GetCardRewardsForWing(int wing, HashSet <RewardVisualTiming> rewardTimings)
    {
        List <RewardData>     rewardsForWing = FixedRewardsMgr.Get().GetRewardsForWing(wing, rewardTimings);
        List <CardRewardData> list2          = new List <CardRewardData>();

        foreach (RewardData data in rewardsForWing)
        {
            if (data.RewardType == Reward.Type.CARD)
            {
                list2.Add(data as CardRewardData);
            }
        }
        return(list2);
    }
コード例 #3
0
    private void MissingCardDisplay(Actor actor, string cardID, TAG_PREMIUM premium)
    {
        NetCache.CardValue value2;
        int buy = -1;

        NetCache.NetCacheCardValues netObject = NetCache.Get().GetNetObject <NetCache.NetCacheCardValues>();
        NetCache.CardDefinition     key       = new NetCache.CardDefinition {
            Name    = cardID,
            Premium = premium
        };
        if (netObject.Values.TryGetValue(key, out value2))
        {
            buy = value2.Buy;
        }
        long balance = NetCache.Get().GetNetObject <NetCache.NetCacheArcaneDustBalance>().Balance;

        if (((buy > 0) && (buy <= balance)) && FixedRewardsMgr.Get().CanCraftCard(cardID, premium))
        {
            if (!actor.isGhostCard())
            {
                actor.GhostCardEffect(true);
            }
        }
        else
        {
            CollectionManagerDisplay display = CollectionManagerDisplay.Get();
            if (!actor.MissingCardEffect())
            {
                if (premium == TAG_PREMIUM.GOLDEN)
                {
                    actor.OverrideAllMeshMaterials(display.GetGoldenCardNotOwnedMeshMaterial());
                }
                else
                {
                    actor.OverrideAllMeshMaterials(display.GetCardNotOwnedMeshMaterial());
                }
            }
        }
    }
コード例 #4
0
    public List <CardRewardData> GetCardRewardsForDefeatingScenario(int scenarioID, HashSet <RewardVisualTiming> rewardTimings)
    {
        AdventureMission mission;

        if (!this.m_missions.TryGetValue(scenarioID, out mission))
        {
            return(new List <CardRewardData>());
        }
        List <RewardData> list = null;

        if (GameUtils.IsHeroicAdventureMission(scenarioID))
        {
            list = FixedRewardsMgr.Get().GetRewardsForWingFlags(mission.GrantedProgress.Wing, mission.GrantedProgress.Flags, rewardTimings);
        }
        else if (GameUtils.IsClassChallengeMission(scenarioID))
        {
            list = FixedRewardsMgr.Get().GetRewardsForWingFlags(mission.GrantedProgress.Wing, mission.GrantedProgress.Flags, rewardTimings);
        }
        else if (mission.GrantedProgress != null)
        {
            list = FixedRewardsMgr.Get().GetRewardsForWingProgress(mission.GrantedProgress.Wing, mission.GrantedProgress.Progress, rewardTimings);
        }
        List <CardRewardData> list2 = new List <CardRewardData>();

        if (list != null)
        {
            foreach (RewardData data in list)
            {
                if (data.RewardType == Reward.Type.CARD)
                {
                    list2.Add(data as CardRewardData);
                }
            }
        }
        return(list2);
    }