}
- * @protected
- */
- async _prepareNotesContext(context, _options) {
- const { system } = this.document;
- const { TextEditor } = foundry.applications.ux;
-
- const paths = {
- notes: 'notes'
- };
-
- for (const [key, path] of Object.entries(paths)) {
- const value = foundry.utils.getProperty(system, path);
- context[key] = {
- field: system.schema.getField(path),
- value,
- enriched: await TextEditor.implementation.enrichHTML(value, {
- secrets: this.document.isOwner,
- relativeTo: this.document
- })
- };
- }
- }
-}
diff --git a/module/applications/ui/chatLog.mjs b/module/applications/ui/chatLog.mjs
index 7036a5df..34b25591 100644
--- a/module/applications/ui/chatLog.mjs
+++ b/module/applications/ui/chatLog.mjs
@@ -103,19 +103,6 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
_getEntryContextOptions() {
return [
...super._getEntryContextOptions(),
- {
- label: 'DAGGERHEART.UI.ChatLog.rerollActionRoll',
- icon: ' ',
- visible: li => {
- const message = game.messages.get(li.dataset.messageId);
- return message.system.hasRoll && (game.user.isGM || message.isAuthor);
- },
- callback: async li => {
- const message = game.messages.get(li.dataset.messageId);
- const reroll = await message.rolls[0].reroll({ liveRoll: true });
- message.update({ rolls: [reroll] });
- }
- },
{
label: 'DAGGERHEART.UI.ChatLog.rerollDamage',
icon: ' ',
@@ -126,10 +113,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
: false;
return (game.user.isGM || message.isAuthor) && hasRolledDamage;
},
- callback: async li => {
+ callback: li => {
const message = game.messages.get(li.dataset.messageId);
- const update = await message.system.getRerolledDamage();
- message.update(update);
+ new game.system.api.applications.dialogs.RerollDamageDialog(message).render({ force: true });
}
}
];
diff --git a/module/data/actor/_module.mjs b/module/data/actor/_module.mjs
index 1fe1ef3f..99577620 100644
--- a/module/data/actor/_module.mjs
+++ b/module/data/actor/_module.mjs
@@ -1,17 +1,15 @@
import DhCharacter from './character.mjs';
import DhCompanion from './companion.mjs';
import DhAdversary from './adversary.mjs';
-import DhNPC from './npc.mjs';
import DhEnvironment from './environment.mjs';
import DhParty from './party.mjs';
-export { DhCharacter, DhCompanion, DhAdversary, DhNPC, DhEnvironment, DhParty };
+export { DhCharacter, DhCompanion, DhAdversary, DhEnvironment, DhParty };
export const config = {
character: DhCharacter,
companion: DhCompanion,
adversary: DhAdversary,
- npc: DhNPC,
environment: DhEnvironment,
party: DhParty
};
diff --git a/module/data/actor/adversary.mjs b/module/data/actor/adversary.mjs
index d6d0dcdf..d69e17ad 100644
--- a/module/data/actor/adversary.mjs
+++ b/module/data/actor/adversary.mjs
@@ -3,7 +3,8 @@ import { ActionField } from '../fields/actionField.mjs';
import { commonActorRules } from './base.mjs';
import DhCreature from './creature.mjs';
import { bonusField } from '../fields/actorField.mjs';
-import { getTierAdjustedAdversary } from './tierAdjustment.mjs';
+import { calculateExpectedValue, parseTermsFromSimpleFormula } from '../../helpers/utils.mjs';
+import { adversaryExpectedDamage, adversaryScalingData } from '../../config/actorConfig.mjs';
export default class DhpAdversary extends DhCreature {
static LOCALIZATION_PREFIXES = ['DAGGERHEART.ACTORS.Adversary'];
@@ -205,6 +206,205 @@ export default class DhpAdversary extends DhCreature {
/** Returns source data for this actor adjusted to a new tier, which can be used to create a new actor. */
adjustForTier(tier) {
const source = this.parent.toObject(true);
- return getTierAdjustedAdversary(source, tier);
+
+ /** @type {(2 | 3 | 4)[]} */
+ const tiers = new Array(Math.abs(tier - this.tier))
+ .fill(0)
+ .map((_, idx) => idx + Math.min(tier, this.tier) + 1);
+ if (tier < this.tier) tiers.reverse();
+ const typeData = adversaryScalingData[source.system.type] ?? adversaryScalingData[source.system.standard];
+ const tierEntries = tiers.map(t => ({ tier: t, ...typeData[t] }));
+
+ // Apply simple tier changes
+ const scale = tier > this.tier ? 1 : -1;
+ for (const entry of tierEntries) {
+ source.system.difficulty += scale * entry.difficulty;
+ source.system.damageThresholds.major += scale * entry.majorThreshold;
+ source.system.damageThresholds.severe += scale * entry.severeThreshold;
+ source.system.resources.hitPoints.max += scale * entry.hp;
+ source.system.resources.stress.max += scale * entry.stress;
+ source.system.attack.roll.bonus += scale * entry.attack;
+ }
+
+ // Get the mean and standard deviation of expected damage in the previous and new tier
+ // The data we have is for attack scaling, but we reuse this for action scaling later
+ const expectedDamageData = adversaryExpectedDamage[source.system.type] ?? adversaryExpectedDamage.basic;
+ const damageMeta = {
+ currentDamageRange: { tier: source.system.tier, ...expectedDamageData[source.system.tier] },
+ newDamageRange: { tier, ...expectedDamageData[tier] },
+ type: 'attack'
+ };
+
+ // Update damage of base attack
+ try {
+ this.#adjustActionDamage(source.system.attack, damageMeta);
+ } catch (err) {
+ ui.notifications.warn('Failed to convert attack damage of adversary');
+ console.error(err);
+ }
+
+ // Update damage of each item action, making sure to also update the description if possible
+ const damageRegex = /@Damage\[([^\[\]]*)\]({[^}]*})?/g;
+ for (const item of source.items) {
+ // Replace damage inlines with new formulas
+ for (const withDescription of [item.system, ...Object.values(item.system.actions)]) {
+ withDescription.description = withDescription.description.replace(damageRegex, (match, inner) => {
+ const { value: formula } = parseInlineParams(inner);
+ if (!formula || !type) return match;
+
+ try {
+ const adjusted = this.#calculateAdjustedDamage(formula, { ...damageMeta, type: 'action' });
+ const newFormula = [
+ adjusted.diceQuantity ? `${adjusted.diceQuantity}d${adjusted.faces}` : null,
+ adjusted.bonus
+ ]
+ .filter(p => !!p)
+ .join('+');
+ return match.replace(formula, newFormula);
+ } catch {
+ return match;
+ }
+ });
+ }
+
+ // Update damage in item actions
+ // Parse damage, and convert all formula matches in the descriptions to the new damage
+ for (const action of Object.values(item.system.actions)) {
+ try {
+ const result = this.#adjustActionDamage(action, { ...damageMeta, type: 'action' });
+ if (!result) continue;
+
+ for (const { previousFormula, formula } of Object.values(result)) {
+ const oldFormulaRegexp = new RegExp(
+ previousFormula.replace(' ', '').replace('+', '(?:\\s)?\\+(?:\\s)?')
+ );
+ item.system.description = item.system.description.replace(oldFormulaRegexp, formula);
+ action.description = action.description.replace(oldFormulaRegexp, formula);
+ }
+ } catch (err) {
+ ui.notifications.warn(`Failed to convert action damage for item ${item.name}`);
+ console.error(err);
+ }
+ }
+ }
+
+ // Finally set the tier of the source data, now that everything is complete
+ source.system.tier = tier;
+ return source;
+ }
+
+ /**
+ * Converts a damage object to a new damage range
+ * @returns {{ diceQuantity: number; faces: number; bonus: number }} the adjusted result as a combined term
+ * @throws error if the formula is the wrong type
+ */
+ #calculateAdjustedDamage(formula, { currentDamageRange, newDamageRange, type }) {
+ const terms = parseTermsFromSimpleFormula(formula);
+ const flatTerms = terms.filter(t => t.diceQuantity === 0);
+ const diceTerms = terms.filter(t => t.diceQuantity > 0);
+ if (flatTerms.length > 1 || diceTerms.length > 1) {
+ throw new Error('invalid formula for conversion');
+ }
+ const value = {
+ ...(diceTerms[0] ?? { diceQuantity: 0, faces: 1 }),
+ bonus: flatTerms[0]?.bonus ?? 0
+ };
+ const previousExpected = calculateExpectedValue(value);
+ if (previousExpected === 0) return value; // nothing to do
+
+ const dieSizes = [4, 6, 8, 10, 12, 20];
+ const steps = newDamageRange.tier - currentDamageRange.tier;
+ const increasing = steps > 0;
+ const deviation = (previousExpected - currentDamageRange.mean) / currentDamageRange.deviation;
+ const expected = Math.max(1, newDamageRange.mean + newDamageRange.deviation * deviation);
+
+ // If this was just a flat number, convert to the expected damage and exit
+ if (value.diceQuantity === 0) {
+ value.bonus = Math.round(expected);
+ return value;
+ }
+
+ const getExpectedDie = () => calculateExpectedValue({ diceQuantity: 1, faces: value.faces }) || 1;
+ const getBaseAverage = () => calculateExpectedValue({ ...value, bonus: 0 });
+
+ // Check the number of base overages over the expected die. In the end, if the bonus inflates too much, we add a die
+ const baseOverages = Math.floor(value.bonus / getExpectedDie());
+
+ // Prestep. Change number of dice for attacks, bump up/down for actions
+ // We never bump up to d20, though we might bump down from it
+ if (type === 'attack') {
+ const minimum = increasing ? value.diceQuantity : 0;
+ value.diceQuantity = Math.max(minimum, newDamageRange.tier);
+ } else {
+ const currentIdx = dieSizes.indexOf(value.faces);
+ value.faces = dieSizes[Math.clamp(currentIdx + steps, 0, 4)];
+ }
+
+ value.bonus = Math.round(expected - getBaseAverage());
+
+ // Attempt to handle negative values.
+ // If we can do it with only step downs, do so. Otherwise remove tier dice, and try again
+ if (value.bonus < 0) {
+ let stepsRequired = Math.ceil(Math.abs(value.bonus) / value.diceQuantity);
+ const currentIdx = dieSizes.indexOf(value.faces);
+
+ // If step downs alone don't suffice, change the flat modifier, then calculate steps required again
+ // If this isn't sufficient, the result will be slightly off. This is unlikely to happen
+ if (type !== 'attack' && stepsRequired > currentIdx && value.diceQuantity > 0) {
+ value.diceQuantity -= increasing ? 1 : Math.abs(steps);
+ value.bonus = Math.round(expected - getBaseAverage());
+ if (value.bonus >= 0) return value; // complete
+ }
+
+ stepsRequired = Math.ceil(Math.abs(value.bonus) / value.diceQuantity);
+ value.faces = dieSizes[Math.max(0, currentIdx - stepsRequired)];
+ value.bonus = Math.max(0, Math.round(expected - getBaseAverage()));
+ }
+
+ // If value is really high, we add a number of dice based on the number of overages
+ // This attempts to preserve a similar amount of variance when increasing an action
+ const overagesToRemove = Math.floor(value.bonus / getExpectedDie()) - baseOverages;
+ if (type !== 'attack' && increasing && overagesToRemove > 0) {
+ value.diceQuantity += overagesToRemove;
+ value.bonus = Math.round(expected - getBaseAverage());
+ }
+
+ return value;
+ }
+
+ /**
+ * Updates damage to reflect a specific value.
+ * @throws if damage structure is invalid for conversion
+ * @returns the converted formula and value as a simplified term, or null if it doesn't deal HP damage
+ */
+ #adjustActionDamage(action, damageMeta) {
+ if (!action.damage?.parts.hitPoints) return null;
+
+ const result = {};
+ for (const property of ['value', 'valueAlt']) {
+ const data = action.damage.parts.hitPoints[property];
+ const previousFormula = data.custom.enabled
+ ? data.custom.formula
+ : [data.flatMultiplier ? `${data.flatMultiplier}${data.dice}` : 0, data.bonus ?? 0]
+ .filter(p => !!p)
+ .join('+');
+ const value = this.#calculateAdjustedDamage(previousFormula, damageMeta);
+ const formula = [value.diceQuantity ? `${value.diceQuantity}d${value.faces}` : null, value.bonus]
+ .filter(p => !!p)
+ .join('+');
+ if (value.diceQuantity) {
+ data.custom.enabled = false;
+ data.bonus = value.bonus;
+ data.dice = `d${value.faces}`;
+ data.flatMultiplier = value.diceQuantity;
+ } else if (!value.diceQuantity) {
+ data.custom.enabled = true;
+ data.custom.formula = formula;
+ }
+
+ result[property] = { previousFormula, formula, value };
+ }
+
+ return result;
}
}
diff --git a/module/data/actor/npc.mjs b/module/data/actor/npc.mjs
deleted file mode 100644
index 2ccaf926..00000000
--- a/module/data/actor/npc.mjs
+++ /dev/null
@@ -1,43 +0,0 @@
-import DHNPCSettings from '../../applications/sheets-configs/npc-settings.mjs';
-import BaseDataActor from './base.mjs';
-
-export default class DhpNPC extends BaseDataActor {
- static LOCALIZATION_PREFIXES = ['DAGGERHEART.ACTORS.NPC'];
-
- static get metadata() {
- return foundry.utils.mergeObject(super.metadata, {
- label: 'TYPES.Actor.npc',
- type: 'npc',
- settingSheet: DHNPCSettings,
- hasResistances: false,
- hasAttribution: true
- });
- }
-
- static defineSchema() {
- const fields = foundry.data.fields;
- return {
- ...super.defineSchema(),
- difficulty: new fields.NumberField({
- nullable: true,
- initial: null,
- integer: true,
- label: 'DAGGERHEART.GENERAL.difficulty'
- }),
- description: new fields.HTMLField({ label: 'DAGGERHEART.GENERAL.description' }),
- motives: new fields.StringField(),
- notes: new fields.HTMLField()
- };
- }
-
- /**@inheritdoc */
- static DEFAULT_ICON = 'systems/daggerheart/assets/icons/documents/actors/drama-masks.svg';
-
- get features() {
- return this.parent.items.filter(x => x.type === 'feature');
- }
-
- isItemValid(source) {
- return super.isItemValid(source) || source.type === 'feature';
- }
-}
diff --git a/module/data/actor/tierAdjustment.mjs b/module/data/actor/tierAdjustment.mjs
deleted file mode 100644
index 785eec2b..00000000
--- a/module/data/actor/tierAdjustment.mjs
+++ /dev/null
@@ -1,218 +0,0 @@
-import { calculateExpectedValue, parseTermsFromSimpleFormula } from '../../helpers/utils.mjs';
-import { adversaryExpectedDamage, adversaryScalingData } from '../../config/actorConfig.mjs';
-
-export function getTierAdjustedAdversary(source, tier) {
- const currentTier = source.tier ?? 1;
-
- /** @type {(2 | 3 | 4)[]} */
- const tiers = new Array(Math.abs(tier - currentTier))
- .fill(0)
- .map((_, idx) => idx + Math.min(tier, currentTier) + 1);
- if (tier < currentTier) tiers.reverse();
- const typeData = adversaryScalingData[source.system.type] ?? adversaryScalingData[source.system.standard];
- const tierEntries = tiers.map(t => ({ tier: t, ...typeData[t] }));
-
- // Apply simple tier changes
- const scale = tier > currentTier ? 1 : -1;
- for (const entry of tierEntries) {
- source.system.difficulty += scale * entry.difficulty;
- source.system.damageThresholds.major += scale * entry.majorThreshold;
- source.system.damageThresholds.severe += scale * entry.severeThreshold;
- source.system.resources.hitPoints.max += scale * entry.hp;
- source.system.resources.stress.max += scale * entry.stress;
- source.system.attack.roll.bonus += scale * entry.attack;
- }
-
- // Get the mean and standard deviation of expected damage in the previous and new tier
- // The data we have is for attack scaling, but we reuse this for action scaling later
- const expectedDamageData = adversaryExpectedDamage[source.system.type] ?? adversaryExpectedDamage.basic;
- const damageMeta = {
- currentDamageRange: { tier: source.system.tier, ...expectedDamageData[source.system.tier] },
- newDamageRange: { tier, ...expectedDamageData[tier] }
- };
-
- // Store initial attack damage for abilities that have you deal a "standard attack"
- const initialAttack = {
- type: source.system.attack.damage?.parts.hitPoints?.type?.toSorted(),
- value: getDamagePartsFormula(source.system.attack.damage?.parts.hitPoints?.value)
- };
-
- // Update damage of base attack.
- try {
- const damage = source.system.attack.damage;
- if (!damage?.parts.hitPoints) throw new Error('Unexpected missing attack in adversary');
-
- for (const property of ['value', 'valueAlt']) {
- const data = damage.parts.hitPoints[property];
- const previousFormula = getDamagePartsFormula(data);
- const { value, formula } = calculateAdjustedDamage(previousFormula, 'attack', damageMeta);
- applyAdjustedDamage(data, value, formula);
- }
- } catch (err) {
- ui.notifications.warn('Failed to convert attack damage of adversary');
- console.error(err);
- }
-
- // Update damage of each item action, making sure to also update the description if possible
- const damageRegex = /@Damage\[([^\[\]]*)\]({[^}]*})?/g;
- for (const item of source.items) {
- // Replace damage inlines with new formulas. Keep a record for a specific check later
- const descriptionFormulas = [];
- for (const withDescription of [item.system, ...Object.values(item.system.actions)]) {
- withDescription.description = withDescription.description.replace(damageRegex, (match, inner) => {
- const { value: formula } = parseInlineParams(inner);
- if (!formula || !type) return match;
-
- try {
- const newFormula = calculateAdjustedDamage(formula, 'action', damageMeta)?.formula;
- descriptionFormulas.push(formula);
- return match.replace(formula, newFormula);
- } catch {
- return match;
- }
- });
- }
-
- // Update damage in item actions and convert all formula matches in the descriptions to the new damage
- for (const action of Object.values(item.system.actions)) {
- if (!action.damage?.parts.hitPoints) continue;
- try {
- // Apply conversions and save a record. If it matches attack damage *and* Its not in the description, use attack conversion instead
- const result = [];
- for (const property of ['value', 'valueAlt']) {
- const { [property]: data, type: damageType } = action.damage.parts.hitPoints;
- const previousFormula = getDamagePartsFormula(data);
- const isActuallyAttack =
- previousFormula === initialAttack.value &&
- foundry.utils.equals(damageType.toSorted(), initialAttack.type) &&
- !descriptionFormulas.includes(previousFormula);
- const type = isActuallyAttack ? 'attack' : 'action';
- const { value, formula } = calculateAdjustedDamage(previousFormula, type, damageMeta);
- applyAdjustedDamage(data, value, formula);
- result.push({ previousFormula, formula });
- }
-
- // Override text in the description with those values
- for (const { previousFormula, formula } of Object.values(result)) {
- const oldFormulaRegexp = new RegExp(
- previousFormula.replace(' ', '').replace('+', '(?:\\s)?\\+(?:\\s)?')
- );
- item.system.description = item.system.description.replace(oldFormulaRegexp, formula);
- action.description = action.description.replace(oldFormulaRegexp, formula);
- }
- } catch (err) {
- ui.notifications.warn(`Failed to convert action damage for item ${item.name}`);
- console.error(err);
- }
- }
- }
-
- // Finally set the tier of the source data, now that everything is complete
- source.system.tier = tier;
- return source;
-}
-
-/**
- * Converts a damage object to a new damage range
- * @returns {{ diceQuantity: number; faces: number; bonus: number }} the adjusted result as a combined term
- * @throws error if the formula is the wrong type
- */
-function calculateAdjustedDamage(formula, type, { currentDamageRange, newDamageRange }) {
- const terms = parseTermsFromSimpleFormula(formula);
- const flatTerms = terms.filter(t => t.diceQuantity === 0);
- const diceTerms = terms.filter(t => t.diceQuantity > 0);
- if (flatTerms.length > 1 || diceTerms.length > 1) {
- throw new Error('invalid formula for conversion');
- }
- const value = {
- ...(diceTerms[0] ?? { diceQuantity: 0, faces: 1 }),
- bonus: flatTerms[0]?.bonus ?? 0
- };
- const previousExpected = calculateExpectedValue(value);
- if (previousExpected === 0) return value; // nothing to do
-
- const dieSizes = [4, 6, 8, 10, 12, 20];
- const steps = newDamageRange.tier - currentDamageRange.tier;
- const increasing = steps > 0;
- const deviation = (previousExpected - currentDamageRange.mean) / currentDamageRange.deviation;
- const expected = Math.max(1, newDamageRange.mean + newDamageRange.deviation * deviation);
-
- // If this was just a flat number, convert to the expected damage and exit
- if (value.diceQuantity === 0) {
- value.bonus = Math.round(expected);
- return value;
- }
-
- const getExpectedDie = () => calculateExpectedValue({ diceQuantity: 1, faces: value.faces }) || 1;
- const getBaseAverage = () => calculateExpectedValue({ ...value, bonus: 0 });
-
- // Check the number of base overages over the expected die. In the end, if the bonus inflates too much, we add a die
- const baseOverages = Math.floor(value.bonus / getExpectedDie());
-
- // Prestep. Change number of dice for attacks, bump up/down for actions
- // We never bump up to d20, though we might bump down from it
- if (type === 'attack') {
- const minimum = increasing ? value.diceQuantity : 0;
- value.diceQuantity = Math.max(minimum, newDamageRange.tier);
- } else {
- const currentIdx = dieSizes.indexOf(value.faces);
- value.faces = dieSizes[Math.clamp(currentIdx + steps, 0, 4)];
- }
-
- value.bonus = Math.round(expected - getBaseAverage());
-
- // Attempt to handle negative values.
- // If we can do it with only step downs, do so. Otherwise remove tier dice, and try again
- if (value.bonus < 0) {
- let stepsRequired = Math.ceil(Math.abs(value.bonus) / value.diceQuantity);
- const currentIdx = dieSizes.indexOf(value.faces);
-
- // If step downs alone don't suffice, change the flat modifier, then calculate steps required again
- // If this isn't sufficient, the result will be slightly off. This is unlikely to happen
- if (type !== 'attack' && stepsRequired > currentIdx && value.diceQuantity > 0) {
- value.diceQuantity -= increasing ? 1 : Math.abs(steps);
- value.bonus = Math.round(expected - getBaseAverage());
- if (value.bonus >= 0) return value; // complete
- }
-
- stepsRequired = Math.ceil(Math.abs(value.bonus) / value.diceQuantity);
- value.faces = dieSizes[Math.max(0, currentIdx - stepsRequired)];
- value.bonus = Math.max(0, Math.round(expected - getBaseAverage()));
- }
-
- // If value is really high, we add a number of dice based on the number of overages
- // This attempts to preserve a similar amount of variance when increasing an action
- const overagesToRemove = Math.floor(value.bonus / getExpectedDie()) - baseOverages;
- if (type !== 'attack' && increasing && overagesToRemove > 0) {
- value.diceQuantity += overagesToRemove;
- value.bonus = Math.round(expected - getBaseAverage());
- }
-
- const newFormula = [value.diceQuantity ? `${value.diceQuantity}d${value.faces}` : null, value.bonus]
- .filter(p => !!p)
- .join('+');
- return { value, formula: newFormula };
-}
-
-function getDamagePartsFormula(data) {
- return data.custom.enabled
- ? data.custom.formula
- : [data.flatMultiplier ? `${data.flatMultiplier}${data.dice}` : 0, data.bonus ?? 0].filter(p => !!p).join('+');
-}
-
-/**
- * Updates damage to reflect a specific value.
- * @throws if damage structure is invalid for conversion
- * @returns the converted formula and value as a simplified term, or null if it doesn't deal HP damage
- */
-function applyAdjustedDamage(diceData, value, formula) {
- if (value.diceQuantity) {
- diceData.custom.enabled = false;
- diceData.bonus = value.bonus;
- diceData.dice = `d${value.faces}`;
- diceData.flatMultiplier = value.diceQuantity;
- } else if (!value.diceQuantity) {
- diceData.custom.enabled = true;
- diceData.custom.formula = formula;
- }
-}
diff --git a/module/data/chat-message/actorRoll.mjs b/module/data/chat-message/actorRoll.mjs
index ccfe25ea..eaa1cdc2 100644
--- a/module/data/chat-message/actorRoll.mjs
+++ b/module/data/chat-message/actorRoll.mjs
@@ -1,5 +1,3 @@
-import { triggerChatRollFx } from '../../helpers/utils.mjs';
-
const fields = foundry.data.fields;
const targetsField = () =>
@@ -132,35 +130,6 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
});
}
- /* TODO: Change how damage data is stored somehow to enable better rerolling */
- async getRerolledDamage() {
- if (!this.damage) return;
-
- const rerolls = [];
- const update = { system: { damage: {} } };
- for (const partKey in this.damage) {
- const part = this.damage[partKey];
- const testRoll = Roll.fromData(part.parts[0].roll);
- const rerolled = await testRoll.reroll();
- rerolls.push(rerolled);
-
- if (!update.system.damage[partKey]) update.system.damage[partKey] = { parts: [part.parts[0]] };
- const partData = update.system.damage[partKey].parts[0];
- update.system.damage[partKey].total = rerolled.total;
- partData.modifierTotal = rerolled.terms.reduce((acc, x) => {
- if (x.isDeterministic && !x.operator) acc += x.total;
- return acc;
- }, 0);
- partData.dice = rerolled.dice.map(d => ({ ...d.toJSON(), dice: d.denomination }));
- partData.total = rerolled.total;
- partData.roll = rerolled.toJSON();
- }
-
- await triggerChatRollFx(rerolls);
-
- return update;
- }
-
registerTargetHook() {
if (!this.parent.isAuthor || !this.hasTarget) return;
if (this.targetMode && this.parent.targetHook !== null) {
diff --git a/module/data/fields/action/damageField.mjs b/module/data/fields/action/damageField.mjs
index 9b21d3ba..30a5ad7c 100644
--- a/module/data/fields/action/damageField.mjs
+++ b/module/data/fields/action/damageField.mjs
@@ -72,6 +72,9 @@ export default class DamageField extends fields.SchemaField {
damageConfig.source.message = messageId;
damageConfig.directDamage = !!damageConfig.source?.message;
+ // if(damageConfig.source?.message && game.modules.get('dice-so-nice')?.active)
+ // await game.dice3d.waitFor3DAnimationByMessageID(damageConfig.source.message);
+
const damageResult = await CONFIG.Dice.daggerheart.DamageRoll.build(damageConfig);
if (!damageResult) return false;
if (damageResult.actionChatMessageHandled) config.actionChatMessageHandled = true;
diff --git a/module/data/fields/action/summonField.mjs b/module/data/fields/action/summonField.mjs
index a2275fa5..ec7881f7 100644
--- a/module/data/fields/action/summonField.mjs
+++ b/module/data/fields/action/summonField.mjs
@@ -1,4 +1,4 @@
-import { itemAbleRollParse, triggerChatRollFx } from '../../../helpers/utils.mjs';
+import { itemAbleRollParse } from '../../../helpers/utils.mjs';
import FormulaField from '../formulaField.mjs';
const fields = foundry.data.fields;
@@ -40,7 +40,7 @@ export default class DHSummonField extends fields.ArrayField {
const roll = new Roll(itemAbleRollParse(summon.count, this.actor, this.item));
await roll.evaluate();
const count = roll.total;
- if (!roll.isDeterministic) rolls.push(roll);
+ if (!roll.isDeterministic && game.modules.get('dice-so-nice')?.active) rolls.push(roll);
const actor = await DHSummonField.getWorldActor(await foundry.utils.fromUuid(summon.actorUUID));
/* Extending summon data in memory so it's available in actionField.toChat. Think it's harmless, but ugly. Could maybe find a better way. */
@@ -56,7 +56,7 @@ export default class DHSummonField extends fields.ArrayField {
}
}
- if (rolls.length) await triggerChatRollFx(rolls);
+ if (rolls.length) await Promise.all(rolls.map(roll => game.dice3d.showForRoll(roll, game.user, true)));
this.actor.sheet?.minimize();
DHSummonField.handleSummon(summonData, this.actor);
diff --git a/module/data/item/class.mjs b/module/data/item/class.mjs
index 470a1e3c..7014e011 100644
--- a/module/data/item/class.mjs
+++ b/module/data/item/class.mjs
@@ -2,7 +2,7 @@ import BaseDataItem from './base.mjs';
import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs';
import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs';
import ItemLinkFields from '../fields/itemLinkFields.mjs';
-import { addLinkedItemsDiff, fromUuids, getFeaturesHTMLData, updateLinkedItemApps } from '../../helpers/utils.mjs';
+import { addLinkedItemsDiff, getFeaturesHTMLData, updateLinkedItemApps } from '../../helpers/utils.mjs';
export default class DHClass extends BaseDataItem {
/** @inheritDoc */
@@ -73,16 +73,15 @@ export default class DHClass extends BaseDataItem {
const uuids = [this.parent.uuid, this.parent._stats?.compendiumSource].filter(u => !!u);
const subclasses = game.items.filter(x => x.type === 'subclass' && uuids.includes(x.system.linkedClass));
for (const pack of game.packs) {
- const packIds = [];
const indexes = await pack.getIndex({ fields: ['system.linkedClass'] });
for (const index of indexes) {
if (index.type !== 'subclass') continue;
if (!uuids.includes(index.system?.linkedClass)) continue;
if (subclasses.find(x => x.uuid === index.uuid)) continue;
- packIds.push(index._id);
- }
- if (packIds.length > 0) subclasses.push(...(await pack.getDocuments({ _id__in: packIds })));
+ const subclass = await foundry.utils.fromUuid(index.uuid);
+ subclasses.push(subclass);
+ }
}
return subclasses;
@@ -217,10 +216,6 @@ export default class DHClass extends BaseDataItem {
classItems.push(contentLink.outerHTML);
}
- // Preload all class features for acquisition from the cache
- // todo: make feature acquisition async and replace feature helpers for methods
- await fromUuids(this._source.features.map(f => f.item));
-
const hopeFeatures = await getFeaturesHTMLData(this.hopeFeatures);
const classFeatures = await getFeaturesHTMLData(this.classFeatures);
diff --git a/module/data/item/subclass.mjs b/module/data/item/subclass.mjs
index 55b078c2..ecf72de3 100644
--- a/module/data/item/subclass.mjs
+++ b/module/data/item/subclass.mjs
@@ -1,4 +1,5 @@
-import { fromUuids, getFeaturesHTMLData } from '../../helpers/utils.mjs';
+import { getFeaturesHTMLData } from '../../helpers/utils.mjs';
+import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs';
import ItemLinkFields from '../fields/itemLinkFields.mjs';
import BaseDataItem from './base.mjs';
@@ -90,11 +91,6 @@ export default class DHSubclass extends BaseDataItem {
const spellcastTrait = this.spellcastingTrait
? game.i18n.localize(CONFIG.DH.ACTOR.abilities[this.spellcastingTrait].label)
: null;
-
- // Preload all class features for acquisition from the cache
- // todo: make feature acquisition async and replace feature helpers for methods
- await fromUuids(this._source.features.map(f => f.item));
-
const foundationFeatures = await getFeaturesHTMLData(this.foundationFeatures);
const specializationFeatures = await getFeaturesHTMLData(this.specializationFeatures);
const masteryFeatures = await getFeaturesHTMLData(this.masteryFeatures);
diff --git a/module/dice/d20Roll.mjs b/module/dice/d20Roll.mjs
index b1d3bd0b..509f5d69 100644
--- a/module/dice/d20Roll.mjs
+++ b/module/dice/d20Roll.mjs
@@ -1,5 +1,4 @@
import D20RollDialog from '../applications/dialogs/d20RollDialog.mjs';
-import { triggerChatRollFx } from '../helpers/utils.mjs';
import DHRoll from './dhRoll.mjs';
export default class D20Roll extends DHRoll {
@@ -225,15 +224,4 @@ export default class D20Roll extends DHRoll {
resetFormula() {
return (this._formula = this.constructor.getFormula(this.terms));
}
-
- async reroll(options) {
- const result = await super.reroll(options);
- if (this instanceof game.system.api.dice.DualityRoll) return result;
-
- if (options?.liveRoll) {
- await triggerChatRollFx([result]);
- }
-
- return result;
- }
}
diff --git a/module/dice/damageRoll.mjs b/module/dice/damageRoll.mjs
index ef810ed7..98fd8401 100644
--- a/module/dice/damageRoll.mjs
+++ b/module/dice/damageRoll.mjs
@@ -1,5 +1,5 @@
import DamageDialog from '../applications/dialogs/damageDialog.mjs';
-import { parseRallyDice, triggerChatRollFx } from '../helpers/utils.mjs';
+import { parseRallyDice } from '../helpers/utils.mjs';
import DHRoll from './dhRoll.mjs';
export default class DamageRoll extends DHRoll {
@@ -18,12 +18,7 @@ export default class DamageRoll extends DHRoll {
if (config.evaluate !== false) for (const roll of config.roll) await roll.roll.evaluate();
roll._evaluated = true;
-
- const parts = [];
- for (const roll of config.roll) {
- parts.push(this.postEvaluate(roll));
- roll.roll = JSON.stringify(roll.roll.toJSON());
- }
+ const parts = config.roll.map(r => this.postEvaluate(r));
config.damage = this.unifyDamageRoll(parts);
}
@@ -43,24 +38,25 @@ export default class DamageRoll extends DHRoll {
const chatMessage = config.source?.message
? ui.chat.collection.get(config.source.message)
: getDocumentClass('ChatMessage').applyMode({}, config.rollMode ?? 'public');
-
- const diceRolls = [];
if (game.modules.get('dice-so-nice')?.active) {
- config.mute = true;
const pool = foundry.dice.terms.PoolTerm.fromRolls(
- Object.values(config.damage).flatMap(r => r.parts.map(p => p.roll))
+ Object.values(config.damage).flatMap(r => r.parts.map(p => p.roll))
+ ),
+ diceRoll = Roll.fromTerms([pool]);
+ await game.dice3d.showForRoll(
+ diceRoll,
+ game.user,
+ true,
+ chatMessage.whisper?.length > 0 ? chatMessage.whisper : null,
+ chatMessage.blind
);
- diceRolls.push(Roll.fromTerms([pool]));
+ config.mute = true;
}
-
- await triggerChatRollFx(diceRolls, {
- whisper: chatMessage.whisper?.length > 0 ? chatMessage.whisper : null,
- blind: chatMessage.blind
- });
await super.buildPost(roll, config, message);
-
if (config.source?.message) {
chatMessage.update({ 'system.damage': config.damage });
+
+ if (!game.modules.get('dice-so-nice')?.active) foundry.audio.AudioHelper.play({ src: CONFIG.sounds.dice });
}
}
@@ -323,10 +319,9 @@ export default class DamageRoll extends DHRoll {
const newIndex = parsedDiceTerms[dice].results.length;
await term.reroll(`/r1=${termResult.result}`);
- const diceRolls = [];
if (game.modules.get('dice-so-nice')?.active) {
const newResult = parsedDiceTerms[dice].results[newIndex];
- diceRolls.push({
+ const diceSoNiceRoll = {
_evaluated: true,
dice: [
new foundry.dice.terms.Die({
@@ -337,10 +332,11 @@ export default class DamageRoll extends DHRoll {
})
],
options: { appearance: {} }
- });
+ };
+
+ await game.dice3d.showForRoll(diceSoNiceRoll, game.user, true);
}
- await triggerChatRollFx(diceRolls);
await parsedRoll.evaluate();
const results = parsedRoll.dice[dice].results.map(result => ({
diff --git a/module/dice/dhRoll.mjs b/module/dice/dhRoll.mjs
index 02c4ab24..d6975f71 100644
--- a/module/dice/dhRoll.mjs
+++ b/module/dice/dhRoll.mjs
@@ -1,5 +1,4 @@
import D20RollDialog from '../applications/dialogs/d20RollDialog.mjs';
-import { triggerChatRollFx } from '../helpers/utils.mjs';
export default class DHRoll extends Roll {
baseTerms = [];
@@ -76,7 +75,9 @@ export default class DHRoll extends Roll {
}
if (config.skips?.createMessage) {
- await triggerChatRollFx([roll]);
+ if (game.modules.get('dice-so-nice')?.active) {
+ await game.dice3d.showForRoll(roll, game.user, true);
+ }
} else if (!config.source?.message) {
config.message = await this.toMessage(roll, config);
}
@@ -84,7 +85,6 @@ export default class DHRoll extends Roll {
static postEvaluate(roll, config = {}) {
return {
- ...roll.options.roll,
total: roll.total,
formula: roll.formula,
dice: roll.dice.map(d => ({
diff --git a/module/dice/die/dualityDie.mjs b/module/dice/die/dualityDie.mjs
index cc7ee75e..83229425 100644
--- a/module/dice/die/dualityDie.mjs
+++ b/module/dice/die/dualityDie.mjs
@@ -1,4 +1,4 @@
-import { updateResourcesForDualityReroll } from '../helpers.mjs';
+import { ResourceUpdateMap } from '../../data/action/baseAction.mjs';
export default class DualityDie extends foundry.dice.terms.Die {
constructor(options) {
@@ -12,6 +12,24 @@ export default class DualityDie extends foundry.dice.terms.Die {
return roll.withHope ? 1 : roll.withFear ? -1 : 0;
}
+ #updateResources(oldDuality, newDuality, actor) {
+ const { hopeFear } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation);
+ if (game.user.isGM ? !hopeFear.gm : !hopeFear.players) return;
+
+ const updates = [];
+ const hope = (newDuality >= 0 ? 1 : 0) - (oldDuality >= 0 ? 1 : 0);
+ const stress = (newDuality === 0 ? 1 : 0) - (oldDuality === 0 ? 1 : 0);
+ const fear = (newDuality === -1 ? 1 : 0) - (oldDuality === -1 ? 1 : 0);
+
+ if (hope !== 0) updates.push({ key: 'hope', value: hope, total: -1 * hope, enabled: true });
+ if (stress !== 0) updates.push({ key: 'stress', value: -1 * stress, total: stress, enabled: true });
+ if (fear !== 0) updates.push({ key: 'fear', value: fear, total: -1 * fear, enabled: true });
+
+ const resourceUpdates = new ResourceUpdateMap(actor);
+ resourceUpdates.addResources(updates);
+ resourceUpdates.updateResources();
+ }
+
async reroll(modifier, options) {
const oldDuality = this.#getDualityState(options.liveRoll.roll);
await super.reroll(modifier, options);
@@ -39,7 +57,7 @@ export default class DualityDie extends foundry.dice.terms.Die {
if (options.liveRoll.isReaction) return;
const newDuality = this.#getDualityState(options.liveRoll.roll);
- updateResourcesForDualityReroll(oldDuality, newDuality, options.liveRoll.actor);
+ this.#updateResources(oldDuality, newDuality, options.liveRoll.actor);
}
}
diff --git a/module/dice/dualityRoll.mjs b/module/dice/dualityRoll.mjs
index 1d2d556a..d58811fe 100644
--- a/module/dice/dualityRoll.mjs
+++ b/module/dice/dualityRoll.mjs
@@ -1,8 +1,6 @@
import D20RollDialog from '../applications/dialogs/d20RollDialog.mjs';
import D20Roll from './d20Roll.mjs';
import { parseRallyDice, setDiceSoNiceForDualityRoll } from '../helpers/utils.mjs';
-import { getDiceSoNicePresets } from '../config/generalConfig.mjs';
-import { updateResourcesForDualityReroll } from './helpers.mjs';
export default class DualityRoll extends D20Roll {
_advantageNumber = 1;
@@ -132,14 +130,20 @@ export default class DualityRoll extends D20Roll {
}
createBaseDice() {
- this.terms = [this.terms[0], this.terms[1], this.terms[2]];
+ if (
+ this.dice[0] instanceof game.system.api.dice.diceTypes.HopeDie &&
+ this.dice[1] instanceof game.system.api.dice.diceTypes.FearDie
+ ) {
+ this.terms = [this.terms[0], this.terms[1], this.terms[2]];
+ return;
+ }
this.terms[0] = new game.system.api.dice.diceTypes.HopeDie({
- faces: this.terms[0]?.faces ?? this.data.rules.dualityRoll?.defaultHopeDice ?? 12
+ faces: this.data.rules.dualityRoll?.defaultHopeDice ?? 12
});
this.terms[1] = new foundry.dice.terms.OperatorTerm({ operator: '+' });
this.terms[2] = new game.system.api.dice.diceTypes.FearDie({
- faces: this.terms[2]?.faces ?? this.data.rules.dualityRoll?.defaultFearDice ?? 12
+ faces: this.data.rules.dualityRoll?.defaultFearDice ?? 12
});
}
@@ -384,40 +388,4 @@ export default class DualityRoll extends D20Roll {
if (currentCombatant?.actorId == config.data.id) ui.combat.setCombatantSpotlight(currentCombatant.id);
}
}
-
- async reroll(options) {
- const oldDuality = this.withHope ? 1 : this.withFear ? -1 : 0;
- const rerolled = DualityRoll.fromData((await super.reroll(options)).toJSON());
-
- if (options?.liveRoll) {
- if (game.modules.get('dice-so-nice')?.active) {
- const diceAppearance = await getDiceSoNicePresets(
- rerolled,
- rerolled.dHope.denomination,
- rerolled.dFear.denomination
- );
- rerolled.dHope.options.appearance = diceAppearance.hope.appearance;
- rerolled.dFear.options.appearance = diceAppearance.fear.appearance;
- if (rerolled.dAdvantage) rerolled.dAdvantage.options.appearance = diceAppearance.advantage.appearance;
- if (rerolled.dDisadvantage)
- rerolled.dDisadvantage.options.appearance = diceAppearance.disadvantage.appearance;
-
- await game.dice3d.showForRoll(rerolled, game.user, true);
- } else {
- foundry.audio.AudioHelper.play({ src: CONFIG.sounds.dice });
- }
-
- if (this.options.actionType === 'reaction') return;
-
- const newDuality = rerolled.withHope ? 1 : rerolled.withFear ? -1 : 0;
- const actor = await foundry.utils.fromUuid(this.options.source.actor);
- updateResourcesForDualityReroll(oldDuality, newDuality, actor);
- }
-
- return rerolled;
- }
-
- fromJSON(json) {
- return super.fromJSON(json);
- }
}
diff --git a/module/dice/helpers.mjs b/module/dice/helpers.mjs
deleted file mode 100644
index 33519949..00000000
--- a/module/dice/helpers.mjs
+++ /dev/null
@@ -1,17 +0,0 @@
-export function updateResourcesForDualityReroll(oldDuality, newDuality, actor) {
- const { hopeFear } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation);
- if (game.user.isGM ? !hopeFear.gm : !hopeFear.players) return;
-
- const updates = [];
- const hope = (newDuality >= 0 ? 1 : 0) - (oldDuality >= 0 ? 1 : 0);
- const stress = (newDuality === 0 ? 1 : 0) - (oldDuality === 0 ? 1 : 0);
- const fear = (newDuality === -1 ? 1 : 0) - (oldDuality === -1 ? 1 : 0);
-
- if (hope !== 0) updates.push({ key: 'hope', value: hope, total: -1 * hope, enabled: true });
- if (stress !== 0) updates.push({ key: 'stress', value: -1 * stress, total: stress, enabled: true });
- if (fear !== 0) updates.push({ key: 'fear', value: fear, total: -1 * fear, enabled: true });
-
- const resourceUpdates = new ResourceUpdateMap(actor);
- resourceUpdates.addResources(updates);
- resourceUpdates.updateResources();
-}
diff --git a/module/documents/actor.mjs b/module/documents/actor.mjs
index 6c462d98..e4c11a5c 100644
--- a/module/documents/actor.mjs
+++ b/module/documents/actor.mjs
@@ -109,14 +109,6 @@ export default class DhpActor extends Actor {
});
}
- if (this.type === 'npc') {
- Object.assign(update, {
- prototypeToken: {
- disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY
- }
- });
- }
-
this.updateSource(update);
}
diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs
index 2f20175b..7bc5fa25 100644
--- a/module/helpers/utils.mjs
+++ b/module/helpers/utils.mjs
@@ -864,57 +864,3 @@ export function camelize(str) {
})
.replace(/\s+/g, '');
}
-
-/** Bulk load a list of documents using uuids. Returns the documents in the same order */
-export async function fromUuids(uuids) {
- // Set up base entries. Each step works on a sublist of these objects
- const entries = uuids.map(uuid => ({
- uuid,
- parsed: foundry.utils.parseUuid(uuid),
- value: foundry.utils.fromUuidSync(uuid)
- }));
-
- // Handle missing uuids for embedded documents first
- // A value may be index data, so we check if its a document
- const packEmbeddedEntries = entries.filter(
- e =>
- !(e.value instanceof Document) &&
- e.parsed.collection instanceof foundry.documents.collections.CompendiumCollection &&
- e.parsed.embedded.length > 0
- );
- await Promise.all(
- packEmbeddedEntries.map(async e => {
- e.value = await fromUuid(e.uuid);
- return true;
- })
- );
-
- // Handle missing top level pack stuff, by batching per pack
- const missingTopLevel = entries.filter(e => !(e.value instanceof Document) && e.value?.pack);
- for (const packGroup of Object.values(Object.groupBy(missingTopLevel, e => e.value.pack))) {
- const pack = game.packs.get(packGroup[0].value.pack);
- if (!pack) continue;
-
- const ids = packGroup.map(p => p.parsed.id);
- const documents = await pack.getDocuments({ _id__in: ids });
- for (const p of packGroup) {
- p.value = documents.find(d => d.id === p.parsed.id) ?? p.value;
- }
- }
-
- return entries.map(e => e.value);
-}
-/**
- * Triggers DiceSoNice rolls or dice roll audio for rolls. Not used for duality rolls.
- * @param { Roll[] } rolls
- * @return { void }
- */
-export async function triggerChatRollFx(rolls, options = { whisper: false, blind: false }) {
- const { whisper, blind } = options;
- if (game.modules.get('dice-so-nice')?.active) {
- const rerollPromises = rolls.map(roll => game.dice3d.showForRoll(roll, game.user, true, whisper, blind));
- await Promise.allSettled(rerollPromises);
- } else {
- foundry.audio.AudioHelper.play({ src: CONFIG.sounds.dice });
- }
-}
diff --git a/styles/less/dialog/index.less b/styles/less/dialog/index.less
index e8f61318..11d9635e 100644
--- a/styles/less/dialog/index.less
+++ b/styles/less/dialog/index.less
@@ -24,6 +24,8 @@
@import './multiclass-choice/sheet.less';
+@import './reroll-dialog/sheet.less';
+
@import './tag-team-dialog/initialization.less';
@import './tag-team-dialog/sheet.less';
diff --git a/styles/less/dialog/level-up/sheet.less b/styles/less/dialog/level-up/sheet.less
index 9ebd9331..c663f304 100644
--- a/styles/less/dialog/level-up/sheet.less
+++ b/styles/less/dialog/level-up/sheet.less
@@ -14,7 +14,8 @@
.tab.active {
flex: 1;
overflow: auto;
- .with-scroll-shadows();
+ scrollbar-width: thin;
+ scrollbar-color: light-dark(@dark-blue, @golden) transparent;
}
div[data-application-part='form'] {
diff --git a/styles/less/dialog/level-up/summary-container.less b/styles/less/dialog/level-up/summary-container.less
index de7c9f4a..97353ba7 100644
--- a/styles/less/dialog/level-up/summary-container.less
+++ b/styles/less/dialog/level-up/summary-container.less
@@ -18,7 +18,7 @@
overflow: auto;
padding: 10px 0;
max-height: 700px;
- .with-scroll-shadows();
+ mask-image: linear-gradient(0deg, transparent 0%, black 5%, black 95%, transparent 100%);
.level-achievements-container,
.level-advancements-container {
diff --git a/styles/less/dialog/reroll-dialog/sheet.less b/styles/less/dialog/reroll-dialog/sheet.less
new file mode 100644
index 00000000..71c94d80
--- /dev/null
+++ b/styles/less/dialog/reroll-dialog/sheet.less
@@ -0,0 +1,125 @@
+.daggerheart.dialog.dh-style.views.reroll-dialog {
+ .window-content {
+ max-width: 648px;
+ }
+
+ .reroll-outer-container {
+ h2 {
+ margin: 0;
+ }
+
+ .dices-container {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px;
+ }
+
+ .dice-outer-container {
+ width: 300px;
+
+ legend {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+
+ i {
+ margin-right: 4px;
+ }
+ }
+
+ .dice-container {
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
+
+ .result-container {
+ position: relative;
+ aspect-ratio: 1;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 1.375rem;
+ opacity: 0.8;
+
+ &.selected {
+ opacity: 1;
+ border: 1px solid;
+ border-radius: 6px;
+ border-color: light-dark(@dark-blue, @golden);
+ filter: drop-shadow(0 0 3px @golden);
+ }
+
+ &:before {
+ content: ' ';
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ z-index: -1;
+ mask: var(--svg-die) no-repeat center;
+ mask-size: contain;
+ background: linear-gradient(139.01deg, #efe6d8 3.51%, #372e1f 96.49%);
+ }
+
+ &.d4:before {
+ --svg-die: url(../assets/icons/dice/default/d4.svg);
+ }
+ &.d6:before {
+ --svg-die: url(../assets/icons/dice/default/d6.svg);
+ }
+ &.d8:before {
+ --svg-die: url(../assets/icons/dice/default/d8.svg);
+ }
+ &.d10:before {
+ --svg-die: url(../assets/icons/dice/default/d10.svg);
+ }
+ &.d12:before {
+ --svg-die: url('../assets/icons/dice/default/d12.svg');
+ }
+ &.d20:before {
+ --svg-die: url(../assets/icons/dice/default/d20.svg);
+ }
+
+ .to-reroll-result {
+ position: absolute;
+ bottom: -7px;
+ gap: 2px;
+ border: 1px solid;
+ border-radius: 6px;
+ background-image: url(../assets/parchments/dh-parchment-dark.png);
+ display: flex;
+ align-items: center;
+ padding: 2px 6px;
+
+ input {
+ margin: 0;
+ height: 12px;
+ line-height: 0px;
+ position: relative;
+ top: 1px;
+
+ &:before,
+ &:after {
+ line-height: 12px;
+ font-size: var(--font-size-12);
+ }
+ }
+
+ i {
+ font-size: var(--font-size-10);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ footer {
+ margin-top: 8px;
+ display: flex;
+ justify-content: space-between;
+
+ .controls {
+ display: flex;
+ gap: 8px;
+ }
+ }
+}
diff --git a/styles/less/dialog/tag-team-dialog/sheet.less b/styles/less/dialog/tag-team-dialog/sheet.less
index 82bc0270..3a112146 100644
--- a/styles/less/dialog/tag-team-dialog/sheet.less
+++ b/styles/less/dialog/tag-team-dialog/sheet.less
@@ -194,7 +194,6 @@
.roll-selection-container {
display: flex;
- gap: 16px;
.select-roll-button {
margin-top: 8px;
diff --git a/styles/less/global/elements.less b/styles/less/global/elements.less
index e57ba50d..7af8becd 100755
--- a/styles/less/global/elements.less
+++ b/styles/less/global/elements.less
@@ -283,7 +283,7 @@
}
&.fit-height {
- flex: 1;
+ height: 95%;
}
&.flex {
diff --git a/styles/less/global/prose-mirror.less b/styles/less/global/prose-mirror.less
index e4b1249f..02d54cc5 100644
--- a/styles/less/global/prose-mirror.less
+++ b/styles/less/global/prose-mirror.less
@@ -40,7 +40,8 @@
ul {
list-style: disc;
}
- }
+ }
+
// Fixes centering and makes it not render over scrollbar
&:hover button.toggle:enabled {
display: flex;
diff --git a/styles/less/global/tab-navigation.less b/styles/less/global/tab-navigation.less
index 3d143b4c..a08c5a5e 100755
--- a/styles/less/global/tab-navigation.less
+++ b/styles/less/global/tab-navigation.less
@@ -20,10 +20,6 @@
a {
color: @color-text-emphatic;
-
- &.empty:not(.active) {
- opacity: 0.4;
- }
}
}
}
diff --git a/styles/less/sheets-settings/adversary-settings/sheet.less b/styles/less/sheets-settings/adversary-settings/sheet.less
index e6eb8d0b..b4b0683b 100644
--- a/styles/less/sheets-settings/adversary-settings/sheet.less
+++ b/styles/less/sheets-settings/adversary-settings/sheet.less
@@ -7,7 +7,7 @@
&.attack.active {
display: flex;
flex-direction: column;
- gap: 12px;
+ gap: 16px;
}
.fieldsets-section {
diff --git a/styles/less/sheets/actors/actor-sheet-shared.less b/styles/less/sheets/actors/actor-sheet-shared.less
index c90e5d88..bf98cbf2 100644
--- a/styles/less/sheets/actors/actor-sheet-shared.less
+++ b/styles/less/sheets/actors/actor-sheet-shared.less
@@ -84,7 +84,7 @@
height: 32px;
position: absolute;
right: 20px;
- font-size: var(--font-size-16);
+ font-size: var(--font-size-16);;
z-index: 1;
color: light-dark(@dark-blue-50, @beige-50);
}
diff --git a/styles/less/sheets/actors/adversary/effects.less b/styles/less/sheets/actors/adversary/effects.less
index da71b52b..3977f5ad 100644
--- a/styles/less/sheets/actors/adversary/effects.less
+++ b/styles/less/sheets/actors/adversary/effects.less
@@ -8,8 +8,8 @@
flex-direction: column;
gap: 10px;
overflow-y: auto;
- padding-bottom: 4px;
scrollbar-gutter: stable;
+ padding-bottom: 4px;
.with-scroll-shadows();
}
}
diff --git a/styles/less/sheets/actors/adversary/header.less b/styles/less/sheets/actors/adversary/header.less
index 1e5e4fa5..5208e8ba 100644
--- a/styles/less/sheets/actors/adversary/header.less
+++ b/styles/less/sheets/actors/adversary/header.less
@@ -35,7 +35,7 @@
.tags {
display: flex;
gap: 10px;
- padding-bottom: 8px;
+ padding-bottom: 16px;
.tag {
display: flex;
@@ -67,5 +67,14 @@
gap: 12px;
padding: 16px 0;
}
+
+ .adversary-navigation {
+ display: flex;
+ gap: 8px;
+ align-items: baseline;
+ .tab-navigation {
+ margin-top: 0;
+ }
+ }
}
}
diff --git a/styles/less/sheets/actors/adversary/index.less b/styles/less/sheets/actors/adversary/index.less
index a05af854..9f74b0e0 100644
--- a/styles/less/sheets/actors/adversary/index.less
+++ b/styles/less/sheets/actors/adversary/index.less
@@ -1,6 +1,6 @@
@import './sheet.less';
-@import './header.less';
@import './features.less';
+@import './header.less';
@import './sidebar.less';
@import './effects.less';
-@import './notes.less';
+@import './notes.less';
\ No newline at end of file
diff --git a/styles/less/sheets/actors/adversary/notes.less b/styles/less/sheets/actors/adversary/notes.less
index 80feb77d..5c3671b7 100644
--- a/styles/less/sheets/actors/adversary/notes.less
+++ b/styles/less/sheets/actors/adversary/notes.less
@@ -1,7 +1,11 @@
-.application.sheet.daggerheart.actor.dh-style.adversary .tab.notes.active {
- padding: 6px 0 4px 15px;
- .editor-content {
- scrollbar-gutter: stable;
- .with-scroll-shadows();
+@import '../../../utils/mixin.less';
+
+.application.sheet.daggerheart.actor.dh-style.adversary {
+ .tab.notes {
+ padding: 6px 0 4px 15px;
+ .editor-content {
+ scrollbar-gutter: stable;
+ .with-scroll-shadows();
+ }
}
-}
+}
\ No newline at end of file
diff --git a/styles/less/sheets/actors/character/effects.less b/styles/less/sheets/actors/character/effects.less
index 0ab1007d..5740f978 100644
--- a/styles/less/sheets/actors/character/effects.less
+++ b/styles/less/sheets/actors/character/effects.less
@@ -4,13 +4,15 @@
.application.sheet.daggerheart.actor.dh-style.character {
.tab.effects {
+ padding-right: 0;
+ overflow-y: auto;
+ scrollbar-gutter: stable;
+ .with-scroll-shadows();
.effects-sections {
display: flex;
flex-direction: column;
gap: 10px;
- overflow-y: auto;
- padding-bottom: 20px;
- .with-scroll-shadows();
+ padding-bottom: 4px;
}
}
}
diff --git a/styles/less/sheets/actors/character/features.less b/styles/less/sheets/actors/character/features.less
index f81f0e32..ac241c34 100644
--- a/styles/less/sheets/actors/character/features.less
+++ b/styles/less/sheets/actors/character/features.less
@@ -4,14 +4,15 @@
.application.sheet.daggerheart.actor.dh-style.character {
.tab.features {
+ overflow-y: auto;
+ scrollbar-gutter: stable;
+ padding-right: 0;
+ padding-bottom: 4px;
+ .with-scroll-shadows();
.features-sections {
display: flex;
flex-direction: column;
gap: 10px;
- overflow-y: auto;
- padding-bottom: 20px;
- scrollbar-gutter: stable;
- .with-scroll-shadows();
}
}
}
diff --git a/styles/less/sheets/actors/character/loadout.less b/styles/less/sheets/actors/character/loadout.less
index 67b2914b..528553c2 100644
--- a/styles/less/sheets/actors/character/loadout.less
+++ b/styles/less/sheets/actors/character/loadout.less
@@ -1,11 +1,11 @@
@import '../../../utils/colors.less';
@import '../../../utils/fonts.less';
-@import '../../../utils/mixin.less';
.application.sheet.daggerheart.actor.dh-style.character {
.tab.loadout {
.search-section {
padding-right: 14px;
+
.btn-toggle-view {
background: light-dark(@dark-blue-10, @dark-blue);
border: 1px solid @color-border;
diff --git a/styles/less/sheets/actors/companion/header.less b/styles/less/sheets/actors/companion/header.less
index aca789a6..6a4e6c3e 100644
--- a/styles/less/sheets/actors/companion/header.less
+++ b/styles/less/sheets/actors/companion/header.less
@@ -148,8 +148,10 @@
}
.companion-navigation {
- width: 100%;
- padding: 0 10px;
+ display: flex;
+ gap: 8px;
+ align-items: baseline;
+ width: calc(100% - 32px);
}
}
}
diff --git a/styles/less/sheets/actors/companion/index.less b/styles/less/sheets/actors/companion/index.less
deleted file mode 100644
index c4931814..00000000
--- a/styles/less/sheets/actors/companion/index.less
+++ /dev/null
@@ -1,4 +0,0 @@
-@import './details.less';
-@import './header.less';
-@import './sheet.less';
-@import './effects.less';
diff --git a/styles/less/sheets/actors/companion/sheet.less b/styles/less/sheets/actors/companion/sheet.less
index 8bf8a0b9..7e5fab62 100644
--- a/styles/less/sheets/actors/companion/sheet.less
+++ b/styles/less/sheets/actors/companion/sheet.less
@@ -22,4 +22,4 @@
display: flex;
flex-direction: column;
}
-}
+}
\ No newline at end of file
diff --git a/styles/less/sheets/actors/environment/header.less b/styles/less/sheets/actors/environment/header.less
index da6954e0..85471af4 100644
--- a/styles/less/sheets/actors/environment/header.less
+++ b/styles/less/sheets/actors/environment/header.less
@@ -138,8 +138,10 @@
}
.environment-navigation {
+ display: flex;
+ gap: 20px;
+ align-items: baseline;
padding: 0 20px;
-
.tab-navigation {
margin-top: 0;
}
diff --git a/styles/less/sheets/actors/environment/index.less b/styles/less/sheets/actors/environment/index.less
index db35eabc..8937c129 100644
--- a/styles/less/sheets/actors/environment/index.less
+++ b/styles/less/sheets/actors/environment/index.less
@@ -2,4 +2,4 @@
@import './features.less';
@import './header.less';
@import './potentialAdversaries.less';
-@import './notes.less';
+@import './notes.less';
\ No newline at end of file
diff --git a/styles/less/sheets/actors/environment/potentialAdversaries.less b/styles/less/sheets/actors/environment/potentialAdversaries.less
index e66ff34d..94c1c1fa 100644
--- a/styles/less/sheets/actors/environment/potentialAdversaries.less
+++ b/styles/less/sheets/actors/environment/potentialAdversaries.less
@@ -8,7 +8,7 @@
flex-direction: column;
gap: 10px;
overflow-y: auto;
- padding: 0 4px 4px 4px;
+ padding-bottom: 0 4px 4px 4px;
scrollbar-gutter: stable;
.with-scroll-shadows();
}
diff --git a/styles/less/sheets/actors/npc/features.less b/styles/less/sheets/actors/npc/features.less
deleted file mode 100644
index a579d9f8..00000000
--- a/styles/less/sheets/actors/npc/features.less
+++ /dev/null
@@ -1,18 +0,0 @@
-.application.sheet.daggerheart.actor.dh-style.npc {
- .tab.features {
- &.active {
- overflow: hidden;
- display: flex;
- flex-direction: column;
- }
-
- .feature-section {
- display: flex;
- flex-direction: column;
- gap: 10px;
- overflow-y: auto;
- padding-bottom: 4px;
- .with-scroll-shadows();
- }
- }
-}
diff --git a/styles/less/sheets/actors/npc/header.less b/styles/less/sheets/actors/npc/header.less
deleted file mode 100644
index d49d763c..00000000
--- a/styles/less/sheets/actors/npc/header.less
+++ /dev/null
@@ -1,83 +0,0 @@
-.application.sheet.daggerheart.actor.dh-style.npc {
- .npc-header-sheet {
- width: 100%;
- display: flex;
-
- .portrait {
- cursor: pointer;
- width: 275px;
-
- img {
- height: 275px;
- }
- }
-
- .tags {
- display: flex;
- gap: 10px;
- padding-bottom: 8px;
-
- .tag {
- display: flex;
- flex-direction: row;
- gap: 4px;
- justify-content: center;
- align-items: center;
- padding: 3px 5px;
- font-size: var(--font-size-12);
- font: @font-body;
-
- background: light-dark(@dark-15, @beige-15);
- border: 1px solid light-dark(@dark, @beige);
- border-radius: 3px;
- }
-
- .label {
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- font-size: var(--font-size-12);
- }
- }
-
- .info-section {
- flex: 1;
- padding: 0 15px;
- padding-top: var(--header-height);
- display: flex;
- flex-direction: column;
-
- .name-row {
- display: flex;
- gap: 5px;
- align-items: center;
- justify-content: space-between;
- padding: 8px 0;
-
- h1 {
- display: flex;
- flex: 1;
- padding: 6px 0 0 0;
- font-size: var(--font-size-32);
- text-align: start;
- border: 1px solid transparent;
- outline: 2px solid transparent;
- transition: all 0.3s ease;
- word-break: break-word;
-
- &:hover {
- outline: 2px solid light-dark(@dark, @golden);
- }
- }
- }
-
- .npc-info {
- display: flex;
- flex-direction: column;
- gap: 12px;
- padding: 16px 0;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/styles/less/sheets/actors/npc/index.less b/styles/less/sheets/actors/npc/index.less
deleted file mode 100644
index 2d7d54e3..00000000
--- a/styles/less/sheets/actors/npc/index.less
+++ /dev/null
@@ -1,3 +0,0 @@
-@import './sheet.less';
-@import './header.less';
-@import './features.less';
\ No newline at end of file
diff --git a/styles/less/sheets/actors/npc/sheet.less b/styles/less/sheets/actors/npc/sheet.less
deleted file mode 100644
index 8ba3b7a9..00000000
--- a/styles/less/sheets/actors/npc/sheet.less
+++ /dev/null
@@ -1,10 +0,0 @@
-.application.sheet.daggerheart.actor.dh-style.npc {
- .window-content {
- display: grid;
- grid-template-rows: auto auto 1fr;
- }
-
- .npc-navigation {
- padding: 0 15px;
- }
-}
\ No newline at end of file
diff --git a/styles/less/sheets/actors/party/party-members.less b/styles/less/sheets/actors/party/party-members.less
index 7b85eb35..fe2a004b 100644
--- a/styles/less/sheets/actors/party/party-members.less
+++ b/styles/less/sheets/actors/party/party-members.less
@@ -4,6 +4,7 @@
.application.sheet.daggerheart.actor.dh-style.party .tab.partyMembers {
overflow: auto;
+ scrollbar-gutter: stable;
.with-scroll-shadows();
.actors-list {
diff --git a/styles/less/sheets/actors/party/sheet.less b/styles/less/sheets/actors/party/sheet.less
index 33aa64a3..4715f8a5 100644
--- a/styles/less/sheets/actors/party/sheet.less
+++ b/styles/less/sheets/actors/party/sheet.less
@@ -19,8 +19,6 @@
.application.sheet.daggerheart.actor.dh-style.party {
.tab {
flex: 1;
- overflow-y: auto;
- scrollbar-gutter: stable;
margin-right: 2px;
padding-right: 8px;
diff --git a/styles/less/sheets/index.less b/styles/less/sheets/index.less
index 4312f755..a4092086 100644
--- a/styles/less/sheets/index.less
+++ b/styles/less/sheets/index.less
@@ -4,11 +4,14 @@
@import './actors/adversary/index.less';
@import './actors/character/index.less';
-@import './actors/companion/index.less';
@import './actors/environment/index.less';
-@import './actors/npc/index.less';
@import './actors/party/index.less';
+@import './actors/companion/details.less';
+@import './actors/companion/header.less';
+@import './actors/companion/sheet.less';
+@import './actors/companion/effects.less';
+
@import './items/beastform.less';
@import './items/class.less';
@import './items/domain-card.less';
diff --git a/styles/less/ui/item-browser/item-browser.less b/styles/less/ui/item-browser/item-browser.less
index aac63d7a..1387f444 100644
--- a/styles/less/ui/item-browser/item-browser.less
+++ b/styles/less/ui/item-browser/item-browser.less
@@ -1,6 +1,5 @@
@import '../../utils/colors.less';
@import '../../utils/fonts.less';
-@import '../../utils/mixin.less';
.application.daggerheart.dh-style.compendium-browser {
border: initial;
@@ -243,7 +242,6 @@
.compendium-sidebar > .folder-list {
overflow-y: auto;
scrollbar-gutter: stable;
- .with-scroll-shadows();
}
.item-list-header,
diff --git a/styles/less/utils/mixin.less b/styles/less/utils/mixin.less
index 18b1f9a6..69c2bf6b 100644
--- a/styles/less/utils/mixin.less
+++ b/styles/less/utils/mixin.less
@@ -180,10 +180,10 @@
--fade-start: 0;
}
10%, 100% {
- --fade-start: 12px;
+ --fade-start: 10px;
}
0%, 90% {
- --fade-end: 12px;
+ --fade-end: 10px;
}
100% {
--fade-end: 0;
@@ -194,7 +194,6 @@
.with-scroll-shadows() {
animation: scrollfade;
animation-timeline: --scrollfade;
- animation-range: entry 0% exit 100%;
scroll-timeline: --scrollfade y;
mask-image: linear-gradient(
0deg,
@@ -204,3 +203,4 @@
transparent 100%
);
}
+
diff --git a/system.json b/system.json
index 89320768..2acd7570 100644
--- a/system.json
+++ b/system.json
@@ -244,14 +244,11 @@
"adversary": {
"htmlFields": ["notes", "description"]
},
- "npc": {
- "htmlFields": ["notes"]
- },
"environment": {
"htmlFields": ["notes", "description"]
},
"party": {
- "htmlFields": ["notes", "description"]
+ "htmlFields": ["notes"]
}
},
"Item": {
diff --git a/templates/dialogs/rerollDialog/damage/main.hbs b/templates/dialogs/rerollDialog/damage/main.hbs
new file mode 100644
index 00000000..5b994bf6
--- /dev/null
+++ b/templates/dialogs/rerollDialog/damage/main.hbs
@@ -0,0 +1,35 @@
+
+ {{#each damage}}
+
{{localize (concat 'DAGGERHEART.CONFIG.HealingType.' @key '.name')}}
+ {{#each this}}
+
+ {{#each this}}
+
+
+
+
+ {{this.selectedResults}}/{{this.maxSelected}} Selected
+
+
+
+ {{#each this.results}}
+
+ {{/each}}
+
+
+ {{/each}}
+
+ {{/each}}
+ {{/each}}
+
\ No newline at end of file
diff --git a/templates/dialogs/rerollDialog/footer.hbs b/templates/dialogs/rerollDialog/footer.hbs
new file mode 100644
index 00000000..5d4ae2b2
--- /dev/null
+++ b/templates/dialogs/rerollDialog/footer.hbs
@@ -0,0 +1,4 @@
+
+ {{localize "DAGGERHEART.GENERAL.reroll"}}
+ {{localize "DAGGERHEART.APPLICATIONS.RerollDialog.acceptCurrentRolls"}}
+
\ No newline at end of file
diff --git a/templates/dialogs/rerollDialog/main.hbs b/templates/dialogs/rerollDialog/main.hbs
new file mode 100644
index 00000000..6f10ce33
--- /dev/null
+++ b/templates/dialogs/rerollDialog/main.hbs
@@ -0,0 +1,35 @@
+
+ {{#each damage}}
+
{{localize (concat 'DAGGERHEART.CONFIG.HealingType.' @key '.name')}}
+ {{#each this}}
+
+ {{#each this}}
+
+
+
+
+ {{this.selectedResults}}/{{this.results.length}} Selected
+
+
+
+ {{#each this.results}}
+
+ {{/each}}
+
+
+ {{/each}}
+
+ {{/each}}
+ {{/each}}
+
\ No newline at end of file
diff --git a/templates/dialogs/tagTeamDialog/parts/tagTeamDamageParts.hbs b/templates/dialogs/tagTeamDialog/parts/tagTeamDamageParts.hbs
index 2a366269..49fc8f4f 100644
--- a/templates/dialogs/tagTeamDialog/parts/tagTeamDamageParts.hbs
+++ b/templates/dialogs/tagTeamDialog/parts/tagTeamDamageParts.hbs
@@ -16,7 +16,7 @@
{{/unless}}
{{/each}}
{{#if part.modifierTotal}}
- {{#if part.dice.length}}{{#if (gte part.modifierTotal 0)}}+{{else}}-{{/if}} {{/if}}
+ {{#if (gte part.modifierTotal 0)}}+{{else}}-{{/if}}
{{positive part.modifierTotal}}
{{/if}}
diff --git a/templates/sheets-settings/adversary-settings/details.hbs b/templates/sheets-settings/adversary-settings/details.hbs
index 3160fbb9..dc2fd386 100644
--- a/templates/sheets-settings/adversary-settings/details.hbs
+++ b/templates/sheets-settings/adversary-settings/details.hbs
@@ -18,12 +18,6 @@
{{formField systemFields.motivesAndTactics value=document._source.system.motivesAndTactics label=(localize "DAGGERHEART.ACTORS.Adversary.FIELDS.motivesAndTactics.label")}}
-
- {{localize "DAGGERHEART.GENERAL.DamageThresholds.title"}}
- {{formGroup systemFields.damageThresholds.fields.major value=document._source.system.damageThresholds.major label=(localize "DAGGERHEART.GENERAL.DamageThresholds.majorThreshold")}}
- {{formGroup systemFields.damageThresholds.fields.severe value=document._source.system.damageThresholds.severe label=(localize "DAGGERHEART.GENERAL.DamageThresholds.severeThreshold")}}
-
-
{{localize "DAGGERHEART.GENERAL.Resource.plural"}}
@@ -32,4 +26,10 @@
{{/each}}
+
+
+ {{localize "DAGGERHEART.GENERAL.DamageThresholds.title"}}
+ {{formGroup systemFields.damageThresholds.fields.major value=document._source.system.damageThresholds.major label=(localize "DAGGERHEART.GENERAL.DamageThresholds.majorThreshold")}}
+ {{formGroup systemFields.damageThresholds.fields.severe value=document._source.system.damageThresholds.severe label=(localize "DAGGERHEART.GENERAL.DamageThresholds.severeThreshold")}}
+
diff --git a/templates/sheets-settings/npc-settings/details.hbs b/templates/sheets-settings/npc-settings/details.hbs
deleted file mode 100644
index 0e18b488..00000000
--- a/templates/sheets-settings/npc-settings/details.hbs
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- {{localize "DAGGERHEART.GENERAL.description"}}
- {{formInput systemFields.description value=document._source.system.description}}
-
-
- {{formGroup systemFields.motives value=document._source.system.motives}}
- {{formGroup systemFields.difficulty value=document._source.system.difficulty localize=true}}
-
diff --git a/templates/sheets-settings/npc-settings/features.hbs b/templates/sheets-settings/npc-settings/features.hbs
deleted file mode 100644
index 2f2f5f47..00000000
--- a/templates/sheets-settings/npc-settings/features.hbs
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
- {{localize "DOCUMENT.New" type=(localize "TYPES.Item.feature")}}
-
-
- {{localize tabs.features.label}}
-
- {{#each @root.features as |feature|}}
-
-
-
- {{feature.name}}
-
-
-
- {{/each}}
-
-
- {{localize "DAGGERHEART.GENERAL.dropFeaturesHere"}}
-
-
-
\ No newline at end of file
diff --git a/templates/sheets-settings/npc-settings/header.hbs b/templates/sheets-settings/npc-settings/header.hbs
deleted file mode 100644
index c9cb60fe..00000000
--- a/templates/sheets-settings/npc-settings/header.hbs
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/templates/sheets/actors/adversary/header.hbs b/templates/sheets/actors/adversary/header.hbs
index 5adc235a..fba96980 100644
--- a/templates/sheets/actors/adversary/header.hbs
+++ b/templates/sheets/actors/adversary/header.hbs
@@ -44,9 +44,10 @@
- {{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
+
+ {{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
- {{/ 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
+
\ No newline at end of file
diff --git a/templates/sheets/actors/companion/header.hbs b/templates/sheets/actors/companion/header.hbs
index 9c324709..d10c0640 100644
--- a/templates/sheets/actors/companion/header.hbs
+++ b/templates/sheets/actors/companion/header.hbs
@@ -50,10 +50,9 @@
- {{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
-
-
-
- {{/ 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
+ {{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
+
+
+
\ No newline at end of file
diff --git a/templates/sheets/actors/environment/header.hbs b/templates/sheets/actors/environment/header.hbs
index 1b4073c7..2c6bbb5a 100644
--- a/templates/sheets/actors/environment/header.hbs
+++ b/templates/sheets/actors/environment/header.hbs
@@ -44,10 +44,9 @@
- {{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
-
-
-
- {{/ 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
+ {{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
+
+
+
\ No newline at end of file
diff --git a/templates/sheets/actors/npc/features.hbs b/templates/sheets/actors/npc/features.hbs
deleted file mode 100644
index 3b495e74..00000000
--- a/templates/sheets/actors/npc/features.hbs
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- {{> 'daggerheart.inventory-items'
- title=tabs.features.label
- type='feature'
- collection=@root.features
- hideContextMenu=true
- hideModifyControls=true
- canCreate=@root.editable
- showActions=@root.editable
- }}
-
-
\ No newline at end of file
diff --git a/templates/sheets/actors/npc/header.hbs b/templates/sheets/actors/npc/header.hbs
deleted file mode 100644
index 8dc345dc..00000000
--- a/templates/sheets/actors/npc/header.hbs
+++ /dev/null
@@ -1,40 +0,0 @@
-
\ No newline at end of file
diff --git a/templates/sheets/actors/npc/navigation.hbs b/templates/sheets/actors/npc/navigation.hbs
deleted file mode 100644
index ae684f0d..00000000
--- a/templates/sheets/actors/npc/navigation.hbs
+++ /dev/null
@@ -1,7 +0,0 @@
-
- {{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
-
-
-
- {{/'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
-
\ No newline at end of file
diff --git a/templates/sheets/actors/npc/notes.hbs b/templates/sheets/actors/npc/notes.hbs
deleted file mode 100644
index bc9ac3cf..00000000
--- a/templates/sheets/actors/npc/notes.hbs
+++ /dev/null
@@ -1,11 +0,0 @@
-
- {{formInput notes.field value=notes.value enriched=notes.enriched toggled=true}}
-
- {{#if (and showAttribution document.system.attribution.artist)}}
- {{localize "DAGGERHEART.GENERAL.artistAttribution" artist=document.system.attribution.artist}}
- {{/if}}
-
\ No newline at end of file
diff --git a/templates/sheets/global/tabs/tab-navigation.hbs b/templates/sheets/global/tabs/tab-navigation.hbs
index 8af1f140..f9a31d3e 100755
--- a/templates/sheets/global/tabs/tab-navigation.hbs
+++ b/templates/sheets/global/tabs/tab-navigation.hbs
@@ -4,7 +4,7 @@
{{#each tabs as |tab|}}
-
+
{{localize tab.label}}
{{/each}}
diff --git a/templates/ui/chat/parts/roll-part.hbs b/templates/ui/chat/parts/roll-part.hbs
index cfee735f..14e3eaa6 100644
--- a/templates/ui/chat/parts/roll-part.hbs
+++ b/templates/ui/chat/parts/roll-part.hbs
@@ -12,9 +12,13 @@
{{/if}}
- {{#if roll.options.roll.difficulty}}
-
- {{localize "DAGGERHEART.GENERAL.difficulty"}} {{roll.options.roll.difficulty}}
+ {{#if roll.difficulty}}
+
+ {{!-- {{#if canViewSecret}} --}}
+ difficulty {{roll.difficulty}}
+ {{!-- {{else}}
+ {{localize (ifThen roll.success "DAGGERHEART.GENERAL.success" "DAGGERHEART.GENERAL.failure")}}
+ {{/if}} --}}
{{/if}}
diff --git a/templates/ui/sidebar/actor-document-partial.hbs b/templates/ui/sidebar/actor-document-partial.hbs
index 1bd3ff9a..2a9f47fa 100644
--- a/templates/ui/sidebar/actor-document-partial.hbs
+++ b/templates/ui/sidebar/actor-document-partial.hbs
@@ -6,8 +6,6 @@
{{name}}
{{#if (or (eq type "adversary") (eq type "environment"))}}
{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.tier" tier=system.tier type=(@root.getTypeLabel this)}}
- {{else if (eq type "npc")}}
- {{localize "TYPES.Actor.npc"}}
{{else if (eq type "character")}}
{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.character" level=system.levelData.level.current}}
{{else if (eq type "companion")}}