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; }
public static void PatchedMethod(Achievements.Type type) { AchievementManager.EarnAchivement(type); }
public bool IsEarned(Achievements.Type type) { return(GetByType(type).Earned); }
public Achievement GetByType(Achievements.Type type) { return(Achievements.Find(a => a.Type == type)); }