Generates a random, equipped character for Dungeons and Dragons 3.X
To use CharacterGen, simply use the CharacterGenerator. Pass in the randomizers that you wish to use. If you wish to generate leadership and followers for a character, use the Generate methods on the LeadershipGenerator.
var character = characterGenerator.GenerateWith(anyAlignmentRandomizer, anyPlayerClassNameRandomizer, anyLevelRandomizer, anyBaseRaceRandomizzer, anyMetaraceRandomizer, rawStatsRandomizer);
var leadership = leadershipGenerator.GenerateLeadership(6, 3, "Pseudodragon");
var cohort = leadershipGenerator.GenerateCohort(leadership.CohortScore, character.Class.Level, character.Alignment.Full, character.Class.ClassName);
var follower = leadershipGenerator.GenerateFollower(1, character.Alignment.Full, character.Class.ClassName);
You can obtain generators via the Ninject module. Because the generators are very complex and are decorated in various ways, there is not a (recommended) way to build these generator manually. Note: This will also load the dependencies for CharacterGen, including TreasureGen, RollGen, and Infrastructure
var kernel = new StandardKernel();
characterGenModuleLoader.LoadModules(kernel);
Your particular syntax for how the Ninject injection should work will depend on your project (class library, web site, etc.)
If you want a set randomizer, inject and instance of of the set randomizer interface (such as ISetClassNameRandomizer
). If you want a general randomizer, inject a named instance of the randomizer
kernel.Get<RaceRandomizer>(RaceRandomizerTypeConstants.BaseRace.StandardBase);
The project is on Nuget. Install via the NuGet Package Manager.
PM > Install-Package CharacterGen