#calculator #damage #spell #utility #dofus

bin+lib dofus-dmg-calculator

A binary crate to estimate Dofus spells' output damage

23 stable releases

Uses new Rust 2024

new 1.1.7 Apr 16, 2025
1.1.6 Apr 9, 2025
1.0.14 Mar 27, 2025

#477 in Command line utilities

Download history 603/week @ 2025-03-21 924/week @ 2025-03-28 361/week @ 2025-04-04 168/week @ 2025-04-11

2,056 downloads per month

MIT/Apache

16KB
241 lines

dofus-dmg-calculator

github crates.io crates.io

A binary crate to estimate Dofus spells' output damage

Installation

Current release: 1.1.7

cargo install dofus-dmg-calculator

Usage

Available options:

$ dofus-dmg-calculator --help
Usage: dofus-dmg-calculator [OPTIONS]

Estimate Dofus spells' output damage

Options:
  -i, --default-min <MIN_DEFAULT_DMG>  The spell minimum default damage [default: 0]
  -j, --default-max <MAX_DEFAULT_DMG>  The spell maximum default damage [default: 0]
  -k, --crit-min <MIN_CRIT_DMG>        The spell minimum critical damage [default: 0]
  -l, --crit-max <MAX_CRIT_DMG>        The spell maximum critical damage [default: 0]
  -s, --stat-points <STAT_POINTS>      The character stat points [default: 0]
  -p, --power <POWER>                  The character power [default: 0]
  -f, --fixed-dmg <FIXED_DMG>          The character fixed damage [default: 0]
  -x, --fixed-res <FIXED_RES>          The enemy fixed resistance [default: 0]
  -r, --variable-res <VARIABLE_RES>    The enemy variable resistance [default: 0]
  -a, --author                         Print author
  -h, --help                           Print help
  -V, --version                        Print version

Version: 1.1.7
Author: Patacode <pata.codegineer@gmail.com>

Examples:

Agility spell inflicting 9 - 11 (12 - 14) (i.e. 9 to 11 damage by default and 12 to 14 on critical hit) by a character having 128 points allocated in agility stat and 1 point in fixed agility damage (no power and no resistances):

$ dofus-dmg-calculator \
  --default-min 9 \
  --default-max 11 \
  --crit-min 12 \
  --crit-max 14 \
  --stat-points 128 \
  --fixed-dmg 1
Damage estimation = 21 - 26 (28 - 32)

Same scenario than above but against an enemy with 5 points in fixed agility resistance and 20% in variable agility resistance:

$ dofus-dmg-calculator \
  --default-min 9 \
  --default-max 11 \
  --crit-min 12 \
  --crit-max 14 \
  --stat-points 128 \
  --fixed-dmg 1 \
  --fixed-res 5 \
  --variable-res 20
Damage estimation = 13 - 16 (18 - 22)

Development

Install cargo-make, dev tools and build the package:

./bootstrap.sh

Run the tests:

cargo test # unit + integration tests
cargo test --lib # unit tests
cargo test --test integration_tests # integration tests

Generate code coverage report in HTML format under target/tarpaulin:

cargo tarpaulin \
  --out Html \
  --exclude-files src/lib.rs src/main.rs benches/* tests/* \
  --output-dir target/tarpaulin

Benchmark binary and library crates:

cargo bench

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

Dependencies

~1.2–1.8MB
~34K SLoC