Lethal Company
Install

Details

Last Updated
First Uploaded
Downloads
3.6K
Likes
0
Size
39KB
Dependency string
DreWulff-ConfigHelper-1.0.0
Dependants

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's BaseUnityPlugin have a base definition of Config. This can be passed with base.Config.
  • 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 out parameters correspond to the required rarity parameters for LethalLib's Enemies.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

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.