mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Merge branch 'hotfix' into fix/877-hope-update-order
This commit is contained in:
commit
a22b4c8209
23 changed files with 267 additions and 80 deletions
|
|
@ -189,7 +189,11 @@
|
||||||
"title": "Multiclass Subclass",
|
"title": "Multiclass Subclass",
|
||||||
"text": "Do you want to add this subclass as your multiclass subclass?"
|
"text": "Do you want to add this subclass as your multiclass subclass?"
|
||||||
},
|
},
|
||||||
"cannotRemoveCoreExperience": "You are using Levelup Auto. You cannot remove an experience given to you by the rule progression."
|
"cannotRemoveCoreExperience": "You are using Levelup Auto. You cannot remove an experience given to you by the rule progression.",
|
||||||
|
"companionLevelup": {
|
||||||
|
"confirmTitle": "Companion Levelup",
|
||||||
|
"confirmText": "Would you like to level up your companion {name} by {levelChange} levels at this time? (You can do it manually later)"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Companion": {
|
"Companion": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
|
|
@ -2370,7 +2374,8 @@
|
||||||
"rulesOn": "Rules On",
|
"rulesOn": "Rules On",
|
||||||
"rulesOff": "Rules Off",
|
"rulesOff": "Rules Off",
|
||||||
"remainingUses": "Uses refresh on {type}",
|
"remainingUses": "Uses refresh on {type}",
|
||||||
"rightClickExtand": "Right-Click to extand"
|
"rightClickExtand": "Right-Click to extand",
|
||||||
|
"companionPartnerLevelBlock": "The companion needs an assigned partner to level up."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,28 @@ export default class DhCompanionLevelUp extends BaseLevelUp {
|
||||||
const levelKeys = Object.keys(this.levelup.levels);
|
const levelKeys = Object.keys(this.levelup.levels);
|
||||||
const actorDamageDice = this.actor.system.attack.damage.parts[0].value.dice;
|
const actorDamageDice = this.actor.system.attack.damage.parts[0].value.dice;
|
||||||
const actorRange = this.actor.system.attack.range;
|
const actorRange = this.actor.system.attack.range;
|
||||||
|
|
||||||
|
let achievementExperiences = [];
|
||||||
|
for (var levelKey of levelKeys) {
|
||||||
|
const level = this.levelup.levels[levelKey];
|
||||||
|
if (Number(levelKey) < this.levelup.startLevel) continue;
|
||||||
|
|
||||||
|
achievementExperiences = level.achievements.experiences
|
||||||
|
? Object.values(level.achievements.experiences).reduce((acc, experience) => {
|
||||||
|
if (experience.name) acc.push(experience);
|
||||||
|
return acc;
|
||||||
|
}, [])
|
||||||
|
: [];
|
||||||
|
}
|
||||||
|
context.achievements = {
|
||||||
|
experiences: {
|
||||||
|
values: achievementExperiences,
|
||||||
|
shown: achievementExperiences.length > 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
context.achievements = context.achievements.experiences.shown ? context.achievements : undefined;
|
||||||
|
|
||||||
const advancement = {};
|
const advancement = {};
|
||||||
for (var levelKey of levelKeys) {
|
for (var levelKey of levelKeys) {
|
||||||
const level = this.levelup.levels[levelKey];
|
const level = this.levelup.levels[levelKey];
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import { GMUpdateEvent, socketEvent } from '../../systemRegistration/socket.mjs';
|
import { GMUpdateEvent, socketEvent } from '../../systemRegistration/socket.mjs';
|
||||||
import DhCompanionlevelUp from '../levelup/companionLevelup.mjs';
|
|
||||||
import DHBaseActorSettings from '../sheets/api/actor-setting.mjs';
|
import DHBaseActorSettings from '../sheets/api/actor-setting.mjs';
|
||||||
|
|
||||||
/**@typedef {import('@client/applications/_types.mjs').ApplicationClickAction} ApplicationClickAction */
|
/**@typedef {import('@client/applications/_types.mjs').ApplicationClickAction} ApplicationClickAction */
|
||||||
|
|
@ -11,8 +10,7 @@ export default class DHCompanionSettings extends DHBaseActorSettings {
|
||||||
position: { width: 455, height: 'auto' },
|
position: { width: 455, height: 'auto' },
|
||||||
actions: {
|
actions: {
|
||||||
addExperience: DHCompanionSettings.#addExperience,
|
addExperience: DHCompanionSettings.#addExperience,
|
||||||
removeExperience: DHCompanionSettings.#removeExperience,
|
removeExperience: DHCompanionSettings.#removeExperience
|
||||||
levelUp: DHCompanionSettings.#levelUp
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -121,12 +119,4 @@ export default class DHCompanionSettings extends DHBaseActorSettings {
|
||||||
|
|
||||||
await this.actor.update({ [`system.experiences.-=${target.dataset.experience}`]: null });
|
await this.actor.update({ [`system.experiences.-=${target.dataset.experience}`]: null });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Opens the companion level-up dialog for the associated actor.
|
|
||||||
* @type {ApplicationClickAction}
|
|
||||||
*/
|
|
||||||
static async #levelUp() {
|
|
||||||
new DhCompanionlevelUp(this.actor).render({ force: true });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import DhCompanionLevelUp from '../../levelup/companionLevelup.mjs';
|
||||||
import DHBaseActorSheet from '../api/base-actor.mjs';
|
import DHBaseActorSheet from '../api/base-actor.mjs';
|
||||||
|
|
||||||
/**@typedef {import('@client/applications/_types.mjs').ApplicationClickAction} ApplicationClickAction */
|
/**@typedef {import('@client/applications/_types.mjs').ApplicationClickAction} ApplicationClickAction */
|
||||||
|
|
@ -6,7 +7,9 @@ export default class DhCompanionSheet extends DHBaseActorSheet {
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
classes: ['actor', 'companion'],
|
classes: ['actor', 'companion'],
|
||||||
position: { width: 300 },
|
position: { width: 300 },
|
||||||
actions: {}
|
actions: {
|
||||||
|
levelManagement: DhCompanionSheet.#levelManagement
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static PARTS = {
|
static PARTS = {
|
||||||
|
|
@ -25,4 +28,25 @@ export default class DhCompanionSheet extends DHBaseActorSheet {
|
||||||
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
|
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** @inheritDoc */
|
||||||
|
async _onRender(context, options) {
|
||||||
|
await super._onRender(context, options);
|
||||||
|
|
||||||
|
this.element
|
||||||
|
.querySelector('.level-value')
|
||||||
|
?.addEventListener('change', event => this.document.updateLevel(Number(event.currentTarget.value)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
/* Application Clicks Actions */
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens the companions level management window.
|
||||||
|
* @type {ApplicationClickAction}
|
||||||
|
*/
|
||||||
|
static #levelManagement() {
|
||||||
|
new DhCompanionLevelUp(this.document).render({ force: true });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ export default function ItemAttachmentSheet(Base) {
|
||||||
...super.TABS,
|
...super.TABS,
|
||||||
primary: {
|
primary: {
|
||||||
...super.TABS?.primary,
|
...super.TABS?.primary,
|
||||||
tabs: [...(super.TABS?.primary?.tabs || []), { id: 'attachments' }],
|
tabs: [...(super.TABS?.primary?.tabs || []) /*{ id: 'attachments' }*/], // Disabled until fixed
|
||||||
initial: super.TABS?.primary?.initial || 'description',
|
initial: super.TABS?.primary?.initial || 'description',
|
||||||
labelPrefix: super.TABS?.primary?.labelPrefix || 'DAGGERHEART.GENERAL.Tabs'
|
labelPrefix: super.TABS?.primary?.labelPrefix || 'DAGGERHEART.GENERAL.Tabs'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -602,7 +602,20 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareDerivedData() {
|
prepareDerivedData() {
|
||||||
const baseHope = this.resources.hope.value + (this.companion?.system?.resources?.hope ?? 0);
|
let baseHope = this.resources.hope.value;
|
||||||
|
if (this.companion) {
|
||||||
|
for (let levelKey in this.companion.system.levelData.levelups) {
|
||||||
|
const level = this.companion.system.levelData.levelups[levelKey];
|
||||||
|
for (let selection of level.selections) {
|
||||||
|
switch (selection.type) {
|
||||||
|
case 'hope':
|
||||||
|
this.resources.hope.max += selection.value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.resources.hope.value = Math.min(baseHope, this.resources.hope.max);
|
this.resources.hope.value = Math.min(baseHope, this.resources.hope.max);
|
||||||
this.attack.roll.trait = this.rules.attack.roll.trait ?? this.attack.roll.trait;
|
this.attack.roll.trait = this.rules.attack.roll.trait ?? this.attack.roll.trait;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,12 +40,14 @@ export default class DhCompanion extends BaseDataActor {
|
||||||
experiences: new fields.TypedObjectField(
|
experiences: new fields.TypedObjectField(
|
||||||
new fields.SchemaField({
|
new fields.SchemaField({
|
||||||
name: new fields.StringField({}),
|
name: new fields.StringField({}),
|
||||||
value: new fields.NumberField({ integer: true, initial: 0 })
|
value: new fields.NumberField({ integer: true, initial: 0 }),
|
||||||
|
description: new fields.StringField(),
|
||||||
|
core: new fields.BooleanField({ initial: false })
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
initial: {
|
initial: {
|
||||||
experience1: { value: 2 },
|
experience1: { value: 2, core: true },
|
||||||
experience2: { value: 2 }
|
experience2: { value: 2, core: true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
|
@ -134,6 +136,23 @@ export default class DhCompanion extends BaseDataActor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _preUpdate(changes, options, userId) {
|
||||||
|
const allowed = await super._preUpdate(changes, options, userId);
|
||||||
|
if (allowed === false) return;
|
||||||
|
|
||||||
|
/* The first two experiences are always marked as core */
|
||||||
|
if (changes.system?.experiences && Object.keys(this.experiences).length < 2) {
|
||||||
|
const experiences = new Set(Object.keys(this.experiences));
|
||||||
|
const changeExperiences = new Set(Object.keys(changes.system.experiences));
|
||||||
|
const newExperiences = Array.from(changeExperiences.difference(experiences));
|
||||||
|
|
||||||
|
for (var i = 0; i < Math.min(newExperiences.length, 2 - experiences.size); i++) {
|
||||||
|
const experience = newExperiences[i];
|
||||||
|
changes.system.experiences[experience].core = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async _preDelete() {
|
async _preDelete() {
|
||||||
if (this.partner) {
|
if (this.partner) {
|
||||||
await this.partner.update({ 'system.companion': null });
|
await this.partner.update({ 'system.companion': null });
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import AttachableItem from './attachableItem.mjs';
|
import AttachableItem from './attachableItem.mjs';
|
||||||
import { ActionsField, ActionField } from '../fields/actionField.mjs';
|
import { ActionField } from '../fields/actionField.mjs';
|
||||||
|
|
||||||
export default class DHWeapon extends AttachableItem {
|
export default class DHWeapon extends AttachableItem {
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
|
|
@ -18,12 +18,23 @@ export default class DHWeapon extends AttachableItem {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
return {
|
return {
|
||||||
...super.defineSchema(),
|
...super.defineSchema(),
|
||||||
tier: new fields.NumberField({ required: true, integer: true, initial: 1, min: 1, label: "DAGGERHEART.GENERAL.Tiers.singular" }),
|
tier: new fields.NumberField({
|
||||||
|
required: true,
|
||||||
|
integer: true,
|
||||||
|
initial: 1,
|
||||||
|
min: 1,
|
||||||
|
label: 'DAGGERHEART.GENERAL.Tiers.singular'
|
||||||
|
}),
|
||||||
equipped: new fields.BooleanField({ initial: false }),
|
equipped: new fields.BooleanField({ initial: false }),
|
||||||
|
|
||||||
//SETTINGS
|
//SETTINGS
|
||||||
secondary: new fields.BooleanField({ initial: false, label: "DAGGERHEART.ITEMS.Weapon.secondaryWeapon" }),
|
secondary: new fields.BooleanField({ initial: false, label: 'DAGGERHEART.ITEMS.Weapon.secondaryWeapon' }),
|
||||||
burden: new fields.StringField({ required: true, choices: CONFIG.DH.GENERAL.burden, initial: 'oneHanded', label: "DAGGERHEART.GENERAL.burden" }),
|
burden: new fields.StringField({
|
||||||
|
required: true,
|
||||||
|
choices: CONFIG.DH.GENERAL.burden,
|
||||||
|
initial: 'oneHanded',
|
||||||
|
label: 'DAGGERHEART.GENERAL.burden'
|
||||||
|
}),
|
||||||
weaponFeatures: new fields.ArrayField(
|
weaponFeatures: new fields.ArrayField(
|
||||||
new fields.SchemaField({
|
new fields.SchemaField({
|
||||||
value: new fields.StringField({
|
value: new fields.StringField({
|
||||||
|
|
@ -212,7 +223,7 @@ export default class DHWeapon extends AttachableItem {
|
||||||
const labels = [];
|
const labels = [];
|
||||||
const { roll, range, damage } = this.attack;
|
const { roll, range, damage } = this.attack;
|
||||||
|
|
||||||
if (roll.trait) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Traits.${roll.trait}.short`))
|
if (roll.trait) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Traits.${roll.trait}.short`));
|
||||||
if (range) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Range.${range}.short`));
|
if (range) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Range.${range}.short`));
|
||||||
|
|
||||||
for (const { value, type } of damage.parts) {
|
for (const { value, type } of damage.parts) {
|
||||||
|
|
|
||||||
|
|
@ -404,7 +404,27 @@ export const defaultCompanionTier = {
|
||||||
start: 2,
|
start: 2,
|
||||||
end: 10
|
end: 10
|
||||||
},
|
},
|
||||||
initialAchievements: {},
|
initialAchievements: {
|
||||||
|
experience: {
|
||||||
|
nr: 1,
|
||||||
|
modifier: 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/* Improved this. Quick solution for companions */
|
||||||
|
extraAchievements: {
|
||||||
|
5: {
|
||||||
|
experience: {
|
||||||
|
nr: 1,
|
||||||
|
modifier: 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
8: {
|
||||||
|
experience: {
|
||||||
|
nr: 1,
|
||||||
|
modifier: 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
availableOptions: 1,
|
availableOptions: 1,
|
||||||
domainCardByLevel: 0,
|
domainCardByLevel: 0,
|
||||||
options: {
|
options: {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ export class DhLevelup extends foundry.abstract.DataModel {
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
}, {})
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
const domainCards = [...Array(tier.domainCardByLevel).keys()].reduce((acc, _) => {
|
const domainCards = [...Array(tier.domainCardByLevel).keys()].reduce((acc, _) => {
|
||||||
const id = foundry.utils.randomID();
|
const id = foundry.utils.randomID();
|
||||||
acc[id] = { uuid: null, itemUuid: null, level: i };
|
acc[id] = { uuid: null, itemUuid: null, level: i };
|
||||||
|
|
@ -42,6 +43,20 @@ export class DhLevelup extends foundry.abstract.DataModel {
|
||||||
belongingLevels.push(i);
|
belongingLevels.push(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Improve. Temporary handling for Companion new experiences */
|
||||||
|
Object.keys(tier.extraAchievements ?? {}).forEach(key => {
|
||||||
|
const level = Number(key);
|
||||||
|
if (level >= startLevel && level <= endLevel) {
|
||||||
|
const levelExtras = tier.extraAchievements[level];
|
||||||
|
if (levelExtras.experience) {
|
||||||
|
levels[level].achievements.experiences[foundry.utils.randomID()] = {
|
||||||
|
name: '',
|
||||||
|
modifier: levelExtras.experience.modifier
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
tiers[key] = {
|
tiers[key] = {
|
||||||
name: tier.name,
|
name: tier.name,
|
||||||
belongingLevels: belongingLevels,
|
belongingLevels: belongingLevels,
|
||||||
|
|
|
||||||
|
|
@ -137,9 +137,10 @@ export default class DamageRoll extends DHRoll {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.isCritical && part.applyTo === CONFIG.DH.GENERAL.healingTypes.hitPoints.id) {
|
if (config.isCritical && part.applyTo === CONFIG.DH.GENERAL.healingTypes.hitPoints.id) {
|
||||||
const tmpRoll = Roll.fromTerms(part.roll.terms)._evaluateSync({ maximize: true }),
|
const total = part.roll.dice.reduce((acc, term) => acc + term._faces*term._number, 0);
|
||||||
criticalBonus = tmpRoll.total - this.constructor.calculateTotalModifiers(tmpRoll);
|
if (total > 0) {
|
||||||
part.roll.terms.push(...this.formatModifier(criticalBonus));
|
part.roll.terms.push(...this.formatModifier(total));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* To Remove When Reaction System */
|
/* To Remove When Reaction System */
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import { emitAsGM, GMUpdateEvent } from '../systemRegistration/socket.mjs';
|
||||||
import { LevelOptionType } from '../data/levelTier.mjs';
|
import { LevelOptionType } from '../data/levelTier.mjs';
|
||||||
import DHFeature from '../data/item/feature.mjs';
|
import DHFeature from '../data/item/feature.mjs';
|
||||||
import { damageKeyToNumber } from '../helpers/utils.mjs';
|
import { damageKeyToNumber } from '../helpers/utils.mjs';
|
||||||
|
import DhCompanionLevelUp from '../applications/levelup/companionLevelup.mjs';
|
||||||
|
|
||||||
export default class DhpActor extends Actor {
|
export default class DhpActor extends Actor {
|
||||||
/**
|
/**
|
||||||
|
|
@ -142,9 +143,6 @@ export default class DhpActor extends Actor {
|
||||||
}, {})
|
}, {})
|
||||||
});
|
});
|
||||||
this.update(getUpdate());
|
this.update(getUpdate());
|
||||||
if (this.system.companion) {
|
|
||||||
this.system.companion.update(getUpdate());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subclassFeatureState.class) {
|
if (subclassFeatureState.class) {
|
||||||
|
|
@ -195,10 +193,6 @@ export default class DhpActor extends Actor {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.sheet.render();
|
this.sheet.render();
|
||||||
|
|
||||||
if (this.system.companion) {
|
|
||||||
this.system.companion.updateLevel(newLevel);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -219,16 +213,6 @@ export default class DhpActor extends Actor {
|
||||||
core: true
|
core: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.system.companion) {
|
|
||||||
await this.system.companion.update({
|
|
||||||
[`system.experiences.${experienceKey}`]: {
|
|
||||||
name: '',
|
|
||||||
value: experience.modifier,
|
|
||||||
core: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -405,6 +389,7 @@ export default class DhpActor extends Actor {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const levelChange = this.system.levelData.level.changed - this.system.levelData.level.current;
|
||||||
await this.update({
|
await this.update({
|
||||||
system: {
|
system: {
|
||||||
levelData: {
|
levelData: {
|
||||||
|
|
@ -417,8 +402,21 @@ export default class DhpActor extends Actor {
|
||||||
});
|
});
|
||||||
this.sheet.render();
|
this.sheet.render();
|
||||||
|
|
||||||
if (this.system.companion) {
|
if (this.system.companion && !this.system.companion.system.levelData.canLevelUp) {
|
||||||
this.system.companion.updateLevel(this.system.levelData.level.changed);
|
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||||
|
window: {
|
||||||
|
title: game.i18n.localize('DAGGERHEART.ACTORS.Character.companionLevelup.confirmTitle')
|
||||||
|
},
|
||||||
|
content: game.i18n.format('DAGGERHEART.ACTORS.Character.companionLevelup.confirmText', {
|
||||||
|
name: this.system.companion.name,
|
||||||
|
levelChange: levelChange
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!confirmed) return;
|
||||||
|
|
||||||
|
await this.system.companion.updateLevel(this.system.companion.system.levelData.level.current + levelChange);
|
||||||
|
new DhCompanionLevelUp(this.system.companion).render({ force: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,4 +72,8 @@ export default class DHToken extends TokenDocument {
|
||||||
}
|
}
|
||||||
return attributes;
|
return attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_shouldRecordMovementHistory() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,11 +49,11 @@ export default class DhTooltipManager extends foundry.helpers.interaction.Toolti
|
||||||
const longRest = element.dataset.tooltip?.startsWith('#longRest#');
|
const longRest = element.dataset.tooltip?.startsWith('#longRest#');
|
||||||
if (shortRest || longRest) {
|
if (shortRest || longRest) {
|
||||||
const key = element.dataset.tooltip.slice(shortRest ? 11 : 10);
|
const key = element.dataset.tooltip.slice(shortRest ? 11 : 10);
|
||||||
const downtimeOptions = shortRest
|
|
||||||
? CONFIG.DH.GENERAL.defaultRestOptions.shortRest()
|
|
||||||
: CONFIG.DH.GENERAL.defaultRestOptions.longRest();
|
|
||||||
|
|
||||||
const move = downtimeOptions[key];
|
const moves = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).restMoves[
|
||||||
|
element.dataset.restType
|
||||||
|
].moves;
|
||||||
|
const move = moves[key];
|
||||||
const description = await TextEditor.enrichHTML(move.description);
|
const description = await TextEditor.enrichHTML(move.description);
|
||||||
html = await foundry.applications.handlebars.renderTemplate(
|
html = await foundry.applications.handlebars.renderTemplate(
|
||||||
`systems/daggerheart/templates/ui/tooltip/downtime.hbs`,
|
`systems/daggerheart/templates/ui/tooltip/downtime.hbs`,
|
||||||
|
|
|
||||||
|
|
@ -251,13 +251,15 @@ export const adjustRange = (rangeVal, decrease) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateActorTokens = async (actor, update) => {
|
export const updateActorTokens = async (actor, update) => {
|
||||||
await actor.prototypeToken.update(update);
|
await actor.prototypeToken.update({ ...update });
|
||||||
|
|
||||||
/* Update the tokens in all scenes belonging to Actor */
|
/* Update the tokens in all scenes belonging to Actor */
|
||||||
for (let token of actor.getDependentTokens()) {
|
for (let token of actor.getDependentTokens()) {
|
||||||
const tokenActor = token.baseActor ?? token.actor;
|
const tokenActor = token.baseActor ?? token.actor;
|
||||||
if (tokenActor?.id === actor.id) {
|
if (tokenActor?.id === actor.id) {
|
||||||
await token.update(update);
|
await token.update({
|
||||||
|
...update
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -341,7 +343,7 @@ export const itemAbleRollParse = (value, actor, item) => {
|
||||||
const model = isItemTarget ? item : actor;
|
const model = isItemTarget ? item : actor;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return Roll.replaceFormulaData(slicedValue, model?.getRollData?.() ?? model);
|
return Roll.replaceFormulaData(slicedValue, isItemTarget || !model?.getRollData ? model : model.getRollData());
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
@ -370,7 +372,7 @@ export function getScrollTextData(resources, resource, key) {
|
||||||
|
|
||||||
export function createScrollText(actor, optionsData) {
|
export function createScrollText(actor, optionsData) {
|
||||||
if (actor && optionsData?.length) {
|
if (actor && optionsData?.length) {
|
||||||
actor.getDependentTokens().forEach(token => {
|
actor.getActiveTokens().forEach(token => {
|
||||||
optionsData.forEach(data => {
|
optionsData.forEach(data => {
|
||||||
const { text, ...options } = data;
|
const { text, ...options } = data;
|
||||||
canvas.interface.createScrollingText(token.getCenterPoint(), data.text, {
|
canvas.interface.createScrollingText(token.getCenterPoint(), data.text, {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -9,13 +9,13 @@
|
||||||
|
|
||||||
&.xxs {
|
&.xxs {
|
||||||
height: 1rem;
|
height: 1rem;
|
||||||
font-size: .5rem;
|
font-size: 0.5rem;
|
||||||
-webkit-text-stroke: 1px black;
|
-webkit-text-stroke: 1px black;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.xs {
|
&.xs {
|
||||||
height: 1.5rem;
|
height: 1.5rem;
|
||||||
font-size: .75rem;
|
font-size: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.lg {
|
&.lg {
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&.discarded {
|
&.discarded {
|
||||||
opacity: .5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
mask: var(--svg-die) no-repeat center;
|
mask: var(--svg-die) no-repeat center;
|
||||||
mask-size: contain;
|
mask-size: contain;
|
||||||
background: linear-gradient(139.01deg, #EFE6D8 3.51%, #372E1F 96.49%);
|
background: linear-gradient(139.01deg, #efe6d8 3.51%, #372e1f 96.49%);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.d4:before {
|
&.d4:before {
|
||||||
|
|
@ -63,18 +63,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&.color-hope:before {
|
&.color-hope:before {
|
||||||
background: linear-gradient(139.01deg, #F3C267 3.51%, #4C3407 96.49%);
|
background: linear-gradient(139.01deg, #f3c267 3.51%, #4c3407 96.49%);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.color-fear:before {
|
&.color-fear:before {
|
||||||
background: linear-gradient(151.21deg, #352AB2 7.21%, #18162E 92.79%);
|
background: linear-gradient(151.21deg, #352ab2 7.21%, #18162e 92.79%);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.color-adv:before {
|
&.color-adv:before {
|
||||||
background: linear-gradient(139.01deg, #40A640 3.51%, #011B01 96.49%);
|
background: linear-gradient(139.01deg, #40a640 3.51%, #011b01 96.49%);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.color-dis:before {
|
&.color-dis:before {
|
||||||
background: linear-gradient(139.01deg, #E54E4E 3.51%, #3C0000 82.19%);
|
background: linear-gradient(139.01deg, #e54e4e 3.51%, #3c0000 82.19%);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
&.coin:before {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -185,9 +185,50 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.level-up-label {
|
.level-div {
|
||||||
font-size: 24px;
|
white-space: nowrap;
|
||||||
padding-top: 8px;
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
|
||||||
|
.label {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
|
||||||
|
.input-section {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 40px;
|
||||||
|
padding: 0;
|
||||||
|
text-align: center;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.level-button {
|
||||||
|
color: light-dark(@dark, @beige);
|
||||||
|
font-size: 18px;
|
||||||
|
line-height: 1;
|
||||||
|
min-height: unset;
|
||||||
|
height: min-content;
|
||||||
|
padding: 4px;
|
||||||
|
font-family: 'Cinzel', serif;
|
||||||
|
margin: 0;
|
||||||
|
font-weight: normal;
|
||||||
|
border-color: light-dark(@dark-blue, @golden);
|
||||||
|
background-color: light-dark(transparent, @deep-black);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-image: none;
|
||||||
|
background-color: var(--color-warm-2);
|
||||||
|
filter: drop-shadow(0 0 3px lightgray);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
<div class="activities-container">
|
<div class="activities-container">
|
||||||
{{#each moves as |move key|}}
|
{{#each moves as |move key|}}
|
||||||
<a class="activity-container" data-action="selectMove" data-category="{{../category}}" data-move="{{key}}" data-tooltip="{{concat "#" ../category "#" key}}">
|
<a class="activity-container" data-action="selectMove" data-category="{{../category}}" data-move="{{key}}" data-tooltip="{{concat "#" ../category "#" key}}" data-rest-type="{{../category}}">
|
||||||
<div class="activity-inner-container">
|
<div class="activity-inner-container">
|
||||||
<i class="{{#if move.selected}}fa-solid{{else}}fa-regular{{/if}} fa-circle activity-marker"></i>
|
<i class="{{#if move.selected}}fa-solid{{else}}fa-regular{{/if}} fa-circle activity-marker"></i>
|
||||||
<div class="activity-select-section">
|
<div class="activity-select-section">
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<section
|
<section
|
||||||
class='tab {{tabs.details.cssClass}} {{tabs.details.id}}'
|
class='tab {{tabs.details.cssClass}} {{tabs.details.id}}'
|
||||||
data-tab='{{tabs.details.id}}'
|
data-tab='{{tabs.details.id}}'
|
||||||
data-group='{{tabs.details.group}}'
|
data-group='{{tabs.details.group}}'
|
||||||
>
|
>
|
||||||
<fieldset class="one-column">
|
<fieldset class="one-column">
|
||||||
|
|
@ -14,10 +14,9 @@
|
||||||
<div class="form-fields">
|
<div class="form-fields">
|
||||||
<label>{{localize "DAGGERHEART.ACTORS.Companion.FIELDS.partner.label"}}</label>
|
<label>{{localize "DAGGERHEART.ACTORS.Companion.FIELDS.partner.label"}}</label>
|
||||||
<select class="partner-value" name="system.partner">
|
<select class="partner-value" name="system.partner">
|
||||||
{{selectOptions playerCharacters selected=document._source.system.partner.uuid labelAttr="name" valueAttr="key" blank=""}}
|
{{selectOptions playerCharacters selected=document.system.partner.uuid labelAttr="name" valueAttr="key" blank=""}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<button type="button" data-action="levelUp" {{#if (not document._source.system.levelData.canLevelUp)}}disabled{{/if}}>{{localize "DAGGERHEART.GENERAL.levelUp"}}</button>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -12,12 +12,16 @@
|
||||||
<ul class="experience-list">
|
<ul class="experience-list">
|
||||||
{{#each document._source.system.experiences as |experience key|}}
|
{{#each document._source.system.experiences as |experience key|}}
|
||||||
<li class="experience-item">
|
<li class="experience-item">
|
||||||
<div class="experience-inner-item {{#if @root.levelupAuto}}no-controls{{/if}}">
|
<div class="experience-inner-item">
|
||||||
<input class="name" type="text" name="system.experiences.{{key}}.name" value="{{experience.name}}" />
|
<input class="name" type="text" name="system.experiences.{{key}}.name" value="{{experience.name}}" />
|
||||||
<input class="modifier" type="text" name="system.experiences.{{key}}.value" value="{{experience.value}}" data-dtype="Number" />
|
<input class="modifier" type="text" name="system.experiences.{{key}}.value" value="{{experience.value}}" data-dtype="Number" />
|
||||||
{{#unless @root.levelupAuto}}<a data-action="removeExperience" data-experience="{{key}}" data-tooltip="{{localize 'CONTROLS.CommonDelete'}}"><i class="fa-solid fa-trash"></i></a>{{/unless}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<span data-tooltip="{{#if experience.core}}{{localize 'DAGGERHEART.ACTORS.Character.cannotRemoveCoreExperience'}}{{else}}{{localize 'CONTROLS.CommonDelete'}}{{/if}}">
|
||||||
|
<a data-action="removeExperience" data-experience="{{key}}" class="{{#if experience.core}}disabled{{/if}}">
|
||||||
|
<i class="fa-solid fa-trash"></i>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
<textarea name="system.experiences.{{key}}.description">{{experience.description}}</textarea>
|
<textarea name="system.experiences.{{key}}.description">{{experience.description}}</textarea>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
<side-line-div></side-line-div>
|
<side-line-div></side-line-div>
|
||||||
</div>
|
</div>
|
||||||
{{#each source.system.experiences as |experience id|}}
|
{{#each source.system.experiences as |experience id|}}
|
||||||
<div class="experience-row">
|
<div class="experience-row" data-tooltip-text="{{experience.description}}">
|
||||||
<div class="experience-value">
|
<div class="experience-value">
|
||||||
+{{experience.value}}
|
+{{experience.value}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,25 @@
|
||||||
<h4>{{localize "DAGGERHEART.GENERAL.stress"}}</h4>
|
<h4>{{localize "DAGGERHEART.GENERAL.stress"}}</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h3 class="level-up-label">
|
<div class='level-div'>
|
||||||
{{localize "DAGGERHEART.GENERAL.level"}}
|
<h3 class='label'>
|
||||||
{{source.system.levelData.level.changed}}
|
{{localize 'DAGGERHEART.GENERAL.level'}}
|
||||||
</h3>
|
<div class="input-section">
|
||||||
|
{{#if document.system.levelData.canLevelUp}}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="level-button glow" data-tooltip="{{localize "DAGGERHEART.ACTORS.Character.levelUp"}}"
|
||||||
|
data-action="levelManagement"
|
||||||
|
>
|
||||||
|
<i class="fa-solid fa-angles-up"></i>
|
||||||
|
</button>
|
||||||
|
{{/if}}
|
||||||
|
<span {{#unless document.system.partner}}data-tooltip="{{localize "DAGGERHEART.UI.Tooltip.companionPartnerLevelBlock"}}"{{/unless}}>
|
||||||
|
<input type="text" data-dtype="Number" class="level-value" value={{document.system.levelData.level.changed}} {{#if document.system.needsCharacterSetup}}disabled{{/if}} {{disabled (not document.system.partner)}} />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="companion-navigation">
|
<div class="companion-navigation">
|
||||||
{{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
{{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue