Mvoed config out form under application

This commit is contained in:
WBHarry 2025-07-04 20:50:40 +02:00
parent 82960ea4bd
commit 28a70e7288
39 changed files with 32 additions and 32 deletions

199
module/config/Action.mjs Normal file
View file

@ -0,0 +1,199 @@
import DaggerheartSheet from '../applications/sheets/daggerheart-sheet.mjs';
const { ApplicationV2 } = foundry.applications.api;
export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
constructor(action) {
super({});
this.action = action;
this.openSection = null;
}
static DEFAULT_OPTIONS = {
tag: 'form',
id: 'daggerheart-action',
classes: ['daggerheart', 'views', 'action'],
position: { width: 600, height: 'auto' },
actions: {
toggleSection: this.toggleSection,
addEffect: this.addEffect,
removeEffect: this.removeEffect,
addElement: this.addElement,
removeElement: this.removeElement,
editEffect: this.editEffect,
addDamage: this.addDamage,
removeDamage: this.removeDamage
},
form: {
handler: this.updateForm,
submitOnChange: true,
closeOnSubmit: false
}
};
static PARTS = {
form: {
id: 'action',
template: 'systems/daggerheart/templates/config/action.hbs'
}
};
static CLEAN_ARRAYS = ['damage.parts', 'cost', 'effects'];
_getTabs() {
const tabs = {
base: { active: true, cssClass: '', group: 'primary', id: 'base', icon: null, label: 'Base' },
config: { active: false, cssClass: '', group: 'primary', id: 'config', icon: null, label: 'Configuration' },
effect: { active: false, cssClass: '', group: 'primary', id: 'effect', icon: null, label: 'Effect' }
};
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] ? this.tabGroups[v.group] === v.id : v.active;
v.cssClass = v.active ? 'active' : '';
}
return tabs;
}
async _prepareContext(_options) {
const context = await super._prepareContext(_options, 'action');
context.source = this.action.toObject(false);
context.openSection = this.openSection;
context.tabs = this._getTabs();
context.config = CONFIG.DH;
if (!!this.action.effects) context.effects = this.action.effects.map(e => this.action.item.effects.get(e._id));
if (this.action.damage?.hasOwnProperty('includeBase') && this.action.type === 'attack')
context.hasBaseDamage = !!this.action.parent.damage;
context.getRealIndex = this.getRealIndex.bind(this);
context.getEffectDetails = this.getEffectDetails.bind(this);
context.disableOption = this.disableOption.bind(this);
context.isNPC = this.action.actor && this.action.actor.type !== 'character';
context.hasRoll = this.action.hasRoll;
const settingsTiers = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers;
context.tierOptions = [
{ key: 1, label: game.i18n.localize('DAGGERHEART.Tiers.tier1') },
...Object.values(settingsTiers).map(x => ({ key: x.tier, label: x.name }))
];
return context;
}
static toggleSection(_, button) {
this.openSection = button.dataset.section === this.openSection ? null : button.dataset.section;
this.render(true);
}
disableOption(index, options, choices) {
const filtered = foundry.utils.deepClone(options);
Object.keys(filtered).forEach(o => {
if (choices.find((c, idx) => c.type === o && index !== idx)) delete filtered[o];
});
return filtered;
}
getRealIndex(index) {
const data = this.action.toObject(false);
return data.damage.parts.find(d => d.base) ? index - 1 : index;
}
getEffectDetails(id) {
return this.action.item.effects.get(id);
}
_prepareSubmitData(event, formData) {
const submitData = foundry.utils.expandObject(formData.object);
for (const keyPath of this.constructor.CLEAN_ARRAYS) {
const data = foundry.utils.getProperty(submitData, keyPath);
if (data) foundry.utils.setProperty(submitData, keyPath, Object.values(data));
}
return submitData;
}
static async updateForm(event, _, formData) {
const submitData = this._prepareSubmitData(event, formData),
data = foundry.utils.mergeObject(this.action.toObject(), submitData),
container = foundry.utils.getProperty(this.action.parent, this.action.systemPath);
let newActions;
if (Array.isArray(container)) {
newActions = foundry.utils.getProperty(this.action.parent, this.action.systemPath).map(x => x.toObject()); // Find better way
if (!newActions.findSplice(x => x._id === data._id, data)) newActions.push(data);
} else newActions = data;
const updates = await this.action.parent.parent.update({ [`system.${this.action.systemPath}`]: newActions });
if (!updates) return;
this.action = Array.isArray(container)
? foundry.utils.getProperty(updates.system, this.action.systemPath)[this.action.index]
: foundry.utils.getProperty(updates.system, this.action.systemPath);
this.render();
}
static addElement(event) {
const data = this.action.toObject(),
key = event.target.closest('.action-category-data').dataset.key;
if (!this.action[key]) return;
data[key].push({});
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
}
static removeElement(event) {
event.stopPropagation();
const data = this.action.toObject(),
key = event.target.closest('.action-category-data').dataset.key,
index = event.target.dataset.index;
data[key].splice(index, 1);
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
}
static addDamage(event) {
if (!this.action.damage.parts) return;
const data = this.action.toObject();
data.damage.parts.push({});
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
}
static removeDamage(event) {
if (!this.action.damage.parts) return;
const data = this.action.toObject(),
index = event.target.dataset.index;
data.damage.parts.splice(index, 1);
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
}
static async addEffect(event) {
if (!this.action.effects) return;
const effectData = this._addEffectData.bind(this)(),
[created] = await this.action.item.createEmbeddedDocuments('ActiveEffect', [effectData], { render: false }),
data = this.action.toObject();
data.effects.push({ _id: created._id });
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
this.action.item.effects.get(created._id).sheet.render(true);
}
/**
* The data for a newly created applied effect.
* @returns {object}
* @protected
*/
_addEffectData() {
return {
name: this.action.item.name,
img: this.action.item.img,
origin: this.action.item.uuid,
transfer: false
};
}
static removeEffect(event) {
if (!this.action.effects) return;
const index = event.target.dataset.index,
effectId = this.action.effects[index]._id;
this.constructor.removeElement.bind(this)(event);
this.action.item.deleteEmbeddedDocuments('ActiveEffect', [effectId]);
}
static editEffect(event) {
const id = event.target.closest('[data-effect-id]')?.dataset?.effectId;
this.action.item.effects.get(id).sheet.render(true);
}
}

25
module/config/_module.mjs Normal file
View file

@ -0,0 +1,25 @@
import * as action from './Action.mjs';
import * as actionConfig from './actionConfig.mjs';
import * as actorConfig from './actorConfig.mjs';
import * as domainConfig from './domainConfig.mjs';
import * as effectConfig from './effectConfig.mjs';
import * as flagsConfig from './flagsConfig.mjs';
import * as generalConfig from './generalConfig.mjs';
import * as hooksConfig from './hooksConfig.mjs';
import * as itemConfig from './itemConfig.mjs';
import * as settingsConfig from './settingsConfig.mjs';
import * as systemConfig from './system.mjs';
export {
action,
actionConfig,
actorConfig,
domainConfig,
effectConfig,
flagsConfig,
generalConfig,
hooksConfig,
itemConfig,
settingsConfig,
systemConfig
};

View file

@ -0,0 +1,127 @@
export const actionTypes = {
attack: {
id: 'attack',
name: 'DAGGERHEART.Actions.Types.attack.name',
icon: 'fa-swords'
},
// spellcast: {
// id: 'spellcast',
// name: 'DAGGERHEART.Actions.Types.spellcast.name',
// icon: 'fa-book-sparkles'
// },
healing: {
id: 'healing',
name: 'DAGGERHEART.Actions.Types.healing.name',
icon: 'fa-kit-medical'
},
// resource: {
// id: 'resource',
// name: 'DAGGERHEART.Actions.Types.resource.name',
// icon: 'fa-honey-pot'
// },
damage: {
id: 'damage',
name: 'DAGGERHEART.Actions.Types.damage.name',
icon: 'fa-bone-break'
},
summon: {
id: 'summon',
name: 'DAGGERHEART.Actions.Types.summon.name',
icon: 'fa-ghost'
},
effect: {
id: 'effect',
name: 'DAGGERHEART.Actions.Types.effect.name',
icon: 'fa-person-rays'
},
macro: {
id: 'macro',
name: 'DAGGERHEART.Actions.Types.macro.name',
icon: 'fa-scroll'
},
beastform: {
id: 'beastform',
name: 'DAGGERHEART.Actions.Types.beastform.name',
icon: 'fa-paw'
}
};
export const targetTypes = {
self: {
id: 'self',
label: 'Self'
},
friendly: {
id: 'friendly',
label: 'Friendly'
},
hostile: {
id: 'hostile',
label: 'Hostile'
},
any: {
id: 'any',
label: 'Any'
}
};
export const damageOnSave = {
none: {
id: 'none',
label: 'None',
mod: 0
},
half: {
id: 'half',
label: 'Half Damage',
mod: 0.5
},
full: {
id: 'full',
label: 'Full damage',
mod: 1
}
};
export const diceCompare = {
below: {
id: 'below',
label: 'Below',
operator: '<'
},
belowEqual: {
id: 'belowEqual',
label: 'Below or Equal',
operator: '<='
},
equal: {
id: 'equal',
label: 'Equal',
operator: '='
},
aboveEqual: {
id: 'aboveEqual',
label: 'Above or Equal',
operator: '>='
},
above: {
id: 'above',
label: 'Above',
operator: '>'
}
};
export const advandtageState = {
disadvantage: {
label: 'DAGGERHEART.General.Disadvantage.Full',
value: -1
},
neutral: {
label: 'DAGGERHEART.General.Neutral.Full',
value: 0
},
advantage: {
label: 'DAGGERHEART.General.Advantage.Full',
value: 1
}
};

View file

@ -0,0 +1,417 @@
export const abilities = {
agility: {
label: 'DAGGERHEART.Abilities.agility.name',
verbs: [
'DAGGERHEART.Abilities.agility.verb.sprint',
'DAGGERHEART.Abilities.agility.verb.leap',
'DAGGERHEART.Abilities.agility.verb.maneuver'
]
},
strength: {
label: 'DAGGERHEART.Abilities.strength.name',
verbs: [
'DAGGERHEART.Abilities.strength.verb.lift',
'DAGGERHEART.Abilities.strength.verb.smash',
'DAGGERHEART.Abilities.strength.verb.grapple'
]
},
finesse: {
label: 'DAGGERHEART.Abilities.finesse.name',
verbs: [
'DAGGERHEART.Abilities.finesse.verb.control',
'DAGGERHEART.Abilities.finesse.verb.hide',
'DAGGERHEART.Abilities.finesse.verb.tinker'
]
},
instinct: {
label: 'DAGGERHEART.Abilities.instinct.name',
verbs: [
'DAGGERHEART.Abilities.instinct.verb.perceive',
'DAGGERHEART.Abilities.instinct.verb.sense',
'DAGGERHEART.Abilities.instinct.verb.navigate'
]
},
presence: {
label: 'DAGGERHEART.Abilities.presence.name',
verbs: [
'DAGGERHEART.Abilities.presence.verb.charm',
'DAGGERHEART.Abilities.presence.verb.perform',
'DAGGERHEART.Abilities.presence.verb.deceive'
]
},
knowledge: {
label: 'DAGGERHEART.Abilities.knowledge.name',
verbs: [
'DAGGERHEART.Abilities.knowledge.verb.recall',
'DAGGERHEART.Abilities.knowledge.verb.analyze',
'DAGGERHEART.Abilities.knowledge.verb.comprehend'
]
}
};
export const featureProperties = {
agility: {
name: 'DAGGERHEART.Abilities.agility.name',
path: actor => actor.system.traits.agility.data.value
},
strength: {
name: 'DAGGERHEART.Abilities.strength.name',
path: actor => actor.system.traits.strength.data.value
},
finesse: {
name: 'DAGGERHEART.Abilities.finesse.name',
path: actor => actor.system.traits.finesse.data.value
},
instinct: {
name: 'DAGGERHEART.Abilities.instinct.name',
path: actor => actor.system.traits.instinct.data.value
},
presence: {
name: 'DAGGERHEART.Abilities.presence.name',
path: actor => actor.system.traits.presence.data.value
},
knowledge: {
name: 'DAGGERHEART.Abilities.knowledge.name',
path: actor => actor.system.traits.knowledge.data.value
},
spellcastingTrait: {
name: 'DAGGERHEART.FeatureProperty.SpellcastingTrait',
path: actor => actor.system.traits[actor.system.class.subclass.system.spellcastingTrait].data.value
}
};
export const adversaryTypes = {
bruiser: {
id: 'bruiser',
label: 'DAGGERHEART.Adversary.Type.bruiser.label',
description: 'DAGGERHEART.Adversary.bruiser.description'
},
horde: {
id: 'horde',
label: 'DAGGERHEART.Adversary.Type.horde.label',
description: 'DAGGERHEART.Adversary.horde.description'
},
leader: {
id: 'leader',
label: 'DAGGERHEART.Adversary.Type.leader.label',
description: 'DAGGERHEART.Adversary.leader.description'
},
minion: {
id: 'minion',
label: 'DAGGERHEART.Adversary.Type.minion.label',
description: 'DAGGERHEART.Adversary.minion.description'
},
ranged: {
id: 'ranged',
label: 'DAGGERHEART.Adversary.Type.ranged.label',
description: 'DAGGERHEART.Adversary.ranged.description'
},
skulk: {
id: 'skulk',
label: 'DAGGERHEART.Adversary.Type.skulk.label',
description: 'DAGGERHEART.Adversary.skulk.description'
},
social: {
id: 'social',
label: 'DAGGERHEART.Adversary.Type.social.label',
description: 'DAGGERHEART.Adversary.social.description'
},
solo: {
id: 'solo',
label: 'DAGGERHEART.Adversary.Type.solo.label',
description: 'DAGGERHEART.Adversary.solo.description'
},
standard: {
id: 'standard',
label: 'DAGGERHEART.Adversary.Type.standard.label',
description: 'DAGGERHEART.Adversary.standard.description'
},
support: {
id: 'support',
label: 'DAGGERHEART.Adversary.Type.support.label',
description: 'DAGGERHEART.Adversary.support.description'
}
};
export const environmentTypes = {
exploration: {
label: 'DAGGERHEART.Environment.Type.exploration.label',
description: 'DAGGERHEART.Environment.Type.exploration.description'
},
social: {
label: 'DAGGERHEART.Environment.Type.social.label',
description: 'DAGGERHEART.Environment.Type.social.description'
},
traversal: {
label: 'DAGGERHEART.Environment.Type.traversal.label',
description: 'DAGGERHEART.Environment.Type.traversal.description'
},
event: {
label: 'DAGGERHEART.Environment.Type.event.label',
description: 'DAGGERHEART.Environment.Type.event.description'
}
};
export const adversaryTraits = {
relentless: {
name: 'DAGGERHEART.Adversary.Trait..Name',
description: 'DAGGERHEART.Adversary.Trait..Description',
tip: 'DAGGERHEART.Adversary.Trait..Tip'
},
slow: {
name: 'DAGGERHEART.Adversary.Trait..Name',
description: 'DAGGERHEART.Adversary.Trait..Description',
tip: 'DAGGERHEART.Adversary.Trait..Tip'
},
minion: {
name: 'DAGGERHEART.Adversary.Trait..Name',
description: 'DAGGERHEART.Adversary.Trait..Description',
tip: 'DAGGERHEART.Adversary.Trait..Tip'
}
};
export const levelChoices = {
attributes: {
name: 'attributes',
title: '',
choices: []
},
hitPointSlots: {
name: 'hitPointSlots',
title: '',
choices: []
},
stressSlots: {
name: 'stressSlots',
title: '',
choices: []
},
experiences: {
name: 'experiences',
title: '',
choices: 'system.experiences',
nrChoices: 2
},
proficiency: {
name: 'proficiency',
title: '',
choices: []
},
armorOrEvasionSlot: {
name: 'armorOrEvasionSlot',
title: 'Permanently add one Armor Slot or take +1 to your Evasion',
choices: [
{ name: 'Armor Marks +1', path: 'armor' },
{ name: 'Evasion +1', path: 'evasion' }
],
nrChoices: 1
},
majorDamageThreshold2: {
name: 'majorDamageThreshold2',
title: '',
choices: []
},
severeDamageThreshold2: {
name: 'severeDamageThreshold2',
title: '',
choices: []
},
// minorDamageThreshold2: {
// name: 'minorDamageThreshold2',
// title: '',
// choices: [],
// },
severeDamageThreshold3: {
name: 'severeDamageThreshold3',
title: '',
choices: []
},
// major2OrSevere4DamageThreshold: {
// name: 'major2OrSevere4DamageThreshold',
// title: 'Increase your Major Damage Threshold by +2 or Severe Damage Threshold by +4',
// choices: [{ name: 'Major Damage Threshold +2', path: 'major' }, { name: 'Severe Damage Threshold +4', path: 'severe' }],
// nrChoices: 1,
// },
// minor1OrMajor1DamageThreshold: {
// name: 'minor1OrMajor1DamageThreshold',
// title: 'Increase your Minor or Major Damage Threshold by +1',
// choices: [{ name: 'Minor Damage Threshold +1', path: 'minor' }, { name: 'Major Damage Threshold +1', path: 'major' }],
// nrChoices: 1,
// },
severeDamageThreshold4: {
name: 'severeDamageThreshold4',
title: '',
choices: []
},
// majorDamageThreshold1: {
// name: 'majorDamageThreshold2',
// title: '',
// choices: [],
// },
subclass: {
name: 'subclass',
title: 'Select subclass to upgrade',
choices: []
},
multiclass: {
name: 'multiclass',
title: '',
choices: [{}]
}
};
export const levelupData = {
tier1: {
id: '2_4',
tier: 1,
levels: [2, 3, 4],
label: 'DAGGERHEART.LevelUp.Tier1.Label',
info: 'DAGGERHEART.LevelUp.Tier1.InfoLabel',
pretext: 'DAGGERHEART.LevelUp.Tier1.Pretext',
posttext: 'DAGGERHEART.LevelUp.Tier1.Posttext',
choices: {
[levelChoices.attributes.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Attributes',
maxChoices: 3
},
[levelChoices.hitPointSlots.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.HitPointSlots',
maxChoices: 1
},
[levelChoices.stressSlots.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.StressSlots',
maxChoices: 1
},
[levelChoices.experiences.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Experiences',
maxChoices: 1
},
[levelChoices.proficiency.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Proficiency',
maxChoices: 1
},
[levelChoices.armorOrEvasionSlot.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.ArmorOrEvasionSlot',
maxChoices: 1
},
[levelChoices.majorDamageThreshold2.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.MajorDamageThreshold2',
maxChoices: 1
},
[levelChoices.severeDamageThreshold2.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.SevereDamageThreshold2',
maxChoices: 1
}
}
},
tier2: {
id: '5_7',
tier: 2,
levels: [5, 6, 7],
label: 'DAGGERHEART.LevelUp.Tier2.Label',
info: 'DAGGERHEART.LevelUp.Tier2.InfoLabel',
pretext: 'DAGGERHEART.LevelUp.Tier2.Pretext',
posttext: 'DAGGERHEART.LevelUp.Tier2.Posttext',
choices: {
[levelChoices.attributes.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Attributes',
maxChoices: 3
},
[levelChoices.hitPointSlots.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.HitPointSlots',
maxChoices: 2
},
[levelChoices.stressSlots.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.StressSlots',
maxChoices: 2
},
[levelChoices.experiences.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Experiences',
maxChoices: 1
},
[levelChoices.proficiency.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Proficiency',
maxChoices: 2
},
[levelChoices.armorOrEvasionSlot.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.ArmorOrEvasionSlot',
maxChoices: 2
},
[levelChoices.majorDamageThreshold2.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.MajorDamageThreshold2',
maxChoices: 1
},
[levelChoices.severeDamageThreshold3.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.SevereDamageThreshold3',
maxChoices: 1
},
[levelChoices.subclass.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Subclass',
maxChoices: 1
},
[levelChoices.multiclass.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Multiclass',
maxChoices: 1,
cost: 2
}
}
},
tier3: {
id: '8_10',
tier: 3,
levels: [8, 9, 10],
label: 'DAGGERHEART.LevelUp.Tier3.Label',
info: 'DAGGERHEART.LevelUp.Tier3.InfoLabel',
pretext: 'DAGGERHEART.LevelUp.Tier3.Pretext',
posttext: 'DAGGERHEART.LevelUp.Tier3.Posttext',
choices: {
[levelChoices.attributes.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Attributes',
maxChoices: 3
},
[levelChoices.hitPointSlots.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.HitPointSlots',
maxChoices: 2
},
[levelChoices.stressSlots.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.StressSlots',
maxChoices: 2
},
[levelChoices.experiences.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Experiences',
maxChoices: 1
},
[levelChoices.proficiency.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Proficiency',
maxChoices: 2
},
[levelChoices.armorOrEvasionSlot.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.ArmorOrEvasionSlot',
maxChoices: 2
},
[levelChoices.majorDamageThreshold2.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.MajorDamageThreshold2',
maxChoices: 1
},
[levelChoices.severeDamageThreshold4.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.SevereDamageThreshold4',
maxChoices: 1
},
[levelChoices.subclass.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Subclass',
maxChoices: 1
},
[levelChoices.multiclass.name]: {
description: 'DAGGERHEART.LevelUp.ChoiceDescriptions.Multiclass',
maxChoices: 1,
cost: 2
}
}
}
};
export const subclassFeatureLabels = {
1: 'DAGGERHEART.Sheets.PC.DomainCard.FoundationTitle',
2: 'DAGGERHEART.Sheets.PC.DomainCard.SpecializationTitle',
3: 'DAGGERHEART.Sheets.PC.DomainCard.MasteryTitle'
};

View file

@ -0,0 +1,100 @@
export const domains = {
arcana: {
id: 'arcana',
label: 'DAGGERHEART.Domains.arcana.label',
src: 'systems/daggerheart/assets/icons/domains/arcana.svg',
description: 'DAGGERHEART.Domains.Arcana'
},
blade: {
id: 'blade',
label: 'DAGGERHEART.Domains.blade.label',
src: 'systems/daggerheart/assets/icons/domains/blade.svg',
description: 'DAGGERHEART.Domains.Blade'
},
bone: {
id: 'bone',
label: 'DAGGERHEART.Domains.bone.label',
src: 'systems/daggerheart/assets/icons/domains/bone.svg',
description: 'DAGGERHEART.Domains.Bone'
},
codex: {
id: 'codex',
label: 'DAGGERHEART.Domains.codex.label',
src: 'systems/daggerheart/assets/icons/domains/codex.svg',
description: 'DAGGERHEART.Domains.Codex'
},
grace: {
id: 'grace',
label: 'DAGGERHEART.Domains.grace.label',
src: 'systems/daggerheart/assets/icons/domains/grace.svg',
description: 'DAGGERHEART.Domains.Grace'
},
midnight: {
id: 'midnight',
label: 'DAGGERHEART.Domains.midnight.label',
src: 'systems/daggerheart/assets/icons/domains/midnight.svg',
description: 'DAGGERHEART.Domains.Midnight'
},
sage: {
id: 'sage',
label: 'DAGGERHEART.Domains.sage.label',
src: 'systems/daggerheart/assets/icons/domains/sage.svg',
description: 'DAGGERHEART.Domains.Sage'
},
splendor: {
id: 'splendor',
label: 'DAGGERHEART.Domains.splendor.label',
src: 'systems/daggerheart/assets/icons/domains/splendor.svg',
description: 'DAGGERHEART.Domains.Splendor'
},
valor: {
id: 'valor',
label: 'DAGGERHEART.Domains.valor.label',
src: 'systems/daggerheart/assets/icons/domains/valor.svg',
description: 'DAGGERHEART.Domains.Valor'
}
};
export const classDomainMap = {
rogue: [domains.midnight, domains.grace]
};
export const subclassMap = {
syndicate: {
id: 'syndicate',
label: 'Syndicate'
},
nightwalker: {
id: 'nightwalker',
label: 'Nightwalker'
}
};
export const classMap = {
rogue: {
label: 'Rogue',
subclasses: [subclassMap.syndicate.id, subclassMap.nightwalker.id]
},
seraph: {
label: 'Seraph',
subclasses: []
}
};
export const cardTypes = {
ability: {
id: 'ability',
label: 'DAGGERHEART.Domain.CardTypes.ability',
img: ''
},
spell: {
id: 'spell',
label: 'DAGGERHEART.Domain.CardTypes.spell',
img: ''
},
grimoire: {
id: 'grimoire',
label: 'DAGGERHEART.Domain.CardTypes.grimoire',
img: ''
}
};

View file

@ -0,0 +1,64 @@
import { range } from '../config/generalConfig.mjs';
export const valueTypes = {
numberString: {
id: 'numberString'
},
select: {
id: 'select'
}
};
export const parseTypes = {
string: {
id: 'string'
},
number: {
id: 'number'
}
};
export const applyLocations = {
attackRoll: {
id: 'attackRoll',
name: 'DAGGERHEART.Effects.ApplyLocations.AttackRoll.Name'
},
damageRoll: {
id: 'damageRoll',
name: 'DAGGERHEART.Effects.ApplyLocations.DamageRoll.Name'
}
};
export const effectTypes = {
health: {
id: 'health',
name: 'DAGGERHEART.Effects.Types.Health.Name',
values: [],
valueType: valueTypes.numberString.id,
parseType: parseTypes.number.id
},
stress: {
id: 'stress',
name: 'DAGGERHEART.Effects.Types.Stress.Name',
valueType: valueTypes.numberString.id,
parseType: parseTypes.number.id
},
reach: {
id: 'reach',
name: 'DAGGERHEART.Effects.Types.Reach.Name',
valueType: valueTypes.select.id,
parseType: parseTypes.string.id,
options: Object.keys(range).map(x => ({ name: range[x].name, value: x }))
},
damage: {
id: 'damage',
name: 'DAGGERHEART.Effects.Types.Damage.Name',
valueType: valueTypes.numberString.id,
parseType: parseTypes.string.id,
appliesOn: applyLocations.damageRoll.id,
applyLocationChoices: {
[applyLocations.damageRoll.id]: applyLocations.damageRoll.name,
[applyLocations.attackRoll.id]: applyLocations.attackRoll.name
}
}
};

View file

@ -0,0 +1,9 @@
export const displayDomainCardsAsList = 'displayDomainCardsAsList';
export const narrativeCountdown = {
simple: 'countdown-narrative-simple',
position: 'countdown-narrative-position'
};
export const encounterCountdown = {
simple: 'countdown-encounter-simple',
position: 'countdown-encounter-position'
};

View file

@ -0,0 +1,436 @@
export const range = {
self: {
id: 'self',
short: 's',
label: 'DAGGERHEART.Range.self.name',
description: 'DAGGERHEART.Range.self.description',
distance: 0
},
melee: {
id: 'melee',
short: 'm',
label: 'DAGGERHEART.Range.melee.name',
description: 'DAGGERHEART.Range.melee.description',
distance: 1
},
veryClose: {
id: 'veryClose',
short: 'vc',
label: 'DAGGERHEART.Range.veryClose.name',
description: 'DAGGERHEART.Range.veryClose.description',
distance: 3
},
close: {
id: 'close',
short: 'c',
label: 'DAGGERHEART.Range.close.name',
description: 'DAGGERHEART.Range.close.description',
distance: 10
},
far: {
id: 'far',
short: 'f',
label: 'DAGGERHEART.Range.far.name',
description: 'DAGGERHEART.Range.far.description',
distance: 20
},
veryFar: {
id: 'veryFar',
short: 'vf',
label: 'DAGGERHEART.Range.veryFar.name',
description: 'DAGGERHEART.Range.veryFar.description',
distance: 30
}
};
export const burden = {
oneHanded: {
value: 'oneHanded',
label: 'DAGGERHEART.Burden.oneHanded'
},
twoHanded: {
value: 'twoHanded',
label: 'DAGGERHEART.Burden.twoHanded'
}
};
export const damageTypes = {
physical: {
id: 'physical',
label: 'DAGGERHEART.DamageType.physical.name',
abbreviation: 'DAGGERHEART.DamageType.physical.abbreviation'
},
magical: {
id: 'magical',
label: 'DAGGERHEART.DamageType.magical.name',
abbreviation: 'DAGGERHEART.DamageType.magical.abbreviation'
}
};
export const healingTypes = {
hitPoints: {
id: 'hitPoints',
label: 'DAGGERHEART.HealingType.HitPoints.Name',
abbreviation: 'DAGGERHEART.HealingType.HitPoints.Abbreviation'
},
stress: {
id: 'stress',
label: 'DAGGERHEART.HealingType.Stress.Name',
abbreviation: 'DAGGERHEART.HealingType.Stress.Abbreviation'
},
hope: {
id: 'hope',
label: 'DAGGERHEART.HealingType.Hope.Name',
abbreviation: 'DAGGERHEART.HealingType.Hope.Abbreviation'
},
armorStack: {
id: 'armorStack',
label: 'DAGGERHEART.HealingType.ArmorStack.Name',
abbreviation: 'DAGGERHEART.HealingType.ArmorStack.Abbreviation'
}
};
export const conditions = {
vulnerable: {
id: 'vulnerable',
name: 'DAGGERHEART.Condition.vulnerable.name',
icon: 'icons/magic/control/silhouette-fall-slip-prone.webp',
description: 'DAGGERHEART.Condition.vulnerable.description'
},
hidden: {
id: 'hidden',
name: 'DAGGERHEART.Condition.hidden.name',
icon: 'icons/magic/perception/silhouette-stealth-shadow.webp',
description: 'DAGGERHEART.Condition.hidden.description'
},
restrained: {
id: 'restrained',
name: 'DAGGERHEART.Condition.restrained.name',
icon: 'icons/magic/control/debuff-chains-shackle-movement-red.webp',
description: 'DAGGERHEART.Condition.restrained.description'
}
};
export const defaultRestOptions = {
shortRest: () => ({
tendToWounds: {
id: 'tendToWounds',
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.TendToWounds.Name'),
img: 'icons/magic/life/cross-worn-green.webp',
description: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.TendToWounds.Description'),
actions: [
{
type: 'healing',
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.TendToWounds.Name'),
img: 'icons/magic/life/cross-worn-green.webp',
actionType: 'action',
healing: {
type: 'health',
value: {
custom: {
enabled: true,
formula: '1d4 + 1' // should be 1d4 + {tier}. How to use the roll param?
}
}
}
}
]
},
clearStress: {
id: 'clearStress',
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.ClearStress.Name'),
img: 'icons/magic/perception/eye-ringed-green.webp',
description: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.ClearStress.Description'),
actions: [
{
type: 'healing',
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.ClearStress.Name'),
img: 'icons/magic/perception/eye-ringed-green.webp',
actionType: 'action',
healing: {
type: 'stress',
value: {
custom: {
enabled: true,
formula: '1d4 + 1' // should be 1d4 + {tier}. How to use the roll param?
}
}
}
}
]
},
repairArmor: {
id: 'repairArmor',
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.RepairArmor.Name'),
img: 'icons/skills/trades/smithing-anvil-silver-red.webp',
description: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.RepairArmor.Description'),
actions: []
},
prepare: {
id: 'prepare',
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.Prepare.Name'),
img: 'icons/skills/trades/academics-merchant-scribe.webp',
description: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.Prepare.Description'),
actions: []
}
}),
longRest: () => ({
tendToWounds: {
id: 'tendToWounds',
name: game.i18n.localize('DAGGERHEART.Downtime.LongRest.TendToWounds.Name'),
img: 'icons/magic/life/cross-worn-green.webp',
description: game.i18n.localize('DAGGERHEART.Downtime.LongRest.TendToWounds.Description'),
actions: []
},
clearStress: {
id: 'clearStress',
name: game.i18n.localize('DAGGERHEART.Downtime.LongRest.ClearStress.Name'),
img: 'icons/magic/perception/eye-ringed-green.webp',
description: game.i18n.localize('DAGGERHEART.Downtime.LongRest.ClearStress.Description'),
actions: []
},
repairArmor: {
id: 'repairArmor',
name: game.i18n.localize('DAGGERHEART.Downtime.LongRest.RepairArmor.Name'),
img: 'icons/skills/trades/smithing-anvil-silver-red.webp',
description: game.i18n.localize('DAGGERHEART.Downtime.LongRest.RepairArmor.Description'),
actions: []
},
prepare: {
id: 'prepare',
name: game.i18n.localize('DAGGERHEART.Downtime.LongRest.Prepare.Name'),
img: 'icons/skills/trades/academics-merchant-scribe.webp',
description: game.i18n.localize('DAGGERHEART.Downtime.LongRest.Prepare.Description'),
actions: []
},
workOnAProject: {
id: 'workOnAProject',
name: game.i18n.localize('DAGGERHEART.Downtime.LongRest.WorkOnAProject.Name'),
img: 'icons/skills/social/thumbsup-approval-like.webp',
description: game.i18n.localize('DAGGERHEART.Downtime.LongRest.WorkOnAProject.Description'),
actions: []
}
}),
custom: {
id: 'customActivity',
name: '',
img: 'icons/skills/trades/academics-investigation-puzzles.webp',
description: '',
namePlaceholder: 'DAGGERHEART.Downtime.Custom.NamePlaceholder',
placeholder: 'DAGGERHEART.Downtime.Custom.Placeholder'
}
};
export const deathMoves = {
avoidDeath: {
id: 'avoidDeath',
name: 'DAGGERHEART.DeathMoves.AvoidDeath.Name',
img: 'icons/magic/time/hourglass-yellow-green.webp',
description: 'DAGGERHEART.DeathMoves.AvoidDeath.Description'
},
riskItAll: {
id: 'riskItAll',
name: 'DAGGERHEART.DeathMoves.RiskItAll.Name',
img: 'icons/sundries/gaming/dice-pair-white-green.webp',
description: 'DAGGERHEART.DeathMoves.RiskItAll.Description'
},
blazeOfGlory: {
id: 'blazeOfGlory',
name: 'DAGGERHEART.DeathMoves.BlazeOfGlory.Name',
img: 'icons/magic/life/heart-cross-strong-flame-purple-orange.webp',
description: 'DAGGERHEART.DeathMoves.BlazeOfGlory.Description'
}
};
export const tiers = {
tier1: {
id: 'tier1',
label: 'DAGGERHEART.Tiers.tier1',
value: 1
},
tier2: {
id: 'tier2',
label: 'DAGGERHEART.Tiers.tier2',
value: 2
},
tier3: {
id: 'tier3',
label: 'DAGGERHEART.Tiers.tier3',
value: 3
},
tier4: {
id: 'tier4',
label: 'DAGGERHEART.Tiers.tier4',
value: 4
}
};
export const diceTypes = {
d4: 'd4',
d6: 'd6',
d8: 'd8',
d10: 'd10',
d12: 'd12',
d20: 'd20'
};
export const multiplierTypes = {
prof: 'Proficiency',
cast: 'Spellcast',
scale: 'Cost Scaling',
result: 'Roll Result',
flat: 'Flat'
};
export const diceSetNumbers = {
prof: 'Proficiency',
cast: 'Spellcast',
scale: 'Cost Scaling',
flat: 'Flat'
};
export const getDiceSoNicePresets = () => {
const { diceSoNice } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance);
return {
hope: {
...diceSoNice.hope,
colorset: 'inspired',
texture: 'bloodmoon',
material: 'metal',
font: 'Arial Black',
system: 'standard'
},
fear: {
...diceSoNice.fear,
colorset: 'bloodmoon',
texture: 'bloodmoon',
material: 'metal',
font: 'Arial Black',
system: 'standard'
},
advantage: {
...diceSoNice.advantage,
colorset: 'bloodmoon',
texture: 'bloodmoon',
material: 'metal',
font: 'Arial Black',
system: 'standard'
},
disadvantage: {
...diceSoNice.disadvantage,
colorset: 'bloodmoon',
texture: 'bloodmoon',
material: 'metal',
font: 'Arial Black',
system: 'standard'
}
};
};
export const refreshTypes = {
session: {
id: 'session',
label: 'DAGGERHEART.General.RefreshType.Session'
},
shortRest: {
id: 'shortRest',
label: 'DAGGERHEART.General.RefreshType.Shortrest'
},
longRest: {
id: 'longRest',
label: 'DAGGERHEART.General.RefreshType.Longrest'
}
};
export const abilityCosts = {
hope: {
id: 'hope',
label: 'Hope',
group: 'TYPES.Actor.character'
},
stress: {
id: 'stress',
label: 'DAGGERHEART.HealingType.Stress.Name',
group: 'TYPES.Actor.character'
},
armor: {
id: 'armor',
label: 'Armor Stack',
group: 'TYPES.Actor.character'
},
hp: {
id: 'hp',
label: 'DAGGERHEART.HealingType.HitPoints.Name',
group: 'TYPES.Actor.character'
},
prayer: {
id: 'prayer',
label: 'Prayer Dice',
group: 'TYPES.Actor.character'
},
favor: {
id: 'favor',
label: 'Favor Points',
group: 'TYPES.Actor.character'
},
slayer: {
id: 'slayer',
label: 'Slayer Dice',
group: 'TYPES.Actor.character'
},
tide: {
id: 'tide',
label: 'Tide',
group: 'TYPES.Actor.character'
},
chaos: {
id: 'chaos',
label: 'Chaos',
group: 'TYPES.Actor.character'
},
fear: {
id: 'fear',
label: 'Fear',
group: 'TYPES.Actor.adversary'
}
};
export const countdownTypes = {
spotlight: {
id: 'spotlight',
label: 'DAGGERHEART.Countdown.Type.Spotlight'
},
characterAttack: {
id: 'characterAttack',
label: 'DAGGERHEART.Countdown.Type.CharacterAttack'
},
custom: {
id: 'custom',
label: 'DAGGERHEART.Countdown.Type.Custom'
}
};
export const rollTypes = {
weapon: {
id: 'weapon',
label: 'DAGGERHEART.RollTypes.weapon.name'
},
spellcast: {
id: 'spellcast',
label: 'DAGGERHEART.RollTypes.spellcast.name'
},
ability: {
id: 'ability',
label: 'DAGGERHEART.RollTypes.ability.name'
},
diceSet: {
id: 'diceSet',
label: 'DAGGERHEART.RollTypes.diceSet.name'
}
};
export const fearDisplay = {
token: { value: 'token', label: 'DAGGERHEART.Settings.Appearance.FearDisplay.Token' },
bar: { value: 'bar', label: 'DAGGERHEART.Settings.Appearance.FearDisplay.Bar' },
hide: { value: 'hide', label: 'DAGGERHEART.Settings.Appearance.FearDisplay.Hide' }
};

View file

@ -0,0 +1,4 @@
export const hooks = {
characterAttack: 'characterAttackHook',
spotlight: 'spotlightHook'
};

View file

@ -0,0 +1,725 @@
export const armorFeatures = {
burning: {
label: 'DAGGERHEART.ArmorFeature.Burning.Name',
description: 'DAGGERHEART.ArmorFeature.Burning.Description'
},
channeling: {
label: 'DAGGERHEART.ArmorFeature.Channeling.Name',
description: 'DAGGERHEART.ArmorFeature.Channeling.Description',
effects: [
{
changes: [
{
key: 'system.bonuses.spellcast',
mode: 2,
value: '1'
}
]
}
]
},
difficult: {
label: 'DAGGERHEART.ArmorFeature.Difficult.Name',
description: 'DAGGERHEART.ArmorFeature.Difficult.Description',
effects: [
{
changes: [
{
key: 'system.traits.agility.bonus',
mode: 2,
value: '-1'
},
{
key: 'system.traits.strength.bonus',
mode: 2,
value: '-1'
},
{
key: 'system.traits.finesse.bonus',
mode: 2,
value: '-1'
},
{
key: 'system.traits.instinct.bonus',
mode: 2,
value: '-1'
},
{
key: 'system.traits.presence.bonus',
mode: 2,
value: '-1'
},
{
key: 'system.traits.knowledge.bonus',
mode: 2,
value: '-1'
},
{
key: 'system.evasion.bonus',
mode: 2,
value: '-1'
}
]
}
]
},
flexible: {
label: 'DAGGERHEART.ArmorFeature.Flexible.Name',
description: 'DAGGERHEART.ArmorFeature.Flexible.Description',
effects: [
{
changes: [
{
key: 'system.evasion.bonus',
mode: 2,
value: '1'
}
]
}
]
},
fortified: {
label: 'DAGGERHEART.ArmorFeature.Fortified.Name',
description: 'DAGGERHEART.ArmorFeature.Fortified.Description'
},
gilded: {
label: 'DAGGERHEART.ArmorFeature.Gilded.Name',
description: 'DAGGERHEART.ArmorFeature.Gilded.Description',
effects: [
{
changes: [
{
key: 'system.traits.presence.bonus',
mode: 2,
value: '1'
}
]
}
]
},
heavy: {
label: 'DAGGERHEART.ArmorFeature.Heavy.Name',
description: 'DAGGERHEART.ArmorFeature.Heavy.Description',
effects: [
{
changes: [
{
key: 'system.evasion.bonus',
mode: 2,
value: '-1'
}
]
}
]
},
hopeful: {
label: 'DAGGERHEART.ArmorFeature.Hopeful.Name',
description: 'DAGGERHEART.ArmorFeature.Hopeful.Description'
},
impenetrable: {
label: 'DAGGERHEART.ArmorFeature.Impenetrable.Name',
description: 'DAGGERHEART.ArmorFeature.Impenetrable.Description'
},
magic: {
label: 'DAGGERHEART.ArmorFeature.Magic.Name',
description: 'DAGGERHEART.ArmorFeature.Magic.Description'
},
painful: {
label: 'DAGGERHEART.ArmorFeature.Painful.Name',
description: 'DAGGERHEART.ArmorFeature.Painful.Description'
},
physical: {
label: 'DAGGERHEART.ArmorFeature.Physical.Name',
description: 'DAGGERHEART.ArmorFeature.Physical.Description'
},
quiet: {
label: 'DAGGERHEART.ArmorFeature.Quiet.Name',
description: 'DAGGERHEART.ArmorFeature.Quiet.Description'
},
reinforced: {
label: 'DAGGERHEART.ArmorFeature.Reinforced.Name',
description: 'DAGGERHEART.ArmorFeature.Reinforced.Description'
},
resilient: {
label: 'DAGGERHEART.ArmorFeature.Resilient.Name',
description: 'DAGGERHEART.ArmorFeature.Resilient.Description'
},
sharp: {
label: 'DAGGERHEART.ArmorFeature.Sharp.Name',
description: 'DAGGERHEART.ArmorFeature.Sharp.Description'
},
shifting: {
label: 'DAGGERHEART.ArmorFeature.Shifting.Name',
description: 'DAGGERHEART.ArmorFeature.Shifting.Description'
},
timeslowing: {
label: 'DAGGERHEART.ArmorFeature.Timeslowing.Name',
description: 'DAGGERHEART.ArmorFeature.Timeslowing.Description'
},
truthseeking: {
label: 'DAGGERHEART.ArmorFeature.Truthseeking.Name',
description: 'DAGGERHEART.ArmorFeature.Truthseeking.Description'
},
veryheavy: {
label: 'DAGGERHEART.ArmorFeature.VeryHeavy.Name',
description: 'DAGGERHEART.ArmorFeature.VeryHeavy.Description',
effects: [
{
changes: [
{
key: 'system.evasion.bonus',
mode: 2,
value: '-2'
},
{
key: 'system.traits.agility.bonus',
mode: 2,
value: '-1'
}
]
}
]
},
warded: {
label: 'DAGGERHEART.ArmorFeature.Warded.Name',
description: 'DAGGERHEART.ArmorFeature.Warded.Description'
}
};
export const weaponFeatures = {
barrier: {
label: 'DAGGERHEART.WeaponFeature.Barrier.Name',
description: 'DAGGERHEART.WeaponFeature.Barrier.Description',
effects: [
{
changes: [
{
key: 'system.bonuses.armorScore',
mode: 2,
value: '@system.tier + 1'
}
]
},
{
changes: [
{
key: 'system.evasion.bonus',
mode: 2,
value: '-1'
}
]
}
]
},
bonded: {
label: 'DAGGERHEART.WeaponFeature.Bonded.Name',
description: 'DAGGERHEART.WeaponFeature.Bonded.Description',
effects: [
{
changes: [
{
key: 'system.bonuses.damage',
mode: 2,
value: 'system.levelData.levels.current'
}
]
}
]
},
bouncing: {
label: 'DAGGERHEART.WeaponFeature.Bouncing.Name',
description: 'DAGGERHEART.WeaponFeature.Bouncing.Description'
},
brave: {
label: 'DAGGERHEART.WeaponFeature.Brave.Name',
description: 'DAGGERHEART.WeaponFeature.Brave.Description',
effects: [
{
changes: [
{
key: 'system.evasion.bonus',
mode: 2,
value: '-1'
}
]
},
{
changes: [
{
key: 'system.damageThresholds.severe',
mode: 2,
value: '3'
}
]
}
]
},
brutal: {
label: 'DAGGERHEART.WeaponFeature.Brutal.Name',
description: 'DAGGERHEART.WeaponFeature.Brutal.Description'
},
charged: {
label: 'DAGGERHEART.WeaponFeature.Charged.Name',
description: 'DAGGERHEART.WeaponFeature.Charged.Description',
actions: [
{
type: 'effect',
name: 'DAGGERHEART.WeaponFeature.Concussive.Name',
img: 'icons/skills/melee/shield-damaged-broken-brown.webp',
actionType: 'action',
cost: [
{
type: 'stress',
value: 1
}
]
// Should add an effect with path system.proficiency.bonus +1
}
]
},
concussive: {
label: 'DAGGERHEART.WeaponFeature.Concussive.Name',
description: 'DAGGERHEART.WeaponFeature.Concussive.Description',
actions: [
{
type: 'resource',
name: 'DAGGERHEART.WeaponFeature.Concussive.Name',
img: 'icons/skills/melee/shield-damaged-broken-brown.webp',
actionType: 'action',
cost: [
{
type: 'hope',
value: 1
}
]
}
]
},
cumbersome: {
label: 'DAGGERHEART.WeaponFeature.Cumbersome.Name',
description: 'DAGGERHEART.WeaponFeature.Cumbersome.Description',
effects: [
{
changes: [
{
key: 'system.traits.finesse.bonus',
mode: 2,
value: '-1'
}
]
}
]
},
deadly: {
label: 'DAGGERHEART.WeaponFeature.Deadly.Name',
description: 'DAGGERHEART.WeaponFeature.Deadly.Description'
},
deflecting: {
label: 'DAGGERHEART.WeaponFeature.Deflecting.Name',
description: 'DAGGERHEART.WeaponFeature.Deflecting.Description'
// actions: [{
// type: 'effect',
// name: 'DAGGERHEART.WeaponFeature.Deflecting.Name',
// img: 'icons/skills/melee/strike-flail-destructive-yellow.webp',
// actionType: 'reaction',
// cost: [{
// type: 'armorSlot', // Needs armorSlot as type
// value: 1
// }],
// }],
},
destructive: {
label: 'DAGGERHEART.WeaponFeature.Destructive.Name',
description: 'DAGGERHEART.WeaponFeature.Destructive.Description',
effects: [
{
changes: [
{
key: 'system.traits.agility.bonus',
mode: 2,
value: '-1'
}
]
}
]
},
devastating: {
label: 'DAGGERHEART.WeaponFeature.Devastating.Name',
description: 'DAGGERHEART.WeaponFeature.Devastating.Description',
actions: [
{
type: 'resource',
name: 'DAGGERHEART.WeaponFeature.Devastating.Name',
img: 'icons/skills/melee/strike-flail-destructive-yellow.webp',
actionType: 'action',
cost: [
{
type: 'stress',
value: 1
}
]
}
]
},
doubleduty: {
label: 'DAGGERHEART.WeaponFeature.DoubleDuty.Name',
description: 'DAGGERHEART.WeaponFeature.DoubleDuty.Description',
effects: [
{
changes: [
{
key: 'system.bonuses.armorScore',
mode: 2,
value: '1'
}
]
}
]
},
doubledup: {
label: 'DAGGERHEART.WeaponFeature.DoubledUp.Name',
description: 'DAGGERHEART.WeaponFeature.DoubledUp.Description'
},
dueling: {
label: 'DAGGERHEART.WeaponFeature.Dueling.Name',
description: 'DAGGERHEART.WeaponFeature.Dueling.Description'
},
eruptive: {
label: 'DAGGERHEART.WeaponFeature.Eruptive.Name',
description: 'DAGGERHEART.WeaponFeature.Eruptive.Description'
},
grappling: {
label: 'DAGGERHEART.WeaponFeature.Grappling.Name',
description: 'DAGGERHEART.WeaponFeature.Grappling.Description',
actions: [
{
type: 'resource',
name: 'DAGGERHEART.WeaponFeature.Grappling.Name',
img: 'icons/magic/control/debuff-chains-ropes-net-white.webp',
actionType: 'action',
cost: [
{
type: 'stress',
value: 1
}
]
}
]
},
greedy: {
label: 'DAGGERHEART.WeaponFeature.Greedy.Name',
description: 'DAGGERHEART.WeaponFeature.Greedy.Description'
},
healing: {
label: 'DAGGERHEART.WeaponFeature.Healing.Name',
description: 'DAGGERHEART.WeaponFeature.Healing.Description',
actions: [
{
type: 'healing',
name: 'DAGGERHEART.WeaponFeature.Healing.Name',
img: 'icons/magic/life/cross-beam-green.webp',
actionType: 'action',
healing: {
type: 'health',
value: {
custom: {
enabled: true,
formula: '1'
}
}
}
}
]
},
heavy: {
label: 'DAGGERHEART.WeaponFeature.Heavy.Name',
description: 'DAGGERHEART.WeaponFeature.Heavy.Description',
effects: [
{
changes: [
{
key: 'system.evasion.bonus',
mode: 2,
value: '-1'
}
]
}
]
},
hooked: {
label: 'DAGGERHEART.WeaponFeature.Hooked.Name',
description: 'DAGGERHEART.WeaponFeature.Hooked.Description'
},
hot: {
label: 'DAGGERHEART.WeaponFeature.Hot.Name',
description: 'DAGGERHEART.WeaponFeature.Hot.Description'
},
invigorating: {
label: 'DAGGERHEART.WeaponFeature.Invigorating.Name',
description: 'DAGGERHEART.WeaponFeature.Invigorating.Description'
},
lifestealing: {
label: 'DAGGERHEART.WeaponFeature.Lifestealing.Name',
description: 'DAGGERHEART.WeaponFeature.Lifestealing.Description'
},
lockedon: {
label: 'DAGGERHEART.WeaponFeature.LockedOn.Name',
description: 'DAGGERHEART.WeaponFeature.LockedOn.Description'
},
long: {
label: 'DAGGERHEART.WeaponFeature.Long.Name',
description: 'DAGGERHEART.WeaponFeature.Long.Description'
},
lucky: {
label: 'DAGGERHEART.WeaponFeature.Lucky.Name',
description: 'DAGGERHEART.WeaponFeature.Lucky.Description',
actions: [
{
type: 'resource',
name: 'DAGGERHEART.WeaponFeature.Lucky.Name',
img: 'icons/magic/control/buff-luck-fortune-green.webp',
actionType: 'action',
cost: [
{
type: 'stress',
value: 1
}
]
}
]
},
massive: {
label: 'DAGGERHEART.WeaponFeature.Massive.Name',
description: 'DAGGERHEART.WeaponFeature.Massive.Description',
effects: [
{
changes: [
{
key: 'system.evasion.bonus',
mode: 2,
value: '-1'
}
]
}
]
},
painful: {
label: 'DAGGERHEART.WeaponFeature.Painful.Name',
description: 'DAGGERHEART.WeaponFeature.Painful.Description',
actions: [
{
type: 'resource',
name: 'DAGGERHEART.WeaponFeature.Painful.Name',
img: 'icons/skills/wounds/injury-face-impact-orange.webp',
actionType: 'action',
cost: [
{
type: 'stress',
value: 1
}
]
}
]
},
paired: {
label: 'DAGGERHEART.WeaponFeature.Paired.Name',
description: 'DAGGERHEART.WeaponFeature.Paired.Description',
override: {
bonusDamage: 1
}
},
parry: {
label: 'DAGGERHEART.WeaponFeature.Parry.Name',
description: 'DAGGERHEART.WeaponFeature.Parry.Description'
},
persuasive: {
label: 'DAGGERHEART.WeaponFeature.Persuasive.Name',
description: 'DAGGERHEART.WeaponFeature.Persuasive.Description'
},
pompous: {
label: 'DAGGERHEART.WeaponFeature.Pompous.Name',
description: 'DAGGERHEART.WeaponFeature.Pompous.Description'
},
powerful: {
label: 'DAGGERHEART.WeaponFeature.Powerful.Name',
description: 'DAGGERHEART.WeaponFeature.Powerful.Description'
},
protective: {
label: 'DAGGERHEART.WeaponFeature.Protective.Name',
description: 'DAGGERHEART.WeaponFeature.Protective.Description',
effects: [
{
changes: [
{
key: 'system.bonuses.armorScore',
mode: 2,
value: '@system.tier'
}
]
}
]
},
quick: {
label: 'DAGGERHEART.WeaponFeature.Quick.Name',
description: 'DAGGERHEART.WeaponFeature.Quick.Description',
actions: [
{
type: 'resource',
name: 'DAGGERHEART.WeaponFeature.Quick.Name',
img: 'icons/skills/movement/arrow-upward-yellow.webp',
actionType: 'action',
cost: [
{
type: 'stress',
value: 1
}
]
}
]
},
reliable: {
label: 'DAGGERHEART.WeaponFeature.Reliable.Name',
description: 'DAGGERHEART.WeaponFeature.Reliable.Description',
effects: [
{
changes: [
{
key: 'system.bonuses.attack',
mode: 2,
value: 1
}
]
}
]
},
reloading: {
label: 'DAGGERHEART.WeaponFeature.Reloading.Name',
description: 'DAGGERHEART.WeaponFeature.Reloading.Description'
},
retractable: {
label: 'DAGGERHEART.WeaponFeature.Retractable.Name',
description: 'DAGGERHEART.WeaponFeature.Retractable.Description'
},
returning: {
label: 'DAGGERHEART.WeaponFeature.Returning.Name',
description: 'DAGGERHEART.WeaponFeature.Returning.Description'
},
scary: {
label: 'DAGGERHEART.WeaponFeature.Scary.Name',
description: 'DAGGERHEART.WeaponFeature.Scary.Description'
},
serrated: {
label: 'DAGGERHEART.WeaponFeature.Serrated.Name',
description: 'DAGGERHEART.WeaponFeature.Serrated.Description'
},
sharpwing: {
label: 'DAGGERHEART.WeaponFeature.Sharpwing.Name',
description: 'DAGGERHEART.WeaponFeature.Sharpwing.Description'
},
sheltering: {
label: 'DAGGERHEART.WeaponFeature.Sheltering.Name',
description: 'DAGGERHEART.WeaponFeature.Sheltering.Description'
},
startling: {
label: 'DAGGERHEART.WeaponFeature.Startling.Name',
description: 'DAGGERHEART.WeaponFeature.Startling.Description',
actions: [
{
type: 'resource',
name: 'DAGGERHEART.WeaponFeature.Startling.Name',
img: 'icons/magic/control/fear-fright-mask-orange.webp',
actionType: 'action',
cost: [
{
type: 'stress',
value: 1
}
]
}
]
},
timebending: {
label: 'DAGGERHEART.WeaponFeature.Timebending.Name',
description: 'DAGGERHEART.WeaponFeature.Timebending.Description'
},
versatile: {
label: 'DAGGERHEART.WeaponFeature.Versatile.Name',
description: 'DAGGERHEART.WeaponFeature.Versatile.Description',
versatile: {
characterTrait: '',
range: '',
damage: ''
}
}
};
export const featureTypes = {
ancestry: {
id: 'ancestry',
label: 'DAGGERHEART.Feature.Type.ancestry'
},
community: {
id: 'community',
label: 'DAGGERHEART.Feature.Type.community'
},
class: {
id: 'class',
label: 'DAGGERHEART.Feature.Type.class'
},
subclass: {
id: 'subclass',
label: 'DAGGERHEART.Feature.Type.subclass'
},
classHope: {
id: 'classHope',
label: 'DAGGERHEART.Feature.Type.classHope'
},
domainCard: {
id: 'domainCard',
label: 'DAGGERHEART.Feature.Type.domainCard'
},
equipment: {
id: 'equipment',
label: 'DAGGERHEART.Feature.Type.equipment'
}
};
export const valueTypes = {
normal: {
id: 'normal',
name: 'DAGGERHEART.Feature.ValueType.Normal',
data: {
value: 0,
max: 0
}
},
input: {
id: 'input',
name: 'DAGGERHEART.Feature.ValueType.Input',
data: {
value: null
}
},
dice: {
id: 'dice',
name: 'DAGGERHEART.Feature.ValueType.Dice',
data: {
value: null
}
}
};
export const actionTypes = {
passive: {
id: 'passive',
label: 'DAGGERHEART.ActionType.passive'
},
action: {
id: 'action',
label: 'DAGGERHEART.ActionType.action'
},
reaction: {
id: 'reaction',
label: 'DAGGERHEART.ActionType.reaction'
}
};

View file

@ -0,0 +1,42 @@
export const menu = {
Automation: {
Name: 'GameSettingsAutomation',
Icon: 'fa-solid fa-robot'
},
Homebrew: {
Name: 'GameSettingsHomebrew',
Icon: 'fa-solid fa-flask-vial'
},
Range: {
Name: 'GameSettingsRange',
Icon: 'fa-solid fa-ruler'
},
VariantRules: {
Name: 'GameSettingsVariantrules',
Icon: 'fa-solid fa-scale-balanced'
}
};
export const gameSettings = {
Automation: 'Automation',
Homebrew: 'Homebrew',
RangeMeasurement: 'RangeMeasurement',
appearance: 'Appearance',
variantRules: 'VariantRules',
Resources: {
Fear: 'ResourcesFear'
},
LevelTiers: 'LevelTiers',
Countdowns: 'Countdowns'
};
export const DualityRollColor = {
colorful: {
value: 0,
label: 'DAGGERHEART.Settings.DualityRollColor.Options.Colorful'
},
normal: {
value: 1,
label: 'DAGGERHEART.Settings.DualityRollColor.Options.Normal'
}
};

24
module/config/system.mjs Normal file
View file

@ -0,0 +1,24 @@
import * as GENERAL from './generalConfig.mjs';
import * as DOMAIN from './domainConfig.mjs';
import * as ACTOR from './actorConfig.mjs';
import * as ITEM from './itemConfig.mjs';
import * as SETTINGS from './settingsConfig.mjs';
import { hooks as HOOKS } from './hooksConfig.mjs';
import * as EFFECTS from './effectConfig.mjs';
import * as ACTIONS from './actionConfig.mjs';
import * as FLAGS from './flagsConfig.mjs';
export const SYSTEM_ID = 'daggerheart';
export const SYSTEM = {
id: SYSTEM_ID,
GENERAL,
DOMAIN,
ACTOR,
ITEM,
SETTINGS,
HOOKS,
EFFECTS,
ACTIONS,
FLAGS
};