/// <summary> /// 引数の日のおすすめクエストを返す。 /// </summary> /// <param name="time"></param> /// <returns>おすすめクエスト</returns> public static string recommandQuest(DateTime time) { QuestConfig qst = getQuestConfig(time); DateTime epoc = qst.epoch_day; TimeSpan ts = time - epoc; return(qst.quest_names[ts.Days % qst.quest_names.Count]); }
public QuestConfiguraor() { quests = new List <QuestConfig>(); QuestConfig q1 = new QuestConfig(); q1.epoch_day = new DateTime(2018, 5, 31); q1.start_time = new DateTime(2018, 5, 31); q1.quest_names = new List <string>() { "暗影渦巻く壊れた世界", "境界を貫く双角の凶鳥", "混沌導く闇の化身", "混沌産み出す闇の化身", "混沌喚び出す龍の咆哮" }; quests.Add(q1); QuestConfig q2 = new QuestConfig(); q2.epoch_day = new DateTime(2019, 3, 28); q2.start_time = new DateTime(2019, 3, 28); q2.quest_names = new List <string>() { "暗影渦巻く壊れた世界" }; quests.Add(q2); QuestConfig q3 = new QuestConfig(); q3.epoch_day = new DateTime(2018, 5, 31); q3.start_time = new DateTime(2019, 4, 4); q3.quest_names = new List <string>() { "暗影渦巻く壊れた世界", "境界を貫く双角の凶鳥", "混沌導く闇の化身", "混沌産み出す闇の化身", "混沌喚び出す龍の咆哮" }; quests.Add(q3); QuestConfig q4 = new QuestConfig(); q4.epoch_day = new DateTime(2019, 8, 20); q4.start_time = new DateTime(2019, 8, 21); q4.quest_names = new List <string>() { "暗影渦巻く壊れた世界", "平穏を引き裂く混沌", "混沌導く闇の化身", "戦塵を招く魔城の脅威", "静寂に生まれし混沌" }; quests.Add(q4); QuestConfig q5 = new QuestConfig(); q5.epoch_day = new DateTime(2020, 3, 2); q5.start_time = new DateTime(2020, 3, 4); q5.quest_names = new List <string>() { "暗影渦巻く壊れた世界", "平穏を引き裂く混沌", "安寧を破りし超急の魔笛", "戦塵を招く魔城の脅威", "静寂に生まれし混沌" }; quests.Add(q5); }
/// <summary> /// 引数で指定したクエストが発生する一番近い日を探す。 /// その日にクエストが発生場合、次のクエスがが発生する日を返す。 /// </summary> /// <param name="quest"></param> /// <param name="nowDay"></param> /// <returns></returns> public static (int days, DateTime day) nextnextQuest(string quest, DateTime nowDay) { (int d, DateTime time) = nextQuest(quest, nowDay); QuestConfig questconfig = getQuestConfig(nowDay); if (d == 0) { DateTime addOneday = (fixDateTime(nowDay) + new TimeSpan(1, 0, 0, 0)); (int day2, DateTime time2) = nextQuest(quest, addOneday); return(questconfig.quest_names.Count, time2); } else { return(d, time); } }