Compare commits

..

4 commits

9 changed files with 45 additions and 86 deletions

View file

@ -35,7 +35,7 @@ jobs:
env: env:
version: ${{steps.get_version.outputs.version-without-v}} version: ${{steps.get_version.outputs.version-without-v}}
url: https://github.com/${{github.repository}} 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 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 # Create a zip file with all files required by the module to add to the release

View file

@ -18,7 +18,7 @@ export default class DhMeasuredTemplate extends foundry.canvas.placeables.Measur
static getRangeLabels(distanceValue, settings) { static getRangeLabels(distanceValue, settings) {
let result = { distance: distanceValue, units: '' }; 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 sceneRangeMeasurement = canvas.scene.flags.daggerheart?.rangeMeasurement;
const { disable, custom } = CONFIG.DH.GENERAL.sceneRangeMeasurementSetting; const { disable, custom } = CONFIG.DH.GENERAL.sceneRangeMeasurementSetting;

View file

@ -95,7 +95,7 @@ export default class DhTokenManager {
: this.#actor; : this.#actor;
const tokenData = await actor.getTokenDocument(); const tokenData = await actor.getTokenDocument();
const result = await canvas.scene.createEmbeddedDocuments('Token', [ 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; this.#activePreview = undefined;

View file

@ -65,13 +65,7 @@ export const renderMeasuredTemplate = async event => {
? '180' ? '180'
: undefined; : undefined;
let baseDistance = range; const distance = getTemplateDistance(range, type);
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 { width, height } = game.canvas.scene.dimensions; const { width, height } = game.canvas.scene.dimensions;
const data = { const data = {
@ -86,3 +80,23 @@ export const renderMeasuredTemplate = async event => {
CONFIG.ux.TemplateManager.createPreview(data); 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;
};

View file

@ -36,7 +36,8 @@
"resultBased": false, "resultBased": false,
"value": { "value": {
"custom": { "custom": {
"enabled": false "enabled": false,
"formula": ""
}, },
"multiplier": "prof", "multiplier": "prof",
"dice": "d8", "dice": "d8",
@ -44,7 +45,9 @@
"flatMultiplier": 1 "flatMultiplier": 1
}, },
"applyTo": "hitPoints", "applyTo": "hitPoints",
"type": [], "type": [
"magical"
],
"base": false, "base": false,
"valueAlt": { "valueAlt": {
"multiplier": "prof", "multiplier": "prof",
@ -52,7 +55,8 @@
"dice": "d6", "dice": "d6",
"bonus": null, "bonus": null,
"custom": { "custom": {
"enabled": false "enabled": false,
"formula": ""
} }
} }
} }
@ -87,57 +91,6 @@
"name": "Cast", "name": "Cast",
"img": "icons/skills/melee/spear-tips-three-green.webp", "img": "icons/skills/melee/spear-tips-three-green.webp",
"range": "veryClose" "range": "veryClose"
},
"CUKoYyDxQhNc0pLs": {
"type": "damage",
"_id": "CUKoYyDxQhNc0pLs",
"systemPath": "actions",
"description": "<p>If a target you hit is <em>Vulnerable</em>, they take an extra <strong>1d8</strong> damage.</p>",
"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": { "attribution": {

View file

@ -5,22 +5,14 @@
"_id": "ijWppQzSOqVCb3rE", "_id": "ijWppQzSOqVCb3rE",
"img": "icons/weapons/axes/axe-battle-jagged.webp", "img": "icons/weapons/axes/axe-battle-jagged.webp",
"system": { "system": {
"description": "", "description": "<strong>Protective</strong>: +1 to Armor Score",
"actions": {}, "actions": {},
"attached": [], "attached": [],
"tier": 3, "tier": 3,
"equipped": false, "equipped": false,
"secondary": false, "secondary": false,
"burden": "twoHanded", "burden": "twoHanded",
"weaponFeatures": [ "weaponFeatures": [],
{
"value": "protective",
"effectIds": [
"qTxADRsQnKiYfOiQ"
],
"actionIds": []
}
],
"attack": { "attack": {
"name": "Attack", "name": "Attack",
"img": "icons/skills/melee/blood-slash-foam-red.webp", "img": "icons/skills/melee/blood-slash-foam-red.webp",
@ -111,13 +103,13 @@
"effects": [ "effects": [
{ {
"name": "Protective", "name": "Protective",
"description": "Add your character's Tier to your Armor Score", "description": "+1 to Armor Score",
"img": "icons/skills/melee/shield-block-gray-orange.webp", "img": "icons/magic/defensive/shield-barrier-deflect-teal.webp",
"changes": [ "changes": [
{ {
"key": "system.armorScore", "key": "system.armorScore",
"mode": 2, "mode": 2,
"value": "ITEM.@system.tier" "value": "1"
} }
], ],
"_id": "qTxADRsQnKiYfOiQ", "_id": "qTxADRsQnKiYfOiQ",

View file

@ -2,7 +2,7 @@
"id": "daggerheart", "id": "daggerheart",
"title": "Daggerheart", "title": "Daggerheart",
"description": "An unofficial implementation of the Daggerheart system", "description": "An unofficial implementation of the Daggerheart system",
"version": "1.9.6", "version": "1.9.7",
"compatibility": { "compatibility": {
"minimum": "13.346", "minimum": "13.346",
"verified": "13.351", "verified": "13.351",

View file

@ -1,9 +1,9 @@
<div class="item-description-outer-container"> {{#if features.length}}
{{#if features.length}} <div class="item-description-outer-container">
<div class="item-description-container"> <div class="item-description-container">
{{#each features as | feature |}} {{#each features as | feature |}}
<div><strong>{{localize feature.label}}</strong>: {{{localize feature.description}}}</div> <div><strong>{{localize feature.label}}</strong>: {{{localize feature.description}}}</div>
{{/each}} {{/each}}
</div> </div>
{{/if}} </div>
</div> {{/if}}

View file

@ -1,9 +1,9 @@
<div class="item-description-outer-container"> {{#if features.length}}
{{#if features.length}} <div class="item-description-outer-container">
<div class="item-description-container"> <div class="item-description-container">
{{#each features as | feature |}} {{#each features as | feature |}}
<div><strong>{{localize feature.label}}</strong>: {{{localize feature.description}}}</div> <div><strong>{{localize feature.label}}</strong>: {{{localize feature.description}}}</div>
{{/each}} {{/each}}
</div> </div>
{{/if}} </div>
</div> {{/if}}