Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using AssetHolder;
- using data;
- using GameScene.scene;
- using Scream.Api;
- namespace GameUI.dialog
- {
- // Token: 0x020009CE RID: 2510
- public static class ItemGetFunction
- {
- // Token: 0x06004196 RID: 16790 RVA: 0x00132D64 File Offset: 0x00131164
- public static ItemGetBaseData GetSearchItem(List<item_get_correlation.Data> searchCorreelationList, List<int> activeEventGroupList = null, ItemGetFunction.ItemStoryType storyType = ItemGetFunction.ItemStoryType.Invalid)
- {
- if (searchCorreelationList.Count == 0)
- {
- return null;
- }
- ItemGetBaseData itemGetBaseData = null;
- for (int i = 0; i < searchCorreelationList.Count; i++)
- {
- item_get_correlation.Data data = searchCorreelationList[i];
- if (data.mode == "0")
- {
- itemGetBaseData = ItemGetFunction.Story(data, activeEventGroupList, storyType);
- }
- if (itemGetBaseData != null)
- {
- break;
- }
- }
- return itemGetBaseData;
- }
- // Token: 0x06004197 RID: 16791 RVA: 0x00132DCC File Offset: 0x001311CC
- public static bool JumpScene(ItemGetBaseData data, List<object> parameter)
- {
- ItemGetFunction.<JumpScene>c__AnonStorey2 <JumpScene>c__AnonStorey = new ItemGetFunction.<JumpScene>c__AnonStorey2();
- <JumpScene>c__AnonStorey.parameter = parameter;
- if (data == null)
- {
- return false;
- }
- ItemGetFunction.ItemModeType type = data.type;
- if (type == ItemGetFunction.ItemModeType.Invalid)
- {
- throw new Exception("モードが未設定");
- }
- if (type != ItemGetFunction.ItemModeType.Story)
- {
- throw new Exception("モードが未設定");
- }
- ItemGetStoryData tmpStoryData = data as ItemGetStoryData;
- ItemGetFunction.ItemStoryType story_type = tmpStoryData.story_type;
- if (story_type == ItemGetFunction.ItemStoryType.Invalid)
- {
- throw new Exception("ストーリータイプが未設定");
- }
- if (story_type != ItemGetFunction.ItemStoryType.Main)
- {
- if (story_type != ItemGetFunction.ItemStoryType.Event)
- {
- return false;
- }
- SingletonMonoBehaviour<SceneRoot>.Instance.ChangeInstantScene("StoryDetail", delegate
- {
- StoryDetail component = SingletonMonoBehaviour<SceneRoot>.Instance.activeScene.GetComponent<StoryDetail>();
- component.SettingEvent((DifficultyType)tmpStoryData.story_master_data.difficulty_type, tmpStoryData.story_event_group.story_event_group_id, (int)tmpStoryData.story_event_group.story_event_episode_id, <JumpScene>c__AnonStorey.parameter);
- }, null, SceneRoot.SceneChangeProductionType.None);
- return true;
- }
- else
- {
- StoryFunction.Number number = StoryFunction.Number.CreateMain(tmpStoryData.story_main_data, (DifficultyType)tmpStoryData.story_master_data.difficulty_type);
- if (!StoryFunction.GetIsUnlock(number))
- {
- SingletonMonoBehaviour<SceneRoot>.Instance.OpenScene("CommonDialog", delegate
- {
- game_mode_unlock_master game_mode_unlock_master = SingletonMonoBehaviour<DataBaseRoot>.Instance.MasterData.original.game_mode_unlock_master;
- LanguageMasterData languageMasterData = SingletonMonoBehaviour<AssetHolderRoot>.Instance.commonHolder.GetLanguageMasterData();
- LanguageData data2 = languageMasterData.GetData(LanguageMasterData.Kind.COM);
- string text = data2.GetInfo(9103).text;
- CommonDialog component = SingletonMonoBehaviour<SceneRoot>.Instance.piledScene.GetComponent<CommonDialog>();
- component.SetupNotice(text, null);
- }, null, null, true, SceneRoot.SceneChangeProductionType.None, SceneRoot.FadePattern.Default);
- return false;
- }
- SingletonMonoBehaviour<SceneRoot>.Instance.ChangeInstantScene("StoryDetail", delegate
- {
- StoryDetail component = SingletonMonoBehaviour<SceneRoot>.Instance.activeScene.GetComponent<StoryDetail>();
- component.SettingMain((DifficultyType)tmpStoryData.story_master_data.difficulty_type, (int)tmpStoryData.story_main_data.story_part_id, (int)tmpStoryData.story_main_data.story_chapter_id, (int)tmpStoryData.story_main_data.story_episode_id, tmpStoryData.is_latest_story, <JumpScene>c__AnonStorey.parameter);
- }, null, SceneRoot.SceneChangeProductionType.None);
- return true;
- }
- }
- // Token: 0x06004198 RID: 16792 RVA: 0x00132F08 File Offset: 0x00131308
- public static IEnumerator GetEventGroup(Action<List<int>> finish)
- {
- List<int> tmpEventGroupList = new List<int>();
- byte storyType = 2;
- yield return SingletonMonoBehaviour<SceneRoot>.Instance.DownloadStoryInfoList(storyType, false, true);
- List<StoryInfo> list = SingletonMonoBehaviour<UserDataRoot>.Instance.UserData.Story.GetStoryInfoList(storyType);
- for (int i = 0; i < list.Count; i++)
- {
- tmpEventGroupList.Add(list[i].StoryGroupId);
- }
- finish(tmpEventGroupList);
- yield break;
- }
- // Token: 0x06004199 RID: 16793 RVA: 0x00132F24 File Offset: 0x00131324
- private static ItemGetStoryData Story(item_get_correlation.Data searchItemCorrelation, List<int> activeEventGroupList, ItemGetFunction.ItemStoryType storyType)
- {
- story_master story_master = SingletonMonoBehaviour<DataBaseRoot>.Instance.MasterData.original.story_master;
- story_master.Data data4 = story_master.data.Find((story_master.Data data) => data.story_master_id == searchItemCorrelation.story_id);
- if (data4 == null)
- {
- return null;
- }
- if (storyType == ItemGetFunction.ItemStoryType.Invalid || storyType == ItemGetFunction.ItemStoryType.Main)
- {
- bool lastStory = false;
- story_main.Data data2 = ItemGetFunction.MainStory(data4, out lastStory);
- if (data2 != null)
- {
- return new ItemGetStoryData(data4, data2, lastStory);
- }
- }
- if (storyType == ItemGetFunction.ItemStoryType.Invalid || storyType == ItemGetFunction.ItemStoryType.Event)
- {
- story_event_group.Data data3 = ItemGetFunction.EventStory(data4, activeEventGroupList);
- if (data3 != null)
- {
- return new ItemGetStoryData(data4, data3, false);
- }
- }
- return null;
- }
- // Token: 0x0600419A RID: 16794 RVA: 0x00132FC8 File Offset: 0x001313C8
- private static story_main.Data MainStory(story_master.Data searchItemStoryMaster, out bool isLatestStory)
- {
- story_master story_master = SingletonMonoBehaviour<DataBaseRoot>.Instance.MasterData.original.story_master;
- story_main story_main = SingletonMonoBehaviour<DataBaseRoot>.Instance.MasterData.original.story_main;
- isLatestStory = false;
- story_main.Data data3 = story_main.data.Find(delegate(story_main.Data data)
- {
- int story_master_id = searchItemStoryMaster.story_master_id;
- return data.story_master_normal_id == story_master_id || data.story_master_hard_id == story_master_id || data.story_master_scream_id == story_master_id || data.story_master_despair_id == story_master_id;
- });
- if (data3 == null)
- {
- return null;
- }
- StoryFunction.Number number = StoryFunction.Number.CreateMain(data3, (DifficultyType)searchItemStoryMaster.difficulty_type);
- if (!StoryFunction.GetIsUnlock(number))
- {
- return null;
- }
- StoryFunction.PlayableProgress playableProgress = StoryFunction.GetPlayableProgress(searchItemStoryMaster.story_master_id);
- if (playableProgress != null && !playableProgress.isAchived)
- {
- return null;
- }
- UserData.StoryData.StatusData statusData = SingletonMonoBehaviour<UserDataRoot>.Instance.UserData.Story.Status.Find((UserData.StoryData.StatusData data) => data.StoryId == searchItemStoryMaster.story_master_id);
- isLatestStory = (statusData == null);
- if (statusData != null)
- {
- return data3;
- }
- List<UserData.StoryData.StatusData> tmpUserClearStoryList = SingletonMonoBehaviour<UserDataRoot>.Instance.UserData.Story.Status.FindAll((UserData.StoryData.StatusData data) => data.StoryType == 0);
- tmpUserClearStoryList.Sort((UserData.StoryData.StatusData a, UserData.StoryData.StatusData b) => b.StoryId - a.StoryId);
- if (tmpUserClearStoryList.Count == 0)
- {
- if (searchItemStoryMaster.difficulty_type != 0 || data3.id != 1)
- {
- return null;
- }
- return data3;
- }
- else
- {
- story_master.Data tmpUserClearStory = story_master.data.Find((story_master.Data data) => data.story_master_id == tmpUserClearStoryList[0].StoryId);
- story_main.Data data2 = story_main.data.Find(delegate(story_main.Data data)
- {
- int story_master_id = tmpUserClearStory.story_master_id;
- return data.story_master_normal_id == story_master_id || data.story_master_hard_id == story_master_id || data.story_master_scream_id == story_master_id || data.story_master_despair_id == story_master_id;
- });
- if (data2 == null)
- {
- return null;
- }
- int num = data3.id - data2.id;
- if (num > 1)
- {
- return null;
- }
- if (num == 0)
- {
- isLatestStory = false;
- int num2 = (int)(searchItemStoryMaster.difficulty_type - tmpUserClearStory.difficulty_type);
- if (num2 > 1)
- {
- return null;
- }
- }
- else if (num == 1 && searchItemStoryMaster.difficulty_type != 0)
- {
- return null;
- }
- return data3;
- }
- }
- // Token: 0x0600419B RID: 16795 RVA: 0x001331F4 File Offset: 0x001315F4
- private static story_event_group.Data EventStory(story_master.Data searchItemStoryMaster, List<int> activeEventGroupList)
- {
- if (activeEventGroupList == null || activeEventGroupList.Count == 0)
- {
- return null;
- }
- story_master story_master = SingletonMonoBehaviour<DataBaseRoot>.Instance.MasterData.original.story_master;
- story_event_group story_event_group = SingletonMonoBehaviour<DataBaseRoot>.Instance.MasterData.original.story_event_group;
- story_event_group.Data tmpActiveEventGroup = story_event_group.data.Find(delegate(story_event_group.Data data)
- {
- bool flag = data.story_event_story_master_normal_id == searchItemStoryMaster.story_master_id || data.story_event_story_master_hard_id == searchItemStoryMaster.story_master_id || data.story_event_story_master_scream_id == searchItemStoryMaster.story_master_id || data.story_event_story_master_despair_id == searchItemStoryMaster.story_master_id;
- return activeEventGroupList.Contains(data.story_event_group_id) && flag;
- });
- if (tmpActiveEventGroup == null)
- {
- return null;
- }
- StoryFunction.Number number = StoryFunction.Number.CreateEvent(tmpActiveEventGroup, (DifficultyType)searchItemStoryMaster.difficulty_type);
- if (!StoryFunction.GetIsUnlock(number))
- {
- return null;
- }
- StoryFunction.PlayableProgress playableProgress = StoryFunction.GetPlayableProgress(searchItemStoryMaster.story_master_id);
- if (playableProgress != null && !playableProgress.isAchived)
- {
- return null;
- }
- List<story_event_group.Data> list = story_event_group.data.FindAll((story_event_group.Data data) => tmpActiveEventGroup.story_event_group_id == data.story_event_group_id);
- list.Sort((story_event_group.Data a, story_event_group.Data b) => (int)(a.story_event_episode_id - b.story_event_episode_id));
- UserData.StoryData.StatusData statusData = SingletonMonoBehaviour<UserDataRoot>.Instance.UserData.Story.Status.Find((UserData.StoryData.StatusData data) => data.StoryId == searchItemStoryMaster.story_master_id && activeEventGroupList.Contains(data.GroupId));
- if (statusData != null)
- {
- return tmpActiveEventGroup;
- }
- List<UserData.StoryData.StatusData> tmpUserClearStoryList = SingletonMonoBehaviour<UserDataRoot>.Instance.UserData.Story.Status.FindAll((UserData.StoryData.StatusData data) => data.StoryType == 2 && data.GroupId == tmpActiveEventGroup.story_event_group_id);
- tmpUserClearStoryList.Sort((UserData.StoryData.StatusData a, UserData.StoryData.StatusData b) => a.StoryId - b.StoryId);
- if (tmpUserClearStoryList.Count == 0)
- {
- if (searchItemStoryMaster.difficulty_type != 0 || tmpActiveEventGroup.story_event_episode_id != list[0].story_event_episode_id)
- {
- return null;
- }
- return tmpActiveEventGroup;
- }
- else
- {
- story_master.Data data3 = story_master.data.Find((story_master.Data data) => data.story_master_id == tmpUserClearStoryList[0].StoryId);
- story_event_group.Data data2 = list.Find(delegate(story_event_group.Data data)
- {
- int storyId = tmpUserClearStoryList[0].StoryId;
- return data.story_event_story_master_normal_id == searchItemStoryMaster.story_master_id || data.story_event_story_master_hard_id == searchItemStoryMaster.story_master_id || data.story_event_story_master_scream_id == searchItemStoryMaster.story_master_id || data.story_event_story_master_despair_id == searchItemStoryMaster.story_master_id;
- });
- if (data2 == null)
- {
- return null;
- }
- int num = tmpActiveEventGroup.id - data2.id;
- if (num > 1)
- {
- return null;
- }
- if (num == 0)
- {
- int num2 = (int)(searchItemStoryMaster.difficulty_type - data3.difficulty_type);
- if (num2 > 1)
- {
- return null;
- }
- }
- else if (num == 1 && searchItemStoryMaster.difficulty_type != 0)
- {
- return null;
- }
- return tmpActiveEventGroup;
- }
- }
- // Token: 0x020009CF RID: 2511
- public enum ItemModeType
- {
- // Token: 0x04003247 RID: 12871
- Invalid,
- // Token: 0x04003248 RID: 12872
- Story
- }
- // Token: 0x020009D0 RID: 2512
- public enum ItemStoryType
- {
- // Token: 0x0400324A RID: 12874
- Invalid,
- // Token: 0x0400324B RID: 12875
- Main,
- // Token: 0x0400324C RID: 12876
- Sub,
- // Token: 0x0400324D RID: 12877
- Event
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement