private static StageSettings GetStageSettings(ClassicStageInfo self) { var set = new StageSettings { SceneDirectorInteractableCredits = self.sceneDirectorInteractibleCredits, SceneDirectorMonsterCredits = self.sceneDirectorMonsterCredits, BonusCreditObjects = new Dictionary <GameObject, int>() }; foreach (var bonusObj in self.bonusInteractibleCreditObjects) { set.BonusCreditObjects[bonusObj.objectThatGrantsPointsIfEnabled] = bonusObj.points; } set.InteractableCategoryWeights = new Dictionary <InteractableCategory, float>(); var interCats = self.GetFieldValue <DirectorCardCategorySelection>("interactableCategories"); foreach (var cat in interCats.categories) { set.InteractableCategoryWeights[GetInteractableCategory(cat.name)] = cat.selectionWeight; } set.MonsterCategoryWeights = new Dictionary <MonsterCategory, float>(); var monstCats = self.GetFieldValue <DirectorCardCategorySelection>("monsterCategories"); foreach (var cat in monstCats.categories) { set.MonsterCategoryWeights[GetMonsterCategory(cat.name)] = cat.selectionWeight; } return(set); }
private static void SetStageSettings(ClassicStageInfo self, StageSettings set) { self.sceneDirectorInteractibleCredits = set.SceneDirectorInteractableCredits; self.sceneDirectorMonsterCredits = set.SceneDirectorMonsterCredits; var keys = set.BonusCreditObjects.Keys.ToArray(); var bonuses = new ClassicStageInfo.BonusInteractibleCreditObject[keys.Length]; for (int i = 0; i < keys.Length; i++) { bonuses[i] = new ClassicStageInfo.BonusInteractibleCreditObject { objectThatGrantsPointsIfEnabled = keys[i], points = set.BonusCreditObjects[keys[i]] }; } self.bonusInteractibleCreditObjects = bonuses; var interCats = self.GetFieldValue <DirectorCardCategorySelection>("interactableCategories"); for (int i = 0; i < interCats.categories.Length; i++) { var cat = interCats.categories[i]; InteractableCategory intCat = GetInteractableCategory(cat.name); cat.selectionWeight = set.InteractableCategoryWeights[intCat]; interCats.categories[i] = cat; } var monstCats = self.GetFieldValue <DirectorCardCategorySelection>("monsterCategories"); for (int i = 0; i < monstCats.categories.Length; i++) { var cat = monstCats.categories[i]; MonsterCategory monCat = GetMonsterCategory(cat.name); cat.selectionWeight = set.MonsterCategoryWeights[monCat]; monstCats.categories[i] = cat; } }
private static StageSettings GetStageSettings(ClassicStageInfo self) { StageSettings set = new StageSettings { sceneDirectorInteractableCredits = self.sceneDirectorInteractibleCredits, sceneDirectorMonsterCredits = self.sceneDirectorMonsterCredits }; set.bonusCreditObjects = new Dictionary <GameObject, int>(); for (int i = 0; i < self.bonusInteractibleCreditObjects.Length; i++) { var bonusObj = self.bonusInteractibleCreditObjects[i]; set.bonusCreditObjects[bonusObj.objectThatGrantsPointsIfEnabled] = bonusObj.points; } set.interactableCategoryWeights = new Dictionary <InteractableCategory, float>(); var interCats = self.GetFieldValue <DirectorCardCategorySelection>("interactableCategories"); for (int i = 0; i < interCats.categories.Length; i++) { var cat = interCats.categories[i]; set.interactableCategoryWeights[GetInteractableCategory(cat.name)] = cat.selectionWeight; } set.monsterCategoryWeights = new Dictionary <MonsterCategory, float>(); var monstCats = self.GetFieldValue <DirectorCardCategorySelection>("monsterCategories"); for (int i = 0; i < monstCats.categories.Length; i++) { var cat = monstCats.categories[i]; set.monsterCategoryWeights[GetMonsterCategory(cat.name)] = cat.selectionWeight; } return(set); }
private static void ApplyMonsterChanges(ClassicStageInfo self, StageInfo stage) { var monsters = self.GetFieldValue <DirectorCardCategorySelection>("monsterCategories"); var monsterCards = new List <DirectorCardHolder>(); foreach (var cat in monsters.categories) { MonsterCategory monstCat = GetMonsterCategory(cat.name); InteractableCategory interCat = GetInteractableCategory(cat.name); foreach (var t in cat.cards) { monsterCards.Add(new DirectorCardHolder { InteractableCategory = interCat, MonsterCategory = monstCat, Card = t }); } } MonsterActions?.Invoke(monsterCards, stage); var monsterBasic = new List <DirectorCard>(); var monsterSub = new List <DirectorCard>(); var monsterChamp = new List <DirectorCard>(); foreach (var hold in monsterCards) { switch (hold.MonsterCategory) { case MonsterCategory.BasicMonsters: monsterBasic.Add(hold.Card); break; case MonsterCategory.Champions: monsterChamp.Add(hold.Card); break; case MonsterCategory.Minibosses: monsterSub.Add(hold.Card); break; } } for (int i = 0; i < monsters.categories.Length; i++) { DirectorCardCategorySelection.Category cat = monsters.categories[i]; switch (cat.name) { case "Champions": cat.cards = monsterChamp.ToArray(); break; case "Minibosses": cat.cards = monsterSub.ToArray(); break; case "Basic Monsters": cat.cards = monsterBasic.ToArray(); break; } monsters.categories[i] = cat; } }
private static void ApplyInteractableChanges(ClassicStageInfo self, StageInfo stage) { var interactables = self.GetFieldValue <DirectorCardCategorySelection>("interactableCategories"); var interactableCards = new List <DirectorCardHolder>(); foreach (var cat in interactables.categories) { MonsterCategory monstCat = GetMonsterCategory(cat.name); InteractableCategory interCat = GetInteractableCategory(cat.name); foreach (var t in cat.cards) { interactableCards.Add(new DirectorCardHolder { InteractableCategory = interCat, MonsterCategory = monstCat, Card = t }); } } InteractableActions?.Invoke(interactableCards, stage); var interChests = new List <DirectorCard>(); var interBarrels = new List <DirectorCard>(); var interShrines = new List <DirectorCard>(); var interDrones = new List <DirectorCard>(); var interMisc = new List <DirectorCard>(); var interRare = new List <DirectorCard>(); var interDupe = new List <DirectorCard>(); foreach (var hold in interactableCards) { switch (hold.InteractableCategory) { case InteractableCategory.None: R2API.Logger.LogWarning("InteractableCategory from DirectorCardHolder is None !"); break; case InteractableCategory.Chests: interChests.Add(hold.Card); break; case InteractableCategory.Barrels: interBarrels.Add(hold.Card); break; case InteractableCategory.Drones: interDrones.Add(hold.Card); break; case InteractableCategory.Duplicator: interDupe.Add(hold.Card); break; case InteractableCategory.Misc: interMisc.Add(hold.Card); break; case InteractableCategory.Rare: interRare.Add(hold.Card); break; case InteractableCategory.Shrines: interShrines.Add(hold.Card); break; } } for (int i = 0; i < interactables.categories.Length; i++) { DirectorCardCategorySelection.Category cat = interactables.categories[i]; switch (cat.name) { case "Chests": cat.cards = interChests.ToArray(); break; case "Barrels": cat.cards = interBarrels.ToArray(); break; case "Shrines": cat.cards = interShrines.ToArray(); break; case "Drones": cat.cards = interDrones.ToArray(); break; case "Misc": cat.cards = interMisc.ToArray(); break; case "Rare": cat.cards = interRare.ToArray(); break; case "Duplicator": cat.cards = interDupe.ToArray(); break; } interactables.categories[i] = cat; } }
private static void ApplyInteractableChanges(ClassicStageInfo self, StageInfo stage) { var interactables = self.GetFieldValue <DirectorCardCategorySelection>("interactableCategories"); List <DirectorCardHolder> interactableCards = new List <DirectorCardHolder>(); for (int i = 0; i < interactables.categories.Length; i++) { DirectorCardCategorySelection.Category cat = interactables.categories[i]; MonsterCategory monstCat = GetMonsterCategory(cat.name); InteractableCategory interCat = GetInteractableCategory(cat.name); for (int j = 0; j < cat.cards.Length; j++) { interactableCards.Add(new DirectorCardHolder { interactableCategory = interCat, monsterCategory = monstCat, card = cat.cards[j] }); } } interactableActions?.Invoke(interactableCards, stage); DirectorCard[] interChests = new DirectorCard[0]; DirectorCard[] interBarrels = new DirectorCard[0]; DirectorCard[] interShrines = new DirectorCard[0]; DirectorCard[] interDrones = new DirectorCard[0]; DirectorCard[] interMisc = new DirectorCard[0]; DirectorCard[] interRare = new DirectorCard[0]; DirectorCard[] interDupe = new DirectorCard[0]; for (int i = 0; i < interactableCards.Count; i++) { DirectorCardHolder hold = interactableCards[i]; switch (hold.interactableCategory) { default: Debug.Log("Wtf are you doing..."); break; case InteractableCategory.Chests: AddToArray <DirectorCard>(ref interChests, hold.card); break; case InteractableCategory.Barrels: AddToArray <DirectorCard>(ref interBarrels, hold.card); break; case InteractableCategory.Drones: AddToArray <DirectorCard>(ref interDrones, hold.card); break; case InteractableCategory.Duplicator: AddToArray <DirectorCard>(ref interDupe, hold.card); break; case InteractableCategory.Misc: AddToArray <DirectorCard>(ref interMisc, hold.card); break; case InteractableCategory.Rare: AddToArray <DirectorCard>(ref interRare, hold.card); break; case InteractableCategory.Shrines: AddToArray <DirectorCard>(ref interShrines, hold.card); break; } } for (int i = 0; i < interactables.categories.Length; i++) { DirectorCardCategorySelection.Category cat = interactables.categories[i]; switch (cat.name) { default: Debug.Log(cat.name); break; case "Chests": cat.cards = interChests; break; case "Barrels": cat.cards = interBarrels; break; case "Shrines": cat.cards = interShrines; break; case "Drones": cat.cards = interDrones; break; case "Misc": cat.cards = interMisc; break; case "Rare": cat.cards = interRare; break; case "Duplicator": cat.cards = interDupe; break; } interactables.categories[i] = cat; } }
private static void ApplyMonsterChanges(ClassicStageInfo self, StageInfo stage) { var monsters = self.GetFieldValue <DirectorCardCategorySelection>("monsterCategories"); List <DirectorCardHolder> monsterCards = new List <DirectorCardHolder>(); for (int i = 0; i < monsters.categories.Length; i++) { DirectorCardCategorySelection.Category cat = monsters.categories[i]; MonsterCategory monstCat = GetMonsterCategory(cat.name); InteractableCategory interCat = GetInteractableCategory(cat.name); for (int j = 0; j < cat.cards.Length; j++) { monsterCards.Add(new DirectorCardHolder { interactableCategory = interCat, monsterCategory = monstCat, card = cat.cards[j] }); } } monsterActions?.Invoke(monsterCards, stage); DirectorCard[] monsterBasic = new DirectorCard[0]; DirectorCard[] monsterSub = new DirectorCard[0]; DirectorCard[] monsterChamp = new DirectorCard[0]; for (int i = 0; i < monsterCards.Count; i++) { DirectorCardHolder hold = monsterCards[i]; switch (hold.monsterCategory) { default: Debug.Log("Wtf are you doing..."); break; case MonsterCategory.BasicMonsters: AddToArray <DirectorCard>(ref monsterBasic, hold.card); break; case MonsterCategory.Champions: AddToArray <DirectorCard>(ref monsterChamp, hold.card); break; case MonsterCategory.Minibosses: AddToArray <DirectorCard>(ref monsterSub, hold.card); break; } } for (int i = 0; i < monsters.categories.Length; i++) { DirectorCardCategorySelection.Category cat = monsters.categories[i]; switch (cat.name) { default: Debug.Log(cat.name); break; case "Champions": cat.cards = monsterChamp; break; case "Minibosses": cat.cards = monsterSub; break; case "Basic Monsters": cat.cards = monsterBasic; break; } monsters.categories[i] = cat; } }