TheAttack - kyleady/Roll20-Rogue-Trader-API GitHub Wiki

Purpose

This API Command wraps up all the details of rolling to hit, rolling damage, and keeping track of weapon ammunition while taking into account the benefits of the weapon being used and the character using the weapon.

Usage

!use weapon <weapon name><options hash> (Players and GM)

  • weapon name is used to find the weapon the selected characters are using. See MatchingObjs.js.
  • options hash can specify the following
    • Ammo - used to find the Special Ammunition the selected characters are using. See MatchingObjs.js. By default no special ammunition is used.
    • custom - do not search for custom weapons. By default this is false.
    • customAmmo - do not search for custom special ammunition. By default this is false.
    • EffectivePR - the effective Psy Rating of the Character. By default this is the character's Psy Rating.
    • freeShot - should the ammo cost be 0? By default this is false.
    • Modifier - the numerical bonus to the roll to hit. By default this is false.
    • RoF - the action that the character is using to fire the weapon. By default this is Single. The following are recognized.
      • Single
      • Semi Auto
      • Full Auto
      • Called Shot
      • All Out Attack
      • Swift Attack
      • Lightning Attack
    • whisper - should this attack be privately whispered to the GM? By default NPC attacks are whispered to the GM and player attacks are made publicly.
    • Any details of the weapon can be overwritten. Arrays such as Special will by added to instead of overwritten. See INQWeapon.js

If the weapon cannot be found, the user will be informed and the API Command will cease there.

If there are too many weapons that match, the user will receive a list of suggestions.

If Ammo is given and it cannot be found, the user will be informed and the API Command will cease there.

If Ammo is given and there are too many matches, the user will receive a list of suggestions.

If there is not enough ammo, the user will be informed and the weapon will not fire.

The ammo will be tracked with an attribute on the character named "Ammo - <weapon name>".

If you need to keep track of the ammo of two identical weapons separately, give them custom names within the options hash such as Bolt Pistol 1 and Bolt Pistol 2.

If a player is using a vehicle to fire a weapon, TheAttack will use DefaultCharacter.js to use their character's stats to fire the weapon, but it will track the ammo on the selected vehicle.

Warning: Called Shots that miss by less than three degrees of failure will not consume ammo. This is my own addition.

The API Command will output the following

  • An announcement if the weapon jammed or overheated.
  • A link to the weapon used.
  • A link to the ammunition used (if used).
  • The Rate of Fire and max number of hits.
  • The remaining ammunition (if applicable).
  • The roll to hit.
  • An option to re-roll to hit (if the attack missed).
  • The damage roll (if the attack hit and the weapon can deal damage).

This API Command makes use of the eachCharacter() function.

This API Command makes use of the attrValue() function.

The following Talents, Traits, and Qualities are currently accounted for in TheAttack

  • Accurate
  • Proven - Warning: Proven(X) weapons do not increase damage rolls below X to X. Instead, dice that are below X are re-rolled once. There is no easy way to increase dice to X, however it is easy to re-roll dice that are below X in Roll20.
  • Tearing
  • Flesh Render
  • Crushing Blow
  • Mighty Shot
  • Force - only the PR bonus to Damage and Penetration
  • Storm
  • Blast - hits are multiplied after TheAttack for use with HordeKill.js and ApplyDamage.
  • Spray - hits are multiplied after TheAttack for use with HordeKill.js and ApplyDamage. Also Auto Hits.
  • Devastating - only the additional Horde Damage.
  • Twin Linked - Warning: Doubles the max hits instead of allowing for an additional hit.
  • Lance
  • Razor Sharp
  • Maximal - Warning: Instead of the flat bonuses, it grants the following benefits
    • +33% Range
    • +50% Damage Dice
    • +25% Damage Base
    • +20% Penetration
    • +50% Blast
  • Swift Attack - Warning: Swift Attacks have their maximum hits limited to WS Bonus divided by three (minimum three). I found the normal limits too generous.
  • Lightning Attack - Warning: Lightning Attacks have their maximum hits limited to WS Bonus divided by two (minimum two). I found the normal limits too generous.
  • Reliable - Warning: Reliable weapons will not receive a Jamming alert unless they roll a natural 100.
  • Unreliable
  • Overheats
  • Horde Damage - Additional Horde Damage per Hit. Based on Hellfire Rounds
  • Damage - Allows Special Ammunition to add to the weapon's damage.
  • Pen - Allows Special Ammunition to add to or overwrite the weapon's penetration.
  • Type - Allows Special Ammunition to overwrite the weapon's damage type.

Requirements