attack: Perform a Melee Attack

Description Usage Arguments Value Examples

View source: R/attack.R

Description

Perform a Melee Attack

Usage

1
2
3
4
attack(warjack, which = 1L, target = list(stats = c(DEF = 12, ARM = 18, BASE
  = 50)), charge = FALSE, boost_hit = TRUE, boost_damage = TRUE,
  foc = 0, kd = FALSE, dist = 0, dice = sample(1:6, size = 20, replace =
  TRUE), pos = 1)

Arguments

warjack

list warjack object with elements stats, range and melee

which

single integer or single character 'power' index of warjack weapon to use, or identify as a power attack

target

list target warjack object with elements stats and special stats has elements

  1. DEF single numeric NB should include effect of being knocked down (no adjustment here due to possible effect of other modifiers)

  2. ARM single numeric armour value

  3. BASE single numeric diameter of base (mm)

charge

single logical

boost_hit

single logical

boost_damage

single logical

foc

single numeric number of focus

kd

single logical is the target knocked down? (default FALSE)

dist

single numeric distance between bases (default 0)

dice

numeric vector (default sample(1:6))

pos

single numeric (default 1)

Value

named vector with elements

  1. damage amount of damage inflicted

  2. focus remaining focus following attack

  3. knocked down is the target knocked down? 0: No, 1: Yes

  4. position which die to use next

  5. hit was the target hit? 0: No, 1: Yes

Examples

1
2
3
4
5
6
7
8
blueleader <- list(stats = c(SPD = 5, MAT = 7, RAT = 5),
        range = list(),
        melee = list('quake hammer' = list(stats = c(RNG = 2, PAS = 18),
                special = c("crit knockdown")),
            'open fist' = list(stats = c(RNG = 0.5, PAS = 14), special = character(0))))
    attack(blueleader, which = 1, target = list(stats = c(DEF = 13, ARM = 13, BASE = 30)),
        boost_hit = TRUE, boost_damage = TRUE, foc = 3,
        dice = c(1, 5, 4, 1, 1, 2))

CSJCampbell/WMTools documentation built on May 6, 2019, 9:26 a.m.