Beispiel #1
0
        public static int GetProgressiveGoal(this TieredAchievement achievement, Tier tier)
        {
            var goal = 0;

            foreach (var t in TierExtensions.GetAll())
            {
                if (t > tier)
                {
                    break;
                }

                goal += achievement.GetGoal(t);
            }
            return(goal);
        }
Beispiel #2
0
        private void AchievementUnlocked(TieredAchievement achievement, Tier tier)
        {
            BulletinService.Instance.AddBulletin(
                AppText.bulletin_achievement_title,
                $"{achievement.Details().CompletedDescription} {(achievement.GetGoal(tier) > 1 ? $"{achievement.GetGoal(tier)} ganger" : "")}\n\n" +
                $"{achievement.GetUnlockedText(tier)}",
                Images.TieredAchievementCompleteIcon(achievement),
                tier: (int)tier);

            if (!App.IsForeground && Settings.WillSendNotifications)
            {
                var id = (Config.NotificationIdAchievement + ((int)achievement * 10) + (int)tier);
                CrossLocalNotifications.Current.Show(AppText.notification_title, AppText.notification_achievement_unlocked, id);
            }
        }