From ba55933ea8304f110250317fcd28be3324b6ed0d Mon Sep 17 00:00:00 2001 From: Key Date: Fri, 17 Feb 2023 15:28:27 +0100 Subject: [PATCH 001/130] Added non magical- bludgeoning, piercing and slashing --- firebase-rules.json | 28 +-- .../hk-components/hk-dmg-type-select.vue | 8 +- src/components/npcs/Defenses.vue | 48 +++-- src/css/styles.scss | 9 + src/css/variables.scss | 6 +- src/utils/generalConstants.js | 18 +- src/views/UserContent/Players/Defenses.vue | 176 ------------------ src/views/UserContent/Players/EditPlayer.vue | 2 +- 8 files changed, 76 insertions(+), 219 deletions(-) delete mode 100644 src/views/UserContent/Players/Defenses.vue diff --git a/firebase-rules.json b/firebase-rules.json index 04159cb11..5b3c73a18 100644 --- a/firebase-rules.json +++ b/firebase-rules.json @@ -163,17 +163,17 @@ }, "damage_vulnerabilities": { "$vulnerabilityIndex": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" } }, "damage_resistances": { "$resistanceIndex": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" } }, "damage_immunities": { "$immunityIndex": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" } }, "condition_immunities": { @@ -461,17 +461,17 @@ "damage_vulnerabilities": { "$vulnerabilityIndex": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" } }, "damage_resistances": { "$resistanceIndex": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" } }, "damage_immunities": { "$immunityIndex": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" } }, "condition_immunities": { @@ -589,7 +589,7 @@ "rolls": { "$rollIndex": { "damage_type": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" }, "dice_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" @@ -601,7 +601,7 @@ ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" }, "versatile_damage_type": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" }, "versatile_dice_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" @@ -692,7 +692,7 @@ "rolls": { "$rollIndex": { "damage_type": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" }, "dice_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" @@ -704,7 +704,7 @@ ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" }, "versatile_damage_type": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" }, "versatile_dice_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" @@ -801,7 +801,7 @@ "rolls": { "$rollIndex": { "damage_type": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" }, "dice_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" @@ -813,7 +813,7 @@ ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" }, "versatile_damage_type": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" }, "versatile_dice_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" @@ -904,7 +904,7 @@ "rolls": { "$rollIndex": { "damage_type": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" }, "dice_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" @@ -916,7 +916,7 @@ ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" }, "versatile_damage_type": { - ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder)$/)" + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" }, "versatile_dice_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" diff --git a/src/components/hk-components/hk-dmg-type-select.vue b/src/components/hk-components/hk-dmg-type-select.vue index 87da812ad..2c0238602 100644 --- a/src/components/hk-components/hk-dmg-type-select.vue +++ b/src/components/hk-components/hk-dmg-type-select.vue @@ -18,7 +18,7 @@ @@ -96,6 +96,10 @@ } }, methods: { + typeLabel(value) { + value = value.split("_"); + return value.join(" ").capitalizeEach(); + }, filterTypes(val, update) { if (val === '') { update(() => { diff --git a/src/components/npcs/Defenses.vue b/src/components/npcs/Defenses.vue index df915c1fd..b4d3fad4f 100644 --- a/src/components/npcs/Defenses.vue +++ b/src/components/npcs/Defenses.vue @@ -14,7 +14,7 @@ autocomplete="off" multiple :options="damage_types" - v-model="npc[type]" + v-model="entity[type]" :hint="resistanceInfo(type)" > + @@ -52,17 +57,22 @@ class="mt-3 mb-2" multiple :options="condition_list" - v-model="npc.condition_immunities" + v-model="entity.condition_immunities" name="condition_immunities" > + Senses @@ -568,6 +571,11 @@ {{ roll.dice_count || "" }}{{ roll.dice_type ? `d${roll.dice_type}` : `` }} {{ roll_index+1 < action.action_list[0].rolls.length ? "+" : "" }} diff --git a/src/components/compendium/Monster.vue b/src/components/compendium/Monster.vue index bc13751cd..fcd578070 100644 --- a/src/components/compendium/Monster.vue +++ b/src/components/compendium/Monster.vue @@ -1,9 +1,5 @@
- {{ rolled.modifierRoll.roll }} + {{ rolled.rollResult.roll }}
- From 95de6bf21e04b383c3a96fd3ecefd3dff3644a49 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 5 Apr 2023 16:49:49 +0200 Subject: [PATCH 084/130] ReadOnly for mark down --- .../hk-action-rolls/hk-action-roll-form.vue | 11 ++++++++++- src/components/hk-components/hk-markdown-editor.vue | 7 ++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/hk-components/hk-action-rolls/hk-action-roll-form.vue b/src/components/hk-components/hk-action-rolls/hk-action-roll-form.vue index 19481e7ba..006b10c0d 100644 --- a/src/components/hk-components/hk-action-rolls/hk-action-roll-form.vue +++ b/src/components/hk-components/hk-action-rolls/hk-action-roll-form.vue @@ -1,7 +1,15 @@ diff --git a/src/components/compendium/Monster.vue b/src/components/compendium/Monster.vue index 02549c29a..38a90b387 100644 --- a/src/components/compendium/Monster.vue +++ b/src/components/compendium/Monster.vue @@ -322,7 +322,7 @@

{{ monster.name.capitalizeEach() }} can take {{ monster.legendary_count }} legendary actions, choosing from the options below. Only one legendary action option can be used - at a time and only at the end of another creature’s turn. {{ monster.name }} regains + at a time and only at the end of another creature's turn. {{ monster.name }} regains spent legendary actions at the start of their turn.

@@ -336,36 +336,9 @@ ability.action_list[0].rolls.length " > - - -

- - - {{ ability.name }} - - - - - - {{ i + 1 }} - - {{ getVersatile(ability, i) }} - - - - -
- - - + - + @@ -495,21 +468,9 @@ export default { }, methods: { ...mapActions("api_monsters", ["fetch_monster"]), - ...mapActions(["setActionRoll"]), setSize(size) { this.width = size.width; }, - getVersatile(ability, i) { - return ability[`versatile_${i ? "two" : "one"}`] || `Option ${i + 1}`; - }, - roll(e, action, versatile) { - const config = { - type: "monster_action", - versatile, - }; - console.log(action) - this.setActionRoll(this.rollAction(e, action, config)); - }, passivePerception() { return 10 + parseInt(this.skillModifier("wisdom", "perception")); }, diff --git a/src/components/contribute/spell/ViewSpell.vue b/src/components/contribute/spell/ViewSpell.vue index b083fa0a3..dbffd090e 100644 --- a/src/components/contribute/spell/ViewSpell.vue +++ b/src/components/contribute/spell/ViewSpell.vue @@ -83,22 +83,25 @@ - + - +
diff --git a/src/components/hk-components/hk-action-rolls/hk-roll-action.vue b/src/components/hk-components/hk-action-rolls/hk-roll-action.vue new file mode 100644 index 000000000..7e2c412f8 --- /dev/null +++ b/src/components/hk-components/hk-action-rolls/hk-roll-action.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/src/components/hk-components/hk-roll.vue b/src/components/hk-components/hk-roll.vue index f97a34a37..1b29b8ce6 100644 --- a/src/components/hk-components/hk-roll.vue +++ b/src/components/hk-components/hk-roll.vue @@ -1,18 +1,26 @@ \ No newline at end of file + }, + emit(e, advantage_disadvantage) { + this.$emit("roll", { e, advantage_disadvantage }); + }, + }, +}; + diff --git a/src/components/hk-components/hk-rolls/hk-single-roll.vue b/src/components/hk-components/hk-rolls/hk-single-roll.vue index 36ba6c9c6..ec595c470 100644 --- a/src/components/hk-components/hk-rolls/hk-single-roll.vue +++ b/src/components/hk-components/hk-rolls/hk-single-roll.vue @@ -670,7 +670,7 @@ export default { let total = parseInt(roll.rollResult.total); if (action.type === "save" && this.savingThrowResult[action_index] === "save") { - total = total * roll.missSave; + total = total * (roll.missSave || 0); } if (action.toHit && this.hitOrMiss[action_index] === "miss") { total = total * roll.missSave; diff --git a/src/components/npcs/Actions.vue b/src/components/npcs/Actions.vue index a17ebf380..12a53ab4d 100644 --- a/src/components/npcs/Actions.vue +++ b/src/components/npcs/Actions.vue @@ -90,36 +90,9 @@ ability.action_list[0].rolls " > - - - - - - {{ ability.name }} - - - - - {{ i + 1 }} - - {{ getVersatile(ability, i) }} - - - - - - - + - + {{ ability.name }} diff --git a/src/mixins/dice.js b/src/mixins/dice.js index c2a55a106..850a92ace 100644 --- a/src/mixins/dice.js +++ b/src/mixins/dice.js @@ -199,11 +199,15 @@ export const dice = { actions: [], }; - if (config.versatile !== undefined) { - returnRoll.name = - config.versatile === 0 - ? `${ability.name} (${ability.versatile_one || "Option 1"})` - : `${ability.name} (${ability.versatile_two || "Option 2"})`; + if (config.option !== undefined) { + if (ability.versatile) { + returnRoll.name = + config.option === 0 + ? `${ability.name} (${ability.versatile_one || "Option 1"})` + : `${ability.name} (${ability.versatile_two || "Option 2"})`; + } else if (ability.options && ability.options.length) { + returnRoll.name = `${ability.name} (${config.option})`; + } } // Check for advantage/disadvantage in the $event @@ -238,7 +242,7 @@ export const dice = { false, advantage_object ); - if (returnRoll.actions[i].toHit.throwsTotal >= 1) { + if (returnRoll.actions[i].toHit.throwsTotal >= 20) { returnRoll.actions[i].crit = true; crit = true; } @@ -268,9 +272,22 @@ export const dice = { : [roll.special]; let magical = !!roll.magical; + // Check for options + if (ability.options && config.option && roll.options && roll.options[config.option]) { + const option = roll.options[config.option]; + if (option.ignore) { + editableRoll = {}; + } else { + editableRoll.damage_type = option.damage_type || editableRoll.damage_type; + editableRoll.dice_type = option.dice_type || editableRoll.dice_type; + editableRoll.dice_count = option.dice_count || editableRoll.dice_count; + editableRoll.fixed_val = option.fixed_val || editableRoll.fixed_val; + magical = option.magical; + } + } // Check for versatile. 1 is the alternative option // Changes only have to be made if the versatile roll is the alternative (1) - if (config.versatile === 1) { + else if (ability.versatile && config.option === 1) { editableRoll.damage_type = roll.versatile_damage_type || editableRoll.damage_type; editableRoll.dice_type = roll.versatile_dice_type || editableRoll.dice_type; editableRoll.dice_count = roll.versatile_dice_count || editableRoll.dice_count; @@ -311,7 +328,7 @@ export const dice = { } // Double the rolled damage (without the modifier [throwsTotal]) - // simply add [trhowsTotal] once more to the [total] + // simply add [throwsTotal] once more to the [total] // Only when it's a crit and crit settings are set to double if (crit && this.critSettings === "double") { rollResult.total = rollResult.total + rollResult.throwsTotal; diff --git a/src/mixins/runEncounter.js b/src/mixins/runEncounter.js index 4f02b534a..ba5d3ad48 100644 --- a/src/mixins/runEncounter.js +++ b/src/mixins/runEncounter.js @@ -12,11 +12,11 @@ export const runEncounter = { methods: { ...mapActions(["setActionRoll", "set_limitedUses"]), ...mapActions("campaigns", ["set_share"]), - roll_action({ e, action_index, action, category, entity, targets, versatile = undefined }) { + roll_action({ e, action_index, action, category, entity, targets, option = undefined }) { let roll; const config = { type: "monster_action", - versatile, + option, }; // Roll once for AOE From 43b223fa944940bd3819f5ab94f1a51f802971c8 Mon Sep 17 00:00:00 2001 From: Harm Manders Date: Fri, 7 Apr 2023 15:58:01 +0200 Subject: [PATCH 094/130] remove unused attributes --- src/store/modules/userContent/players.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/store/modules/userContent/players.js b/src/store/modules/userContent/players.js index c316ffaa7..8200c4d70 100644 --- a/src/store/modules/userContent/players.js +++ b/src/store/modules/userContent/players.js @@ -32,15 +32,25 @@ function filterSkills(playerSkills) { } return returnArray; } +function filterUnusedAttributes(player) { + const unused_attributes = ["ac_bonus", "curHp", "tempHp", "maxHpMod"]; + + Object.keys(player).forEach((attribute) => { + if (unused_attributes.includes(attribute)) { + player[attribute] = null; + } + }); + return player; +} function parseInts(player) { - for (const [key, value] of Object.entries(player)) { + Object.entries(player).forEach(([key, value]) => { if (numberValues.includes(key) && value !== undefined && value !== null && value !== "") { player[key] = parseInt(value); } if (numberValues.includes(key) && value === "") { player[key] = null; } - } + }); return player; } @@ -244,6 +254,7 @@ const player_actions = { throw "Not enough slots"; } try { + player = filterUnusedAttributes(player); player = parseInts(player); if (player.skills) { @@ -297,6 +308,7 @@ const player_actions = { if (uid) { const services = await dispatch("get_player_services"); try { + player = filterUnusedAttributes(player); player = parseInts(player); if (player.skills) { From 9cb6b872a487e9e5b64710b69aa9734eac826eae Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 7 Apr 2023 16:21:08 +0200 Subject: [PATCH 095/130] Add options for monster actions --- firebase-rules.json | 108 +++++++++++++ .../hk-action-rolls/hk-action-roll-form.vue | 9 +- src/components/npcs/Actions.vue | 144 ++++++++---------- src/components/spells/Actions.vue | 2 +- src/mixins/dice.js | 8 +- 5 files changed, 185 insertions(+), 86 deletions(-) diff --git a/firebase-rules.json b/firebase-rules.json index 0126d1877..b4ad59175 100644 --- a/firebase-rules.json +++ b/firebase-rules.json @@ -602,6 +602,11 @@ "versatile_two": { ".validate": "newData.isString() && newData.val().length <= 25" }, + "options": { + "$optionIndex": { + ".validate": "newData.isString() && newData.val().length <= 30" + } + }, "action_list": { "$listIndex": { "type": { @@ -648,6 +653,28 @@ "versatile_fixed_val": { ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" }, + "options": { + "$optionKey": { + "damage_type": { + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" + }, + "magical": { + ".validate": "newData.isBoolean()" + }, + "dice_count": { + ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" + }, + "dice_type": { + ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 20" + }, + "fixed_val": { + ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" + }, + "ignore": { + ".validate": "newData.isBoolean()" + } + } + }, "projectile_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" }, @@ -711,6 +738,11 @@ "versatile_two": { ".validate": "newData.isString() && newData.val().length <= 25" }, + "options": { + "$optionIndex": { + ".validate": "newData.isString() && newData.val().length <= 30" + } + }, "action_list": { "$listIndex": { "type": { @@ -757,6 +789,28 @@ "versatile_fixed_val": { ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" }, + "options": { + "$optionKey": { + "damage_type": { + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" + }, + "magical": { + ".validate": "newData.isBoolean()" + }, + "dice_count": { + ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" + }, + "dice_type": { + ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 20" + }, + "fixed_val": { + ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" + }, + "ignore": { + ".validate": "newData.isBoolean()" + } + } + }, "projectile_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" }, @@ -826,6 +880,11 @@ "versatile_two": { ".validate": "newData.isString() && newData.val().length <= 25" }, + "options": { + "$optionIndex": { + ".validate": "newData.isString() && newData.val().length <= 30" + } + }, "action_list": { "$listIndex": { "type": { @@ -872,6 +931,28 @@ "versatile_fixed_val": { ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" }, + "options": { + "$optionKey": { + "damage_type": { + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" + }, + "magical": { + ".validate": "newData.isBoolean()" + }, + "dice_count": { + ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" + }, + "dice_type": { + ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 20" + }, + "fixed_val": { + ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" + }, + "ignore": { + ".validate": "newData.isBoolean()" + } + } + }, "projectile_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" }, @@ -935,6 +1016,11 @@ "versatile_two": { ".validate": "newData.isString() && newData.val().length <= 25" }, + "options": { + "$optionIndex": { + ".validate": "newData.isString() && newData.val().length <= 30" + } + }, "action_list": { "$listIndex": { "type": { @@ -981,6 +1067,28 @@ "versatile_fixed_val": { ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" }, + "options": { + "$optionKey": { + "damage_type": { + ".validate": "newData.isString() && newData.val().matches(/^(acid|bludgeoning|cold|fire|force|lightning|necrotic|piercing|poison|psychic|radiant|slashing|thunder|non_magical_bludgeoning|non_magical_piercing|non_magical_slashing)$/)" + }, + "magical": { + ".validate": "newData.isBoolean()" + }, + "dice_count": { + ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" + }, + "dice_type": { + ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 20" + }, + "fixed_val": { + ".validate": "newData.isNumber() && newData.val() >= -99 && newData.val() <= 99" + }, + "ignore": { + ".validate": "newData.isBoolean()" + } + } + }, "projectile_count": { ".validate": "newData.isNumber() && newData.val() >= 1 && newData.val() <= 99" }, diff --git a/src/components/hk-components/hk-action-rolls/hk-action-roll-form.vue b/src/components/hk-components/hk-action-rolls/hk-action-roll-form.vue index be431f331..78a2d4094 100644 --- a/src/components/hk-components/hk-action-rolls/hk-action-roll-form.vue +++ b/src/components/hk-components/hk-action-rolls/hk-action-roll-form.vue @@ -8,7 +8,11 @@ Description - +
- -
-
- -
- -
+ + + +