Skip to main content

A package to calculate the probability of one-shotting monsters in Dungeons and Dragons

Project description

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 and this one is for AD&D 2e. 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. 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. 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 and SBLaxman's similarly laboriously compiled Monster List.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

one_shot_calculator-1.0.1.tar.gz (677.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

one_shot_calculator-1.0.1-py3-none-any.whl (686.1 kB view details)

Uploaded Python 3

File details

Details for the file one_shot_calculator-1.0.1.tar.gz.

File metadata

  • Download URL: one_shot_calculator-1.0.1.tar.gz
  • Upload date:
  • Size: 677.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for one_shot_calculator-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8ab4540333c32bceb0347f59c21a541f44dbf37e7ae5b79463a2aaef28322dbf
MD5 1ae47a5069ca4f56c734533372439efa
BLAKE2b-256 13278729e780a20e775b616c6392abe11e7ff0fa53414788ef3e533f48ae3f2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for one_shot_calculator-1.0.1.tar.gz:

Publisher: python-publish.yml on matt-vonhippel/one-shot-calculator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file one_shot_calculator-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for one_shot_calculator-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 45b795177cfcb8e293e75328a25b12e06ca8bec7da918637b98881b276963c35
MD5 e988aa35b9c7f5bc79e40fbdf7c1c51d
BLAKE2b-256 182e735b5ae89ded830d88a43fe97bab12162f0cbdcd45f1065b031ab8d7da3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for one_shot_calculator-1.0.1-py3-none-any.whl:

Publisher: python-publish.yml on matt-vonhippel/one-shot-calculator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page