using RadicadeServer.RecNet.Enums.Challenges; using RadicadeServer.RecNet.Progression.Objectives; namespace Rubidium2018.Utils.Objectives { public class RbPresetDailys : RbObjective { private static ObjectiveTypes[] DisallowedTypes = { ObjectiveTypes.AllDailyObjectives, ObjectiveTypes.FirstSessionOfDay, ObjectiveTypes.NUX_AllPunchcardObjectives, ObjectiveTypes.NUX_PunchcardObjective, ObjectiveTypes.DailyObjective3, ObjectiveTypes.DailyObjective2, ObjectiveTypes.DailyObjective1, ObjectiveTypes.OOBE_GoToActivity, ObjectiveTypes.OOBE_GoToLockerRoom, ObjectiveTypes.OOBE_FinishActivity, ObjectiveTypes.CreateACustomRoom, ObjectiveTypes.Default }; private static ObjectiveTypes[] AllowedTypes() { var allowed = Enum.GetValues(typeof(ObjectiveTypes)).Cast().Where(o => !DisallowedTypes.Contains(o)).ToArray(); return allowed; } public static ObjectiveTypes GetRandomObjectiveTypes() { var allowed = AllowedTypes(); return allowed[Random.Shared.Next(allowed.Length)]; } public static Objective CreateRandomObjective() { var ObjectiveTypes = GetRandomObjectiveTypes(); return new Objective { type = ObjectiveTypes, score = ((int)ObjectiveTypes >= 100) ? 3 : 1, xp = 200 }; } } }