Versions in this module Expand all Collapse all v4 v4.4.1 Jun 13, 2022 v4.3.13 Jun 7, 2022 v4.3.12 Apr 23, 2022 v4.3.11 Oct 17, 2021 Changes in this version + func ByDescription(desc string) func(*Dice) error + func ByDieType(qty, sides, bonus int) func(*Dice) error + func WithAutoSF(enabled bool, successMessage, failureMessage string) func(*sdrOptions) + func WithDieBonus(n int) func(*Dice) error + func WithDiv(n int) func(*Dice) error + func WithFactor(n int) func(*Dice) error + func WithGenerator(source rand.Source) func(*Dice) error + func WithRollBonus(bonus int) func(*sdrOptions) + func WithSeed(s int64) func(*Dice) error + type Dice struct + LastValue int + MaxValue int + MinValue int + Rolled bool + func New(options ...func(*Dice) error) (*Dice, error) + func (d *Dice) Description() (desc string) + func (d *Dice) MaxRoll() (int, error) + func (d *Dice) MaxRollToConfirm(bonus int) (int, error) + func (d *Dice) Roll() (int, error) + func (d *Dice) RollToConfirm(confirm bool, threat int, bonus int) (int, error) + func (d *Dice) StructuredDescribeRoll(options ...func(*sdrOptions)) ([]StructuredDescription, error) + type DieRoller struct + Confirm bool + DC int + DoMax bool + FailMessage string + LabelText string + PctChance int + PctLabel string + Permutations [][]interface{} + RepeatFor int + RepeatUntil int + SuccessMessage string + Template string + func NewDieRoller(options ...func(*Dice) error) (*DieRoller, error) + func (d *DieRoller) DoRoll(spec string) (string, []StructuredResult, error) + func (d *DieRoller) DoRollOnce(spec string) (string, StructuredResult, error) + func (d *DieRoller) IsNatural1() (result bool) + func (d *DieRoller) IsNaturalMax() (result bool) + func (d *DieRoller) RandFloat64() float64 + func (d *DieRoller) RandIntn(n int) int + type StructuredDescription struct + Type string + Value string + type StructuredDescriptionSet []StructuredDescription + func (sr StructuredDescriptionSet) Text() (string, error) + type StructuredResult struct + Details StructuredDescriptionSet + Result int + func Roll(spec string) (string, []StructuredResult, error) + func RollOnce(spec string) (string, StructuredResult, error) Other modules containing this package github.com/MadScienceZone/go-gma/v5