コード例 #1
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 = RoomFactory3.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
                    StaticReferences2.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
                    StaticReferences2.subShopTable.InjectionData.AddRange(GetFlowModifier(roomData));
                    /// Tools.Print($"Registering {roomData.room.name} with weight {wRoom.weight} as {roomData.category}:{roomData.specialSubCategory}");
                    // success = true;
                    break;

                default:
                    StaticReferences2.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:
                StaticReferences2.RoomTables["secret"].includedRooms.Add(wRoom);
                //success = true;
                break;

            //===========================PUTS YOUR BOSS ROOMS IN THE POOLS DEFINED IN StaticReferences2 ====================
            case RoomCategory.BOSS:
                switch (room.subCategoryBoss)
                {
                case RoomBossSubCategory.FLOOR_BOSS:
                    foreach (var p in room.prerequisites)
                    {
                        if (p.requiredTileset == GlobalDungeonData.ValidTilesets.CASTLEGEON)
                        {
                            if (room.name.ToLower().Contains("bulletking"))
                            {
                                StaticReferences2.RoomTables["bulletking"].includedRooms.Add(wRoom);
                            }
                            else if (room.name.ToLower().Contains("triggertwins"))
                            {
                                StaticReferences2.RoomTables["triggertwins"].includedRooms.Add(wRoom);
                            }
                            else if (room.name.ToLower().Contains("gatlinggull"))
                            {
                                StaticReferences2.RoomTables["gull"].includedRooms.Add(wRoom);
                            }
                            else
                            {
                                StaticReferences2.RoomTables["gull"].includedRooms.Add(wRoom);
                                StaticReferences2.RoomTables["triggertwins"].includedRooms.Add(wRoom);
                                StaticReferences2.RoomTables["bulletking"].includedRooms.Add(wRoom);
                            }
                        }
                        else if (p.requiredTileset == GlobalDungeonData.ValidTilesets.SEWERGEON)
                        {
                            StaticReferences2.RoomTables["blobby"].includedRooms.Add(wRoom);
                        }
                        else if (p.requiredTileset == GlobalDungeonData.ValidTilesets.GUNGEON)
                        {
                            if (room.name.ToLower().Contains("beholster"))
                            {
                                StaticReferences2.RoomTables["beholster"].includedRooms.Add(wRoom);
                            }
                            else if (room.name.ToLower().Contains("ammoconda"))
                            {
                                StaticReferences2.RoomTables["ammoconda"].includedRooms.Add(wRoom);
                            }
                            else if (room.name.ToLower().Contains("gorgun"))
                            {
                                StaticReferences2.RoomTables["gorgun"].includedRooms.Add(wRoom);
                            }
                            else
                            {
                                StaticReferences2.RoomTables["gorgun"].includedRooms.Add(wRoom);
                                StaticReferences2.RoomTables["beholster"].includedRooms.Add(wRoom);
                                StaticReferences2.RoomTables["ammoconda"].includedRooms.Add(wRoom);
                            }
                        }
                        else if (p.requiredTileset == GlobalDungeonData.ValidTilesets.CATHEDRALGEON)
                        {
                            StaticReferences2.RoomTables["oldking"].includedRooms.Add(wRoom);
                        }
                        else if (p.requiredTileset == GlobalDungeonData.ValidTilesets.MINEGEON)
                        {
                            if (room.name.ToLower().Contains("tank"))
                            {
                                StaticReferences2.RoomTables["tank"].includedRooms.Add(wRoom);
                            }
                            else if (room.name.ToLower().Contains("cannonballrog"))
                            {
                                StaticReferences2.RoomTables["cannonballrog"].includedRooms.Add(wRoom);
                            }
                            else if (room.name.ToLower().Contains("mineflayer"))
                            {
                                StaticReferences2.RoomTables["flayer"].includedRooms.Add(wRoom);
                            }
                            else
                            {
                                StaticReferences2.RoomTables["tank"].includedRooms.Add(wRoom);
                                StaticReferences2.RoomTables["cannonballrog"].includedRooms.Add(wRoom);
                                StaticReferences2.RoomTables["flayer"].includedRooms.Add(wRoom);
                            }
                        }
                        else if (p.requiredTileset == GlobalDungeonData.ValidTilesets.CATHEDRALGEON)
                        {
                            if (room.name.ToLower().Contains("killpillars"))
                            {
                                StaticReferences2.RoomTables["pillars"].includedRooms.Add(wRoom);
                            }
                            else if (room.name.ToLower().Contains("highpriest"))
                            {
                                StaticReferences2.RoomTables["priest"].includedRooms.Add(wRoom);
                            }
                            else if (room.name.ToLower().Contains("wallmonger"))
                            {
                                StaticReferences2.RoomTables["monger"].includedRooms.Add(wRoom);
                            }
                            else
                            {
                                StaticReferences2.RoomTables["pillars"].includedRooms.Add(wRoom);
                                StaticReferences2.RoomTables["priest"].includedRooms.Add(wRoom);
                                StaticReferences2.RoomTables["monger"].includedRooms.Add(wRoom);
                            }
                        }
                        else
                        {
                            //StaticReferences2.RoomTables["doorlord"].includedRooms.Add(wRoom);
                        }
                    }
                    room.associatedMinimapIcon = iconPrefab;

                    break;

                case RoomBossSubCategory.MINI_BOSS:
                    if (room.name.ToLower().Contains("blockner"))
                    {
                        StaticReferences2.RoomTables["blockner"].includedRooms.Add(wRoom);
                    }
                    else if (room.name.ToLower().Contains("agunim"))
                    {
                        StaticReferences2.RoomTables["shadeagunim"].includedRooms.Add(wRoom);
                    }
                    else
                    {
                        StaticReferences2.RoomTables["blockner"].includedRooms.Add(wRoom);
                        StaticReferences2.RoomTables["shadeagunim"].includedRooms.Add(wRoom);
                    }
                    //StaticReferences2.RoomTables["fuselier"].includedRooms.Add(wRoom);
                    room.associatedMinimapIcon = iconPrefab;
                    break;

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


            //===============================================
            default:
                foreach (var p in room.prerequisites)
                {
                    if (p.requireTileset)
                    {
                        try
                        {
                            //ETGModConsole.Log("Attempting To Add This Room" + room.name);
                            StaticReferences2.GetRoomTable(p.requiredTileset).includedRooms.Add(wRoom);
                        }
                        catch (Exception e)
                        {
                            ETGModConsole.Log(e.ToString());
                            ETGModConsole.Log("This Room f***s it up:" + room.name);
                        }
                    }
                }
                //   success = true;
                break;
            }

            RemoveTilesetPrereqs(room);
        }
コード例 #2
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
                    StaticReferences2.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
                    StaticReferences2.subShopTable.InjectionData.AddRange(GetFlowModifier(roomData));
                    /// Tools.Print($"Registering {roomData.room.name} with weight {wRoom.weight} as {roomData.category}:{roomData.specialSubCategory}");
                    //    success = true;
                    break;

                default:
                    StaticReferences2.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:
                StaticReferences2.RoomTables["secret"].includedRooms.Add(wRoom);
                //success = true;
                break;

            case RoomCategory.BOSS:
                // TODO
                break;

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