Merge branch 'main' into issue-64

This commit is contained in:
IrkTheImp 2025-05-26 13:15:19 -05:00
commit 2630b1411e
42 changed files with 2266 additions and 1408 deletions

3
.gitignore vendored
View file

@ -1,4 +1,5 @@
.vscode
node_modules
/packs
Build
Build
/build

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

View file

@ -10,6 +10,9 @@ import DhpChatLog from './module/ui/chatLog.mjs';
import DhpPlayers from './module/ui/players.mjs';
import DhpRuler from './module/ui/ruler.mjs';
import DhpTokenRuler from './module/ui/tokenRuler.mjs';
import { dualityRollEnricher, getDualityMessage } from './module/enrichers/DualityRollEnricher.mjs';
import { getCommandTarget, rollCommandToJSON } from './module/helpers/utils.mjs';
import { abilities } from './module/config/actorConfig.mjs';
globalThis.SYSTEM = SYSTEM;
@ -21,6 +24,11 @@ Hooks.once('init', () => {
documents
};
CONFIG.TextEditor.enrichers.push({
pattern: /\[\[\/dr\s?(.*?)\]\]/g,
enricher: dualityRollEnricher
});
CONFIG.statusEffects = Object.values(SYSTEM.GENERAL.conditions).map(x => ({
...x,
name: game.i18n.localize(x.name)
@ -90,7 +98,6 @@ Hooks.once('init', () => {
game.socket.on(`system.${SYSTEM.id}`, handleSocketEvent);
registerDHPSettings();
RegisterHandlebarsHelpers.registerHelpers();
return preloadHandlebarsTemplates();
@ -122,6 +129,134 @@ Hooks.on(socketEvent.GMUpdate, async (action, uuid, update) => {
}
});
const renderDualityButton = async event => {
const button = event.currentTarget;
const attributeValue = button.dataset.attribute?.toLowerCase();
const target = getCommandTarget();
if (!target) return;
const rollModifier = attributeValue ? target.system.attributes[attributeValue].data.value : null;
const { roll, hope, fear, advantage, disadvantage, modifiers } = await target.diceRoll({
title: button.dataset.label,
value: rollModifier
});
const cls = getDocumentClass('ChatMessage');
const msgData = {
type: 'dualityRoll',
sound: CONFIG.sounds.dice,
system: {
title: button.dataset.label,
origin: target.id,
roll: roll._formula,
modifiers: modifiers,
hope: hope,
fear: fear,
advantage: advantage,
disadvantage: disadvantage
},
user: game.user.id,
content: 'systems/daggerheart/templates/chat/duality-roll.hbs',
rolls: [roll]
};
await cls.create(msgData);
};
Hooks.on('renderChatMessageHTML', (_, element) => {
element
.querySelectorAll('.duality-roll-button')
.forEach(element => element.addEventListener('click', renderDualityButton));
});
Hooks.on('renderJournalEntryPageProseMirrorSheet', (_, element) => {
element
.querySelectorAll('.duality-roll-button')
.forEach(element => element.addEventListener('click', renderDualityButton));
});
Hooks.on('renderHandlebarsApplication', (_, element) => {
element
.querySelectorAll('.duality-roll-button')
.forEach(element => element.addEventListener('click', renderDualityButton));
});
Hooks.on('chatMessage', (_, message) => {
if (message.startsWith('/dr')) {
const rollCommand = rollCommandToJSON(message.replace(/\/dr\s?/, ''));
if (!rollCommand) {
ui.notifications.error(game.i18n.localize('DAGGERHEART.Notification.Error.DualityParsing'));
return false;
}
const attributeValue = rollCommand.attribute?.toLowerCase();
// Target not required if an attribute is not used.
const target = attributeValue ? getCommandTarget() : undefined;
if (target || !attributeValue) {
new Promise(async (resolve, reject) => {
const attribute = target ? target.system.attributes[attributeValue] : undefined;
if (attributeValue && !attribute) {
ui.notifications.error(game.i18n.localize('DAGGERHEART.Notification.Error.AttributeFaulty'));
reject();
return;
}
const title = attributeValue
? game.i18n.format('DAGGERHEART.Chat.DualityRoll.AbilityCheckTitle', {
ability: game.i18n.localize(abilities[attributeValue].label)
})
: game.i18n.localize('DAGGERHEART.General.Duality');
const hopeAndFearRoll = `1${rollCommand.hope ?? 'd12'}+1${rollCommand.fear ?? 'd12'}`;
const advantageRoll = `${rollCommand.advantage && !rollCommand.disadvantage ? '+d6' : rollCommand.disadvantage && !rollCommand.advantage ? '-d6' : ''}`;
const attributeRoll = `${attribute?.data?.value ? `${attribute.data.value > 0 ? `+${attribute.data.value}` : `${attribute.data.value}`}` : ''}`;
const roll = new Roll(`${hopeAndFearRoll}${advantageRoll}${attributeRoll}`);
await roll.evaluate();
resolve({
roll,
attribute: attribute
? {
value: attribute.data.value,
label: `${game.i18n.localize(abilities[attributeValue].label)} ${attribute.data.value >= 0 ? `+` : `-`}${attribute.data.value}`
}
: undefined,
title
});
}).then(({ roll, attribute, title }) => {
const cls = getDocumentClass('ChatMessage');
const msgData = {
type: 'dualityRoll',
sound: CONFIG.sounds.dice,
system: {
title: title,
origin: target?.id,
roll: roll._formula,
modifiers: attribute ? [attribute] : [],
hope: { dice: rollCommand.hope ?? 'd12', value: roll.dice[0].total },
fear: { dice: rollCommand.fear ?? 'd12', value: roll.dice[1].total },
advantage:
rollCommand.advantage && !rollCommand.disadvantage
? { dice: 'd6', value: roll.dice[2].total }
: undefined,
disadvantage:
rollCommand.disadvantage && !rollCommand.advantage
? { dice: 'd6', value: roll.dice[2].total }
: undefined
},
user: game.user.id,
content: 'systems/daggerheart/templates/chat/duality-roll.hbs',
rolls: [roll]
};
cls.create(msgData);
});
}
return false;
}
});
const preloadHandlebarsTemplates = async function () {
return foundry.applications.handlebars.loadTemplates([
'systems/daggerheart/templates/sheets/parts/attributes.hbs',

50
lang/en.json Normal file → Executable file
View file

@ -77,6 +77,14 @@
"Name": "Enable Range Measurement",
"Hint": "Enable measuring of ranges with the ruler according to set distances."
}
},
"DualityRollColor": {
"Name": "Duality Roll Colour Scheme",
"Hint": "The display type for Duality Rolls",
"Options": {
"Colorful": "Colorful",
"Normal": "Normal"
}
}
},
"Notification": {
@ -92,13 +100,19 @@
"LacksDomain": "Your character doesn't have the domain of the card!",
"MaxLoadoutReached": "You can't have any more domain cards at this level!",
"DuplicateDomainCard": "You already have a domain card with that name!",
"ActionRequiresTarget": "The action requires at least one target"
"ActionRequiresTarget": "The action requires at least one target",
"NoAssignedPlayerCharacter": "You have no assigned character.",
"NoSelectedToken": "You have no selected token",
"OnlyUseableByPC": "This can only be used with a PC token",
"DualityParsing": "Duality roll not properly formated",
"AttributeFaulty": "The supplied Attribute doesn't exist"
}
},
"General": {
"OpenBetaDisclaimer": "Daggerheart Open Beta {version}",
"Hope": "Hope",
"Fear": "Fear",
"Duality": "Duality",
"Check": "{check} Check",
"CriticalSuccess": "Critical Success",
"Advantage": {
"Full": "Advantage",
@ -680,10 +694,13 @@
},
"Feature": {
"Type": {
"Ancestry": "Ancestry",
"Community": "Community",
"Class": "Class",
"Subclass": "Subclass"
"ancestry": "Ancestry",
"community": "Community",
"class": "Class",
"subclass": "Subclass",
"classHope": "Class Hope",
"domainCard": "Domain Card",
"equipment": "Equipment"
},
"ValueType": {
"Normal": "Normal",
@ -995,9 +1012,18 @@
"Tabs": {
"Features": "Features",
"Effects": "Effects",
"Actions": "Actions"
"Settings": "Settings",
"Actions": "Actions",
"Description": "Description"
},
"Description": "Description"
"Description": "Description",
"effects": {
"addEffect": "Add Effect",
"applyLocation": "Apply Location",
"value": "Value",
"initiallySelected": "Initially Selected",
"hopeIncrease": "Hope Increase"
}
},
"Consumable": {
"Quantity": "Quantity",
@ -1036,16 +1062,16 @@
},
"Effects": {
"Types": {
"Health": {
"health": {
"Name": "Health"
},
"Stress": {
"stress": {
"Name": "Stress"
},
"Reach": {
"reach": {
"Name": "Reach"
},
"Damage": {
"damage": {
"Name": "Damage"
}
},

View file

@ -1,3 +1,6 @@
import { DualityRollColor } from '../config/settingsConfig.mjs';
import DhpDualityRoll from '../data/dualityRoll.mjs';
export default class DhpChatMesssage extends ChatMessage {
async renderHTML() {
if (
@ -9,6 +12,20 @@ export default class DhpChatMesssage extends ChatMessage {
this.content = await foundry.applications.handlebars.renderTemplate(this.content, this.system);
}
return super.renderHTML();
/* We can change to fully implementing the renderHTML function if needed, instead of augmenting it. */
const html = await super.renderHTML();
if (
this.type === 'dualityRoll' &&
game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.DualityRollColor) ===
DualityRollColor.colorful.value
) {
html.classList.add('duality');
const dualityResult = this.system.dualityResult;
if (dualityResult === DhpDualityRoll.dualityResult.hope) html.classList.add('hope');
else if (dualityResult === DhpDualityRoll.dualityResult.fear) html.classList.add('fear');
else html.classList.add('critical');
}
return html;
}
}

View file

@ -113,7 +113,9 @@ export default class DamageSelectionDialog extends HandlebarsApplicationMixin(Ap
}
}
static rollDamage() {
static rollDamage(event) {
event.preventDefault();
this.resolve({
rollString: this.getRollString(),
bonusDamage: this.data.bonusDamage,

View file

@ -1,3 +1,5 @@
import { DualityRollColor } from '../config/settingsConfig.mjs';
class DhpAutomationSettings extends FormApplication {
constructor(object = {}, options = {}) {
super(object, options);
@ -213,6 +215,16 @@ export const registerDHPSettings = () => {
}
});
game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.DualityRollColor, {
name: game.i18n.localize('DAGGERHEART.Settings.DualityRollColor.Name'),
hint: game.i18n.localize('DAGGERHEART.Settings.DualityRollColor.Hint'),
scope: 'world',
config: true,
type: Number,
choices: Object.values(DualityRollColor),
default: DualityRollColor.colorful.value
});
game.settings.registerMenu(SYSTEM.id, SYSTEM.SETTINGS.menu.Automation.Name, {
name: game.i18n.localize('DAGGERHEART.Settings.Menu.Automation.Name'),
label: game.i18n.localize('DAGGERHEART.Settings.Menu.Automation.Label'),

60
module/applications/sheets/feature.mjs Normal file → Executable file
View file

@ -12,7 +12,8 @@ export default class FeatureSheet extends DaggerheartSheet(ItemSheetV2) {
static DEFAULT_OPTIONS = {
tag: 'form',
classes: ['daggerheart', 'sheet', 'feature'],
id: 'daggerheart-feature',
classes: ['daggerheart', 'sheet', 'dh-style', 'feature'],
position: { width: 600, height: 600 },
window: { resizable: true },
actions: {
@ -30,17 +31,57 @@ export default class FeatureSheet extends DaggerheartSheet(ItemSheetV2) {
};
static PARTS = {
form: {
id: 'feature',
template: 'systems/daggerheart/templates/sheets/feature.hbs'
header: { template: 'systems/daggerheart/templates/sheets/items/feature/header.hbs' },
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' },
actions: {
template: 'systems/daggerheart/templates/sheets/items/feature/actions.hbs',
scrollable: ['.actions']
},
settings: {
template: 'systems/daggerheart/templates/sheets/items/feature/settings.hbs',
scrollable: ['.settings']
},
effects: {
template: 'systems/daggerheart/templates/sheets/items/feature/effects.hbs',
scrollable: ['.effects']
}
};
_getTabs() {
const tabs = {
features: { active: true, cssClass: '', group: 'primary', id: 'features', icon: null, label: 'Features' },
effects: { active: false, cssClass: '', group: 'primary', id: 'effects', icon: null, label: 'Effects' },
actions: { active: false, cssClass: '', group: 'primary', id: 'actions', icon: null, label: 'Actions' }
description: {
active: true,
cssClass: '',
group: 'primary',
id: 'description',
icon: null,
label: 'DAGGERHEART.Sheets.Feature.Tabs.Description'
},
actions: {
active: false,
cssClass: '',
group: 'primary',
id: 'actions',
icon: null,
label: 'DAGGERHEART.Sheets.Feature.Tabs.Actions'
},
settings: {
active: false,
cssClass: '',
group: 'primary',
id: 'settings',
icon: null,
label: 'DAGGERHEART.Sheets.Feature.Tabs.Settings'
},
effects: {
active: false,
cssClass: '',
group: 'primary',
id: 'effects',
icon: null,
label: 'DAGGERHEART.Sheets.Feature.Tabs.Effects'
}
};
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] ? this.tabGroups[v.group] === v.id : v.active;
@ -58,7 +99,8 @@ export default class FeatureSheet extends DaggerheartSheet(ItemSheetV2) {
async _prepareContext(_options) {
const context = await super._prepareContext(_options);
context.document = this.document;
(context.tabs = this._getTabs()), (context.generalConfig = SYSTEM.GENERAL);
context.tabs = this._getTabs();
context.generalConfig = SYSTEM.GENERAL;
context.itemConfig = SYSTEM.ITEM;
context.properties = SYSTEM.ACTOR.featureProperties;
context.dice = SYSTEM.GENERAL.diceTypes;
@ -98,7 +140,7 @@ export default class FeatureSheet extends DaggerheartSheet(ItemSheetV2) {
}
static async addAction() {
const action = await new DaggerheartAction({}, { parent: this.document });
const action = await new DaggerheartAction({ img: this.document.img }, { parent: this.document });
await this.document.update({ 'system.actions': [...this.document.system.actions, action] });
await new DaggerheartActionConfig(this.document.system.actions[this.document.system.actions.length - 1]).render(
true

File diff suppressed because it is too large Load diff

View file

@ -285,19 +285,31 @@ export const weaponFeatures = {
export const featureTypes = {
ancestry: {
id: 'ancestry',
label: 'DAGGERHEART.Feature.Type.Ancestry'
label: 'DAGGERHEART.Feature.Type.ancestry'
},
community: {
id: 'community',
label: 'DAGGERHEART.Feature.Type.Community'
label: 'DAGGERHEART.Feature.Type.community'
},
class: {
id: 'class',
label: 'DAGGERHEART.Feature.Type.Class'
label: 'DAGGERHEART.Feature.Type.class'
},
subclass: {
id: 'subclass',
label: 'DAGGERHEART.Feature.Type.Subclass'
label: 'DAGGERHEART.Feature.Type.subclass'
},
classHope: {
id: 'classHope',
label: 'DAGGERHEART.Feature.Type.classHope'
},
domainCard: {
id: 'domainCard',
label: 'DAGGERHEART.Feature.Type.domainCard'
},
equipment: {
id: 'equipment',
label: 'DAGGERHEART.Feature.Type.equipment'
}
};

View file

@ -24,5 +24,17 @@ export const gameSettings = {
General: {
AbilityArray: 'AbilityArray',
RangeMeasurement: 'RangeMeasurement'
},
DualityRollColor: 'DualityRollColor'
};
export const DualityRollColor = {
colorful: {
value: 0,
label: 'DAGGERHEART.Settings.DualityRollColor.Options.Colorful'
},
normal: {
value: 1,
label: 'DAGGERHEART.Settings.DualityRollColor.Options.Normal'
}
};

1
module/data/action.mjs Normal file → Executable file
View file

@ -4,6 +4,7 @@ export default class DaggerheartAction extends foundry.abstract.DataModel {
return {
id: new fields.StringField({}),
name: new fields.StringField({ initial: 'New Action' }),
img: new fields.StringField({ initial: '' }),
damage: new fields.SchemaField({
type: new fields.StringField({ choices: SYSTEM.GENERAL.damageTypes, nullable: true, initial: null }),
value: new fields.StringField({})

View file

@ -13,11 +13,6 @@ export default class DhpClass extends foundry.abstract.TypeDataModel {
uuid: new fields.StringField({})
})
),
damageThresholds: new fields.SchemaField({
minor: new fields.NumberField({ initial: 0, integer: true }),
major: new fields.NumberField({ initial: 0, integer: true }),
severe: new fields.NumberField({ initial: 0, integer: true })
}),
evasion: new fields.NumberField({ initial: 0, integer: true }),
features: new fields.ArrayField(
new fields.SchemaField({

View file

@ -1,3 +1,5 @@
import { DualityRollColor } from '../config/settingsConfig.mjs';
const fields = foundry.data.fields;
const diceField = () =>
new fields.SchemaField({
@ -6,6 +8,12 @@ const diceField = () =>
});
export default class DhpDualityRoll extends foundry.abstract.TypeDataModel {
static dualityResult = {
hope: 1,
fear: 2,
critical: 3
};
static defineSchema() {
return {
title: new fields.StringField(),
@ -57,17 +65,32 @@ export default class DhpDualityRoll extends foundry.abstract.TypeDataModel {
}
get total() {
const modifiers = this.modifiers.reduce((acc, x) => acc + x.value, 0);
const advantage = this.advantage.value
? this.advantage.value
: this.disadvantage.value
? -this.disadvantage.value
: 0;
return this.highestRoll + advantage + modifiers;
return this.diceTotal + advantage + this.modifierTotal.value;
}
get highestRoll() {
return Math.max(this.hope.value, this.fear.value);
get diceTotal() {
return this.hope.value + this.fear.value;
}
get modifierTotal() {
const total = this.modifiers.reduce((acc, x) => acc + x.value, 0);
return {
value: total,
label: total > 0 ? `+${total}` : total < 0 ? `-${total}` : ''
};
}
get dualityResult() {
return this.hope.value > this.fear.value
? this.constructor.dualityResult.hope
: this.fear.value > this.hope.value
? this.constructor.dualityResult.fear
: this.constructor.dualityResult.critical;
}
get totalLabel() {
@ -81,6 +104,13 @@ export default class DhpDualityRoll extends foundry.abstract.TypeDataModel {
return game.i18n.localize(label);
}
get colorful() {
return (
game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.DualityRollColor) ===
DualityRollColor.colorful.value
);
}
prepareDerivedData() {
const total = this.total;
@ -92,89 +122,3 @@ export default class DhpDualityRoll extends foundry.abstract.TypeDataModel {
});
}
}
//V1.3
// const fields = foundry.data.fields;
// const diceField = () => new fields.SchemaField({
// dice: new fields.StringField({}),
// value: new fields.NumberField({ integer: true}),
// });
// export default class DhpDualityRoll extends foundry.abstract.TypeDataModel {
// static defineSchema() {
// return {
// roll: new fields.StringField({}),
// modifiers: new fields.ArrayField(new fields.SchemaField({
// value: new fields.NumberField({ integer: true }),
// label: new fields.StringField({}),
// title: new fields.StringField({}),
// })),
// hope: diceField(),
// fear: diceField(),
// advantage: diceField(),
// disadvantage: diceField(),
// advantageSelected: new fields.NumberField({ initial: 0 }),
// targets: new fields.ArrayField(new fields.SchemaField({
// id: new fields.StringField({}),
// name: new fields.StringField({}),
// img: new fields.StringField({}),
// difficulty: new fields.NumberField({ integer: true, nullable: true }),
// evasion: new fields.NumberField({ integer: true }),
// hit: new fields.BooleanField({ initial: false }),
// })),
// damage: new fields.SchemaField({
// value: new fields.StringField({}),
// type: new fields.StringField({ choices: Object.keys(SYSTEM.GENERAL.damageTypes), integer: false }),
// bonusDamage: new fields.ArrayField(new fields.SchemaField({
// value: new fields.StringField({}),
// type: new fields.StringField({ choices: Object.keys(SYSTEM.GENERAL.damageTypes), integer: false }),
// initiallySelected: new fields.BooleanField(),
// appliesOn: new fields.StringField({ choices: Object.keys(SYSTEM.EFFECTS.applyLocations) }, { nullable: true, initial: null }),
// description: new fields.StringField({}),
// hopeIncrease: new fields.StringField({ nullable: true })
// }), { nullable: true, initial: null })
// })
// }
// }
// get total() {
// const modifiers = this.modifiers.reduce((acc, x) => acc+x.value, 0);
// const regular = {
// normal: this.disadvantage.value ? Math.min(this.disadvantage.value, this.hope.value) + this.fear.value + modifiers : this.hope.value + this.fear.value + modifiers,
// alternate: this.advantage.value ? this.advantage.value + this.fear.value + modifiers : null,
// };
// const advantageSolve = this.advantageSelected === 0 ? null : {
// normal: this.advantageSelected === 1 ? this.hope.value + this.fear.value + modifiers : this.advantage.value + this.fear.value + modifiers,
// alternate: null,
// };
// return advantageSolve ?? regular;
// }
// get totalLabel() {
// if(this.advantage.value && this.advantageSelected === 0) return game.i18n.localize("DAGGERHEART.Chat.DualityRoll.AdvantageChooseTitle");
// const hope = !this.advantage.value || this.advantageSelected === 1 ? this.hope.value : this.advantage.value;
// const label = hope > this.fear.value ? "DAGGERHEART.General.Hope" : this.fear.value > hope ? "DAGGERHEART.General.Fear" : "DAGGERHEART.General.CriticalSuccess";
// return game.i18n.localize(label);
// }
// get dualityDiceStates() {
// return {
// hope: this.hope.value > this.fear.value ? 'hope' : this.fear.value > this.hope.value ? 'fear' : 'critical',
// alternate: this.advantage.value > this.fear.value ? 'hope' : this.fear.value > this.advantage.value ? 'fear' : 'critical',
// }
// }
// prepareDerivedData(){
// const total = this.total;
// if(total.alternate) return false;
// this.targets.forEach(target => {
// target.hit = target.difficulty ? total.normal >= target.difficulty : total.normal >= target.evasion;
// });
// }
// }

View file

@ -119,7 +119,10 @@ export default class DhpActor extends Actor {
const modifiers = [
{
value: modifier.value ? Number.parseInt(modifier.value) : 0,
label: modifier.value >= 0 ? `+${modifier.value}` : `-${modifier.value}`,
label:
modifier.value >= 0
? `${modifier.title} +${modifier.value}`
: `${modifier.title} -${modifier.value}`,
title: modifier.title
}
];

View file

@ -0,0 +1,36 @@
import { abilities } from '../config/actorConfig.mjs';
import { rollCommandToJSON } from '../helpers/utils.mjs';
export function dualityRollEnricher(match, _options) {
const roll = rollCommandToJSON(match[1]);
if (!roll) return match[0];
return getDualityMessage(roll);
}
export function getDualityMessage(roll) {
const attributeLabel =
roll.attribute && abilities[roll.attribute]
? game.i18n.format('DAGGERHEART.General.Check', {
check: game.i18n.localize(abilities[roll.attribute].label)
})
: null;
const label = attributeLabel ?? game.i18n.localize('DAGGERHEART.General.Duality');
const dualityElement = document.createElement('span');
dualityElement.innerHTML = `
<button class="duality-roll-button"
data-label="${label}"
data-hope="${roll.hope ?? 'd12'}"
data-fear="${roll.fear ?? 'd12'}"
${roll.attribute && abilities[roll.attribute] ? `data-attribute="${roll.attribute}"` : ''}
${roll.advantage ? 'data-advantage="true"' : ''}
${roll.disadvantage ? 'data-disadvantage="true"' : ''}
>
<i class="fa-solid fa-circle-half-stroke"></i>
${label}
</button>
`;
return dualityElement;
}

View file

@ -22,17 +22,6 @@ const getCompendiumOptions = async compendium => {
};
export const getWidthOfText = (txt, fontsize, allCaps, bold) => {
// if(getWidthOfText.e === undefined){
// getWidthOfText.e = document.createElement('span');
// getWidthOfText.e.style.display = "none";
// document.body.appendChild(getWidthOfText.e);
// }
// if(getWidthOfText.e.style.fontSize !== fontsize)
// getWidthOfText.e.style.fontSize = fontsize;
// if(getWidthOfText.e.style.fontFamily !== 'Signika, sans-serif')
// getWidthOfText.e.style.fontFamily = 'Signika, sans-serif';
// getWidthOfText.e.innerText = txt;
// return getWidthOfText.e.offsetWidth;
const text = allCaps ? txt.toUpperCase() : txt;
if (getWidthOfText.c === undefined) {
getWidthOfText.c = document.createElement('canvas');
@ -82,3 +71,50 @@ export const generateId = (title, length) => {
.join('');
return Number.isNumeric(length) ? id.slice(0, length).padEnd(length, '0') : id;
};
export function rollCommandToJSON(text) {
if (!text) return {};
// Match key="quoted string" OR key=unquotedValue
const PAIR_RE = /(\w+)=("(?:[^"\\]|\\.)*"|\S+)/g;
const result = {};
for (const [, key, raw] of text.matchAll(PAIR_RE)) {
let value;
if (raw.startsWith('"') && raw.endsWith('"')) {
// Strip the surrounding quotes, un-escape any \" sequences
value = raw.slice(1, -1).replace(/\\"/g, '"');
} else if (/^(true|false)$/i.test(raw)) {
// Boolean
value = raw.toLowerCase() === 'true';
} else if (!Number.isNaN(Number(raw))) {
// Numeric
value = Number(raw);
} else {
// Fallback to string
value = raw;
}
result[key] = value;
}
return Object.keys(result).length > 0 ? result : null;
}
export const getCommandTarget = () => {
let target = game.canvas.tokens.controlled.length > 0 ? game.canvas.tokens.controlled[0].actor : null;
if (!game.user.isGM) {
target = game.user.character;
if (!target) {
ui.notifications.error(game.i18n.localize('DAGGERHEART.Notification.Error.NoAssignedPlayerCharacter'));
return null;
}
}
if (!target) {
ui.notifications.error(game.i18n.localize('DAGGERHEART.Notification.Error.NoSelectedToken'));
return null;
}
if (target.type !== 'pc') {
ui.notifications.error(game.i18n.localize('DAGGERHEART.Notification.Error.OnlyUseableByPC'));
return null;
}
return target;
};

View file

@ -14,7 +14,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
}
addChatListeners = async (app, html, data) => {
html.querySelectorAll('.roll-damage-button').forEach(element =>
html.querySelectorAll('.duality-action').forEach(element =>
element.addEventListener('click', event => this.onRollDamage(event, data.message))
);
html.querySelectorAll('.target-container').forEach(element => {

View file

@ -1,3 +1,303 @@
.chat-message {
&.duality {
border-color: black;
padding: 8px 0 0 0;
.message-header {
color: var(--color-light-3);
padding: 0 8px;
}
.duality-data {
display: flex;
flex-direction: column;
.duality-title {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
border-bottom: 1px solid;
margin-bottom: 2px;
display: flex;
align-items: end;
justify-content: space-between;
padding: 0 8px;
.duality-result-value {
border: 1px solid var(--color-dark-5);
padding: 2px;
font-weight: bold;
background: var(--color-dark-1);
margin-bottom: 4px;
font-size: 16px;
}
}
.duality-modifiers {
display: flex;
gap: 2px;
margin-bottom: 4px;
padding: 0 8px;
.duality-modifier {
padding: 2px;
border-radius: 6px;
border: 1px solid;
background: var(--color-dark-6);
font-size: 12px;
}
}
.duality-line {
display: flex;
align-items: end;
justify-content: space-between;
padding: 0 8px;
&.simple {
padding-right: 0;
}
.dice-outer-container {
display: flex;
align-items: center;
gap: 4px;
margin-bottom: 4px;
.dice-container {
display: flex;
flex-direction: column;
gap: 2px;
.dice-title {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
}
.dice-inner-container {
display: flex;
align-items: center;
justify-content: center;
position: relative;
.dice-wrapper {
height: 24px;
width: 24px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
clip-path: polygon(
50% 0%,
80% 10%,
100% 35%,
100% 70%,
80% 90%,
50% 100%,
20% 90%,
0% 70%,
0% 35%,
20% 10%
);
.dice {
height: 26px;
width: 26px;
max-width: unset;
position: absolute;
}
}
.dice-value {
position: absolute;
font-weight: bold;
font-size: 16px;
}
&.hope {
.dice-wrapper {
background: black;
.dice {
filter: brightness(0) saturate(100%) invert(79%) sepia(79%) saturate(333%)
hue-rotate(352deg) brightness(102%) contrast(103%);
}
}
.dice-value {
color: var(--color-dark-1);
text-shadow: 0 0 4px white;
}
}
&.fear {
.dice-wrapper {
background: white;
.dice {
filter: brightness(0) saturate(100%) invert(12%) sepia(88%) saturate(4321%)
hue-rotate(221deg) brightness(92%) contrast(110%);
}
}
.dice-value {
color: var(--color-light-1);
text-shadow: 0 0 4px black;
}
}
}
}
.advantage-container {
padding-top: 21px;
.dice-wrapper {
height: 24px;
width: 24px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
.dice {
height: 26px;
width: 26px;
max-width: unset;
position: absolute;
}
.dice-value {
position: absolute;
font-weight: bold;
font-size: 16px;
}
}
&.advantage {
.dice-wrapper {
.dice {
filter: brightness(0) saturate(100%) invert(18%) sepia(92%) saturate(4133%)
hue-rotate(96deg) brightness(104%) contrast(107%);
}
}
}
&.disadvantage {
.dice-wrapper {
.dice {
filter: brightness(0) saturate(100%) invert(9%) sepia(78%) saturate(6903%)
hue-rotate(11deg) brightness(93%) contrast(117%);
}
}
}
}
.duality-modifier {
padding-top: 21px;
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-size: 16px;
}
}
}
}
.duality-result {
display: flex;
flex-direction: column;
align-items: end;
justify-content: center;
gap: 2px;
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-weight: bold;
background: var(--color-dark-1);
padding: 4px;
border-radius: 6px 0 0 0;
}
.duality-actions {
display: flex;
justify-content: space-between;
.duality-action {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-weight: bold;
background: var(--color-dark-1);
padding: 4px;
border-radius: 0 6px 0 0;
border-color: black;
min-height: unset;
height: 26px;
&:hover {
background: var(--button-hover-background-color);
}
}
}
.target-section {
margin: 4px 4px;
border: 2px solid;
.target-container {
display: flex;
align-items: center;
transition: all 0.2s ease-in-out;
&:hover {
filter: drop-shadow(0 0 3px @secondaryShadow);
border-color: gold;
}
&.hit {
background: @hit;
}
&.miss {
background: @miss;
}
img {
flex: 0;
width: 22px;
height: 22px;
margin-left: 8px;
align-self: center;
border-color: transparent;
}
.target-inner-container {
flex: 1;
display: flex;
justify-content: center;
margin-right: @hugeMargin;
font-weight: bold;
font-size: 17px;
}
}
}
&.hope {
background: linear-gradient(0, @hopeBackgroundEnd 40px, @hopeBackgroundStart);
}
&.fear {
background: linear-gradient(0, @fearBackgroundEnd, @fearBackgroundStart);
}
&.critical {
background: linear-gradient(0, @criticalBackgroundEnd, @criticalBackgroundStart);
}
.dice-roll {
color: var(--color-dark-1);
.dice-flavor {
color: var(--color-light-1);
}
}
}
}
.daggerheart.chat {
&.downtime {
display: flex;
@ -110,6 +410,24 @@
}
.dice-total {
&.duality {
&.hope {
border-color: @hope;
border-width: 3px;
background: rgba(@hope, 0.5);
}
&.fear {
border-color: @fear;
border-width: 3px;
background: rgba(@fear, 0.5);
}
&.critical {
border-color: @critical;
border-width: 3px;
background: rgba(@critical, 0.5);
}
}
.dice-total-value {
.hope {
color: @hope;

636
styles/daggerheart.css Normal file → Executable file
View file

@ -1,11 +1,12 @@
/* General */
/* Drop Shadows */
/* Background */
/* Base Value */
/* Margins */
/* Borders */
/* Padding */
/* Inputs */
/* General */
/* Drop Shadows */
/* Background */
/* Duality */
@import '../node_modules/@yaireo/tagify/dist/tagify.css';
.daggerheart.sheet.class .editor {
height: 500px;
@ -1346,6 +1347,234 @@
cursor: pointer;
filter: drop-shadow(0 0 3px red);
}
.chat-message.duality {
border-color: black;
padding: 8px 0 0 0;
}
.chat-message.duality .message-header {
color: var(--color-light-3);
padding: 0 8px;
}
.chat-message.duality .duality-data {
display: flex;
flex-direction: column;
}
.chat-message.duality .duality-data .duality-title {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
border-bottom: 1px solid;
margin-bottom: 2px;
display: flex;
align-items: end;
justify-content: space-between;
padding: 0 8px;
}
.chat-message.duality .duality-data .duality-title .duality-result-value {
border: 1px solid var(--color-dark-5);
padding: 2px;
font-weight: bold;
background: var(--color-dark-1);
margin-bottom: 4px;
font-size: 16px;
}
.chat-message.duality .duality-data .duality-modifiers {
display: flex;
gap: 2px;
margin-bottom: 4px;
padding: 0 8px;
}
.chat-message.duality .duality-data .duality-modifiers .duality-modifier {
padding: 2px;
border-radius: 6px;
border: 1px solid;
background: var(--color-dark-6);
font-size: 12px;
}
.chat-message.duality .duality-data .duality-line {
display: flex;
align-items: end;
justify-content: space-between;
padding: 0 8px;
}
.chat-message.duality .duality-data .duality-line.simple {
padding-right: 0;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container {
display: flex;
align-items: center;
gap: 4px;
margin-bottom: 4px;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container {
display: flex;
flex-direction: column;
gap: 2px;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-title {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container {
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container .dice-wrapper {
height: 24px;
width: 24px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
clip-path: polygon(50% 0%, 80% 10%, 100% 35%, 100% 70%, 80% 90%, 50% 100%, 20% 90%, 0% 70%, 0% 35%, 20% 10%);
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container .dice-wrapper .dice {
height: 26px;
width: 26px;
max-width: unset;
position: absolute;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container .dice-value {
position: absolute;
font-weight: bold;
font-size: 16px;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.hope .dice-wrapper {
background: black;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.hope .dice-wrapper .dice {
filter: brightness(0) saturate(100%) invert(79%) sepia(79%) saturate(333%) hue-rotate(352deg) brightness(102%) contrast(103%);
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.hope .dice-value {
color: var(--color-dark-1);
text-shadow: 0 0 4px white;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.fear .dice-wrapper {
background: white;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.fear .dice-wrapper .dice {
filter: brightness(0) saturate(100%) invert(12%) sepia(88%) saturate(4321%) hue-rotate(221deg) brightness(92%) contrast(110%);
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .dice-container .dice-inner-container.fear .dice-value {
color: var(--color-light-1);
text-shadow: 0 0 4px black;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container {
padding-top: 21px;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container .dice-wrapper {
height: 24px;
width: 24px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container .dice-wrapper .dice {
height: 26px;
width: 26px;
max-width: unset;
position: absolute;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container .dice-wrapper .dice-value {
position: absolute;
font-weight: bold;
font-size: 16px;
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container.advantage .dice-wrapper .dice {
filter: brightness(0) saturate(100%) invert(18%) sepia(92%) saturate(4133%) hue-rotate(96deg) brightness(104%) contrast(107%);
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .advantage-container.disadvantage .dice-wrapper .dice {
filter: brightness(0) saturate(100%) invert(9%) sepia(78%) saturate(6903%) hue-rotate(11deg) brightness(93%) contrast(117%);
}
.chat-message.duality .duality-data .duality-line .dice-outer-container .duality-modifier {
padding-top: 21px;
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-size: 16px;
}
.chat-message.duality .duality-result {
display: flex;
flex-direction: column;
align-items: end;
justify-content: center;
gap: 2px;
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-weight: bold;
background: var(--color-dark-1);
padding: 4px;
border-radius: 6px 0 0 0;
}
.chat-message.duality .duality-actions {
display: flex;
justify-content: space-between;
}
.chat-message.duality .duality-actions .duality-action {
color: var(--color-light-1);
text-shadow: 0 0 1px black;
font-weight: bold;
background: var(--color-dark-1);
padding: 4px;
border-radius: 0 6px 0 0;
border-color: black;
min-height: unset;
height: 26px;
}
.chat-message.duality .duality-actions .duality-action:hover {
background: var(--button-hover-background-color);
}
.chat-message.duality .target-section {
margin: 4px 4px;
border: 2px solid;
}
.chat-message.duality .target-section .target-container {
display: flex;
align-items: center;
transition: all 0.2s ease-in-out;
}
.chat-message.duality .target-section .target-container:hover {
filter: drop-shadow(0 0 3px gold);
border-color: gold;
}
.chat-message.duality .target-section .target-container.hit {
background: #008000;
}
.chat-message.duality .target-section .target-container.miss {
background: #ff0000;
}
.chat-message.duality .target-section .target-container img {
flex: 0;
width: 22px;
height: 22px;
margin-left: 8px;
align-self: center;
border-color: transparent;
}
.chat-message.duality .target-section .target-container .target-inner-container {
flex: 1;
display: flex;
justify-content: center;
margin-right: 32px;
font-weight: bold;
font-size: 17px;
}
.chat-message.duality.hope {
background: linear-gradient(0, rgba(165, 42, 42, 0.6) 40px, rgba(0, 0, 0, 0.6));
}
.chat-message.duality.fear {
background: linear-gradient(0, rgba(0, 0, 255, 0.6), rgba(15, 15, 97, 0.6));
}
.chat-message.duality.critical {
background: linear-gradient(0, rgba(128, 0, 128, 0.6), rgba(37, 8, 37, 0.6));
}
.chat-message.duality .dice-roll {
color: var(--color-dark-1);
}
.chat-message.duality .dice-roll .dice-flavor {
color: var(--color-light-1);
}
.daggerheart.chat.downtime {
display: flex;
flex-direction: column;
@ -1391,7 +1620,7 @@
}
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.hope {
color: white;
-webkit-text-stroke-color: #008080;
-webkit-text-stroke-color: #ffe760;
-webkit-text-stroke-width: 1.5px;
font-weight: 400;
}
@ -1400,7 +1629,7 @@
}
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.fear {
color: white;
-webkit-text-stroke-color: #430070;
-webkit-text-stroke-color: #0032b1;
-webkit-text-stroke-width: 1.5px;
font-weight: 400;
}
@ -1415,7 +1644,7 @@
}
.daggerheart.chat.roll .dice-tooltip .dice-rolls.duality .roll.die.advantage {
color: white;
-webkit-text-stroke-color: green;
-webkit-text-stroke-color: #008000;
-webkit-text-stroke-width: 1.5px;
font-weight: 400;
}
@ -1431,14 +1660,29 @@
text-align: end;
font-weight: bold;
}
.daggerheart.chat.roll .dice-total.duality.hope {
border-color: #ffe760;
border-width: 3px;
background: rgba(255, 231, 96, 0.5);
}
.daggerheart.chat.roll .dice-total.duality.fear {
border-color: #0032b1;
border-width: 3px;
background: rgba(0, 50, 177, 0.5);
}
.daggerheart.chat.roll .dice-total.duality.critical {
border-color: #430070;
border-width: 3px;
background: rgba(67, 0, 112, 0.5);
}
.daggerheart.chat.roll .dice-total .dice-total-value .hope {
color: #008080;
color: #ffe760;
}
.daggerheart.chat.roll .dice-total .dice-total-value .fear {
color: #430070;
color: #0032b1;
}
.daggerheart.chat.roll .dice-total .dice-total-value .critical {
color: #ffd700;
color: #430070;
}
.daggerheart.chat.roll .dice-total-label {
font-size: 12px;
@ -1562,7 +1806,6 @@
align-items: baseline;
}
.daggerheart.sheet .item-sidebar {
border-right: 1px groove darkgray;
min-width: 160px;
flex: 0;
padding: 4px;
@ -2541,6 +2784,369 @@ div.daggerheart.views.multiclass {
.item-button .item-icon.checked {
opacity: 1;
}
.application.sheet.daggerheart.dh-style.feature .item-sheet-header {
display: flex;
}
.application.sheet.daggerheart.dh-style.feature .item-sheet-header .profile {
height: 130px;
width: 130px;
}
.application.sheet.daggerheart.dh-style.feature section.tab {
height: 400px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: light-dark(#18162e, #f3c267) transparent;
}
.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list {
display: flex;
flex-direction: column;
list-style: none;
padding: 0;
margin: 0;
width: 100%;
gap: 5px;
}
.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list .action-item {
display: grid;
align-items: center;
grid-template-columns: 1fr 4fr 1fr;
cursor: pointer;
}
.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list .action-item h4 {
font-family: 'Montserrat', sans-serif;
font-weight: lighter;
color: #efe6d8;
}
.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list .action-item .image {
height: 40px;
width: 40px;
object-fit: cover;
border-radius: 6px;
border: none;
}
.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list .action-item .controls {
display: flex;
justify-content: center;
gap: 10px;
}
.application.sheet.daggerheart.dh-style.feature .tab.actions .actions-list .action-item .controls a {
text-shadow: none;
}
@font-face {
font-family: 'Cinzel';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/cinzel/v23/8vIU7ww63mVu7gtR-kwKxNvkNOjw-tbnTYo.ttf) format('truetype');
}
@font-face {
font-family: 'Cinzel';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url(https://fonts.gstatic.com/s/cinzel/v23/8vIU7ww63mVu7gtR-kwKxNvkNOjw-jHgTYo.ttf) format('truetype');
}
@font-face {
font-family: 'Cinzel Decorative';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url(https://fonts.gstatic.com/s/cinzeldecorative/v17/daaHSScvJGqLYhG8nNt8KPPswUAPniZoaelD.ttf) format('truetype');
}
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/montserrat/v29/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtr6Ew-.ttf) format('truetype');
}
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 600;
font-display: swap;
src: url(https://fonts.gstatic.com/s/montserrat/v29/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCu170w-.ttf) format('truetype');
}
.application.sheet.daggerheart.dh-style h1 {
font-family: 'Cinzel Decorative', serif;
margin: 0;
border: none;
font-weight: normal;
}
.application.sheet.daggerheart.dh-style h2,
.application.sheet.daggerheart.dh-style h3 {
font-family: 'Cinzel', serif;
margin: 0;
border: none;
font-weight: normal;
}
.application.sheet.daggerheart.dh-style h4 {
font-family: 'Montserrat', sans-serif;
font-size: 14px;
border: none;
font-weight: 700;
margin: 0;
text-shadow: none;
color: #f3c267;
font-weight: normal;
}
.application.sheet.daggerheart.dh-style h5 {
font-size: 14px;
color: #f3c267;
margin: 0;
font-weight: normal;
}
.application.sheet.daggerheart.dh-style p,
.application.sheet.daggerheart.dh-style span {
font-family: 'Montserrat', sans-serif;
}
.application.sheet.daggerheart.dh-style small {
font-family: 'Montserrat', sans-serif;
opacity: 0.8;
}
.application.sheet.dh-style .window-header {
background: transparent;
border-bottom: none;
justify-content: end;
}
.application.sheet.dh-style .window-header h1 {
color: light-dark(#18162e, #efe6d8);
font-family: 'Montserrat', sans-serif;
}
.application.sheet.dh-style .window-header button {
background: light-dark(transparent, #0e0d15);
color: light-dark(#18162e, #efe6d8);
border: 1px solid light-dark(#18162e, transparent);
padding: 0;
}
.application.sheet.dh-style .window-header button:hover {
border: 1px solid light-dark(#18162e, #f3c267);
color: light-dark(#18162e, #f3c267);
}
.application.sheet.dh-style:not(.minimized) .window-title,
.application.sheet.dh-style:not(.minimized) .window-icon {
display: none;
opacity: 0;
transition: opacity 0.3s ease;
}
.application.sheet.dh-style.minimized .window-content {
display: none;
opacity: 0;
transition: opacity 0.1s ease;
}
.application.sheet.dh-style:not(.minimized) .window-content {
opacity: 1;
transition: opacity 0.3s ease;
}
.application.sheet.dh-style .window-content {
overflow: initial;
backdrop-filter: none;
padding: 0;
}
.theme-dark .application.sheet.dh-style {
backdrop-filter: blur(4px);
}
.theme-light .application.sheet.dh-style {
background-image: url('../assets/parchments/dh-parchment-light.png');
background-repeat: no-repeat;
background-position: center;
}
.application.sheet.daggerheart.dh-style .window-content {
position: relative;
top: -36px;
}
.application.sheet.daggerheart.dh-style .window-content .tab {
padding: 0 10px;
}
.application.sheet.dh-style {
border: 1px solid light-dark(#18162e, #f3c267);
}
.application.sheet.dh-style input[type='text'],
.application.sheet.dh-style input[type='number'] {
background: light-dark(transparent, transparent);
border-radius: 6px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
backdrop-filter: blur(9.5px);
-webkit-backdrop-filter: blur(9.5px);
outline: none;
color: light-dark(#18162e, #f3c267);
border: 1px solid light-dark(#222, #efe6d8);
}
.application.sheet.dh-style input[type='text']:hover[type='text'],
.application.sheet.dh-style input[type='number']:hover[type='text'],
.application.sheet.dh-style input[type='text']:hover[type='number'],
.application.sheet.dh-style input[type='number']:hover[type='number'],
.application.sheet.dh-style input[type='text']:focus[type='text'],
.application.sheet.dh-style input[type='number']:focus[type='text'],
.application.sheet.dh-style input[type='text']:focus[type='number'],
.application.sheet.dh-style input[type='number']:focus[type='number'] {
background: light-dark(rgba(0, 0, 0, 0.05), rgba(24, 22, 46, 0.33));
box-shadow: none;
outline: 2px solid light-dark(#222, #efe6d8);
}
.application.sheet.dh-style input[type='checkbox']:checked::after {
color: light-dark(#18162e, #f3c267);
}
.application.sheet.dh-style input[type='checkbox']::before {
color: light-dark(#f3c267, #18162e);
}
.application.sheet.dh-style button {
background: light-dark(transparent, #f3c267);
border: 1px solid light-dark(#18162e, #18162e);
color: light-dark(#18162e, #18162e);
outline: none;
box-shadow: none;
}
.application.sheet.dh-style button:hover {
background: light-dark(rgba(0, 0, 0, 0.3), #18162e);
color: light-dark(#18162e, #f3c267);
}
.application.sheet.dh-style select {
background: light-dark(transparent, transparent);
color: light-dark(#222, #efe6d8);
font-family: 'Montserrat', sans-serif;
outline: 2px solid transparent;
border: 1px solid light-dark(#222, #efe6d8);
}
.application.sheet.dh-style select:focus,
.application.sheet.dh-style select:hover {
outline: 2px solid light-dark(#222, #efe6d8);
box-shadow: none;
}
.application.sheet.dh-style select option {
color: #efe6d8;
background-color: #18162e;
border-radius: 6px;
}
.application.sheet.dh-style p {
margin: 0;
}
.application.sheet.dh-style ul {
margin: 0;
padding: 0;
list-style: none;
}
.application.sheet.dh-style li {
margin: 0;
}
.application.sheet.dh-style fieldset {
align-items: center;
margin-top: 5px;
border-radius: 6px;
border-color: light-dark(#18162e, #f3c267);
}
.application.sheet.dh-style fieldset.one-column {
display: flex;
flex-direction: column;
align-items: start;
gap: 10px;
min-height: 64px;
}
.application.sheet.dh-style fieldset.two-columns {
display: grid;
grid-template-columns: 1fr 2fr;
gap: 10px;
}
.application.sheet.dh-style fieldset legend {
font-family: 'Montserrat', sans-serif;
font-weight: bold;
color: light-dark(#18162e, #f3c267);
}
.application.sheet.dh-style fieldset legend a {
text-shadow: none;
}
.application.sheet.dh-style fieldset input[type='text'],
.application.sheet.dh-style fieldset input[type='number'] {
color: light-dark(#222, #efe6d8);
font-family: 'Montserrat', sans-serif;
transition: all 0.3s ease;
outline: 2px solid transparent;
}
.application.sheet.dh-style fieldset input[type='text']:focus,
.application.sheet.dh-style fieldset input[type='number']:focus,
.application.sheet.dh-style fieldset input[type='text']:hover,
.application.sheet.dh-style fieldset input[type='number']:hover {
outline: 2px solid light-dark(#222, #efe6d8);
}
.application.sheet.dh-style fieldset .nest-inputs {
display: flex;
align-items: center;
gap: 5px;
}
.application.sheet.dh-style line-div {
display: block;
height: 1px;
width: 100%;
border-bottom: 1px solid light-dark(#18162e, #f3c267);
mask-image: linear-gradient(270deg, transparent 0%, black 50%, transparent 100%);
}
.application.sheet.dh-style .item-description {
opacity: 1;
transform: translateY(0);
transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
.application.sheet.dh-style .item-description.invisible {
height: 0;
opacity: 0;
overflow: hidden;
transform: translateY(-20px);
transform-origin: top;
}
.sheet.daggerheart.dh-style .tab-navigation {
margin: 5px 0;
height: 40px;
}
.sheet.daggerheart.dh-style .tab-navigation .feature-tab {
border: none;
gap: 5px;
}
.sheet.daggerheart.dh-style .tab-navigation .feature-tab a {
color: light-dark(#18162e, #f3c267);
text-shadow: none;
font-family: 'Montserrat', sans-serif;
}
.application.sheet.daggerheart.dh-style .item-sheet-header {
display: flex;
}
.application.sheet.daggerheart.dh-style .item-sheet-header .profile {
height: 150px;
width: 150px;
object-fit: cover;
border-right: 1px solid light-dark(#18162e, #f3c267);
border-bottom: 1px solid light-dark(#18162e, #f3c267);
box-sizing: border-box;
cursor: pointer;
}
.application.sheet.daggerheart.dh-style .item-sheet-header .item-info {
display: flex;
flex-direction: column;
align-items: center;
gap: 5px;
margin-top: 36px;
text-align: center;
width: 80%;
}
.application.sheet.daggerheart.dh-style .item-sheet-header .item-info .item-name input[type='text'] {
font-size: 32px;
height: 42px;
text-align: center;
width: 90%;
transition: all 0.3s ease;
outline: 2px solid transparent;
border: 1px solid transparent;
}
.application.sheet.daggerheart.dh-style .item-sheet-header .item-info .item-name input[type='text']:hover[type='text'],
.application.sheet.daggerheart.dh-style .item-sheet-header .item-info .item-name input[type='text']:focus[type='text'] {
box-shadow: none;
outline: 2px solid light-dark(#18162e, #f3c267);
}
.application.sheet.daggerheart.dh-style .item-sheet-header .item-info .item-description {
display: flex;
gap: 10px;
}
.application.sheet.daggerheart.dh-style .item-sheet-header .item-info h3 {
font-size: 1rem;
}
#logo {
content: url(../assets/DaggerheartLogo.webp);
height: 50px;
@ -2591,21 +3197,11 @@ div.daggerheart.views.multiclass {
.daggerheart .icon-button.spaced {
margin-left: 4px;
}
.daggerheart .icon-button.active {
filter: drop-shadow(0 0 3px red);
}
.daggerheart .icon-button.active.secondary {
filter: drop-shadow(0 0 3px gold);
}
.daggerheart .icon-button.disabled {
opacity: 0.6;
}
.daggerheart .icon-button:hover:not(.disabled) {
cursor: pointer;
filter: drop-shadow(0 0 3px red);
}
.daggerheart .icon-button:hover:not(.disabled).secondary {
filter: drop-shadow(0 0 3px gold);
}
#players h3 {
display: flex;

25
styles/daggerheart.less Normal file → Executable file
View file

@ -1,4 +1,5 @@
@import './variables/variables.less';
@import './variables/colors.less';
@import './class.less';
@import './pc.less';
@import './ui.less';
@ -10,6 +11,17 @@
@import './dialog.less';
@import '../node_modules/@yaireo/tagify/dist/tagify.css';
// new styles imports
@import './less/items/feature.less';
@import './less/utils/colors.less';
@import './less/utils/fonts.less';
@import './less/global/sheet.less';
@import './less/global/elements.less';
@import './less/global/tab-navigation.less';
@import './less/global/item-header.less';
#logo {
content: url(../assets/DaggerheartLogo.webp);
height: 50px;
@ -72,25 +84,12 @@
margin-left: @halfMargin;
}
&.active {
filter: drop-shadow(0 0 3px @mainShadow);
&.secondary {
filter: drop-shadow(0 0 3px @secondaryShadow);
}
}
&.disabled {
opacity: 0.6;
}
&:hover:not(.disabled) {
cursor: pointer;
filter: drop-shadow(0 0 3px @mainShadow);
&.secondary {
filter: drop-shadow(0 0 3px @secondaryShadow);
}
}
}

2
styles/item.less Normal file → Executable file
View file

@ -42,7 +42,7 @@
}
.item-sidebar {
border-right: @thinBorder groove darkgray;
// border-right: @thinBorder groove darkgray;
min-width: 160px;
flex: 0;
padding: @fullPadding;

158
styles/less/global/elements.less Executable file
View file

@ -0,0 +1,158 @@
@import '../utils/colors.less';
@import '../utils/fonts.less';
.application.sheet.dh-style {
border: 1px solid light-dark(@dark-blue, @golden);
input[type='text'],
input[type='number'] {
background: light-dark(transparent, transparent);
border-radius: 6px;
box-shadow: 0 4px 30px @soft-shadow;
backdrop-filter: blur(9.5px);
-webkit-backdrop-filter: blur(9.5px);
outline: none;
color: light-dark(@dark-blue, @golden);
border: 1px solid light-dark(@dark, @beige);
&:hover[type='text'],
&:hover[type='number'],
&:focus[type='text'],
&:focus[type='number'] {
background: light-dark(@soft-shadow, @semi-transparent-dark-blue);
box-shadow: none;
outline: 2px solid light-dark(@dark, @beige);
}
}
input[type='checkbox'] {
&:checked::after {
color: light-dark(@dark-blue, @golden);
}
&::before {
color: light-dark(@golden, @dark-blue);
}
}
button {
background: light-dark(transparent, @golden);
border: 1px solid light-dark(@dark-blue, @dark-blue);
color: light-dark(@dark-blue, @dark-blue);
outline: none;
box-shadow: none;
&:hover {
background: light-dark(@light-black, @dark-blue);
color: light-dark(@dark-blue, @golden);
}
}
select {
background: light-dark(transparent, transparent);
color: light-dark(@dark, @beige);
font-family: @font-body;
outline: 2px solid transparent;
border: 1px solid light-dark(@dark, @beige);
&:focus,
&:hover {
outline: 2px solid light-dark(@dark, @beige);
box-shadow: none;
}
& option {
color: @beige;
background-color: @dark-blue;
border-radius: 6px;
}
}
p {
margin: 0;
}
ul {
margin: 0;
padding: 0;
list-style: none;
}
li {
margin: 0;
}
fieldset {
align-items: center;
margin-top: 5px;
border-radius: 6px;
border-color: light-dark(@dark-blue, @golden);
&.one-column {
display: flex;
flex-direction: column;
align-items: start;
gap: 10px;
min-height: 64px;
}
&.two-columns {
display: grid;
grid-template-columns: 1fr 2fr;
gap: 10px;
}
legend {
font-family: @font-body;
font-weight: bold;
color: light-dark(@dark-blue, @golden);
a {
text-shadow: none;
}
}
input[type='text'],
input[type='number'] {
color: light-dark(@dark, @beige);
font-family: @font-body;
transition: all 0.3s ease;
outline: 2px solid transparent;
&:focus,
&:hover {
outline: 2px solid light-dark(@dark, @beige);
}
}
.nest-inputs {
display: flex;
align-items: center;
gap: 5px;
}
}
line-div {
display: block;
height: 1px;
width: 100%;
border-bottom: 1px solid light-dark(@dark-blue, @golden);
mask-image: linear-gradient(270deg, transparent 0%, black 50%, transparent 100%);
}
.item-description {
opacity: 1;
transform: translateY(0);
transition:
opacity 0.3s ease-out,
transform 0.3s ease-out;
}
.item-description.invisible {
height: 0;
opacity: 0;
overflow: hidden;
transform: translateY(-20px);
transform-origin: top;
}
}

View file

@ -0,0 +1,52 @@
@import '../utils/colors.less';
.application.sheet.daggerheart.dh-style {
.item-sheet-header {
display: flex;
.profile {
height: 150px;
width: 150px;
object-fit: cover;
border-right: 1px solid light-dark(@dark-blue, @golden);
border-bottom: 1px solid light-dark(@dark-blue, @golden);
box-sizing: border-box;
cursor: pointer;
}
.item-info {
display: flex;
flex-direction: column;
align-items: center;
gap: 5px;
margin-top: 36px;
text-align: center;
width: 80%;
.item-name input[type='text'] {
font-size: 32px;
height: 42px;
text-align: center;
width: 90%;
transition: all 0.3s ease;
outline: 2px solid transparent;
border: 1px solid transparent;
&:hover[type='text'],
&:focus[type='text'] {
box-shadow: none;
outline: 2px solid light-dark(@dark-blue, @golden);
}
}
.item-description {
display: flex;
gap: 10px;
}
h3 {
font-size: 1rem;
}
}
}
}

81
styles/less/global/sheet.less Executable file
View file

@ -0,0 +1,81 @@
@import '../utils/colors.less';
@import '../utils/fonts.less';
.application.sheet.dh-style .window-header {
background: transparent;
border-bottom: none;
justify-content: end;
h1 {
color: light-dark(@dark-blue, @beige);
font-family: @font-body;
}
button {
background: light-dark(transparent, @deep-black);
color: light-dark(@dark-blue, @beige);
border: 1px solid light-dark(@dark-blue, transparent);
padding: 0;
&:hover {
border: 1px solid light-dark(@dark-blue, @golden);
color: light-dark(@dark-blue, @golden);
}
}
}
.application.sheet.dh-style:not(.minimized) {
.window-title,
.window-icon {
display: none;
opacity: 0;
transition: opacity 0.3s ease;
}
}
.application.sheet.dh-style.minimized {
.window-content {
display: none;
opacity: 0;
transition: opacity 0.1s ease;
}
}
.application.sheet.dh-style:not(.minimized) {
.window-content {
opacity: 1;
transition: opacity 0.3s ease;
}
}
.application.sheet.dh-style .window-content {
overflow: initial;
backdrop-filter: none;
padding: 0;
}
.theme-dark {
.application.sheet.dh-style {
backdrop-filter: blur(4px);
}
}
.theme-light {
.application.sheet.dh-style {
background-image: url('../assets/parchments/dh-parchment-light.png');
background-repeat: no-repeat;
background-position: center;
}
}
// D:\Foundry\v13\data\Data\systems\daggerheart\assets\parchments\dh-parchment-light.png
.application.sheet.daggerheart.dh-style {
.window-content {
position: relative;
top: -36px;
.tab {
padding: 0 10px;
}
}
}

View file

@ -0,0 +1,20 @@
@import '../utils/colors.less';
@import '../utils/fonts.less';
.sheet.daggerheart.dh-style {
.tab-navigation {
margin: 5px 0;
height: 40px;
.feature-tab {
border: none;
gap: 5px;
a {
color: light-dark(@dark-blue, @golden);
text-shadow: none;
font-family: @font-body;
}
}
}
}

62
styles/less/items/feature.less Executable file
View file

@ -0,0 +1,62 @@
@import '../utils/colors.less';
@import '../utils/fonts.less';
.application.sheet.daggerheart.dh-style.feature {
.item-sheet-header {
display: flex;
.profile {
height: 130px;
width: 130px;
}
}
section.tab {
height: 400px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: light-dark(@dark-blue, @golden) transparent;
}
.tab.actions {
.actions-list {
display: flex;
flex-direction: column;
list-style: none;
padding: 0;
margin: 0;
width: 100%;
gap: 5px;
.action-item {
display: grid;
align-items: center;
grid-template-columns: 1fr 4fr 1fr;
cursor: pointer;
h4 {
font-family: @font-body;
font-weight: lighter;
color: @beige;
}
.image {
height: 40px;
width: 40px;
object-fit: cover;
border-radius: 6px;
border: none;
}
.controls {
display: flex;
justify-content: center;
gap: 10px;
a {
text-shadow: none;
}
}
}
}
}
}

22
styles/less/utils/colors.less Executable file
View file

@ -0,0 +1,22 @@
@primary-blue: #1488cc;
@secondary-blue: #2b32b2;
@golden: #f3c267;
@dark-blue: #18162e;
@deep-black: #0e0d15;
@beige: #efe6d8;
@beige-60-opacity: #efe6d860;
@dark-blue: rgb(24, 22, 46);
@semi-transparent-dark-blue: rgba(24, 22, 46, 0.33);
@dark: #222;
@light-black: rgba(0, 0, 0, 0.3);
@soft-shadow: rgba(0, 0, 0, 0.05);
@gradient-hp: linear-gradient(15deg, rgb(70, 20, 10) 0%, rgb(190, 0, 0) 42%, rgb(252, 176, 69) 100%);
@gradient-stress: linear-gradient(15deg, rgb(130, 59, 1) 0%, rgb(252, 142, 69) 65%, rgb(190, 0, 0) 100%);
.theme-dark {
@primary-color: @golden;
}
.theme-light {
@primary-color: @dark-blue;
}

50
styles/less/utils/fonts.less Executable file
View file

@ -0,0 +1,50 @@
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Cinzel+Decorative:wght@700&family=Montserrat:wght@400;600&display=swap');
@font-title: 'Cinzel Decorative', serif;
@font-subtitle: 'Cinzel', serif;
@font-body: 'Montserrat', sans-serif;
.application.sheet.daggerheart.dh-style {
h1 {
font-family: @font-title;
margin: 0;
border: none;
font-weight: normal;
}
h2,
h3 {
font-family: @font-subtitle;
margin: 0;
border: none;
font-weight: normal;
}
h4 {
font-family: @font-body;
font-size: 14px;
border: none;
font-weight: 700;
margin: 0;
text-shadow: none;
color: #f3c267;
font-weight: normal;
}
h5 {
font-size: 14px;
color: #f3c267;
margin: 0;
font-weight: normal;
}
p,
span {
font-family: @font-body;
}
small {
font-family: @font-body;
opacity: 0.8;
}
}

View file

@ -1,8 +1,5 @@
/* General */
@hope: #008080;
@fear: #430070;
@critical: #ffd700;
@advantage: green;
@advantage: #008000;
@disadvantage: #b30000;
@miss: rgb(255, 0, 0);
@hit: rgb(0, 128, 0);
@ -22,3 +19,16 @@
@secondaryAccent: #708090;
@formBackground: #782e22;
@hoverBackground: #2f4f4f40;
/* Duality */
@hope: #ffe760;
@hopeBackgroundStart: rgba(0, 0, 0, 0.6);
@hopeBackgroundEnd: rgba(165, 42, 42, 0.6);
@fear: #0032b1;
@fearAccent: #2555cd;
@fearBackgroundStart: rgba(15, 15, 97, 0.6);
@fearBackgroundEnd: rgba(0, 0, 255, 0.6);
@critical: #430070;
@criticalAccent: #66159c;
@criticalBackgroundStart: rgba(37, 8, 37, 0.6);
@criticalBackgroundEnd: rgba(128, 0, 128, 0.6);

View file

@ -1,70 +1,76 @@
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor">{{localize "DAGGERHEART.Chat.AttackRoll.Title" attack=this.title}}</div>
<div class="dice-result">
<div class="dice-formula">{{roll}}</div>
<div class="dice-tooltip">
<div class="wrapper">
<section class="tooltip-part">
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{hope.dice}}</span>
|
<span>1{{fear.dice}}</span>
</span>
<span class="part-total">{{this.highestRoll}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls duality">
<li class="roll die {{hope.dice}} {{#if hope.discarded}}discarded{{/if}} hope min" title="{{localize "DAGGERHEART.General.Hope"}}">{{hope.value}}</li>
<li class="roll die {{fear.dice}} {{#if fear.discarded}}discarded{{/if}} fear min" title="{{localize "DAGGERHEART.General.Fear"}}">{{fear.value}}</li>
</ol>
</div>
</div>
{{#if advantage.value}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{advantage.dice}}</span>
</span>
<span class="part-total">{{advantage.value}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
<li class="roll die {{advantage.dice}} hope min">{{advantage.value}}</li>
</ol>
</div>
</div>
{{/if}}
{{#if disadvantage.value}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{disadvantage.dice}}</span>
</span>
<span class="part-total">{{disadvantage.value}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
<li class="roll die {{disadvantage.dice}} hope min">{{disadvantage.value}}</li>
</ol>
</div>
</div>
{{/if}}
</section>
<div class="daggerheart chat roll" data-action="expandRoll">
{{#if this.colorful}}
<div class="duality-data">
<div class="duality-title">
<div>{{localize "DAGGERHEART.Chat.AttackRoll.Title" attack=this.title}}</div>
<div class="duality-result-value">{{this.total}}</div>
</div>
</div>
<div class="dice-total">
<div class="dice-total-label">{{totalLabel}}</div>
<div class="dice-total-value">
{{this.total}}
<div class="duality-modifiers">
{{#each this.modifiers}}
<div class="duality-modifier">
{{this.label}}
</div>
{{/each}}
{{#if this.advantage.value}}
<div class="duality-modifier">
{{localize "DAGGERHEART.General.Advantage.Full"}}
</div>
{{/if}}
{{#if this.disadvantage.value}}
<div class="duality-modifier">
{{localize "DAGGERHEART.General.Disadvantage.Full"}}
</div>
{{/if}}
</div>
<div class="duality-line {{#if (not this.damage.value)}}simple{{/if}}">
<div class="dice-outer-container">
<div class="dice-container">
<div class="dice-title">{{localize "DAGGERHEART.General.Hope"}}</div>
<div class="dice-inner-container hope" title="{{localize "DAGGERHEART.General.Hope"}}">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d12-grey.svg"/>
</div>
<div class="dice-value">{{hope.value}}</div>
</div>
</div>
<div class="dice-container">
<div class="dice-title">{{localize "DAGGERHEART.General.Fear"}}</div>
<div class="dice-inner-container fear" title="{{localize "DAGGERHEART.General.Fear"}}">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d12-grey.svg"/>
</div>
<div class="dice-value">{{fear.value}}</div>
</div>
</div>
{{#if this.advantage.value}}
<div class="advantage-container advantage">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d6-grey.svg"/>
<div class="dice-value">{{this.advantage.value}}</div>
</div>
</div>
{{/if}}
{{#if this.disadvantage.value}}
<div class="advantage-container disadvantage">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d6-grey.svg"/>
<div class="dice-value">{{this.disadvantage.value}}</div>
</div>
</div>
{{/if}}
{{#if this.modifierTotal.value}}<div class="duality-modifier">{{this.modifierTotal.label}}</div>{{/if}}
</div>
{{#if (not this.damage.value)}}
<div class="duality-result">
<div>{{#if (eq dualityResult 1)}}With Hope{{else}}{{#if (eq dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
</div>
{{/if}}
</div>
</div>
{{#if (gt targets.length 0)}}
<div class="target-section">
{{#each targets as |target|}}
<div class="dice-total target-container {{#if target.hit}}hit{{else}}{{#if (not ../total.alternate)}}miss{{/if}}{{/if}}" data-token="{{target.id}}">
<div class="target-container {{#if target.hit}}hit{{else}}{{#if (not ../total.alternate)}}miss{{/if}}{{/if}}" data-token="{{target.id}}">
<img src="{{target.img}}" />
<div class="target-inner-container">
{{#if target.hit}}{{localize "Hit"}}{{else}}{{#if (not ../total.alternate)}}{{localize "Miss"}}{{else}}?{{/if}}{{/if}}
@ -73,8 +79,94 @@
{{/each}}
</div>
{{/if}}
<div class="flexrow">
<button class="roll-damage-button" data-value="{{this.total}}" data-damage="{{this.damage.value}}" data-damage-type="{{this.damage.type}}" {{#if this.damage.disabled}}disabled{{/if}}><span>Roll Damage</span></button>
{{#if this.damage.value}}
<div class="duality-actions">
<button class="duality-action" data-value="{{this.total}}" data-damage="{{this.damage.value}}" data-damage-type="{{this.damage.type}}" {{#if this.damage.disabled}}disabled{{/if}}><span>Roll Damage</span></button>
<div class="duality-result">
<div>{{#if (eq dualityResult 1)}}With Hope{{else}}{{#if (eq dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
</div>
</div>
{{/if}}
{{else}}
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor">{{localize "DAGGERHEART.Chat.AttackRoll.Title" attack=this.title}}</div>
<div class="dice-result">
<div class="dice-formula">{{roll}}</div>
<div class="dice-tooltip">
<div class="wrapper">
<section class="tooltip-part">
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{hope.dice}}</span>
|
<span>1{{fear.dice}}</span>
</span>
<span class="part-total">{{this.diceTotal}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls duality">
<li class="roll die {{hope.dice}} {{#if hope.discarded}}discarded{{/if}} hope min" title="{{localize "DAGGERHEART.General.Hope"}}">{{hope.value}}</li>
<li class="roll die {{fear.dice}} {{#if fear.discarded}}discarded{{/if}} fear min" title="{{localize "DAGGERHEART.General.Fear"}}">{{fear.value}}</li>
</ol>
</div>
</div>
{{#if advantage.value}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{advantage.dice}}</span>
</span>
<span class="part-total">{{advantage.value}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
<li class="roll die {{advantage.dice}} hope min">{{advantage.value}}</li>
</ol>
</div>
</div>
{{/if}}
{{#if disadvantage.value}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{disadvantage.dice}}</span>
</span>
<span class="part-total">{{disadvantage.value}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
<li class="roll die {{disadvantage.dice}} hope min">{{disadvantage.value}}</li>
</ol>
</div>
</div>
{{/if}}
</section>
</div>
</div>
<div class="dice-total duality {{#if fear.discarded}}hope{{else}}{{#if hope.discarded}}fear{{else}}critical{{/if}}{{/if}}">
<div class="dice-total-label">{{totalLabel}}</div>
<div class="dice-total-value">
{{this.total}}
</div>
</div>
{{#if (gt targets.length 0)}}
<div class="target-section">
{{#each targets as |target|}}
<div class="dice-total target-container {{#if target.hit}}hit{{else}}{{#if (not ../total.alternate)}}miss{{/if}}{{/if}}" data-token="{{target.id}}">
<img src="{{target.img}}" />
<div class="target-inner-container">
{{#if target.hit}}{{localize "Hit"}}{{else}}{{#if (not ../total.alternate)}}{{localize "Miss"}}{{else}}?{{/if}}{{/if}}
</div>
</div>
{{/each}}
</div>
{{/if}}
<div class="flexrow">
<button class="roll-damage-button" data-value="{{this.total}}" data-damage="{{this.damage.value}}" data-damage-type="{{this.damage.type}}" {{#if this.damage.disabled}}disabled{{/if}}><span>Roll Damage</span></button>
</div>
</div>
</div>
</div>
{{/if}}
</div>

View file

@ -1,64 +1,142 @@
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor">{{this.title}}</div>
<div class="dice-result">
<div class="dice-formula">{{roll}}</div>
<div class="dice-tooltip">
<div class="wrapper">
<section class="tooltip-part">
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{hope.dice}}</span>
|
<span>1{{fear.dice}}</span>
</span>
<span class="part-total">{{this.highestRoll}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls duality">
<li class="roll die {{hope.dice}} {{#if hope.discarded}}discarded{{/if}} hope min" title="{{localize "DAGGERHEART.General.Hope"}}">{{hope.value}}</li>
<li class="roll die {{fear.dice}} {{#if fear.discarded}}discarded{{/if}} fear min" title="{{localize "DAGGERHEART.General.Fear"}}">{{fear.value}}</li>
</ol>
</div>
<div class="daggerheart chat roll" data-action="expandRoll">
{{#if this.colorful}}
<div class="duality-data">
<div class="duality-title">
<div>{{this.title}}</div>
<div class="duality-result-value">{{this.total}}</div>
</div>
<div class="duality-modifiers">
{{#each this.modifiers}}
<div class="duality-modifier">
{{this.label}}
</div>
{{#if advantage.value}}
{{/each}}
{{#if this.advantage.value}}
<div class="duality-modifier">
{{localize "DAGGERHEART.General.Advantage.Full"}}
</div>
{{/if}}
{{#if this.disadvantage.value}}
<div class="duality-modifier">
{{localize "DAGGERHEART.General.Disadvantage.Full"}}
</div>
{{/if}}
</div>
<div class="duality-line {{#if (not this.damage.value)}}simple{{/if}}">
<div class="dice-outer-container">
<div class="dice-container">
<div class="dice-title">{{localize "DAGGERHEART.General.Hope"}}</div>
<div class="dice-inner-container hope" title="{{localize "DAGGERHEART.General.Hope"}}">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d12-grey.svg"/>
</div>
<div class="dice-value">{{hope.value}}</div>
</div>
</div>
<div class="dice-container">
<div class="dice-title">{{localize "DAGGERHEART.General.Fear"}}</div>
<div class="dice-inner-container fear" title="{{localize "DAGGERHEART.General.Fear"}}">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d12-grey.svg"/>
</div>
<div class="dice-value">{{fear.value}}</div>
</div>
</div>
{{#if this.advantage.value}}
<div class="advantage-container advantage">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d6-grey.svg"/>
<div class="dice-value">{{this.advantage.value}}</div>
</div>
</div>
{{/if}}
{{#if this.disadvantage.value}}
<div class="advantage-container disadvantage">
<div class="dice-wrapper">
<img class="dice" src="../icons/svg/d6-grey.svg"/>
<div class="dice-value">{{this.disadvantage.value}}</div>
</div>
</div>
{{/if}}
{{#if this.modifierTotal.value}}<div class="duality-modifier">{{this.modifierTotal.label}}</div>{{/if}}
</div>
{{#if (not this.damage.value)}}
<div class="duality-result">
<div>{{#if (eq dualityResult 1)}}With Hope{{else}}{{#if (eq dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
</div>
{{/if}}
</div>
</div>
{{#if this.damage.value}}
<div class="duality-actions">
<div></div>
<div class="duality-result">
<div>{{#if (eq dualityResult 1)}}With Hope{{else}}{{#if (eq dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
</div>
</div>
{{/if}}
{{else}}
<div class="dice-flavor">{{this.title}}</div>
<div class="dice-result">
<div class="dice-formula">{{roll}}</div>
<div class="dice-tooltip">
<div class="wrapper">
<section class="tooltip-part">
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{advantage.dice}}</span>
<span>1{{hope.dice}}</span>
|
<span>1{{fear.dice}}</span>
</span>
<span class="part-total">{{advantage.value}}</span>
<span class="part-total">{{this.diceTotal}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
<li class="roll die {{advantage.dice}} hope min">{{advantage.value}}</li>
<ol class="dice-rolls duality">
<li class="roll die {{hope.dice}} {{#if hope.discarded}}discarded{{/if}} hope min" title="{{localize "DAGGERHEART.General.Hope"}}">{{hope.value}}</li>
<li class="roll die {{fear.dice}} {{#if fear.discarded}}discarded{{/if}} fear min" title="{{localize "DAGGERHEART.General.Fear"}}">{{fear.value}}</li>
</ol>
</div>
</div>
{{/if}}
{{#if disadvantage.value}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{disadvantage.dice}}</span>
</span>
<span class="part-total">{{disadvantage.value}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
<li class="roll die {{disadvantage.dice}} hope min">{{disadvantage.value}}</li>
</ol>
</div>
</div>
{{/if}}
</section>
{{#if advantage.value}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{advantage.dice}}</span>
</span>
<span class="part-total">{{advantage.value}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
<li class="roll die {{advantage.dice}} hope min">{{advantage.value}}</li>
</ol>
</div>
</div>
{{/if}}
{{#if disadvantage.value}}
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">
<span>1{{disadvantage.dice}}</span>
</span>
<span class="part-total">{{disadvantage.value}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls">
<li class="roll die {{disadvantage.dice}} hope min">{{disadvantage.value}}</li>
</ol>
</div>
</div>
{{/if}}
</section>
</div>
</div>
<div class="dice-total duality {{#if fear.discarded}}hope{{else}}{{#if hope.discarded}}fear{{else}}critical{{/if}}{{/if}}">
<div class="dice-total-label">{{totalLabel}}</div>
<div class="dice-total-value">
{{total}}
</div>
</div>
</div>
<div class="dice-total">
<div class="dice-total-label">{{totalLabel}}</div>
<div class="dice-total-value">
{{total}}
</div>
</div>
</div>
{{/if}}
</div>

View file

@ -27,17 +27,6 @@
<input class="domain-input" value="{{domains}}" />
</div>
</div>
<div class="form-group">
<label>{{localize "DAGGERHEART.Sheets.Class.DamageThresholds.Title"}}</label>
<div class="form-fields">
<label>{{localize "DAGGERHEART.Sheets.Class.DamageThresholds.Minor"}}</label>
<input name="system.damageThresholds.minor" value="{{source.system.damageThresholds.minor}}" placeholder="Minor" type="text" data-dtype="Number" />
<label>{{localize "DAGGERHEART.Sheets.Class.DamageThresholds.Major"}}</label>
<input name="system.damageThresholds.major" value="{{source.system.damageThresholds.major}}" placeholder="Major" type="text" data-dtype="Number" />
<label>{{localize "DAGGERHEART.Sheets.Class.DamageThresholds.Severe"}}</label>
<input name="system.damageThresholds.severe" value="{{source.system.damageThresholds.severe}}" placeholder="Severe" type="text" data-dtype="Number" />
</div>
</div>
{{formField systemFields.evasion value=source.system.evasion label=(localize "DAGGERHEART.Sheets.Class.Evasion")}}
{{!-- <div class="form-group">
<label>{{localize "DAGGERHEART.Sheets.Class.Evasion"}}</label>

View file

@ -1,79 +0,0 @@
<div>
<header class="flexcol">
<div class="title-container">
<img class="flex0" src="{{document.img}}" data-edit="img" data-action="onEditImage" title="{{document.name}}" height="64" width="64"/>
<div class="title-name">
{{formInput fields.name value=source.name rootId=partId}}
</div>
</div>
<nav class="sheet-tabs tabs">
{{#each tabs as |tab|}}
<a class="{{tab.cssClass}}" data-action="tab" data-group="{{tab.group}}" data-tab="{{tab.id}}">
<i class="{{tab.icon}}"></i>
<label>{{localize tab.label}}</label>
</a>
{{/each}}
</nav>
</header>
<section class="sheet-body">
<div class="tab {{this.tabs.features.cssClass}}" data-group="primary" data-tab="features">
<div class="feature-description">
{{formField systemFields.type value=source.system.type rootId=partId label="DAGGERHEART.Sheets.Feature.FeatureType" localize=true }}
{{formField systemFields.actionType value=source.system.actionType label="DAGGERHEART.Sheets.Feature.ActionType" rootId=partId localize=true }}
<div class="form-group">
<div class="form-fields">
{{formField systemFields.refreshData.fields.type value=source.system.refreshData.type rootId=partId label="DAGGERHEART.Sheets.Feature.RefreshType" localize=true }}
{{#if document.system.refreshData.type}}
<label>Uses</label>
<input type="text" name="system.refreshData.uses" value="{{document.system.refreshData.uses}}" data-dtype="Number" />
{{/if}}
</div>
</div>
<div class="form-group">
<label>{{localize "DAGGERHEART.Sheets.Feature.ValueType.Title"}}</label>
<div class="flexcol">
<div class="form-fields">
{{#if (eq document.system.featureType.type "dice")}}
<label>{{localize "DAGGERHEART.Sheets.Feature.ValueType.Type"}}</label>
{{/if}}
<select name="system.featureType.type">
{{selectOptions this.itemConfig.valueTypes selected=document.system.featureType.type labelAttr="name" localize=true}}
</select>
{{#if (eq document.system.featureType.type "dice")}}
<label>{{localize "DAGGERHEART.Sheets.Feature.ValueType.Dice"}}</label>
<select name="system.featureType.data.value">
{{selectOptions this.dice selected=document.system.featureType.data.value }}
</select>
<label>{{localize "DAGGERHEART.Sheets.Feature.Max"}}</label>
<input type="text" name="system.featureType.data.max" value="{{document.system.featureType.data.max}}" />
<label>{{localize "DAGGERHEART.Sheets.Feature.ValueType.Property"}}</label>
<select name="system.featureType.data.property">
{{selectOptions this.properties selected=document.system.featureType.data.property labelAttr="name" localize=true}}
</select>
{{/if}}
</div>
</div>
</div>
<h2>{{localize "DAGGERHEART.Sheets.Feature.Description"}}</h2>
{{!-- {{editor document.system.description target="system.description" button=true}} --}}
{{formInput systemFields.description value=source.system.description enriched=source.system.description localize=true toggled=true}}
</div>
</div>
<div class="tab {{this.tabs.effects.cssClass}}" data-group="primary" data-tab="effects">
{{> "systems/daggerheart/templates/sheets/parts/effects.hbs" config=this.effectConfig selectedEffectType=this.selectedEffectType effects=document.system.effects}}
</div>
<div class="tab {{this.tabs.actions.cssClass}}" data-group="primary" data-tab="actions">
<h2>{{localize "Actions"}} <i class="fa-solid fa-plus icon-button" data-action="addAction"></i></h2>
<div class="flexrow">
{{#each document.system.actions as |action index|}}
<div data-action="editAction" data-index="{{index}}" class="ability-chip">
<img src="{{action.img}}" />
<div>{{action.name}}</div>
<button data-action="removeAction" data-index="{{index}}"><i class="fa-solid fa-x"></i></button>
</div>
{{/each}}
</div>
</div>
</section>
</div>

View file

@ -0,0 +1,10 @@
<section
class='tab {{tabs.description.cssClass}} {{tabs.description.id}}'
data-tab='{{tabs.description.id}}'
data-group='{{tabs.description.group}}'
>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Feature.Description"}}</legend>
{{formInput systemFields.description value=source.system.description enriched=source.system.description localize=true toggled=true}}
</fieldset>
</section>

View file

@ -0,0 +1,11 @@
<section class='tab-navigation'>
<line-div></line-div>
<nav class='feature-tab sheet-tabs tabs' data-group='primary'>
{{#each tabs as |tab|}}
<a class='{{tab.id}} {{tab.cssClass}}' data-action='tab' data-group='{{tab.group}}' data-tab='{{tab.id}}'>
{{localize tab.label}}
</a>
{{/each}}
</nav>
<line-div></line-div>
</section>

View file

@ -0,0 +1,21 @@
<section
class='tab {{tabs.actions.cssClass}} {{tabs.actions.id}}'
data-tab='{{tabs.actions.id}}'
data-group='{{tabs.actions.group}}'
>
<fieldset class="one-column">
<legend>{{localize "Actions"}} <a><i class="fa-solid fa-plus icon-button" data-action="addAction"></i></a></legend>
<div class="actions-list">
{{#each document.system.actions as |action index|}}
<div class="action-item">
<img class="image" src="{{action.img}}" />
<span>{{action.name}}</span>
<div class="controls">
<a data-action="editAction" data-index="{{index}}"><i class="fa-solid fa-pen-to-square"></i></a>
<a data-action="removeAction" data-index="{{index}}"><i class="fa-solid fa-trash"></i></a>
</div>
</div>
{{/each}}
</div>
</fieldset>
</section>

View file

@ -0,0 +1,67 @@
<section
class='tab {{tabs.effects.cssClass}} {{tabs.effects.id}}'
data-tab='{{tabs.effects.id}}'
data-group='{{tabs.effects.group}}'
>
<fieldset class="two-columns">
<legend>{{localize "Effects"}}</legend>
<span>{{localize "DAGGERHEART.Sheets.Feature.effects.addEffect"}}</span>
<div class="nest-inputs">
<select class="effect-select">
{{selectOptions this.effectConfig.effectTypes selected=this.selectedEffectType labelAttr="name" localize=true blank=""}}
</select>
<a>
<i class="fa-solid fa-plus icon-button {{#if (not this.selectedEffectType)}}disabled{{/if}}" data-action="addEffect"></i>
</a>
</div>
</fieldset>
{{#each this.document.system.effects as |effect key|}}
<fieldset class="two-columns">
<legend>
{{localize (concat 'DAGGERHEART.Effects.Types.' effect.type '.Name')}}
<a>
<i class="fa-solid fa-trash icon-button flex0" data-action="removeEffect" data-effect="{{key}}"></i>
</a>
</legend>
{{#if effect.applyLocationChoices}}
<span>
{{localize "DAGGERHEART.Sheets.Feature.effects.applyLocation"}}
</span>
<select name="system.effects.{{key}}.appliesOn">
{{selectOptions effect.applyLocationChoices selected=effect.appliesOn localize=true}}
</select>
{{/if}}
{{#if (eq effect.valueType ../this.effectConfig.valueTypes.numberString.id)}}
{{#if (eq effect.type ../this.effectConfig.effectTypes.damage.id) }}
<span>{{localize "DAGGERHEART.Sheets.Feature.effects.value"}}</span>
<input type="text" name="system.effects.{{key}}.valueData.value" value="{{effect.valueData.value}}" />
<span>{{localize "DAGGERHEART.Sheets.Feature.effects.initiallySelected"}}</span>
<input type="checkbox" name="system.effects.{{key}}.initiallySelected" {{checked effect.initiallySelected}} />
<span>{{localize "DAGGERHEART.Sheets.Feature.effects.hopeIncrease"}}</span>
<input type="text" name="system.effects.{{key}}.valueData.hopeIncrease" value="{{effect.valueData.hopeIncrease}}" />
{{else}}
<span>{{localize "DAGGERHEART.Sheets.Feature.effects.value"}}</span>
<input type="text" name="system.effects.{{key}}.valueData.value" value="{{effect.valueData.value}}" />
{{/if}}
{{/if}}
{{#if (eq effect.valueType ../this.effectConfig.valueTypes.select.id)}}
<span>
{{localize effect.valueData.fromValue}}
</span>
<select name="system.effects.{{key}}.valueData.fromValue" value="{{effect.valueData.fromValue}}">
{{selectOptions effect.options selected=effect.valueData.fromValue labelAttr="name" valueAttr="value" localize=true blank="" }}
</select>
<span>
{{localize effect.valueData.name}}
</span>
<select name="system.effects.{{key}}.valueData.value" value="{{effect.valueData.value}}">
{{selectOptions effect.options selected=effect.valueData.value labelAttr="name" valueAttr="value" localize=true blank="" }}
</select>
{{/if}}
</fieldset>
{{/each}}
</section>

View file

@ -0,0 +1,10 @@
<header class='item-sheet-header'>
<img class='profile' src='{{source.img}}' data-action='editImage' data-edit='img' />
<div class='item-info'>
<line-div></line-div>
<h1 class='item-name'><input type='text' name='name' value='{{source.name}}' /></h1>
<div class='item-description'>
<h3>{{localize (concat 'DAGGERHEART.Feature.Type.' source.system.type)}}</h3>
</div>
</div>
</header>

View file

@ -0,0 +1,43 @@
<section
class='tab {{tabs.settings.cssClass}} {{tabs.settings.id}}'
data-tab='{{tabs.settings.id}}'
data-group='{{tabs.settings.group}}'
>
<fieldset class="two-columns">
<legend>{{localize tabs.settings.label}}</legend>
<span>{{localize "DAGGERHEART.Sheets.Feature.FeatureType"}}</span>
{{formField systemFields.type value=source.system.type rootId=partId localize=true }}
<span>{{localize "DAGGERHEART.Sheets.Feature.ActionType"}}</span>
{{formField systemFields.actionType value=source.system.actionType rootId=partId localize=true }}
<span>{{localize "DAGGERHEART.Sheets.Feature.RefreshType"}}</span>
<div class="nest-inputs">
<span><input type="text" name="system.refreshData.uses" value="{{source.system.refreshData.uses}}" data-dtype="Number" /></span>
{{formField systemFields.refreshData.fields.type value=source.system.refreshData.type rootId=partId localize=true }}
</div>
</fieldset>
<fieldset class="two-columns">
<legend>{{localize "DAGGERHEART.Sheets.Feature.ValueType.Title"}}</legend>
<span>{{localize "DAGGERHEART.Sheets.Feature.ValueType.Title"}}</span>
<select name="system.featureType.type">
{{selectOptions this.itemConfig.valueTypes selected=document.system.featureType.type labelAttr="name" localize=true}}
</select>
{{#if (eq document.system.featureType.type "dice")}}
<span>{{localize "DAGGERHEART.Sheets.Feature.ValueType.Dice"}}</span>
<select name="system.featureType.data.value">
{{selectOptions this.dice selected=document.system.featureType.data.value }}
</select>
<span>{{localize "DAGGERHEART.Feature.Max"}}</span>
<input type="text" name="system.featureType.data.max" value="{{document.system.featureType.data.max}}" />
<span>{{localize "DAGGERHEART.Sheets.Feature.ValueType.Property"}}</span>
<select name="system.featureType.data.property">
{{selectOptions this.properties selected=document.system.featureType.data.property labelAttr="name" localize=true}}
</select>
{{/if}}
</fieldset>
</section>

View file

@ -76,7 +76,6 @@
<div class="tab features {{this.tabs.primary.features.cssClass}}" data-group="primary" data-tab="features">
<div class="tab-container">
<div class="flexcol tab-inner-container">
<div class="system-info">{{localize "DAGGERHEART.General.OpenBetaDisclaimer" version="V1.4"}}</div>
<div class="feature-sheet-body flexrow">
<div class="body-section flex2">
{{> "systems/daggerheart/templates/sheets/parts/defense.hbs" }}