Skip to content

WeaponGenerator.js

kyleady edited this page Jul 10, 2016 · 4 revisions

Purpose

Randomly generates weapons for randomly generated xenos civilizations. These weapons can be melee, thrown, pistol, basic, heavy, or superheavy. The Damage, Penetration, Range, Rate of Fire, Clip, Reload, and Weapon Qualities are all randomly generated. However, the technology level of the xenos civilization allows multiple dice to be rolled, picking the highest one.

Usage

There is no frontend output for this script. It is meant to supplement XenosGenerator.js and VehicleGenerator.js.

TechRoll(rerolls, diceSides, diceNum)
TechoRoll initially rolls diceNum number of dice with diceSides sides. If rerolls is 0, it simply outputs the initial roll, unmodified. If rerolls is greater than zero, TechRoll rolls the initial roll rerolls number of times and outputs the highest of those rolls. If rerolls is less than zero, TechRoll rolls the initial roll AbsoluteValue(rerolls) number of times and outputs the lowest of those rolls. For example TechRoll(-3,10,2) would output the minimum of (2D10,2D10,2D10). By default rerolls is -1. By default diceSides is 10. By default diceNum is 1. Therefore TechRoll() = minimum of (D10,D10).

RandomWeapon(type, tech, qualities, blast, rangemultiplier, clipmultiplier)
Takes the input and outputs an object detailing a weapon. XenosGenerator.js and VehicleGenerator.js take that weapon object and not only convert it into text on a Character Sheet but also construct a Token Macro to fire that weapon. The inputs affect the following:

  • type
  • tech
  • qualities
  • blast
  • rangemultiplier
  • clipmultiplier

Requirements

Future Work

Clone this wiki locally