to_attack: How many successful hits from an attack?

Description Usage Arguments Value Examples

View source: R/to_attack.R

Description

When a unit attacks another unit, dice are rolled against the ballistic or weapon skill of the attacker. Successful attacks have the opportunity to wound the defender.

Usage

1
2
to_attack(n, skill, reroll = NULL, explode = NULL, expand = NULL,
  trigger = NULL)

Arguments

n

integer scalar number of attacks

skill

integer scalar minimum successful roll for relevant attack skill (e.g. BS 3+ would be skill = 3).

reroll

integer scalar what MAXIMUM result rerolls (default NULL).

explode

integer scalar what MINIMUM result explodes (default NULL).

expand

named list of arguments for expand_dice (default NULL).

trigger

integer vector length >= 1 which values trigger special effects (default NULL).

Value

integer scalar number of successful hits UNLESS !is.null(trigger) then named list with number of successes (success) and triggers (trigger).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# a single SM tactical attacks.
to_attack(n = 1, skill = 3)

# a single SM tactical attacks while within 6" of a Captain.
to_attack(n = 1, skill = 3, reroll = 1)

# a single CSM attacks with Death to the False Emperor.
to_attack(n = 1, skill = 3, explode = 6)

# with expanding attacks
to_attack(n = 1, skill = 3, expand = list(lvl = 6, rate = 3))

# a single SM tactical attacks with an overcharged plasma
to_attack(n = 1, skill = 3, trigger = 1)

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