Exemple #1
0
        private static bool CountDaysWithoutKill(AchievementData ach, object o)
        {
            int num = Mathf.FloorToInt(LocalPlayer.Stats.DaySurvived) - LocalPlayer.Achievements.LastKillSurvivedDays;

            AccountInfo.SetIntStat(ach, num);
            return(num != 0);
        }
Exemple #2
0
 public void TickStat(object o)
 {
     try
     {
         if (!this.Completed)
         {
             if (this.CustomAction != null)
             {
                 if (Achievements.ShowLogs)
                 {
                     Debug.Log(string.Concat(new string[]
                     {
                         "# Doing custom tick action for stat: ",
                         this.StatKey,
                         " [",
                         this.Key,
                         "]"
                     }));
                 }
                 if (!this.CustomAction(this, o))
                 {
                     return;
                 }
             }
             else
             {
                 if (Achievements.ShowLogs)
                 {
                     Debug.Log(string.Concat(new string[]
                     {
                         "# Ticking stat: ",
                         this.StatKey,
                         " [",
                         this.Key,
                         "]"
                     }));
                 }
                 AccountInfo.SetIntStat(this, this.CurrentValue + 1);
             }
         }
         if (this.Completed || AccountInfo.IsAchievementUnlocked(this))
         {
             if (Achievements.ShowLogs)
             {
                 Debug.Log("# Unlocked [" + this.Key + "] after ticking " + this.StatKey);
             }
             this.Completed = true;
             this.Clear();
         }
     }
     catch (Exception exception)
     {
         if (Achievements.ShowExceptions)
         {
             Debug.LogException(exception);
         }
     }
 }
Exemple #3
0
 private static bool DaySurvivedAction(AchievementData ach, object o)
 {
     if (LocalPlayer.Stats)
     {
         AccountInfo.SetIntStat(ach, Mathf.FloorToInt(LocalPlayer.Stats.DaySurvived));
         return(true);
     }
     return(false);
 }
Exemple #4
0
 private static bool IntHighScore(AchievementData ach, object o)
 {
     AccountInfo.SetIntStat(ach, (int)o);
     return(true);
 }