Example #1
0
            private static bool Prefix(ref StorySystem __instance)
            {
                if (!settings.lockFastQiyuCompletion)
                {
                    return(true);
                }
                if (__instance.storySystemStoryId == 10002 || __instance.storySystemStoryId == 10003 || __instance.storySystemStoryId == 10004)
                {
                    return(true);
                }
                __instance.ClossToStoryMenu();
                int num = DateFile.instance.ParseInt(DateFile.instance.baseStoryDate[__instance.storySystemStoryId][302]);

                if (num != 0)
                {
                    DateFile.instance.SetEvent(new int[3]
                    {
                        0,
                        -1,
                        num
                    }, addToFirst: true);
                    logger.Log("MassageWindow.DoEvent called");
                    MassageWindow_DoEvent.Invoke(MassageWindow.instance, new object[1]
                    {
                        0
                    });
                }
                else
                {
                    DateFile.instance.SetStory(true, __instance.storySystemPartId, __instance.storySystemPlaceId, 0, 0);
                    __instance.StoryEnd();
                }
                return(false);
            }
Example #2
0
            private static bool Prefix(ref StorySystem __instance)
            {
                if (!enabled || !settings.basicUISettings[3])
                {
                    return(true);
                }
                else
                {
                    int storyId = __instance.storySystemStoryId;
#if DEBUG
                    logger.Log($"[TaiwuEditor]OpenStory: StoryId: {storyId}");
#endif
                    if (storyId > 0)
                    {
                        bool storyIdExist = false;
                        for (int i = 0; i < settings.includedStoryTyps.Length; i++)
                        {
                            if (settings.includedStoryTyps[i])
                            {
                                if (settings.GetStoryTyp(i).IsContainStoryId(storyId))
                                {
                                    storyIdExist = true;
                                    break;
                                }
                            }
                        }
                        if (!storyIdExist)
                        {
                            return(true);
                        }
                        // 关闭奇遇窗口
                        __instance.ClossToStoryMenu();
                        // 终点的事件ID
                        int storyEndEventId = int.Parse(DateFile.instance.baseStoryDate[storyId][302]);
#if DEBUG
                        logger.Log($"[TaiwuEditor]OpenStory: storyEndEventId: {storyEndEventId}");
#endif
                        if (Helper.EventSetup(storyEndEventId, __instance.storySystemPartId, __instance.storySystemPlaceId, __instance.storySystemStoryId))
                        {
                            logger.Log("MassageWindow.DoEvent called");
                            try
                            {
                                // 调用MessageWindow.DoEvent(0)执行终点Event
                                MassageWindow.instance.Invoke("DoEvent", new object[] { 0 });
                            }
                            catch (Exception e)
                            {
                                logger.Log($"[TaiwuEditor]奇遇直达终点失效 storyEndEventId: {storyEndEventId}");
                                logger.Log(e.Message);
                                logger.Log(e.StackTrace);
                                // 如果出现问题则return true调用游戏本来的奇遇处理方法
                                return(true);
                            }
                        }
                        else
                        {
                            logger.Log($"[TaiwuEditor]OpenStory has been removed due to storyEndEventId is 0");
                            __instance.StoryEnd();
                        }
                        return(false);
                    }
                    return(true);
                }
            }