コード例 #1
0
        private static void AddBCEntry(EntryType entryType, Mod mod, float progression, string bcName,
                                       Func <bool> downedCondition, BCIDData identificationData, string spawnInfo,
                                       string despawnMessage, string texture, string overrideHeadIconTexture,
                                       Func <bool> bossAvailable)
        {
            string addType;

            switch (entryType)
            {
            case EntryType.Boss:
                addType = "AddBoss";
                break;

            case EntryType.Miniboss:
                addType = "AddMiniBoss";
                break;

            case EntryType.Event:
                addType = "AddEvent";
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(entryType), entryType, null);
            }

            BossChecklistMod.Call(
                addType,
                progression,
                identificationData.npcIDs ?? new List <int>(),
                mod,
                bcName,
                downedCondition,
                identificationData.itemSpawnIDs ?? new List <int>(),
                identificationData.itemCollectionIDs ?? new List <int>(),
                identificationData.itemLootIDs ?? new List <int>(),
                spawnInfo.IsNullOrEmptyFallback("Mods.BossChecklist.BossLog.DrawnText.NoInfo"),
                despawnMessage.IsNullOrEmptyFallback(entryType == EntryType.Boss
                                        ? "Mods.BossChecklist.BossVictory.Generic"
                                        : ""),
                texture.IsNullOrEmptyFallback("BossChecklist/Resources/BossTextures/BossPlaceholder_byCorrina"),
                overrideHeadIconTexture,
                bossAvailable ?? (() => true)
                );
        }
コード例 #2
0
        private static void RegisterInterfaces(Mod spiritMod)
        {
            foreach (Type type in spiritMod.Code.GetTypes().Where(x => x.GetInterfaces().Contains(typeof(IBCRegistrable))))
            {
                BCIDData    identificationData  = new BCIDData(null, null, null, null);
                string      spawnInfo           = "";
                string      despawnMessage      = "";
                string      texture             = "";
                string      headTextureOverride = "";
                Func <bool> isAvailable         = null;

                if (!(Activator.CreateInstance(type) is IBCRegistrable registrableType))
                {
                    continue;
                }

                registrableType.RegisterToChecklist(out EntryType entryType, out float progression, out string name,
                                                    out Func <bool> downedCondition, ref identificationData, ref spawnInfo, ref despawnMessage,
                                                    ref texture, ref headTextureOverride, ref isAvailable);

                AddBCEntry(entryType, spiritMod, progression, name, downedCondition, identificationData, spawnInfo, despawnMessage, texture, headTextureOverride, isAvailable);
            }
        }
コード例 #3
0
 public static void AddEvent(this Mod mod, float progression, string eventName, Func <bool> downedCondition,
                             BCIDData identificationData, string spawnInfo, string despawnMessage, string texture,
                             string overrideHeadIconTexture,
                             Func <bool> eventAvailable) =>
 AddBCEntry(EntryType.Event, mod, progression, eventName, downedCondition, identificationData, spawnInfo,
            despawnMessage, texture, overrideHeadIconTexture, eventAvailable);
コード例 #4
0
 public static void AddMiniBoss(this Mod mod, float progression, string npcName, Func <bool> downedCondition,
                                BCIDData identificationData, string spawnInfo, string despawnMessage, string texture,
                                string overrideHeadIconTexture, Func <bool> bossAvailable) =>
 AddBCEntry(EntryType.Miniboss, mod, progression, npcName, downedCondition, identificationData, spawnInfo,
            despawnMessage, texture, overrideHeadIconTexture, bossAvailable);