mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-14 08:38:11 +02:00
Compare commits
No commits in common. "4558fbdcf618314c1460360377015b3229e17b0c" and "404640a0a3fa23463101447768c61c4fd2edb3b9" have entirely different histories.
4558fbdcf6
...
404640a0a3
7 changed files with 19 additions and 16 deletions
|
|
@ -22,10 +22,9 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
|
||||||
);
|
);
|
||||||
|
|
||||||
const orderedArmorSources = getArmorSources(actor).filter(s => !s.disabled);
|
const orderedArmorSources = getArmorSources(actor).filter(s => !s.disabled);
|
||||||
const armor = orderedArmorSources.reduce((acc, { name, document }) => {
|
const armor = orderedArmorSources.reduce((acc, { document }) => {
|
||||||
const { current, max } = document.type === 'armor' ? document.system.armor : document.system.armorData;
|
const { current, max } = document.type === 'armor' ? document.system.armor : document.system.armorData;
|
||||||
acc.push({
|
acc.push({
|
||||||
name,
|
|
||||||
effect: document,
|
effect: document,
|
||||||
marks: [...Array(max).keys()].reduce((acc, _, index) => {
|
marks: [...Array(max).keys()].reduce((acc, _, index) => {
|
||||||
const spent = index < current;
|
const spent = index < current;
|
||||||
|
|
@ -153,8 +152,14 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
|
||||||
|
|
||||||
const armorSources = [];
|
const armorSources = [];
|
||||||
for (const source of this.marks.armor) {
|
for (const source of this.marks.armor) {
|
||||||
|
const parent = source.effect.origin
|
||||||
|
? await foundry.utils.fromUuid(source.effect.origin)
|
||||||
|
: source.effect.parent;
|
||||||
|
|
||||||
|
const useEffectName = parent.type === 'armor' || parent instanceof Actor;
|
||||||
|
const label = useEffectName ? source.effect.name : parent.name;
|
||||||
armorSources.push({
|
armorSources.push({
|
||||||
label: source.name,
|
label: label,
|
||||||
uuid: source.effect.uuid,
|
uuid: source.effect.uuid,
|
||||||
marks: source.marks
|
marks: source.marks
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,6 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
|
|
||||||
/** Recursively finds the first parent document of the given object */
|
/** Recursively finds the first parent document of the given object */
|
||||||
static #resolveParentDocument(model, documentClass) {
|
static #resolveParentDocument(model, documentClass) {
|
||||||
if (!model) return null;
|
|
||||||
return model instanceof documentClass
|
return model instanceof documentClass
|
||||||
? model
|
? model
|
||||||
: model.parent
|
: model.parent
|
||||||
|
|
|
||||||
|
|
@ -757,12 +757,9 @@ export function getArmorSources(actor) {
|
||||||
// Get the origin item. Since the actor is already loaded, it should already be cached
|
// Get the origin item. Since the actor is already loaded, it should already be cached
|
||||||
// Consider the relative function versions if this causes an issue
|
// Consider the relative function versions if this causes an issue
|
||||||
const origin = doc.origin ? foundry.utils.fromUuidSync(doc.origin) : doc;
|
const origin = doc.origin ? foundry.utils.fromUuidSync(doc.origin) : doc;
|
||||||
const useParentName = doc.parent && !(doc.parent instanceof Actor);
|
|
||||||
const name = doc.origin || !useParentName ? doc.name : doc.parent.name;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
origin,
|
origin,
|
||||||
name,
|
name: origin.name,
|
||||||
document: doc,
|
document: doc,
|
||||||
data: doc.system.armor ?? doc.system.armorData,
|
data: doc.system.armor ?? doc.system.armorData,
|
||||||
disabled: !!doc.disabled || !!doc.isSuppressed
|
disabled: !!doc.disabled || !!doc.isSuppressed
|
||||||
|
|
|
||||||
|
|
@ -138,9 +138,12 @@
|
||||||
"src": "systems/daggerheart/assets/icons/documents/actors/dragon-head.svg",
|
"src": "systems/daggerheart/assets/icons/documents/actors/dragon-head.svg",
|
||||||
"anchorX": 0.5,
|
"anchorX": 0.5,
|
||||||
"anchorY": 0.5,
|
"anchorY": 0.5,
|
||||||
|
"offsetX": 0,
|
||||||
|
"offsetY": 0,
|
||||||
"fit": "contain",
|
"fit": "contain",
|
||||||
"scaleX": 1,
|
"scaleX": 1,
|
||||||
"scaleY": 1,
|
"scaleY": 1,
|
||||||
|
"rotation": 0,
|
||||||
"tint": "#ffffff",
|
"tint": "#ffffff",
|
||||||
"alphaThreshold": 0.75
|
"alphaThreshold": 0.75
|
||||||
},
|
},
|
||||||
|
|
@ -191,7 +194,7 @@
|
||||||
"saturation": 0,
|
"saturation": 0,
|
||||||
"contrast": 0
|
"contrast": 0
|
||||||
},
|
},
|
||||||
"detectionModes": {},
|
"detectionModes": [],
|
||||||
"occludable": {
|
"occludable": {
|
||||||
"radius": 0
|
"radius": 0
|
||||||
},
|
},
|
||||||
|
|
@ -217,8 +220,7 @@
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"randomImg": false,
|
"randomImg": false,
|
||||||
"appendNumber": false,
|
"appendNumber": false,
|
||||||
"prependAdjective": false,
|
"prependAdjective": false
|
||||||
"depth": 1
|
|
||||||
},
|
},
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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": "2.2.2",
|
"version": "2.2.1",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "14.359",
|
"minimum": "14.359",
|
||||||
"verified": "14.360",
|
"verified": "14.360",
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
},
|
},
|
||||||
"url": "https://github.com/Foundryborne/daggerheart",
|
"url": "https://github.com/Foundryborne/daggerheart",
|
||||||
"manifest": "https://raw.githubusercontent.com/Foundryborne/daggerheart/v14/system.json",
|
"manifest": "https://raw.githubusercontent.com/Foundryborne/daggerheart/v14/system.json",
|
||||||
"download": "https://github.com/Foundryborne/daggerheart/releases/download/2.2.2/system.zip",
|
"download": "https://github.com/Foundryborne/daggerheart/releases/download/2.2.1/system.zip",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "WBHarry"
|
"name": "WBHarry"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue