mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-25 00:43:38 +02:00
Compare commits
No commits in common. "98cf6fa6de1d2bb61f0a9b9c4a4d2df385120b70" and "9393bab6cf6cd1203d4f991895d3e589d011a104" have entirely different histories.
98cf6fa6de
...
9393bab6cf
43 changed files with 279 additions and 365 deletions
|
|
@ -78,7 +78,6 @@ CONFIG.ux.ContextMenu = applications.ux.DHContextMenu;
|
||||||
CONFIG.ux.TooltipManager = documents.DhTooltipManager;
|
CONFIG.ux.TooltipManager = documents.DhTooltipManager;
|
||||||
CONFIG.ux.TemplateManager = new TemplateManager();
|
CONFIG.ux.TemplateManager = new TemplateManager();
|
||||||
CONFIG.ux.TokenManager = new TokenManager();
|
CONFIG.ux.TokenManager = new TokenManager();
|
||||||
CONFIG.debug.triggers = false;
|
|
||||||
|
|
||||||
Hooks.once('init', () => {
|
Hooks.once('init', () => {
|
||||||
game.system.api = {
|
game.system.api = {
|
||||||
|
|
@ -90,7 +89,7 @@ Hooks.once('init', () => {
|
||||||
fields
|
fields
|
||||||
};
|
};
|
||||||
|
|
||||||
game.system.registeredTriggers = new game.system.api.data.RegisteredTriggers();
|
game.system.registeredTriggers = new RegisteredTriggers();
|
||||||
|
|
||||||
const { DocumentSheetConfig } = foundry.applications.apps;
|
const { DocumentSheetConfig } = foundry.applications.apps;
|
||||||
DocumentSheetConfig.unregisterSheet(TokenDocument, 'core', foundry.applications.sheets.TokenConfig);
|
DocumentSheetConfig.unregisterSheet(TokenDocument, 'core', foundry.applications.sheets.TokenConfig);
|
||||||
|
|
@ -390,12 +389,49 @@ Hooks.on('refreshToken', (_, options) => {
|
||||||
Hooks.on('renderCompendiumDirectory', (app, html) => applications.ui.ItemBrowser.injectSidebarButton(html));
|
Hooks.on('renderCompendiumDirectory', (app, html) => applications.ui.ItemBrowser.injectSidebarButton(html));
|
||||||
Hooks.on('renderDocumentDirectory', (app, html) => applications.ui.ItemBrowser.injectSidebarButton(html));
|
Hooks.on('renderDocumentDirectory', (app, html) => applications.ui.ItemBrowser.injectSidebarButton(html));
|
||||||
|
|
||||||
/* Non actor-linked Actors should unregister the triggers of their tokens if a scene's token layer is torn down */
|
class RegisteredTriggers extends Map {
|
||||||
Hooks.on('canvasTearDown', canvas => {
|
constructor() {
|
||||||
game.system.registeredTriggers.unregisterSceneTriggers(canvas.scene);
|
super();
|
||||||
});
|
}
|
||||||
|
|
||||||
/* Non actor-linked Actors should register the triggers of their tokens on a readied scene */
|
async registerTriggers(trigger, actor, triggeringActorType, uuid, commands) {
|
||||||
Hooks.on('canvasReady', canas => {
|
const existingTrigger = this.get(trigger);
|
||||||
game.system.registeredTriggers.registerSceneTriggers(canvas.scene);
|
if (!existingTrigger) this.set(trigger, new Map());
|
||||||
});
|
|
||||||
|
this.get(trigger).set(uuid, { actor, triggeringActorType, commands });
|
||||||
|
}
|
||||||
|
|
||||||
|
async runTrigger(trigger, currentActor, ...args) {
|
||||||
|
const updates = [];
|
||||||
|
const triggerSettings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).triggers;
|
||||||
|
if (!triggerSettings.enabled) return updates;
|
||||||
|
|
||||||
|
const dualityTrigger = this.get(trigger);
|
||||||
|
if (dualityTrigger) {
|
||||||
|
for (let { actor, triggeringActorType, commands } of dualityTrigger.values()) {
|
||||||
|
const triggerData = CONFIG.DH.TRIGGER.triggers[trigger];
|
||||||
|
if (triggerData.usesActor && triggeringActorType !== 'any') {
|
||||||
|
if (triggeringActorType === 'self' && currentActor?.uuid !== actor) continue;
|
||||||
|
else if (triggeringActorType === 'other' && currentActor?.uuid === actor) continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let command of commands) {
|
||||||
|
try {
|
||||||
|
const result = await command(...args);
|
||||||
|
if (result?.updates?.length) updates.push(...result.updates);
|
||||||
|
} catch (_) {
|
||||||
|
const triggerName = game.i18n.localize(triggerData.label);
|
||||||
|
ui.notifications.error(
|
||||||
|
game.i18n.format('DAGGERHEART.CONFIG.Triggers.triggerError', {
|
||||||
|
trigger: triggerName,
|
||||||
|
actor: currentActor?.name
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return updates;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
15
lang/en.json
15
lang/en.json
|
|
@ -237,13 +237,10 @@
|
||||||
"confirmText": "Would you like to level up your companion {name} by {levelChange} levels at this time? (You can do it manually later)"
|
"confirmText": "Would you like to level up your companion {name} by {levelChange} levels at this time? (You can do it manually later)"
|
||||||
},
|
},
|
||||||
"viewLevelups": "View Levelups",
|
"viewLevelups": "View Levelups",
|
||||||
"resetCharacter": "Reset Character",
|
|
||||||
"viewParty": "View Party",
|
"viewParty": "View Party",
|
||||||
"InvalidOldCharacterImportTitle": "Old Character Import",
|
"InvalidOldCharacterImportTitle": "Old Character Import",
|
||||||
"InvalidOldCharacterImportText": "Character data exported prior to system version 1.1 will not generate a complete character. Do you wish to continue?",
|
"InvalidOldCharacterImportText": "Character data exported prior to system version 1.1 will not generate a complete character. Do you wish to continue?",
|
||||||
"cancelBeastform": "Cancel Beastform",
|
"cancelBeastform": "Cancel Beastform"
|
||||||
"resetCharacterConfirmationTitle": "Reset Character",
|
|
||||||
"resetCharacterConfirmationContent": "You are reseting all character data except name and portrait. Are you sure?"
|
|
||||||
},
|
},
|
||||||
"Companion": {
|
"Companion": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
|
|
@ -317,8 +314,6 @@
|
||||||
"selectPrimaryWeapon": "Select Primary Weapon",
|
"selectPrimaryWeapon": "Select Primary Weapon",
|
||||||
"selectSecondaryWeapon": "Select Secondary Weapon",
|
"selectSecondaryWeapon": "Select Secondary Weapon",
|
||||||
"selectSubclass": "Select Subclass",
|
"selectSubclass": "Select Subclass",
|
||||||
"setupSkipTitle": "Skipping Character Setup",
|
|
||||||
"setupSkipContent": "You are skipping the Character Setup by adding this manually. The character setup is the blinking arrows in the top-right. Are you sure you want to continue?",
|
|
||||||
"startingItems": "Starting Items",
|
"startingItems": "Starting Items",
|
||||||
"story": "Story",
|
"story": "Story",
|
||||||
"storyExplanation": "Select which background and connection prompts you want to copy into your character's background.",
|
"storyExplanation": "Select which background and connection prompts you want to copy into your character's background.",
|
||||||
|
|
@ -2090,7 +2085,6 @@
|
||||||
"tier4": "tier 4",
|
"tier4": "tier 4",
|
||||||
"domains": "Domains",
|
"domains": "Domains",
|
||||||
"downtime": "Downtime",
|
"downtime": "Downtime",
|
||||||
"itemFeatures": "Item Features",
|
|
||||||
"roll": "Roll",
|
"roll": "Roll",
|
||||||
"rules": "Rules",
|
"rules": "Rules",
|
||||||
"partyMembers": "Party Members",
|
"partyMembers": "Party Members",
|
||||||
|
|
@ -2455,6 +2449,10 @@
|
||||||
"label": "Show Resource Change Scrolltexts",
|
"label": "Show Resource Change Scrolltexts",
|
||||||
"hint": "When a character is damaged, uses armor etc, a scrolling text will briefly appear by the token to signify this."
|
"hint": "When a character is damaged, uses armor etc, a scrolling text will briefly appear by the token to signify this."
|
||||||
},
|
},
|
||||||
|
"playerCanEditSheet": {
|
||||||
|
"label": "Players Can Manually Edit Character Settings",
|
||||||
|
"hint": "Players are allowed to access the manual Character Settings and change their statistics beyond the rules."
|
||||||
|
},
|
||||||
"roll": {
|
"roll": {
|
||||||
"roll": {
|
"roll": {
|
||||||
"label": "Roll",
|
"label": "Roll",
|
||||||
|
|
@ -2711,9 +2709,6 @@
|
||||||
"rerollDamage": "Reroll Damage",
|
"rerollDamage": "Reroll Damage",
|
||||||
"assignTagRoll": "Assign as Tag Roll"
|
"assignTagRoll": "Assign as Tag Roll"
|
||||||
},
|
},
|
||||||
"ConsoleLogs": {
|
|
||||||
"triggerRun": "DH TRIGGER | Item '{item}' on actor '{actor}' ran a '{trigger}' trigger."
|
|
||||||
},
|
|
||||||
"Countdowns": {
|
"Countdowns": {
|
||||||
"title": "Countdowns",
|
"title": "Countdowns",
|
||||||
"toggleIconMode": "Toggle Icon Only",
|
"toggleIconMode": "Toggle Icon Only",
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
context.formula = this.roll.constructFormula(this.config);
|
context.formula = this.roll.constructFormula(this.config);
|
||||||
if (this.actor?.system?.traits) context.abilities = this.getTraitModifiers();
|
if (this.actor?.system?.traits) context.abilities = this.getTraitModifiers();
|
||||||
|
|
||||||
context.showReaction = !this.config.roll?.type || context.rollType === 'DualityRoll';
|
context.showReaction = !this.config.roll?.type && context.rollType === 'DualityRoll';
|
||||||
context.reactionOverride = this.reactionOverride;
|
context.reactionOverride = this.reactionOverride;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
makeDeathMove: CharacterSheet.#makeDeathMove,
|
makeDeathMove: CharacterSheet.#makeDeathMove,
|
||||||
levelManagement: CharacterSheet.#levelManagement,
|
levelManagement: CharacterSheet.#levelManagement,
|
||||||
viewLevelups: CharacterSheet.#viewLevelups,
|
viewLevelups: CharacterSheet.#viewLevelups,
|
||||||
resetCharacter: CharacterSheet.#resetCharacter,
|
|
||||||
toggleEquipItem: CharacterSheet.#toggleEquipItem,
|
toggleEquipItem: CharacterSheet.#toggleEquipItem,
|
||||||
toggleResourceDice: CharacterSheet.#toggleResourceDice,
|
toggleResourceDice: CharacterSheet.#toggleResourceDice,
|
||||||
handleResourceDice: CharacterSheet.#handleResourceDice,
|
handleResourceDice: CharacterSheet.#handleResourceDice,
|
||||||
|
|
@ -43,11 +42,6 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
icon: 'fa-solid fa-angles-up',
|
icon: 'fa-solid fa-angles-up',
|
||||||
label: 'DAGGERHEART.ACTORS.Character.viewLevelups',
|
label: 'DAGGERHEART.ACTORS.Character.viewLevelups',
|
||||||
action: 'viewLevelups'
|
action: 'viewLevelups'
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'fa-solid fa-arrow-rotate-left',
|
|
||||||
label: 'DAGGERHEART.ACTORS.Character.resetCharacter',
|
|
||||||
action: 'resetCharacter'
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -226,6 +220,13 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
async _preparePartContext(partId, context, options) {
|
async _preparePartContext(partId, context, options) {
|
||||||
context = await super._preparePartContext(partId, context, options);
|
context = await super._preparePartContext(partId, context, options);
|
||||||
switch (partId) {
|
switch (partId) {
|
||||||
|
case 'header':
|
||||||
|
const { playerCanEditSheet, levelupAuto } = game.settings.get(
|
||||||
|
CONFIG.DH.id,
|
||||||
|
CONFIG.DH.SETTINGS.gameSettings.Automation
|
||||||
|
);
|
||||||
|
context.showSettings = game.user.isGM || !levelupAuto || (levelupAuto && playerCanEditSheet);
|
||||||
|
break;
|
||||||
case 'loadout':
|
case 'loadout':
|
||||||
await this._prepareLoadoutContext(context, options);
|
await this._prepareLoadoutContext(context, options);
|
||||||
break;
|
break;
|
||||||
|
|
@ -665,32 +666,6 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
new LevelupViewMode(this.document).render({ force: true });
|
new LevelupViewMode(this.document).render({ force: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Resets the character data and removes all embedded documents.
|
|
||||||
*/
|
|
||||||
static async #resetCharacter() {
|
|
||||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
|
||||||
window: {
|
|
||||||
title: game.i18n.localize('DAGGERHEART.ACTORS.Character.resetCharacterConfirmationTitle')
|
|
||||||
},
|
|
||||||
content: game.i18n.localize('DAGGERHEART.ACTORS.Character.resetCharacterConfirmationContent')
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!confirmed) return;
|
|
||||||
|
|
||||||
await this.document.update({
|
|
||||||
'==system': {}
|
|
||||||
});
|
|
||||||
await this.document.deleteEmbeddedDocuments(
|
|
||||||
'Item',
|
|
||||||
this.document.items.map(x => x.id)
|
|
||||||
);
|
|
||||||
await this.document.deleteEmbeddedDocuments(
|
|
||||||
'ActiveEffect',
|
|
||||||
this.document.effects.map(x => x.id)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the Death Move interface for the character.
|
* Opens the Death Move interface for the character.
|
||||||
* @type {ApplicationClickAction}
|
* @type {ApplicationClickAction}
|
||||||
|
|
@ -737,7 +712,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
headerTitle: game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', {
|
headerTitle: game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', {
|
||||||
ability: abilityLabel
|
ability: abilityLabel
|
||||||
}),
|
}),
|
||||||
effects: await game.system.api.data.actions.actionsTypes.base.getEffects(this.document),
|
effects: Array.from(await this.document.allApplicableEffects()),
|
||||||
roll: {
|
roll: {
|
||||||
trait: button.dataset.attribute,
|
trait: button.dataset.attribute,
|
||||||
type: 'trait'
|
type: 'trait'
|
||||||
|
|
@ -981,18 +956,6 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
}
|
}
|
||||||
|
|
||||||
async _onDropItem(event, item) {
|
async _onDropItem(event, item) {
|
||||||
const setupCriticalItemTypes = ['class', 'subclass', 'ancestry', 'community'];
|
|
||||||
if (this.document.system.needsCharacterSetup && setupCriticalItemTypes.includes(item.type)) {
|
|
||||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
|
||||||
window: {
|
|
||||||
title: game.i18n.localize('DAGGERHEART.APPLICATIONS.CharacterCreation.setupSkipTitle')
|
|
||||||
},
|
|
||||||
content: game.i18n.localize('DAGGERHEART.APPLICATIONS.CharacterCreation.setupSkipContent')
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!confirmed) return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.document.uuid === item.parent?.uuid) {
|
if (this.document.uuid === item.parent?.uuid) {
|
||||||
return super._onDropItem(event, item);
|
return super._onDropItem(event, item);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -505,10 +505,7 @@ export default function DHApplicationMixin(Base) {
|
||||||
const doc = await getDocFromElement(target),
|
const doc = await getDocFromElement(target),
|
||||||
action = doc?.system?.attack ?? doc;
|
action = doc?.system?.attack ?? doc;
|
||||||
const config = action.prepareConfig(event);
|
const config = action.prepareConfig(event);
|
||||||
config.effects = await game.system.api.data.actions.actionsTypes.base.getEffects(
|
config.effects = Array.from(await this.document.allApplicableEffects());
|
||||||
this.document,
|
|
||||||
doc
|
|
||||||
);
|
|
||||||
config.hasRoll = false;
|
config.hasRoll = false;
|
||||||
return action && action.workflow.get('damage').execute(config, null, true);
|
return action && action.workflow.get('damage').execute(config, null, true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ export default class DaggerheartMenu extends HandlebarsApplicationMixin(Abstract
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
classes: ['dh-style', 'directory'],
|
classes: ['dh-style'],
|
||||||
window: {
|
window: {
|
||||||
title: 'SIDEBAR.TabSettings'
|
title: 'SIDEBAR.TabSettings'
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -92,19 +92,6 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
super.close(options);
|
super.close(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Ensure the chat theme inherits the interface theme */
|
|
||||||
_replaceHTML(result, content, options) {
|
|
||||||
const themedElement = result.log?.querySelector(".chat-log");
|
|
||||||
themedElement?.classList.remove("themed", "theme-light", "theme-dark");
|
|
||||||
super._replaceHTML(result, content, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Remove chat log theme from notifications area */
|
|
||||||
async _onFirstRender(result, content) {
|
|
||||||
await super._onFirstRender(result, content);
|
|
||||||
document.querySelector("#chat-notifications .chat-log")?.classList.remove("themed", "theme-light", "theme-dark")
|
|
||||||
}
|
|
||||||
|
|
||||||
async onRollSimple(event, message) {
|
async onRollSimple(event, message) {
|
||||||
const buttonType = event.target.dataset.type ?? 'damage',
|
const buttonType = event.target.dataset.type ?? 'damage',
|
||||||
total = message.rolls.reduce((a, c) => a + Roll.fromJSON(c).total, 0),
|
total = message.rolls.reduce((a, c) => a + Roll.fromJSON(c).total, 0),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
export { default as DhCombat } from './combat.mjs';
|
export { default as DhCombat } from './combat.mjs';
|
||||||
export { default as DhCombatant } from './combatant.mjs';
|
export { default as DhCombatant } from './combatant.mjs';
|
||||||
export { default as DhTagTeamRoll } from './tagTeamRoll.mjs';
|
export { default as DhTagTeamRoll } from './tagTeamRoll.mjs';
|
||||||
export { default as RegisteredTriggers } from './registeredTriggers.mjs';
|
|
||||||
|
|
||||||
export * as countdowns from './countdowns.mjs';
|
export * as countdowns from './countdowns.mjs';
|
||||||
export * as actions from './action/_module.mjs';
|
export * as actions from './action/_module.mjs';
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
let config = this.prepareConfig(event);
|
let config = this.prepareConfig(event);
|
||||||
if (!config) return;
|
if (!config) return;
|
||||||
|
|
||||||
config.effects = await game.system.api.data.actions.actionsTypes.base.getEffects(this.actor, this.item);
|
await this.addEffects(config);
|
||||||
|
|
||||||
if (Hooks.call(`${CONFIG.DH.id}.preUseAction`, this, config) === false) return;
|
if (Hooks.call(`${CONFIG.DH.id}.preUseAction`, this, config) === false) return;
|
||||||
|
|
||||||
|
|
@ -266,26 +266,14 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** */
|
||||||
* Get the all potentially applicable effects on the actor
|
async addEffects(config) {
|
||||||
* @param {DHActor} actor The actor performing the action
|
let effects = [];
|
||||||
* @param {DHItem|DhActor} effectParent The parent of the effect
|
if (this.actor) {
|
||||||
* @returns {DhActiveEffect[]}
|
effects = Array.from(await this.actor.allApplicableEffects());
|
||||||
*/
|
|
||||||
static async getEffects(actor, effectParent) {
|
|
||||||
if (!actor) return [];
|
|
||||||
|
|
||||||
return Array.from(await actor.allApplicableEffects()).filter(effect => {
|
|
||||||
/* Effects on weapons only ever apply for the weapon itself */
|
|
||||||
if (effect.parent.type === 'weapon') {
|
|
||||||
/* Unless they're secondary - then they apply only to other primary weapons */
|
|
||||||
if (effect.parent.system.secondary) {
|
|
||||||
if (effectParent?.type !== 'weapon' || effectParent?.system.secondary) return false;
|
|
||||||
} else if (effectParent?.id !== effect.parent.id) return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return !effect.isSuppressed;
|
config.effects = effects;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,26 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
||||||
|
|
||||||
prepareBaseData() {
|
prepareBaseData() {
|
||||||
super.prepareBaseData();
|
super.prepareBaseData();
|
||||||
game.system.registeredTriggers.registerItemTriggers(this.parent);
|
|
||||||
|
for (const action of this.actions ?? []) {
|
||||||
|
if (!action.actor) continue;
|
||||||
|
|
||||||
|
const actionsToRegister = [];
|
||||||
|
for (let i = 0; i < action.triggers.length; i++) {
|
||||||
|
const trigger = action.triggers[i];
|
||||||
|
const { args } = CONFIG.DH.TRIGGER.triggers[trigger.trigger];
|
||||||
|
const fn = new foundry.utils.AsyncFunction(...args, `{${trigger.command}\n}`);
|
||||||
|
actionsToRegister.push(fn.bind(action));
|
||||||
|
if (i === action.triggers.length - 1)
|
||||||
|
game.system.registeredTriggers.registerTriggers(
|
||||||
|
trigger.trigger,
|
||||||
|
action.actor?.uuid,
|
||||||
|
trigger.triggeringActorType,
|
||||||
|
this.parent.uuid,
|
||||||
|
actionsToRegister
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async _preCreate(data, options, user) {
|
async _preCreate(data, options, user) {
|
||||||
|
|
@ -227,28 +246,6 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
||||||
const armorData = getScrollTextData(this.parent.parent.system.resources, changed.system.marks, 'armor');
|
const armorData = getScrollTextData(this.parent.parent.system.resources, changed.system.marks, 'armor');
|
||||||
options.scrollingTextData = [armorData];
|
options.scrollingTextData = [armorData];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed.system?.actions) {
|
|
||||||
const triggersToRemove = Object.keys(changed.system.actions).reduce((acc, key) => {
|
|
||||||
if (!changed.system.actions[key]) {
|
|
||||||
const strippedKey = key.replace('-=', '');
|
|
||||||
acc.push(...this.actions.get(strippedKey).triggers.map(x => x.trigger));
|
|
||||||
}
|
|
||||||
|
|
||||||
return acc;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
game.system.registeredTriggers.unregisterTriggers(triggersToRemove, this.parent.uuid);
|
|
||||||
|
|
||||||
if (!(this.parent.parent.token instanceof game.system.api.documents.DhToken)) {
|
|
||||||
for (const token of this.parent.parent.getActiveTokens()) {
|
|
||||||
game.system.registeredTriggers.unregisterTriggers(
|
|
||||||
triggersToRemove,
|
|
||||||
`${token.document.uuid}.${this.parent.uuid}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_onUpdate(changed, options, userId) {
|
_onUpdate(changed, options, userId) {
|
||||||
|
|
|
||||||
|
|
@ -1,154 +0,0 @@
|
||||||
export default class RegisteredTriggers extends Map {
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
registerTriggers(triggers, actor, uuid) {
|
|
||||||
for (const triggerKey of Object.keys(CONFIG.DH.TRIGGER.triggers)) {
|
|
||||||
const match = triggers[triggerKey];
|
|
||||||
const existingTrigger = this.get(triggerKey);
|
|
||||||
|
|
||||||
if (!match) {
|
|
||||||
if (existingTrigger?.get(uuid)) this.get(triggerKey).delete(uuid);
|
|
||||||
} else {
|
|
||||||
const { trigger, triggeringActorType, commands } = match;
|
|
||||||
|
|
||||||
if (!existingTrigger) this.set(trigger, new Map());
|
|
||||||
this.get(trigger).set(uuid, { actor, triggeringActorType, commands });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
registerItemTriggers(item, registerOverride) {
|
|
||||||
for (const action of item.system.actions ?? []) {
|
|
||||||
if (!action.actor) continue;
|
|
||||||
|
|
||||||
/* Non actor-linked should only prep synthetic actors so they're not registering triggers unless they're on the canvas */
|
|
||||||
if (
|
|
||||||
!registerOverride &&
|
|
||||||
!action.actor.prototypeToken.actorLink &&
|
|
||||||
(!(action.actor.parent instanceof game.system.api.documents.DhToken) || !action.actor.parent?.uuid)
|
|
||||||
)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
const triggers = {};
|
|
||||||
for (const trigger of action.triggers) {
|
|
||||||
const { args } = CONFIG.DH.TRIGGER.triggers[trigger.trigger];
|
|
||||||
const fn = new foundry.utils.AsyncFunction(...args, `{${trigger.command}\n}`);
|
|
||||||
|
|
||||||
if (!triggers[trigger.trigger])
|
|
||||||
triggers[trigger.trigger] = {
|
|
||||||
trigger: trigger.trigger,
|
|
||||||
triggeringActorType: trigger.triggeringActorType,
|
|
||||||
commands: []
|
|
||||||
};
|
|
||||||
triggers[trigger.trigger].commands.push(fn.bind(action));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.registerTriggers(triggers, action.actor?.uuid, item.uuid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unregisterTriggers(triggerKeys, uuid) {
|
|
||||||
for (const triggerKey of triggerKeys) {
|
|
||||||
const existingTrigger = this.get(triggerKey);
|
|
||||||
if (!existingTrigger) return;
|
|
||||||
|
|
||||||
existingTrigger.delete(uuid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unregisterItemTriggers(items) {
|
|
||||||
for (const item of items) {
|
|
||||||
if (!item.system.actions.size) continue;
|
|
||||||
|
|
||||||
const triggers = (item.system.actions ?? []).reduce((acc, action) => {
|
|
||||||
acc.push(...action.triggers.map(x => x.trigger));
|
|
||||||
return acc;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
this.unregisterTriggers(triggers, item.uuid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unregisterSceneTriggers(scene) {
|
|
||||||
for (const triggerKey of Object.keys(CONFIG.DH.TRIGGER.triggers)) {
|
|
||||||
const existingTrigger = this.get(triggerKey);
|
|
||||||
if (!existingTrigger) continue;
|
|
||||||
const filtered = new Map();
|
|
||||||
for (const [uuid, data] of existingTrigger.entries()) {
|
|
||||||
if (!uuid.startsWith(scene.uuid)) filtered.set(uuid, data);
|
|
||||||
}
|
|
||||||
this.set(triggerKey, filtered);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
registerSceneTriggers(scene) {
|
|
||||||
/* TODO: Finish sceneEnvironment registration and unreg */
|
|
||||||
// const systemData = new game.system.api.data.scenes.DHScene(scene.flags.daggerheart);
|
|
||||||
// for (const environment of systemData.sceneEnvironments) {
|
|
||||||
// for (const feature of environment.system.features) {
|
|
||||||
// if(feature) this.registerItemTriggers(feature, true);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
for (const actor of scene.tokens.filter(x => x.actor).map(x => x.actor)) {
|
|
||||||
if (actor.prototypeToken.actorLink) continue;
|
|
||||||
|
|
||||||
for (const item of actor.items) {
|
|
||||||
this.registerItemTriggers(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async runTrigger(trigger, currentActor, ...args) {
|
|
||||||
const updates = [];
|
|
||||||
const triggerSettings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).triggers;
|
|
||||||
if (!triggerSettings.enabled) return updates;
|
|
||||||
|
|
||||||
const dualityTrigger = this.get(trigger);
|
|
||||||
if (dualityTrigger) {
|
|
||||||
const tokenBoundActors = ['adversary', 'environment'];
|
|
||||||
const triggerActors = ['character', ...tokenBoundActors];
|
|
||||||
for (let [itemUuid, { actor: actorUuid, triggeringActorType, commands }] of dualityTrigger.entries()) {
|
|
||||||
const actor = await foundry.utils.fromUuid(actorUuid);
|
|
||||||
if (!actor || !triggerActors.includes(actor.type)) continue;
|
|
||||||
if (tokenBoundActors.includes(actor.type) && !actor.getActiveTokens().length) continue;
|
|
||||||
|
|
||||||
const triggerData = CONFIG.DH.TRIGGER.triggers[trigger];
|
|
||||||
if (triggerData.usesActor && triggeringActorType !== 'any') {
|
|
||||||
if (triggeringActorType === 'self' && currentActor?.uuid !== actorUuid) continue;
|
|
||||||
else if (triggeringActorType === 'other' && currentActor?.uuid === actorUuid) continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const command of commands) {
|
|
||||||
try {
|
|
||||||
if (CONFIG.debug.triggers) {
|
|
||||||
const item = await foundry.utils.fromUuid(itemUuid);
|
|
||||||
console.log(
|
|
||||||
game.i18n.format('DAGGERHEART.UI.ConsoleLogs.triggerRun', {
|
|
||||||
actor: actor.name ?? '<Missing Actor>',
|
|
||||||
item: item?.name ?? '<Missing Item>',
|
|
||||||
trigger: game.i18n.localize(triggerData.label)
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = await command(...args);
|
|
||||||
if (result?.updates?.length) updates.push(...result.updates);
|
|
||||||
} catch (_) {
|
|
||||||
const triggerName = game.i18n.localize(triggerData.label);
|
|
||||||
ui.notifications.error(
|
|
||||||
game.i18n.format('DAGGERHEART.CONFIG.Triggers.triggerError', {
|
|
||||||
trigger: triggerName,
|
|
||||||
actor: currentActor?.name
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return updates;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -55,6 +55,11 @@ export default class DhAutomation extends foundry.abstract.DataModel {
|
||||||
initial: true,
|
initial: true,
|
||||||
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.resourceScrollTexts.label'
|
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.resourceScrollTexts.label'
|
||||||
}),
|
}),
|
||||||
|
playerCanEditSheet: new fields.BooleanField({
|
||||||
|
required: true,
|
||||||
|
initial: false,
|
||||||
|
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.playerCanEditSheet.label'
|
||||||
|
}),
|
||||||
defeated: new fields.SchemaField({
|
defeated: new fields.SchemaField({
|
||||||
enabled: new fields.BooleanField({
|
enabled: new fields.BooleanField({
|
||||||
required: true,
|
required: true,
|
||||||
|
|
|
||||||
|
|
@ -104,16 +104,6 @@ export default class DhpActor extends Actor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async _preDelete() {
|
|
||||||
if (this.prototypeToken.actorLink) {
|
|
||||||
game.system.registeredTriggers.unregisterItemTriggers(this.items);
|
|
||||||
} else {
|
|
||||||
for (const token of this.getActiveTokens()) {
|
|
||||||
game.system.registeredTriggers.unregisterItemTriggers(token.actor.items);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_onDelete(options, userId) {
|
_onDelete(options, userId) {
|
||||||
super._onDelete(options, userId);
|
super._onDelete(options, userId);
|
||||||
for (const party of this.parties) {
|
for (const party of this.parties) {
|
||||||
|
|
|
||||||
|
|
@ -158,9 +158,7 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
const config = foundry.utils.deepClone(this.system);
|
const config = foundry.utils.deepClone(this.system);
|
||||||
config.event = event;
|
config.event = event;
|
||||||
if (this.system.action) {
|
if (this.system.action) {
|
||||||
const actor = await foundry.utils.fromUuid(config.source.actor);
|
await this.system.action.addEffects(config);
|
||||||
const item = actor?.items.get(config.source.item) ?? null;
|
|
||||||
config.effects = await game.system.api.data.actions.actionsTypes.base.getEffects(actor, item);
|
|
||||||
await this.system.action.workflow.get('damage')?.execute(config, this._id, true);
|
await this.system.action.workflow.get('damage')?.execute(config, this._id, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -194,16 +192,7 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelectedOrPerm'));
|
return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelectedOrPerm'));
|
||||||
|
|
||||||
this.consumeOnSuccess();
|
this.consumeOnSuccess();
|
||||||
if (this.system.action) this.system.action.workflow.get('applyDamage')?.execute(config, targets, true);
|
this.system.action?.workflow.get('applyDamage')?.execute(config, targets, true);
|
||||||
else {
|
|
||||||
for (const target of targets) {
|
|
||||||
const actor = await foundry.utils.fromUuid(target.actorId);
|
|
||||||
if (!actor) continue;
|
|
||||||
|
|
||||||
if (this.system.hasHealing) actor.takeHealing(this.system.damage);
|
|
||||||
else actor.takeDamage(this.system.damage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async onRollSave(event) {
|
async onRollSave(event) {
|
||||||
|
|
|
||||||
|
|
@ -208,23 +208,4 @@ export default class DHItem extends foundry.documents.Item {
|
||||||
|
|
||||||
cls.create(msg);
|
cls.create(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteTriggers() {
|
|
||||||
const actions = Array.from(this.system.actions ?? []);
|
|
||||||
if (!actions.length) return;
|
|
||||||
|
|
||||||
const triggerKeys = actions.flatMap(action => action.triggers.map(x => x.trigger));
|
|
||||||
|
|
||||||
game.system.registeredTriggers.unregisterTriggers(triggerKeys, this.uuid);
|
|
||||||
|
|
||||||
if (!(this.actor.parent instanceof game.system.api.documents.DhToken)) {
|
|
||||||
for (const token of this.actor.getActiveTokens()) {
|
|
||||||
game.system.registeredTriggers.unregisterTriggers(triggerKeys, `${token.document.uuid}.${this.uuid}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async _preDelete() {
|
|
||||||
this.deleteTriggers();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -536,10 +536,4 @@ export default class DHToken extends CONFIG.Token.documentClass {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
async _preDelete() {
|
|
||||||
if (this.actor && !this.actor.prototypeToken?.actorLink) {
|
|
||||||
game.system.registeredTriggers.unregisterItemTriggers(this.actor.items);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,18 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [],
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
"_id": "sGVVxSM68Fmr1sSM",
|
"_id": "sGVVxSM68Fmr1sSM",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,16 @@
|
||||||
"key": "system.evasion",
|
"key": "system.evasion",
|
||||||
"mode": 2,
|
"mode": 2,
|
||||||
"value": "-1"
|
"value": "-1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_id": "E0PjC15OP55vIype",
|
"_id": "E0PjC15OP55vIype",
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,18 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [],
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
"_id": "DCie5eR1dZH2Qvln",
|
"_id": "DCie5eR1dZH2Qvln",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,18 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [],
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
"_id": "sZ1XotFlGdkPPDG4",
|
"_id": "sZ1XotFlGdkPPDG4",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,18 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [],
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
"_id": "T831j6kZiMnpMNmv",
|
"_id": "T831j6kZiMnpMNmv",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,18 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [],
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
"_id": "ir4iKLIQ4CH1Qckn",
|
"_id": "ir4iKLIQ4CH1Qckn",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,18 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [],
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
"_id": "K4VgrDjVj1U1m9Ie",
|
"_id": "K4VgrDjVj1U1m9Ie",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,18 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [],
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
"_id": "904orawScurM9GjG",
|
"_id": "904orawScurM9GjG",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,16 @@
|
||||||
"key": "system.evasion",
|
"key": "system.evasion",
|
||||||
"mode": 2,
|
"mode": 2,
|
||||||
"value": "-1"
|
"value": "-1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_id": "cffkpiwGpEGhjiUC",
|
"_id": "cffkpiwGpEGhjiUC",
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,18 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [],
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
"_id": "hnayB09P25ZW3gVY",
|
"_id": "hnayB09P25ZW3gVY",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,16 @@
|
||||||
"key": "system.evasion",
|
"key": "system.evasion",
|
||||||
"mode": 2,
|
"mode": 2,
|
||||||
"value": "-1"
|
"value": "-1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_id": "2nl35v8sPAudiOIb",
|
"_id": "2nl35v8sPAudiOIb",
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,18 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [],
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
"_id": "OV1Ly7vX4owBUgLQ",
|
"_id": "OV1Ly7vX4owBUgLQ",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,16 @@
|
||||||
"key": "system.evasion",
|
"key": "system.evasion",
|
||||||
"mode": 2,
|
"mode": 2,
|
||||||
"value": "-1"
|
"value": "-1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_id": "oRCiXSElN5xufUfn",
|
"_id": "oRCiXSElN5xufUfn",
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,18 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [],
|
"changes": [
|
||||||
|
{
|
||||||
|
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
||||||
|
"mode": 2,
|
||||||
|
"value": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "system.rules.weapon.dropLowestDamageDice",
|
||||||
|
"mode": 5,
|
||||||
|
"value": "1"
|
||||||
|
}
|
||||||
|
],
|
||||||
"_id": "2J6vzNUel78JFypp",
|
"_id": "2J6vzNUel78JFypp",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,10 @@
|
||||||
@import '../utils/fonts.less';
|
@import '../utils/fonts.less';
|
||||||
@import '../utils/mixin.less';
|
@import '../utils/mixin.less';
|
||||||
|
|
||||||
.daggerheart.chat-sidebar.theme-light,
|
.theme-light {
|
||||||
#interface.theme-light {
|
.daggerheart.chat-sidebar .chat-log,
|
||||||
.chat-log .chat-message {
|
#chat-notifications .chat-log {
|
||||||
|
.chat-message {
|
||||||
background-image: url('../assets/parchments/dh-parchment-light.png');
|
background-image: url('../assets/parchments/dh-parchment-light.png');
|
||||||
|
|
||||||
.message-header .message-header-metadata .message-metadata,
|
.message-header .message-header-metadata .message-metadata,
|
||||||
|
|
@ -16,6 +17,7 @@
|
||||||
color: @dark-blue;
|
color: @dark-blue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#chat-message {
|
#chat-message {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
@import '../../utils/fonts.less';
|
@import '../../utils/fonts.less';
|
||||||
@import '../../utils/spacing.less';
|
@import '../../utils/spacing.less';
|
||||||
|
|
||||||
.daggerheart.chat-sidebar.theme-light,
|
|
||||||
#interface.theme-light {
|
#interface.theme-light {
|
||||||
.daggerheart.chat.domain-card {
|
.daggerheart.chat.domain-card {
|
||||||
.domain-card-move .domain-card-header {
|
.domain-card-move .domain-card-header {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
@import '../../utils/fonts.less';
|
@import '../../utils/fonts.less';
|
||||||
@import '../../utils/spacing.less';
|
@import '../../utils/spacing.less';
|
||||||
|
|
||||||
.daggerheart.chat-sidebar.theme-light,
|
|
||||||
#interface.theme-light {
|
#interface.theme-light {
|
||||||
.daggerheart.chat.action {
|
.daggerheart.chat.action {
|
||||||
.action-move .action-section {
|
.action-move .action-section {
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
@import '../../utils/fonts.less';
|
@import '../../utils/fonts.less';
|
||||||
@import '../../utils/spacing.less';
|
@import '../../utils/spacing.less';
|
||||||
|
|
||||||
.daggerheart.chat-sidebar.theme-light,
|
|
||||||
#interface.theme-light {
|
#interface.theme-light {
|
||||||
.chat-log {
|
.daggerheart.chat-sidebar .chat-log,
|
||||||
|
#chat-notifications .chat-log {
|
||||||
--text-color: @dark-blue;
|
--text-color: @dark-blue;
|
||||||
--bg-color: @dark-blue-40;
|
--bg-color: @dark-blue-40;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
@import '../../utils/colors.less';
|
@import '../../utils/colors.less';
|
||||||
|
|
||||||
.daggerheart.chat-sidebar.theme-light,
|
|
||||||
#interface.theme-light {
|
#interface.theme-light {
|
||||||
.daggerheart.chat.damage-summary .token-target-container {
|
.daggerheart.chat.damage-summary .token-target-container {
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
@import '../../utils/fonts.less';
|
@import '../../utils/fonts.less';
|
||||||
@import '../../utils/spacing.less';
|
@import '../../utils/spacing.less';
|
||||||
|
|
||||||
.daggerheart.chat-sidebar.theme-light,
|
|
||||||
#interface.theme-light {
|
#interface.theme-light {
|
||||||
.daggerheart.chat.downtime {
|
.daggerheart.chat.downtime {
|
||||||
.downtime-moves-list .downtime-move {
|
.downtime-moves-list .downtime-move {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
@import '../../utils/colors.less';
|
@import '../../utils/colors.less';
|
||||||
|
|
||||||
.daggerheart.chat-sidebar.theme-light,
|
|
||||||
#interface.theme-light {
|
#interface.theme-light {
|
||||||
.daggerheart.chat.effect-summary {
|
.daggerheart.chat.effect-summary {
|
||||||
.effect-header,
|
.effect-header,
|
||||||
|
|
|
||||||
|
|
@ -125,9 +125,9 @@
|
||||||
|
|
||||||
.group-roll-trait {
|
.group-roll-trait {
|
||||||
padding: 2px 8px;
|
padding: 2px 8px;
|
||||||
border: 1px solid light-dark(@dark-blue, white);
|
border: 1px solid light-dark(white, white);
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
color: light-dark(@dark-blue, white);
|
color: light-dark(white, white);
|
||||||
background: light-dark(@beige-80, @beige-80);
|
background: light-dark(@beige-80, @beige-80);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
@import '../../utils/colors.less';
|
@import '../../utils/colors.less';
|
||||||
@import '../../utils/fonts.less';
|
@import '../../utils/fonts.less';
|
||||||
|
|
||||||
.daggerheart.chat-sidebar.theme-light,
|
|
||||||
#interface.theme-light {
|
#interface.theme-light {
|
||||||
.chat-message:not(.duality) .message-content {
|
.chat-message:not(.duality) .message-content {
|
||||||
color: @dark;
|
color: @dark;
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
overflow: auto;
|
|
||||||
height: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "daggerheart",
|
"id": "daggerheart",
|
||||||
"title": "Daggerheart",
|
"title": "Daggerheart",
|
||||||
"description": "An unofficial implementation of the Daggerheart system",
|
"description": "An unofficial implementation of the Daggerheart system",
|
||||||
"version": "1.5.2",
|
"version": "1.5.0",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "13.346",
|
"minimum": "13.346",
|
||||||
"verified": "13.351",
|
"verified": "13.351",
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
{{formGroup settingFields.schema.fields.hordeDamage value=settingFields._source.hordeDamage localize=true}}
|
{{formGroup settingFields.schema.fields.hordeDamage value=settingFields._source.hordeDamage localize=true}}
|
||||||
{{formGroup settingFields.schema.fields.effects.fields.rangeDependent value=settingFields._source.effects.rangeDependent localize=true}}
|
{{formGroup settingFields.schema.fields.effects.fields.rangeDependent value=settingFields._source.effects.rangeDependent localize=true}}
|
||||||
{{formGroup settingFields.schema.fields.levelupAuto value=settingFields._source.levelupAuto localize=true}}
|
{{formGroup settingFields.schema.fields.levelupAuto value=settingFields._source.levelupAuto localize=true}}
|
||||||
|
{{formGroup settingFields.schema.fields.playerCanEditSheet value=settingFields._source.playerCanEditSheet localize=true}}
|
||||||
{{formGroup settingFields.schema.fields.damageReductionRulesDefault value=settingFields._source.damageReductionRulesDefault localize=true}}
|
{{formGroup settingFields.schema.fields.damageReductionRulesDefault value=settingFields._source.damageReductionRulesDefault localize=true}}
|
||||||
{{formGroup settingFields.schema.fields.resourceScrollTexts value=settingFields._source.resourceScrollTexts localize=true}}
|
{{formGroup settingFields.schema.fields.resourceScrollTexts value=settingFields._source.resourceScrollTexts localize=true}}
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,9 @@
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }}
|
{{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' showSettings=showSettings }}
|
||||||
|
{{#if ../showSettings}}
|
||||||
<button type="button" data-action="openSettings" data-tooltip-text="{{localize "DAGGERHEART.UI.Tooltip.openSheetSettings"}}"><i class="fa-solid fa-wrench"></i></button>
|
<button type="button" data-action="openSettings" data-tooltip-text="{{localize "DAGGERHEART.UI.Tooltip.openSheetSettings"}}"><i class="fa-solid fa-wrench"></i></button>
|
||||||
|
{{/if}}
|
||||||
{{/'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
{{/'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||||
</header>
|
</header>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue