ConfigHelper
Helper library with methods to standardize monster spawn configurations between my projects.Configuration Helper
Small helper library to standardize the configuration of enemy/entity spawning.
Namespace is currently generic in case I add new configurations for other mods.
Functions
Entities (Enemies)
Spawning
The main function to generate the spawning configuration and retrieve the value for enemy registering is the following:
public static void GetRarities(
ConfigFile cfg,
Dictionary<string, int> defaultWeights,
out Dictionary<LevelTypes, int> vanillaRarities,
out Dictionary<string, int> customRarities)
Parameters:
ConfigFile cfg:- Plugins that extend
BepInEx'sBaseUnityPluginhave a base definition ofConfig. This can be passed withbase.Config.
- Plugins that extend
Dictionary<string, int> defaultWeights:- Contains the key/value pair of moons and spawn weights.
// Example: defaultWeights: new Dictionary<string, int> { {"Vow", 20}, {"Halation", 10}, {"Junic", 15}, },- The
outparameters correspond to the required rarity parameters forLethalLib'sEnemies.RegisterEnemy()function.
Reminder
LethalLib's configurations use the .Bind() method from the ConfigFile class.
For configurations not supported by this library (practically all), follow the example:
public ConfigEntry<int> damage;
public PluginConfig(ConfigFile cfg)
{
damage = cfg.Bind(
"Behaviour", // Section
"Barb Damage", // Title
20, // Default value
"Damage dealt" // Description
);
}
For a more in-depth example I recommend checking @Hamunii 's Example Enemy
Credits
- DreWulff (me!): Coding.
- Source code: LC-ConfigHelper on github
- Originally based off of the Configuration code from @Hamunii.
- Thanks to @Evaisa for LethalLib.
