public void OnContentLoad() { // Set survivor dict SurvivorDict.Add("mult", SurvivorCatalog.FindSurvivorIndex("Toolbot")); SurvivorDict.Add("mul-t", SurvivorCatalog.FindSurvivorIndex("Toolbot")); SurvivorDict.Add("toolbot", SurvivorCatalog.FindSurvivorIndex("Toolbot")); SurvivorDict.Add("hunt", SurvivorCatalog.FindSurvivorIndex("Huntress")); SurvivorDict.Add("huntress", SurvivorCatalog.FindSurvivorIndex("Huntress")); SurvivorDict.Add("engi", SurvivorCatalog.FindSurvivorIndex("Engi")); SurvivorDict.Add("engineer", SurvivorCatalog.FindSurvivorIndex("Engi")); SurvivorDict.Add("mage", SurvivorCatalog.FindSurvivorIndex("Mage")); SurvivorDict.Add("arti", SurvivorCatalog.FindSurvivorIndex("Mage")); SurvivorDict.Add("artificer", SurvivorCatalog.FindSurvivorIndex("Mage")); SurvivorDict.Add("merc", SurvivorCatalog.FindSurvivorIndex("Merc")); SurvivorDict.Add("mercenary", SurvivorCatalog.FindSurvivorIndex("Merc")); SurvivorDict.Add("rex", SurvivorCatalog.FindSurvivorIndex("Treebot")); SurvivorDict.Add("treebot", SurvivorCatalog.FindSurvivorIndex("Treebot")); SurvivorDict.Add("croco", SurvivorCatalog.FindSurvivorIndex("Croco")); SurvivorDict.Add("capt", SurvivorCatalog.FindSurvivorIndex("Captain")); // Add skill helpers AiSkillHelperCatalog.Populate(); // Config InitialBots = new ConfigEntry <int> [RandomSurvivorsList.Count]; for (int i = 0; i < RandomSurvivorsList.Count; i++) { string name = BodyCatalog.GetBodyName(SurvivorCatalog.GetBodyIndexFromSurvivorIndex(RandomSurvivorsList[i])).Replace("\'", ""); InitialBots[i] = Config.Bind("Starting Bots", "StartingBots." + name, 0, "Starting amount of bots to spawn at the start of a run. (" + name + ")"); } }
private static void InjectSkillDrivers(GameObject gameObject, BaseAI ai, SurvivorIndex survivorIndex) { AISkillDriver[] skillDrivers = gameObject.GetComponents <AISkillDriver>(); if (skillDrivers != null) { // Strip skills StripSkills(skillDrivers); } // Add skill drivers based on class AiSkillHelper skillHelper = AiSkillHelperCatalog.GetSkillHelperByIndex(survivorIndex); skillHelper.InjectSkills(gameObject, ai); // Set skill drivers PropertyInfo property = typeof(BaseAI).GetProperty("skillDrivers"); property.DeclaringType.GetProperty("skillDrivers"); property.SetValue(ai, gameObject.GetComponents <AISkillDriver>(), BindingFlags.NonPublic | BindingFlags.Instance, null, null, null); //ai.SetFieldValue2("skillDrivers", gameObject.GetComponents<AISkillDriver>()); // Combat update timer fix gameObject.AddComponent <PlayerBotCombatFix>(); }
public void Start() { AiSkillHelperCatalog.Populate(); }