DEV Community

Rachel Soderberg
Rachel Soderberg

Posted on

Hp Calculator 5e Dungeons & Dragons Max Hit Points Calculator

This week I wanted to do something different and share a fun little side project I put together! A bit of backstory: I've recently begun playing Dungeons and Dragons with some friends and think it's awesome, and going through the trouble of learning how to determine my character's HP at each level was some combination of humorous and frustrating. When I figured out the math, I decided to really solidify the concept and save future me some time in the process... and so the D&D Max Hit Points Calculator was born!

I built the Calculator as a Windows Form Application and it is quite simple and easy to use (and would be a fun learning project for anyone getting into C#). Simply enter your character's current max HP (or 0 if it's a new level 1 character) into "Current Max HP", put your Constitution modifier value into "Const Modifier", and click Roll after selecting the hit die your class was designated to generate your rolled die value. Click Calculate Max Hit Points and voila - the math's been done for you! The "Current Max HP" value will even update, making rolling for multiple levels a snap.

Max Hit Points Calculator

Here's a link to the source code: D&D Max Hit Points Calculator. You are welcome to use this project for whatever you'd like (except selling or distributing it, obviously). Feel free to learn with it, copy and tweak it, use it for your own D&D games, or even comment/email me with suggestions (r_soderberg@yahoo.com).


If you'd like to catch up with me on social media, come find me over on Twitter or LinkedIn and say hello!

Top comments (3)

Collapse
 
raddevus profile image
raddevus • Edited

I took a look at your code. It's a nice little utility.
A couple of things just to let you know. I tried to build the code but the repo is missing a few items:

  1. the Program.cs file which actually launches the app.
  2. the /Properties folder and all of its contents (5 files -assembly.info, Resources.resx,Resources.Designer.cs , Settings.settings, Settings.Designer.cs)

I built it and got it going by

  1. building the Program.cs from scratch
  2. copying the \Properties files from another project.

Also, normally you don't check in the binaries (stuff under \bin) to source control. But maybe you did that so people could try the program out easily.

Just some tips to help out.

Have a great day and...

Keep on learning, keep on coding

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

Hey, thanks for the info and tips! This was my first time posting a project as "open source" so I'm not surprised there were a couple hiccups. I'll go ahead and fix that up later today.

Collapse
 
raddevus profile image
raddevus

Glad to help. Also, if you add a .gitignore file to your project root folder you will find that the extra things like /obj/ and /bin directories and associated files are not added -- it'll only track your source files which is what you want.
Github provides a nice Visual Studio / C# .gitignore for you at:
github.com/github/gitignore/blob/m...

All you have to do is :

  1. create a text file named .gitignore in your project root
  2. copy the text from the link above
  3. paste test into your local .gitignore
  4. save

After that, your local git will ignore those files. Since you've already added them you may have to work a bit to remove them from your git repo, but it'll still help. :)