expand_dice: Expands effects

Description Usage Arguments Details Value Examples

View source: R/roll_die.R

Description

Some effects spawn additional successes on certain rolls. For example, on an attack roll of 6+, this attack scores 3 hits instead of 1. I call this "expands" because it increases the number of successes without generating new rolls (explodes). Expanding attacks have a rate of expansion – how many new successes proc-d on flagged roll?

Usage

1
expand_dice(x, lvl = 6, rate = 1)

Arguments

x

numeric vector length >= 1.

lvl

numeric scalar what MINIMUM result expands; default 6+.

rate

numeric scalar number of actual successes on proc (default 1)?

Details

This function specifically returns the number of additionall successes, not including the initial success. For example, if an attack grants 3 successes on a 6+, this function would return 2 – the ADDITIONAL successes.

Value

integer scalar number additional successes (see description).

Examples

1
2
x <- roll_dice(6)
expand_dice(x = x, lvl = 6, rate = 3)

psmits/mathhammr documentation built on May 14, 2019, 5:16 a.m.