mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
Merge branch 'main' into release
This commit is contained in:
commit
42a22a49f0
13 changed files with 74 additions and 17 deletions
|
|
@ -607,6 +607,7 @@
|
||||||
},
|
},
|
||||||
"RerollDialog": {
|
"RerollDialog": {
|
||||||
"title": "Reroll",
|
"title": "Reroll",
|
||||||
|
"damageTitle": "Reroll Damage",
|
||||||
"deselectDiceNotification": "Deselect one of the selected dice first",
|
"deselectDiceNotification": "Deselect one of the selected dice first",
|
||||||
"acceptCurrentRolls": "Accept Current Rolls"
|
"acceptCurrentRolls": "Accept Current Rolls"
|
||||||
},
|
},
|
||||||
|
|
@ -2506,6 +2507,7 @@
|
||||||
"itemFeatures": "Item Features",
|
"itemFeatures": "Item Features",
|
||||||
"nrChoices": "# Moves Per Rest",
|
"nrChoices": "# Moves Per Rest",
|
||||||
"resetMovesTitle": "Reset {type} Downtime Moves",
|
"resetMovesTitle": "Reset {type} Downtime Moves",
|
||||||
|
"resetItemFeaturesTitle": "Reset {type}",
|
||||||
"resetMovesText": "Are you sure you want to reset?",
|
"resetMovesText": "Are you sure you want to reset?",
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"maxFear": { "label": "Max Fear" },
|
"maxFear": { "label": "Max Fear" },
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,15 @@ export default class DhSceneConfigSettings extends foundry.applications.sheets.S
|
||||||
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
||||||
const item = await foundry.utils.fromUuid(data.uuid);
|
const item = await foundry.utils.fromUuid(data.uuid);
|
||||||
if (item instanceof game.system.api.documents.DhpActor && item.type === 'environment') {
|
if (item instanceof game.system.api.documents.DhpActor && item.type === 'environment') {
|
||||||
|
let sceneUuid = data.uuid;
|
||||||
|
if (item.pack) {
|
||||||
|
const inWorldActor = await game.system.api.documents.DhpActor.create([item.toObject()]);
|
||||||
|
if (!inWorldActor.length) return;
|
||||||
|
sceneUuid = inWorldActor[0].uuid;
|
||||||
|
}
|
||||||
|
|
||||||
await this.daggerheartFlag.updateSource({
|
await this.daggerheartFlag.updateSource({
|
||||||
sceneEnvironments: [...this.daggerheartFlag.sceneEnvironments, data.uuid]
|
sceneEnvironments: [...this.daggerheartFlag.sceneEnvironments, sceneUuid]
|
||||||
});
|
});
|
||||||
this.render({ internalRefresh: true });
|
this.render({ internalRefresh: true });
|
||||||
}
|
}
|
||||||
|
|
@ -97,6 +104,10 @@ export default class DhSceneConfigSettings extends foundry.applications.sheets.S
|
||||||
/** @override */
|
/** @override */
|
||||||
async _processSubmitData(event, form, submitData, options) {
|
async _processSubmitData(event, form, submitData, options) {
|
||||||
submitData.flags.daggerheart = this.daggerheartFlag.toObject();
|
submitData.flags.daggerheart = this.daggerheartFlag.toObject();
|
||||||
|
submitData.flags.daggerheart.sceneEnvironments = submitData.flags.daggerheart.sceneEnvironments.filter(x =>
|
||||||
|
foundry.utils.fromUuidSync(x)
|
||||||
|
);
|
||||||
|
|
||||||
for (const key of Object.keys(this.document._source.flags.daggerheart?.sceneEnvironments ?? {})) {
|
for (const key of Object.keys(this.document._source.flags.daggerheart?.sceneEnvironments ?? {})) {
|
||||||
if (!submitData.flags.daggerheart.sceneEnvironments[key]) {
|
if (!submitData.flags.daggerheart.sceneEnvironments[key]) {
|
||||||
submitData.flags.daggerheart.sceneEnvironments[`-=${key}`] = null;
|
submitData.flags.daggerheart.sceneEnvironments[`-=${key}`] = null;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,8 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
|
||||||
addItem: this.addItem,
|
addItem: this.addItem,
|
||||||
editItem: this.editItem,
|
editItem: this.editItem,
|
||||||
removeItem: this.removeItem,
|
removeItem: this.removeItem,
|
||||||
resetMoves: this.resetMoves,
|
resetDowntimeMoves: this.resetDowntimeMoves,
|
||||||
|
resetItemFeatures: this.resetItemFeatures,
|
||||||
addDomain: this.addDomain,
|
addDomain: this.addDomain,
|
||||||
toggleSelectedDomain: this.toggleSelectedDomain,
|
toggleSelectedDomain: this.toggleSelectedDomain,
|
||||||
deleteDomain: this.deleteDomain,
|
deleteDomain: this.deleteDomain,
|
||||||
|
|
@ -232,7 +233,7 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
static async resetMoves(_, target) {
|
static async resetDowntimeMoves(_, target) {
|
||||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||||
window: {
|
window: {
|
||||||
title: game.i18n.format('DAGGERHEART.SETTINGS.Homebrew.resetMovesTitle', {
|
title: game.i18n.format('DAGGERHEART.SETTINGS.Homebrew.resetMovesTitle', {
|
||||||
|
|
@ -266,7 +267,7 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
|
||||||
...move,
|
...move,
|
||||||
name: game.i18n.localize(move.name),
|
name: game.i18n.localize(move.name),
|
||||||
description: game.i18n.localize(move.description),
|
description: game.i18n.localize(move.description),
|
||||||
actions: move.actions.reduce((acc, key) => {
|
actions: Object.keys(move.actions).reduce((acc, key) => {
|
||||||
const action = move.actions[key];
|
const action = move.actions[key];
|
||||||
acc[key] = {
|
acc[key] = {
|
||||||
...action,
|
...action,
|
||||||
|
|
@ -293,6 +294,31 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async resetItemFeatures(_, target) {
|
||||||
|
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||||
|
window: {
|
||||||
|
title: game.i18n.format('DAGGERHEART.SETTINGS.Homebrew.resetItemFeaturesTitle', {
|
||||||
|
type: game.i18n.localize(`DAGGERHEART.GENERAL.${target.dataset.type}`)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
content: game.i18n.localize('DAGGERHEART.SETTINGS.Homebrew.resetMovesText')
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!confirmed) return;
|
||||||
|
|
||||||
|
await this.settings.updateSource({
|
||||||
|
[`itemFeatures.${target.dataset.type}`]: Object.keys(
|
||||||
|
this.settings.itemFeatures[target.dataset.type]
|
||||||
|
).reduce((acc, key) => {
|
||||||
|
acc[`-=${key}`] = null;
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
}, {})
|
||||||
|
});
|
||||||
|
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
|
||||||
static async addDomain(event) {
|
static async addDomain(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const content = new foundry.data.fields.StringField({
|
const content = new foundry.data.fields.StringField({
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,8 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
||||||
this.combats
|
this.combats
|
||||||
.find(x => x.active)
|
.find(x => x.active)
|
||||||
?.system?.extendedBattleToggles?.reduce((acc, toggle) => (acc ?? 0) + toggle.category, null) ?? null;
|
?.system?.extendedBattleToggles?.reduce((acc, toggle) => (acc ?? 0) + toggle.category, null) ?? null;
|
||||||
const maxBP = CONFIG.DH.ENCOUNTER.BaseBPPerEncounter(context.characters.length) + modifierBP;
|
const maxBP = CONFIG.DH.ENCOUNTER.BaseBPPerEncounter(context.allCharacters.length) + modifierBP;
|
||||||
const currentBP = AdversaryBPPerEncounter(context.adversaries, context.characters);
|
const currentBP = AdversaryBPPerEncounter(context.adversaries, context.allCharacters);
|
||||||
|
|
||||||
Object.assign(context, {
|
Object.assign(context, {
|
||||||
fear: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear),
|
fear: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear),
|
||||||
|
|
@ -73,9 +73,8 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
||||||
Object.assign(context, {
|
Object.assign(context, {
|
||||||
actionTokens: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules).actionTokens,
|
actionTokens: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules).actionTokens,
|
||||||
adversaries,
|
adversaries,
|
||||||
characters: characters
|
allCharacters: characters,
|
||||||
?.filter(x => !x.isNPC)
|
characters: characters.filter(x => !spotlightQueueEnabled || x.system.spotlight.requestOrderIndex == 0),
|
||||||
.filter(x => !spotlightQueueEnabled || x.system.spotlight.requestOrderIndex == 0),
|
|
||||||
spotlightRequests
|
spotlightRequests
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,8 @@ export default class DhEffectsDisplay extends HandlebarsApplicationMixin(Applica
|
||||||
};
|
};
|
||||||
|
|
||||||
toggleHidden(token, focused) {
|
toggleHidden(token, focused) {
|
||||||
|
if (!this.element) return;
|
||||||
|
|
||||||
const effects = DhEffectsDisplay.getTokenEffects(focused ? token : null);
|
const effects = DhEffectsDisplay.getTokenEffects(focused ? token : null);
|
||||||
this.element.hidden = effects.length === 0;
|
this.element.hidden = effects.length === 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -241,6 +241,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
hasHealing: this.hasHealing,
|
hasHealing: this.hasHealing,
|
||||||
hasEffect: this.hasEffect,
|
hasEffect: this.hasEffect,
|
||||||
hasSave: this.hasSave,
|
hasSave: this.hasSave,
|
||||||
|
onSave: this.save?.damageMod,
|
||||||
isDirect: !!this.damage?.direct,
|
isDirect: !!this.damage?.direct,
|
||||||
selectedRollMode: game.settings.get('core', 'rollMode'),
|
selectedRollMode: game.settings.get('core', 'rollMode'),
|
||||||
data: this.getRollData(),
|
data: this.getRollData(),
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import D20RollDialog from '../applications/dialogs/d20RollDialog.mjs';
|
||||||
export default class DHRoll extends Roll {
|
export default class DHRoll extends Roll {
|
||||||
baseTerms = [];
|
baseTerms = [];
|
||||||
constructor(formula, data = {}, options = {}) {
|
constructor(formula, data = {}, options = {}) {
|
||||||
super(formula, data, options);
|
super(formula, data, foundry.utils.mergeObject(options, { roll: [] }, { overwrite: false }));
|
||||||
options.bonusEffects = this.bonusEffectBuilder();
|
options.bonusEffects = this.bonusEffectBuilder();
|
||||||
if (!this.data || !Object.keys(this.data).length) this.data = options.data;
|
if (!this.data || !Object.keys(this.data).length) this.data = options.data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -607,7 +607,7 @@ export default class DhpActor extends Actor {
|
||||||
if (!updates.length) return;
|
if (!updates.length) return;
|
||||||
|
|
||||||
const hpDamage = updates.find(u => u.key === CONFIG.DH.GENERAL.healingTypes.hitPoints.id);
|
const hpDamage = updates.find(u => u.key === CONFIG.DH.GENERAL.healingTypes.hitPoints.id);
|
||||||
if (hpDamage) {
|
if (hpDamage?.value) {
|
||||||
hpDamage.value = this.convertDamageToThreshold(hpDamage.value);
|
hpDamage.value = this.convertDamageToThreshold(hpDamage.value);
|
||||||
if (
|
if (
|
||||||
this.type === 'character' &&
|
this.type === 'character' &&
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
config = foundry.utils.deepClone(this.system);
|
config = foundry.utils.deepClone(this.system);
|
||||||
config.event = event;
|
config.event = event;
|
||||||
|
|
||||||
if (this.system.onSave) {
|
if (config.hasSave) {
|
||||||
const pendingingSaves = targets.filter(t => t.saved.success === null);
|
const pendingingSaves = targets.filter(t => t.saved.success === null);
|
||||||
if (pendingingSaves.length) {
|
if (pendingingSaves.length) {
|
||||||
const confirm = await foundry.applications.api.DialogV2.confirm({
|
const confirm = await foundry.applications.api.DialogV2.confirm({
|
||||||
|
|
|
||||||
|
|
@ -210,6 +210,22 @@ export async function runMigrations() {
|
||||||
|
|
||||||
lastMigrationVersion = '1.2.7';
|
lastMigrationVersion = '1.2.7';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (foundry.utils.isNewerVersion('1.5.5', lastMigrationVersion)) {
|
||||||
|
for (const scene of game.scenes) {
|
||||||
|
if (!scene.flags.daggerheart) continue;
|
||||||
|
const systemData = new game.system.api.data.scenes.DHScene(scene.flags.daggerheart);
|
||||||
|
const sceneEnvironments = systemData.sceneEnvironments;
|
||||||
|
|
||||||
|
const newEnvironments = sceneEnvironments.filter(x => !x?.pack);
|
||||||
|
if (newEnvironments.length !== sceneEnvironments.length)
|
||||||
|
await scene.update({ 'flags.daggerheart.sceneEnvironments': newEnvironments });
|
||||||
|
}
|
||||||
|
|
||||||
|
ui.nav.render(true);
|
||||||
|
|
||||||
|
lastMigrationVersion = '1.5.5';
|
||||||
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);
|
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);
|
||||||
|
|
|
||||||
|
|
@ -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.5.4",
|
"version": "1.5.5",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "13.346",
|
"minimum": "13.346",
|
||||||
"verified": "13.351",
|
"verified": "13.351",
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<legend>
|
<legend>
|
||||||
{{localize "DAGGERHEART.APPLICATIONS.Downtime.longRest.title"}}
|
{{localize "DAGGERHEART.APPLICATIONS.Downtime.longRest.title"}}
|
||||||
<a data-action="addItem" data-type="longRest"><i class="fa-solid fa-plus"></i></a>
|
<a data-action="addItem" data-type="longRest"><i class="fa-solid fa-plus"></i></a>
|
||||||
<a data-action="resetMoves" data-type="longRest"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
<a data-action="resetDowntimeMoves" data-type="longRest"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
||||||
</legend>
|
</legend>
|
||||||
|
|
||||||
<div class="form-group setting-group-field">
|
<div class="form-group setting-group-field">
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
<legend>
|
<legend>
|
||||||
{{localize "DAGGERHEART.APPLICATIONS.Downtime.shortRest.title"}}
|
{{localize "DAGGERHEART.APPLICATIONS.Downtime.shortRest.title"}}
|
||||||
<a data-action="addItem" data-type="shortRest"><i class="fa-solid fa-plus"></i></a>
|
<a data-action="addItem" data-type="shortRest"><i class="fa-solid fa-plus"></i></a>
|
||||||
<a data-action="resetMoves" data-type="shortRest"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
<a data-action="resetDowntimeMoves" data-type="shortRest"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
||||||
</legend>
|
</legend>
|
||||||
|
|
||||||
<div class="form-group setting-group-field">
|
<div class="form-group setting-group-field">
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<legend>
|
<legend>
|
||||||
{{localize "DAGGERHEART.GENERAL.weaponFeatures"}}
|
{{localize "DAGGERHEART.GENERAL.weaponFeatures"}}
|
||||||
<a data-action="addItem" data-type="weaponFeatures"><i class="fa-solid fa-plus"></i></a>
|
<a data-action="addItem" data-type="weaponFeatures"><i class="fa-solid fa-plus"></i></a>
|
||||||
<a data-action="resetMoves" data-type="weaponFeatures"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
<a data-action="resetItemFeatures" data-type="weaponFeatures"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
||||||
</legend>
|
</legend>
|
||||||
|
|
||||||
<div class="settings-items">
|
<div class="settings-items">
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<legend>
|
<legend>
|
||||||
{{localize "DAGGERHEART.GENERAL.armorFeatures"}}
|
{{localize "DAGGERHEART.GENERAL.armorFeatures"}}
|
||||||
<a data-action="addItem" data-type="armorFeatures"><i class="fa-solid fa-plus"></i></a>
|
<a data-action="addItem" data-type="armorFeatures"><i class="fa-solid fa-plus"></i></a>
|
||||||
<a data-action="resetMoves" data-type="armorFeatures"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
<a data-action="resetItemFeatures" data-type="armorFeatures"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
||||||
</legend>
|
</legend>
|
||||||
|
|
||||||
<div class="settings-items">
|
<div class="settings-items">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue