dice_tower 0.7.0 copy "dice_tower: ^0.7.0" to clipboard
dice_tower: ^0.7.0 copied to clipboard

A flutter package for rolling dice using the rules for various table top games.

example/example.dart

import "package:dice_tower/dice_tower.dart";

void main(List<String> arguments) async {
  // Defining dice pools.
  Dice d1 = Dice(20);
  Dice d2 = Dice(12, numberOfDice: 2);
  Dice d3 = Dice(10, modifier: -2);
  Dice d4 = Dice(8, modifier: 1, numberOfDice: 3);
  Dice d5 = Dice(4, modifier: -10, numberOfDice: 20, title: "Lemons & Limes");

  // Rolling a single dice pool.
  RollResult r1 = Dnd5eRuleset.roll([d1]);

  // Rolling x dice pool.
  RollResult r2 = Dnd5eRuleset.roll([d1, d2, d3, d4, d5]);

  // Pretty printing results.
  print(
      "Title: ${r1.title}\nSum: ${Dnd5eRuleset.prettyPrintResult(r1)}\nRoll Details: ${Dnd5eRuleset.prettyPrintResultDetails(r1)}");
  print(
      "Title: ${r2.title}\nSum: ${Dnd5eRuleset.prettyPrintResult(r2)}\nRoll Details: ${Dnd5eRuleset.prettyPrintResultDetails(r2)}");
}
1
likes
40
pub points
0%
popularity

Publisher

unverified uploader

A flutter package for rolling dice using the rules for various table top games.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on dice_tower