DEV Community

Cover image for DnD 5e Character Creator
Abbey
Abbey

Posted on

DnD 5e Character Creator

This is my first functionally complete program I've ever written! Although there are a lot more functions and a lot more content I'd like to add in later versions, this version is completely usable.

The bulk of the code is in three sections: race selection, class selection, and stat generation. The stat generator creates random numbers which the user then assigns to attributes as they choose. The race and class selections each have unique code blocks, most of which prompt the user for further choices. Additionally, the program records a dictionary of all character features (and their descriptions), a list of proficiencies and languages, and a collection of stats that are dependent on the 6 basic generated attributes (armor class, initiative, etc.)

At the end, the program generates a readable character sheet containing all of the information selected, recorded, and generated above.

Try it out for yourself if you like.

I'd like to clean up the code a little bit, create more functions to shorten the repetitive code segments. Then I want to add in the rest of the races and classes available in the Player's Handbook, as well as subclasses and equipment. I'd also like to include data for spellcasters - spell save DC, spell attack modifiers, spell lists, spell slots, cantrips, etc. Eventually if I want to keep working on the project, I'd like to add in classes and races available in supplementary materials, and allow the user to save their character sheet in a text file and later update the sheet when they level up.

Top comments (0)