play_LHTR_battle: Play one battle

Description Usage Arguments Details Value Examples

View source: R/lhtr2.R

Description

Plays one battle following Larry Harris Tournament Ruls for Axis and Allies Revised edition (LHTR 2.0)

Usage

1
2
3
4
5
6
7
play_LHTR_battle(
  oolAttacker,
  oolDefender,
  retreat = NULL,
  verbose = F,
  suppressChecks = F
)

Arguments

oolAttacker

character() order of loss for attacker

oolDefender

character() order of loss for defender

retreat

integer() round number after which attacker should retreat, if NULL, round number will not trigger retreat

verbose

logical() whether to print battle information to stdout

suppressChecks

suppressChecks on input

Details

units for oolAttacker and oolDefender accepts all units specified in ool

In addition to the standard units, special units achieved through weapons development are supported:

Dbomb

Destroyer offshore bombardment

jftr

Jet Fighter

ssub

Super Submarine

hbomb

Heavy Bomber

Weapons development that does not result in changes to battle stats (such as long-range aircraft) does not have separate unit codes.

In addition to the standard options, the attacker and defender OOL supports the directives:

SUBM

Submarines submerge at first opportunity when all units preceeding this directive is lost.

In addition to the standard options, the attacker OOL supports the directives:

RET

Attacker will retreat when all units preceeding this directive is lost.

LHTR 2.0 does only allow one antiaircraft gun to fire for each territory. Only one shot will be fired for each plane, regardless of how many aa are listed in 'oolDefender'. To simulate units flying over territories with AA-guns en-route to battle, this must be modelled as a separate battle. Battle termination conditions are check _after_ each round of battle, so it is possible ot set up a simulation of only aircrafts vs AA.

Value

list() with members

unitsAttacker

remaining units for attacker, formatted as oolAttacker

unitsDefender

remaining units for defender, formatted as oolDefender

Examples

1
 play_LHTR_battle(c("inf", "art", "ftr"), c("inf", "inf", "inf", "AA"))

edvinf/aaSimulator documentation built on June 1, 2020, 12:10 p.m.