Beispiel #1
0
        private void CleanupExpiredPlayerPerks()
        {
            StaticDataController      staticDataController     = Service.StaticDataController;
            List <ActivatedPerkData>  playerActivatedPerks     = this.GetPlayerActivatedPerks();
            Dictionary <string, uint> playerPerkGroupCooldowns = this.GetPlayerPerkGroupCooldowns();

            ResourceGenerationPerkUtils.ProcessResouceGenPerkEffectsIntoStorage(this.GetPlayerActivatedPerks());
            List <ActivatedPerkData> list = new List <ActivatedPerkData>();
            int i     = 0;
            int count = playerActivatedPerks.Count;

            while (i < count)
            {
                ActivatedPerkData activatedPerkData = playerActivatedPerks[i];
                if (this.IsPerkExpired(activatedPerkData.PerkId))
                {
                    PerkVO perkVO    = staticDataController.Get <PerkVO>(activatedPerkData.PerkId);
                    string perkGroup = perkVO.PerkGroup;
                    if (playerPerkGroupCooldowns.ContainsKey(perkGroup))
                    {
                        playerPerkGroupCooldowns.Remove(perkGroup);
                    }
                    list.Add(playerActivatedPerks[i]);
                }
                i++;
            }
            int j      = 0;
            int count2 = list.Count;

            while (j < count2)
            {
                playerActivatedPerks.Remove(list[j]);
                j++;
            }
        }
Beispiel #2
0
 public unsafe static long $Invoke3(long instance, long *args)
 {
     ResourceGenerationPerkUtils.ProcessResouceGenPerkEffectsIntoStorage((List <ActivatedPerkData>)GCHandledObjects.GCHandleToObject(*args));
     return(-1L);
 }