mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 04:01:06 +01:00
Merge branch 'main' into feature/actor-sizes
This commit is contained in:
commit
8de9ae6020
165 changed files with 798 additions and 444 deletions
|
|
@ -179,6 +179,7 @@ export default function DHApplicationMixin(Base) {
|
|||
super._attachPartListeners(partId, htmlElement, options);
|
||||
this._dragDrop.forEach(d => d.bind(htmlElement));
|
||||
|
||||
// Handle delta inputs
|
||||
for (const deltaInput of htmlElement.querySelectorAll('input[data-allow-delta]')) {
|
||||
deltaInput.dataset.numValue = deltaInput.value;
|
||||
deltaInput.inputMode = 'numeric';
|
||||
|
|
@ -232,6 +233,25 @@ export default function DHApplicationMixin(Base) {
|
|||
handleUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
// Handle contenteditable
|
||||
for (const input of htmlElement.querySelectorAll('[contenteditable][data-property]')) {
|
||||
const property = input.dataset.property;
|
||||
input.addEventListener("blur", () => {
|
||||
const selection = document.getSelection();
|
||||
if (input.contains(selection.anchorNode)) {
|
||||
selection.empty();
|
||||
}
|
||||
this.document.update({ [property]: input.textContent });
|
||||
});
|
||||
|
||||
input.addEventListener("keydown", event => {
|
||||
if (event.key === "Enter") input.blur();
|
||||
});
|
||||
|
||||
// Chrome sometimes add <br>, which aren't a problem for the value but are for the placeholder
|
||||
input.addEventListener("input", () => input.querySelectorAll("br").forEach((i) => i.remove()));
|
||||
}
|
||||
}
|
||||
|
||||
/**@inheritdoc */
|
||||
|
|
|
|||
|
|
@ -31,4 +31,11 @@ export default class FeatureSheet extends DHBaseItemSheet {
|
|||
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
|
||||
}
|
||||
};
|
||||
//Might be wrong location but testing out if here is okay.
|
||||
/**@override */
|
||||
async _prepareContext(options) {
|
||||
const context = await super._prepareContext(options);
|
||||
context.featureFormChoices = CONFIG.DH.ITEM.featureForm;
|
||||
return context;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
|||
actions: {
|
||||
requestSpotlight: this.requestSpotlight,
|
||||
toggleSpotlight: this.toggleSpotlight,
|
||||
setActionTokens: this.setActionTokens,
|
||||
openCountdowns: this.openCountdowns
|
||||
setActionTokens: this.setActionTokens
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -57,7 +56,10 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
|||
|
||||
const adversaries = context.turns?.filter(x => x.isNPC) ?? [];
|
||||
const characters = context.turns?.filter(x => !x.isNPC) ?? [];
|
||||
const spotlightQueueEnabled = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.SpotlightRequestQueue);
|
||||
const spotlightQueueEnabled = game.settings.get(
|
||||
CONFIG.DH.id,
|
||||
CONFIG.DH.SETTINGS.gameSettings.SpotlightRequestQueue
|
||||
);
|
||||
|
||||
const spotlightRequests = characters
|
||||
?.filter(x => !x.isNPC && spotlightQueueEnabled)
|
||||
|
|
@ -71,7 +73,9 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
|||
Object.assign(context, {
|
||||
actionTokens: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.variantRules).actionTokens,
|
||||
adversaries,
|
||||
characters: characters?.filter(x => !x.isNPC).filter(x => !spotlightQueueEnabled || x.system.spotlight.requestOrderIndex == 0),
|
||||
characters: characters
|
||||
?.filter(x => !x.isNPC)
|
||||
.filter(x => !spotlightQueueEnabled || x.system.spotlight.requestOrderIndex == 0),
|
||||
spotlightRequests
|
||||
});
|
||||
}
|
||||
|
|
@ -162,8 +166,10 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
|||
if (this.viewed.turn !== toggleTurn) {
|
||||
const { updateCountdowns } = game.system.api.applications.ui.DhCountdowns;
|
||||
if (combatant.actor.type === 'character') {
|
||||
await updateCountdowns(CONFIG.DH.GENERAL.countdownProgressionTypes.spotlight.id,
|
||||
CONFIG.DH.GENERAL.countdownProgressionTypes.characterSpotlight.id);
|
||||
await updateCountdowns(
|
||||
CONFIG.DH.GENERAL.countdownProgressionTypes.spotlight.id,
|
||||
CONFIG.DH.GENERAL.countdownProgressionTypes.characterSpotlight.id
|
||||
);
|
||||
} else {
|
||||
await updateCountdowns(CONFIG.DH.GENERAL.countdownProgressionTypes.spotlight.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ export const BPModifiers = {
|
|||
increaseDamage: {
|
||||
sort: 2,
|
||||
description: 'DAGGERHEART.CONFIG.BPModifiers.increaseDamage.description',
|
||||
effectTargetTypes: ['adversary'],
|
||||
effects: [
|
||||
{
|
||||
name: 'DAGGERHEART.CONFIG.BPModifiers.increaseDamage.effect.name',
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ export const armorFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'damage',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.ArmorFeature.burning.actions.burn.name',
|
||||
description: 'DAGGERHEART.CONFIG.ArmorFeature.burning.actions.burn.description',
|
||||
|
|
@ -174,7 +173,6 @@ export const armorFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.ArmorFeature.hopeful.actions.hope.name',
|
||||
description: 'DAGGERHEART.CONFIG.ArmorFeature.hopeful.actions.hope.description',
|
||||
|
|
@ -188,7 +186,6 @@ export const armorFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.ArmorFeature.impenetrable.actions.impenetrable.name',
|
||||
description: 'DAGGERHEART.CONFIG.ArmorFeature.impenetrable.actions.impenetrable.description',
|
||||
|
|
@ -231,7 +228,6 @@ export const armorFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.ArmorFeature.painful.actions.pain.name',
|
||||
description: 'DAGGERHEART.CONFIG.ArmorFeature.painful.actions.pain.description',
|
||||
|
|
@ -269,7 +265,6 @@ export const armorFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.ArmorFeature.quiet.actions.quiet.name',
|
||||
description: 'DAGGERHEART.CONFIG.ArmorFeature.quiet.actions.quiet.description',
|
||||
|
|
@ -306,7 +301,6 @@ export const armorFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'attack',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.ArmorFeature.resilient.actions.resilient.name',
|
||||
description: 'DAGGERHEART.CONFIG.ArmorFeature.resilient.actions.resilient.description',
|
||||
|
|
@ -353,7 +347,6 @@ export const armorFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.ArmorFeature.shifting.actions.shift.name',
|
||||
description: 'DAGGERHEART.CONFIG.ArmorFeature.shifting.actions.shift.description',
|
||||
|
|
@ -373,7 +366,6 @@ export const armorFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'attack',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.ArmorFeature.timeslowing.actions.slowTime.name',
|
||||
description: 'DAGGERHEART.CONFIG.ArmorFeature.timeslowing.actions.slowTime.description',
|
||||
|
|
@ -401,7 +393,6 @@ export const armorFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.ArmorFeature.truthseeking.actions.truthseeking.name',
|
||||
description: 'DAGGERHEART.CONFIG.ArmorFeature.truthseeking.actions.truthseeking.description',
|
||||
|
|
@ -537,7 +528,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.bouncing.actions.bounce.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.bouncing.actions.bounce.description',
|
||||
|
|
@ -582,7 +572,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.brutal.actions.addDamage.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.brutal.actions.addDamage.description',
|
||||
|
|
@ -596,7 +585,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.burning.actions.burn.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.burning.actions.burn.description',
|
||||
|
|
@ -610,7 +598,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.charged.actions.markStress.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.charged.actions.markStress.description',
|
||||
|
|
@ -647,7 +634,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.concussive.actions.attack.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.concussive.actions.attack.description',
|
||||
|
|
@ -688,7 +674,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.deadly.actions.extraDamage.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.deadly.actions.extraDamage.description',
|
||||
|
|
@ -702,7 +687,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.deflecting.actions.deflect.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.deflecting.actions.deflect.description',
|
||||
|
|
@ -739,7 +723,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'damage',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.destructive.actions.attack.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.destructive.actions.attack.descriptive',
|
||||
|
|
@ -784,7 +767,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.devastating.actions.devastate.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.devastating.actions.devastate.description',
|
||||
|
|
@ -835,7 +817,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.doubledUp.actions.doubleUp.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.doubledUp.actions.doubleUp.description',
|
||||
|
|
@ -849,7 +830,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.dueling.actions.duel.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.dueling.actions.duel.description',
|
||||
|
|
@ -863,7 +843,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect', // Should prompt a dc 14 reaction save on adversaries
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.eruptive.actions.erupt.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.eruptive.actions.erupt.description',
|
||||
|
|
@ -877,7 +856,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.grappling.actions.grapple.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.grappling.actions.grapple.description',
|
||||
|
|
@ -897,7 +875,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.greedy.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.greedy.description',
|
||||
|
|
@ -929,7 +906,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'healing',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.healing.actions.heal.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.healing.actions.heal.description',
|
||||
|
|
@ -977,7 +953,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.hooked.actions.hook.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.hooked.actions.hook.description',
|
||||
|
|
@ -991,7 +966,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.hot.actions.hot.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.hot.actions.hot.description',
|
||||
|
|
@ -1005,7 +979,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.invigorating.actions.invigorate.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.invigorating.actions.invigorate.description',
|
||||
|
|
@ -1019,7 +992,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.lifestealing.actions.lifesteal.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.lifestealing.actions.lifesteal.description',
|
||||
|
|
@ -1033,7 +1005,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.lockedOn.actions.lockOn.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.lockedOn.actions.lockOn.description',
|
||||
|
|
@ -1047,7 +1018,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.long.actions.long.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.long.actions.long.description',
|
||||
|
|
@ -1061,7 +1031,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.lucky.actions.luck.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.lucky.actions.luck.description',
|
||||
|
|
@ -1099,7 +1068,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.painful.actions.pain.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.painful.actions.pain.description',
|
||||
|
|
@ -1145,7 +1113,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.parry.actions.parry.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.parry.actions.parry.description',
|
||||
|
|
@ -1159,7 +1126,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.persuasive.actions.persuade.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.persuasive.actions.persuade.description',
|
||||
|
|
@ -1196,7 +1162,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.pompous.actions.pompous.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.pompous.actions.pompous.description',
|
||||
|
|
@ -1240,7 +1205,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.quick.actions.quick.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.quick.actions.quick.description',
|
||||
|
|
@ -1278,7 +1242,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.reloading.actions.reload.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.reloading.actions.reload.description',
|
||||
|
|
@ -1292,7 +1255,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.retractable.actions.retract.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.retractable.actions.retract.description',
|
||||
|
|
@ -1306,7 +1268,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.returning.actions.return.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.returning.actions.return.description',
|
||||
|
|
@ -1320,7 +1281,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.scary.actions.scare.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.scary.actions.scare.description',
|
||||
|
|
@ -1376,7 +1336,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.sheltering.actions.shelter.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.sheltering.actions.shelter.description',
|
||||
|
|
@ -1390,7 +1349,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.startling.actions.startle.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.startling.actions.startle.description',
|
||||
|
|
@ -1410,7 +1368,6 @@ export const weaponFeatures = {
|
|||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.timebending.actions.bendTime.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.timebending.actions.bendTime.description',
|
||||
|
|
@ -1458,6 +1415,12 @@ export const orderedWeaponFeatures = () => {
|
|||
return Object.values(all).sort((a, b) => game.i18n.localize(a.label).localeCompare(game.i18n.localize(b.label)));
|
||||
};
|
||||
|
||||
export const featureForm = {
|
||||
passive: "DAGGERHEART.CONFIG.FeatureForm.passive",
|
||||
action: "DAGGERHEART.CONFIG.FeatureForm.action",
|
||||
reaction: "DAGGERHEART.CONFIG.FeatureForm.reaction"
|
||||
};
|
||||
|
||||
export const featureTypes = {
|
||||
ancestry: {
|
||||
id: 'ancestry',
|
||||
|
|
@ -1515,21 +1478,6 @@ export const featureSubTypes = {
|
|||
mastery: 'mastery'
|
||||
};
|
||||
|
||||
export const actionTypes = {
|
||||
passive: {
|
||||
id: 'passive',
|
||||
label: 'DAGGERHEART.CONFIG.ActionType.passive'
|
||||
},
|
||||
action: {
|
||||
id: 'action',
|
||||
label: 'DAGGERHEART.CONFIG.ActionType.action'
|
||||
},
|
||||
reaction: {
|
||||
id: 'reaction',
|
||||
label: 'DAGGERHEART.CONFIG.ActionType.reaction'
|
||||
}
|
||||
};
|
||||
|
||||
export const itemResourceTypes = {
|
||||
simple: {
|
||||
id: 'simple',
|
||||
|
|
|
|||
|
|
@ -193,8 +193,6 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
async use(event) {
|
||||
if (!this.actor) throw new Error("An Action can't be used outside of an Actor context.");
|
||||
|
||||
if (this.chatDisplay) await this.toChat();
|
||||
|
||||
let config = this.prepareConfig(event);
|
||||
if (!config) return;
|
||||
|
||||
|
|
@ -211,6 +209,8 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
|
||||
if (Hooks.call(`${CONFIG.DH.id}.postUseAction`, this, config) === false) return;
|
||||
|
||||
if (this.chatDisplay) await this.toChat();
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
|
@ -324,7 +324,6 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
_getTags() {
|
||||
const tags = [
|
||||
game.i18n.localize(`DAGGERHEART.ACTIONS.TYPES.${this.type}.name`),
|
||||
game.i18n.localize(`DAGGERHEART.CONFIG.ActionType.${this.actionType}`)
|
||||
];
|
||||
|
||||
return tags;
|
||||
|
|
|
|||
|
|
@ -141,6 +141,12 @@ export function ActionMixin(Base) {
|
|||
return this.documentName;
|
||||
}
|
||||
|
||||
//Getter for icons
|
||||
get typeIcon() {
|
||||
const config = CONFIG.DH.ACTIONS.actionTypes[this.type];
|
||||
return config?.icon || 'fa-question'; // Fallback icon just in case
|
||||
}
|
||||
|
||||
get relativeUUID() {
|
||||
return `.Item.${this.item.id}.Action.${this.id}`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,13 @@ export default class DHFeature extends BaseDataItem {
|
|||
initial: null
|
||||
}),
|
||||
multiclassOrigin: new fields.BooleanField({ initial: false }),
|
||||
identifier: new fields.StringField()
|
||||
identifier: new fields.StringField(),
|
||||
featureForm: new fields.StringField({
|
||||
required: true,
|
||||
initial: 'passive',
|
||||
choices: CONFIG.DH.ITEM.featureForm,
|
||||
label: 'DAGGERHEART.CONFIG.FeatureForm.label'
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -537,7 +537,7 @@ export default class DhpActor extends Actor {
|
|||
|
||||
/**@inheritdoc */
|
||||
getRollData() {
|
||||
const rollData = super.getRollData();
|
||||
const rollData = super.getRollData().clone();
|
||||
rollData.name = this.name;
|
||||
rollData.system = this.system.getRollData();
|
||||
rollData.prof = this.system.proficiency ?? 1;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ export default class DhpCombat extends Combat {
|
|||
...effect,
|
||||
name: game.i18n.localize(effect.name),
|
||||
description: game.i18n.localize(effect.description),
|
||||
effectTargetTypes: grouping.effectTargetTypes ?? [],
|
||||
flags: {
|
||||
[`${CONFIG.DH.id}.${CONFIG.DH.FLAGS.combatToggle}`]: {
|
||||
category: toggle.category,
|
||||
|
|
@ -45,11 +46,7 @@ export default class DhpCombat extends Combat {
|
|||
for (let actor of actors) {
|
||||
await actor.createEmbeddedDocuments(
|
||||
'ActiveEffect',
|
||||
effects.map(effect => ({
|
||||
...effect,
|
||||
name: game.i18n.localize(effect.name),
|
||||
description: game.i18n.localize(effect.description)
|
||||
}))
|
||||
effects.filter(x => x.effectTargetTypes.includes(actor.type))
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue