### Start Development Server Source: https://github.com/foundryborne/daggerheart/blob/main/README.md Starts the development server with file watching enabled. This command also launches Foundry VTT, allowing for live development. ```bash npm start ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/foundryborne/daggerheart/blob/main/README.md Install all necessary Node.js dependencies for the project. This command should be run from the repository's root directory. ```bash npm install ``` -------------------------------- ### Navigate to Repository Directory Source: https://github.com/foundryborne/daggerheart/blob/main/README.md Change your current directory to the root of the cloned repository. This is the first step before installing dependencies. ```bash cd // ``` -------------------------------- ### Example Trigger Return Structure Source: https://github.com/foundryborne/daggerheart/wiki/Triggers This example shows how a trigger can return updates to actor resources like hope or stress. The 'key' specifies the resource, 'value' is the signed amount to change it by, and 'clear' can optionally reset the resource to zero. ```javascript returns { updates: [{ key: 'stress', value: -1, }] } ``` -------------------------------- ### Create Development Symlinks Source: https://github.com/foundryborne/daggerheart/blob/main/README.md Sets up necessary type definitions and creates symlinks for the Daggerheart system within your Foundry VTT data directory. Requires elevated privileges. ```bash npm run createSymlink ``` -------------------------------- ### Build Project Source: https://github.com/foundryborne/daggerheart/blob/main/README.md Performs a one-time build of the project. This is useful for creating a production-ready version. ```bash npm run build ``` -------------------------------- ### Linux Symlink Creation Source: https://github.com/foundryborne/daggerheart/blob/main/README.md Manually creates a symbolic link for the Daggerheart system in Linux. This is an alternative to `npm run createSymlink` and should be run from within the Foundry VTT systems directory. ```bash ln -snf daggerheart ``` -------------------------------- ### Add Custom Domains Source: https://github.com/foundryborne/daggerheart/wiki/Module-Builder-Information Register custom domains for classes and domain cards by adding them to the `CONFIG.DH.DOMAIN.domains` path in the init hook. ```javascript Hooks.once('init', () => { CONFIG.DH.DOMAIN.domains.test = { id: 'test', label: 'Test', // Alternatively a translation string if the module uses lang files description: 'A test domain', // Alternatively a translation string if the module uses lang files src: 'modules/test-module/assets/test-domain-image.png', }; }); ``` -------------------------------- ### Open a Daggerheart Dialog with Custom Styles Source: https://github.com/foundryborne/daggerheart/wiki/Theming-and-Style-Rules Use this method to open a confirmation dialog. Ensure 'daggerheart', 'dialog', 'dh-style', and 'module' are included in the classes array for correct styling. ```javascript static async openDialog(_, button) { const confirmed = await DialogV2.confirm({ window: { title: 'Title', icon: 'fa-solid fa-user' }, content: 'content.hbs', // 'daggerheart', 'dialog' and 'dh-style' must be included to styles work proprely classes: ['daggerheart', 'dialog', 'dh-style', 'module'] }); if (!confirmed) return; // ... } ``` -------------------------------- ### Register Custom Character Resources Source: https://github.com/foundryborne/daggerheart/wiki/Module-Builder-Information Define custom resources for characters in the init hook, specifying their ID, initial and max values, and label. Optionally include custom icons. ```javascript Hooks.once('init', () => { CONFIG.DH.RESOURCE.character.custom.corruption = { id: 'corruption', initial: 0, max: 4, label: 'Corruption', images: { full: { value: 'systems/daggerheart/assets/icons/domains/sage.svg', isIcon: false }, empty: { value: 'systems/daggerheart/assets/icons/domains/sage.svg', isIcon: false } } }; }) ``` -------------------------------- ### Define Custom Attribution Sources Source: https://github.com/foundryborne/daggerheart/wiki/Module-Builder-Information Register custom attribution sources in the init hook to provide dropdown options for entity attribution. ```javascript Hooks.once('init', () => { CONFIG.DH.GENERAL.attributionSources.deadlyBeasts = { label: "Deadly Beasts", values: [ { label: "Deadly Beasts - Volume 1" }, {label: "Deadly Beasts - Volume 2"} ] }; }) ``` -------------------------------- ### Dialog Content Template with Header Source: https://github.com/foundryborne/daggerheart/wiki/Theming-and-Style-Rules A basic HTML template for dialog content. Includes an optional header section that can be copied for consistent dialog titles. ```html {{!-- content.hbs --}}
{{!-- you can include the title using coping this element --}}

Dialog Title

{{!-- your content --}}
``` -------------------------------- ### Duality Button Text Enrichment Source: https://github.com/foundryborne/daggerheart/wiki/Dice-Rolls-&-Chat-Commands Create Duality Roll buttons using the [[/dr]] syntax. Optional parameters can be included, and a flavor label can be added after the closing bracket. ```text [[/dr]] ``` ```text [[/dr trait=strength difficulty=14 grantResources=true]] ``` ```text [[/dr reaction=true trait=instinct difficulty=16]]{Petryifying Gaze} ``` -------------------------------- ### Apply Daggerheart Styles to Applications and Dialogs Source: https://github.com/foundryborne/daggerheart/wiki/Theming-and-Style-Rules Reference the '.dh-style' class in your application's default options or dialog configurations. Recommended for applicationV2 and dialogV2. ```javascript const { ActorSheetV2 } = foundry.applications.sheets; const { DialogV2 } = foundry.applications.api; export class YourBaseActorSheet extends HandlebarsApplicationMixin(ActorSheetV2) { static DEFAULT_OPTIONS = { classes: ['daggerheart', 'module', 'application', 'dh-style'], // ... } static async openDialog(_, button) { const confirmed = await DialogV2.confirm({ window: { title: 'Title', icon: 'fa-solid fa-user' }, content: 'Lorem Ipsum', classes: ['daggerheart', 'module', 'dialog', 'dh-style'] }); if (!confirmed) return; // ... } } ``` -------------------------------- ### Use Daggerheart Theme Colors in CSS Source: https://github.com/foundryborne/daggerheart/wiki/Theming-and-Style-Rules Apply theme colors using CSS variables, supporting both light and dark modes with the `light-dark()` function. Note: This method may not work in chat messages due to interface theming. ```css h1 { // first light color, then dark color colors: light-dark(var(--golden), var(--dark-blue)); } ``` -------------------------------- ### Duality Roll Chat Command Source: https://github.com/foundryborne/daggerheart/wiki/Dice-Rolls-&-Chat-Commands Use the /dr command to perform a Duality Roll. Optional parameters like difficulty, trait, reaction, advantage, disadvantage, and grantResources can be appended. ```text /dr ``` ```text /dr difficulty=12 ``` ```text /dr trait=strength ``` ```text /dr reaction=true ``` ```text /dr advantage=true ``` ```text /dr disadvantage=true ``` ```text /dr grantResources=true ``` -------------------------------- ### Damage Button Text Enrichment Source: https://github.com/foundryborne/daggerheart/wiki/Dice-Rolls-&-Chat-Commands Create a Damage button using the @Damage syntax. Specify the damage type(s) and value. Supports physical and magical damage types. ```text @Damage[type:physical|value:1d6] ``` ```text @Damage[type:[physical,magical]|value:4d8+5] ``` -------------------------------- ### Apply Daggerheart Typography Styles Source: https://github.com/foundryborne/daggerheart/wiki/Theming-and-Style-Rules Set font families for various HTML elements to match the Daggerheart system's 'fancy' aesthetic. Font sizes can be adjusted for applications, dialogs, and chat. ```css h1 { font-family: 'Cinzel Decorative'; // font-size 32px for Applications // font-size 24px for Dialog and Chat } h2, h3 { font-family: 'Cinzel'; // font-size 20px for Applications // font-size 16px for Dialog and Chat } h4, h5 { font-family: 'Montserrat'; // font-size 16px for Applications // font-size 16px for Dialog and Chat } p, span, textarea, label, select, table, fieldset legend, input[type='text'], input[type='number'], input[type='search'], li { font-family: 'Montserrat'; // font-size 14px for Applications // font-size 14px for Dialog and Chat } ``` -------------------------------- ### Template Button Text Enrichment Source: https://github.com/foundryborne/daggerheart/wiki/Dice-Rolls-&-Chat-Commands Generate a Template button using the @Template syntax. Specify the type (circle, cone, inFront, rectangle, line) and range (Melee, VeryClose, Close, Far). ```text @Template[type:circle|range:close] ``` -------------------------------- ### Register Custom Adversary Types Source: https://github.com/foundryborne/daggerheart/wiki/Module-Builder-Information Add new adversary types to the existing list by defining them under `CONFIG.DH.ACTOR.adversaryTypes` in the Foundry init hook. ```javascript Hooks.once('init', () => { CONFIG.DH.ACTOR.adversaryTypes.superMonster = { id: 'superMonster', label: 'Super Monster', // Alternatively a translation string if the module uses lang files description: 'Thunderbolts and lightning, very very frightening', // Alternatively a translation string if the module uses lang files bpCost: 4 }; }); ``` -------------------------------- ### Fate Button Text Enrichment Source: https://github.com/foundryborne/daggerheart/wiki/Dice-Rolls-&-Chat-Commands Create Fate Roll buttons using the [[/fr]] syntax. Specify the type and optionally add a flavor label. ```text [[/fr]] ``` ```text [[/fr type=fear]]{Your Doom Is Near} ``` -------------------------------- ### Return Actor Resource Updates Source: https://github.com/foundryborne/daggerheart/wiki/Triggers Triggers can return an array of updates to modify actor resources like hope or stress. Specify the origin actor, the resource key, and the signed value for modification. The 'clear' flag can reset a resource to 0. ```javascript returns { updates: { originActor: this.actor, updates: [{ key: 'hitPoints', value: -1, }] } ``` -------------------------------- ### Fate Roll Chat Command Source: https://github.com/foundryborne/daggerheart/wiki/Dice-Rolls-&-Chat-Commands Use the /fr command to perform a Fate Roll. Specify the type as 'hope' or 'fear'. ```text /fr ``` ```text /fr type=hope ``` ```text /fr type=fear ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.