A reimplementation of the damage calculation in Pokémon Mystery Dungeon: Explorers of Sky. The goal is to closely reproduce the way the original game's damage calculation code works.
This calculator is available as an interactive web application. It can also be compiled as a command-line application and as a static library. If you just want to look at how the code works, the main damage calculation routines are in src/damage.cpp
.
Note that some things have not yet been implemented. See the Not Yet Implemented section.
First, clone the repository recursively:
git clone --recursive https://github.com/usernamefodder/damage-eos.git
If you already cloned the project but forgot to do it recursively, you can instead run:
git submodule update --init
To build, you'll need to install CMake. Assuming cmake
is available, navigate to the top-level project directory and run:
# If on Windows, use the equivalents to `mkdir` and `cd`
# in your environment, or build with Visual Studio
mkdir build && cd build
cmake ..
cmake --build . --target damagecalc
Once finished, this should place the damagecalc
command-line utility and the libdamage.a
static library in build/src
.
You shouldn't need to build this for WebAssembly; it's done automatically and deployed to a GitHub Pages site for easy use. However, if you do want to build to Wasm for some reason, just run build-wasm.sh
on a Unix system.
(Have you considered using the web application?)
To use damagecalc
, pass it the path to a JSON configuration file. For more information on output, you can also optionally pass the verbose flag up to three times. For example:
damagecalc -i <path/to/config/file> -vvv
For an example config file, see sample-config.json
.
Where relevant, the config file works with names rather than internal IDs. For example, "bulbasaur"
rather than its ID of 1. All names are case-insensitive, and some IDs (statuses and exclusive item effects) can even be specified by multiple names. You can see most of the allowable names for moves, species, items, etc. in idmap.cpp
. Note that with moves and status conditions, not every listed possibility is actually suppported by the damage calculator. There are also a few special names for certain fields:
"guts/marvel scale"
status to indicate any status that would activate Guts or Marvel Scale."stick"
, "iron thorn"
, "silver spike"
, "gold fang"
, "cacnea spike"
, "corsola twig"
, "gold thorn"
.The following properties can optionally be specified within the attacker and defender objects: "type1"
, "type2"
, "ability1"
, "ability2"
. If present, these values will override the normal values determined based on the "species"
field.