-
Notifications
You must be signed in to change notification settings - Fork 0
INQWeaponNoteParser.js
kyleady edited this page Jun 26, 2017
·
2 revisions
The INQWeaponNoteParser was made primarily to parse the Weapon Notes on Character Sheets and turn them into INQWeapon objects. An example Weapon Note is as follows: Astartes Combat Knife (1d10 + 8 R; Pen 2; Balanced).
It is suggested that you do not use this prototype directly. Instead, let INQWeapon() use it.
The string is parsed by [INQLinkParser.js]. The Name of the INQLink is used for the INQWeapon Name. The substring inside the outer most parenthesis is split by commas and semicolons and each piece is analyzed separately to fill out the details of the INQWeapon object.
- Class: It recognizes Melee, Pistol, Basic, and Heavy.
- Range: It recognizes # [k]m. The k, for kilo, is optional.
- Rate of Fire: It recognizes (S|-)/(#|-)/(#|-), such as S/-/2 or -/-/6.
- Damage: It recognizes [#]d#[+#] .
- The DiceNumber is optional.
- The DiceType is not optional.
- The DamageBase is optional.
- The DamageType is optional. And the following Types are accepted: I, R, E, X.
- Penetration: It recognizes Pen[etration][:][#][d#+][#], such as Penetration: 1d10 or Pen 3
- The PenDiceNumber is optional.
- The PenDiceType is optional.
- The Penetration is optional.
- Clip: It recognizes Clip #.
- Reload: It recognizes (Reload|Rld)[:]#
- If a detail doesn't match any of the above patterns, it will be tossed in with the special rules.