コード例 #1
0
        private static void BuildDirectorCard()
        {
            archWispCharacterSpawnCard = Resources.Load <CharacterSpawnCard>("spawncards/characterspawncards/cscarchwisp");

            archWispDirectorCardHolder = new DirectorAPI.DirectorCardHolder();
            archWispCharacterSpawnCard.directorCreditCost = 250;
            archWispCharacterSpawnCard.forbiddenAsBoss    = true;

            archWispDirectorCard = new DirectorCard
            {
                allowAmbushSpawn        = true,
                forbiddenUnlockable     = "",
                minimumStageCompletions = 4,
                preventOverhead         = false,
                requiredUnlockable      = "",
                selectionWeight         = 1,
                spawnCard     = archWispCharacterSpawnCard,
                spawnDistance = DirectorCore.MonsterSpawnDistance.Standard,
            };

            archWispDirectorCardHolder.Card = archWispDirectorCard;
            archWispDirectorCardHolder.InteractableCategory = InteractableCategory.None;
            archWispDirectorCardHolder.MonsterCategory      = DirectorAPI.MonsterCategory.Minibosses;

            MonsterActions += delegate(List <DirectorCardHolder> list, DirectorAPI.StageInfo stage)
            {
                if (!list.Contains(archWispDirectorCardHolder))
                {
                    list.Add(archWispDirectorCardHolder);
                }
            };
        }
コード例 #2
0
            /// <summary>
            /// Adds a new interactable to all stages.
            /// </summary>
            /// <param name="interactableCard">The DirectorCard for the interactable</param>
            /// <param name="category">The category of the interactable</param>
            public static void AddNewInteractable(DirectorCard interactableCard, InteractableCategory category)
            {
                DirectorCardHolder card = new DirectorCardHolder
                {
                    Card = interactableCard,
                    InteractableCategory = category,
                    MonsterCategory      = MonsterCategory.None
                };

                InteractableActions += (interactables, currentStage) => {
                    interactables.Add(card);
                };
            }
コード例 #3
0
            /// <summary>
            /// Adds a new monster to all stages.
            /// </summary>
            /// <param name="monsterCard">The DirectorCard for the monster</param>
            /// <param name="category">The category to add the monster to</param>
            public static void AddNewMonster(DirectorCard monsterCard, MonsterCategory category)
            {
                DirectorCardHolder card = new DirectorCardHolder
                {
                    Card = monsterCard,
                    InteractableCategory = InteractableCategory.None,
                    MonsterCategory      = category
                };

                MonsterActions += (monsters, currentStage) => {
                    monsters.Add(card);
                };
            }
コード例 #4
0
            /// <summary>
            /// Adds a new interactable to all stages.
            /// </summary>
            /// <param name="interactableCard">The DirectorCard for the interactable</param>
            /// <param name="category">The category of the interactable</param>
            public static void AddNewInteractable(DirectorCard?interactableCard, InteractableCategory category)
            {
                if (!Loaded)
                {
                    throw new InvalidOperationException($"{nameof(DirectorAPI)} is not loaded. Please use [{nameof(R2APISubmoduleDependency)}(nameof({nameof(DirectorAPI)})]");
                }
                DirectorCardHolder card = new DirectorCardHolder {
                    Card = interactableCard,
                    InteractableCategory = category,
                    MonsterCategory      = MonsterCategory.None
                };

                InteractableActions += (interactables, currentStage) => {
                    interactables.Add(card);
                };
            }
コード例 #5
0
            /// <summary>
            /// Adds a new interactable to a specific stage.
            /// For custom stages use Stage.Custom and enter the name of the stage in customStageName.
            /// </summary>
            /// <param name="interactableCard">The DirectorCard of the interactable</param>
            /// <param name="category">The category of the interactable</param>
            /// <param name="stage">The stage to add the interactable to</param>
            /// <param name="customStageName">The name of the custom stage</param>
            public static void AddNewInteractableToStage(DirectorCard interactableCard, InteractableCategory category, Stage stage, string customStageName = "")
            {
                DirectorCardHolder card = new DirectorCardHolder
                {
                    Card = interactableCard,
                    InteractableCategory = category,
                    MonsterCategory      = MonsterCategory.None
                };

                InteractableActions += (interactables, currentStage) => {
                    if (currentStage.stage == stage)
                    {
                        if (currentStage.CheckStage(stage, customStageName))
                        {
                            interactables.Add(card);
                        }
                    }
                };
            }
コード例 #6
0
            /// <summary>
            /// Adds a new monster to a specific stage.
            /// For custom stages use Stage.Custom and enter the name of the stage in customStageName.
            /// </summary>
            /// <param name="monsterCard">The DirectorCard of the monster to add</param>
            /// <param name="category">The category to add the monster to</param>
            /// <param name="stage">The stage to add the monster to</param>
            /// <param name="customStageName">The name of the custom stage</param>
            public static void AddNewMonsterToStage(DirectorCard monsterCard, MonsterCategory category, Stage stage, string customStageName = "")
            {
                DirectorCardHolder card = new DirectorCardHolder
                {
                    Card = monsterCard,
                    InteractableCategory = InteractableCategory.None,
                    MonsterCategory      = category
                };

                MonsterActions += (monsters, currentStage) => {
                    if (currentStage.stage == stage)
                    {
                        if (currentStage.CheckStage(stage, customStageName))
                        {
                            monsters.Add(card);
                        }
                    }
                };
            }
コード例 #7
0
            /// <summary>
            /// Adds a new monster to a specific stage.
            /// For custom stages use Stage.Custom and enter the name of the stage in customStageName.
            /// </summary>
            /// <param name="monsterCard">The DirectorCard of the monster to add</param>
            /// <param name="category">The category to add the monster to</param>
            /// <param name="stage">The stage to add the monster to</param>
            /// <param name="customStageName">The name of the custom stage</param>
            public static void AddNewMonsterToStage(DirectorCard?monsterCard, MonsterCategory category, Stage stage, string?customStageName = "")
            {
                if (!Loaded)
                {
                    throw new InvalidOperationException($"{nameof(DirectorAPI)} is not loaded. Please use [{nameof(R2APISubmoduleDependency)}(nameof({nameof(DirectorAPI)})]");
                }
                DirectorCardHolder card = new DirectorCardHolder {
                    Card = monsterCard,
                    InteractableCategory = InteractableCategory.None,
                    MonsterCategory      = category
                };

                MonsterActions += (monsters, currentStage) => {
                    if (currentStage.stage == stage)
                    {
                        if (currentStage.CheckStage(stage, customStageName))
                        {
                            monsters.Add(card);
                        }
                    }
                };
            }
コード例 #8
0
        private void InitializeDirectorCards()
        {
            DirectorCard directorCard = new DirectorCard
            {
                spawnCard = iSpawnCard,
#if DEBUG
                selectionWeight = 1000,
#else
                selectionWeight = spawnWeight,
#endif
                spawnDistance    = DirectorCore.MonsterSpawnDistance.Close,
                allowAmbushSpawn = true,
                preventOverhead  = false
            };

            iDirectorCardHolder = new DirectorCardHolder
            {
                Card                 = directorCard,
                MonsterCategory      = MonsterCategory.None,
                InteractableCategory = InteractableCategory.Drones,
            };
        }
コード例 #9
0
        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;
            }
        }
コード例 #10
0
        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;
            }
        }