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); } } } }
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 override void Start() { if (!string.IsNullOrEmpty(ExceptionText) | !string.IsNullOrEmpty(ExceptionText2)) { if (!string.IsNullOrEmpty(ExceptionText)) { ETGModConsole.Log(ExceptionText); } if (!string.IsNullOrEmpty(ExceptionText2)) { ETGModConsole.Log(ExceptionText2); } return; } ExpandSharedHooks.InstallRequiredHooks(); AssetBundle expandSharedAssets1 = ResourceManager.LoadAssetBundle(ModAssetBundleName); AssetBundle sharedAssets = ResourceManager.LoadAssetBundle("shared_auto_001"); AssetBundle sharedAssets2 = ResourceManager.LoadAssetBundle("shared_auto_002"); AssetBundle braveResources = ResourceManager.LoadAssetBundle("brave_resources_001"); AssetBundle enemiesBase = ResourceManager.LoadAssetBundle("enemies_base_001"); ExpandAssets.InitAudio(expandSharedAssets1, ModSoundBankName); ExpandObjectDatabase.BuildDatabase(); // Init Custom GameLevelDefinitions ExpandCustomDungeonPrefabs.InitCustomGameLevelDefinitions(braveResources); // Init Custom Sprite Collections ExpandPrefabs.InitSpriteCollections(expandSharedAssets1); ExpandCustomEnemyDatabase.InitSpriteCollections(expandSharedAssets1); // Init ItemAPI SetupItemAPI(expandSharedAssets1); try { // Init Prefab Databases ExpandPrefabs.InitCustomPrefabs(expandSharedAssets1, sharedAssets, sharedAssets2, braveResources, enemiesBase); // Init Custom Enemy Prefabs ExpandCustomEnemyDatabase.InitPrefabs(expandSharedAssets1); // Init Custom Room Prefabs ExpandRoomPrefabs.InitCustomRooms(expandSharedAssets1, sharedAssets, sharedAssets2, braveResources, enemiesBase); // Init Custom DungeonFlow(s) ExpandDungeonFlow.InitDungeonFlows(sharedAssets2); // Post Init // Things that need existing stuff created first have code run here BootlegGuns.PostInit(); // Dungeon Prefabs ExpandCustomDungeonPrefabs.InitDungoenPrefabs(expandSharedAssets1, sharedAssets, sharedAssets2, braveResources); ExpandLists.InvalidRatFloorRainRooms = new List <string>() { ExpandRoomPrefabs.SecretBossRoom.name, ExpandRoomPrefabs.ThwompCrossingVerticalNoRain.name, ExpandRoomPrefabs.SecretRewardRoom.name, ExpandPrefabs.DragunBossFoyerRoom.name, ExpandPrefabs.DraGunExitRoom.name, ExpandPrefabs.DraGunEndTimesRoom.name, ExpandPrefabs.BlacksmithShop.name, "Zelda Puzzle Room 1", "Zelda Puzzle Room 2", "Zelda Puzzle Room 3", "Special Entrance" }; } catch (Exception ex) { ETGModConsole.Log("[ExpandTheGungeon] ERROR: Exception occured while building prefabs!", true); Debug.LogException(ex); expandSharedAssets1 = null; sharedAssets = null; sharedAssets2 = null; braveResources = null; enemiesBase = null; return; } // Modified version of Anywhere mod DungeonFlowModule.Install(); InitConsoleCommands(ConsoleCommandName); GameManager.Instance.StartCoroutine(WaitForFoyerLoad()); if (ExpandSettings.EnableLanguageFix) { GameManager.Options.CurrentLanguage = StringTableManager.GungeonSupportedLanguages.ENGLISH; StringTableManager.CurrentLanguage = StringTableManager.GungeonSupportedLanguages.ENGLISH; } // Null bundles when done with them to avoid game crash issues expandSharedAssets1 = null; sharedAssets = null; sharedAssets2 = null; braveResources = null; enemiesBase = null; }
public override void Start() { if (!string.IsNullOrEmpty(ExceptionText)) { ETGModConsole.Log(ExceptionText); return; } ExpandSharedHooks.InstallRequiredHooks(); // Init ItemAPI SetupItemAPI(); try { // Init Prefab Databases ExpandPrefabs.InitCustomPrefabs(); // Init Custom Enemy Prefabs ExpandCustomEnemyDatabase.InitPrefabs(); // Init Custom Room Prefabs ExpandRoomPrefabs.InitCustomRooms(); // Init Custom DungeonFlow(s) ExpandDungeonFlow.InitDungeonFlows(); // Init Custom Dungeons Prefabs ExpandCustomDungeonPrefabs.InitCustomDungeons(); // Post Init // Things thta need existing stuff created first have code run here BootlegGuns.PostInit(); ExpandLists.InvalidRatFloorRainRooms = new List <string>() { ExpandRoomPrefabs.SecretBossRoom.name, ExpandRoomPrefabs.ThwompCrossingVerticalNoRain.name, ExpandRoomPrefabs.SecretRewardRoom.name, ExpandPrefabs.DragunBossFoyerRoom.name, ExpandPrefabs.DraGunExitRoom.name, ExpandPrefabs.DraGunEndTimesRoom.name, ExpandPrefabs.BlacksmithShop.name, "Zelda Puzzle Room 1", "Zelda Puzzle Room 2", "Zelda Puzzle Room 3", "Special Entrance" }; } catch (Exception ex) { ETGModConsole.Log("[ExpandTheGungeon] ERROR: Exception occured while building prefabs!", true); Debug.LogException(ex); ExpandPrefabs.sharedAssets = null; ExpandPrefabs.sharedAssets2 = null; ExpandPrefabs.braveResources = null; ExpandPrefabs.enemiesBase = null; return; } // Modified version of Anywhere mod DungeonFlowModule.Install(); InitConsoleCommands(ConsoleCommandName); // Null bundles when done with them to avoid game crash issues. ExpandPrefabs.sharedAssets = null; ExpandPrefabs.sharedAssets2 = null; ExpandPrefabs.braveResources = null; ExpandPrefabs.enemiesBase = null; }