one-shot-calculator 1.0.1
A package to calculate the probability of one-shotting monsters in Dungeons and Dragons
Requires Python: >=3.9

# One-Shot Calculator

There's a saying in some RPGs: the best debuff for your enemies is *dead*.

In some editions of Dungeons and Dragons, it is possible to make a character that does vastly more damage than you will ever need. Once you can reliably one-shot the kinds of monsters you're likely to face, you can focus the rest of your character's resources on doing other things, like not dying.

Thus, `one_shot_calculator`. This is Python package to calculate your chances of one-shotting monsters you might encounter. It can print out a histogram of your chances for one-shotting monsters, and has various other functions you can use to calculate various other useful things.

## Install

If you aren't used to using Python, the easiest way to use `one_shot_calculator` is to start from one of the notebooks I've set up on Google Colab. [This one is for D&D 3.5](https://colab.research.google.com/drive/1GXeVRbqqMoXvhVPXW5jzYOzyvlJK5JoM?usp=sharing) and [this one is for AD&D 2e](https://colab.research.google.com/drive/1AYvlqgqFBmdVGfqSTjcf5IXrPGMnhIXh?usp=sharing). Just open up the notebook, try out the examples, then try modifying the code to do what you want to do.

If you are familiar with Python, you can instead install with:

```
pip install one-shot-calculator
```

## Usage

The package contains four modules and two CSV files full of monsters.

`Monster Compendium (Graphless).csv` is derived from [an Excel sheet created by Giant in the Playground Forum user ezkajii](https://forums.giantitp.com/showthread.php?402179). It contains nearly all monsters published by Wizards of the Coast for D&D 3.0 and D&D 3.5.

`SBLaxman's AD&D Monster List 2.1.csv` is derived from [an Excel sheet created by Dragonsfood Forum user SBLaxman](https://www.dragonsfoot.org/forums/viewtopic.php?t=51196). It contains nearly all monsters published by TSR for AD&D 1e and 2e.

`process_csv.py` contains functions for processing the CSV files so they can be used in the other modules. For AD&D, this includes filtering the list of monsters to only include those which this package is currently able to handle.

`discrete_dists.py` contains general functions for manipulating discrete probability distributions with integer outcomes.

`one_shot_calculator_3p5.py` contains functions for manipulating probability distributions that describe your chance of one-shotting opponents in D&D 3.5. This includes distributions for damage dealt by attacks and for saving throws. You build a one-shot function using one of the functions that end in `_one_shot_function`, then use the function `one_shot_histogram` to make a histogram of your chance of one-shotting opponents within a given CR range.

`one_shot_calculator_adnd.py` contains functions for manipulating probability distributions that describe your chance of one-shotting opponents in AD&D 2e. This includes distributions for damage dealt by attacks and for saving throws. You build a one-shot function using one of the functions that end in `_one_shot_function`, then use the function `one_shot_histogram_XP` to make a histogram of your chance of one-shotting opponents that give XP within a given range. You can also use the function `monster_lookup` to check if a particular monster is included, and `one_monster_table` to get results for that particular monster.

## Future Extensions

That's up to you! Here are some things I could do if people are interested:

- More user-friendliness: I could set this up so you can do some rudimentary things without programming, possibly with some sort of web interface.

- More editions: I could do this for more editions of D&D, Pathfinder, or some other appropriate RPG. In order to do that I need a CSV full of monsters for that edition.

- More coverage: Currently the AD&D version of this package leaves out many monsters and makes a few simplifying assumptions. Future versions will improve this.

- More examples: I'd love to include a super-high-optimization build in D&D 3.5 in the examples in the Colab notebook. If someone can walk me through a standard opener for the Mailman or Cindy or the like I can add that as an example.

- More sensitivity: In order for the one-shot histograms to be fully accurate they need to take into account immunities. I could add some code to process_csv to add columns for common types of immunities so you can condition on them in your one-shot distributions.

- More versatility: If you're skeptical about one-shotting things, there is a more "normal" concept, average damage per round (DPR). It would be easy to add a DPR calculator. I could also give you an overall one-shot percentage with a given encounter table, or even try to make a setup to answer more complicated questions like whether you can kill a monster before it kills you.

- More fun stuff: Want code for specific spells? Anarchic Initiate Chaotic Surges? Other specialized things?


## Acknowledgements

This project would not be possible without ezkajii's laboriously compiled [Monster Compendium](https://forums.giantitp.com/showthread.php?402179) and SBLaxman's similarly laboriously compiled [Monster List](https://www.dragonsfoot.org/forums/viewtopic.php?t=51196).