Exemple #1
0
        private void OnSceneChanged(UnityEngine.SceneManagement.Scene from, UnityEngine.SceneManagement.Scene to)
        {
            string scene = to.name;

            try
            {
                if (HeroController.instance.gameObject.GetComponent <SceneExpander>() != null)
                {
                    UObject.Destroy(HeroController.instance.gameObject.GetComponent <SceneExpander>());
                }
            }
            catch
            { }

            if (scene == TransitionGateNames.Rt)
            {
                // Black Egg Entrance, needs change to make Hornet give the Item
                SceneChanger.CR_Change_Room_temple(to);
            }
            else if (scene == TransitionGateNames.Wp06)
            {
                // Path of Pain Entrance, needs change to make "Test of Teamwork" accessible
                SceneChanger.CR_Change_White_Palace_06(to);
            }
            else if (scene == TransitionGateNames.Tot01)
            {
                GameManager.instance.RefreshTilemapInfo(scene);
            }
            else if (scene == TransitionGateNames.Tot02)
            {
                GameManager.instance.RefreshTilemapInfo(scene);
            }
            else if (scene == TransitionGateNames.Tot03)
            {
                GameManager.instance.RefreshTilemapInfo(scene);
            }
            else if (scene == TransitionGateNames.TotEndless)
            {
                SceneChanger.CR_Change_ToTEndless(to);
                GameManager.instance.RefreshTilemapInfo(scene);
            }
            else if (scene == TransitionGateNames.TotDropdown)
            {
                GameManager.instance.RefreshTilemapInfo(scene);
            }
            else if (scene == "GG_Hornet_2")
            {
                var go  = to.Find("Hornet Boss 2");
                var fsm = go.LocateMyFSM("Control");
                fsm.GetAction <IntCompare>("Escalation", 2).integer2 = 99999999;
                fsm.ChangeTransition("Refight Wake", "FINISHED", "Barb Antic");
                fsm.ChangeTransition("Barb Recover", "FINISHED", "Flourish?");
                go.GetComponent <HealthManager>().hp = 1500;
            }
        }
Exemple #2
0
        public override void Initialize(Dictionary <string, Dictionary <string, GameObject> > preloadedObjects)
        {
            Log("Initializing");
            Instance = this;

            InitGlobalSettings();
            SceneChanger = new SceneChanger(preloadedObjects);
            AudioDict    = new AudioStrings(SceneChanger);
            //UIManager.instance.RefreshAchievementsList();

            //GameManager.instance.StartCoroutine(DEBUG_Shade_Style());
            GameManager.instance.StartCoroutine(Register2BossModCore());

            #region Achievements

            foreach (var keyname in Registry.CurrentUser.OpenSubKey("SOFTWARE").OpenSubKey("Team Cherry").OpenSubKey("Hollow Knight").GetValueNames())
            {
                if (keyname.Contains("_"))
                {
                    string paddedName = keyname.Substring(0, keyname.LastIndexOf('_'));
                    try
                    {
                        string decryptedName = Encryption.Decrypt(paddedName);
                        string ret           = (string)typeof(PlayerPrefsSharedData).GetMethod("ReadEncrypted", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(Platform.Current.EncryptedSharedData, new object[] { decryptedName });

                        Log($"Raw Key: '{decryptedName}': '{ret}'");
                    }
                    catch (Exception e)
                    {
                        string retString = PlayerPrefs.GetString(paddedName, "DOESN'T EXIST");
                        if (retString.Equals("DOESN'T EXIST"))
                        {
                            float retfloat = PlayerPrefs.GetFloat(paddedName, -123.456f);
                            if (retfloat.Equals(-123.456f))
                            {
                                Log($"Other Key: '{paddedName}': '{PlayerPrefs.GetInt(paddedName, 0)}'");
                            }
                            else
                            {
                                Log($"Float Key: '{paddedName}': '{retfloat}'");
                            }
                        }
                        else
                        {
                            Log($"String Key: '{paddedName}': '{retString}'");
                        }
                    }
                }
            }

            #endregion

            //Log("Loading Hugger 1");
            //memoryHugger1 = new int[536870912];
            //Log("Loading Hugger 2");
            //memoryHugger2 = new int[536870912];
            //Log("Loading Hugger 3");
            //memoryHugger3 = new int[536870912];
            //Log("Loading Hugger 4");
            //memoryHugger4 = new int[536870912];
            //Log("Loading Hugger 5");
            //memoryHugger5 = new int[536870912];

            Log("Initialized");
        }