Skip to content

Commit 7e25662

Browse files
authored
Lots of enhancements and bug fixes (#100)
* Update compatibleCoreVersion to 0.7.5. * Separate die and modifier for Cast Spell From Scroll. Separate die and modifier for initiative rolls. Closes #65 Closes #86 * Initial implementation of rollable treasure and currency conversion (for coins). * Tidy value rolls and currency conversion. Closes #80 Closes #87 * Use action die for relevant rolls. Closes #55 * Saves are always rolled on a d20. * Formatting pass and fix up tests to handle action die changes. * Handle multiple action dice. Action dice are set in the config dialog and selected from a dropdown where the actionDice text field was. Zeroes always use the first action dice defined in the config. Closes #90 * Action Dice can be dragged to the macro bar to create a macro that selects the current die. * Add maximum fields for abilities and support showing them on the sheet. Closes #88 * Populate ability score maximums with the initial ability score. * Implement basic upper level character parsing. Put some zero level fields in the right places. * Cleric upper level import passing tests. * Fix import of treasure items. Avoid potential nasty infinite recursion when combining As Coins items. * Handle upper level thieves. * Parse upper level halfling stats. Formatting pass. * Upper level warrior parsing. * Upper level wizard and dwarf parsing. * Parse upper level Elf stats. Closes #90 * Put back template for the 'results' field of spells. * Validate and format speed field as a distance in feet. Closes #97 * Remove ability label if a class doesn't have a spellCheckAbility defined. Closes #92 * Run formatter. * Use roll.roll() over roll.evaluate() for compatibility with 0.6.6. * Rename Show Max Attributes to the more correct Show Max Abilities * Bump minimal compatible version to 0.6.6 as I'm currently testing on that and latest. * Bump to 0.16
1 parent d89f360 commit 7e25662

25 files changed

+2296
-199
lines changed

lang/en.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"DCC.Action": "Action",
3131
"DCC.ActionAbil": "Ability Check",
3232
"DCC.ActionDice": "Action Dice",
33+
"DCC.ActionDiceMacroName": "Action Dice ({die})",
3334
"DCC.ActionHeal": "Healing",
3435
"DCC.ActionMSAK": "Melee Spell Attack",
3536
"DCC.ActionMWAK": "Melee Weapon Attack",
@@ -63,6 +64,7 @@
6364
"DCC.Background": "Background",
6465
"DCC.Backstab": "Backstab",
6566
"DCC.BackstabEmote": "Backstabs with their {weaponName} and hits AC {rollHTML} for {damageRollHTML} points of damage!{crit}{fumble}",
67+
"DCC.BadValueFormulaWarning": "Bad formula in item value field!",
6668
"DCC.BaseACAbilityConfig": "Base AC Ability",
6769
"DCC.Bio": "Bio",
6870
"DCC.Biography": "Biography",
@@ -162,8 +164,15 @@
162164
"DCC.CurrencyCP": "Copper",
163165
"DCC.CurrencyConvert": "Convert All Currency",
164166
"DCC.CurrencyConvertHint": "Convert all carried currency to the highest possible denomination to reduce the amount of coinage carried by the character. Be wary, this action cannot be undone.",
167+
"DCC.CurrencyEP": "Electrum",
165168
"DCC.CurrencyGP": "Gold",
169+
"DCC.CurrencyPP": "Platinum",
166170
"DCC.CurrencySP": "Silver",
171+
"DCC.CurrencyShortCP": "Cp.",
172+
"DCC.CurrencyShortEP": "Ep.",
173+
"DCC.CurrencyShortGP": "Gp.",
174+
"DCC.CurrencyShortPP": "Pp.",
175+
"DCC.CurrencyShortSP": "Sp.",
167176
"DCC.DamImm": "Damage Immunities",
168177
"DCC.DamRes": "Damage Resistances",
169178
"DCC.DamVuln": "Damage Vulnerabilities",
@@ -374,16 +383,18 @@
374383
"DCC.RangedWeapons": "Ranged Weapons",
375384
"DCC.Rarity": "Rarity",
376385
"DCC.Reaction": "Reaction",
386+
"DCC.ReadLanguages": "Read Languages",
377387
"DCC.RemoveEmptyItems": "Remove empty items",
378388
"DCC.RemoveEmptyItemsInfo": "Remove items with zero quantity",
379-
"DCC.ReadLanguages": "Read Languages",
380389
"DCC.RequiredMaterials": "Required Materials",
390+
"DCC.ResolveValueEmote": "Rolled value of {itemName}:<br/>{pp} Pp. {ep} Ep. {gp} Gp. {sp} Sp. {cp} Cp.",
381391
"DCC.Roll": "Roll",
382392
"DCC.RollAttackBonusConfig": "Roll Attack Bonus",
383393
"DCC.RollAttackBonusInfo": "Use @ab in ToHit or Damage for last roll",
384394
"DCC.RollExample": "e.g. +1d4",
385395
"DCC.RollMode": "Roll Mode",
386396
"DCC.RollSituationalBonus": "Situational Bonus?",
397+
"DCC.RollTreasureValue": "Roll Treasure Value",
387398
"DCC.RollUnder": "{name} (Roll Under)",
388399
"DCC.SameAlignment": "Same",
389400
"DCC.Save": "Save",
@@ -401,8 +412,9 @@
401412
"DCC.SettingFumbleTableHint": "Roll Table to use for fumbles - must be in a compendium pack",
402413
"DCC.SheetConfig": "Sheet Configuration",
403414
"DCC.ShieldBash": "Shield Bash",
404-
"DCC.ShowSkills": "Show Custom Skills Tab",
405-
"DCC.ShowSpells": "Show Custom Spells Tab",
415+
"DCC.ShowMaxAbilitiesConfig": "Show Max Abilities",
416+
"DCC.ShowSkillsConfig": "Show Custom Skills Tab",
417+
"DCC.ShowSpellsConfig": "Show Custom Spells Tab",
406418
"DCC.Size": "Size",
407419
"DCC.SizeGargantuan": "Gargantuan",
408420
"DCC.SizeHuge": "Huge",

module/__tests__/actor.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test('roll ability check', () => {
3636

3737
actor.rollAbilityCheck('str')
3838
expect(Roll).toHaveBeenCalledTimes(1)
39-
expect(Roll).toHaveBeenCalledWith('1d20+@abilMod', { abilMod: -1, critical: 20 })
39+
expect(Roll).toHaveBeenCalledWith('@die+@abilMod', { die: '1d20', abilMod: -1, critical: 20 })
4040
expect(rollToMessageMock).toHaveBeenCalledWith({ flavor: 'AbilityStr Check', speaker: actor })
4141

4242
// Check that rollUnder option is interpreted correctly
@@ -48,7 +48,7 @@ test('roll ability check', () => {
4848
// ...both ways
4949
actor.rollAbilityCheck('lck', { rollUnder: false })
5050
expect(Roll).toHaveBeenCalledTimes(3)
51-
expect(Roll).toHaveBeenCalledWith('1d20+@abilMod', { abilMod: -1, critical: 20 })
51+
expect(Roll).toHaveBeenCalledWith('@die+@abilMod', { die: '1d20', abilMod: -1, critical: 20 })
5252
expect(rollToMessageMock).toHaveBeenLastCalledWith({ flavor: 'AbilityLck Check', speaker: actor })
5353
})
5454

@@ -57,17 +57,17 @@ test('roll saving throw', () => {
5757

5858
actor.rollSavingThrow('frt')
5959
expect(Roll).toHaveBeenCalledTimes(1)
60-
expect(Roll).toHaveBeenCalledWith('1d20+@saveMod', { saveMod: -1 })
60+
expect(Roll).toHaveBeenCalledWith('@die+@saveMod', { die: '1d20', saveMod: -1 })
6161
expect(rollToMessageMock).toHaveBeenCalledWith({ flavor: 'SavesFortitude Save', speaker: actor })
6262

6363
actor.rollSavingThrow('ref')
6464
expect(Roll).toHaveBeenCalledTimes(2)
65-
expect(Roll).toHaveBeenCalledWith('1d20+@saveMod', { saveMod: 0 })
65+
expect(Roll).toHaveBeenCalledWith('@die+@saveMod', { die: '1d20', saveMod: 0 })
6666
expect(rollToMessageMock).toHaveBeenCalledWith({ flavor: 'SavesReflex Save', speaker: actor })
6767

6868
actor.rollSavingThrow('wil')
6969
expect(Roll).toHaveBeenCalledTimes(3)
70-
expect(Roll).toHaveBeenCalledWith('1d20+@saveMod', { saveMod: +12 })
70+
expect(Roll).toHaveBeenCalledWith('@die+@saveMod', { die: '1d20', saveMod: +12 })
7171
expect(rollToMessageMock).toHaveBeenCalledWith({ flavor: 'SavesWill Save', speaker: actor })
7272
})
7373

@@ -76,7 +76,7 @@ test('roll initiative', () => {
7676

7777
actor.rollInitiative()
7878
expect(Roll).toHaveBeenCalledTimes(1)
79-
expect(Roll).toHaveBeenCalledWith('1d20+@init', { init: -1 })
79+
expect(Roll).toHaveBeenCalledWith('@die+@init', { die: '1d20', init: -1 })
8080
expect(rollToMessageMock).toHaveBeenCalledWith({ flavor: 'Initiative', speaker: actor })
8181
})
8282

module/__tests__/npc-parser.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test('super snake', () => {
1313
'data.attributes.hp.value': '21',
1414
'data.attributes.hp.max': '21',
1515
'data.attributes.speed.value': '20’',
16-
'data.attributes.actionDice.value': '1d20',
16+
'data.config.actionDice': '1d20',
1717
'data.saves.frt.value': '+8',
1818
'data.saves.ref.value': '+4',
1919
'data.saves.wil.value': '+4',
@@ -44,7 +44,7 @@ test('pile of bones', () => {
4444
'data.attributes.hp.value': '3',
4545
'data.attributes.hp.max': '3',
4646
'data.attributes.speed.value': '5’',
47-
'data.attributes.actionDice.value': '1d20',
47+
'data.config.actionDice': '1d20',
4848
'data.saves.frt.value': '+0',
4949
'data.saves.ref.value': '-4',
5050
'data.saves.wil.value': '+1',
@@ -74,8 +74,8 @@ test('orcs', () => {
7474
'data.attributes.hp.value': '13',
7575
'data.attributes.hp.max': '13',
7676
'data.attributes.speed.value': '30’',
77-
'data.attributes.actionDice.value': '1d20',
7877
'data.attributes.special.value': 'none',
78+
'data.config.actionDice': '1d20',
7979
'data.saves.frt.value': '+3',
8080
'data.saves.ref.value': '+0',
8181
'data.saves.wil.value': '-1',
@@ -118,8 +118,8 @@ test('spider', () => {
118118
'data.attributes.hp.max': '20',
119119
'data.attributes.speed.value': '30’',
120120
'data.attributes.speed.other': 'climb 30’',
121-
'data.attributes.actionDice.value': '1d20',
122121
'data.attributes.special.value': 'poison (DC 14 Fort save or additional 3d4 damage and lose 1 point of Strength, 1d4 damage if successful), create web, filled with bats',
122+
'data.config.actionDice': '1d20',
123123
'data.saves.frt.value': '+2',
124124
'data.saves.ref.value': '+4',
125125
'data.saves.wil.value': '+0',
@@ -161,8 +161,8 @@ test('wedad', () => {
161161
'data.attributes.hp.value': '30',
162162
'data.attributes.hp.max': '30',
163163
'data.attributes.speed.value': 'none',
164-
'data.attributes.actionDice.value': '1d20',
165164
'data.attributes.special.value': 'takes 2x damage from fire, can attack targets up to 20’ away with tree limbs',
165+
'data.config.actionDice': '1d20',
166166
'data.saves.frt.value': '+6',
167167
'data.saves.ref.value': '-2',
168168
'data.saves.wil.value': '+4',
@@ -194,8 +194,8 @@ test('shortstats', () => {
194194
'data.attributes.hp.value': '4',
195195
'data.attributes.hp.max': '4',
196196
'data.attributes.speed.value': '30',
197-
'data.attributes.actionDice.value': '1d20',
198197
'data.attributes.special.value': '',
198+
'data.config.actionDice': '1d20',
199199
'data.saves.frt.value': '-2',
200200
'data.saves.ref.value': '+6',
201201
'data.saves.wil.value': '+4',
@@ -227,8 +227,8 @@ test('familiar', () => {
227227
'data.attributes.hp.value': '2',
228228
'data.attributes.hp.max': '2',
229229
'data.attributes.speed.value': '30',
230-
'data.attributes.actionDice.value': '1d20',
231230
'data.attributes.special.value': '',
231+
'data.config.actionDice': '1d20',
232232
'data.saves.frt.value': '+0',
233233
'data.saves.ref.value': '+0',
234234
'data.saves.wil.value': '+0',

0 commit comments

Comments
 (0)