Code Monkey home page Code Monkey logo

critfail's Introduction

Critfail

CritFail is a dice simulator designed for use with D&D (specifically 5e). It can handle ability checks, damage rolls, and advantage/disadvantage. Attacks (check and damage) can be rolled in one expression, and critical hit damage is calculated accordingly.

Critfail is available as a desktop application, a cli program, or a web app. The web app can be accessed here.

The business logic for Critfail is also available as a rust library on crates.io. See the api docs for more info on using the library.

Installation

The desktop version of critfail is a single executable that can be downloaded from the releases page and run directly. The same executable is used for the cli interface—just put it somewhere on your path.

Usage

Whatever interface you are using, rolls are made using roll expressions. There are 3 kinds of roll expressions: Checks, damage, and attacks.

  • r+6 : A check. Roll a d20 and add 6.
  • 2d6+4 : Damage roll. Rolls 2d8 and adds 4.
  • r+3?1d12+3: An attack. Rolls to hit and for damage. Damage is automatically double-rolled for a critical hit.

Checks

Roll a d20 with a modifier. Checks can have advantage/disadvantage, and any number of constant or dice modifiers can be added.

  • r : Roll a d20.
  • r+5 : Roll a d20 and add 5 to the value.
  • a+5 : roll a d20 with advantage then add 5.
  • d+4 : roll a d20 with disadvantage then add 4.
  • d+4+1d4 : roll a d20 with disadvantage, then add 4.+1d4

Damage

Roll multiple dice to determine damage. Damage rolls use the usual dice notation.

  • 2d8+5
  • 2d8-1d4+7-2

Attacks

An attack consts of both a check and a damage roll, separated by a ?. If the check part of an attack rolls a 20, all of the positive dice in the damage part of the roll will be rolled twice. (Modifiers will only be counted once)."

  • r+4?1d8
  • a+5?1d4+4+5d6

Building

Desktop

To build for desktop, run cargo build --release

Web

Building for web is handled using the Just command runner tool. To build the web application, run just build from the project root. The web folder will contain the build output. Run web-serve to start a server running the web app.

Building for web requires the following dependencies:

  • wasm-bindgen available on the path
  • binaryen installed and available on path (specifically the wasm-opt binary)
  • To run the local server: python 3 installed

critfail's People

Stargazers

Paul Saunders avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.