Esempio n. 1
0
        private void Start()
        {
            Dungeon              m_dungeonPrefab     = DungeonDatabase.GetOrLoadByName("finalscenario_guide");
            DungeonFlow          dungeonFlowPrefab   = m_dungeonPrefab.PatternSettings.flows[0];
            PrototypeDungeonRoom GuidePastRoom       = dungeonFlowPrefab.AllNodes[0].overrideExactRoom;
            GameObject           GuidePastRoomObject = GuidePastRoom.placedObjects[0].nonenemyBehaviour.gameObject;
            GameObject           m_RainPrefab        = GuidePastRoomObject.transform.Find("Rain").gameObject;

            GameObject m_ThunderStorm = Instantiate(m_RainPrefab);

            m_ThunderStorm.name = "ExpandRain";
            m_StormController   = m_ThunderStorm.GetComponent <ThunderstormController>();
            ParticleSystem m_CachedParticleSystem = m_StormController.RainSystemTransform.GetComponent <ParticleSystem>();

            if (useCustomIntensity)
            {
                BraveUtility.SetEmissionRate(m_CachedParticleSystem, RainIntensity);
            }
            m_StormController.DecayVertical = isLocalToRoom;
            m_StormController.DoLighting    = false;
            LightningRenderers = m_StormController.LightningRenderers;
            m_ThunderStorm.transform.parent = gameObject.transform;

            dungeonFlowPrefab = null;
            m_dungeonPrefab   = null;

            isActive = true;
        }
Esempio n. 2
0
        // Retrieve sharedInjectionData from a specific floor if one is available
        public static List <SharedInjectionData> RetrieveSharedInjectionDataListFromSpecificFloor(string targetfloorname)
        {
            List <SharedInjectionData> m_CachedInjectionDataList = new List <SharedInjectionData>(0);

            if (targetfloorname == null | targetfloorname == string.Empty)
            {
                return(new List <SharedInjectionData>(0));
            }
            Dungeon dungeon = DungeonDatabase.GetOrLoadByName(targetfloorname);

            if (dungeon.PatternSettings.flows != null && dungeon.PatternSettings.flows.Count > 0)
            {
                m_CachedInjectionDataList = dungeon.PatternSettings.flows[0].sharedInjectionData;
            }
            else
            {
                dungeon = null;
                return(new List <SharedInjectionData>(0));
            }
            if (m_CachedInjectionDataList == null | m_CachedInjectionDataList.Count <= 0)
            {
                dungeon = null;
                return(new List <SharedInjectionData>(0));
            }
            dungeon = null;
            return(m_CachedInjectionDataList);
        }
 private void HandleFlightCollider(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
 {
     if (!GameManager.Instance.IsLoadingLevel && IsValidForUse())
     {
         PlayerController component = specRigidbody.GetComponent <PlayerController>();
         if (component && component.IsFlying && !m_isLoading && !GameManager.Instance.IsLoadingLevel && !string.IsNullOrEmpty(targetLevelName))
         {
             m_timeHovering += BraveTime.DeltaTime;
             if (GameManager.Instance.CurrentGameType == GameManager.GameType.COOP_2_PLAYER)
             {
                 PlayerController otherPlayer = GameManager.Instance.GetOtherPlayer(component);
                 if (component.IsFlying && !otherPlayer.IsFlying && !otherPlayer.IsGhost)
                 {
                     m_timeHovering = 0f;
                 }
             }
             if (m_timeHovering > 0.5f)
             {
                 m_isLoading = true;
                 if (IsSecretGlitchFloorPit)
                 {
                     GameManager.Instance.InjectedFlowPath = "secretglitchfloor_Flow";
                     ExpandUtility.RatDungeon = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat");
                     ExpandUtility.RatDungeon.LevelOverrideType = GameManager.LevelOverrideState.NONE;
                     ExpandPrefabs.InitCanyonTileSet(ExpandUtility.RatDungeon, GlobalDungeonData.ValidTilesets.PHOBOSGEON);
                 }
                 component.LevelToLoadOnPitfall = targetLevelName;
                 component.ForceFall();
                 // GameManager.Instance.LoadCustomLevel(targetLevelName);
             }
         }
     }
 }
Esempio n. 4
0
        // Initialize KnownFlows array with custom + official flows.

        public static void InitBossRooms()
        {
            Dungeon CathedralPrefab = DungeonDatabase.GetOrLoadByName("Base_Cathedral");

            CathedralInjectionData = CathedralPrefab.PatternSettings.flows[0].sharedInjectionData[1];

            BossBishopRoom = new ProceduralFlowModifierData()
            {
                annotation        = "The Bishop's Chapel",
                DEBUG_FORCE_SPAWN = false,
                OncePerRun        = false,
                placementRules    = new List <ProceduralFlowModifierData.FlowModifierPlacementType>()
                {
                    ProceduralFlowModifierData.FlowModifierPlacementType.RANDOM_NODE_CHILD
                },
                // exactRoom = SewersInjectionData.InjectionData[0].exactRoom,
                exactRoom              = dungeonRoom,
                RequiresMasteryToken   = false,
                chanceToLock           = 0,
                selectionWeight        = 1,
                chanceToSpawn          = 1,
                RequiredValidPlaceable = null,
                prerequisites          = new DungeonPrerequisite[0],
                CanBeForcedSecret      = true,
                RandomNodeChildMinDistanceFromEntrance = 0,
                exactSecondaryRoom = null,
                framedCombatNodes  = 0,
            };
            CathedralInjectionData.InjectionData.Add(BossBishopRoom);

            CathedralPrefab = null;
        }
        public static void Init()
        {
            AssetBundles = new Dictionary <string, AssetBundle>();
            foreach (var name in assetBundleNames)
            {
                try
                {
                    var bundle = ResourceManager.LoadAssetBundle(name);
                    if (bundle == null)
                    {
                        Tools.PrintError($"Failed to load asset bundle: {name}");
                        continue;
                    }
                    AssetBundles.Add(name, ResourceManager.LoadAssetBundle(name));
                }
                catch (Exception e)
                {
                    Tools.PrintError($"Failed to load asset bundle: {name}");
                    Tools.PrintException(e);
                }
            }

            RoomTables = new Dictionary <string, GenericRoomTable>();
            foreach (var entry in roomTableMap)
            {
                try
                {
                    var table = DungeonDatabase.GetOrLoadByName($"base_{entry.Key}").PatternSettings.flows[0].fallbackRoomTable;
                    RoomTables.Add(entry.Key, table);
                }
                catch (Exception e)
                {
                    Tools.PrintError($"Failed to load room table: {entry.Key}:{entry.Value}");
                    Tools.PrintException(e);
                }
            }

            foreach (var entry in specialRoomTableMap)
            {
                try
                {
                    var table = GetAsset <GenericRoomTable>(entry.Value);
                    RoomTables.Add(entry.Key, table);
                }
                catch (Exception e)
                {
                    Tools.PrintError($"Failed to load special room table: {entry.Key}:{entry.Value}");
                    Tools.PrintException(e);
                }
            }

            subShopTable = AssetBundles["shared_auto_001"].LoadAsset <SharedInjectionData>("_global injected subshop table");

            //foreach(var data in subShopTable.InjectionData)
            //{
            //    Tools.LogPropertiesAndFields(data, data.annotation);
            //}

            Tools.Print("Static references initialized.");
        }
        private void InitStorm()
        {
            Dungeon              m_dungeonPrefab     = DungeonDatabase.GetOrLoadByName("finalscenario_guide");
            DungeonFlow          dungeonFlowPrefab   = m_dungeonPrefab.PatternSettings.flows[0];
            PrototypeDungeonRoom GuidePastRoom       = dungeonFlowPrefab.AllNodes[0].overrideExactRoom;
            GameObject           GuidePastRoomObject = GuidePastRoom.placedObjects[0].nonenemyBehaviour.gameObject;
            GameObject           m_RainPrefab        = GuidePastRoomObject.transform.Find("Rain").gameObject;

            m_ThunderStorm      = Instantiate(m_RainPrefab);
            m_ThunderStorm.name = "ChaosRain";
            ThunderstormController stormController        = m_ThunderStorm.GetComponent <ThunderstormController>();
            ParticleSystem         m_CachedParticleSystem = stormController.RainSystemTransform.GetComponent <ParticleSystem>();

            if (useCustomIntensity)
            {
                BraveUtility.SetEmissionRate(m_CachedParticleSystem, RainIntensity);
            }
            m_cachedEmissionRate          = m_CachedParticleSystem.emission.rate.constant;
            stormController.DecayVertical = false;
            stormController.DoLighting    = false;
            m_ChaosLightning = new GameObject("ChaosLightning");
            m_ChaosLightning.AddComponent <ChaosWeatherController>();
            ChaosWeatherController LightningComponent = m_ChaosLightning.GetComponent <ChaosWeatherController>();

            LightningComponent.LightningRenderers = stormController.LightningRenderers;
            dungeonFlowPrefab = null;
            m_dungeonPrefab   = null;
        }
        public static void DungeonFlowInit(bool refreshFlows = false)
        {
            LoopItemRoomPrefab = ExpandTheGungeon.ExpandUtilities.RoomFactory.BuildFromResource("Items/Resources/LoopItemRoom.room");
            sharedAssets2      = ResourceManager.LoadAssetBundle("shared_auto_002");

            Dungeon ForgePrefab = DungeonDatabase.GetOrLoadByName("Base_Forge");

            ForgeData    = ForgePrefab.PatternSettings.flows[0].sharedInjectionData[1];
            LoopItemRoom = new ProceduralFlowModifierData()
            {
                annotation        = "Loop Item Room",
                DEBUG_FORCE_SPAWN = false,
                OncePerRun        = false,
                placementRules    = new List <ProceduralFlowModifierData.FlowModifierPlacementType>()
                {
                    ProceduralFlowModifierData.FlowModifierPlacementType.END_OF_CHAIN
                },
                roomTable              = null,
                exactRoom              = LoopItemRoomPrefab,
                IsWarpWing             = false,
                RequiresMasteryToken   = false,
                chanceToLock           = 0,
                selectionWeight        = 1,
                chanceToSpawn          = 1,
                RequiredValidPlaceable = null,
                prerequisites          = new DungeonPrerequisite[] {
                    new DungeonPrerequisite()
                    {
                        prerequisiteOperation      = DungeonPrerequisite.PrerequisiteOperation.EQUAL_TO,
                        prerequisiteType           = DungeonPrerequisite.PrerequisiteType.TILESET,
                        requiredTileset            = GlobalDungeonData.ValidTilesets.FORGEGEON,
                        requireTileset             = true,
                        comparisonValue            = 1,
                        encounteredObjectGuid      = string.Empty,
                        maxToCheck                 = TrackedMaximums.MOST_KEYS_HELD,
                        requireDemoMode            = false,
                        requireCharacter           = false,
                        requiredCharacter          = PlayableCharacters.Pilot,
                        requireFlag                = false,
                        useSessionStatValue        = false,
                        encounteredRoom            = null,
                        requiredNumberOfEncounters = -1,
                        saveFlagToCheck            = GungeonFlags.TUTORIAL_COMPLETED,
                        statToCheck                = TrackedStats.GUNBERS_MUNCHED
                    }
                },
                CanBeForcedSecret = true,
                RandomNodeChildMinDistanceFromEntrance = 0,
                exactSecondaryRoom = null,
                framedCombatNodes  = 0,
            };
            ExpandTheGungeon.ExpandObjects.ExpandObjectDatabase objectDatabase = new ExpandTheGungeon.ExpandObjects.ExpandObjectDatabase();


            BaseSharedInjectionData.InjectionData.Add(LoopItemRoom);
            ExpandTheGungeon.ExpandUtilities.RoomBuilder.AddObjectToRoom(LoopItemRoomPrefab, new Vector2(5, 7), objectDatabase.GodRays);
            ExpandTheGungeon.ExpandUtilities.RoomBuilder.AddObjectToRoom(LoopItemRoomPrefab, new Vector2(7, 8), ExpandTheGungeon.ExpandUtilities.ExpandUtility.GenerateDungeonPlacable(TimeItemStand, useExternalPrefab: true));
            objectDatabase = null;
            ForgePrefab    = null;
        }
Esempio n. 8
0
        public static DungeonFlow GetRandomFlowFromNextDungeonPrefabForGlitchFloor()
        {
            int     NextLevelIndex = ReflectionHelpers.ReflectGetField <int>(typeof(GameManager), "nextLevelIndex", GameManager.Instance);
            Dungeon dungeon        = null;
            bool    useFallBack    = true;

            switch (NextLevelIndex)
            {
            case 2:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Castle");
                break;

            case 3:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Gungeon");
                break;

            case 4:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Mines");
                break;

            case 5:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Catacombs");
                break;

            case 6:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Forge");
                break;

            case 7:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Bullethell");
                break;

            default:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Mines");
                break;
            }
            DungeonFlow m_AssignedFallBackFlow = FlowDatabase.GetOrLoadByName(BraveUtility.RandomElement(GlitchChestFlows));
            DungeonFlow m_AssignedFlow         = FlowHelpers.DuplicateDungeonFlow(BraveUtility.RandomElement(dungeon.PatternSettings.flows));

            dungeon = null;
            foreach (DungeonFlowNode node in m_AssignedFlow.AllNodes)
            {
                if (node.roomCategory == PrototypeDungeonRoom.RoomCategory.BOSS)
                {
                    node.overrideExactRoom = ExpandPrefabs.doublebeholsterroom01;
                    useFallBack            = false;
                    break;
                }
            }
            if (useFallBack)
            {
                return(m_AssignedFallBackFlow);
            }
            else
            {
                return(m_AssignedFlow);
            }
        }
Esempio n. 9
0
        public static void InitCustomPrefabs()
        {
            try {
                AssetBundle assetBundle  = ResourceManager.LoadAssetBundle("shared_auto_001");
                AssetBundle assetBundle2 = ResourceManager.LoadAssetBundle("shared_auto_002");
                shared_auto_001 = assetBundle;
                shared_auto_002 = assetBundle2;
                braveResources  = ResourceManager.LoadAssetBundle("brave_resources_001");

                ModAssets = AssetBundleLoader.LoadAssetBundleFromLiterallyAnywhere("roundassetbundle");
                if (ModAssets == null)
                {
                    ETGModConsole.Log("ModAssets is null, all according to plan!");
                }
                tileset = ModAssets.LoadAsset <Texture2D>("floorsheet");

                TutorialDungeonPrefab   = DungeonDatabase.GetOrLoadByName("Base_Tutorial");
                SewerDungeonPrefab      = DungeonDatabase.GetOrLoadByName("Base_Sewer");
                MinesDungeonPrefab      = DungeonDatabase.GetOrLoadByName("Base_Mines");
                ratDungeon              = DungeonDatabase.GetOrLoadByName("base_resourcefulrat");
                CathedralDungeonPrefab  = DungeonDatabase.GetOrLoadByName("Base_Cathedral");
                BulletHellDungeonPrefab = DungeonDatabase.GetOrLoadByName("Base_BulletHell");
                ForgeDungeonPrefab      = DungeonDatabase.GetOrLoadByName("Base_Forge");
                CatacombsDungeonPrefab  = DungeonDatabase.GetOrLoadByName("Base_Catacombs");
                NakatomiDungeonPrefab   = DungeonDatabase.GetOrLoadByName("base_nakatomi");



                reward_room          = shared_auto_002.LoadAsset <PrototypeDungeonRoom>("reward room");
                gungeon_rewardroom_1 = shared_auto_002.LoadAsset <PrototypeDungeonRoom>("gungeon_rewardroom_1");
                shop_room_table      = shared_auto_002.LoadAsset <GenericRoomTable>("Shop Room Table");
                shop02          = shared_auto_002.LoadAsset <PrototypeDungeonRoom>("shop02");
                boss_foyertable = shared_auto_002.LoadAsset <GenericRoomTable>("Boss Foyers");

                FloorNameRoomTable = ScriptableObject.CreateInstance <GenericRoomTable>();
                FloorNameRoomTable.includedRooms          = new WeightedRoomCollection();
                FloorNameRoomTable.includedRooms.elements = new List <WeightedRoom>();
                FloorNameRoomTable.includedRoomTables     = new List <GenericRoomTable>(0);

                SecretRoomTable = shared_auto_002.LoadAsset <GenericRoomTable>("secret_room_table_01");

                CastleRoomTable     = shared_auto_002.LoadAsset <GenericRoomTable>("Castle_RoomTable");
                Gungeon_RoomTable   = shared_auto_002.LoadAsset <GenericRoomTable>("Gungeon_RoomTable");
                SewersRoomTable     = SewerDungeonPrefab.PatternSettings.flows[0].fallbackRoomTable;
                AbbeyRoomTable      = CathedralDungeonPrefab.PatternSettings.flows[0].fallbackRoomTable;
                MinesRoomTable      = MinesDungeonPrefab.PatternSettings.flows[0].fallbackRoomTable;
                CatacombsRoomTable  = CatacombsDungeonPrefab.PatternSettings.flows[0].fallbackRoomTable;
                ForgeRoomTable      = ForgeDungeonPrefab.PatternSettings.flows[0].fallbackRoomTable;
                BulletHellRoomTable = BulletHellDungeonPrefab.PatternSettings.flows[0].fallbackRoomTable;

                doublebeholsterroom01 = FloorNameDungeonFlows.LoadOfficialFlow("Secret_DoubleBeholster_Flow").AllNodes[2].overrideExactRoom;
            }
            catch (Exception e)
            {
                Tools.Print(e);
            }
        }
        public static void InitFlow()
        {
            Dungeon CatacombsPrefab = DungeonDatabase.GetOrLoadByName("Base_Catacombs");

            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.name = "TEST_West_Floor_03a_Flow";
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.fallbackRoomTable   = CatacombsPrefab.PatternSettings.flows[0].fallbackRoomTable;
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.subtypeRestrictions = new List <DungeonFlowSubtypeRestriction>()
            {
                TestSubTypeRestriction
            };
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.flowInjectionData   = new List <ProceduralFlowModifierData>(0);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.sharedInjectionData = new List <SharedInjectionData>(0);

            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.Initialize();

            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_00, null);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_01, TestNode_10);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_02, TestNode_01);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_03, TestNode_02);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_04, TestNode_00);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_05, TestNode_04);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_06, TestNode_11);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_07, TestNode_06);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_08, TestNode_21);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_09, TestNode_08);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_10, TestNode_09);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_11, TestNode_05);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_12, TestNode_11);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_13, TestNode_12);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_14, TestNode_21);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_15, TestNode_07);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_16, TestNode_14);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_17, TestNode_10);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_18, TestNode_17);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_19, TestNode_18);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_20, TestNode_19);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_21, TestNode_15);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_22, TestNode_07);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_23, TestNode_09);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.AddNodeToFlow(TestNode_24, TestNode_18);

            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.LoopConnectNodes(TestNode_13, TestNode_05);
            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.LoopConnectNodes(TestNode_20, TestNode_10);

            ChaosDungeonFlows.TEST_West_Floor_03a_Flow.FirstNode = TestNode_00;

            // Null any Dungeon prefabs you call up when done else you'll break level generation for that prefab on future level loads!
            CatacombsPrefab = null;
        }
        private void HandleTriggerEntered(SpeculativeRigidbody specRigidbody, SpeculativeRigidbody sourceSpecRigidbody, CollisionData collisionData)
        {
            PlayerController component = specRigidbody.GetComponent <PlayerController>();

            if (component)
            {
                if (IsSecretGlitchFloorPit)
                {
                    GameManager.Instance.InjectedFlowPath = "secretglitchfloor_flow";
                    ExpandUtility.RatDungeon = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat");
                    ExpandUtility.RatDungeon.LevelOverrideType = GameManager.LevelOverrideState.NONE;
                    ExpandPrefabs.InitCanyonTileSet(ExpandUtility.RatDungeon, GlobalDungeonData.ValidTilesets.PHOBOSGEON);
                }
                component.LevelToLoadOnPitfall = targetLevelName;
            }
        }
 public void Interact(PlayerController player)
 {
     if (IsValidForUse())
     {
         if (IsSecretGlitchFloorPit)
         {
             ExpandUtility.RatDungeon = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat");
             ExpandUtility.RatDungeon.LevelOverrideType = GameManager.LevelOverrideState.NONE;
             ExpandPrefabs.InitCanyonTileSet(ExpandUtility.RatDungeon, GlobalDungeonData.ValidTilesets.PHOBOSGEON);
             GameManager.Instance.StartCoroutine(ExpandUtility.DelayedGlitchLevelLoad(1f, "SecretGlitchFloor_Flow", true));
         }
         else
         {
             GameManager.Instance.LoadCustomLevel(targetLevelName);
         }
     }
 }
        public static void AddRainStormToFloor(string dungeon, float RainIntensity = 1f, bool useCustomIntensity = false)
        {
            if (string.IsNullOrEmpty(dungeon))
            {
                return;
            }
            GameObject dungeonObject = GameObject.Find(dungeon);

            if (dungeonObject == null)
            {
                dungeonObject = GameObject.Find(dungeon + "(Clone)");
            }
            if (dungeonObject == null)
            {
                return;
            }
            Dungeon              m_dungeonPrefab     = DungeonDatabase.GetOrLoadByName("finalscenario_guide");
            DungeonFlow          dungeonFlowPrefab   = m_dungeonPrefab.PatternSettings.flows[0];
            PrototypeDungeonRoom GuidePastRoom       = dungeonFlowPrefab.AllNodes[0].overrideExactRoom;
            GameObject           GuidePastRoomObject = GuidePastRoom.placedObjects[0].nonenemyBehaviour.gameObject;
            GameObject           m_RainPrefab        = GuidePastRoomObject.transform.Find("Rain").gameObject;
            GameObject           m_ThunderStorm      = Instantiate(m_RainPrefab);

            m_ThunderStorm.name = "ChaosRain";
            ThunderstormController stormController        = m_ThunderStorm.GetComponent <ThunderstormController>();
            ParticleSystem         m_CachedParticleSystem = stormController.RainSystemTransform.GetComponent <ParticleSystem>();

            if (useCustomIntensity)
            {
                BraveUtility.SetEmissionRate(m_CachedParticleSystem, RainIntensity);
            }
            stormController.DecayVertical = false;
            stormController.DoLighting    = false;
            GameObject m_ChaosLightning = new GameObject("ChaosLightning");

            m_ChaosLightning.name = "ChaosLightning";
            m_ChaosLightning.AddComponent <ChaosWeatherController>();
            ChaosWeatherController LightningComponent = m_ChaosLightning.GetComponent <ChaosWeatherController>();

            LightningComponent.LightningRenderers = stormController.LightningRenderers;
            dungeonFlowPrefab = null;
            m_dungeonPrefab   = null;
            return;
        }
        public static void Init()
        {
            AssetBundles = new Dictionary <string, AssetBundle>();
            foreach (var name in assetBundleNames)
            {
                try
                {
                    var bundle = ResourceManager.LoadAssetBundle(name);
                    AssetBundles.Add(name, ResourceManager.LoadAssetBundle(name));
                }
                catch (Exception e)
                {
                    Tools.PrintError($"Failed to load asset bundle: {name}");
                    Tools.PrintException(e);
                }
            }


            RoomTables = new Dictionary <string, GenericRoomTable>();
            foreach (var entry in roomTableMap)
            {
                try
                {
                    var table = GetAsset <GenericRoomTable>(entry.Value);
                    if (table == null)
                    {
                        table = DungeonDatabase.GetOrLoadByName($"base_{entry.Key}").PatternSettings.flows[0].fallbackRoomTable;
                    }
                    RoomTables.Add(entry.Key, table);
                    //Tools.Log(table.name);
                }
                catch (Exception e)
                {
                    Tools.PrintError($"Failed to load room table: {entry.Key}:{entry.Value}");
                    Tools.PrintException(e);
                }
            }
            Tools.Print("Static references initialized.");
        }
Esempio n. 15
0
 // Token: 0x06000079 RID: 121 RVA: 0x00006768 File Offset: 0x00004968
 public static void Init()
 {
     StaticReferences.AssetBundles = new Dictionary <string, AssetBundle>();
     foreach (string text in StaticReferences.assetBundleNames)
     {
         try
         {
             AssetBundle assetBundle = ResourceManager.LoadAssetBundle(text);
             StaticReferences.AssetBundles.Add(text, ResourceManager.LoadAssetBundle(text));
         }
         catch (Exception e)
         {
             Tools.PrintError <string>("Failed to load asset bundle: " + text, "FF0000");
             Tools.PrintException(e, "FF0000");
         }
     }
     StaticReferences.RoomTables = new Dictionary <string, GenericRoomTable>();
     foreach (KeyValuePair <string, string> keyValuePair in StaticReferences.roomTableMap)
     {
         try
         {
             GenericRoomTable genericRoomTable = StaticReferences.GetAsset <GenericRoomTable>(keyValuePair.Value);
             bool             flag             = genericRoomTable == null;
             bool             flag2            = flag;
             if (flag2)
             {
                 genericRoomTable = DungeonDatabase.GetOrLoadByName("base_" + keyValuePair.Key).PatternSettings.flows[0].fallbackRoomTable;
             }
             StaticReferences.RoomTables.Add(keyValuePair.Key, genericRoomTable);
         }
         catch (Exception e2)
         {
             Tools.PrintError <string>("Failed to load room table: " + keyValuePair.Key + ":" + keyValuePair.Value, "FF0000");
             Tools.PrintException(e2, "FF0000");
         }
     }
     Tools.Print <string>("Static references initialized.", "FFFFFF", false);
 }
Esempio n. 16
0
 /// <summary>
 /// Sets the base assembly of the ResourceExtractor, so
 /// resources can be accessed
 /// </summary>
 public static void Init()
 {
     try
     {
         MethodBase method        = new StackFrame(1, false).GetMethod();
         var        declaringType = method.DeclaringType;
         ResourceExtractor.SetAssembly(declaringType);
         ItemBuilder.sharedAssets        = ResourceManager.LoadAssetBundle("shared_auto_001");
         ItemBuilder.Shop_Key_Items_01   = ItemBuilder.sharedAssets.LoadAsset <GenericLootTable>("Shop_Key_Items_01");
         ItemBuilder.Shop_Truck_Items_01 = ItemBuilder.sharedAssets.LoadAsset <GenericLootTable>("Shop_Truck_Items_01");
         ItemBuilder.Shop_Curse_Items_01 = ItemBuilder.sharedAssets.LoadAsset <GenericLootTable>("Shop_Curse_Items_01");
         ItemBuilder.Shop_Goop_Items_01  = ItemBuilder.sharedAssets.LoadAsset <GenericLootTable>("Shop_Goop_Items_01");
         ItemBuilder.Shop_Blank_Items_01 = ItemBuilder.sharedAssets.LoadAsset <GenericLootTable>("Shop_Blank_Items_01");
         ItemBuilder.ForgeDungeonPrefab  = DungeonDatabase.GetOrLoadByName("Base_Forge");
         ItemBuilder.BlacksmithShop      = ItemBuilder.ForgeDungeonPrefab.PatternSettings.flows[0].AllNodes[10].overrideExactRoom;
         ItemBuilder.BlackSmith_Items_01 = (ItemBuilder.BlacksmithShop.placedObjects[8].nonenemyBehaviour as BaseShopController).shopItemsGroup2;
     }
     catch (Exception e)
     {
         ETGModConsole.Log(e.Message);
         ETGModConsole.Log(e.StackTrace);
     }
 }
Esempio n. 17
0
        public static void InitDungeonFlows(bool refreshFlows = false)
        {
            try {
                Dungeon TutorialPrefab       = DungeonDatabase.GetOrLoadByName("Base_Tutorial");
                Dungeon CastlePrefab         = DungeonDatabase.GetOrLoadByName("Base_Castle");
                Dungeon SewerPrefab          = DungeonDatabase.GetOrLoadByName("Base_Sewer");
                Dungeon GungeonPrefab        = DungeonDatabase.GetOrLoadByName("Base_Gungeon");
                Dungeon CathedralPrefab      = DungeonDatabase.GetOrLoadByName("Base_Cathedral");
                Dungeon MinesPrefab          = DungeonDatabase.GetOrLoadByName("Base_Mines");
                Dungeon ResourcefulRatPrefab = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat");
                Dungeon CatacombsPrefab      = DungeonDatabase.GetOrLoadByName("Base_Catacombs");
                Dungeon NakatomiPrefab       = DungeonDatabase.GetOrLoadByName("Base_Nakatomi");
                Dungeon ForgePrefab          = DungeonDatabase.GetOrLoadByName("Base_Forge");
                Dungeon BulletHellPrefab     = DungeonDatabase.GetOrLoadByName("Base_BulletHell");

                BaseSharedInjectionData = ModPrefabs.shared_auto_002.LoadAsset <SharedInjectionData>("Base Shared Injection Data");
                GungeonInjectionData    = GungeonPrefab.PatternSettings.flows[0].sharedInjectionData[1];
                SewersInjectionData     = SewerPrefab.PatternSettings.flows[0].sharedInjectionData[1];
                HollowsInjectionData    = CatacombsPrefab.PatternSettings.flows[0].sharedInjectionData[1];
                CastleInjectionData     = CastlePrefab.PatternSettings.flows[0].sharedInjectionData[0];



                // Don't build/add flows until injection data is created!
                Foyer_Flow = FlowHelpers.DuplicateDungeonFlow(ModPrefabs.shared_auto_002.LoadAsset <DungeonFlow>("Foyer Flow"));

                // List<DungeonFlow> m_knownFlows = new List<DungeonFlow>();
                KnownFlows = new List <DungeonFlow>();

                //we will add our custom flow here soon.


                // Fix issues with nodes so that things other then MainMenu can load Foyer flow
                Foyer_Flow.name = "Foyer_Flow";
                Foyer_Flow.AllNodes[1].handlesOwnWarping = true;
                Foyer_Flow.AllNodes[2].handlesOwnWarping = true;
                Foyer_Flow.AllNodes[3].handlesOwnWarping = true;

                KnownFlows.Add(Foyer_Flow);
                KnownFlows.Add(f1b_Hat_flow_01.F1b_Hat_flow_01());
                // Add official flows to list (flows found in Dungeon asset bundles after AG&D)
                for (int i = 0; i < TutorialPrefab.PatternSettings.flows.Count; i++)
                {
                    KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(TutorialPrefab.PatternSettings.flows[i]));
                }
                for (int i = 0; i < CastlePrefab.PatternSettings.flows.Count; i++)
                {
                    KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(CastlePrefab.PatternSettings.flows[i]));
                }
                for (int i = 0; i < SewerPrefab.PatternSettings.flows.Count; i++)
                {
                    KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(SewerPrefab.PatternSettings.flows[i]));
                }
                for (int i = 0; i < GungeonPrefab.PatternSettings.flows.Count; i++)
                {
                    KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(GungeonPrefab.PatternSettings.flows[i]));
                }
                for (int i = 0; i < MinesPrefab.PatternSettings.flows.Count; i++)
                {
                    KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(MinesPrefab.PatternSettings.flows[i]));
                }
                for (int i = 0; i < ResourcefulRatPrefab.PatternSettings.flows.Count; i++)
                {
                    KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(ResourcefulRatPrefab.PatternSettings.flows[i]));
                }
                for (int i = 0; i < CatacombsPrefab.PatternSettings.flows.Count; i++)
                {
                    KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(CatacombsPrefab.PatternSettings.flows[i]));
                }
                for (int i = 0; i < NakatomiPrefab.PatternSettings.flows.Count; i++)
                {
                    KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(NakatomiPrefab.PatternSettings.flows[i]));
                }
                for (int i = 0; i < ForgePrefab.PatternSettings.flows.Count; i++)
                {
                    KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(ForgePrefab.PatternSettings.flows[i]));
                }
                for (int i = 0; i < BulletHellPrefab.PatternSettings.flows.Count; i++)
                {
                    KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(BulletHellPrefab.PatternSettings.flows[i]));
                }

                for (int i = 0; i < CathedralPrefab.PatternSettings.flows.Count; i++)
                {
                    KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(CathedralPrefab.PatternSettings.flows[i]));
                }


                TutorialPrefab       = null;
                CastlePrefab         = null;
                SewerPrefab          = null;
                GungeonPrefab        = null;
                CathedralPrefab      = null;
                MinesPrefab          = null;
                ResourcefulRatPrefab = null;
                CatacombsPrefab      = null;
                CathedralPrefab      = null;
                NakatomiPrefab       = null;
                ForgePrefab          = null;
                BulletHellPrefab     = null;
            }
            catch (Exception e)
            {
                Tools.Print(e);
            }
        }
Esempio n. 18
0
        public static Dungeon FloorNameGeon(Dungeon dungeon)
        {
            Dungeon         MinesDungeonPrefab         = GetOrLoadByName_Orig("Base_Mines");
            Dungeon         CatacombsPrefab            = GetOrLoadByName_Orig("Base_Catacombs");
            Dungeon         RatDungeonPrefab           = GetOrLoadByName_Orig("Base_ResourcefulRat");
            Dungeon         CathedralPrefab            = DungeonDatabase.GetOrLoadByName("Base_Cathedral");
            DungeonMaterial FinalScenario_MainMaterial = UnityEngine.Object.Instantiate(CathedralPrefab.roomMaterialDefinitions[0]);

            dungeon.roomMaterialDefinitions[0].AmbientPitVFX    = CathedralPrefab.roomMaterialDefinitions[0].AmbientPitVFX;
            dungeon.roomMaterialDefinitions[0].UsePitAmbientVFX = true;
            FinalScenario_MainMaterial.supportsPits             = true;
            FinalScenario_MainMaterial.doPitAO = true;
            // FinalScenario_MainMaterial.pitsAreOneDeep = true;
            FinalScenario_MainMaterial.useLighting = true;
            // FinalScenario_MainMaterial.supportsLavaOrLavalikeSquares = true;
            FinalScenario_MainMaterial.lightPrefabs.elements[0].rawGameObject = MinesDungeonPrefab.roomMaterialDefinitions[0].lightPrefabs.elements[0].rawGameObject;
            FinalScenario_MainMaterial.roomFloorBorderGrid = CathedralPrefab.roomMaterialDefinitions[0].roomFloorBorderGrid;
            FinalScenario_MainMaterial.pitLayoutGrid       = CathedralPrefab.roomMaterialDefinitions[0].pitLayoutGrid;
            FinalScenario_MainMaterial.pitBorderFlatGrid   = CathedralPrefab.roomMaterialDefinitions[0].pitBorderFlatGrid;

            DungeonTileStampData m_FloorNameStampData = ScriptableObject.CreateInstance <DungeonTileStampData>();

            m_FloorNameStampData.name                    = "ENV_FloorName_STAMP_DATA";
            m_FloorNameStampData.tileStampWeight         = 0;
            m_FloorNameStampData.spriteStampWeight       = 0;
            m_FloorNameStampData.objectStampWeight       = 1;
            m_FloorNameStampData.stamps                  = new TileStampData[0];
            m_FloorNameStampData.spriteStamps            = new SpriteStampData[0];
            m_FloorNameStampData.objectStamps            = CathedralPrefab.stampData.objectStamps;
            m_FloorNameStampData.SymmetricFrameChance    = 0.25f;
            m_FloorNameStampData.SymmetricCompleteChance = 0.6f;

            dungeon.gameObject.name  = "Base_FloorName";
            dungeon.contentSource    = ContentSource.CONTENT_UPDATE_03;
            dungeon.DungeonSeed      = 0;
            dungeon.DungeonFloorName = "The Bishop's Chapel";                             // what shows up At the top when floor is loaded
            dungeon.DungeonShortName = "The Bishop's Chapel";                             // no clue lol, just make it the same
            dungeon.DungeonFloorLevelTextOverride = "God giveth, and god taketh away..."; // what shows up below the floorname
            dungeon.LevelOverrideType             = GameManager.LevelOverrideState.NONE;
            dungeon.debugSettings = new DebugDungeonSettings()
            {
                RAPID_DEBUG_DUNGEON_ITERATION_SEEKER = false,
                RAPID_DEBUG_DUNGEON_ITERATION        = false,
                RAPID_DEBUG_DUNGEON_COUNT            = 50,
                GENERATION_VIEWER_MODE  = false,
                FULL_MINIMAP_VISIBILITY = false,
                COOP_TEST                  = false,
                DISABLE_ENEMIES            = false,
                DISABLE_LOOPS              = false,
                DISABLE_SECRET_ROOM_COVERS = false,
                DISABLE_OUTLINES           = false,
                WALLS_ARE_PITS             = false
            };
            dungeon.ForceRegenerationOfCharacters = false;
            dungeon.ActuallyGenerateTilemap       = true;
            dungeon.tileIndices = new TileIndices()
            {
                tilesetId = (GlobalDungeonData.ValidTilesets)CustomValidTilesets.TOPHATGEON, //sets it to our floors CustomValidTileset

                //since the tileset im using here is a copy of the Rat dungeon tileset, the first variable in ReplaceDungeonCollection is RatDungeonPrefab.tileIndices.dungeonCollection,
                //otherwise we will use a different dungeon prefab
                dungeonCollection = Toolbox.ReplaceDungeonCollection(CathedralPrefab.tileIndices.dungeonCollection, ModPrefabs.tileset),
                dungeonCollectionSupportsDiagonalWalls = false,
                aoTileIndices        = CathedralPrefab.tileIndices.aoTileIndices,
                placeBorders         = true,
                placePits            = false,
                chestHighWallIndices = new List <TileIndexVariant>()
                {
                    new TileIndexVariant()
                    {
                        index              = 41,
                        likelihood         = 0.5f,
                        overrideLayerIndex = 0,
                        overrideIndex      = 0
                    }
                },
                decalIndexGrid   = null,
                patternIndexGrid = RatDungeonPrefab.tileIndices.patternIndexGrid,

                globalSecondBorderTiles = new List <int>(0),
                edgeDecorationTiles     = null
            };

            dungeon.tileIndices.dungeonCollection.name = "ENV_Tileset_DARKZONE";
            dungeon.roomMaterialDefinitions            = new DungeonMaterial[] {
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial,
                FinalScenario_MainMaterial
            };
            dungeon.dungeonWingDefinitions = new DungeonWingDefinition[0];

            //This section can be used to take parts from other floors and use them as our own.
            //we can make the running dust from one floor our own, the tables from another our own,
            //we can use all of the stuff from the same floor, or if you want, you can make your own.
            dungeon.pathGridDefinitions = new List <TileIndexGrid>()
            {
                MinesDungeonPrefab.pathGridDefinitions[0]
            };
            dungeon.dungeonDustups = new DustUpVFX()
            {
                runDustup             = MinesDungeonPrefab.dungeonDustups.runDustup,
                waterDustup           = MinesDungeonPrefab.dungeonDustups.waterDustup,
                additionalWaterDustup = MinesDungeonPrefab.dungeonDustups.additionalWaterDustup,
                rollNorthDustup       = MinesDungeonPrefab.dungeonDustups.rollNorthDustup,
                rollNorthEastDustup   = MinesDungeonPrefab.dungeonDustups.rollNorthEastDustup,
                rollEastDustup        = MinesDungeonPrefab.dungeonDustups.rollEastDustup,
                rollSouthEastDustup   = MinesDungeonPrefab.dungeonDustups.rollSouthEastDustup,
                rollSouthDustup       = MinesDungeonPrefab.dungeonDustups.rollSouthDustup,
                rollSouthWestDustup   = MinesDungeonPrefab.dungeonDustups.rollSouthWestDustup,
                rollWestDustup        = MinesDungeonPrefab.dungeonDustups.rollWestDustup,
                rollNorthWestDustup   = MinesDungeonPrefab.dungeonDustups.rollNorthWestDustup,
                rollLandDustup        = MinesDungeonPrefab.dungeonDustups.rollLandDustup
            };
            dungeon.PatternSettings = new SemioticDungeonGenSettings()
            {
                flows = new List <DungeonFlow>()
                {
                    f1b_Hat_flow_01.F1b_Hat_flow_01(),
                },
                mandatoryExtraRooms              = new List <ExtraIncludedRoomData>(0),
                optionalExtraRooms               = new List <ExtraIncludedRoomData>(0),
                MAX_GENERATION_ATTEMPTS          = 250,
                DEBUG_RENDER_CANVASES_SEPARATELY = false
            };

            dungeon.damageTypeEffectMatrix = MinesDungeonPrefab.damageTypeEffectMatrix;
            dungeon.stampData           = m_FloorNameStampData;
            dungeon.UsesCustomFloorIdea = false;
            dungeon.FloorIdea           = new RobotDaveIdea()
            {
                ValidEasyEnemyPlaceables = new DungeonPlaceable[0],
                ValidHardEnemyPlaceables = new DungeonPlaceable[0],
                UseWallSawblades         = false,
                UseRollingLogsVertical   = true,
                UseRollingLogsHorizontal = true,
                UseFloorPitTraps         = true,
                UseFloorFlameTraps       = true,
                UseFloorSpikeTraps       = true,
                UseFloorConveyorBelts    = true,
                UseCaveIns        = true,
                UseAlarmMushrooms = false,
                UseChandeliers    = true,
                UseMineCarts      = false,
                CanIncludePits    = true
            };

            //more variable we can copy from other floors, or make our own
            dungeon.PlaceDoors                       = true;
            dungeon.doorObjects                      = CathedralPrefab.doorObjects;
            dungeon.oneWayDoorObjects                = CathedralPrefab.oneWayDoorObjects;
            dungeon.oneWayDoorPressurePlate          = CathedralPrefab.oneWayDoorPressurePlate;
            dungeon.phantomBlockerDoorObjects        = CathedralPrefab.phantomBlockerDoorObjects;
            dungeon.UsesWallWarpWingDoors            = false;
            dungeon.baseChestContents                = CatacombsPrefab.baseChestContents;
            dungeon.SecretRoomSimpleTriggersFacewall = new List <GameObject>()
            {
                CatacombsPrefab.SecretRoomSimpleTriggersFacewall[0]
            };
            dungeon.SecretRoomSimpleTriggersSidewall = new List <GameObject>()
            {
                CatacombsPrefab.SecretRoomSimpleTriggersSidewall[0]
            };
            dungeon.SecretRoomComplexTriggers   = new List <ComplexSecretRoomTrigger>(0);
            dungeon.SecretRoomDoorSparkVFX      = CatacombsPrefab.SecretRoomDoorSparkVFX;
            dungeon.SecretRoomHorizontalPoofVFX = CatacombsPrefab.SecretRoomHorizontalPoofVFX;
            dungeon.SecretRoomVerticalPoofVFX   = CatacombsPrefab.SecretRoomVerticalPoofVFX;
            dungeon.sharedSettingsPrefab        = CatacombsPrefab.sharedSettingsPrefab;
            dungeon.NormalRatGUID                = string.Empty;
            dungeon.BossMasteryTokenItemId       = CatacombsPrefab.BossMasteryTokenItemId;
            dungeon.UsesOverrideTertiaryBossSets = false;
            dungeon.OverrideTertiaryRewardSets   = new List <TertiaryBossRewardSet>(0);
            dungeon.defaultPlayerPrefab          = MinesDungeonPrefab.defaultPlayerPrefab;
            dungeon.StripPlayerOnArrival         = false;
            dungeon.SuppressEmergencyCrates      = false;
            dungeon.SetTutorialFlag              = false;
            dungeon.PlayerIsLight                = true;
            dungeon.PlayerLightColor             = CatacombsPrefab.PlayerLightColor;
            dungeon.PlayerLightIntensity         = 4;
            dungeon.PlayerLightRadius            = 4;
            dungeon.PrefabsToAutoSpawn           = new GameObject[0];

            //include this for custom floor audio
            //dungeon.musicEventName = "play_sound";


            CatacombsPrefab    = null;
            RatDungeonPrefab   = null;
            MinesDungeonPrefab = null;
            CathedralPrefab    = null;
            return(dungeon);
        }
        public static void Init()
        {
            #region SpecialLoot
            NonRatStealableArmor = PickupObjectDatabase.GetById(120).gameObject.InstantiateAndFakeprefab();
            NonRatStealableArmor.GetComponent <PickupObject>().IgnoredByRat = true;

            NonRatStealableAmmo = PickupObjectDatabase.GetById(78).gameObject.InstantiateAndFakeprefab();
            NonRatStealableAmmo.GetComponent <PickupObject>().IgnoredByRat = true;

            NonRatStealableSpreadAmmo = PickupObjectDatabase.GetById(600).gameObject.InstantiateAndFakeprefab();
            NonRatStealableSpreadAmmo.GetComponent <PickupObject>().IgnoredByRat = true;

            MapPlaceable = PickupObjectDatabase.GetById(137).gameObject.InstantiateAndFakeprefab();
            MapPlaceable.GetComponent <PickupObject>().IgnoredByRat = true;
            MapPlaceable.GetOrAddComponent <SquishyBounceWiggler>();

            GlassGuonPlaceable = PickupObjectDatabase.GetById(565).gameObject.InstantiateAndFakeprefab();
            GlassGuonPlaceable.GetComponent <PickupObject>().IgnoredByRat = true;
            GlassGuonPlaceable.GetOrAddComponent <SquishyBounceWiggler>();

            FiftyCasingPlaceable = PickupObjectDatabase.GetById(74).gameObject.InstantiateAndFakeprefab();
            if (FiftyCasingPlaceable.GetComponent <PickupMover>())
            {
                UnityEngine.Object.Destroy(FiftyCasingPlaceable.GetComponent <PickupMover>());
            }

            SingleCasingPlaceable = PickupObjectDatabase.GetById(68).gameObject.InstantiateAndFakeprefab();
            if (SingleCasingPlaceable.GetComponent <PickupMover>())
            {
                UnityEngine.Object.Destroy(SingleCasingPlaceable.GetComponent <PickupMover>());
            }

            FiveCasingPlaceable = PickupObjectDatabase.GetById(70).gameObject.InstantiateAndFakeprefab();
            if (FiveCasingPlaceable.GetComponent <PickupMover>())
            {
                UnityEngine.Object.Destroy(FiveCasingPlaceable.GetComponent <PickupMover>());
            }
            #endregion
            #region NonFloorStolen
            BulletKingThrone = EnemyDatabase.GetOrLoadByGuid("ffca09398635467da3b1f4a54bcfda80").GetComponent <BulletKingDeathController>().thronePrefab.InstantiateAndFakeprefab();
            OldKingThrone    = EnemyDatabase.GetOrLoadByGuid("5729c8b5ffa7415bb3d01205663a33ef").GetComponent <BulletKingDeathController>().thronePrefab.InstantiateAndFakeprefab();
            GameObject skeletonNote = LoadHelper.LoadAssetFromAnywhere <GameObject>("assets/data/prefabs/interactable objects/notes/skeleton_note_001.prefab");
            SecretRoomSkeleton = skeletonNote.transform.Find("skleleton").gameObject.InstantiateAndFakeprefab();
            #endregion
            #region Oubliette
            Dungeon sewerDungeon = DungeonDatabase.GetOrLoadByName("base_sewer");
            foreach (WeightedRoom wRoom in sewerDungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements)
            {
                if (wRoom.room != null && !string.IsNullOrEmpty(wRoom.room.name))
                {
                    if (wRoom.room.name.ToLower().StartsWith("sewer_trash_compactor_001"))
                    {
                        HorizontalCrusher = wRoom.room.placedObjects[0].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                    }
                }
            }
            sewerDungeon = null;
            #endregion
            #region Abbey
            Dungeon abbeyDungeon = DungeonDatabase.GetOrLoadByName("base_cathedral");
            foreach (WeightedRoom wRoom in abbeyDungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements)
            {
                if (wRoom.room != null && !string.IsNullOrEmpty(wRoom.room.name))
                {
                    if (wRoom.room.name.ToLower().StartsWith("cathedral_brent_standard_02"))
                    {
                        Pew = wRoom.room.placedObjects[0].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                    }
                }
            }
            abbeyDungeon = null;
            #endregion
            #region R&GDept
            Dungeon rngDungeon = DungeonDatabase.GetOrLoadByName("base_nakatomi");
            if (rngDungeon)
            {
                if (rngDungeon.PatternSettings.flows[0].name == "FS4_Nakatomi_Flow")
                {
                    if (rngDungeon.PatternSettings.flows[0].AllNodes.Count == 14)
                    {
                        MopAndBucket               = rngDungeon.PatternSettings.flows[0].AllNodes[0].overrideExactRoom.placedObjects[0].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        CardboardBox3              = rngDungeon.PatternSettings.flows[0].AllNodes[0].overrideExactRoom.placedObjects[2].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        ACUnit                     = rngDungeon.PatternSettings.flows[0].AllNodes[1].overrideExactRoom.placedObjects[1].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        ACVent                     = rngDungeon.PatternSettings.flows[0].AllNodes[1].overrideExactRoom.placedObjects[2].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        KitchenChairFront          = rngDungeon.PatternSettings.flows[0].AllNodes[4].overrideExactRoom.placedObjects[1].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        KitchenChairLeft           = rngDungeon.PatternSettings.flows[0].AllNodes[4].overrideExactRoom.placedObjects[8].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        KitchenChairRight          = rngDungeon.PatternSettings.flows[0].AllNodes[4].overrideExactRoom.placedObjects[12].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        KitchenCounter             = rngDungeon.PatternSettings.flows[0].AllNodes[4].overrideExactRoom.placedObjects[16].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        SteelTableHorizontal       = rngDungeon.PatternSettings.flows[0].AllNodes[4].overrideExactRoom.placedObjects[6].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        SteelTableVertical         = rngDungeon.PatternSettings.flows[0].AllNodes[4].overrideExactRoom.placedObjects[3].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        BathroomStallDividerNorth  = rngDungeon.PatternSettings.flows[0].AllNodes[6].overrideExactRoom.placedObjects[0].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        BathroomStallDividerEast   = rngDungeon.PatternSettings.flows[0].AllNodes[6].overrideExactRoom.placedObjects[6].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        BathroomStallDividerWest   = rngDungeon.PatternSettings.flows[0].AllNodes[6].overrideExactRoom.placedObjects[9].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        ToiletNorth                = rngDungeon.PatternSettings.flows[0].AllNodes[6].overrideExactRoom.placedObjects[2].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        ToiletEast                 = rngDungeon.PatternSettings.flows[0].AllNodes[6].overrideExactRoom.placedObjects[7].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        ToiletWest                 = rngDungeon.PatternSettings.flows[0].AllNodes[6].overrideExactRoom.placedObjects[10].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        GlassWallVertical          = rngDungeon.PatternSettings.flows[0].AllNodes[7].overrideExactRoom.placedObjects[0].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        GlassWallHorizontal        = rngDungeon.PatternSettings.flows[0].AllNodes[7].overrideExactRoom.placedObjects[6].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        LargeDesk                  = rngDungeon.PatternSettings.flows[0].AllNodes[8].overrideExactRoom.placedObjects[0].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        TechnoFloorCellEmpty       = rngDungeon.PatternSettings.flows[0].AllNodes[10].overrideExactRoom.placedObjects[0].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        TechnoFloorCellCaterpillar = rngDungeon.PatternSettings.flows[0].AllNodes[10].overrideExactRoom.placedObjects[4].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        TechnoFloorCellLeever      = rngDungeon.PatternSettings.flows[0].AllNodes[10].overrideExactRoom.placedObjects[13].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        TechnoFloorCellSpider      = rngDungeon.PatternSettings.flows[0].AllNodes[10].overrideExactRoom.placedObjects[14].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        WideComputerBreakable      = rngDungeon.PatternSettings.flows[0].AllNodes[10].overrideExactRoom.placedObjects[6].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        MetalCrate                 = rngDungeon.PatternSettings.flows[0].AllNodes[10].overrideExactRoom.placedObjects[10].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        HologramWallHorizontal     = rngDungeon.PatternSettings.flows[0].AllNodes[11].overrideExactRoom.placedObjects[0].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        HologramWallVertical       = rngDungeon.PatternSettings.flows[0].AllNodes[11].overrideExactRoom.placedObjects[7].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        VentilationTube            = rngDungeon.PatternSettings.flows[0].AllNodes[11].overrideExactRoom.placedObjects[8].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        TallComputerBreakable      = rngDungeon.PatternSettings.flows[0].AllNodes[11].overrideExactRoom.placedObjects[13].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        AgunimBossMatt             = rngDungeon.PatternSettings.flows[0].AllNodes[12].overrideExactRoom.placedObjects[1].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        AlienTank                  = rngDungeon.PatternSettings.flows[0].AllNodes[13].overrideExactRoom.placedObjects[9].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        DecorativeElectricFloor    = rngDungeon.PatternSettings.flows[0].AllNodes[13].overrideExactRoom.placedObjects[29].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                    }
                    else
                    {
                        ETGModConsole.Log("<color=#ff0000ff>ERROR: R&G DEPARTMENT FLOW 0 HAS AN INCORRECT AMOUNT OF NODES</color>");
                    }
                }
                else
                {
                    ETGModConsole.Log("<color=#ff0000ff>ERROR: R&G DEPARTMENT FLOW 0 HAS AN INCORRECT NAME, AND HAS BEEN ALTERED</color>");
                }
            }
            else
            {
                ETGModConsole.Log("<color=#ff0000ff>ERROR: R&G DEPARTMENT DUNGEON PREFAB WAS NULL</color>");
            }
            rngDungeon = null;
            #endregion
            #region Forge
            Dungeon forgeDungeon = DungeonDatabase.GetOrLoadByName("base_forge");
            foreach (WeightedRoom wRoom in forgeDungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements)
            {
                if (wRoom.room != null && !string.IsNullOrEmpty(wRoom.room.name))
                {
                    if (wRoom.room.name.ToLower().StartsWith("forge_normal_cubulead_03"))
                    {
                        VerticalCrusher = wRoom.room.placedObjects[0].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        FireBarTrap     = wRoom.room.placedObjects[7].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                    }
                    if (wRoom.room.name.ToLower().StartsWith("forge_connector_flamepipes_01"))
                    {
                        FlamePipeNorth = wRoom.room.placedObjects[1].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        FlamePipeWest  = wRoom.room.placedObjects[3].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                        FlamePipeEast  = wRoom.room.placedObjects[2].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                    }
                }
            }
            forgeDungeon = null;
            #endregion
            #region BulletHell
            Dungeon hellDungeon = DungeonDatabase.GetOrLoadByName("base_bullethell");
            foreach (WeightedRoom wRoom in hellDungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements)
            {
                if (wRoom.room != null && !string.IsNullOrEmpty(wRoom.room.name))
                {
                    if (wRoom.room.name.ToLower().StartsWith("hell_connector_pathburst_01"))
                    {
                        FlameburstTrap = wRoom.room.placedObjects[3].nonenemyBehaviour.gameObject.InstantiateAndFakeprefab();
                    }
                }
            }
            hellDungeon = null;
            #endregion
        }
        public static void BuildDatabase()
        {
            // Dungeon marinePastDungeon = DungeonDatabase.GetOrLoadByName("finalscenario_soldier");
            Dungeon convictPastDungeon = DungeonDatabase.GetOrLoadByName("finalscenario_convict");
            Dungeon catacombsDungeon   = DungeonDatabase.GetOrLoadByName("base_catacombs");
            Dungeon sewersDungeon      = DungeonDatabase.GetOrLoadByName("base_sewer");
            Dungeon forgeDungeon       = DungeonDatabase.GetOrLoadByName("base_forge");
            Dungeon gungeonDungeon     = DungeonDatabase.GetOrLoadByName("base_gungeon");
            Dungeon castleDungeon      = DungeonDatabase.GetOrLoadByName("base_castle");

            YellowDrum                = ExpandAssets.LoadOfficialAsset <GameObject>("Yellow Drum", ExpandAssets.AssetSource.SharedAuto2);
            RedDrum                   = ExpandAssets.LoadOfficialAsset <GameObject>("Red Drum", ExpandAssets.AssetSource.SharedAuto1);
            WaterDrum                 = ExpandAssets.LoadOfficialAsset <GameObject>("Blue Drum", ExpandAssets.AssetSource.SharedAuto2);
            OilDrum                   = ExpandAssets.LoadOfficialAsset <GameObject>("Purple Drum", ExpandAssets.AssetSource.SharedAuto2);
            IceBomb                   = ExpandAssets.LoadOfficialAsset <GameObject>("Ice Cube Bomb", ExpandAssets.AssetSource.SharedAuto2);
            TableHorizontal           = ExpandAssets.LoadOfficialAsset <GameObject>("Table_Horizontal", ExpandAssets.AssetSource.SharedAuto1);
            TableVertical             = ExpandAssets.LoadOfficialAsset <GameObject>("Table_Vertical", ExpandAssets.AssetSource.SharedAuto1);
            TableHorizontalStone      = ExpandAssets.LoadOfficialAsset <GameObject>("Table_Horizontal_Stone", ExpandAssets.AssetSource.SharedAuto1);
            TableVerticalStone        = ExpandAssets.LoadOfficialAsset <GameObject>("Table_Vertical_Stone", ExpandAssets.AssetSource.SharedAuto1);
            NPCOldMan                 = ExpandAssets.LoadOfficialAsset <GameObject>("NPC_Old_Man", ExpandAssets.AssetSource.SharedAuto1);
            NPCSynergrace             = ExpandAssets.LoadOfficialAsset <GameObject>("NPC_Synergrace", ExpandAssets.AssetSource.SharedAuto1);
            NPCTonic                  = ExpandAssets.LoadOfficialAsset <GameObject>("NPC_Tonic", ExpandAssets.AssetSource.SharedAuto1);
            NPCCursola                = ExpandAssets.LoadOfficialAsset <GameObject>("NPC_Curse_Jailed", ExpandAssets.AssetSource.SharedAuto2);
            NPCGunMuncher             = ExpandAssets.LoadOfficialAsset <GameObject>("NPC_GunberMuncher", ExpandAssets.AssetSource.SharedAuto2);
            NPCEvilMuncher            = ExpandAssets.LoadOfficialAsset <GameObject>("NPC_GunberMuncher_Evil", ExpandAssets.AssetSource.SharedAuto1);
            NPCMonsterManuel          = ExpandAssets.LoadOfficialAsset <GameObject>("NPC_Monster_Manuel", ExpandAssets.AssetSource.SharedAuto1);
            NPCVampire                = ExpandAssets.LoadOfficialAsset <GameObject>("NPC_Vampire", ExpandAssets.AssetSource.SharedAuto2);
            NPCGuardLeft              = ExpandAssets.LoadOfficialAsset <GameObject>("NPC_Guardian_Left", ExpandAssets.AssetSource.SharedAuto2);
            NPCGuardRight             = ExpandAssets.LoadOfficialAsset <GameObject>("NPC_Guardian_Right", ExpandAssets.AssetSource.SharedAuto2);
            NPCTruthKnower            = ExpandAssets.LoadOfficialAsset <GameObject>("NPC_Truth_Knower", ExpandAssets.AssetSource.SharedAuto1);
            NPCHeartDispenser         = ExpandAssets.LoadOfficialAsset <GameObject>("HeartDispenser", ExpandAssets.AssetSource.SharedAuto2);
            AmygdalaNorth             = ExpandAssets.LoadOfficialAsset <GameObject>("Amygdala_North", ExpandAssets.AssetSource.BraveResources);
            AmygdalaSouth             = ExpandAssets.LoadOfficialAsset <GameObject>("Amygdala_South", ExpandAssets.AssetSource.BraveResources);
            AmygdalaWest              = ExpandAssets.LoadOfficialAsset <GameObject>("Amygdala_West", ExpandAssets.AssetSource.BraveResources);
            AmygdalaEast              = ExpandAssets.LoadOfficialAsset <GameObject>("Amygdala_East", ExpandAssets.AssetSource.BraveResources);
            SpaceFog                  = ExpandAssets.LoadOfficialAsset <GameObject>("Space Fog", ExpandAssets.AssetSource.BraveResources);
            LockedDoor                = ExpandAssets.LoadOfficialAsset <GameObject>("SimpleLockedDoor", ExpandAssets.AssetSource.SharedAuto2);
            LockedJailDoor            = ExpandAssets.LoadOfficialAsset <GameObject>("JailDoor", ExpandAssets.AssetSource.SharedAuto2);
            SpikeTrap                 = ExpandAssets.LoadOfficialAsset <GameObject>("trap_spike_gungeon_2x2", ExpandAssets.AssetSource.SharedAuto1);
            FlameTrap                 = ExpandAssets.LoadOfficialAsset <GameObject>("trap_flame_poofy_gungeon_1x1", ExpandAssets.AssetSource.SharedAuto2);
            FakeTrap                  = ExpandAssets.LoadOfficialAsset <GameObject>("trap_pit_gungeon_trigger_2x2", ExpandAssets.AssetSource.SharedAuto1);
            PlayerCorpse              = ExpandAssets.LoadOfficialAsset <GameObject>("PlayerCorpse", ExpandAssets.AssetSource.BraveResources);
            TimefallCorpse            = ExpandAssets.LoadOfficialAsset <GameObject>("TimefallCorpse", ExpandAssets.AssetSource.BraveResources);
            ThoughtBubble             = ExpandAssets.LoadOfficialAsset <GameObject>("ThoughtBubble", ExpandAssets.AssetSource.BraveResources);
            HangingPot                = ExpandAssets.LoadOfficialAsset <GameObject>("Hanging_Pot", ExpandAssets.AssetSource.SharedAuto1);
            DoorsVertical             = ExpandAssets.LoadOfficialAsset <GameObject>("GungeonShopDoor_Vertical", ExpandAssets.AssetSource.SharedAuto2);
            DoorsHorizontal           = ExpandAssets.LoadOfficialAsset <GameObject>("GungeonShopDoor_Horizontal", ExpandAssets.AssetSource.SharedAuto2);
            DoorsHorizontal_Catacombs = catacombsDungeon.doorObjects.variantTiers[0].nonDatabasePlaceable;
            DoorsVertical_Catacombs   = catacombsDungeon.doorObjects.variantTiers[1].nonDatabasePlaceable;
            BigDoorsHorizontal        = ExpandAssets.LoadOfficialAsset <GameObject>("IronWoodDoor_Horizontal_Gungeon", ExpandAssets.AssetSource.SharedAuto2);
            BigDoorsVertical          = ExpandAssets.LoadOfficialAsset <GameObject>("IronWoodDoor_Vertical_Gungeon", ExpandAssets.AssetSource.SharedAuto2);
            RatTrapDoorIcon           = ExpandAssets.LoadOfficialAsset <GameObject>("RatTrapdoorMinimapIcon", ExpandAssets.AssetSource.BraveResources);
            CultistBaldBowBackLeft    = ExpandAssets.LoadOfficialAsset <GameObject>("CultistBaldBowBackLeft_cutout", ExpandAssets.AssetSource.SharedAuto2);
            CultistBaldBowBackRight   = ExpandAssets.LoadOfficialAsset <GameObject>("CultistBaldBowBackRight_cutout", ExpandAssets.AssetSource.SharedAuto2);
            CultistBaldBowBack        = ExpandAssets.LoadOfficialAsset <GameObject>("CultistBaldBowBack_cutout", ExpandAssets.AssetSource.SharedAuto2);
            CultistBaldBowLeft        = ExpandAssets.LoadOfficialAsset <GameObject>("CultistBaldBowLeft_cutout", ExpandAssets.AssetSource.SharedAuto2);
            CultistHoodBowBack        = ExpandAssets.LoadOfficialAsset <GameObject>("CultistHoodBowBack_cutout", ExpandAssets.AssetSource.SharedAuto2);
            CultistHoodBowLeft        = ExpandAssets.LoadOfficialAsset <GameObject>("CultistHoodBowLeft_cutout", ExpandAssets.AssetSource.SharedAuto2);
            CultistHoodBowRight       = ExpandAssets.LoadOfficialAsset <GameObject>("CultistHoodBowRight_cutout", ExpandAssets.AssetSource.SharedAuto2);
            ForgeHammer               = ExpandAssets.LoadOfficialAsset <GameObject>("Forge_Hammer", ExpandAssets.AssetSource.SharedAuto1);
            ChestBrownTwoItems        = ExpandAssets.LoadOfficialAsset <GameObject>("Chest_Wood_Two_Items", ExpandAssets.AssetSource.SharedAuto1);
            ChestTruth                = ExpandAssets.LoadOfficialAsset <GameObject>("TruthChest", ExpandAssets.AssetSource.SharedAuto1);
            ChestBlue                 = ChestTruth = ExpandAssets.LoadOfficialAsset <GameObject>("Chest_Silver", ExpandAssets.AssetSource.SharedAuto1);
            ChestRed                  = ChestTruth = ExpandAssets.LoadOfficialAsset <GameObject>("Chest_Red", ExpandAssets.AssetSource.SharedAuto1);
            ChestBlack                = ChestTruth = ExpandAssets.LoadOfficialAsset <GameObject>("Chest_Black", ExpandAssets.AssetSource.SharedAuto1);
            ChestRat                  = ExpandAssets.LoadOfficialAsset <GameObject>("Chest_Rat", ExpandAssets.AssetSource.SharedAuto1);
            ChestMirror               = ExpandAssets.LoadOfficialAsset <GameObject>("Shrine_Mirror", ExpandAssets.AssetSource.SharedAuto1);
            WinchesterMinimapIcon     = ExpandAssets.LoadOfficialAsset <GameObject>("minimap_winchester_icon", ExpandAssets.AssetSource.SharedAuto1);
            GatlingGullNest           = ExpandAssets.LoadOfficialAsset <GameObject>("gatlinggullnest", ExpandAssets.AssetSource.SharedAuto1);
            BabyDragunNPC             = ExpandAssets.LoadOfficialAsset <GameObject>("BabyDragunJail", ExpandAssets.AssetSource.SharedAuto2);
            GungeonLightStone         = ExpandAssets.LoadOfficialAsset <GameObject>("Gungeon Light (Stone)", ExpandAssets.AssetSource.SharedAuto1);
            GungeonLightPurple        = ExpandAssets.LoadOfficialAsset <GameObject>("Gungeon Light (Purple)", ExpandAssets.AssetSource.SharedAuto1);
            Sconce_Light              = ExpandAssets.LoadOfficialAsset <GameObject>("Sconce_Light", ExpandAssets.AssetSource.SharedAuto1);
            Sconce_Light_Side         = ExpandAssets.LoadOfficialAsset <GameObject>("Sconce_Light_Side", ExpandAssets.AssetSource.SharedAuto1);
            DefaultTorch              = ExpandAssets.LoadOfficialAsset <GameObject>("DefaultTorch", ExpandAssets.AssetSource.SharedAuto1);
            DefaultTorchSide          = ExpandAssets.LoadOfficialAsset <GameObject>("DefaultTorchSide", ExpandAssets.AssetSource.SharedAuto1);
            // GungeonWarpDoor = gungeonDungeon.WarpWingDoorPrefab;
            // CastleWarpDoor = castleDungeon.WarpWingDoorPrefab;
            EndTimes = ExpandAssets.LoadOfficialAsset <GameObject>("EndTimes", ExpandAssets.AssetSource.BraveResources);

            foreach (WeightedRoom wRoom in sewersDungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements)
            {
                if (wRoom.room != null && !string.IsNullOrEmpty(wRoom.room.name))
                {
                    if (wRoom.room.name.ToLower().StartsWith("sewer_trash_compactor_001"))
                    {
                        CrushDoor_Horizontal = wRoom.room.placedObjects[0].nonenemyBehaviour.gameObject;
                    }
                }
            }

            foreach (WeightedRoom wRoom in forgeDungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements)
            {
                if (wRoom.room != null && !string.IsNullOrEmpty(wRoom.room.name))
                {
                    if (wRoom.room.name.ToLower().StartsWith("forge_normal_cubulead_03"))
                    {
                        CrushDoor_Vertical = wRoom.room.placedObjects[0].nonenemyBehaviour.gameObject;
                    }
                }
            }

            // Dungeon Placables
            ExplodyBarrel      = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("ExplodyBarrel_Maybe", ExpandAssets.AssetSource.SharedAuto2);
            CoffinVertical     = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("Vertical Coffin", ExpandAssets.AssetSource.SharedAuto2);
            CoffinHorizontal   = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("Horizontal Coffin", ExpandAssets.AssetSource.SharedAuto2);
            Brazier            = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("Brazier", ExpandAssets.AssetSource.SharedAuto1);
            CursedPot          = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("Curse Pot", ExpandAssets.AssetSource.SharedAuto1);
            Sarcophogus        = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("Sarcophogus", ExpandAssets.AssetSource.SharedAuto1);
            GodRays            = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("Godrays_placeable", ExpandAssets.AssetSource.SharedAuto1);
            SpecialTraps       = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("RobotDaveTraps", ExpandAssets.AssetSource.BraveResources);
            PitTrap            = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("Pit Trap", ExpandAssets.AssetSource.SharedAuto2);
            Bush               = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("Bush", ExpandAssets.AssetSource.SharedAuto2);
            BushFlowers        = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("Bush Flowers", ExpandAssets.AssetSource.SharedAuto2);
            WoodenBarrel       = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("Barrel_collection", ExpandAssets.AssetSource.SharedAuto1);
            WrithingBulletman  = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("Writhing Bulletman", ExpandAssets.AssetSource.SharedAuto2);
            GungeonLockedDoors = gungeonDungeon.lockedDoorObjects;
            IronWoodDoors      = ExpandAssets.LoadOfficialAsset <DungeonPlaceable>("DoorTest", ExpandAssets.AssetSource.SharedAuto2);
            // DimensionFog = marinePastDungeon.PatternSettings.flows[0].AllNodes[0].overrideExactRoom.placedObjects[0].nonenemyBehaviour.gameObject.transform.Find("DimensionFog").gameObject;

            ConvictPastController    pastController  = convictPastDungeon.PatternSettings.flows[0].AllNodes[0].overrideExactRoom.placedObjects[0].nonenemyBehaviour.gameObject.GetComponent <ConvictPastController>();
            NightclubCrowdController crowdController = pastController.crowdController;

            ConvictPastCrowdNPC_01 = crowdController.Dancers[0].gameObject;
            ConvictPastCrowdNPC_02 = crowdController.Dancers[1].gameObject;
            ConvictPastCrowdNPC_03 = crowdController.Dancers[2].gameObject;
            ConvictPastCrowdNPC_04 = crowdController.Dancers[3].gameObject;
            ConvictPastCrowdNPC_05 = crowdController.Dancers[4].gameObject;
            ConvictPastCrowdNPC_06 = crowdController.Dancers[5].gameObject;
            ConvictPastCrowdNPC_07 = crowdController.Dancers[6].gameObject;
            ConvictPastCrowdNPC_08 = crowdController.Dancers[7].gameObject;
            ConvictPastCrowdNPC_09 = crowdController.Dancers[8].gameObject;
            ConvictPastCrowdNPC_10 = crowdController.Dancers[9].gameObject;
            ConvictPastCrowdNPC_11 = crowdController.Dancers[10].gameObject;
            ConvictPastCrowdNPC_12 = crowdController.Dancers[11].gameObject;
            ConvictPastCrowdNPC_13 = crowdController.Dancers[12].gameObject;
            ConvictPastCrowdNPC_14 = crowdController.Dancers[13].gameObject;
            ConvictPastCrowdNPC_15 = crowdController.Dancers[14].gameObject;
            ConvictPastCrowdNPC_16 = crowdController.Dancers[15].gameObject;

            ConvictPastDancers = new GameObject[] {
                ConvictPastCrowdNPC_01,
                ConvictPastCrowdNPC_02,
                ConvictPastCrowdNPC_03,
                ConvictPastCrowdNPC_04,
                ConvictPastCrowdNPC_05,
                ConvictPastCrowdNPC_06,
                ConvictPastCrowdNPC_07,
                ConvictPastCrowdNPC_08,
                ConvictPastCrowdNPC_09,
                ConvictPastCrowdNPC_10,
                ConvictPastCrowdNPC_11,
                ConvictPastCrowdNPC_12,
                ConvictPastCrowdNPC_13,
                ConvictPastCrowdNPC_14,
                ConvictPastCrowdNPC_15,
                ConvictPastCrowdNPC_16
            };


            Mines_Cave_In = ExpandAssets.LoadOfficialAsset <GameObject>("Mines_Cave_In", ExpandAssets.AssetSource.SharedAuto2);
            Plunger       = Mines_Cave_In.GetComponent <HangingObjectController>().triggerObjectPrefab;

            FoldingTable = PickupObjectDatabase.GetById(644).GetComponent <FoldingTableItem>().TableToSpawn.gameObject;

            convictPastDungeon = null;
            catacombsDungeon   = null;
            sewersDungeon      = null;
            forgeDungeon       = null;
            gungeonDungeon     = null;
            castleDungeon      = null;
        }
        public static void InitPrefabs(AssetBundle expandSharedAssets1)
        {
            List <string> m_DoorOpenSprites = new List <string>()
            {
                "EXSecretDoor_Open_00",
                "EXSecretDoor_Open_01",
                "EXSecretDoor_Open_02",
                "EXSecretDoor_Open_03",
                "EXSecretDoor_Open_04",
                "EXSecretDoor_Open_05",
                "EXSecretDoor_Open_06",
                "EXSecretDoor_Open_07"
            };

            List <string> m_DoorCloseSprites = new List <string>()
            {
                "EXSecretDoor_Close_00",
                "EXSecretDoor_Close_01",
                "EXSecretDoor_Close_02",
                "EXSecretDoor_Close_03",
                "EXSecretDoor_Close_04",
                "EXSecretDoor_Close_05",
                "EXSecretDoor_Close_06",
                "EXSecretDoor_Close_07",
            };

            EXSecretDoorMinimapIcon = expandSharedAssets1.LoadAsset <GameObject>("EXSecretDoor_MinimapIcon");
            ItemBuilder.AddSpriteToObject(EXSecretDoorMinimapIcon, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_MinimapIcon"), false, false);

            EXSecretDoor                               = expandSharedAssets1.LoadAsset <GameObject>("EX Secret Door Entrance");
            EXSecretDoor_Frame_Top                     = EXSecretDoor.transform.Find("EX Secret Door Top").gameObject;
            EXSecretDoor_Frame_Bottom                  = EXSecretDoor.transform.Find("EX Secret Door Bottom").gameObject;
            EXSecretDoor_Background                    = EXSecretDoor.transform.Find("EX Secret Door Background").gameObject;
            EXSecretDoor_Light                         = EXSecretDoor.transform.Find("EX Secret Door Light").gameObject;
            EXSecretDoor_Frame_Top.layer               = LayerMask.NameToLayer("FG_Critical");
            EXSecretDoor_Frame_Bottom.layer            = LayerMask.NameToLayer("FG_Critical");
            EXSecretDoor_Background.layer              = LayerMask.NameToLayer("FG_Critical");
            EXSecretDoor_Light.layer                   = LayerMask.NameToLayer("FG_Critical");
            EXSecretDoor_Frame_Top.transform.parent    = EXSecretDoor.transform;
            EXSecretDoor_Frame_Bottom.transform.parent = EXSecretDoor.transform;
            EXSecretDoor_Background.transform.parent   = EXSecretDoor.transform;
            EXSecretDoor_Light.transform.parent        = EXSecretDoor.transform;

            ItemBuilder.AddSpriteToObject(EXSecretDoor, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Open_00"), false, false);
            ItemBuilder.AddSpriteToObject(EXSecretDoor_Frame_Top, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Frame_Top"), false, false);
            ItemBuilder.AddSpriteToObject(EXSecretDoor_Frame_Bottom, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Frame_Bottom"), false, false);
            ItemBuilder.AddSpriteToObject(EXSecretDoor_Background, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Background"), false, false);
            ItemBuilder.AddSpriteToObject(EXSecretDoor_Light, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Light_Red"), false, false);


            tk2dSprite m_DoorBorderTopSprite = EXSecretDoor_Frame_Top.GetComponent <tk2dSprite>();

            m_DoorBorderTopSprite.HeightOffGround = 3;
            SpriteBuilder.AddSpriteToCollection(expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Frame_NoDecal_Top"), m_DoorBorderTopSprite.Collection);

            tk2dSprite m_DoorBorderBottomSprite = EXSecretDoor_Frame_Bottom.GetComponent <tk2dSprite>();

            m_DoorBorderBottomSprite.HeightOffGround = -0.5f;

            tk2dSprite m_DoorSprite = EXSecretDoor.GetComponent <tk2dSprite>();

            m_DoorSprite.HeightOffGround = -1.5f;

            tk2dSprite m_DoorBackgroundSprite = EXSecretDoor_Background.GetComponent <tk2dSprite>();

            m_DoorBackgroundSprite.HeightOffGround = -2f;

            tk2dSprite m_DoorLightSprite = EXSecretDoor_Light.GetComponent <tk2dSprite>();

            m_DoorLightSprite.HeightOffGround = 3.5f;

            SpriteBuilder.AddSpriteToCollection(expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Light_Green"), m_DoorLightSprite.Collection);

            foreach (string spriteName in m_DoorOpenSprites)
            {
                if (spriteName != "EXSecretDoor_Open_00")
                {
                    SpriteBuilder.AddSpriteToCollection(expandSharedAssets1.LoadAsset <Texture2D>(spriteName), m_DoorSprite.Collection);
                }
            }
            foreach (string spriteName in m_DoorCloseSprites)
            {
                SpriteBuilder.AddSpriteToCollection(expandSharedAssets1.LoadAsset <Texture2D>(spriteName), m_DoorSprite.Collection);
            }

            ExpandUtility.GenerateSpriteAnimator(EXSecretDoor, ClipFps: 10);

            tk2dSpriteAnimator m_DoorAnimator = EXSecretDoor.GetComponent <tk2dSpriteAnimator>();

            ExpandUtility.AddAnimation(m_DoorAnimator, m_DoorSprite.Collection, m_DoorOpenSprites, "door_open", frameRate: 10);
            ExpandUtility.AddAnimation(m_DoorAnimator, m_DoorSprite.Collection, m_DoorCloseSprites, "door_close", frameRate: 10);

            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 64), offset: new IntVector2(16, 0));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 14));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor, CollisionLayer.LowObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, IsTrigger: true, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 12));

            ExpandSecretDoorPlacable m_SecretDoorComponent = EXSecretDoor.AddComponent <ExpandSecretDoorPlacable>();

            m_SecretDoorComponent.DoorTopBorderObject    = EXSecretDoor_Frame_Top;
            m_SecretDoorComponent.DoorBottomBorderObject = EXSecretDoor_Frame_Bottom;
            m_SecretDoorComponent.DoorBackgroundObject   = EXSecretDoor_Background;
            m_SecretDoorComponent.DoorLightObject        = EXSecretDoor_Light;

            GameObject m_RatLock = ExpandPrefabs.RatJailDoorPlacable.gameObject.GetComponent <InteractableDoorController>().WorldLocks[0].gameObject;

            EXSecretDoor_Lock = EXSecretDoor.transform.Find("EX Secret Door Lock").gameObject;
            tk2dSprite EXLockSprite = EXSecretDoor_Lock.AddComponent <tk2dSprite>();

            ExpandUtility.DuplicateSprite(EXLockSprite, m_RatLock.GetComponent <tk2dSprite>());
            EXLockSprite.HeightOffGround = -0.3f;

            tk2dSpriteAnimator m_EXLockAnimator = ExpandUtility.DuplicateSpriteAnimator(EXSecretDoor_Lock, m_RatLock.GetComponent <tk2dSpriteAnimator>(), true);

            InteractableLock m_EXLock = EXSecretDoor_Lock.AddComponent <InteractableLock>();

            m_EXLock.Suppress       = m_RatLock.GetComponent <InteractableLock>().Suppress;
            m_EXLock.lockMode       = InteractableLock.InteractableLockMode.RESOURCEFUL_RAT;
            m_EXLock.JailCellKeyId  = m_RatLock.GetComponent <InteractableLock>().JailCellKeyId;
            m_EXLock.IdleAnimName   = m_RatLock.GetComponent <InteractableLock>().IdleAnimName;
            m_EXLock.UnlockAnimName = m_RatLock.GetComponent <InteractableLock>().UnlockAnimName;
            m_EXLock.NoKeyAnimName  = m_RatLock.GetComponent <InteractableLock>().NoKeyAnimName;
            m_EXLock.SpitAnimName   = m_RatLock.GetComponent <InteractableLock>().SpitAnimName;
            m_EXLock.BustedAnimName = m_RatLock.GetComponent <InteractableLock>().BustedAnimName;

            m_SecretDoorComponent.Lock = m_EXLock;
            EXSecretDoor_Lock.SetLayerRecursively(LayerMask.NameToLayer("FG_Critical"));

            EXSecretDoorDestination      = UnityEngine.Object.Instantiate(EXSecretDoor);
            EXSecretDoorDestination.name = "EX Secret Door (Exit)";
            ExpandSecretDoorExitPlacable m_ExitDoorComponent = EXSecretDoorDestination.AddComponent <ExpandSecretDoorExitPlacable>();

            m_ExitDoorComponent.MinimapIcon = ExpandPrefabs.exit_room_basic.associatedMinimapIcon;

            m_ExitDoorComponent.DoorBackgroundObject   = EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>().DoorBackgroundObject;
            m_ExitDoorComponent.DoorBottomBorderObject = EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>().DoorBottomBorderObject;
            m_ExitDoorComponent.DoorLightObject        = EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>().DoorLightObject;
            m_ExitDoorComponent.DoorTopBorderObject    = EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>().DoorTopBorderObject;
            UnityEngine.Object.Destroy(EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>().Lock.gameObject);
            UnityEngine.Object.Destroy(EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>());


            Dungeon    Base_Castle  = DungeonDatabase.GetOrLoadByName("Base_Castle");
            GameObject m_NormalLock = (Base_Castle.PatternSettings.flows[0].sharedInjectionData[1].InjectionData[0].exactRoom.placedObjects[0].nonenemyBehaviour as SecretFloorInteractableController).WorldLocks[0].gameObject;

            // Setup copy with no rat decal and normal lock instead of rat lock. A general purpose version of the Mini-Elevator.
            EXSecretDoor_Normal      = UnityEngine.Object.Instantiate(EXSecretDoor);
            EXSecretDoor_Normal.name = "EX Secret Door 2 (Entrance)";

            Vector3 Lock2PositionOffset = (EXSecretDoor_Normal.transform.position + new Vector3(1.22f, 0.34f));

            ExpandSecretDoorPlacable m_SecretDoor2Component = EXSecretDoor_Normal.GetComponent <ExpandSecretDoorPlacable>();

            m_SecretDoor2Component.isHollowsElevator = false;
            UnityEngine.Object.Destroy(m_SecretDoor2Component.Lock.gameObject);
            m_SecretDoor2Component.DoorTopBorderObject.GetComponent <tk2dSprite>().SetSprite("EXSecretDoor_Frame_NoDecal_Top");
            GameObject m_LockObject2 = UnityEngine.Object.Instantiate(m_NormalLock, Lock2PositionOffset, Quaternion.identity);

            m_LockObject2.gameObject.SetLayerRecursively(LayerMask.NameToLayer("FG_Critical"));
            m_LockObject2.GetComponent <InteractableLock>().sprite.HeightOffGround = 1.7f;
            m_LockObject2.GetComponent <InteractableLock>().sprite.UpdateZDepth();
            // m_LockObject2.SetActive(false);
            m_LockObject2.transform.SetParent(EXSecretDoor_Normal.transform, true);
            m_SecretDoor2Component.Lock = m_LockObject2.GetComponent <InteractableLock>();


            /*m_ExitDoorComponent.DoorBackgroundObject.SetActive(false);
             * m_ExitDoorComponent.DoorBottomBorderObject.SetActive(false);
             * m_ExitDoorComponent.DoorLightObject.SetActive(false);
             * m_ExitDoorComponent.DoorTopBorderObject.SetActive(false);*/
            EXSecretDoor_Normal.SetActive(false);
            EXSecretDoorDestination.SetActive(false);
            FakePrefab.MarkAsFakePrefab(EXSecretDoor_Normal);
            FakePrefab.MarkAsFakePrefab(EXSecretDoorDestination);
            UnityEngine.Object.DontDestroyOnLoad(EXSecretDoor_Normal);
            UnityEngine.Object.DontDestroyOnLoad(EXSecretDoorDestination);

            Base_Castle  = null;
            m_NormalLock = null;
        }
Esempio n. 22
0
 public static Dungeon GetDungeonPrefab(string floor)
 {
     return(DungeonDatabase.GetOrLoadByName(floor));
 }
Esempio n. 23
0
        // Initialize KnownFlows array with custom + official flows.
        public static void InitDungeonFlows(AssetBundle sharedAssets2, bool refreshFlows = false)
        {
            Dungeon TutorialPrefab       = DungeonDatabase.GetOrLoadByName("Base_Tutorial");
            Dungeon CastlePrefab         = DungeonDatabase.GetOrLoadByName("Base_Castle");
            Dungeon SewerPrefab          = DungeonDatabase.GetOrLoadByName("Base_Sewer");
            Dungeon GungeonPrefab        = DungeonDatabase.GetOrLoadByName("Base_Gungeon");
            Dungeon CathedralPrefab      = DungeonDatabase.GetOrLoadByName("Base_Cathedral");
            Dungeon MinesPrefab          = DungeonDatabase.GetOrLoadByName("Base_Mines");
            Dungeon ResourcefulRatPrefab = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat");
            Dungeon CatacombsPrefab      = DungeonDatabase.GetOrLoadByName("Base_Catacombs");
            Dungeon NakatomiPrefab       = DungeonDatabase.GetOrLoadByName("Base_Nakatomi");
            Dungeon ForgePrefab          = DungeonDatabase.GetOrLoadByName("Base_Forge");
            Dungeon BulletHellPrefab     = DungeonDatabase.GetOrLoadByName("Base_BulletHell");

            BaseSharedInjectionData = sharedAssets2.LoadAsset <SharedInjectionData>("Base Shared Injection Data");
            GungeonInjectionData    = GungeonPrefab.PatternSettings.flows[0].sharedInjectionData[1];
            SewersInjectionData     = SewerPrefab.PatternSettings.flows[0].sharedInjectionData[1];
            HollowsInjectionData    = CatacombsPrefab.PatternSettings.flows[0].sharedInjectionData[1];
            CastleInjectionData     = CastlePrefab.PatternSettings.flows[0].sharedInjectionData[0];

            JunkSecretRoomInjector = new ProceduralFlowModifierData()
            {
                annotation        = "Tiny Secret Room",
                DEBUG_FORCE_SPAWN = false,
                OncePerRun        = false,
                placementRules    = new List <ProceduralFlowModifierData.FlowModifierPlacementType>()
                {
                    ProceduralFlowModifierData.FlowModifierPlacementType.RANDOM_NODE_CHILD
                },
                roomTable              = null,
                exactRoom              = ExpandRoomPrefabs.Expand_TinySecret,
                IsWarpWing             = false,
                RequiresMasteryToken   = false,
                chanceToLock           = 0,
                selectionWeight        = 1,
                chanceToSpawn          = 1,
                RequiredValidPlaceable = null,
                prerequisites          = new DungeonPrerequisite[0],
                CanBeForcedSecret      = true,
                RandomNodeChildMinDistanceFromEntrance = 0,
                exactSecondaryRoom = null,
                framedCombatNodes  = 0,
            };

            BellySpecialEntranceRoomInjector = new ProceduralFlowModifierData()
            {
                annotation        = "Secret Belly Entrance Room",
                DEBUG_FORCE_SPAWN = false,
                OncePerRun        = false,
                placementRules    = new List <ProceduralFlowModifierData.FlowModifierPlacementType>()
                {
                    ProceduralFlowModifierData.FlowModifierPlacementType.END_OF_CHAIN
                },
                roomTable              = null,
                exactRoom              = ExpandRoomPrefabs.Expand_Gungeon_BellyEntranceRoom,
                IsWarpWing             = false,
                RequiresMasteryToken   = false,
                chanceToLock           = 0,
                selectionWeight        = 1,
                chanceToSpawn          = 1,
                RequiredValidPlaceable = null,
                prerequisites          = new DungeonPrerequisite[] {
                    new DungeonPrerequisite()
                    {
                        prerequisiteOperation      = DungeonPrerequisite.PrerequisiteOperation.EQUAL_TO,
                        prerequisiteType           = DungeonPrerequisite.PrerequisiteType.TILESET,
                        requiredTileset            = GlobalDungeonData.ValidTilesets.GUNGEON,
                        requireTileset             = true,
                        comparisonValue            = 1,
                        encounteredObjectGuid      = string.Empty,
                        maxToCheck                 = TrackedMaximums.MOST_KEYS_HELD,
                        requireDemoMode            = false,
                        requireCharacter           = false,
                        requiredCharacter          = PlayableCharacters.Pilot,
                        requireFlag                = false,
                        useSessionStatValue        = false,
                        encounteredRoom            = null,
                        requiredNumberOfEncounters = -1,
                        saveFlagToCheck            = GungeonFlags.TUTORIAL_COMPLETED,
                        statToCheck                = TrackedStats.GUNBERS_MUNCHED
                    }
                },
                CanBeForcedSecret = true,
                RandomNodeChildMinDistanceFromEntrance = 0,
                exactSecondaryRoom = null,
                framedCombatNodes  = 0,
            };

            BellySpecialMonsterRoomInjector = new ProceduralFlowModifierData()
            {
                annotation        = "Secret Belly Monster Room",
                DEBUG_FORCE_SPAWN = false,
                OncePerRun        = false,
                placementRules    = new List <ProceduralFlowModifierData.FlowModifierPlacementType>()
                {
                    ProceduralFlowModifierData.FlowModifierPlacementType.NO_LINKS
                },
                roomTable              = null,
                exactRoom              = ExpandRoomPrefabs.Expand_Gungeon_HiddenMonsterRoom,
                IsWarpWing             = true,
                RequiresMasteryToken   = false,
                chanceToLock           = 0,
                selectionWeight        = 1,
                chanceToSpawn          = 1,
                RequiredValidPlaceable = null,
                prerequisites          = new DungeonPrerequisite[] {
                    new DungeonPrerequisite()
                    {
                        prerequisiteOperation      = DungeonPrerequisite.PrerequisiteOperation.EQUAL_TO,
                        prerequisiteType           = DungeonPrerequisite.PrerequisiteType.TILESET,
                        requiredTileset            = GlobalDungeonData.ValidTilesets.GUNGEON,
                        requireTileset             = true,
                        comparisonValue            = 1,
                        encounteredObjectGuid      = string.Empty,
                        maxToCheck                 = TrackedMaximums.MOST_KEYS_HELD,
                        requireDemoMode            = false,
                        requireCharacter           = false,
                        requiredCharacter          = PlayableCharacters.Pilot,
                        requireFlag                = false,
                        useSessionStatValue        = false,
                        encounteredRoom            = null,
                        requiredNumberOfEncounters = -1,
                        saveFlagToCheck            = GungeonFlags.TUTORIAL_COMPLETED,
                        statToCheck                = TrackedStats.GUNBERS_MUNCHED
                    }
                },
                CanBeForcedSecret = true,
                RandomNodeChildMinDistanceFromEntrance = 0,
                exactSecondaryRoom = null,
                framedCombatNodes  = 0,
            };

            GungeonInjectionData.InjectionData.Add(BellySpecialEntranceRoomInjector);
            GungeonInjectionData.InjectionData.Add(BellySpecialMonsterRoomInjector);

            SewersInjectionData.InjectionData.Add(JunkSecretRoomInjector);


            SecretFloorEntranceInjector = new ProceduralFlowModifierData()
            {
                annotation        = "Secret Floor Entrance Room",
                DEBUG_FORCE_SPAWN = false,
                OncePerRun        = false,
                placementRules    = new List <ProceduralFlowModifierData.FlowModifierPlacementType>()
                {
                    ProceduralFlowModifierData.FlowModifierPlacementType.NO_LINKS
                },
                roomTable = null,
                // exactRoom = SewersInjectionData.InjectionData[0].exactRoom,
                exactRoom              = ExpandRoomPrefabs.SecretExitRoom2,
                IsWarpWing             = true,
                RequiresMasteryToken   = false,
                chanceToLock           = 0,
                selectionWeight        = 1,
                chanceToSpawn          = 1,
                RequiredValidPlaceable = null,
                prerequisites          = new DungeonPrerequisite[0],
                CanBeForcedSecret      = true,
                RandomNodeChildMinDistanceFromEntrance = 0,
                exactSecondaryRoom = null,
                framedCombatNodes  = 0,
            };

            SecretMiniElevatorInjector = new ProceduralFlowModifierData()
            {
                annotation        = "Secret MiniElevator Room with Glitched Rats",
                DEBUG_FORCE_SPAWN = false,
                OncePerRun        = false,
                placementRules    = new List <ProceduralFlowModifierData.FlowModifierPlacementType>()
                {
                    ProceduralFlowModifierData.FlowModifierPlacementType.RANDOM_NODE_CHILD
                },
                roomTable              = null,
                exactRoom              = ExpandRoomPrefabs.SecretRatEntranceRoom,
                IsWarpWing             = false,
                RequiresMasteryToken   = false,
                chanceToLock           = 0.25f,
                selectionWeight        = 1,
                chanceToSpawn          = 1,
                RequiredValidPlaceable = null,
                prerequisites          = new DungeonPrerequisite[0],
                CanBeForcedSecret      = true,
                RandomNodeChildMinDistanceFromEntrance = 0,
                exactSecondaryRoom = null,
                framedCombatNodes  = 0,
            };


            m_KeepJungleEntranceRooms = ScriptableObject.CreateInstance <GenericRoomTable>();
            m_KeepJungleEntranceRooms.includedRoomTables = new List <GenericRoomTable>(0);
            m_KeepJungleEntranceRooms.includedRooms      = new WeightedRoomCollection()
            {
                elements = new List <WeightedRoom>()
                {
                    ExpandRoomPrefabs.GenerateWeightedRoom(ExpandRoomPrefabs.Expand_Keep_TreeRoom, Weight: 0.5f),
                    ExpandRoomPrefabs.GenerateWeightedRoom(ExpandRoomPrefabs.Expand_Keep_TreeRoom2)
                }
            };


            SecretJungleEntranceInjector = new ProceduralFlowModifierData()
            {
                annotation        = "Secret Jungle Entrance Room",
                DEBUG_FORCE_SPAWN = false,
                OncePerRun        = false,
                placementRules    = new List <ProceduralFlowModifierData.FlowModifierPlacementType>()
                {
                    ProceduralFlowModifierData.FlowModifierPlacementType.RANDOM_NODE_CHILD
                },
                roomTable              = m_KeepJungleEntranceRooms,
                exactRoom              = null,
                IsWarpWing             = false,
                RequiresMasteryToken   = false,
                chanceToLock           = 0,
                selectionWeight        = 1,
                chanceToSpawn          = 1,
                RequiredValidPlaceable = null,
                prerequisites          = new DungeonPrerequisite[] {
                    new DungeonPrerequisite()
                    {
                        prerequisiteOperation      = DungeonPrerequisite.PrerequisiteOperation.EQUAL_TO,
                        prerequisiteType           = DungeonPrerequisite.PrerequisiteType.TILESET,
                        requiredTileset            = GlobalDungeonData.ValidTilesets.CASTLEGEON,
                        requireTileset             = true,
                        comparisonValue            = 1,
                        encounteredObjectGuid      = string.Empty,
                        maxToCheck                 = TrackedMaximums.MOST_KEYS_HELD,
                        requireDemoMode            = false,
                        requireCharacter           = false,
                        requiredCharacter          = PlayableCharacters.Pilot,
                        requireFlag                = false,
                        useSessionStatValue        = false,
                        encounteredRoom            = null,
                        requiredNumberOfEncounters = -1,
                        saveFlagToCheck            = GungeonFlags.TUTORIAL_COMPLETED,
                        statToCheck                = TrackedStats.GUNBERS_MUNCHED
                    }
                },
                CanBeForcedSecret = true,
                RandomNodeChildMinDistanceFromEntrance = 0,
                exactSecondaryRoom = null,
                framedCombatNodes  = 0,
            };

            HollowsInjectionData.InjectionData.Add(SecretFloorEntranceInjector);
            HollowsInjectionData.InjectionData.Add(SecretMiniElevatorInjector);
            CastleInjectionData.InjectionData.Add(SecretJungleEntranceInjector);


            RickRollSecretRoomInjector = new ProceduralFlowModifierData()
            {
                annotation        = "RickRoll Secret Room",
                DEBUG_FORCE_SPAWN = false,
                OncePerRun        = false,
                placementRules    = new List <ProceduralFlowModifierData.FlowModifierPlacementType>()
                {
                    ProceduralFlowModifierData.FlowModifierPlacementType.END_OF_CHAIN
                },
                roomTable              = null,
                exactRoom              = ExpandRoomPrefabs.Expand_RickRollSecret,
                IsWarpWing             = false,
                RequiresMasteryToken   = false,
                chanceToLock           = 0,
                selectionWeight        = 1,
                chanceToSpawn          = 0.25f,
                RequiredValidPlaceable = null,
                prerequisites          = new DungeonPrerequisite[0],
                CanBeForcedSecret      = true,
                RandomNodeChildMinDistanceFromEntrance = 1,
                exactSecondaryRoom = null,
                framedCombatNodes  = 0
            };

            CustomSecretFloorSharedInjectionData = ScriptableObject.CreateInstance <SharedInjectionData>();

            CustomSecretFloorSharedInjectionData.name          = "Rick Roll Secret Room Injection Data";
            CustomSecretFloorSharedInjectionData.InjectionData = new List <ProceduralFlowModifierData>()
            {
                RickRollSecretRoomInjector
            };
            CustomSecretFloorSharedInjectionData.UseInvalidWeightAsNoInjection = true;
            CustomSecretFloorSharedInjectionData.IsNPCCell = false;
            CustomSecretFloorSharedInjectionData.PreventInjectionOfFailedPrerequisites = false;
            CustomSecretFloorSharedInjectionData.OnlyOne               = false;
            CustomSecretFloorSharedInjectionData.ChanceToSpawnOne      = 1;
            CustomSecretFloorSharedInjectionData.AttachedInjectionData = new List <SharedInjectionData>(0);


            // Don't build/add flows until injection data is created!
            Foyer_Flow = FlowHelpers.DuplicateDungeonFlow(sharedAssets2.LoadAsset <DungeonFlow>("Foyer Flow"));

            // List<DungeonFlow> m_knownFlows = new List<DungeonFlow>();
            KnownFlows = new List <DungeonFlow>();

            // Build and add custom flows to list.
            BossrushFlows.InitBossrushFlows();

            KnownFlows.Add(custom_glitchchest_flow.Custom_GlitchChest_Flow());
            KnownFlows.Add(test_west_floor_03a_flow.TEST_West_Floor_03a_Flow());
            KnownFlows.Add(demo_stage_flow.DEMO_STAGE_FLOW());
            KnownFlows.Add(complex_flow_test.Complex_Flow_Test());
            KnownFlows.Add(custom_glitch_flow.Custom_Glitch_Flow());
            KnownFlows.Add(really_big_flow.Really_Big_Flow());
            KnownFlows.Add(fruit_loops.Fruit_Loops());
            KnownFlows.Add(custom_glitchchestalt_flow.Custom_GlitchChestAlt_Flow());
            KnownFlows.Add(test_traproom_flow.Test_TrapRoom_Flow());
            KnownFlows.Add(test_customroom_flow.Test_CustomRoom_Flow());
            KnownFlows.Add(apache_fucking_around_flow.Apache_Fucking_Around_Flow());
            KnownFlows.Add(f1b_jungle_flow_01.F1b_Jungle_Flow_01());
            KnownFlows.Add(f1b_jungle_flow_02.F1b_Jungle_Flow_02());
            KnownFlows.Add(f2b_belly_flow_01.F2b_Belly_Flow_01());
            KnownFlows.Add(f4c_west_flow_01.F4c_West_Flow_01());

            // Fix issues with nodes so that things other then MainMenu can load Foyer flow
            Foyer_Flow.name = "Foyer_Flow";
            Foyer_Flow.AllNodes[1].handlesOwnWarping = true;
            Foyer_Flow.AllNodes[2].handlesOwnWarping = true;
            Foyer_Flow.AllNodes[3].handlesOwnWarping = true;

            KnownFlows.Add(Foyer_Flow);
            KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(LoadOfficialFlow("npcparadise")));
            KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(LoadOfficialFlow("secret_doublebeholster_flow")));
            KnownFlows.Add(BossrushFlows.Bossrush_01_Castle);
            KnownFlows.Add(BossrushFlows.Bossrush_01a_Sewer);
            KnownFlows.Add(BossrushFlows.Bossrush_02_Gungeon);
            KnownFlows.Add(BossrushFlows.Bossrush_02a_Cathedral);
            KnownFlows.Add(BossrushFlows.Bossrush_03_Mines);
            KnownFlows.Add(BossrushFlows.Bossrush_04_Catacombs);
            KnownFlows.Add(BossrushFlows.Bossrush_05_Forge);
            KnownFlows.Add(BossrushFlows.Bossrush_06_BulletHell);
            KnownFlows.Add(BossrushFlows.MiniBossrush_01);

            // Add official flows to list (flows found in Dungeon asset bundles after AG&D)
            for (int i = 0; i < TutorialPrefab.PatternSettings.flows.Count; i++)
            {
                KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(TutorialPrefab.PatternSettings.flows[i]));
            }
            for (int i = 0; i < CastlePrefab.PatternSettings.flows.Count; i++)
            {
                KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(CastlePrefab.PatternSettings.flows[i]));
            }
            for (int i = 0; i < SewerPrefab.PatternSettings.flows.Count; i++)
            {
                KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(SewerPrefab.PatternSettings.flows[i]));
            }
            for (int i = 0; i < GungeonPrefab.PatternSettings.flows.Count; i++)
            {
                KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(GungeonPrefab.PatternSettings.flows[i]));
            }
            for (int i = 0; i < CathedralPrefab.PatternSettings.flows.Count; i++)
            {
                KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(CathedralPrefab.PatternSettings.flows[i]));
            }
            for (int i = 0; i < MinesPrefab.PatternSettings.flows.Count; i++)
            {
                KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(MinesPrefab.PatternSettings.flows[i]));
            }
            for (int i = 0; i < ResourcefulRatPrefab.PatternSettings.flows.Count; i++)
            {
                KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(ResourcefulRatPrefab.PatternSettings.flows[i]));
            }
            for (int i = 0; i < CatacombsPrefab.PatternSettings.flows.Count; i++)
            {
                KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(CatacombsPrefab.PatternSettings.flows[i]));
            }
            for (int i = 0; i < NakatomiPrefab.PatternSettings.flows.Count; i++)
            {
                KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(NakatomiPrefab.PatternSettings.flows[i]));
            }
            for (int i = 0; i < ForgePrefab.PatternSettings.flows.Count; i++)
            {
                KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(ForgePrefab.PatternSettings.flows[i]));
            }
            for (int i = 0; i < BulletHellPrefab.PatternSettings.flows.Count; i++)
            {
                KnownFlows.Add(FlowHelpers.DuplicateDungeonFlow(BulletHellPrefab.PatternSettings.flows[i]));
            }

            // Let's make things look cool and give all boss rush flows my new tiny exit room. :D
            BossrushFlows.Bossrush_01a_Sewer.AllNodes[2].overrideExactRoom     = ExpandPrefabs.tiny_exit;
            BossrushFlows.Bossrush_02_Gungeon.AllNodes[6].overrideExactRoom    = ExpandPrefabs.tiny_exit;
            BossrushFlows.Bossrush_02a_Cathedral.AllNodes[2].overrideExactRoom = ExpandPrefabs.oldbulletking_room_01;
            BossrushFlows.Bossrush_02a_Cathedral.AllNodes[3].overrideExactRoom = ExpandPrefabs.tiny_exit;
            BossrushFlows.Bossrush_03_Mines.AllNodes[6].overrideExactRoom      = ExpandPrefabs.tiny_exit;
            BossrushFlows.Bossrush_04_Catacombs.AllNodes[6].overrideExactRoom  = ExpandPrefabs.tiny_exit;
            // Fix Forge Bossrush so it uses the correct boss foyer room for Dragun.
            // Using the same foyer room for previous floors looks odd so I fixed it. :P
            BossrushFlows.Bossrush_05_Forge.AllNodes[1].overrideExactRoom = ExpandPrefabs.DragunBossFoyerRoom;
            BossrushFlows.Bossrush_05_Forge.AllNodes[3].overrideExactRoom = ExpandPrefabs.tiny_exit;

            TutorialPrefab       = null;
            CastlePrefab         = null;
            SewerPrefab          = null;
            GungeonPrefab        = null;
            CathedralPrefab      = null;
            MinesPrefab          = null;
            ResourcefulRatPrefab = null;
            CatacombsPrefab      = null;
            NakatomiPrefab       = null;
            ForgePrefab          = null;
            BulletHellPrefab     = null;
        }
Esempio n. 24
0
        public static void DumpCurrentRoomLayout(PrototypeDungeonRoom overrideRoom = null, RoomHandler generatedRoomHandler = null)
        {
            try {
                if (overrideRoom != null)
                {
                    LogRoomToPNGFile(overrideRoom);
                    ETGModConsole.Log("Succesfully saved room layout to PNG.", false);
                    return;
                }
                else if (generatedRoomHandler != null)
                {
                    LogRoomHandlerToPNGFile(generatedRoomHandler);
                    ETGModConsole.Log("Succesfully saved room layout to PNG.", false);
                    return;
                }
                RoomHandler currentRoom  = GameManager.Instance.PrimaryPlayer.CurrentRoom;
                int         CurrentFloor = GameManager.Instance.CurrentFloor;
                Dungeon     dungeon      = null;
                if (CurrentFloor == 1)
                {
                    dungeon = DungeonDatabase.GetOrLoadByName("Base_Castle");
                }
                if (CurrentFloor == 2)
                {
                    dungeon = DungeonDatabase.GetOrLoadByName("Base_Gungeon");
                }
                if (CurrentFloor == 3)
                {
                    dungeon = DungeonDatabase.GetOrLoadByName("Base_Mines");
                }
                if (CurrentFloor == 4)
                {
                    dungeon = DungeonDatabase.GetOrLoadByName("Base_Catacombs");
                }
                if (CurrentFloor == 5)
                {
                    dungeon = DungeonDatabase.GetOrLoadByName("Base_Forge");
                }
                if (CurrentFloor == 6)
                {
                    dungeon = DungeonDatabase.GetOrLoadByName("Base_BulletHell");
                }
                if (CurrentFloor == -1)
                {
                    if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.CASTLEGEON)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Castle");
                    }
                    if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.SEWERGEON)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Sewer");
                    }
                    if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.GUNGEON)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Gungeon");
                    }
                    if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.CATHEDRALGEON)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Cathedral");
                    }
                    if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.MINEGEON)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Mines");
                    }
                    if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.RATGEON)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat");
                    }
                    if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.CATACOMBGEON)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Catacombs");
                    }
                    if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.OFFICEGEON)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Nakatomi");
                    }
                    if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.FORGEGEON)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Forge");
                    }
                    if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.HELLGEON)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_BulletHell");
                    }
                }
                if (dungeon == null)
                {
                    ETGModConsole.Log("Could not find current Dungeon prefab for current floor!\n Attempting to use local dungeon data area of room instead.", false);
                    LogRoomHandlerToPNGFile(currentRoom);
                    dungeon = null;
                    return;
                }
                if (dungeon.PatternSettings.flows != null)
                {
                    if (dungeon.PatternSettings.flows[0].fallbackRoomTable != null)
                    {
                        if (dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements != null)
                        {
                            if (dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements.Count > 0)
                            {
                                for (int i = 0; i < dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements.Count; i++)
                                {
                                    if (dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements[i].room != null)
                                    {
                                        if (currentRoom.GetRoomName().ToLower().StartsWith(dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements[i].room.name.ToLower()))
                                        {
                                            LogRoomToPNGFile(dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements[i].room);
                                            ETGModConsole.Log("Succesfully saved current room layout to PNG.", false);
                                            dungeon = null;
                                            return;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                if (dungeon.PatternSettings.flows != null && dungeon.PatternSettings.flows[0].fallbackRoomTable == null)
                {
                    for (int i = 0; i < dungeon.PatternSettings.flows[0].AllNodes.Count; i++)
                    {
                        if (dungeon.PatternSettings.flows[0].AllNodes[i].overrideExactRoom != null)
                        {
                            if (currentRoom.GetRoomName().ToLower().StartsWith(dungeon.PatternSettings.flows[0].AllNodes[i].overrideExactRoom.name.ToLower()))
                            {
                                LogRoomToPNGFile(dungeon.PatternSettings.flows[0].AllNodes[i].overrideExactRoom);
                                ETGModConsole.Log("Succesfully saved current room layout to PNG.", false);
                                dungeon = null;
                                return;
                            }
                        }
                    }
                }

                ETGModConsole.Log("Current Room's ProtoTypeDungeonRoom prefab not found!\nAttempting to use local DungeonData of RoomHandler object instead...", false);
                LogRoomHandlerToPNGFile(currentRoom);
                dungeon = null;
                ETGModConsole.Log("Succesfully saved current room layout to PNG.", false);
            } catch (Exception ex) {
                ETGModConsole.Log("Failed to save room layout!", false);
                ETGModConsole.Log("    " + ex.Message, false);
                Debug.LogException(ex);
            }
        }
Esempio n. 25
0
        public static void DumpRoomLayoutToText(PrototypeDungeonRoom overrideRoom = null)
        {
            try {
                if (overrideRoom == null)
                {
                    RoomHandler currentRoom  = GameManager.Instance.PrimaryPlayer.CurrentRoom;
                    int         CurrentFloor = GameManager.Instance.CurrentFloor;
                    Dungeon     dungeon      = null;
                    if (CurrentFloor == 1)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Castle");
                    }
                    if (CurrentFloor == 2)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Gungeon");
                    }
                    if (CurrentFloor == 3)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Mines");
                    }
                    if (CurrentFloor == 4)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Catacombs");
                    }
                    if (CurrentFloor == 5)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_Forge");
                    }
                    if (CurrentFloor == 6)
                    {
                        dungeon = DungeonDatabase.GetOrLoadByName("Base_BulletHell");
                    }
                    if (CurrentFloor == -1)
                    {
                        if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.CASTLEGEON)
                        {
                            dungeon = DungeonDatabase.GetOrLoadByName("Base_Castle");
                        }
                        if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.SEWERGEON)
                        {
                            dungeon = DungeonDatabase.GetOrLoadByName("Base_Sewer");
                        }
                        if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.GUNGEON)
                        {
                            dungeon = DungeonDatabase.GetOrLoadByName("Base_Gungeon");
                        }
                        if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.CATHEDRALGEON)
                        {
                            dungeon = DungeonDatabase.GetOrLoadByName("Base_Cathedral");
                        }
                        if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.MINEGEON)
                        {
                            dungeon = DungeonDatabase.GetOrLoadByName("Base_Mines");
                        }
                        if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.RATGEON)
                        {
                            dungeon = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat");
                        }
                        if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.CATACOMBGEON)
                        {
                            dungeon = DungeonDatabase.GetOrLoadByName("Base_Catacombs");
                        }
                        if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.OFFICEGEON)
                        {
                            dungeon = DungeonDatabase.GetOrLoadByName("Base_Nakatomi");
                        }
                        if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.FORGEGEON)
                        {
                            dungeon = DungeonDatabase.GetOrLoadByName("Base_Forge");
                        }
                        if (GameManager.Instance.Dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.HELLGEON)
                        {
                            dungeon = DungeonDatabase.GetOrLoadByName("Base_BulletHell");
                        }
                    }
                    if (dungeon == null)
                    {
                        ETGModConsole.Log("Could not determine current floor/tileset!\n Attempting to use" + currentRoom.GetRoomName() + ".area.ProtoTypeDungeonRoom instead!", false);
                        Tools.LogRoomLayout(currentRoom.area.prototypeRoom);
                        dungeon = null;
                        return;
                    }
                    if (dungeon.PatternSettings.flows != null)
                    {
                        if (dungeon.PatternSettings.flows[0].fallbackRoomTable != null)
                        {
                            if (dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements != null)
                            {
                                if (dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements.Count > 0)
                                {
                                    for (int i = 0; i < dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements.Count; i++)
                                    {
                                        if (dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements[i].room != null)
                                        {
                                            if (currentRoom.GetRoomName().ToLower().StartsWith(dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements[i].room.name.ToLower()))
                                            {
                                                Tools.LogRoomLayout(dungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements[i].room);
                                                ETGModConsole.Log("Logged current room layout.", false);
                                                dungeon = null;
                                                return;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }

                    if (dungeon.PatternSettings.flows != null && dungeon.PatternSettings.flows[0].fallbackRoomTable == null)
                    {
                        for (int i = 0; i < dungeon.PatternSettings.flows[0].AllNodes.Count; i++)
                        {
                            if (dungeon.PatternSettings.flows[0].AllNodes[i].overrideExactRoom != null)
                            {
                                if (currentRoom.GetRoomName().ToLower().StartsWith(dungeon.PatternSettings.flows[0].AllNodes[i].overrideExactRoom.name.ToLower()))
                                {
                                    Tools.LogRoomLayout(dungeon.PatternSettings.flows[0].AllNodes[i].overrideExactRoom);
                                    ETGModConsole.Log("Logged current room layout.", false);
                                    dungeon = null;
                                    return;
                                }
                            }
                        }
                    }

                    ETGModConsole.Log("Current Room's ProtoTypeDungeonRoom prefab not found.\n Attempting to use [" + currentRoom.GetRoomName() + "].area.ProtoTypeDungeonRoom instead!", false);
                    Tools.LogRoomLayout(currentRoom.area.prototypeRoom);
                    dungeon = null;
                    ETGModConsole.Log("Logged current room layout.", false);
                }
                else
                {
                    Tools.LogRoomLayout(overrideRoom);
                }
            } catch (System.Exception ex) {
                ETGModConsole.Log("Failed to log current room layout.", false);
                ETGModConsole.Log("    " + ex.Message, false);
                Debug.LogException(ex);
            }
        }
Esempio n. 26
0
        public override void Start()
        {
            ItemAPI.FakePrefabHooks.Init();
            GungeonAPI.FakePrefabHooks.Init();
            ItemAPI.EnemyBuilder.Init();
            ItemAPI.BossBuilder.Init();
            ItemAPI.EnemyTools.Init();
            SaveAPI.SaveAPIManager.Setup("cel");
            ItemBuilder.Init();
            Hooks.Init();
            GungeonAPI.Tools.Init();
            ShrineFactory.Init();
            Library.DefineGoops();
            Library.InitVacuumProjectiles();
            SpecialBlankModificationItem.InitHooks();
            var forgeDungeon = DungeonDatabase.GetOrLoadByName("Base_Forge");

            hellDrag     = forgeDungeon.PatternSettings.flows[0].AllNodes.Where(node => node.overrideExactRoom != null && node.overrideExactRoom.name.Contains("EndTimes")).First().overrideExactRoom.placedObjects.Where(ppod => ppod != null && ppod.nonenemyBehaviour != null).First().nonenemyBehaviour.gameObject.GetComponentsInChildren <HellDragZoneController>()[0];
            forgeDungeon = null;
            MultiActiveReloadManager.SetupHooks();
            //---  PrinceOfTheJammed.Init();
            //--- PoisonGeistEnemy.Init();
            //---  RiskyAmmoCrate.Register();

            TheBullet.Init();        //1                ACTIVE 1
            FunkyBullets.Init();     //2             PASSIVE 1
            NeedleBullets.Init();    //3            PASSIVE 2
            ImpsHorn.Init();         //4                 PASSIVE 3
            SnareBullets.Init();     //5             PASSIVE 4
            CorruptHeart.Init();     //6             ACTIVE 2
            ShockingBattery.Init();  //7          ACTIVE 3
            Dispenser.Add();         //8                 GUN 1
            IronHeart.Init();        //9                ACTIVE 4
            VoidBottle.Init();       //10              ACTIVE 5
            SprunButBetter.Init();   //11          PASSIVE 5
            PetRock.Init();          //12                 PASSIVE 6
            RGG.Add();               //13                      GUN 2
            Phazor.Add();            //14                   GUN 3
            Tesla.Add();             //15                    GUN 4
            Fallout.Add();           //16                  GUN 5
            SuperCrate.Init();       //17              ACTIVE 6
            SteamSale.Init();        //18               PASSIVE 7
            EmptyBullets.Init();     //19            PASSIVE 8
            Sawblade.Init();         // 20               PASSIVE 9
            Matchbox.Init();         //21                ACTIVE 7
            ACMESupply.Init();       //22              ACTIVE 8
            Mininomicon.Init();      //23             PASSIVE 10
            TerribleAmmoBag.Init();  //24         PASSIVE 11
            Questlog.Init();         //25               ACTIVE 9
            Gunlust.Init();          //26                 PASSIVE 12
            BananaJamHands.Init();   //27          PASSIVE 13
            LiteralTrash.Init();     // MISC 1
            Enemies.SpectreBehav();
            DaggerSpray.Init();      // 28            PASSIVE 14
            AuricVial.Init();        //29               PASSIVE 15
            StakeLauncher.Add();     //30            GUN 6
            DragunClaw.Init();       //31              PASSIVE 16
            DragunWing.Init();       //32              PASSIVE 17
            DragunHeart.Init();      //33             PASSIVE 18
            DragunSkull.Init();      //34             PASSIVE 19
            GravityWell.Init();      //35             PASSIVE 20
            WaterCup.Init();         //36                ACTIVE 10
            SpinelTonic.Init();      //37             ACTIVE 11
            DDR.Init();              //38                     PASSIVE 21
            CitrineAmmolet.Init();   // 39         PASSIVE 22
            MalachiteAmmolet.Init(); //40        PASSIVE 23
            GlassHeart.Init();       // 41             PASSIVE 24
            AccursedShackles.Init(); // 42        PASSIVE 25
            Hooks.BuffGuns();        //43               GUN 7
            D6.Init();               //44                      ACTIVE 12

            TimeKeepersPistol.Add();
            ALiteralRock.Add();    // 47            GUN 8
            FloopBullets.Init();   // 48           PASSIVE 26
            EliteBullets.Init();   // 49            PASSIVE 27
            Enemies.AmmoDotBehav();
            FireworkRifle.Add();   // 50           GUN 9
            Skeleton.Add();        // 51                 GUN 10
            Incremental.Add();     // 52              GUN 11

            VenomRounds.Init();    // 53             PASSIVE 28
            BismuthAmmolet.Init(); //54           PASSIVE 29
            MercuryAmmolet.Init(); //55           PASSIVE 30


            BashelliskRifle.Add(); //56           GUN 12
            MarkOfWind.Init();     //57               PASSIVE 31
            PrimeSaw.Add();        //58a                 GUN 13a
            PrimeVice.Add();       //58b                GUN 13b
            PrimeLaser.Add();      //58c               GUN 13c
            PrimeCannon.Add();     //58d              GUN 13d
            RussianRevolver.Add(); //59           GUN 14
            ImpactRounds.Init();   //60             PASSIVE 31
            DroneController.Add(); //61           GUN 15
            Drone.Add();
            Drone2.Add();
            //D.E.A.T.H. Set
            LittleDroneBuddy.Init();  //62         PASSIVE 32
            DroneBuddy1Gun.Add();     //62a
            TriggerPulseDrone.Init(); //63        PASSIVE 33
            TriggerDroneGun.Add();    //63a
            VenomSpitDrone.Init();    //64a          PASSIVE 34
            VenomSpitDGun.Add();      //64b
            DEATHGun.Add();           //65a                 GUN 16
            DEATHDrone.Add();         //65b
            //True Gunpowder Set
            PrimalNitricAcid.Init();  //66         PASSIVE 35
            PrimalCharcoal.Init();    //67           PASSIVE 36
            PrimalSulfur.Init();      //68             PASSIVE 37
            PrimalSaltpeter.Init();   //69          PASSIVE 38
            TrueGunpowder.Init();     //70            PASSIVE 39
            //
            SpiritOfTheDragun.Add();  //71         GUN 17
            BilliardBouncer.Add();    //72           GUN 18
            ElectricBass.Add();       //73              GUN 19
            IonFist.Add();            //74                   GUN 20
            NenFist.Add();            //74a
            EvilCharmedBow.Add();
            ReloadedRifle.Add();      //75             GUN 21
            AK94.Add();               //76                      GUN 22
            LeakingSyringe.Init();    //77           PASSIVE 40
            Holoprinter.Init();       //78              ACTIVE 14
            Günther.Add();            //79                   GUN 23
            AK141.Add();              //80                     GUN 24
            AK188.Add();              //81                     GUN 25
            InfiniteAK.Add();         //82                GUN 26
            //  ---AltarOfKaliber.Init();
            BrokenAltar.Init();
            PlasmaCannon.Add();   //85              GUN 27
            TheLastChamber.Add(); //86            GUN 28
            //  ---BulletDog.Init();//ENEMY 1
            //--- HunterKin.Init();//ENEMY 2
            AutoShotgun.Add();//87               GUN 29
            // ---CrownOfTheChosen.Init();
            // ---CrownChanger.InitCrowns();

            Vacuum.Add();           //88                    GUN 30
            StickyLauncher.Add();   //89            GUN 31
            SupportContract.Init(); //90          ACTIVE 15
            PanicPistol.Add();      //91               GUN 32
            NineBarreledGun.Add();  //92           GUN 33
            //---Ak_hillesHeel.Init();
            //--- TestTargettingSystem.Init();
            SympathyBullets.Init(); //93          PASSIVE 41
            //--- RefractedGlass.Init();
            BloatedRounds.Init();   //94            PASSIVE 42
            EyesOfStone.Init();     //95              PASSIVE 43
            ShellBank.Init();       //96                PASSIVE 44
            //Katana.Add();

            /*
             * HairGel.Init();
             * IgnitionPowder.Init();
             * Magnorbs.Add(); // need to do the orbiting code
             * PoisonPoltergeist.Init();
             *
             * PsiMarker.Init(); //Still need to fix this lol, specifically SpecialOrbitals needs to be fixed.
             * PsiScales.Add();
             * PsiFocus.Init();
             * //Prob wok on Psi Scales tomorrow.
             * SliverBeam.Add();
             */
            GoldenRecord.Init();//97             ACTIVE 16


            //--- MunitionsChestController.Init();
            if (SteamUsername != string.Empty)
            {
                SteamUsername = SteamFriends.GetPersonaName();
                CrownChanger.Change();
            }

            //SPINEL TONIC BY TankTheta!
            //Bismuth Ammolet sprite by TankTheta!
            //Spirit spride by TankTheta!

            //Thanks to ExplosivePanda for helping with the code for Soul Forge
            DualGunsManager.AddDual();
            HoveringGunsAdder.AddHovers();
            SynergyFormAdder.AddForms();

            foreach (AdvancedSynergyEntry syn in GameManager.Instance.SynergyManager.synergies)
            {
                if (syn.NameKey == "#IRONSHOT")
                {
                    syn.OptionalGunIDs.Add(ETGMod.Databases.Items["billiard_bouncer"].PickupObjectId);
                }
            }

            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.ExtravaganceSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.RulebookSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.SturdyAmmoSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.LeadWeightSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.DragunRoarSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.IronManSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.EldritchLoveSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.TwoForOneSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.CriticalMassSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.OverclockedSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.SovietSkillsSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.CommunistIdealsSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.LuckySpinSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.TestGunSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.DEATHGunSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.TrueGunpowderSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.GoldenSpinSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.LoveLeechSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.JajankenSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.AllOutOfLoveSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.BleedingEdgeSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.AbsoluteChaosSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.ShakenSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.CallingInTheHeavySupportSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.BloodlessSyn()
            }).ToArray <AdvancedSynergyEntry>();
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
            {
                new CelSynergies.KvotheKingKillerSyn()
            }).ToArray <AdvancedSynergyEntry>();

            /* --- GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[]
             * {
             *   new CelSynergies.VacuumChamberSyn()
             * }).ToArray<AdvancedSynergyEntry>();
             */
            ETGModConsole.Commands.AddGroup("cel", args =>
            {
            });

            //---ETGModConsole.Commands.GetGroup("cel").AddUnit("crown_override", this.CrownOverride);
            //---ETGModConsole.Commands.GetGroup("cel").AddUnit("mchest", this.SpawnMChest);
            ETGModConsole.Commands.GetGroup("cel").AddUnit("toggle_eyestrain", ToggleEyeStrain);
            //--- ETGModConsole.Commands.GetGroup("cel").AddUnit("get_risk_value", GetRiskStatValue);
            Log($"{Modname} v{Version} started successfully.", Color);
            Log($"Link to Changelog https://pastebin.com/0LeBBa57", Color);
        }
        public void PlaceCorruptTiles(Dungeon dungeon, RoomHandler roomHandler = null, GameObject parentObject = null, bool corruptWallsOnly = false, bool isLeadKeyRoom = false)
        {
            bool m_CorruptedSecretRoomsPresent = false;

            if (roomHandler == null)
            {
                foreach (RoomHandler room in dungeon.data.rooms)
                {
                    if (room.GetRoomName() != null)
                    {
                        if (room.GetRoomName().ToLower().StartsWith("expand apache corrupted secret"))
                        {
                            m_CorruptedSecretRoomsPresent = true;
                            break;
                        }
                    }
                }
            }

            if (roomHandler == null && dungeon.IsGlitchDungeon)
            {
                if (StaticReferenceManager.AllNpcs != null && StaticReferenceManager.AllNpcs.Count > 0)
                {
                    foreach (TalkDoerLite npc in StaticReferenceManager.AllNpcs)
                    {
                        npc.SpeaksGleepGlorpenese = true;
                    }
                }
            }
            else if (roomHandler != null && StaticReferenceManager.AllNpcs != null && StaticReferenceManager.AllNpcs.Count > 0)
            {
                foreach (TalkDoerLite npc in StaticReferenceManager.AllNpcs)
                {
                    if (npc.GetAbsoluteParentRoom() == roomHandler)
                    {
                        npc.SpeaksGleepGlorpenese = true;
                        if (npc.GetAbsoluteParentRoom() != null && !string.IsNullOrEmpty(npc.GetAbsoluteParentRoom().GetRoomName()))
                        {
                            if (npc.GetAbsoluteParentRoom().GetRoomName().ToLower().StartsWith("expand apache corrupted secret"))
                            {
                                ExpandShaders.Instance.ApplyGlitchShader(npc.GetComponent <tk2dBaseSprite>());
                            }
                        }
                    }
                }
            }

            if (!dungeon.IsGlitchDungeon && roomHandler == null && !m_CorruptedSecretRoomsPresent)
            {
                return;
            }

            if (dungeon.IsGlitchDungeon | roomHandler != null)
            {
                m_CorruptedSecretRoomsPresent = false;
            }

            tk2dSpriteCollectionData dungeonCollection = dungeon.tileIndices.dungeonCollection;

            // Used for debug read out information
            int CorruptWallTilesPlaced     = 0;
            int CorruptOpenAreaTilesPlaced = 0;
            int iterations = 0;

            GameObject GlitchedTileObject = new GameObject("GlitchTile_" + UnityEngine.Random.Range(1000000, 9999999))
            {
                layer = 22
            };

            if (parentObject != null)
            {
                GlitchedTileObject.transform.parent = parentObject.transform;
            }
            GlitchedTileObject.AddComponent <tk2dSprite>();
            tk2dSprite glitchSprite = GlitchedTileObject.GetComponent <tk2dSprite>();

            glitchSprite.Collection = dungeonCollection;
            glitchSprite.SetSprite(glitchSprite.Collection, 22);
            glitchSprite.ignoresTiltworldDepth      = false;
            glitchSprite.depthUsesTrimmedBounds     = false;
            glitchSprite.allowDefaultLayer          = false;
            glitchSprite.OverrideMaterialMode       = tk2dBaseSprite.SpriteMaterialOverrideMode.NONE;
            glitchSprite.independentOrientation     = false;
            glitchSprite.hasOffScreenCachedUpdate   = false;
            glitchSprite.CachedPerpState            = tk2dBaseSprite.PerpendicularState.PERPENDICULAR;
            glitchSprite.SortingOrder               = 2;
            glitchSprite.IsBraveOutlineSprite       = false;
            glitchSprite.IsZDepthDirty              = false;
            glitchSprite.ApplyEmissivePropertyBlock = false;
            glitchSprite.GenerateUV2       = false;
            glitchSprite.LockUV2OnFrameOne = false;
            glitchSprite.StaticPositions   = false;

            List <int> CurrentFloorWallIDs  = new List <int>();
            List <int> CurrentFloorFloorIDs = new List <int>();
            List <int> CurrentFloorMiscIDs  = new List <int>();

            // Select Sprite ID lists based on tileset. (IDs corrispond to different sprites depending on tileset dungeonCollection)
            if (dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.CASTLEGEON)
            {
                CurrentFloorWallIDs  = ExpandLists.CastleWallIDs;
                CurrentFloorFloorIDs = ExpandLists.CastleFloorIDs;
                CurrentFloorMiscIDs  = ExpandLists.CastleMiscIDs;
            }
            else if (dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.GUNGEON)
            {
                CurrentFloorWallIDs  = ExpandLists.GungeonWallIDs;
                CurrentFloorFloorIDs = ExpandLists.GungeonFloorIDs;
                CurrentFloorMiscIDs  = ExpandLists.GungeonMiscIDs;
            }
            else if (dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.MINEGEON)
            {
                CurrentFloorWallIDs  = ExpandLists.MinesWallIDs;
                CurrentFloorFloorIDs = ExpandLists.MinesFloorIDs;
                CurrentFloorMiscIDs  = ExpandLists.MinesMiscIDs;
            }
            else if (dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.CATACOMBGEON)
            {
                CurrentFloorWallIDs  = ExpandLists.HollowsWallIDs;
                CurrentFloorFloorIDs = ExpandLists.HollowsFloorIDs;
                CurrentFloorMiscIDs  = ExpandLists.HollowsMiscIDs;
            }
            else if (dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.FORGEGEON)
            {
                CurrentFloorWallIDs  = ExpandLists.ForgeWallIDs;
                CurrentFloorFloorIDs = ExpandLists.ForgeFloorIDs;
                CurrentFloorMiscIDs  = ExpandLists.ForgeMiscIDs;
            }
            else if (dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.HELLGEON)
            {
                CurrentFloorWallIDs  = ExpandLists.BulletHell_WallIDs;
                CurrentFloorFloorIDs = ExpandLists.BulletHell_FloorIDs;
                CurrentFloorMiscIDs  = ExpandLists.BulletHell_MiscIDs;
            }
            else if (dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.SEWERGEON)
            {
                CurrentFloorWallIDs  = ExpandLists.SewerWallIDs;
                CurrentFloorFloorIDs = ExpandLists.SewerFloorIDs;
                CurrentFloorMiscIDs  = ExpandLists.SewerMiscIDs;
            }
            else if (dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.CATHEDRALGEON)
            {
                CurrentFloorWallIDs  = ExpandLists.AbbeyWallIDs;
                CurrentFloorFloorIDs = ExpandLists.AbbeyFloorIDs;
                CurrentFloorMiscIDs  = ExpandLists.AbbeyMiscIDs;
            }
            else if (dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.RATGEON | dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.JUNGLEGEON)
            {
                CurrentFloorWallIDs  = ExpandLists.RatDenWallIDs;
                CurrentFloorFloorIDs = ExpandLists.RatDenFloorIDs;
                CurrentFloorMiscIDs  = ExpandLists.RatDenMiscIDs;
            }
            else if (dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.OFFICEGEON)
            {
                foreach (int id in ExpandLists.Nakatomi_OfficeWallIDs)
                {
                    CurrentFloorWallIDs.Add(id);
                }
                foreach (int id in ExpandLists.Nakatomi_OfficeFloorIDs)
                {
                    CurrentFloorFloorIDs.Add(id);
                }
                foreach (int id in ExpandLists.Nakatomi_OfficeMiscIDs)
                {
                    CurrentFloorMiscIDs.Add(id);
                }
                // This floor stores both Office and Future tilesets it uses into the same sprite collection atlas.
                // Each section has a specific size and and the ID of the last tileset will be subtracted from entries from the next.
                // Office tileset IDs end at id 703
                // Future tileset IDs start at id 704
                // Future tileset IDs have 704 added to them to get the correct ID in the main sprite collection.
                foreach (int id in ExpandLists.Nakatomi_FutureWallIDs)
                {
                    CurrentFloorWallIDs.Add(id + 704);
                }
                foreach (int id in ExpandLists.Nakatomi_FutureFloorIDs)
                {
                    CurrentFloorFloorIDs.Add(id + 704);
                }
                foreach (int id in ExpandLists.Nakatomi_FutureMiscIDs)
                {
                    CurrentFloorMiscIDs.Add(id + 704);
                }
            }
            else
            {
                // Unkown Tilesets will use Gungeon as placeholder
                Dungeon tempDungeonPrefab = DungeonDatabase.GetOrLoadByName("Base_Gungeon");
                dungeonCollection    = tempDungeonPrefab.tileIndices.dungeonCollection;
                CurrentFloorWallIDs  = ExpandLists.GungeonWallIDs;
                CurrentFloorFloorIDs = ExpandLists.GungeonFloorIDs;
                CurrentFloorMiscIDs  = ExpandLists.GungeonMiscIDs;
                tempDungeonPrefab    = null;
            }

            List <int> roomList = Enumerable.Range(0, dungeon.data.rooms.Count).ToList();

            roomList = roomList.Shuffle();

            if (roomHandler != null)
            {
                roomList = new List <int>()
                {
                    0
                };
            }

            List <IntVector2> cachedWallTiles = new List <IntVector2>();
            List <IntVector2> validWalls      = new List <IntVector2>();
            List <IntVector2> validOpenAreas  = new List <IntVector2>();

            RoomHandler RoomBeingWorkedOn = null;

            while (iterations < roomList.Count)
            {
                try {
                    RoomHandler currentRoom = null;

                    if (roomHandler == null)
                    {
                        currentRoom = dungeon.data.rooms[roomList[iterations]];
                    }
                    else
                    {
                        currentRoom = roomHandler;
                    }

                    if (currentRoom == null)
                    {
                        break;
                    }

                    RoomBeingWorkedOn = currentRoom;

                    if (string.IsNullOrEmpty(currentRoom.GetRoomName()))
                    {
                        currentRoom.area.PrototypeRoomName = ("ProceduralRoom_" + UnityEngine.Random.Range(100000, 999999));
                    }

                    if (!m_CorruptedSecretRoomsPresent || (currentRoom.GetRoomName().ToLower().StartsWith("expand apache corrupted secret") | dungeon.IsGlitchDungeon | roomHandler != null))
                    {
                        bool isCorruptedSecretRoom = false;

                        if (currentRoom.GetRoomName().ToLower().StartsWith("expand apache corrupted secret") && !isLeadKeyRoom)
                        {
                            GameObject m_CorruptionMarkerObject = new GameObject("CorruptionAmbienceMarkerObject")
                            {
                                layer = 0
                            };
                            m_CorruptionMarkerObject.transform.position = currentRoom.area.Center;
                            m_CorruptionMarkerObject.transform.parent   = currentRoom.hierarchyParent;
                            ExpandStaticReferenceManager.AllCorruptionSoundObjects.Add(m_CorruptionMarkerObject);
                            isCorruptedSecretRoom = true;
                        }

                        if (m_CorruptedSecretRoomsPresent | isLeadKeyRoom)
                        {
                            foreach (TalkDoerLite npc in StaticReferenceManager.AllNpcs)
                            {
                                if (npc.GetAbsoluteParentRoom() != null && npc.GetAbsoluteParentRoom() == currentRoom)
                                {
                                    npc.SpeaksGleepGlorpenese = true;
                                    ExpandShaders.Instance.ApplyGlitchShader(npc.GetComponent <tk2dBaseSprite>());
                                }
                            }
                        }

                        validWalls.Clear();
                        validOpenAreas.Clear();

                        for (int Width = -1; Width <= currentRoom.area.dimensions.x + 3; Width++)
                        {
                            for (int Height = -1; Height <= currentRoom.area.dimensions.y + 3; Height++)
                            {
                                int X = currentRoom.area.basePosition.x + Width;
                                int Y = currentRoom.area.basePosition.y + Height;
                                if (!cachedWallTiles.Contains(new IntVector2(X, Y)) && (
                                        dungeon.data.isWall(X, Y) | dungeon.data.isAnyFaceWall(X, Y) | dungeon.data.isWall(X, Y - 1))
                                    )
                                {
                                    validWalls.Add(new IntVector2(X, Y));
                                }
                            }
                        }

                        int WallCorruptionIntensity = (validWalls.Count / UnityEngine.Random.Range(2, 4));
                        if (roomHandler == null && !isCorruptedSecretRoom && UnityEngine.Random.value <= 0.1f)
                        {
                            WallCorruptionIntensity = 0;
                        }

                        if (WallCorruptionIntensity > 0)
                        {
                            for (int C = 0; C < WallCorruptionIntensity; C++)
                            {
                                if (validWalls.Count > 0)
                                {
                                    IntVector2 WallPosition = BraveUtility.RandomElement(validWalls);
                                    cachedWallTiles.Add(WallPosition);

                                    float RandomIntervalFloat       = UnityEngine.Random.Range(0.02f, 0.06f);
                                    float RandomDispFloat           = UnityEngine.Random.Range(0.07f, 0.09f);
                                    float RandomDispIntensityFloat  = UnityEngine.Random.Range(0.085f, 0.2f);
                                    float RandomColorProbFloat      = UnityEngine.Random.Range(0.04f, 0.15f);
                                    float RandomColorIntensityFloat = UnityEngine.Random.Range(0.08f, 0.14f);

                                    GameObject m_GlitchTile = Instantiate(GlitchedTileObject, (WallPosition.ToVector2()), Quaternion.identity);
                                    m_GlitchTile.name += ("_" + UnityEngine.Random.Range(100000, 999999).ToString());
                                    m_GlitchTile.layer = 22;
                                    if (parentObject != null)
                                    {
                                        m_GlitchTile.transform.parent = parentObject.transform;
                                    }
                                    else
                                    {
                                        m_GlitchTile.transform.parent = currentRoom.hierarchyParent;
                                    }

                                    tk2dSprite m_GlitchSprite = m_GlitchTile.GetComponent <tk2dSprite>();

                                    int        TileType  = UnityEngine.Random.Range(1, 3);
                                    List <int> spriteIDs = new List <int>();
                                    if (TileType == 1)
                                    {
                                        spriteIDs = CurrentFloorWallIDs;
                                    }
                                    if (TileType == 2)
                                    {
                                        spriteIDs = CurrentFloorFloorIDs;
                                    }
                                    if (TileType == 3)
                                    {
                                        spriteIDs = CurrentFloorMiscIDs;
                                    }

                                    m_GlitchSprite.SetSprite(BraveUtility.RandomElement(spriteIDs));

                                    if (dungeon.data.isFaceWallLower(WallPosition.x, WallPosition.y) && !dungeon.data.isWall(WallPosition.x, WallPosition.y - 1))
                                    {
                                        DepthLookupManager.ProcessRenderer(m_GlitchSprite.renderer, DepthLookupManager.GungeonSortingLayer.BACKGROUND);
                                        m_GlitchSprite.IsPerpendicular = false;
                                        m_GlitchSprite.HeightOffGround = 0;
                                        m_GlitchSprite.UpdateZDepth();
                                    }
                                    else
                                    {
                                        m_GlitchSprite.HeightOffGround = 3;
                                        m_GlitchSprite.UpdateZDepth();
                                        m_GlitchTile.SetLayerRecursively(LayerMask.NameToLayer("FG_Critical"));
                                    }

                                    if (roomHandler != null && !isCorruptedSecretRoom && !isLeadKeyRoom)
                                    {
                                        m_GlitchTile.AddComponent <DebrisObject>();
                                        DebrisObject m_GlitchDebris = m_GlitchTile.GetComponent <DebrisObject>();
                                        m_GlitchDebris.angularVelocity         = 0;
                                        m_GlitchDebris.angularVelocityVariance = 0;
                                        m_GlitchDebris.animatePitFall          = false;
                                        m_GlitchDebris.bounceCount             = 0;
                                        m_GlitchDebris.breakOnFallChance       = 0;
                                        m_GlitchDebris.breaksOnFall            = false;
                                        m_GlitchDebris.canRotate             = false;
                                        m_GlitchDebris.changesCollisionLayer = false;
                                        m_GlitchDebris.collisionStopsBullets = false;
                                        m_GlitchDebris.followupBehavior      = DebrisObject.DebrisFollowupAction.None;
                                        m_GlitchDebris.IsAccurateDebris      = true;
                                        m_GlitchDebris.IsCorpse                      = false;
                                        m_GlitchDebris.motionMultiplier              = 0;
                                        m_GlitchDebris.pitFallSplash                 = false;
                                        m_GlitchDebris.playAnimationOnTrigger        = false;
                                        m_GlitchDebris.PreventAbsorption             = true;
                                        m_GlitchDebris.PreventFallingInPits          = true;
                                        m_GlitchDebris.Priority                      = EphemeralObject.EphemeralPriority.Ephemeral;
                                        m_GlitchDebris.shouldUseSRBMotion            = false;
                                        m_GlitchDebris.usesDirectionalFallAnimations = false;
                                        m_GlitchDebris.lifespanMax                   = 600;
                                        m_GlitchDebris.lifespanMin                   = 500;
                                        m_GlitchDebris.usesLifespan                  = true;
                                    }
                                    else
                                    {
                                        m_GlitchTile.AddComponent <ExpandCorruptedObjectDummyComponent>();
                                        ExpandCorruptedObjectDummyComponent dummyComponent = m_GlitchTile.GetComponent <ExpandCorruptedObjectDummyComponent>();
                                        dummyComponent.Init();
                                    }

                                    if (UnityEngine.Random.value <= 0.5f)
                                    {
                                        ExpandShaders.Instance.ApplyGlitchShader(m_GlitchSprite, true, RandomIntervalFloat, RandomDispFloat, RandomDispIntensityFloat, RandomColorProbFloat, RandomColorIntensityFloat);
                                    }
                                    CorruptWallTilesPlaced++;
                                    validWalls.Remove(WallPosition);
                                }
                            }
                        }

                        for (int Width = -1; Width <= currentRoom.area.dimensions.x; Width++)
                        {
                            for (int Height = -1; Height <= currentRoom.area.dimensions.y; Height++)
                            {
                                int X = currentRoom.area.basePosition.x + Width;
                                int Y = currentRoom.area.basePosition.y + Height;
                                if (!dungeon.data.isWall(X, Y) && !dungeon.data.isAnyFaceWall(X, Y))
                                {
                                    validOpenAreas.Add(new IntVector2(X, Y));
                                }
                            }
                        }

                        int OpenAreaCorruptionIntensity = (validOpenAreas.Count / UnityEngine.Random.Range(5, 10));

                        if (UnityEngine.Random.value <= 0.2f | isCorruptedSecretRoom)
                        {
                            if (isCorruptedSecretRoom)
                            {
                                OpenAreaCorruptionIntensity = (validOpenAreas.Count / UnityEngine.Random.Range(2, 5));
                            }
                            else
                            {
                                OpenAreaCorruptionIntensity = (validOpenAreas.Count / UnityEngine.Random.Range(3, 6));
                            }
                        }

                        if ((roomHandler == null && !isCorruptedSecretRoom && UnityEngine.Random.value <= 0.15f) | corruptWallsOnly)
                        {
                            OpenAreaCorruptionIntensity = 0;
                        }

                        if (OpenAreaCorruptionIntensity > 0 && !currentRoom.IsShop && currentRoom.area.PrototypeRoomCategory != PrototypeDungeonRoom.RoomCategory.BOSS)
                        {
                            for (int S = 0; S <= OpenAreaCorruptionIntensity; S++)
                            {
                                IntVector2 OpenAreaPosition = BraveUtility.RandomElement(validOpenAreas);

                                float RandomIntervalFloat       = UnityEngine.Random.Range(0.02f, 0.06f);
                                float RandomDispFloat           = UnityEngine.Random.Range(0.07f, 0.09f);
                                float RandomDispIntensityFloat  = UnityEngine.Random.Range(0.085f, 0.2f);
                                float RandomColorProbFloat      = UnityEngine.Random.Range(0.04f, 0.15f);
                                float RandomColorIntensityFloat = UnityEngine.Random.Range(0.08f, 0.14f);

                                GameObject m_GlitchTile = Instantiate(GlitchedTileObject, (OpenAreaPosition.ToVector2()), Quaternion.identity);
                                m_GlitchTile.name += ("_" + UnityEngine.Random.Range(100000, 999999).ToString());

                                if (parentObject != null)
                                {
                                    m_GlitchTile.transform.parent = parentObject.transform;
                                }
                                else
                                {
                                    m_GlitchTile.transform.parent = currentRoom.hierarchyParent;
                                }

                                tk2dSprite m_GlitchSprite = m_GlitchTile.GetComponent <tk2dSprite>();
                                int        TileType       = UnityEngine.Random.Range(1, 3);
                                List <int> spriteIDs      = new List <int>();
                                if (TileType == 1)
                                {
                                    spriteIDs = CurrentFloorWallIDs;
                                }
                                if (TileType == 2)
                                {
                                    spriteIDs = CurrentFloorFloorIDs;
                                }
                                if (TileType == 3)
                                {
                                    spriteIDs = CurrentFloorMiscIDs;
                                }

                                m_GlitchSprite.SetSprite(BraveUtility.RandomElement(spriteIDs));

                                if (UnityEngine.Random.value <= 0.3f)
                                {
                                    ExpandShaders.Instance.ApplyGlitchShader(m_GlitchSprite, true, RandomIntervalFloat, RandomDispFloat, RandomDispIntensityFloat, RandomColorProbFloat, RandomColorIntensityFloat);
                                }
                                DepthLookupManager.ProcessRenderer(m_GlitchSprite.renderer, DepthLookupManager.GungeonSortingLayer.BACKGROUND);
                                m_GlitchSprite.IsPerpendicular = false;
                                m_GlitchSprite.HeightOffGround = -4f;
                                m_GlitchSprite.SortingOrder    = 2;
                                m_GlitchSprite.UpdateZDepth();

                                if (roomHandler != null && !isCorruptedSecretRoom)
                                {
                                    m_GlitchTile.AddComponent <DebrisObject>();
                                    DebrisObject m_GlitchDebris = m_GlitchTile.GetComponent <DebrisObject>();
                                    m_GlitchDebris.angularVelocity         = 0;
                                    m_GlitchDebris.angularVelocityVariance = 0;
                                    m_GlitchDebris.animatePitFall          = false;
                                    m_GlitchDebris.bounceCount             = 0;
                                    m_GlitchDebris.breakOnFallChance       = 0;
                                    m_GlitchDebris.breaksOnFall            = false;
                                    m_GlitchDebris.canRotate             = false;
                                    m_GlitchDebris.changesCollisionLayer = false;
                                    m_GlitchDebris.collisionStopsBullets = false;
                                    m_GlitchDebris.followupBehavior      = DebrisObject.DebrisFollowupAction.None;
                                    m_GlitchDebris.IsAccurateDebris      = true;
                                    m_GlitchDebris.IsCorpse                      = false;
                                    m_GlitchDebris.motionMultiplier              = 0;
                                    m_GlitchDebris.pitFallSplash                 = false;
                                    m_GlitchDebris.playAnimationOnTrigger        = false;
                                    m_GlitchDebris.PreventAbsorption             = true;
                                    m_GlitchDebris.PreventFallingInPits          = true;
                                    m_GlitchDebris.Priority                      = EphemeralObject.EphemeralPriority.Ephemeral;
                                    m_GlitchDebris.shouldUseSRBMotion            = false;
                                    m_GlitchDebris.usesDirectionalFallAnimations = false;
                                    if (!isCorruptedSecretRoom && roomHandler != null)
                                    {
                                        m_GlitchDebris.lifespanMax  = 600;
                                        m_GlitchDebris.lifespanMin  = 500;
                                        m_GlitchDebris.usesLifespan = true;
                                    }
                                    else
                                    {
                                        m_GlitchDebris.usesLifespan = false;
                                    }
                                }
                                else
                                {
                                    m_GlitchTile.AddComponent <ExpandCorruptedObjectDummyComponent>();
                                    ExpandCorruptedObjectDummyComponent dummyComponent = m_GlitchTile.GetComponent <ExpandCorruptedObjectDummyComponent>();
                                    dummyComponent.Init();
                                }
                                CorruptOpenAreaTilesPlaced++;
                                validOpenAreas.Remove(OpenAreaPosition);
                            }
                        }
                    }
                    iterations++;
                } catch (Exception ex) {
                    if (ExpandStats.debugMode)
                    {
                        if (RoomBeingWorkedOn != null && !string.IsNullOrEmpty(RoomBeingWorkedOn.GetRoomName()))
                        {
                            ETGModConsole.Log("[DEBUG] Exception occured in Dungeon.PlaceWallMimics with room: " + RoomBeingWorkedOn.GetRoomName());
                            Debug.Log("Exception caught in Dungeon.PlaceWallMimics with room: " + RoomBeingWorkedOn.GetRoomName());
                        }
                        else
                        {
                            ETGModConsole.Log("[DEBUG] Exception occured in Dungeon.PlaceWallMimics!");
                            Debug.Log("Exception caught in Dungeon.PlaceWallMimics!");
                        }
                        Debug.LogException(ex);
                    }
                    if (CorruptWallTilesPlaced > 0)
                    {
                        if (ExpandStats.debugMode)
                        {
                            ETGModConsole.Log("[DEBUG] Number of corrupted wall tiles succesfully placed: " + CorruptWallTilesPlaced, false);
                            ETGModConsole.Log("[DEBUG] Number of corrupted ppen area tiles succesfully placed: " + CorruptOpenAreaTilesPlaced, false);
                        }
                    }
                    if (RoomBeingWorkedOn != null)
                    {
                        RoomBeingWorkedOn = null;
                    }
                    iterations++;
                }
            }
            if (CorruptWallTilesPlaced > 0)
            {
                if (ExpandStats.debugMode)
                {
                    ETGModConsole.Log("[DEBUG] Number of Valid Corrupted Wall Tile locations: " + CorruptWallTilesPlaced, false);
                    ETGModConsole.Log("[DEBUG] Number of Valid Corrupted locations: " + CorruptOpenAreaTilesPlaced, false);
                }
            }
            Destroy(GlitchedTileObject);
            return;
        }
        public static void InitPrefabs(AssetBundle expandSharedAssets1)
        {
            EXSecretDoorAnimation = expandSharedAssets1.LoadAsset <GameObject>("EX_SecretDoor_Animation");

            tk2dSpriteAnimation DoorSpriteAnimations = EXSecretDoorAnimation.AddComponent <tk2dSpriteAnimation>();

            ExpandUtility.AddAnimation(DoorSpriteAnimations, ExpandPrefabs.EXSecretDoorCollection.GetComponent <tk2dSpriteCollectionData>(), m_DoorOpenSprites, "door_open", frameRate: 10);
            ExpandUtility.AddAnimation(DoorSpriteAnimations, ExpandPrefabs.EXSecretDoorCollection.GetComponent <tk2dSpriteCollectionData>(), m_DoorCloseSprites, "door_close", frameRate: 10);

            EXSecretDoorMinimapIcon = expandSharedAssets1.LoadAsset <GameObject>("EXSecretDoor_MinimapIcon");
            SpriteSerializer.AddSpriteToObject(EXSecretDoorMinimapIcon, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_MinimapIcon");

            EXSecretDoor_Hollow = expandSharedAssets1.LoadAsset <GameObject>("EX_Secret_Door_Hollow");
            GameObject EXSecretDoorHollow_Frame_Top    = EXSecretDoor_Hollow.transform.Find("FrameTop").gameObject;
            GameObject EXSecretDoorHollow_Frame_Bottom = EXSecretDoor_Hollow.transform.Find("FrameBottom").gameObject;
            GameObject EXSecretDoorHollow_Background   = EXSecretDoor_Hollow.transform.Find("Background").gameObject;
            GameObject EXSecretDoorHollow_Light        = EXSecretDoor_Hollow.transform.Find("Light").gameObject;
            GameObject EXSecretDoorHollow_Lock         = EXSecretDoor_Hollow.transform.Find("Lock").gameObject;


            tk2dSprite m_DoorHollowSprite             = SpriteSerializer.AddSpriteToObject(EXSecretDoor_Hollow, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Open_00");
            tk2dSprite m_DoorHollowBorderTopSprite    = SpriteSerializer.AddSpriteToObject(EXSecretDoorHollow_Frame_Top, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Frame_Top");
            tk2dSprite m_DoorHollowBorderBottomSprite = SpriteSerializer.AddSpriteToObject(EXSecretDoorHollow_Frame_Bottom, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Frame_Bottom");
            tk2dSprite m_DoorHollowBackgroundSprite   = SpriteSerializer.AddSpriteToObject(EXSecretDoorHollow_Background, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Background");
            tk2dSprite m_DoorHollowLightSprite        = SpriteSerializer.AddSpriteToObject(EXSecretDoorHollow_Light, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Light_Red");

            m_DoorHollowBorderTopSprite.HeightOffGround    = 3;
            m_DoorHollowBorderBottomSprite.HeightOffGround = -0.5f;
            m_DoorHollowSprite.HeightOffGround             = -1.5f;
            m_DoorHollowBackgroundSprite.HeightOffGround   = -2f;
            m_DoorHollowLightSprite.HeightOffGround        = 3.5f;

            ExpandUtility.GenerateSpriteAnimator(EXSecretDoor_Hollow, DoorSpriteAnimations, ClipFps: 10);

            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor_Hollow, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 64), offset: new IntVector2(16, 0));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor_Hollow, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 14));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor_Hollow, CollisionLayer.LowObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, IsTrigger: true, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 12));

            ExpandSecretDoorPlacable m_SecretDoorHollowComponent = EXSecretDoor_Hollow.AddComponent <ExpandSecretDoorPlacable>();

            m_SecretDoorHollowComponent.DoorTopBorderObject    = EXSecretDoorHollow_Frame_Top;
            m_SecretDoorHollowComponent.DoorBottomBorderObject = EXSecretDoorHollow_Frame_Bottom;
            m_SecretDoorHollowComponent.DoorBackgroundObject   = EXSecretDoorHollow_Background;
            m_SecretDoorHollowComponent.DoorLightObject        = EXSecretDoorHollow_Light;

            GameObject m_RatLock = ExpandPrefabs.RatJailDoor.GetComponent <InteractableDoorController>().WorldLocks[0].gameObject;

            tk2dSprite EXLockSprite = EXSecretDoorHollow_Lock.AddComponent <tk2dSprite>();

            ExpandUtility.DuplicateSprite(EXLockSprite, m_RatLock.GetComponent <tk2dSprite>());
            ExpandUtility.DuplicateSpriteAnimator(EXSecretDoorHollow_Lock, m_RatLock.GetComponent <tk2dSpriteAnimator>());
            EXLockSprite.HeightOffGround = -0.3f;


            InteractableLock m_EXLockHollow = EXSecretDoorHollow_Lock.AddComponent <InteractableLock>();

            m_EXLockHollow.Suppress          = m_RatLock.GetComponent <InteractableLock>().Suppress;
            m_EXLockHollow.lockMode          = InteractableLock.InteractableLockMode.RESOURCEFUL_RAT;
            m_EXLockHollow.JailCellKeyId     = m_RatLock.GetComponent <InteractableLock>().JailCellKeyId;
            m_EXLockHollow.IdleAnimName      = m_RatLock.GetComponent <InteractableLock>().IdleAnimName;
            m_EXLockHollow.UnlockAnimName    = m_RatLock.GetComponent <InteractableLock>().UnlockAnimName;
            m_EXLockHollow.NoKeyAnimName     = m_RatLock.GetComponent <InteractableLock>().NoKeyAnimName;
            m_EXLockHollow.SpitAnimName      = m_RatLock.GetComponent <InteractableLock>().SpitAnimName;
            m_EXLockHollow.BustedAnimName    = m_RatLock.GetComponent <InteractableLock>().BustedAnimName;
            m_SecretDoorHollowComponent.Lock = m_EXLockHollow;
            EXSecretDoor_Hollow.SetLayerRecursively(LayerMask.NameToLayer("FG_Critical"));

            EXSecretDoor_Hollow_Unlocked = expandSharedAssets1.LoadAsset <GameObject>("EX_Secret_Door_Hollow_Unlocked");
            GameObject EXSecretDoorHollowUnlocked_Frame_Top    = EXSecretDoor_Hollow_Unlocked.transform.Find("FrameTop").gameObject;
            GameObject EXSecretDoorHollowUnlocked_Frame_Bottom = EXSecretDoor_Hollow_Unlocked.transform.Find("FrameBottom").gameObject;
            GameObject EXSecretDoorHollowUnlocked_Background   = EXSecretDoor_Hollow_Unlocked.transform.Find("Background").gameObject;
            GameObject EXSecretDoorHollowUnlocked_Light        = EXSecretDoor_Hollow_Unlocked.transform.Find("Light").gameObject;

            tk2dSprite m_DoorHollow_UnlockedSprite             = SpriteSerializer.AddSpriteToObject(EXSecretDoor_Hollow_Unlocked, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Open_00");
            tk2dSprite m_DoorHollow_UnlockedBorderTopSprite    = SpriteSerializer.AddSpriteToObject(EXSecretDoorHollowUnlocked_Frame_Top, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Frame_Top");
            tk2dSprite m_DoorHollow_UnlockedBorderBottomSprite = SpriteSerializer.AddSpriteToObject(EXSecretDoorHollowUnlocked_Frame_Bottom, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Frame_Bottom");
            tk2dSprite m_DoorHollow_UnlockedBackgroundSprite   = SpriteSerializer.AddSpriteToObject(EXSecretDoorHollowUnlocked_Background, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Background");
            tk2dSprite m_DoorHollow_UnlockedLightSprite        = SpriteSerializer.AddSpriteToObject(EXSecretDoorHollowUnlocked_Light, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Light_Red");

            m_DoorHollow_UnlockedBorderTopSprite.HeightOffGround    = 3;
            m_DoorHollow_UnlockedBorderBottomSprite.HeightOffGround = -0.5f;
            m_DoorHollow_UnlockedSprite.HeightOffGround             = -1.5f;
            m_DoorHollow_UnlockedBackgroundSprite.HeightOffGround   = -2f;
            m_DoorHollow_UnlockedLightSprite.HeightOffGround        = 3.5f;

            ExpandUtility.GenerateSpriteAnimator(EXSecretDoor_Hollow_Unlocked, DoorSpriteAnimations, ClipFps: 10);

            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor_Hollow_Unlocked, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 64), offset: new IntVector2(16, 0));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor_Hollow_Unlocked, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 14));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor_Hollow_Unlocked, CollisionLayer.LowObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, IsTrigger: true, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 12));

            ExpandSecretDoorPlacable m_SecretDoorHollow_UnlockedComponent = EXSecretDoor_Hollow_Unlocked.AddComponent <ExpandSecretDoorPlacable>();

            m_SecretDoorHollow_UnlockedComponent.DoorTopBorderObject    = EXSecretDoorHollowUnlocked_Frame_Top;
            m_SecretDoorHollow_UnlockedComponent.DoorBottomBorderObject = EXSecretDoorHollowUnlocked_Frame_Bottom;
            m_SecretDoorHollow_UnlockedComponent.DoorBackgroundObject   = EXSecretDoorHollowUnlocked_Background;
            m_SecretDoorHollow_UnlockedComponent.DoorLightObject        = EXSecretDoorHollowUnlocked_Light;
            EXSecretDoor_Hollow_Unlocked.SetLayerRecursively(LayerMask.NameToLayer("FG_Critical"));



            EXSecretDoor = expandSharedAssets1.LoadAsset <GameObject>("EX_Secret_Door");
            GameObject EXSecretDoor_Frame_Top    = EXSecretDoor.transform.Find("FrameTop").gameObject;
            GameObject EXSecretDoor_Frame_Bottom = EXSecretDoor.transform.Find("FrameBottom").gameObject;
            GameObject EXSecretDoor_Background   = EXSecretDoor.transform.Find("Background").gameObject;
            GameObject EXSecretDoor_Light        = EXSecretDoor.transform.Find("Light").gameObject;
            GameObject EXSecretDoor_Lock         = EXSecretDoor.transform.Find("Lock").gameObject;


            tk2dSprite m_DoorSprite             = SpriteSerializer.AddSpriteToObject(EXSecretDoor, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Open_00");
            tk2dSprite m_DoorBorderTopSprite    = SpriteSerializer.AddSpriteToObject(EXSecretDoor_Frame_Top, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Frame_NoDecal_Top");
            tk2dSprite m_DoorBorderBottomSprite = SpriteSerializer.AddSpriteToObject(EXSecretDoor_Frame_Bottom, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Frame_Bottom");
            tk2dSprite m_DoorBackgroundSprite   = SpriteSerializer.AddSpriteToObject(EXSecretDoor_Background, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Background");
            tk2dSprite m_DoorLightSprite        = SpriteSerializer.AddSpriteToObject(EXSecretDoor_Light, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Light_Red");

            m_DoorBorderTopSprite.HeightOffGround    = 3;
            m_DoorBorderBottomSprite.HeightOffGround = -0.5f;
            m_DoorSprite.HeightOffGround             = -1.5f;
            m_DoorBackgroundSprite.HeightOffGround   = -2f;
            m_DoorLightSprite.HeightOffGround        = 3.5f;


            ExpandUtility.GenerateSpriteAnimator(EXSecretDoor, DoorSpriteAnimations, ClipFps: 10);

            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 64), offset: new IntVector2(16, 0));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 14));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor, CollisionLayer.LowObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, IsTrigger: true, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 12));

            ExpandSecretDoorPlacable m_SecretDoorComponent = EXSecretDoor.AddComponent <ExpandSecretDoorPlacable>();

            m_SecretDoorComponent.DoorTopBorderObject    = EXSecretDoor_Frame_Top;
            m_SecretDoorComponent.DoorBottomBorderObject = EXSecretDoor_Frame_Bottom;
            m_SecretDoorComponent.DoorBackgroundObject   = EXSecretDoor_Background;
            m_SecretDoorComponent.DoorLightObject        = EXSecretDoor_Light;

            Dungeon    Base_Castle  = DungeonDatabase.GetOrLoadByName("Base_Castle");
            GameObject m_NormalLock = (Base_Castle.PatternSettings.flows[0].sharedInjectionData[1].InjectionData[0].exactRoom.placedObjects[0].nonenemyBehaviour as SecretFloorInteractableController).WorldLocks[0].gameObject;

            tk2dSprite EXLockNormalSprite = EXSecretDoor_Lock.AddComponent <tk2dSprite>();

            ExpandUtility.DuplicateSprite(EXLockNormalSprite, m_NormalLock.GetComponent <tk2dSprite>());
            ExpandUtility.DuplicateSpriteAnimator(EXSecretDoor_Lock, m_NormalLock.GetComponent <tk2dSpriteAnimator>());
            EXLockNormalSprite.HeightOffGround = 1.7f;

            InteractableLock m_EXLockNormal = EXSecretDoor_Lock.AddComponent <InteractableLock>();

            m_EXLockNormal.Suppress       = m_NormalLock.GetComponent <InteractableLock>().Suppress;
            m_EXLockNormal.lockMode       = m_NormalLock.GetComponent <InteractableLock>().lockMode;
            m_EXLockNormal.JailCellKeyId  = m_NormalLock.GetComponent <InteractableLock>().JailCellKeyId;
            m_EXLockNormal.IdleAnimName   = m_NormalLock.GetComponent <InteractableLock>().IdleAnimName;
            m_EXLockNormal.UnlockAnimName = m_NormalLock.GetComponent <InteractableLock>().UnlockAnimName;
            m_EXLockNormal.NoKeyAnimName  = m_NormalLock.GetComponent <InteractableLock>().NoKeyAnimName;
            m_EXLockNormal.SpitAnimName   = m_NormalLock.GetComponent <InteractableLock>().SpitAnimName;
            m_EXLockNormal.BustedAnimName = m_NormalLock.GetComponent <InteractableLock>().BustedAnimName;

            m_SecretDoorComponent.Lock = m_EXLockNormal;
            EXSecretDoor.SetLayerRecursively(LayerMask.NameToLayer("FG_Critical"));

            Base_Castle  = null;
            m_NormalLock = null;

            EXSecretDoor_Unlocked = expandSharedAssets1.LoadAsset <GameObject>("EX_Secret_Door_Unlocked");
            GameObject EXSecretDoorUnlocked_Frame_Top    = EXSecretDoor_Unlocked.transform.Find("FrameTop").gameObject;
            GameObject EXSecretDoorUnlocked_Frame_Bottom = EXSecretDoor_Unlocked.transform.Find("FrameBottom").gameObject;
            GameObject EXSecretDoorUnlocked_Background   = EXSecretDoor_Unlocked.transform.Find("Background").gameObject;
            GameObject EXSecretDoorUnlocked_Light        = EXSecretDoor_Unlocked.transform.Find("Light").gameObject;

            tk2dSprite m_Door_UnlockedSprite             = SpriteSerializer.AddSpriteToObject(EXSecretDoor_Unlocked, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Open_00");
            tk2dSprite m_Door_UnlockedBorderTopSprite    = SpriteSerializer.AddSpriteToObject(EXSecretDoorUnlocked_Frame_Top, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Frame_Top");
            tk2dSprite m_Door_UnlockedBorderBottomSprite = SpriteSerializer.AddSpriteToObject(EXSecretDoorUnlocked_Frame_Bottom, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Frame_Bottom");
            tk2dSprite m_Door_UnlockedBackgroundSprite   = SpriteSerializer.AddSpriteToObject(EXSecretDoorUnlocked_Background, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Background");
            tk2dSprite m_Door_UnlockedLightSprite        = SpriteSerializer.AddSpriteToObject(EXSecretDoorUnlocked_Light, ExpandPrefabs.EXSecretDoorCollection, "EXSecretDoor_Light_Red");

            m_Door_UnlockedBorderTopSprite.HeightOffGround    = 3;
            m_Door_UnlockedBorderBottomSprite.HeightOffGround = -0.5f;
            m_Door_UnlockedSprite.HeightOffGround             = -1.5f;
            m_Door_UnlockedBackgroundSprite.HeightOffGround   = -2f;
            m_Door_UnlockedLightSprite.HeightOffGround        = 3.5f;

            ExpandUtility.GenerateSpriteAnimator(EXSecretDoor_Unlocked, DoorSpriteAnimations, ClipFps: 10);

            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor_Unlocked, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 64), offset: new IntVector2(16, 0));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor_Unlocked, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 14));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor_Unlocked, CollisionLayer.LowObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, IsTrigger: true, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 12));

            ExpandSecretDoorPlacable m_SecretDoor_UnlockedComponent = EXSecretDoor_Unlocked.AddComponent <ExpandSecretDoorPlacable>();

            m_SecretDoor_UnlockedComponent.DoorTopBorderObject    = EXSecretDoorUnlocked_Frame_Top;
            m_SecretDoor_UnlockedComponent.DoorBottomBorderObject = EXSecretDoorUnlocked_Frame_Bottom;
            m_SecretDoor_UnlockedComponent.DoorBackgroundObject   = EXSecretDoorUnlocked_Background;
            m_SecretDoor_UnlockedComponent.DoorLightObject        = EXSecretDoorUnlocked_Light;
            EXSecretDoor_Unlocked.SetLayerRecursively(LayerMask.NameToLayer("FG_Critical"));
        }
Esempio n. 29
0
 public static Dungeon GetDungeonPrefab(int floor)
 {
     return(DungeonDatabase.GetOrLoadByName(dungeonPrefabNames[floor]));
 }
Esempio n. 30
0
        public static void Init()
        {
            ShopTool.sharedAssets        = ResourceManager.LoadAssetBundle("shared_auto_001");
            ShopTool.Shop_Key_Items_01   = ShopTool.sharedAssets.LoadAsset <GenericLootTable>("Shop_Key_Items_01");
            ShopTool.Shop_Truck_Items_01 = ShopTool.sharedAssets.LoadAsset <GenericLootTable>("Shop_Truck_Items_01");
            ShopTool.Shop_Curse_Items_01 = ShopTool.sharedAssets.LoadAsset <GenericLootTable>("Shop_Curse_Items_01");
            ShopTool.Shop_Goop_Items_01  = ShopTool.sharedAssets.LoadAsset <GenericLootTable>("Shop_Goop_Items_01");
            ShopTool.Shop_Blank_Items_01 = ShopTool.sharedAssets.LoadAsset <GenericLootTable>("Shop_Blank_Items_01");

            ShopTool.ForgeDungeonPrefab  = DungeonDatabase.GetOrLoadByName("Base_Forge");
            ShopTool.BlacksmithShop      = ShopTool.ForgeDungeonPrefab.PatternSettings.flows[0].AllNodes[10].overrideExactRoom;
            ShopTool.BlackSmith_Items_01 = (ShopTool.BlacksmithShop.placedObjects[8].nonenemyBehaviour as BaseShopController).shopItemsGroup2;

            //KEY SHOP

            ShopTool.Shop_Key_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Locked Bullets"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Key_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Nesting Chest"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Key_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Loot Capsule"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            //TRORC SHOP

            ShopTool.Shop_Truck_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Recycloader"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Truck_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Frag grenade"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Truck_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["War Vase"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Truck_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Mind Control Device"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Truck_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Boombox"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            //CURSE SHOP

            ShopTool.Shop_Curse_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Malediction Rounds"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Curse_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Vampire Cloak"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Curse_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Beastblood Injection"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });


            ShopTool.Shop_Curse_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Blunderbeast Blight"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Curse_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Repository Of The Damned"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });


            //GOOP SHOP

            ShopTool.Shop_Goop_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = PickupObjectDatabase.GetByEncounterName("Alchemical Gun").PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Goop_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Panacea"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Goop_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Beastblood Injection"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Goop_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Crackling Egg"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            //BLANK SHOP

            ShopTool.Shop_Blank_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Barrier Ammolet"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Blank_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Blank Spellbook"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.Shop_Blank_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Rusted Armor"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            //BLACKSMITH SHOP

            ShopTool.BlackSmith_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Glass Smelter"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.BlackSmith_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Storm Charger"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.BlackSmith_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Roshambo"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.BlackSmith_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = ETGMod.Databases.Items["Locked Bullets"].PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ShopTool.BlackSmith_Items_01.defaultItemDrops.Add(new WeightedGameObject
            {
                rawGameObject           = null,
                pickupId                = PickupObjectDatabase.GetByEncounterName("The Constructor").PickupObjectId,
                weight                  = 1f,
                forceDuplicatesPossible = false,
                additionalPrerequisites = new DungeonPrerequisite[0]
            });

            ForgeDungeonPrefab = null;

            return;
        }