Esempio n. 1
0
        private void SceneDirector_Start(On.RoR2.SceneDirector.orig_Start orig, RoR2.SceneDirector director)
        {
            orig(director);

            if (SceneInfo.instance.sceneDef.baseSceneName != "bazaar")
            {
                //sky meadow and a couple other stages name them like this. we grab them by exact name so we don't accidentally disable an object we don't want to
                var newts = Resources.FindObjectsOfTypeAll <GameObject>().Where(obj => obj.name == "NewtStatue" || obj.name == "NewtStatue (1)" || obj.name == "NewtStatue (2)" || obj.name == "NewtStatue (3)" || obj.name == "NewtStatue (4)").ToList();
                foreach (var newt in newts)
                {
                    if (NewtAltarChance.Value >= 1 || director.rng.nextNormalizedFloat <= NewtAltarChance.Value)
                    {
                        CmdSetActive(newt, true);
                    }
                    else
                    {
                        CmdSetActive(newt, false);
                    }
                }

                if (!EnableGuaranteedNewtAltars.Value)
                {
                    //naming conventions??? NAHH
                    var guaranteedNewts = Resources.FindObjectsOfTypeAll <GameObject>().Where(obj => obj.name == "NewtStatue, Guarantee" || obj.name == "NewtStatue, Guaranteed" || obj.name == "NewtStatue (Permanent)").ToList();
                    foreach (var newt in guaranteedNewts)
                    {
                        CmdSetActive(newt, false);
                    }
                }
            }
        }
 public void OnSceneStart(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
 {
     orig(self);
     if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "skymeadow")
     {
         Destroy(GameObject.Find("SMSkyboxPrefab"));
     }
 }
Esempio n. 3
0
 private void ModifyScene(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
 {
     orig(self);
     switch (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name)
     {
     case "rootjungle":
         ModifyRootJungle();
         break;
     }
 }
Esempio n. 4
0
        private static void ResetClassValues(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
        {
            // Allow for money sharing triggers as teleporter is inactive
            SetTeleporterActive(false);

            // This should run on every map, as it is required to fix shared money.
            // Reset shared money value to the default (0) at the start of each round
            SharedMoneyValue = 0;

            orig(self);
        }
        private void Check(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
        {
            if (self)
            {
                if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "limbo")
                {
                    base.Grant();
                }
            }

            orig(self);
        }
Esempio n. 6
0
 private void ChooseSceneToModify(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
 {
     orig(self);
     switch (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name)
     {
     case "goolake":
         if (Util.CheckRoll(GooLakeFilled.Value))
         {
             FillGooLake();
         }
         break;
     }
 }
Esempio n. 7
0
        private void Check(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
        {
            if (self)
            {
                string sceneName = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;
                if (sceneName == "golemplains" || sceneName == "golemplains2")
                {
                    base.Grant();
                }
            }

            orig(self);
        }
        private static void ResetClassValues(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
        {
            // Allow for money sharing triggers as teleporter is inactive
            SetTeleporterActive(false);

            // This should run on every map, as it is required to fix shared money.
            // Reset shared money value to the default (0) at the start of each round
            if (ShareSuite.MoneyIsShared.Value && GeneralHooks.IsMultiplayer())
            {
                MoneySharingHooks.SharedMoneyValue = 15;
            }

            orig(self);
        }
Esempio n. 9
0
        private void CoverUpArtifactHoles(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
        {
            orig(self);
            if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "artifactworld")
            {
                var gameplaySpace = GameObject.Find("HOLDER: Gameplay Space");
                var holder        = new GameObject("MODDEDHOLDER: Caulks");
                //holder.transform.parent = gameplaySpace.transform;
                var blockRef1x3    = gameplaySpace.transform.Find("AW Basic Bridge 1").transform.Find("AW_Cube1x3x1").gameObject;
                var blockRef1x0p51 = gameplaySpace.transform.Find("AW Basic Bridge 1").transform.Find("AW_Cube1x0.5x1").gameObject;
                //var blockRef1x3 = GameObject.Find("HOLDER: Gameplay Space").transform.Find("AW Basic Bridge 1 (1)").transform.Find("AW_Cube2x3x1 (2)").gameObject;

                CreateObject(blockRef1x3, new Vector3(88f, -15.3f, 67f), new Vector3(0f, 0f, 270f), 0, holder);
                CreateObject(blockRef1x3, new Vector3(69f, -15.3f, 85f), new Vector3(0f, 0f, 270f), 1, holder);
                CreateObject(blockRef1x0p51, new Vector3(82f, -15.3f, 1.5f), new Vector3(0f, 0f, 270f), 2, holder);
                CreateObject(blockRef1x3, new Vector3(48f, 0.7f, 83f), new Vector3(0f, 0f, 270f), 3, holder);
            }
        }
Esempio n. 10
0
        private void SceneDirector_Start(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
        {
            if (NetworkServer.active)
            {
                //if (SceneManager.GetActiveScene().name.Contains("bazaar"))
                if (isCurrentStageBazaar())
                {
                    //Debug.LogWarning("Hello, log inspector. Hooking SceneDirector.Start in the Bazaar always throws an exception, no matter what you do (vanilla bug). Luckily, it doesn't affect anything and it's unlikely that any of the mods mentioned here are the reason you are checking the log.");
                    var  sacrificeArtifactDef     = ArtifactCatalog.FindArtifactDef("Sacrifice");
                    bool isUsingSacrificeArtifact = false;

                    if (RunArtifactManager.instance.IsArtifactEnabled(sacrificeArtifactDef))
                    {
                        if (!ModConfig.sacrificeArtifactAllowChests.Value)
                        {
                            orig(self);
                        }
                        isUsingSacrificeArtifact = true;
                        RunArtifactManager.instance.SetArtifactEnabledServer(sacrificeArtifactDef, false);
                    }

                    // only the case if you start the run in the bazaar
                    if (Run.instance.stageClearCount == 0)
                    {
                        bazaar.ResetBazaarPlayers();
                        bazaar.CalcDifficultyCoefficient();
                    }
                    bazaar.StartBazaar(this);
                    if (isUsingSacrificeArtifact)
                    {
                        RunArtifactManager.instance.SetArtifactEnabledServer(sacrificeArtifactDef, true);
                    }
                    if (ModConfig.BroadcastShopSettings.Value)
                    {
                        StartCoroutine(BroadcastShopSettings());
                    }
                }
                else
                {
                    bazaar.CurrentDifficultyCoefficient = Run.instance.difficultyCoefficient;
                }
            }
            orig(self);
        }
Esempio n. 11
0
        // ReSharper disable once InconsistentNaming
        private static void EnsureDTNetwork(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
        {
            try
            {
                orig(self);
            }
            catch (Exception e)
            {
                Log.Message($"Vanilla Exception : {e}", Log.LogLevel.Warning, Log.Target.Bepinex);
            }

            if (!_debugToolKitComponentsSpawned)
            {
                _debugToolKitComponentsSpawned =
                    UnityObject.Instantiate(DebugToolKitComponents);

                NetworkServer.Spawn(_debugToolKitComponentsSpawned);
            }
        }
Esempio n. 12
0
        static void DisableDefaultSpawn(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
        {
            if (NetworkServer.active)
            {
                ClassicStageInfo sceneInfo = SceneInfo.instance.GetComponent <ClassicStageInfo>();

                //Disables default interactibles spawning
                if (VoteAPI.VoteResults.HasVote(Settings.CustomInteractablesSpawner.Item2))
                {
                    sceneInfo.sceneDirectorInteractibleCredits = 0;
                    sceneInfo.bonusInteractibleCreditObjects   = null;
                }

                //Disables default mob spawning
                if (!VoteAPI.VoteResults.HasVote(Settings.MobSpawn.Item2))
                {
                    sceneInfo.sceneDirectorMonsterCredits = 0;
                }
            }
            orig(self);
        }
Esempio n. 13
0
        private void SceneDirector_Start(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
        {
            orig(self);
            switch (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name)
            {
            case "s******d":
                //GameObject.Find("Directional Light").GetComponent<Light>().color = Color.white;
                var localMaster = PlayerCharacterMasterController.instances[0].master;
                if (localMaster)
                {
                    localMaster.GetBody()?.characterMotor.Motor.SetPositionAndRotation(new Vector3(0.12f, 0.91f, 7.76f), Quaternion.identity, true);
                }
                break;

            case "bazaar":
                var lockedMage = GameObject.Find("LockedMage").gameObject;
                lockedMage.GetComponent <GameObjectUnlockableFilter>().enabled = false;
                lockedMage.SetActive(true);
                break;
            }
        }
Esempio n. 14
0
        private void SceneDirector_Start(On.RoR2.SceneDirector.orig_Start orig, SceneDirector self)
        {
            if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "arena")
            {
                //check if any paladin has beads of fealty
                bool hasBeads = false;
                for (int i = 0; i < CharacterMaster.readOnlyInstancesList.Count; i++)
                {
                    if (CharacterMaster.readOnlyInstancesList[i].bodyPrefab.GetComponent <CharacterBody>().baseNameToken == "PALADIN_NAME" && CharacterMaster.readOnlyInstancesList[i].inventory.GetItemCount(ItemIndex.LunarTrinket) > 0)
                    {
                        hasBeads = true;
                        break;
                    }
                }

                if (hasBeads)
                {
                    //destroy environment
                    GameObject.Destroy(GameObject.Find("HOLDER: Nullifier Props").gameObject);
                    GameObject.Destroy(GameObject.Find("HOLDER: Misc Props").gameObject);
                    GameObject.Destroy(GameObject.Find("HOLDER: Terrain").gameObject);
                    GameObject.Destroy(GameObject.Find("HOLDER: Ruins").gameObject);
                    GameObject.Destroy(GameObject.Find("HOLDER: Small Trees").gameObject);
                    GameObject.Destroy(GameObject.Find("HOLDER: Artifact Formula").gameObject);
                    GameObject.Destroy(GameObject.Find("HOLDER: Rocks").gameObject);
                    //GameObject.Destroy(GameObject.Find("FOLIAGE: Skybox Kelp Trees").gameObject);
                    GameObject.Destroy(GameObject.Find("ArenaBoulderFix").gameObject);
                    GameObject.Destroy(GameObject.Find("PortalArena").gameObject);
                    GameObject.Find("ArenaMissionController").transform.Find("PPSick").gameObject.SetActive(false);

                    GameObject.Destroy(GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (1)").gameObject);
                    GameObject.Destroy(GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (2)").gameObject);
                    GameObject.Destroy(GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (3)").gameObject);
                    GameObject.Destroy(GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (4)").gameObject);
                    GameObject.Destroy(GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (5)").gameObject);
                    GameObject.Destroy(GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (6)").gameObject);
                    GameObject.Destroy(GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (7)").gameObject);
                    GameObject.Destroy(GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (8)").gameObject);
                    GameObject.Destroy(GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (9)").gameObject);

                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("ShrineCombat").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (1)").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (2)").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (3)").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (4)").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (5)").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (6)").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (7)").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("ArenaBarrier").Find("ArenaBarrierCenter").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("ArenaBarrier (1)").Find("ArenaBarrierCenter").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("ArenaBarrier (2)").Find("ArenaBarrierCenter").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("ArenaBarrier (3)").Find("ArenaBarrierCenter").gameObject.SetActive(true);

                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("ShrineCombat").localPosition = new Vector3(-84, 112, -6);
                    GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").localPosition  = new Vector3(-84, 84, -6);

                    GameObject.Find("HOLDER: Lighting, Effects, Wind, etc").transform.Find("ArenaSkybox").Find("CameraRelative").Find("Dust").gameObject.SetActive(false);
                    GameObject.Find("HOLDER: Lighting, Effects, Wind, etc").transform.Find("ArenaSkybox").Find("CameraRelative").Find("Weather (Locked Position/Rotation").Find("Embers").gameObject.SetActive(true);
                    GameObject.Find("HOLDER: Lighting, Effects, Wind, etc").transform.Find("ArenaSkybox").Find("CameraRelative").Find("Weather (Locked Position/Rotation").Find("GiantDust?").gameObject.SetActive(true);

                    foreach (SpawnPoint i in FindObjectsOfType <SpawnPoint>())
                    {
                        i.transform.position = new Vector3(-84, 103, 32);
                    }
                    ;

                    GameObject.Find("ArenaMissionController").GetComponent <ArenaMissionController>().enabled = false;
                }
            }

            orig(self);
        }