calculateActionTime

Adds a specified number of actions to a game time to determine the correct phase and impulse in the future

calculateActionTime(actionPoints: number, actionsPerImpulse: object, time: object, currentImpulseRemainder: number): object
Parameters
actionPoints (number) A number of action points
actionsPerImpulse (object) An object of distributed action points (e.g. {"1": 2, "2": 1, "3": 2, "4": 2})
time (object) A game time object (e.g. {"impulse" : 1, "phase" : 1})
currentImpulseRemainder (number) The amount of actions remaining this impulse in case of previous remainders
Returns
object: Returns an object with a correct time object as well as remaining actions {time: next, remaining: actions}

nextImpulse

Returns a time object one impulse in the future

nextImpulse(time: object): object
Parameters
time (object) A phase and impulse object
Returns
object: A time object incremented one impulse

previousImpulse

Returns a time object one impulse in the past

previousImpulse(time: object): object
Parameters
time (object) A phase and impulse object
Returns
object: A time object decremented one impulse

phasesToTime

Returns a time some amount of phases in the future

phasesToTime(phases: number, time: object): object
Parameters
phases (number) A number of phases
time (object) A game time object
Returns
object: The future time object

incapacitationTimeToPhases

Converts time to phases

incapacitationTimeToPhases(time: string): number
Parameters
time (string) A length of time in the Incapacitation Table format
Returns
number: The total number of phases

tableLookup

Looks up results on a two-dimensional data table

tableLookup(table: array, inputName: string, columnName: string, inputValue: any): any
Parameters
table (array) A json representation of the book's lookup table
inputName (string) The exact header name of the input value
columnName (string) The header name of the column being cross-referenced with input
inputValue (any)
Returns
any: The resulting lookup

rangeALM

Returns the correct Accuracy Level Modifier for any distance

rangeALM(distance: number): number
Parameters
distance (number) The distance to target in hexes (map) or inches (miniatures)
Returns
number: The ALM to add in to EAL calculation

movingALM

Returns the correct Movement Modifier for targets and shooters

movingALM(targetSpeed: number, shooterSpeed: number, range: number): number
Parameters
targetSpeed (number) The speed the target is moving in hexes per inch
shooterSpeed (number) The speed the shooter is moving in hexes per inch
range (number) The distance between shooter and target in hexes
Returns
number: The ALM to add in to EAL calculation

shotAccuracyALM

Returns the correct Shot Accuracy Modifier for shooters

shotAccuracyALM(weaponAimMod: number, skillAccuracyLevel: number): number
Parameters
weaponAimMod (number) The aim mod imported from the shooter's weapon
skillAccuracyLevel (number) The SAL imported from the shooter's character sheet
Returns
number: The ALM to add in to EAL calculation

situationALM

Returns the Stance/Situation Modifier for shooters

situationALM(list: array): number
Parameters
list (array) A list of string labels of the stances/situations
Returns
number: The ALM to add in to EAL calculation

visibilityALM

Returns the Visibility Modifier for shooters

visibilityALM(list: array): number
Parameters
list (array) A list of string labels of the visibilities
Returns
number: The ALM to add in to EAL calculation

targetSizeALM

Returns the Target Size Modifier based on target's size, either position or actual size

targetSizeALM(list: array, shotType: string, targetSize: number): number
Parameters
list (array) A list of string labels of the standard target sizes
shotType (string) Either 'Single Shot' or 'Burst'
targetSize (number) Optional target size if there are no viable options from the list
Returns
number: The ALM to add in to EAL calculation

skillAccuracyLevel

Returns the Skill Accuracy Level

skillAccuracyLevel(skillLevel: number): number
Parameters
skillLevel (number) The set skill level of the character
Returns
number: The Skill Accuracy Level

intelligenceSkillFactor

Returns the Intelligence Skill Factor

intelligenceSkillFactor(int: number, skillLevel: number): number
Parameters
int (number) The set intelligence level of the character
skillLevel (number) The set skill level level of the character
Returns
number: The Intelligence Skill Factor rounded to an odd number

knockoutValue

Returns the knockout value

knockoutValue(will: number, skillLevel: number): number
Parameters
will (number) The set will attribute
skillLevel (number) The set skill level
Returns
number: The knockout value

movementSpeed

Returns the number of hexes or inches a character can move each phase

movementSpeed(strength: number, agility: number, encumbrance: number): number
Parameters
strength (number) The set strength attribute
agility (number) The set agility level
encumbrance (number) The calculated encumbrance
Returns
number: The total hexes or inches per phase

encumbranceCalculator

Returns the total encumbrance for equipment and weapons

encumbranceCalculator(gear: array, guns: array): number
Parameters
gear (array) A list of all equipment
guns (array) A list of all weapons
Returns
number: The total combined encumbrance

combatActionsPerImpulse

Returns the number of combat actions per impulse

combatActionsPerImpulse(strength: number, agility: number, intelligence: number, skillLevel: number, encumbrance: number): object
Parameters
strength (number) The set strength attribute
agility (number) The set agility attribute
intelligence (number) The set intelligence attribute
skillLevel (number) The set skill level
encumbrance (number) The encumbrance level
Returns
object: The combat actions per impulse object

snapToValue

Returns the closest number in a list of numbers

snapToValue(target: number, array: array): number
Parameters
target (number) The number to change
array (array) A list of numbers with arbitrary space between
Returns
number: The closest number from NumberList

effectiveAccuracyLevel

Returns the EAL given all modifiers

effectiveAccuracyLevel(mods: object): number
Parameters
mods (object) The collection of mods
Returns
number: The effective accuracy level

oddsOfHitting

Returns the chance of hitting

oddsOfHitting(eal: number, shotType: string): number
Parameters
eal (number) The effective accuracy level
shotType (string) Either Single Shot or Burst Elevation
Returns
number: The effective accuracy level

ealToHit

Returns the minimum EAL required to succeed given a rolled to-hit

ealToHit(roll: number, shotType: string): number
Parameters
roll (number) The to-hit roll generated externally
shotType (string) Either Single Shot or Burst Elevation
Returns
number: The minimum effective accuracy level

shotScatter

Returns the number of hexes away on a missed shot

shotScatter(actualEAL: number, requiredEAL: number): number
Parameters
actualEAL (number) The generated EAL
requiredEAL (number) The minimum EAL required to hit
Returns
number: The number of hexes away the shot hits

missedShotPlacement

Returns the placement of a missed shot

missedShotPlacement(roll: number, scatter: number): string
Parameters
roll (number) A random roll of 0-9 generated externally
scatter (number) The number of hexes away the missed shot hit
Returns
string: The description of the shot placement

burstFire

Returns the targets hit in burst fire

burstFire(arc: number, rof: number, targets: number): object
Parameters
arc (number) The arc of fire chosen by user
rof (number) The rate of fire listed on the weapon
targets (number) The number of targets as chosen by user
Returns
object: The targets object with booleans for hit success plus bullets

singleShotFire

Returns the hit success for single shot

singleShotFire(chance: number): boolean
Parameters
chance (number) The percent chance of hitting
Returns
boolean: Whether it hit or not

shotgunFire

Returns the targets hit in shotgun fire

shotgunFire(ammoType: string, bphc: number): object
Parameters
ammoType (string) Either APS or Shot
bphc (number) The Burst Pellet Hit Chance of the weapon ammo at range
Returns
object: The targets object with booleans for hit success plus bullets (pellets)

explosiveFire

Returns the targets hit in explosive fire

explosiveFire(weapon: object, ammoType: string): object
Parameters
weapon (object) The weapon object with bshc as a string with optional asterisk
ammoType (string) The type of ammo used
Returns
object: The targets object with booleans for hit success plus bullets (shrapnel)

blastModifier

Returns the blast modifier for vaious conditions

blastModifier(mod: string): number
Parameters
mod (string) The condition description
Returns
number: The mod to multipy damage by

multipleHitCheck

Returns the asterisks numbers in auto chance

multipleHitCheck(arc: number, rof: number, chance: number): boolean
Parameters
arc (number) The chosen arc of fire
rof (number) The weapon's rate of fire
chance (number) The percent chance of hitting
Returns
boolean: Whether it is a multiple hit

damageClass

Returns the DC for a weapon firing specific ammo at range

damageClass(weapon: object, rangeVal: number, ammo: string): number
Parameters
weapon (object) The database weapon
rangeVal (number) The range in hexes
ammo (string) One of three ammo types
Returns
number: The correct damage class

penetration

Returns the PEN for a weapon firing specific ammo at range

penetration(weapon: object, rangeVal: number, ammo: string): number
Parameters
weapon (object) The database weapon
rangeVal (number) The range in hexes
ammo (string) One of three ammo types
Returns
number: The correct penetration value

effectivePenetrationFactor

Returns the Effective Penetration Factor value

effectivePenetrationFactor(roll: number, armor: string): number
Parameters
roll (number) A random number generated externally
armor (string) The name of the armor or material
Returns
number: The correct EPF

damageReduction

Returns the correct message for which type of reduction, if any

damageReduction(pen: number, epf: number): string
Parameters
pen (number) The penetration value of the weapon
epf (number) The effective penetration factor
Returns
string: The correct reduction message

hitDamage

Returns the correct damage value

hitDamage(roll: number, cover: boolean, dc: number, pen: number, epf: number): number
Parameters
roll (number) A random number generated externally
cover (boolean) If there is cover or not
dc (number) The damage class of the weapon ammo
pen (number) The penetration of the wapon ammo
epf (number) The effective penetration factor
Returns
number: The correct damage value

hitLocation

Returns the correct hit location

hitLocation(roll: number, cover: boolean): string
Parameters
roll (number) A random number generated externally
cover (boolean) If there is cover or not
Returns
string: The correct location

knockdown

Returns the knocked down or delayed status

knockdown(roll: number, cover: boolean, weapon: weapon): string
Parameters
roll (number) A random 0-99 number generated externally
cover (boolean) If there is cover or not
weapon (weapon) The gun firing at the target
Returns
string: The knocked down message

medicalAid

Returns the recovery chance and time

medicalAid(damage: number, aid: string): string
Parameters
damage (number) The total damage
aid (string) The type of aid chosen
Returns
string: The recovery message

incapacitationEffect

Returns the incapacitation effect

incapacitationEffect(pd: number, kv: number, roll: number): object
Parameters
pd (number) Physical damage
kv (number) Knockout value
roll (number) random number between 0-99 generated externally
Returns
object: The incapacitation effect and time

incapacitationChance

Returns the incapacitation chance

incapacitationChance(pd: number, kv: number): number
Parameters
pd (number) Physical damage
kv (number) Knockout value
Returns
number: The incapacitation percent chance

incapacitationTime

Returns the incapacitation time

incapacitationTime(roll: number, pd: number): string
Parameters
roll (number) Random number between 0-9 generated externally
pd (number) Physical damage
Returns
string: The incapacitation time

damageTotal

Returns the damage total

damageTotal(pd: number, health: number): number
Parameters
pd (number) Physical damage
health (number) The character health attribute
Returns
number: The damage total

getAmmoTypes

Returns the ammo types for a gun

getAmmoTypes(weaponName: string): array
Parameters
weaponName (string) Name of the weapon
Returns
array: The array of ammo types

getWeaponByName

Returns a weapon by its name

getWeaponByName(weaponName: string): object
Parameters
weaponName (string) The wapon's name
Returns
object: The weapon object

getAllWeapons

getAllWeapons(): object
Returns
object: The entire weapons object

getAllTables

getAllTables(): object
Returns
object: All tables

shotgunMultipleHit

Returns the hit location spacing for a shotgun hit

shotgunMultipleHit(salm: number): number
Parameters
salm (number) The shotgun alm
Returns
number: The spacing to add or subtract from hit location