diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index aef0ddd1..5e2f9ac7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,7 +35,7 @@ jobs: env: version: ${{steps.get_version.outputs.version-without-v}} url: https://github.com/${{github.repository}} - manifest: https://github.com/${{github.repository}}/releases/latest/download/system.json + manifest: https://raw.githubusercontent.com/${{github.repository}}/V13/system.json download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/system.zip # Create a zip file with all files required by the module to add to the release diff --git a/daggerheart.mjs b/daggerheart.mjs index abe12524..84ce2779 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -405,6 +405,8 @@ Hooks.on('chatMessage', (_, message) => { }); const updateActorsRangeDependentEffects = async token => { + if (!token) return; + const rangeMeasurement = game.settings.get( CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules diff --git a/lang/en.json b/lang/en.json index feeb65b2..2dc13ecf 100755 --- a/lang/en.json +++ b/lang/en.json @@ -71,9 +71,7 @@ "name": "Summon", "tooltip": "Create tokens in the scene.", "error": "You do not have permission to summon tokens or there is no active scene.", - "invalidDrop": "You can only drop Actor entities to summon.", - "chatMessageTitle": "Test2", - "chatMessageHeaderTitle": "Summoning" + "invalidDrop": "You can only drop Actor entities to summon." }, "transform": { "name": "Transform", @@ -87,9 +85,7 @@ }, "Config": { "beastform": { - "exact": "Beastform Max Tier", - "exactHint": "The Character's Tier is used if empty", - "label": "Beastform" + "exact": { "label": "Beastform Max Tier", "hint": "The Character's Tier is used if empty" } }, "countdown": { "defaultOwnership": "Default Ownership", @@ -198,7 +194,10 @@ "type": { "label": "Type" } }, "hordeDamage": "Horde Damage", - "horderHp": "Horde/HP" + "horderHp": "Horde/HP", + "adversaryReactionRoll": { + "headerTitle": "Adversary Reaction Roll" + } }, "Character": { "advantageSources": { @@ -440,6 +439,10 @@ "defaultOwnershipTooltip": "The default player ownership of countdowns", "hideNewCountdowns": "Hide New Countdowns" }, + "CreateItemDialog": { + "createItem": "Create Item", + "browseCompendium": "Browse Compendium" + }, "DaggerheartMenu": { "title": "GM Tools", "refreshFeatures": "Refresh Features" @@ -653,6 +656,12 @@ "noPlayers": "No players to assign ownership to", "default": "Default Ownership" }, + "PendingReactionsDialog": { + "title": "Pending Reaction Rolls Found", + "unfinishedRolls": "Some Tokens still need to roll their Reaction Roll.", + "confirmation": "Are you sure you want to continue ?", + "warning": "Undone reaction rolls will be considered as failed" + }, "ReactionRoll": { "title": "Reaction Roll: {trait}" }, @@ -684,7 +693,13 @@ "damageNotRolled": "Damage not rolled in chat message yet", "insufficientHope": "The initiating character doesn't have enough hope", "createTagTeam": "Create TagTeam Roll", - "chatMessageRollTitle": "Roll" + "chatMessageRollTitle": "Roll", + "cancelConfirmTitle": "Cancel Tag Team Roll", + "cancelConfirmText": "Are you sure you want to cancel the Tag Team Roll? This will close it for all other players too.", + "hints": { + "completeRolls": "Set up and complete the rolls for the characters", + "selectRoll": "Select which roll value to be used for the Tag Team" + } }, "TokenConfig": { "actorSizeUsed": "Actor size is set, determining the dimensions" @@ -1215,6 +1230,11 @@ "on": "On", "onWithToggle": "On With Toggle" }, + "SceneRangeMeasurementTypes": { + "disable": "Disable Daggerheart Range Measurement", + "default": "Default", + "custom": "Custom" + }, "SelectAction": { "selectType": "Select Action Type", "selectAction": "Action Selection" @@ -1894,6 +1914,10 @@ "hint": "Multiply any damage dealt to you by this number" } }, + "Battlepoints": { + "full": "Battlepoints", + "short": "BP" + }, "Bonuses": { "rest": { "downtimeAction": "Downtime Action", @@ -2305,8 +2329,10 @@ "multiclass": "Multiclass", "newCategory": "New Category", "newThing": "New {thing}", + "next": "Next", "none": "None", "noTarget": "No current target", + "optionalThing": "Optional {thing}", "partner": "Partner", "player": { "single": "Player", @@ -2329,9 +2355,11 @@ "rollDamage": "Roll Damage", "rollWith": "{roll} Roll", "save": "Save", + "saveSettings": "Save Settings", "scalable": "Scalable", "scars": "Scars", "situationalBonus": "Situational Bonus", + "searchPlaceholder": "Search...", "spent": "Spent", "step": "Step", "stress": "Stress", @@ -2482,8 +2510,14 @@ }, "Weapon": { "weaponType": "Weapon Type", - "primaryWeapon": "Primary Weapon", - "secondaryWeapon": "Secondary Weapon" + "primaryWeapon": { + "full": "Primary Weapon", + "short": "Primary" + }, + "secondaryWeapon": { + "full": "Secondary Weapon", + "short": "Secondary" + } } }, "MACROS": { @@ -2915,6 +2949,9 @@ "resourceRoll": { "playerMessage": "{user} rerolled their {name}" }, + "saveRoll": { + "reactionRollAllTargets": "Reaction Roll All Targets" + }, "tagTeam": { "title": "Tag Team", "membersTitle": "Members" @@ -2941,9 +2978,9 @@ }, "ItemBrowser": { "title": "Daggerheart Compendium Browser", + "windowTitle": "Compendium Browser", "hint": "Select a Folder in sidebar to start browsing through the compendium", "browserSettings": "Browser Settings", - "searchPlaceholder": "Search...", "columnName": "Name", "tooltipFilters": "Filters", "tooltipErase": "Erase", @@ -2979,7 +3016,7 @@ "weapons": "Weapons", "armors": "Armors", "consumables": "Consumables", - "loots": "Loots" + "loots": "Loot" } }, "Notifications": { @@ -3070,6 +3107,7 @@ "companion": "Level {level} - {partner}", "companionNoPartner": "No Partner", "duplicateToNewTier": "Duplicate to New Tier", + "createAdversary": "Create Adversary", "pickTierTitle": "Pick a new tier for this adversary" }, "daggerheartMenu": { diff --git a/module/applications/characterCreation/characterCreation.mjs b/module/applications/characterCreation/characterCreation.mjs index aa764c56..467366fc 100644 --- a/module/applications/characterCreation/characterCreation.mjs +++ b/module/applications/characterCreation/characterCreation.mjs @@ -11,7 +11,10 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl this.character = character; this.setup = { - traits: this.character.system.traits, + traits: Object.keys(this.character.system.traits).reduce((acc, key) => { + acc[key] = { value: null }; + return acc; + }, {}), ancestryName: { primary: '', secondary: '' @@ -377,8 +380,10 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl ]; return Object.values(this.setup.traits).reduce((acc, x) => { const index = traitCompareArray.indexOf(x.value); + if (index === -1) return acc; + traitCompareArray.splice(index, 1); - acc += index !== -1; + acc += 1; return acc; }, 0); } diff --git a/module/applications/dialogs/downtime.mjs b/module/applications/dialogs/downtime.mjs index 4c01c2a9..5dc93bae 100644 --- a/module/applications/dialogs/downtime.mjs +++ b/module/applications/dialogs/downtime.mjs @@ -259,8 +259,9 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV const resetValue = increasing ? 0 : feature.system.resource.max - ? Roll.replaceFormulaData(feature.system.resource.max, this.actor) + ? new Roll(Roll.replaceFormulaData(feature.system.resource.max, this.actor)).evaluateSync().total : 0; + await feature.update({ 'system.resource.value': resetValue }); } diff --git a/module/applications/settings/appearanceSettings.mjs b/module/applications/settings/appearanceSettings.mjs index 151648e1..7adf065d 100644 --- a/module/applications/settings/appearanceSettings.mjs +++ b/module/applications/settings/appearanceSettings.mjs @@ -118,8 +118,13 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App break; case 'footer': partContext.buttons = [ - { type: 'button', action: 'reset', icon: 'fa-solid fa-arrow-rotate-left', label: 'Reset' }, - { type: 'submit', icon: 'fa-solid fa-floppy-disk', label: 'Save Changes' } + { + type: 'button', + action: 'reset', + icon: 'fa-solid fa-arrow-rotate-left', + label: game.i18n.localize('Reset') + }, + { type: 'submit', icon: 'fa-solid fa-floppy-disk', label: game.i18n.localize('EDITOR.Save') } ]; break; } diff --git a/module/applications/sheets/actors/adversary.mjs b/module/applications/sheets/actors/adversary.mjs index d8a3df29..04be3efb 100644 --- a/module/applications/sheets/actors/adversary.mjs +++ b/module/applications/sheets/actors/adversary.mjs @@ -217,8 +217,8 @@ export default class AdversarySheet extends DHBaseActorSheet { static #reactionRoll(event) { const config = { event, - title: `Reaction Roll: ${this.actor.name}`, - headerTitle: 'Adversary Reaction Roll', + title: game.i18n.localize('DAGGERHEART.GENERAL.reactionRoll'), + headerTitle: game.i18n.localize('DAGGERHEART.ACTORS.Adversary.adversaryReactionRoll.headerTitle'), roll: { type: 'trait' }, diff --git a/module/applications/sheets/actors/party.mjs b/module/applications/sheets/actors/party.mjs index 1b1722db..53316c8b 100644 --- a/module/applications/sheets/actors/party.mjs +++ b/module/applications/sheets/actors/party.mjs @@ -229,7 +229,7 @@ export default class Party extends DHBaseActorSheet { title: game.i18n.localize(`DAGGERHEART.APPLICATIONS.Downtime.${button.dataset.type}.title`), icon: button.dataset.type === 'shortRest' ? 'fa-solid fa-utensils' : 'fa-solid fa-bed' }, - content: 'This will trigger a dialog to players make their downtime moves, are you sure?', + content: game.i18n.localize('DAGGERHEART.ACTORS.Party.triggerRestContent'), classes: ['daggerheart', 'dialog', 'dh-style'] }); diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index b18176ec..baa4d173 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -652,12 +652,12 @@ export default function DHApplicationMixin(Base) { buttons: [ { action: 'create', - label: 'Create Item', + label: game.i18n.localize('DAGGERHEART.APPLICATIONS.CreateItemDialog.createItem'), icon: 'fa-solid fa-plus' }, { action: 'browse', - label: 'Browse Compendium', + label: game.i18n.localize('DAGGERHEART.APPLICATIONS.CreateItemDialog.browseCompendium'), icon: 'fa-solid fa-book' } ] diff --git a/module/applications/sidebar/tabs/actorDirectory.mjs b/module/applications/sidebar/tabs/actorDirectory.mjs index 9d8f16e1..e9484553 100644 --- a/module/applications/sidebar/tabs/actorDirectory.mjs +++ b/module/applications/sidebar/tabs/actorDirectory.mjs @@ -76,7 +76,7 @@ export default class DhActorDirectory extends foundry.applications.sidebar.tabs. window: { title: 'DAGGERHEART.UI.Sidebar.actorDirectory.pickTierTitle' }, content, ok: { - label: 'Create Adversary', + label: 'DAGGERHEART.UI.Sidebar.actorDirectory.createAdversary', callback: (event, button, dialog) => Number(button.form.elements.tier.value) } }); diff --git a/module/applications/ui/fearTracker.mjs b/module/applications/ui/fearTracker.mjs index 82dda215..4e5e1132 100644 --- a/module/applications/ui/fearTracker.mjs +++ b/module/applications/ui/fearTracker.mjs @@ -22,7 +22,7 @@ export default class FearTracker extends HandlebarsApplicationMixin(ApplicationV tag: 'div', window: { frame: true, - title: 'Fear', + title: 'DAGGERHEART.GENERAL.fear', positioned: true, resizable: true, minimizable: false diff --git a/module/applications/ui/itemBrowser.mjs b/module/applications/ui/itemBrowser.mjs index 2d2e8cdc..67a16f6a 100644 --- a/module/applications/ui/itemBrowser.mjs +++ b/module/applications/ui/itemBrowser.mjs @@ -37,7 +37,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) { tag: 'div', window: { frame: true, - title: 'Compendium Browser', + title: 'DAGGERHEART.UI.ItemBrowser.windowTitle', icon: 'fa-solid fa-book-atlas', positioned: true, resizable: true @@ -207,8 +207,23 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) { label: game.i18n.localize(col.label) })); + const splitPath = folderId?.split('.') ?? []; + const { pathLabels } = splitPath.reduce( + (acc, curr) => { + acc.currentPath = !acc.currentPath ? curr : [acc.currentPath, curr].join('.'); + if (curr === 'folder') return acc; + + const label = foundry.utils.getProperty(this.config, acc.currentPath)?.label; + if (label) acc.pathLabels.push(game.i18n.localize(label)); + + return acc; + }, + { pathLabels: [], currentPath: '' } + ); + this.selectedMenu = { - path: folderId?.split('.') ?? [], + path: splitPath, + pathLabels: pathLabels, data: { ...folderData, columns: columns @@ -568,7 +583,9 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) { const { itemUuid } = event.target.closest('[data-item-uuid]').dataset, item = await foundry.utils.fromUuid(itemUuid), dragData = item.toDragData(); + event.dataTransfer.setData('text/plain', JSON.stringify(dragData)); + event.dataTransfer.setDragImage(event.target.querySelector('img'), 0, 0); } _canDragStart() { diff --git a/module/applications/ux/filter-menu.mjs b/module/applications/ux/filter-menu.mjs index 065d08f9..791c0e1f 100644 --- a/module/applications/ux/filter-menu.mjs +++ b/module/applications/ux/filter-menu.mjs @@ -188,7 +188,7 @@ export default class FilterMenu extends foundry.applications.ux.ContextMenu { })); const damageTypeFilter = Object.values(CONFIG.DH.GENERAL.damageTypes).map(({ id, abbreviation }) => ({ - group: 'Damage Type', //TODO localize + group: game.i18n.localize('DAGGERHEART.GENERAL.damageType'), name: game.i18n.localize(abbreviation), filter: { field: 'system.damage.type', diff --git a/module/canvas/placeables/measuredTemplate.mjs b/module/canvas/placeables/measuredTemplate.mjs index e1ea79f5..e439dadc 100644 --- a/module/canvas/placeables/measuredTemplate.mjs +++ b/module/canvas/placeables/measuredTemplate.mjs @@ -18,7 +18,7 @@ export default class DhMeasuredTemplate extends foundry.canvas.placeables.Measur static getRangeLabels(distanceValue, settings) { let result = { distance: distanceValue, units: '' }; - if (!settings.enabled) return result; + if (!settings.enabled || !canvas.scene) return result; const sceneRangeMeasurement = canvas.scene.flags.daggerheart?.rangeMeasurement; const { disable, custom } = CONFIG.DH.GENERAL.sceneRangeMeasurementSetting; diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index f1c21d26..2557e562 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -943,14 +943,14 @@ export const countdownAppMode = { export const sceneRangeMeasurementSetting = { disable: { id: 'disable', - label: 'Disable Daggerheart Range Measurement' + label: 'DAGGERHEART.CONFIG.SceneRangeMeasurementTypes.disable' }, default: { id: 'default', - label: 'Default' + label: 'DAGGERHEART.CONFIG.SceneRangeMeasurementTypes.default' }, custom: { id: 'custom', - label: 'Custom' + label: 'DAGGERHEART.CONFIG.SceneRangeMeasurementTypes.custom' } }; diff --git a/module/config/itemBrowserConfig.mjs b/module/config/itemBrowserConfig.mjs index 3b10409c..f20e56d0 100644 --- a/module/config/itemBrowserConfig.mjs +++ b/module/config/itemBrowserConfig.mjs @@ -7,7 +7,12 @@ export const typeConfig = { }, { key: 'system.type', - label: 'DAGGERHEART.GENERAL.type' + label: 'DAGGERHEART.GENERAL.type', + format: type => { + if (!type) return '-'; + + return CONFIG.DH.ACTOR.allAdversaryTypes()[type].label; + } } ], filters: [ @@ -69,12 +74,13 @@ export const typeConfig = { columns: [ { key: 'type', - label: 'DAGGERHEART.GENERAL.type' + label: 'DAGGERHEART.GENERAL.type', + format: type => type ? `TYPES.Item.${type}` : '-' }, { key: 'system.secondary', label: 'DAGGERHEART.UI.ItemBrowser.subtype', - format: isSecondary => (isSecondary ? 'secondary' : isSecondary === false ? 'primary' : '-') + format: isSecondary => (isSecondary ? 'DAGGERHEART.ITEMS.Weapon.secondaryWeapon.short' : isSecondary === false ? 'DAGGERHEART.ITEMS.Weapon.primaryWeapon.short' : '-') }, { key: 'system.tier', @@ -94,8 +100,8 @@ export const typeConfig = { key: 'system.secondary', label: 'DAGGERHEART.UI.ItemBrowser.subtype', choices: [ - { value: false, label: 'DAGGERHEART.ITEMS.Weapon.primaryWeapon' }, - { value: true, label: 'DAGGERHEART.ITEMS.Weapon.secondaryWeapon' } + { value: false, label: 'DAGGERHEART.ITEMS.Weapon.primaryWeapon.full' }, + { value: true, label: 'DAGGERHEART.ITEMS.Weapon.secondaryWeapon.full' } ] }, { @@ -253,11 +259,13 @@ export const typeConfig = { columns: [ { key: 'system.type', - label: 'DAGGERHEART.GENERAL.type' + label: 'DAGGERHEART.GENERAL.type', + format: type => type ? `DAGGERHEART.CONFIG.DomainCardTypes.${type}` : '-' }, { key: 'system.domain', - label: 'DAGGERHEART.GENERAL.Domain.single' + label: 'DAGGERHEART.GENERAL.Domain.single', + format: domain => domain ? CONFIG.DH.DOMAIN.allDomains()[domain].label : '-' }, { key: 'system.level', @@ -318,7 +326,14 @@ export const typeConfig = { }, { key: 'system.domains', - label: 'DAGGERHEART.GENERAL.Domain.plural' + label: 'DAGGERHEART.GENERAL.Domain.plural', + format: domains => { + const config = CONFIG.DH.DOMAIN.allDomains(); + return domains + .map(x => (x ? game.i18n.localize(config[x].label) : null)) + .filter(x => x) + .join(', '); + } } ], filters: [ @@ -362,18 +377,19 @@ export const typeConfig = { columns: [ { key: 'system.linkedClass', - label: 'Class', + label: 'TYPES.Item.class', format: linkedClass => linkedClass?.name ?? 'DAGGERHEART.UI.ItemBrowser.missing' }, { key: 'system.spellcastingTrait', - label: 'DAGGERHEART.ITEMS.Subclass.spellcastingTrait' + label: 'DAGGERHEART.ITEMS.Subclass.spellcastingTrait', + format: trait => (trait ? `DAGGERHEART.CONFIG.Traits.${trait}.name` : '-') } ], filters: [ { key: 'system.linkedClass.uuid', - label: 'Class', + label: 'TYPES.Item.class', choices: items => { const list = items .filter(item => item.system.linkedClass) @@ -397,7 +413,8 @@ export const typeConfig = { }, { key: 'system.mainTrait', - label: 'DAGGERHEART.GENERAL.Trait.single' + label: 'DAGGERHEART.GENERAL.Trait.single', + format: trait => (trait ? `DAGGERHEART.CONFIG.Traits.${trait}.name` : '-') } ], filters: [ diff --git a/module/config/settingsConfig.mjs b/module/config/settingsConfig.mjs index c19e6e26..8036d789 100644 --- a/module/config/settingsConfig.mjs +++ b/module/config/settingsConfig.mjs @@ -46,18 +46,14 @@ export const gameSettings = { export const actionAutomationChoices = { never: { id: 'never', - label: 'Never' + label: 'DAGGERHEART.CONFIG.ActionAutomationChoices.never' }, showDialog: { id: 'showDialog', - label: 'Show Dialog only' + label: 'DAGGERHEART.CONFIG.ActionAutomationChoices.showDialog' }, - // npcOnly: { - // id: "npcOnly", - // label: "Always for non-characters" - // }, always: { id: 'always', - label: 'Always' + label: 'DAGGERHEART.CONFIG.ActionAutomationChoices.always' } }; diff --git a/module/data/fields/action/beastformField.mjs b/module/data/fields/action/beastformField.mjs index e19807c7..5e9c75f0 100644 --- a/module/data/fields/action/beastformField.mjs +++ b/module/data/fields/action/beastformField.mjs @@ -28,7 +28,8 @@ export default class BeastformField extends fields.SchemaField { { 1: game.i18n.localize('DAGGERHEART.GENERAL.Tiers.1') } ); }, - hint: 'DAGGERHEART.ACTIONS.Config.beastform.exactHint' + label: 'DAGGERHEART.ACTIONS.Config.beastform.exact.label', + hint: 'DAGGERHEART.ACTIONS.Config.beastform.exact.hint' }) }) }; diff --git a/module/data/fields/action/damageField.mjs b/module/data/fields/action/damageField.mjs index 6439344b..6c091f8b 100644 --- a/module/data/fields/action/damageField.mjs +++ b/module/data/fields/action/damageField.mjs @@ -295,7 +295,7 @@ export class DHDamageData extends DHResourceData { required: true }), { - label: 'Type' + label: game.i18n.localize('DAGGERHEART.GENERAL.type') } ) }; diff --git a/module/documents/chatMessage.mjs b/module/documents/chatMessage.mjs index 53921329..acc14439 100644 --- a/module/documents/chatMessage.mjs +++ b/module/documents/chatMessage.mjs @@ -197,8 +197,8 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage { const pendingingSaves = targets.filter(t => t.saved.success === null); if (pendingingSaves.length) { const confirm = await foundry.applications.api.DialogV2.confirm({ - window: { title: 'Pending Reaction Rolls found' }, - content: `
Some Tokens still need to roll their Reaction Roll.
Are you sure you want to continue ?
Undone reaction rolls will be considered as failed
` + window: { title: game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.title') }, + content: `${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.unfinishedRolls')}
${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.confirmation')}
${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.warning')}
` }); if (!confirm) return; } diff --git a/module/documents/tokenManager.mjs b/module/documents/tokenManager.mjs index be5467da..f766a677 100644 --- a/module/documents/tokenManager.mjs +++ b/module/documents/tokenManager.mjs @@ -95,7 +95,7 @@ export default class DhTokenManager { : this.#actor; const tokenData = await actor.getTokenDocument(); const result = await canvas.scene.createEmbeddedDocuments('Token', [ - { ...tokenData, x: this.#activePreview.document.x, y: this.#activePreview.document.y } + { ...tokenData.toObject(), x: this.#activePreview.document.x, y: this.#activePreview.document.y } ]); this.#activePreview = undefined; diff --git a/module/enrichers/TemplateEnricher.mjs b/module/enrichers/TemplateEnricher.mjs index 4bc8fdeb..74462e00 100644 --- a/module/enrichers/TemplateEnricher.mjs +++ b/module/enrichers/TemplateEnricher.mjs @@ -65,13 +65,7 @@ export const renderMeasuredTemplate = async event => { ? '180' : undefined; - let baseDistance = range; - if (Number.isNaN(Number(range))) { - baseDistance = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules).rangeMeasurement[ - range - ]; - } - const distance = type === CONFIG.DH.GENERAL.templateTypes.EMANATION ? baseDistance + 2.5 : baseDistance; + const distance = getTemplateDistance(range, type); const { width, height } = game.canvas.scene.dimensions; const data = { @@ -86,3 +80,23 @@ export const renderMeasuredTemplate = async event => { CONFIG.ux.TemplateManager.createPreview(data); }; + +const getTemplateDistance = (range, type) => { + const rangeNumber = Number(range); + if (!Number.isNaN(rangeNumber)) return rangeNumber; + + const { custom } = CONFIG.DH.GENERAL.sceneRangeMeasurementSetting; + const sceneMeasurements = canvas.scene?.flags.daggerheart?.rangeMeasurement; + const globalMeasurements = game.settings.get( + CONFIG.DH.id, + CONFIG.DH.SETTINGS.gameSettings.variantRules + ).rangeMeasurement; + + const settings = sceneMeasurements?.setting === custom.id ? sceneMeasurements : globalMeasurements; + const baseDistance = settings[range]; + + if (type !== CONFIG.DH.GENERAL.templateTypes.EMANATION) return baseDistance; + + const emanationAddDistance = settings.melee / 2; + return baseDistance + emanationAddDistance; +}; diff --git a/src/packs/ancestries/feature_Retract_UFR67BUOhNGLFyg9.json b/src/packs/ancestries/feature_Retract_UFR67BUOhNGLFyg9.json index b17cd7da..9a1c434b 100644 --- a/src/packs/ancestries/feature_Retract_UFR67BUOhNGLFyg9.json +++ b/src/packs/ancestries/feature_Retract_UFR67BUOhNGLFyg9.json @@ -80,7 +80,7 @@ { "key": "system.disadvantageSources", "mode": 2, - "value": "Retract", + "value": "Action Rolls", "priority": null } ], diff --git a/src/packs/communities/feature_Low_Light_Living_aMla3xQuCHEwORGD.json b/src/packs/communities/feature_Low_Light_Living_aMla3xQuCHEwORGD.json index f1ed3ace..f40baa40 100644 --- a/src/packs/communities/feature_Low_Light_Living_aMla3xQuCHEwORGD.json +++ b/src/packs/communities/feature_Low_Light_Living_aMla3xQuCHEwORGD.json @@ -35,19 +35,7 @@ { "key": "system.advantageSources", "mode": 2, - "value": "In an area with low light or heavy shadow: hide, investigate, or perceive", - "priority": null - }, - { - "key": "system.advantageSources", - "mode": 2, - "value": "", - "priority": null - }, - { - "key": "", - "mode": 2, - "value": "", + "value": "Rolls to hide, investigate, or perceive details in low light", "priority": null } ], @@ -61,7 +49,7 @@ "startRound": null, "startTurn": null }, - "description": "", + "description": "When you’re in an area with low light or heavy shadow, you have advantage on rolls to hide, investigate, or perceive details within that area.
", "origin": null, "tint": "#ffffff", "transfer": true, diff --git a/src/packs/domains/domainCard_Battle_Cry_Ef1JsUG50LIoKx2F.json b/src/packs/domains/domainCard_Battle_Cry_Ef1JsUG50LIoKx2F.json index 432f9992..6ca03c41 100644 --- a/src/packs/domains/domainCard_Battle_Cry_Ef1JsUG50LIoKx2F.json +++ b/src/packs/domains/domainCard_Battle_Cry_Ef1JsUG50LIoKx2F.json @@ -138,7 +138,7 @@ { "key": "system.advantageSources", "mode": 2, - "value": "1", + "value": "Attack Rolls", "priority": null } ], @@ -152,7 +152,7 @@ "startRound": null, "startTurn": null }, - "description": "", + "description": "You gain advantage on attack rolls until you or an ally rolls a failure with Fear.
", "tint": "#ffffff", "statuses": [], "sort": 0, diff --git a/src/packs/domains/domainCard_Rain_of_Blades_Ucenef6JpjQxwXni.json b/src/packs/domains/domainCard_Rain_of_Blades_Ucenef6JpjQxwXni.json index 839dc2c2..7a5ccb1b 100644 --- a/src/packs/domains/domainCard_Rain_of_Blades_Ucenef6JpjQxwXni.json +++ b/src/packs/domains/domainCard_Rain_of_Blades_Ucenef6JpjQxwXni.json @@ -36,7 +36,8 @@ "resultBased": false, "value": { "custom": { - "enabled": false + "enabled": false, + "formula": "" }, "multiplier": "prof", "dice": "d8", @@ -44,7 +45,9 @@ "flatMultiplier": 1 }, "applyTo": "hitPoints", - "type": [], + "type": [ + "magical" + ], "base": false, "valueAlt": { "multiplier": "prof", @@ -52,7 +55,8 @@ "dice": "d6", "bonus": null, "custom": { - "enabled": false + "enabled": false, + "formula": "" } } } @@ -87,57 +91,6 @@ "name": "Cast", "img": "icons/skills/melee/spear-tips-three-green.webp", "range": "veryClose" - }, - "CUKoYyDxQhNc0pLs": { - "type": "damage", - "_id": "CUKoYyDxQhNc0pLs", - "systemPath": "actions", - "description": "If a target you hit is Vulnerable, they take an extra 1d8 damage.
", - "chatDisplay": true, - "actionType": "action", - "cost": [], - "uses": { - "value": null, - "max": "", - "recovery": null - }, - "damage": { - "parts": [ - { - "value": { - "custom": { - "enabled": false - }, - "multiplier": "flat", - "flatMultiplier": 1, - "dice": "d8", - "bonus": null - }, - "applyTo": "hitPoints", - "type": [], - "base": false, - "resultBased": false, - "valueAlt": { - "multiplier": "prof", - "flatMultiplier": 1, - "dice": "d6", - "bonus": null, - "custom": { - "enabled": false - } - } - } - ], - "includeBase": false - }, - "target": { - "type": "any", - "amount": null - }, - "effects": [], - "name": "Damage Against Vulnerable", - "img": "icons/skills/melee/spear-tips-three-purple.webp", - "range": "" } }, "attribution": { diff --git a/src/packs/items/weapons/weapon_Labrys_Axe_ijWppQzSOqVCb3rE.json b/src/packs/items/weapons/weapon_Labrys_Axe_ijWppQzSOqVCb3rE.json index 4958bbe5..3c11528e 100644 --- a/src/packs/items/weapons/weapon_Labrys_Axe_ijWppQzSOqVCb3rE.json +++ b/src/packs/items/weapons/weapon_Labrys_Axe_ijWppQzSOqVCb3rE.json @@ -5,22 +5,14 @@ "_id": "ijWppQzSOqVCb3rE", "img": "icons/weapons/axes/axe-battle-jagged.webp", "system": { - "description": "", + "description": "Protective: +1 to Armor Score", "actions": {}, "attached": [], "tier": 3, "equipped": false, "secondary": false, "burden": "twoHanded", - "weaponFeatures": [ - { - "value": "protective", - "effectIds": [ - "qTxADRsQnKiYfOiQ" - ], - "actionIds": [] - } - ], + "weaponFeatures": [], "attack": { "name": "Attack", "img": "icons/skills/melee/blood-slash-foam-red.webp", @@ -111,13 +103,13 @@ "effects": [ { "name": "Protective", - "description": "Add your character's Tier to your Armor Score", - "img": "icons/skills/melee/shield-block-gray-orange.webp", + "description": "+1 to Armor Score", + "img": "icons/magic/defensive/shield-barrier-deflect-teal.webp", "changes": [ { "key": "system.armorScore", "mode": 2, - "value": "ITEM.@system.tier" + "value": "1" } ], "_id": "qTxADRsQnKiYfOiQ", diff --git a/styles/less/dialog/character-creation/selections-container.less b/styles/less/dialog/character-creation/selections-container.less index 1de3d870..f774eb72 100644 --- a/styles/less/dialog/character-creation/selections-container.less +++ b/styles/less/dialog/character-creation/selections-container.less @@ -175,6 +175,11 @@ opacity: 0.2; } + &.no-horizontal-padding { + padding-left: 0; + padding-right: 0; + } + legend { margin-left: auto; margin-right: auto; @@ -274,6 +279,15 @@ flex-direction: column; gap: 5px; + &.separated { + border-bottom: 2px solid; + padding-bottom: 8px; + } + + .form-group { + padding: 0 0.75rem; + } + .experience-inner-container { position: relative; display: flex; diff --git a/styles/less/global/prose-mirror.less b/styles/less/global/prose-mirror.less index 506fb8b7..fd699b66 100644 --- a/styles/less/global/prose-mirror.less +++ b/styles/less/global/prose-mirror.less @@ -24,7 +24,7 @@ } h4 { font-size: var(--font-size-16); - color: @beige; + color: light-dark(@dark, @beige); font-weight: 600; } diff --git a/styles/less/ui/combat-sidebar/encounter-controls.less b/styles/less/ui/combat-sidebar/encounter-controls.less index 16a8e11a..66f265e0 100644 --- a/styles/less/ui/combat-sidebar/encounter-controls.less +++ b/styles/less/ui/combat-sidebar/encounter-controls.less @@ -10,6 +10,7 @@ .encounter-battlepoints { display: flex; cursor: help; + color: light-dark(@dark, @beige); } .inner-controls { diff --git a/system.json b/system.json index 9242a24a..4049e676 100644 --- a/system.json +++ b/system.json @@ -2,12 +2,15 @@ "id": "daggerheart", "title": "Daggerheart", "description": "An unofficial implementation of the Daggerheart system", - "version": "1.9.6", + "version": "1.9.10", "compatibility": { "minimum": "13.346", "verified": "13.351", "maximum": "13" }, + "url": "https://github.com/Foundryborne/daggerheart", + "manifest": "https://raw.githubusercontent.com/Foundryborne/daggerheart/V13/system.json", + "download": "https://github.com/Foundryborne/daggerheart/releases/download/1.9.10/system.zip", "authors": [ { "name": "WBHarry" @@ -296,8 +299,5 @@ }, "background": "systems/daggerheart/assets/logos/FoundrybornBackgroundLogo.png", "primaryTokenAttribute": "resources.hitPoints", - "secondaryTokenAttribute": "resources.stress", - "url": "https://your/hosted/system/repo/", - "manifest": "https://your/hosted/system/repo/system.json", - "download": "https://your/packaged/download/archive.zip" + "secondaryTokenAttribute": "resources.stress" } diff --git a/templates/actionTypes/beastform.hbs b/templates/actionTypes/beastform.hbs index b9bea445..3dcdb006 100644 --- a/templates/actionTypes/beastform.hbs +++ b/templates/actionTypes/beastform.hbs @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/templates/characterCreation/footer.hbs b/templates/characterCreation/footer.hbs index 95b86cfb..51eef110 100644 --- a/templates/characterCreation/footer.hbs +++ b/templates/characterCreation/footer.hbs @@ -1,8 +1,8 @@ \ No newline at end of file diff --git a/templates/characterCreation/tabs/experience.hbs b/templates/characterCreation/tabs/experience.hbs index 3eb92834..66363084 100644 --- a/templates/characterCreation/tabs/experience.hbs +++ b/templates/characterCreation/tabs/experience.hbs @@ -4,17 +4,25 @@ data-group='{{tabs.experience.group}}' >