mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Added VaultActive and LoadoutIgnore
This commit is contained in:
parent
0b343c9f52
commit
7429369212
19 changed files with 62 additions and 39 deletions
|
|
@ -2294,6 +2294,8 @@
|
||||||
"DomainCard": {
|
"DomainCard": {
|
||||||
"type": "Type",
|
"type": "Type",
|
||||||
"recallCost": "Recall Cost",
|
"recallCost": "Recall Cost",
|
||||||
|
"vaultActive": "Active In Vault",
|
||||||
|
"loadoutIgnore": "Doesn't Count For Loadout",
|
||||||
"foundationTitle": "Foundation",
|
"foundationTitle": "Foundation",
|
||||||
"specializationTitle": "Specialization",
|
"specializationTitle": "Specialization",
|
||||||
"masteryTitle": "Mastery"
|
"masteryTitle": "Mastery"
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
advanceResourceDie: CharacterSheet.#advanceResourceDie,
|
advanceResourceDie: CharacterSheet.#advanceResourceDie,
|
||||||
cancelBeastform: CharacterSheet.#cancelBeastform,
|
cancelBeastform: CharacterSheet.#cancelBeastform,
|
||||||
useDowntime: this.useDowntime,
|
useDowntime: this.useDowntime,
|
||||||
viewParty: CharacterSheet.#viewParty,
|
viewParty: CharacterSheet.#viewParty
|
||||||
},
|
},
|
||||||
window: {
|
window: {
|
||||||
resizable: true,
|
resizable: true,
|
||||||
|
|
@ -338,15 +338,20 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
}
|
}
|
||||||
const type = 'effect';
|
const type = 'effect';
|
||||||
const cls = game.system.api.models.actions.actionsTypes[type];
|
const cls = game.system.api.models.actions.actionsTypes[type];
|
||||||
const action = new cls({
|
const action = new cls(
|
||||||
...cls.getSourceConfig(doc.system),
|
{
|
||||||
type: type,
|
...cls.getSourceConfig(doc.system),
|
||||||
chatDisplay: false,
|
type: type,
|
||||||
cost: [{
|
chatDisplay: false,
|
||||||
key: 'stress',
|
cost: [
|
||||||
value: doc.system.recallCost
|
{
|
||||||
}]
|
key: 'stress',
|
||||||
}, { parent: doc.system });
|
value: doc.system.recallCost
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{ parent: doc.system }
|
||||||
|
);
|
||||||
const config = await action.use(event);
|
const config = await action.use(event);
|
||||||
if (config) {
|
if (config) {
|
||||||
return doc.update({ 'system.inVault': false });
|
return doc.update({ 'system.inVault': false });
|
||||||
|
|
@ -822,7 +827,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
static async #toggleVault(_event, button) {
|
static async #toggleVault(_event, button) {
|
||||||
const doc = await getDocFromElement(button);
|
const doc = await getDocFromElement(button);
|
||||||
const { available } = this.document.system.loadoutSlot;
|
const { available } = this.document.system.loadoutSlot;
|
||||||
if (doc.system.inVault && !available) {
|
if (doc.system.inVault && !available && !doc.system.loadoutIgnore) {
|
||||||
return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached'));
|
return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -900,32 +905,32 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const buttons = parties.map((p) => {
|
const buttons = parties.map(p => {
|
||||||
const button = document.createElement("button");
|
const button = document.createElement('button');
|
||||||
button.type = "button";
|
button.type = 'button';
|
||||||
button.classList.add("plain");
|
button.classList.add('plain');
|
||||||
const img = document.createElement("img");
|
const img = document.createElement('img');
|
||||||
img.src = p.img;
|
img.src = p.img;
|
||||||
button.append(img);
|
button.append(img);
|
||||||
const name = document.createElement("span");
|
const name = document.createElement('span');
|
||||||
name.textContent = p.name;
|
name.textContent = p.name;
|
||||||
button.append(name);
|
button.append(name);
|
||||||
button.addEventListener("click", () => {
|
button.addEventListener('click', () => {
|
||||||
p.sheet?.render({ force: true });
|
p.sheet?.render({ force: true });
|
||||||
game.tooltip.dismissLockedTooltips();
|
game.tooltip.dismissLockedTooltips();
|
||||||
});
|
});
|
||||||
return button;
|
return button;
|
||||||
});
|
});
|
||||||
|
|
||||||
const html = document.createElement("div");
|
const html = document.createElement('div');
|
||||||
html.classList.add("party-list");
|
html.classList.add('party-list');
|
||||||
html.append(...buttons);
|
html.append(...buttons);
|
||||||
|
|
||||||
game.tooltip.dismissLockedTooltips();
|
game.tooltip.dismissLockedTooltips();
|
||||||
game.tooltip.activate(target, {
|
game.tooltip.activate(target, {
|
||||||
html,
|
html,
|
||||||
locked: true,
|
locked: true
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,17 @@ export default class DHDomainCard extends BaseDataItem {
|
||||||
required: true,
|
required: true,
|
||||||
initial: CONFIG.DH.DOMAIN.cardTypes.ability.id
|
initial: CONFIG.DH.DOMAIN.cardTypes.ability.id
|
||||||
}),
|
}),
|
||||||
inVault: new fields.BooleanField({ initial: false })
|
inVault: new fields.BooleanField({ initial: false }),
|
||||||
|
vaultActive: new fields.BooleanField({
|
||||||
|
required: true,
|
||||||
|
nullable: false,
|
||||||
|
initial: false
|
||||||
|
}),
|
||||||
|
loadoutIgnore: new fields.BooleanField({
|
||||||
|
required: true,
|
||||||
|
nullable: false,
|
||||||
|
initial: false
|
||||||
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.parent?.type === 'domainCard') {
|
if (this.parent?.type === 'domainCard') {
|
||||||
return this.parent.system.inVault;
|
return this.parent.system.inVault && !this.parent.system.vaultActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.isSuppressed;
|
return super.isSuppressed;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
},
|
},
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_id": "BFWN2cObMdlk9uVz",
|
"_id": "BFWN2cObMdlk9uVz",
|
||||||
"sort": 3400000,
|
"sort": 3500000,
|
||||||
"effects": [
|
"effects": [
|
||||||
{
|
{
|
||||||
"name": "Get Back Up",
|
"name": "Get Back Up",
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,8 @@
|
||||||
"source": "Daggerheart SRD",
|
"source": "Daggerheart SRD",
|
||||||
"page": 127,
|
"page": 127,
|
||||||
"artist": ""
|
"artist": ""
|
||||||
}
|
},
|
||||||
|
"loadoutIgnore": true
|
||||||
},
|
},
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_id": "IqxzvvjZiYbgx21A",
|
"_id": "IqxzvvjZiYbgx21A",
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
},
|
},
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_id": "4uAFGp3LxiC07woC",
|
"_id": "4uAFGp3LxiC07woC",
|
||||||
"sort": 3400000,
|
"sort": 3500000,
|
||||||
"effects": [],
|
"effects": [],
|
||||||
"ownership": {
|
"ownership": {
|
||||||
"default": 0
|
"default": 0
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,8 @@
|
||||||
"source": "Daggerheart SRD",
|
"source": "Daggerheart SRD",
|
||||||
"page": 121,
|
"page": 121,
|
||||||
"artist": ""
|
"artist": ""
|
||||||
}
|
},
|
||||||
|
"vaultActive": true
|
||||||
},
|
},
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_id": "sWUlSPOJEaXyQLCj",
|
"_id": "sWUlSPOJEaXyQLCj",
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"sorting": "a",
|
"sorting": "a",
|
||||||
"_id": "7pKKYgRQAKlQAksV",
|
"_id": "7pKKYgRQAKlQAksV",
|
||||||
"description": "",
|
"description": "",
|
||||||
"sort": 1000000,
|
"sort": 950000,
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_key": "!folders!7pKKYgRQAKlQAksV"
|
"_key": "!folders!7pKKYgRQAKlQAksV"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"sorting": "a",
|
"sorting": "a",
|
||||||
"_id": "9Xc6KzNyjDtTGZkp",
|
"_id": "9Xc6KzNyjDtTGZkp",
|
||||||
"description": "",
|
"description": "",
|
||||||
"sort": 100000,
|
"sort": 700000,
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_key": "!folders!9Xc6KzNyjDtTGZkp"
|
"_key": "!folders!9Xc6KzNyjDtTGZkp"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"sorting": "a",
|
"sorting": "a",
|
||||||
"_id": "o7t2fsAmRxKLoHrO",
|
"_id": "o7t2fsAmRxKLoHrO",
|
||||||
"description": "",
|
"description": "",
|
||||||
"sort": 200000,
|
"sort": 800000,
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_key": "!folders!o7t2fsAmRxKLoHrO"
|
"_key": "!folders!o7t2fsAmRxKLoHrO"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"sorting": "a",
|
"sorting": "a",
|
||||||
"_id": "wWL9mV6i2EGX5xHS",
|
"_id": "wWL9mV6i2EGX5xHS",
|
||||||
"description": "",
|
"description": "",
|
||||||
"sort": 300000,
|
"sort": 850000,
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_key": "!folders!wWL9mV6i2EGX5xHS"
|
"_key": "!folders!wWL9mV6i2EGX5xHS"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"sorting": "a",
|
"sorting": "a",
|
||||||
"_id": "yalAnCU3SndrYImF",
|
"_id": "yalAnCU3SndrYImF",
|
||||||
"description": "",
|
"description": "",
|
||||||
"sort": 400000,
|
"sort": 900000,
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_key": "!folders!yalAnCU3SndrYImF"
|
"_key": "!folders!yalAnCU3SndrYImF"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"sorting": "a",
|
"sorting": "a",
|
||||||
"_id": "Emnx4o1DWGTVKoAg",
|
"_id": "Emnx4o1DWGTVKoAg",
|
||||||
"description": "",
|
"description": "",
|
||||||
"sort": 500000,
|
"sort": 901563,
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_key": "!folders!Emnx4o1DWGTVKoAg"
|
"_key": "!folders!Emnx4o1DWGTVKoAg"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"sorting": "a",
|
"sorting": "a",
|
||||||
"_id": "EiP5dLozOFZKIeWN",
|
"_id": "EiP5dLozOFZKIeWN",
|
||||||
"description": "",
|
"description": "",
|
||||||
"sort": 600000,
|
"sort": 903125,
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_key": "!folders!EiP5dLozOFZKIeWN"
|
"_key": "!folders!EiP5dLozOFZKIeWN"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"sorting": "a",
|
"sorting": "a",
|
||||||
"_id": "HAGbPLHwm0UozDeG",
|
"_id": "HAGbPLHwm0UozDeG",
|
||||||
"description": "",
|
"description": "",
|
||||||
"sort": 700000,
|
"sort": 906250,
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_key": "!folders!HAGbPLHwm0UozDeG"
|
"_key": "!folders!HAGbPLHwm0UozDeG"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"sorting": "a",
|
"sorting": "a",
|
||||||
"_id": "me7ywrVh38j6T8Sm",
|
"_id": "me7ywrVh38j6T8Sm",
|
||||||
"description": "",
|
"description": "",
|
||||||
"sort": 800000,
|
"sort": 912500,
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_key": "!folders!me7ywrVh38j6T8Sm"
|
"_key": "!folders!me7ywrVh38j6T8Sm"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"sorting": "a",
|
"sorting": "a",
|
||||||
"_id": "QYdeGsmVYIF34kZR",
|
"_id": "QYdeGsmVYIF34kZR",
|
||||||
"description": "",
|
"description": "",
|
||||||
"sort": 900000,
|
"sort": 925000,
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"_key": "!folders!QYdeGsmVYIF34kZR"
|
"_key": "!folders!QYdeGsmVYIF34kZR"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,10 @@
|
||||||
{{formField systemFields.level value=source.system.level data-dtype="Number"}}
|
{{formField systemFields.level value=source.system.level data-dtype="Number"}}
|
||||||
<span>{{localize "DAGGERHEART.ITEMS.DomainCard.recallCost"}}</span>
|
<span>{{localize "DAGGERHEART.ITEMS.DomainCard.recallCost"}}</span>
|
||||||
{{formField systemFields.recallCost value=source.system.recallCost data-dtype="Number"}}
|
{{formField systemFields.recallCost value=source.system.recallCost data-dtype="Number"}}
|
||||||
|
<span>{{localize "DAGGERHEART.ITEMS.DomainCard.vaultActive"}}</span>
|
||||||
|
{{formField systemFields.vaultActive value=source.system.vaultActive}}
|
||||||
|
<span>{{localize "DAGGERHEART.ITEMS.DomainCard.loadoutIgnore"}}</span>
|
||||||
|
{{formField systemFields.loadoutIgnore value=source.system.loadoutIgnore}}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
{{> "systems/daggerheart/templates/sheets/global/partials/resource-section/resource-section.hbs" }}
|
{{> "systems/daggerheart/templates/sheets/global/partials/resource-section/resource-section.hbs" }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue