Exemple #1
0
 // Token: 0x06000089 RID: 137 RVA: 0x000059ED File Offset: 0x00003BED
 public static void Init()
 {
     Tools.Init();
     StaticReferences.Init();
     ShrineFakePrefabHooks.Init();
     ShrineFactory.Init();
 }
        // Token: 0x06000007 RID: 7 RVA: 0x00002D88 File Offset: 0x00000F88
        public static void Register(RoomFactory.RoomData roomData)
        {
            PrototypeDungeonRoom room = roomData.room;
            WeightedRoom         w    = new WeightedRoom
            {
                room = room,
                additionalPrerequisites = new DungeonPrerequisite[0],
                weight = ((roomData.weight == 0f) ? DungeonHandler.GlobalRoomWeight : roomData.weight)
            };

            switch (room.category)
            {
            case PrototypeDungeonRoom.RoomCategory.BOSS:
                return;

            case PrototypeDungeonRoom.RoomCategory.SPECIAL:
            {
                PrototypeDungeonRoom.RoomSpecialSubCategory subCategorySpecial     = room.subCategorySpecial;
                PrototypeDungeonRoom.RoomSpecialSubCategory roomSpecialSubCategory = subCategorySpecial;
                bool flag = roomSpecialSubCategory != PrototypeDungeonRoom.RoomSpecialSubCategory.STANDARD_SHOP;
                if (flag)
                {
                    bool flag2 = roomSpecialSubCategory != PrototypeDungeonRoom.RoomSpecialSubCategory.WEIRD_SHOP;
                    if (flag2)
                    {
                        StaticReferences.RoomTables["special"].includedRooms.Add(w);
                    }
                    else
                    {
                        StaticReferences.subShopTable.InjectionData.Add(DungeonHandler.GetFlowModifier(roomData));
                    }
                }
                else
                {
                    StaticReferences.RoomTables["shop"].includedRooms.Add(w);
                }
                return;
            }

            case PrototypeDungeonRoom.RoomCategory.SECRET:
                StaticReferences.RoomTables["secret"].includedRooms.Add(w);
                return;
            }
            List <DungeonPrerequisite> list = new List <DungeonPrerequisite>();

            foreach (DungeonPrerequisite dungeonPrerequisite in room.prerequisites)
            {
                bool requireTileset = dungeonPrerequisite.requireTileset;
                bool flag3          = requireTileset;
                if (flag3)
                {
                    StaticReferences.GetRoomTable(dungeonPrerequisite.requiredTileset).includedRooms.Add(w);
                    list.Add(dungeonPrerequisite);
                }
            }
            foreach (DungeonPrerequisite item in list)
            {
                room.prerequisites.Remove(item);
            }
        }
        public static void Register(RoomData roomData)
        {
            var room  = roomData.room;
            var wRoom = new WeightedRoom()
            {
                room = room,
                additionalPrerequisites = new DungeonPrerequisite[0],
                weight = roomData.weight == 0 ? GlobalRoomWeight : roomData.weight
            };

            switch (room.category)
            {
            case RoomCategory.SPECIAL:
                switch (room.subCategorySpecial)
                {
                case RoomSpecialSubCategory.STANDARD_SHOP:          //shops
                    StaticReferences.RoomTables["shop"].includedRooms.Add(wRoom);
                    break;

                case RoomSpecialSubCategory.WEIRD_SHOP:            //subshops
                    StaticReferences.subShopTable.InjectionData.Add(GetFlowModifier(roomData));
                    break;

                default:
                    StaticReferences.RoomTables["special"].includedRooms.Add(wRoom);
                    break;
                }
                break;

            case RoomCategory.SECRET:
                StaticReferences.RoomTables["secret"].includedRooms.Add(wRoom);
                break;

            case RoomCategory.BOSS:
                //TODO - Boss rooms
                break;

            default:
                var tilesetPrereqs = new List <DungeonPrerequisite>();
                foreach (var p in room.prerequisites)
                {
                    if (p.requireTileset)
                    {
                        StaticReferences.GetRoomTable(p.requiredTileset).includedRooms.Add(wRoom);
                        tilesetPrereqs.Add(p);
                    }
                }
                foreach (var p in tilesetPrereqs)
                {
                    room.prerequisites.Remove(p);
                }
                break;
            }
            //Tools.Print($"Registering {roomData.room.name} with weight {wRoom.weight} as {roomData.category}");
        }
Exemple #4
0
        public static PrototypeDungeonRoom RoomFromAssetName(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(null);
            }

            string asset = name;

            if (name.Contains('/'))
            {
                asset = name.Substring(name.LastIndexOf('/') + 1).Replace(".asset", "").Trim();
            }

            var room = StaticReferences.GetAsset <PrototypeDungeonRoom>(asset); //check both assetbundles

            return(room);
        }
Exemple #5
0
        // Token: 0x06000059 RID: 89 RVA: 0x00005954 File Offset: 0x00003B54
        public static PrototypeDungeonRoom RoomFromAssetName(string name)
        {
            bool flag = string.IsNullOrEmpty(name);
            PrototypeDungeonRoom result;

            if (flag)
            {
                result = null;
            }
            else
            {
                string assetName = name;
                bool   flag2     = name.Contains('/');
                if (flag2)
                {
                    assetName = name.Substring(name.LastIndexOf('/') + 1).Replace(".asset", "").Trim();
                }
                PrototypeDungeonRoom asset = StaticReferences.GetAsset <PrototypeDungeonRoom>(assetName);
                result = asset;
            }
            return(result);
        }
 // 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);
 }
Exemple #7
0
        public static void Register(RoomData roomData)
        {
            var room  = roomData.room;
            var wRoom = new WeightedRoom()
            {
                room = room,
                additionalPrerequisites = new DungeonPrerequisite[0],
                weight = roomData.weight
            };

            AssetBundle shared_auto_001 = ResourceManager.LoadAssetBundle("shared_auto_001");

            GameObject iconPrefab = RoomFactory.MinimapIconPrefab ?? (shared_auto_001.LoadAsset("assets/data/prefabs/room icons/minimap_boss_icon.prefab") as GameObject);

            //bool success = false;
            switch (room.category)
            {
            case RoomCategory.SPECIAL:
                switch (room.subCategorySpecial)
                {
                case RoomSpecialSubCategory.STANDARD_SHOP:          //shops
                    StaticReferences.RoomTables["shop"].includedRooms.Add(wRoom);
                    // Tools.Print($"Registering {roomData.room.name} with weight {wRoom.weight} as {roomData.category}:{roomData.specialSubCategory}");
                    //   success = true;
                    break;

                case RoomSpecialSubCategory.WEIRD_SHOP:            //subshops
                    StaticReferences.subShopTable.InjectionData.AddRange(GetFlowModifier(roomData));
                    /// Tools.Print($"Registering {roomData.room.name} with weight {wRoom.weight} as {roomData.category}:{roomData.specialSubCategory}");
                    // success = true;
                    break;

                default:
                    StaticReferences.RoomTables["special"].includedRooms.Add(wRoom);
                    //Tools.Print($"Registering {roomData.room.name} with weight {wRoom.weight} as {roomData.category}:{roomData.specialSubCategory}");
                    // success = true;
                    break;
                }
                break;

            case RoomCategory.SECRET:
                StaticReferences.RoomTables["secret"].includedRooms.Add(wRoom);
                //success = true;
                break;

            //===========================PUTS YOUR BOSS ROOMS IN THE POOLS DEFINED IN STATICREFERENCES ====================
            case RoomCategory.BOSS:
                switch (room.subCategoryBoss)
                {
                case RoomBossSubCategory.FLOOR_BOSS:
                    foreach (var p in room.prerequisites)
                    {
                        if (p.requiredTileset == GlobalDungeonData.ValidTilesets.CASTLEGEON)
                        {
                            StaticReferences.RoomTables["boss1"].includedRooms.Add(wRoom);
                            StaticReferences.RoomTables["boss2"].includedRooms.Add(wRoom);
                            StaticReferences.RoomTables["boss3"].includedRooms.Add(wRoom);
                        }
                        else if (p.requiredTileset == GlobalDungeonData.ValidTilesets.SEWERGEON)
                        {
                            StaticReferences.RoomTables["blobby"].includedRooms.Add(wRoom);
                        }
                        else if (p.requiredTileset == GlobalDungeonData.ValidTilesets.GUNGEON)
                        {
                            StaticReferences.RoomTables["gorgun"].includedRooms.Add(wRoom);
                            StaticReferences.RoomTables["beholster"].includedRooms.Add(wRoom);
                            StaticReferences.RoomTables["ammoconda"].includedRooms.Add(wRoom);
                        }
                        else if (p.requiredTileset == GlobalDungeonData.ValidTilesets.CATHEDRALGEON)
                        {
                            StaticReferences.RoomTables["oldking"].includedRooms.Add(wRoom);
                        }
                        else if (p.requiredTileset == GlobalDungeonData.ValidTilesets.MINEGEON)
                        {
                            StaticReferences.RoomTables["tank"].includedRooms.Add(wRoom);
                            StaticReferences.RoomTables["cannonballrog"].includedRooms.Add(wRoom);
                            StaticReferences.RoomTables["flayer"].includedRooms.Add(wRoom);
                        }
                        else if (p.requiredTileset == GlobalDungeonData.ValidTilesets.CATHEDRALGEON)
                        {
                            StaticReferences.RoomTables["pillars"].includedRooms.Add(wRoom);
                            StaticReferences.RoomTables["priest"].includedRooms.Add(wRoom);
                            StaticReferences.RoomTables["monger"].includedRooms.Add(wRoom);
                        }
                        else
                        {
                            //StaticReferences.RoomTables["doorlord"].includedRooms.Add(wRoom);
                        }
                    }
                    room.associatedMinimapIcon = iconPrefab;

                    break;

                case RoomBossSubCategory.MINI_BOSS:
                    StaticReferences.RoomTables["blockner"].includedRooms.Add(wRoom);
                    StaticReferences.RoomTables["shadeagunim"].includedRooms.Add(wRoom);
                    //StaticReferences.RoomTables["fuselier"].includedRooms.Add(wRoom);
                    room.associatedMinimapIcon = iconPrefab;
                    break;

                default:
                    //StaticReferences.RoomTables["doorlord"].includedRooms.Add(wRoom);
                    // room.associatedMinimapIcon = iconPrefab;
                    break;
                }
                break;

            //===============================================
            default:
                foreach (var p in room.prerequisites)
                {
                    if (p.requireTileset)
                    {
                        StaticReferences.GetRoomTable(p.requiredTileset).includedRooms.Add(wRoom);
                    }
                }
                //   success = true;
                break;
            }

            RemoveTilesetPrereqs(room);
        }
Exemple #8
0
        public static void RegisterForShrine(RoomData roomData)
        {
            var room  = roomData.room;
            var wRoom = new WeightedRoom()
            {
                room = room,
                additionalPrerequisites = new DungeonPrerequisite[0],
                weight = roomData.weight
            };
            //AssetBundle shared_auto_001 = ResourceManager.LoadAssetBundle("shared_auto_001");

            GameObject iconPrefab = (GameObject)BraveResources.Load("Global Prefabs/Minimap_Shrine_Icon", ".prefab");

            room.associatedMinimapIcon = iconPrefab;
            // bool success = false;
            switch (room.category)
            {
            case RoomCategory.SPECIAL:
                switch (room.subCategorySpecial)
                {
                case RoomSpecialSubCategory.STANDARD_SHOP:          //shops
                    StaticReferences.RoomTables["shop"].includedRooms.Add(wRoom);
                    // Tools.Print($"Registering {roomData.room.name} with weight {wRoom.weight} as {roomData.category}:{roomData.specialSubCategory}");
                    //    success = true;
                    break;

                case RoomSpecialSubCategory.WEIRD_SHOP:            //subshops
                    StaticReferences.subShopTable.InjectionData.AddRange(GetFlowModifier(roomData));
                    /// Tools.Print($"Registering {roomData.room.name} with weight {wRoom.weight} as {roomData.category}:{roomData.specialSubCategory}");
                    //    success = true;
                    break;

                default:
                    StaticReferences.RoomTables["special"].includedRooms.Add(wRoom);
                    //Tools.Print($"Registering {roomData.room.name} with weight {wRoom.weight} as {roomData.category}:{roomData.specialSubCategory}");
                    //  success = true;
                    break;
                }
                break;

            case RoomCategory.SECRET:
                StaticReferences.RoomTables["secret"].includedRooms.Add(wRoom);
                //success = true;
                break;

            case RoomCategory.BOSS:
                // TODO
                break;

            default:
                foreach (var p in room.prerequisites)
                {
                    if (p.requireTileset)
                    {
                        StaticReferences.GetRoomTable(p.requiredTileset).includedRooms.Add(wRoom);
                    }
                }
                // success = true;
                break;
            }
            //success = true;
            RemoveTilesetPrereqs(room);
        }