private static void Postfix(StorySystem __instance)
        {
            if (!Main.enabled && Main.binding_key)
            {
                return;
            }
            ConfirmConfirm newobj = __instance.gameObject.AddComponent(typeof(ConfirmConfirm)) as ConfirmConfirm;

            newobj.setparam(typeof(StorySystem), "OpenStory", () =>
            {
                //依次检测子窗口,顺序很重要

                // 如果开始奇遇没有显示,则不处理
                if (StorySystem.instance.toStoryIsShow != true)
                {
                    return(false);
                }
                // 如果按钮不可以交互,不处理
                if (StorySystem.instance.openStoryButton.interactable != true)
                {
                    return(false);
                }

                return(StorySystem.instance.openStoryButton.interactable);
            });
        }
Exemple #2
0
        private static void Postfix(StorySystem __instance)
        {
            if (!Main.enabled || Main.binding_key)
            {
                return;
            }

            var comp = __instance.toStoryMenu.AddComponent <ConfirmComponent>();

            comp.SetActionOnConfirm(() =>
            {
                if (!StorySystem.instance.toStoryMenu.activeInHierarchy)
                {
                    return;
                }
                if (!StorySystem.instance.toStoryIsShow)
                {
                    return;
                }
                if (!StorySystem.instance.openStoryButton.interactable)
                {
                    return;
                }
                DateFile.instance.PlayeSE(2);
                StorySystem.instance.OpenStory();
            });
        }
Exemple #3
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);
            }
Exemple #4
0
 static void Postfix(StorySystem __instance, int typ)
 {
     if (!Main.enabled || !Main.settings.showInStory)
     {
         return;
     }
     Changer.ChangeObjectsName(__instance.itemHolder, "ItemNumberText");
 }
Exemple #5
0
 private void OnCreateEntity(EntityInfo entity)
 {
     if (null != entity)
     {
         StorySystem.SendMessage("obj_created", entity.GetId());
         StorySystem.SendMessage(string.Format("npc_created:{0}", entity.GetUnitId()), entity.GetId());
     }
 }
Exemple #6
0
 private static bool Prefix(ref StorySystem __instance)
 {
     if (!Main.enabled || !Main.settings.basicUISettings[10])
     {
         return(true);
     }
     ReflectionMethod.SetValue(__instance, "weatherNumber", 0);
     return(true);
 }
Exemple #7
0
 public void AddNewStory(string[] lines)
 {
     a          = 4;
     storyIndex = 0;
     storyLines = new List <string>(lines.Length);
     storyLines.AddRange(lines);
     Instance = this;
     CreateStory();
 }
Exemple #8
0
        static void Postfix(StorySystem __instance, int typ)
        {
            if (!Main.enabled || !Main.settings.showInStory)
            {
                return;
            }
            Changer changer = new Changer();

            changer.changeObjectsName(__instance.itemHolder);
        }
Exemple #9
0
 private void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         Instance = this;
     }
     continueButton.onClick.AddListener(delegate { ContinueStory(); NextButton.Play(); });
     sceneController = FindObjectOfType <SceneController>();
 }
Exemple #10
0
 void Start()
 {
     rb         = GameObject.Find("Avatar").GetComponent <Rigidbody>();
     story      = GameObject.Find("StorySystemObject").GetComponent <StorySystem>();
     story2     = GameObject.Find("Avatar").GetComponent <StoryChecker>();
     WalkPoints = GameObject.FindGameObjectsWithTag(this.tag + " Waypoint");
     for (int x = 0; x < WalkPoints.Length; x++)
     {
         WalkPoints[x] = GameObject.Find(this.tag + " Waypoints " + (x + 1));
     }
     WalkPointskid = WalkPoints[0].GetComponentsInChildren <Transform>();//Not needed really tbh
     randomizer    = Random.Range(1, WalkPointskid.Length);
     _navMeshAgent = this.GetComponent <NavMeshAgent>();
     NPCAnimScript = GetComponent <NPC_AnimationManager>();
 }
    // Use this for initialization
    void Start()
    {
        STORY                = GameObject.Find("StorySystemObject").GetComponent <StorySystem>();
        ranker               = GameObject.Find("Avatar").GetComponent <MilestoneRankManager>();
        pagehandler          = this.gameObject.GetComponentInChildren <Transform>().GetChild(0);
        leftarrow            = this.gameObject.GetComponentInChildren <Transform>().GetChild(1);
        rightarrow           = this.gameObject.GetComponentInChildren <Transform>().GetChild(2);
        pages                = pagehandler.transform.GetComponentsInChildren <Transform>();
        RankUpTextHolder     = this.gameObject.GetComponentInChildren <Transform>().GetChild(3);
        InventoryTextHolder  = this.gameObject.GetComponentInChildren <Transform>().GetChild(4);
        RankUpTextHolder2    = this.gameObject.GetComponentInChildren <Transform>().GetChild(5);
        InventoryTextHolder2 = this.gameObject.GetComponentInChildren <Transform>().GetChild(6);
        itemsprites          = this.gameObject.GetComponentInChildren <Transform>().GetChild(7);
        ItemButtonHolder     = this.gameObject.GetComponentInChildren <Transform>().GetChild(8);

        ItemPerm        = RankUpTextHolder.GetComponentsInChildren <Text>();
        ItemTemp        = InventoryTextHolder.GetComponentsInChildren <Text>();
        ItemPerm2       = RankUpTextHolder2.GetComponentsInChildren <Text>();
        ItemTemp2       = InventoryTextHolder2.GetComponentsInChildren <Text>();
        ItemPermButtons = ItemButtonHolder.gameObject.transform.GetComponentsInChildren <Button>();
        pageturner(true);
    }
        private void OnAiInitDslLogic(EntityInfo npc)
        {
            AiStateInfo aiInfo = npc.GetAiStateInfo();

            if (aiInfo.AiParam.Length >= 2)
            {
                string storyId   = aiInfo.AiLogic;
                string storyFile = aiInfo.AiParam[0];
                if (!string.IsNullOrEmpty(storyId) && !string.IsNullOrEmpty(storyFile))
                {
                    aiInfo.HomePos = npc.GetMovementStateInfo().GetPosition3D();
                    aiInfo.ChangeToState((int)PredefinedAiStateId.Idle);
                    aiInfo.AiStoryInstanceInfo = StorySystem.NewAiStoryInstance(storyId, string.Empty, storyFile);
                    if (null != aiInfo.AiStoryInstanceInfo)
                    {
                        aiInfo.AiStoryInstanceInfo.m_StoryInstance.Context = this;
                        aiInfo.AiStoryInstanceInfo.m_StoryInstance.SetVariable("@objid", npc.GetId());
                        aiInfo.AiStoryInstanceInfo.m_StoryInstance.Start();
                    }
                }
            }
            m_EntitiesForAi.Add(npc);
        }
Exemple #13
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);
                }
            }
Exemple #14
0
        /// <summary>
        /// 奇遇直接到终点
        /// </summary>
        private static bool StorySystem_OpenStory_Prefix(ref StorySystem __instance, ref bool ___keepHiding)
        {
            if (RuntimeConfig.DebugMode)
            {
                TaiwuEditor.Logger.LogInfo($"OpenStory: StoryId: {__instance.storySystemStoryId}");
            }

            if (!TaiwuEditor.enabled || !TaiwuEditor.settings.StoryCheat.Value)
            {
                return(true);
            }

            /// 借鉴<see cref="StorySystem.StorySystemOpend"/>。<see cref="StorySystem.StoryToBattle"/>会将此值设为true
            /// 用这个值判断是否本次调用<see cref="StorySystem.OpenStory"/>是否由<see cref="StorySystem.StoryToBattle"/>
            /// 返回的,防止奇遇终点是战斗时,无限进入战斗。
            if (___keepHiding)
            {
                return(true);
            }

            int storyId = __instance.storySystemStoryId;

            if (storyId > 0)
            {
                bool storyIdExist = false;
                for (int i = 0; i < TaiwuEditor.settings.includedStoryTyps.Value.Length; i++)
                {
                    if (TaiwuEditor.settings.includedStoryTyps.Value[i])
                    {
                        if (TaiwuEditor.settings.GetStoryTyp(i).IsContainStoryId(storyId))
                        {
                            storyIdExist = true;
                            break;
                        }
                    }
                }
                if (!storyIdExist)
                {
                    return(true);
                }
                // 关闭奇遇窗口
                ToStoryMenu.Instance.CloseToStoryMenu();
                // 终点的事件ID
                int storyEndEventId = int.Parse(DateFile.instance.baseStoryDate[storyId][302]);
                if (RuntimeConfig.DebugMode)
                {
                    TaiwuEditor.Logger.LogInfo($"OpenStory: storyEndEventId: {storyEndEventId}");
                    TaiwuEditor.Logger.LogInfo($"OpenStory: StoryPlayer: {StorySystem.instance.storyPlayer.name}");
                    TaiwuEditor.Logger.LogInfo($"OpenStory: StoryPlayer_placeid: {StorySystem.instance.storyPlayer.parent.parent.parent.name}");
                }

                if (!Helper.EventSetup(StorySystem.StoryBaseManager, storyEndEventId,
                                       __instance.storySystemPartId, __instance.storySystemPlaceId,
                                       __instance.storySystemStoryId))
                {
                    TaiwuEditor.Logger.LogInfo($"OpenStory has been removed due to storyEndEventId is 0");
                    __instance.StoryEnd();
                }
                return(false);
            }
            return(true);
        }
Exemple #15
0
            private static bool Prefix(ref StorySystem __instance, ref bool ___keepHiding)
            {
                if (!Main.enabled || !Main.settings.basicUISettings[3])
                {
                    return(true);
                }

                /// 借鉴<see cref="StorySystem.StorySystemOpend"/>。<see cref="StorySystem.StoryToBattle"/>会将此值设为true
                /// 用这个值判断是否本次调用<see cref="StorySystem.OpenStory"/>是否由<see cref="StorySystem.StoryToBattle"/>
                /// 返回的,防止奇遇终点是战斗时,无限进入战斗。
                if (___keepHiding)
                {
                    return(true);
                }

                int storyId = __instance.storySystemStoryId;

#if DEBUG
                Main.logger.Log($"[TaiwuEditor]OpenStory: StoryId: {storyId}");
#endif
                if (storyId > 0)
                {
                    bool storyIdExist = false;
                    for (int i = 0; i < Main.settings.includedStoryTyps.Length; i++)
                    {
                        if (Main.settings.includedStoryTyps[i])
                        {
                            if (Main.settings.GetStoryTyp(i).IsContainStoryId(storyId))
                            {
                                storyIdExist = true;
                                break;
                            }
                        }
                    }
                    if (!storyIdExist)
                    {
                        return(true);
                    }
                    // 关闭奇遇窗口
                    ToStoryMenu.Instance.CloseToStoryMenu();
                    // 终点的事件ID
                    int storyEndEventId = int.Parse(DateFile.instance.baseStoryDate[storyId][302]);
#if DEBUG
                    Main.logger.Log($"[TaiwuEditor]OpenStory: storyEndEventId: {storyEndEventId}");
                    Main.logger.Log($"[TaiwuEditor]OpenStory: StoryPlayer: {StorySystem.instance.storyPlayer.name}");
                    Main.logger.Log($"[TaiwuEditor]OpenStory: StoryPlayer_placeid: {StorySystem.instance.storyPlayer.parent.parent.parent.name}");
#endif
                    if (HelperBase.EventSetup(StorySystem.StoryBaseManager, storyEndEventId,
                                              __instance.storySystemPartId, __instance.storySystemPlaceId,
                                              __instance.storySystemStoryId))
                    {
#if DEBUG
                        Main.logger.Log("EventSetup successful");
#endif
                    }
                    else
                    {
                        Main.logger.Log($"[TaiwuEditor]OpenStory has been removed due to storyEndEventId is 0");
                        __instance.StoryEnd();
                    }
                    return(false);
                }
                return(true);
            }