Skip to content

StatRoll.js

kyleady edited this page Jul 1, 2016 · 6 revisions

Purpose

Allows the players to quickly roll against their stats, adding in modifiers, and adding bonus successes from Unnatural Characteristics (Using the rules to Unnatural Characteristics from Black Crusade) activated with one API command in the Chat Window, showing the results in terms of successes rolled and potential unnatural successes.

Usage

![gm][ (+|-)<modifier>]
Rolls a D100 against the named stat for each selected character, determining the number of successes. The input allows the player to specify the following

  • gm - Whether or not this roll is to be privately sent to the gm. If so, the result is only known to the gm.
  • stat name - Which stat should the selected character roll against? The currently supported stat names are
    • WS
    • BS
    • S
    • T
    • Ag
    • Pr
    • Wp
    • It
    • Fe
  • modifier - Adds or subtracts the given modifier to the roll.

The output is in the form of a Roll Template. The title of the Roll Template includes the name of the stat being rolled and the name of the character rolling the Stat. The two items in the Roll Template are Successes and Unnatural. Successes is determined by the following formula:

Successes = (Stat + Modifier - D100)/10

Technically, Math.floor() should be used on the result, but my players and I prefer to see how close they came to not passing the check. Successes lists the number of successes achieved on the roll. If the number is negative then it lists the number of Failures incurred on the roll. The ruleset of Rogue Trader was used for determining the number of successes and failures on a Characteristic/Skill Test.

The number of additional successes (on Successful tests) from Unnatural Characteristics are given in Unnatural. Unnatural is determined by the following formula:

Unnatural = Math.ceil(Unnatural Stat/2)

The rule set of Black Crusade was used for determining the effect of Unnatural Characteristics on Characteristic/Skill Tests. It may seem odd using two different rulesets to determine the number of successes on a roll. I chose these rules as they interacted the most naturally with roll templates. Further, there is no easy conversion for creatures from Black Crusade that have that version of Unnatural Characteristics, while it is a simple matter to convert pre-Black Crusade Unnatural Characteristics.

Requirements

The selected characters must not only have the supported stat names as attributes, but they must also have have matching Unnatural Characteristics. The current list is as follows: WS, BS, S, T, Ag, Per, It, Wp, Fe, Unnatural WS, Unnatural BS, Unnatural S, Unnatural T, Unnatural Ag, Unnatural Per, Unnatural It, Unnatural Wp, Unnatural Fe.

Future Work

I would like to see this code changed so that it is more concise when detecting input from users.

I would like to make the code function even when no matching unnatural stat is found.

I would like to add support for the following stats

  • Corruption
  • Insanity (No connected Unnatural Stat)
  • Renown (No connected Unnatural Stat)
  • Starship: Crew Rating (No connected Unnatural Stat)
  • Family: Profit Factor (No connected Unnatural Stat)

Clone this wiki locally