public static void StartingSettings() { ToggableSettings.one = "on"; ToggableSettings.two = "on"; ToggableSettings.three = "on"; GRandomEnemyDataBaseHelper.ToggleDatabases(); }
public override void Start() { ETGModConsole.Log("[EnemyRandomizer] Running"); try { GRandomRoomDatabaseHelper.Start(); GRandomEnemyDataBaseHelper.Start(); Hook enemyhook = new Hook(typeof(DungeonPlaceableUtility).GetMethod("InstantiateDungeonPlaceable", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static), typeof(GRandomHook).GetMethod("MainHook", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static)); Hook DraGunRoomStartHook = new Hook(typeof(DraGunRoomPlaceable).GetMethod("Start", BindingFlags.Instance | BindingFlags.Public), typeof(GRandomHook).GetMethod("DraGunRoomStartHook", BindingFlags.Instance | BindingFlags.Public), typeof(DraGunRoomPlaceable)); Hook DraGunRoomUpdateHook = new Hook(typeof(DraGunRoomPlaceable).GetMethod("Update", BindingFlags.Instance | BindingFlags.Public), typeof(GRandomHook).GetMethod("DraGunRoomUpdateHook", BindingFlags.Instance | BindingFlags.Public), typeof(DraGunRoomPlaceable)); Hook DemonWallMovementBehaviorHook = new Hook(typeof(DemonWallMovementBehavior).GetMethod("Update", BindingFlags.Instance | BindingFlags.Public), typeof(GRandomHook).GetMethod("DemonWallMovementBehaviorHook", BindingFlags.Instance | BindingFlags.Public), typeof(DemonWallMovementBehavior)); Hook HealthHaver_ApplyDamageHook = new Hook(typeof(HealthHaver).GetMethod("ApplyDamage", BindingFlags.Instance | BindingFlags.Public), typeof(BraveHook).GetMethod("HealthHaver_ApplyDamageHook", BindingFlags.Instance | BindingFlags.Public), typeof(HealthHaver)); Hook orig_StartHook = new Hook(typeof(PlayerController).GetMethod("orig_Start", BindingFlags.Instance | BindingFlags.Public), typeof(GRandomHook).GetMethod("orig_StartHook", BindingFlags.Instance | BindingFlags.Public), typeof(PlayerController)); Hook LateUpdateHook = new Hook(typeof(ResourcefulRatMinesHiddenTrapdoor).GetMethod("LateUpdate", BindingFlags.Instance | BindingFlags.NonPublic), typeof(GRandomHook).GetMethod("LateUpdateHook", BindingFlags.Instance | BindingFlags.Public), typeof(ResourcefulRatMinesHiddenTrapdoor)); ToggableSettings.StartingSettings(); ToggableSettings.DisplayStats(); ETGModConsole.Commands.AddGroup("jank", new Action <string[]>(GRandomDebugRoom.kill2)); ETGModConsole.Commands.AddGroup("randhelp", new Action <string[]>(ToggableSettings.Help)); ETGModConsole.Commands.AddGroup("randmodes", new Action <string[]>(ToggableSettings.GetStats)); ETGModConsole.Commands.AddGroup("rand", new Action <string[]>(ToggableSettings.ConsoleLineHandler)); } catch (Exception exception) { Console.WriteLine("[EnemyRandomizer] Error occured while installing hooks"); Debug.LogException(exception); } if (GRDebug) { GRandomDebugRoom.EnemyDatabaseChecker(); ETGModConsole.Log("[Random] In DEBUG Mode"); GRandomDebugRoom.TestingRooms(); GRandomDebugRoom.TestingAssets(); GRandomDebugRoom.gettingAssetTypes(); ETGModConsole.Commands.AddGroup("randomremove", new Action <string[]>(GRandomEnemyDataBaseHelper.DropEnemy)); ETGModConsole.Commands.AddGroup("room", new Action <string[]>(GRandomDebugRoom.RoomStats)); ETGModConsole.Commands.AddGroup("kill", new Action <string[]>(GRandomDebugRoom.KillRoom)); ETGModConsole.Commands.AddGroup("randen", new Action <string[]>(GRandomDebugRoom.EnemySpawner)); ETGModConsole.Commands.AddGroup("on", new Action <string[]>(GRandomDebugRoom.On)); ETGModConsole.Commands.AddGroup("off", new Action <string[]>(GRandomDebugRoom.Off)); ETGModConsole.Commands.AddGroup("collide", new Action <string[]>(GRandomDebugRoom.CollidesWithProjectiles)); ETGModConsole.Commands.AddGroup("components", new Action <string[]>(GRandomDebugRoom.ListEnemyComponents)); ETGModConsole.Commands.AddGroup("dungeon", new Action <string[]>(GRandomDebugRoom.ListDungeonComponents)); ETGModConsole.Commands.AddGroup("room2", new Action <string[]>(GRandomDebugRoom.RoomStats2)); ETGModConsole.Commands.AddGroup("dragun", new Action <string[]>(GRandomDebugRoom.DragunNearDeath)); ETGModConsole.Commands.AddGroup("tele", new Action <string[]>(GRandomTeleport.TeleportToSpecificRoom)); ETGModConsole.Commands.AddGroup("get", new Action <string[]>(GRandomDebugRoom.Get)); //for getting all room names ETGModConsole.Commands.AddGroup("getrooms", new Action <string[]>(GRandomDebugRoom.GetRooms)); ETGModConsole.Commands.AddGroup("specificrooms", new Action <string[]>(GRandomDebugRoom.GetSpecificRooms)); ETGModConsole.Commands.AddGroup("vector", new Action <string[]>(GRandomDebugRoom.GetPlayerVector2)); ETGModConsole.Commands.AddGroup("getscene", new Action <string[]>(GRandomDebugRoom.GetSceneNames)); ETGModConsole.Commands.AddGroup("telescene", new Action <string[]>(GRandomSceneTele.TeleSceneHandler)); ETGModConsole.Commands.AddGroup("compareprojectile", new Action <string[]>(GRandomDebugRoom.CompareProjectileVelocity_HealthHaverDirection)); ETGModConsole.Commands.AddGroup("returntofoyer", new Action <string[]>(GRandomDebugRoom._ReturnToFoyer)); ETGModConsole.Commands.AddGroup("bulletstoppingerror", new Action <string[]>(GRandomDebugRoom.DebugBulletStoppingError)); ETGModConsole.Commands.AddGroup("bosshealth", new Action <string[]>(GRandomDebugRoom.getBossHealth)); ETGModConsole.Commands.AddGroup("bossroom", new Action <string[]>(GRandomDebugRoom.getBossRoomDatabase)); } }
{//set in ETGModConsole by player during runtime public static void ConsoleLineHandler(string[] args) { if (args.Length != 2) { string[] x = null; ETGModConsole.Log("Not valid input, see randhelp"); } else { string command = args[0].Trim(); string toggle = args[1].Trim().ToLower(); ETGModConsole.Log(""); if (command == "1") // Normal Enemies as bosses { if (toggle == "on") { ToggableSettings.one = "on"; } else { ToggableSettings.one = "off"; } ETGModConsole.Log("Normal Enemies as Bosses: " + ToggableSettings.one); } else if (command == "2") // Bosses as Normal Enemies { if (toggle == "on") { ToggableSettings.two = "on"; } else { ToggableSettings.two = "off"; } ETGModConsole.Log("Bosses as Normal Enemies: " + ToggableSettings.two); } else if (command == "3") // Start w/ Random Gun and Item { if (toggle == "on") { ToggableSettings.three = "on"; } else { ToggableSettings.three = "off"; } ETGModConsole.Log("Start w/ Random Gun and Item: " + ToggableSettings.three); } else { ETGModConsole.Log("Not valid input, see randhelp"); } ETGModConsole.Log("Start new dungeon or floor to initiate changes"); GRandomEnemyDataBaseHelper.ToggleDatabases(); } }