Skip to content

Aethraverse/AVDice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AVDice

This module provides a flexible system for dice rolls and modifiers, suitable for any game that requires chance mechanics, RPG-style calculations, or random events.

Features

  • Dice Rolls: Support for multiple dice of various sides (d4, d6, d8, d10, d12, d20, etc.).
  • Modifiers: Apply bonuses, penalties, or custom calculations to dice rolls.
  • Result Tracking: Store detailed roll results for logging, debugging, or game logic.
  • Extensible: Easily integrate custom dice types, probability distributions, and special rules.
  • Robust Dice Notation Parser: Supports [count]d[faces][+/-add][*mult] with validation, e.g. d20, 2d6+3, 3d8-1*1.5.
  • Detailed Roll Trace: Retrieve parsed data, individual die values, base total, and final modified total.
  • Success Check Evaluation: Built-in success / failure / critical success / critical failure evaluation against target thresholds.
  • Dice DSL + AST: expression parser with arithmetic and parenthesis, plus tabletop-style dice operators:
    • kh / kl — keep highest / lowest dice.
    • ! — exploding dice.
    • r — reroll with condition, e.g. r<3, r==1, r>=6.
    • comparisons (>=, <=, >, <, ==) for threshold checks.
  • Safety Sandbox Limits: built-in guards against pathological expressions with limits for MaxDice, MaxFaces, MaxExplodes, MaxDepth, MaxOps, and MaxTime.
  • GAS Integration: includes DiceAttributeEvaluator, DiceGameplayEffectMagnitude, and DiceExecutionCalculation for attribute-driven dice expressions in GameplayEffects.

DSL examples

  • 4d6kh3+2
  • 1d20r<3+5>=15
  • 8d6!>=30
  • (2d8kh1 + 1d6) * 2

Documentation

About

This module provides a flexible system for dice rolls and modifiers, suitable for any game that requires chance mechanics, RPG-style calculations, or random events.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors