protected override Config InstantiateSubsection(string subsectionName)
        {
            Config newModConfig = null;

            if (subsectionName == CharacterDropModConfigCLLC.ModName)
            {
                newModConfig = new CharacterDropModConfigCLLC();
            }
            else if (subsectionName == CharacterDropModConfigEpicLoot.ModName)
            {
                newModConfig = new CharacterDropModConfigEpicLoot();
            }
            else if (subsectionName == CharacterDropModConfigSpawnThat.ModName)
            {
                newModConfig = new CharacterDropModConfigSpawnThat();
            }

            return(newModConfig);
        }
Beispiel #2
0
        public static bool ValidConditionNotInfusion(CharacterDrop.Drop drop, CharacterDropModConfigCLLC config, Character character)
        {
            if (config.ConditionNotInfusion.Value.Length > 0)
            {
                var states = config.ConditionNotInfusion.Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                if ((states?.Length ?? 0) == 0)
                {
#if DEBUG
                    Log.LogDebug("No conditions for CLLC infusions were found.");
#endif
                    //Skip if we have no states to check. This indicates all are allowed.
                    return(true);
                }

                if (states.Any(x => HasState(character, x)))
                {
                    Log.LogTrace($"{nameof(config.ConditionNotInfusion)}: Disabling drop {drop.m_prefab.name} due finding one of the disabled infusions '{config.ConditionNotInfusion.Value}'.");
                    return(false);
                }
            }

            return(true);
        }