Ejemplo n.º 1
0
        public void EarnAchivement(Achievements.Type type)
        {
            var achievement = GetByType(type);

            if (!achievement.Earned)
            {
                ModHelper.Console.WriteLine("Earned the " + type + " achievement for the first time! ");
                if (ModHelper.Config.GetSettingsValue <bool>("Enable Enhanced Sound Effects"))
                {
                    int index;
                    do
                    {
                        index = Random.Next(EnhancedSoundEffects.Count);
                    } while (!EnhancedSoundEffectsPlayed.Contains(index) || EnhancedSoundEffectsPlayed.Count >= EnhancedSoundEffects.Count);

                    EnhancedSoundEffects[index].Play();
                    EnhancedSoundEffectsPlayed.Add(index);
                }
                else
                {
                    StandardSoundEffect.Play();
                }
            }
            else
            {
                ModHelper.Console.WriteLine("Earned the " + type + " achievement! But not for the first time.");
            }

            achievement.Earned = true;
        }
Ejemplo n.º 2
0
 public static void PatchedMethod(Achievements.Type type)
 {
     AchievementManager.EarnAchivement(type);
 }
Ejemplo n.º 3
0
 public bool IsEarned(Achievements.Type type)
 {
     return(GetByType(type).Earned);
 }
Ejemplo n.º 4
0
 public Achievement GetByType(Achievements.Type type)
 {
     return(Achievements.Find(a => a.Type == type));
 }