mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-10 19:17:09 +01:00
Merge branch 'main' into refactor/275-actor-sheets-simplification
This commit is contained in:
commit
17a9630736
44 changed files with 358 additions and 251 deletions
|
|
@ -17,6 +17,7 @@ import {
|
||||||
socketRegistration
|
socketRegistration
|
||||||
} from './module/systemRegistration/_module.mjs';
|
} from './module/systemRegistration/_module.mjs';
|
||||||
import { placeables } from './module/canvas/_module.mjs';
|
import { placeables } from './module/canvas/_module.mjs';
|
||||||
|
import { registerRollDiceHooks } from './module/dice/dhRoll.mjs';
|
||||||
|
|
||||||
Hooks.once('init', () => {
|
Hooks.once('init', () => {
|
||||||
CONFIG.DH = SYSTEM;
|
CONFIG.DH = SYSTEM;
|
||||||
|
|
@ -152,6 +153,7 @@ Hooks.on('ready', () => {
|
||||||
registerCountdownHooks();
|
registerCountdownHooks();
|
||||||
socketRegistration.registerSocketHooks();
|
socketRegistration.registerSocketHooks();
|
||||||
registerCountdownApplicationHooks();
|
registerCountdownApplicationHooks();
|
||||||
|
registerRollDiceHooks();
|
||||||
});
|
});
|
||||||
|
|
||||||
Hooks.once('dicesoniceready', () => {});
|
Hooks.once('dicesoniceready', () => {});
|
||||||
|
|
@ -209,7 +211,7 @@ Hooks.on('chatMessage', (_, message) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const title = traitValue
|
const title = traitValue
|
||||||
? game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilitychecktitle', {
|
? game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', {
|
||||||
ability: game.i18n.localize(SYSTEM.ACTOR.abilities[traitValue].label)
|
ability: game.i18n.localize(SYSTEM.ACTOR.abilities[traitValue].label)
|
||||||
})
|
})
|
||||||
: game.i18n.localize('DAGGERHEART.GENERAL.duality');
|
: game.i18n.localize('DAGGERHEART.GENERAL.duality');
|
||||||
|
|
|
||||||
23
lang/en.json
23
lang/en.json
|
|
@ -611,7 +611,7 @@
|
||||||
},
|
},
|
||||||
"stress": {
|
"stress": {
|
||||||
"name": "Stress",
|
"name": "Stress",
|
||||||
"stress": "STR"
|
"abbreviation": "STR"
|
||||||
},
|
},
|
||||||
"hope": {
|
"hope": {
|
||||||
"name": "Hope",
|
"name": "Hope",
|
||||||
|
|
@ -619,33 +619,39 @@
|
||||||
},
|
},
|
||||||
"armorStack": {
|
"armorStack": {
|
||||||
"name": "Armor Stack",
|
"name": "Armor Stack",
|
||||||
"stress": "AS"
|
"abbreviation": "AS"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Range": {
|
"Range": {
|
||||||
"self": {
|
"self": {
|
||||||
"name": "Self",
|
"name": "Self",
|
||||||
"description": "means yourself."
|
"description": "means yourself.",
|
||||||
|
"short": "Self"
|
||||||
},
|
},
|
||||||
"melee": {
|
"melee": {
|
||||||
"name": "Melee",
|
"name": "Melee",
|
||||||
"description": "means a character is within touching distance of the target. PCs can generally touch targets up to a few feet away from them, but melee range may be greater for especially large NPCs."
|
"description": "means a character is within touching distance of the target. PCs can generally touch targets up to a few feet away from them, but melee range may be greater for especially large NPCs.",
|
||||||
|
"short": "Melee"
|
||||||
},
|
},
|
||||||
"veryClose": {
|
"veryClose": {
|
||||||
"name": "Very Close",
|
"name": "Very Close",
|
||||||
"description": "means a distance where one can see fine details of a target- within moments of reaching, if need be. This is usually anywhere from about 5-10 feet away. While in danger, a PC can usually get to anything that’s very close as part of any other action they take. Anything on a battle map that is within the shortest length of a game card (~2-3 inches) can usually be considered very close."
|
"description": "means a distance where one can see fine details of a target- within moments of reaching, if need be. This is usually anywhere from about 5-10 feet away. While in danger, a PC can usually get to anything that’s very close as part of any other action they take. Anything on a battle map that is within the shortest length of a game card (~2-3 inches) can usually be considered very close.",
|
||||||
|
"short": "V. Close"
|
||||||
},
|
},
|
||||||
"close": {
|
"close": {
|
||||||
"name": "Close",
|
"name": "Close",
|
||||||
"description": "means a distance where one can see prominent details of a target-- across a room or to a neighboring market stall, generally about 10-30 feet away. While in danger, a PC can usually get to anything that’s close as part of any other action they take. Anything on a battle map that is within the length of a standard pen or pencil (~5-6 inches) can usually be considered close."
|
"description": "means a distance where one can see prominent details of a target-- across a room or to a neighboring market stall, generally about 10-30 feet away. While in danger, a PC can usually get to anything that’s close as part of any other action they take. Anything on a battle map that is within the length of a standard pen or pencil (~5-6 inches) can usually be considered close.",
|
||||||
|
"short": "Close"
|
||||||
},
|
},
|
||||||
"far": {
|
"far": {
|
||||||
"name": "Far",
|
"name": "Far",
|
||||||
"description": "means a distance where one can see the appearance of a person or object, but probably not in great detail-- across a small battlefield or down a large corridor. This is usually about 30-100 feet away. While under danger, a PC will likely have to make an Agility check to get here safely. Anything on a battle map that is within the length of a standard piece of paper (~10-11 inches) can usually be considered far."
|
"description": "means a distance where one can see the appearance of a person or object, but probably not in great detail-- across a small battlefield or down a large corridor. This is usually about 30-100 feet away. While under danger, a PC will likely have to make an Agility check to get here safely. Anything on a battle map that is within the length of a standard piece of paper (~10-11 inches) can usually be considered far.",
|
||||||
|
"short": "Far"
|
||||||
},
|
},
|
||||||
"veryFar": {
|
"veryFar": {
|
||||||
"name": "Very Far",
|
"name": "Very Far",
|
||||||
"description": "means a distance where you can see the shape of a person or object, but probably not make outany details-- across a large battlefield or down a long street, generally about 100-300 feet away. While under danger, a PC likely has to make an Agility check to get here safely. Anything on a battle map that is beyond far distance, but still within sight of the characters can usually be considered very far."
|
"description": "means a distance where you can see the shape of a person or object, but probably not make outany details-- across a large battlefield or down a long street, generally about 100-300 feet away. While under danger, a PC likely has to make an Agility check to get here safely. Anything on a battle map that is beyond far distance, but still within sight of the characters can usually be considered very far.",
|
||||||
|
"short": "V. Far"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"RollTypes": {
|
"RollTypes": {
|
||||||
|
|
@ -1098,6 +1104,7 @@
|
||||||
"range": "Range",
|
"range": "Range",
|
||||||
"stress": "Stress",
|
"stress": "Stress",
|
||||||
"take": "Take",
|
"take": "Take",
|
||||||
|
"target": "Target",
|
||||||
"title": "Title",
|
"title": "Title",
|
||||||
"type": "Type",
|
"type": "Type",
|
||||||
"unarmored": "Unarmored",
|
"unarmored": "Unarmored",
|
||||||
|
|
|
||||||
|
|
@ -63,18 +63,6 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
const context = await super._prepareContext(_options);
|
const context = await super._prepareContext(_options);
|
||||||
context.rollConfig = this.config;
|
context.rollConfig = this.config;
|
||||||
context.hasRoll = !!this.config.roll;
|
context.hasRoll = !!this.config.roll;
|
||||||
context.roll = this.roll;
|
|
||||||
context.rollType = this.roll?.constructor.name;
|
|
||||||
context.experiences = Object.keys(this.config.data.experiences).map(id => ({
|
|
||||||
id,
|
|
||||||
...this.config.data.experiences[id]
|
|
||||||
}));
|
|
||||||
context.selectedExperiences = this.config.experiences;
|
|
||||||
context.advantage = this.config.roll?.advantage;
|
|
||||||
context.disadvantage = this.config.roll?.disadvantage;
|
|
||||||
context.diceOptions = CONFIG.DH.GENERAL.diceTypes;
|
|
||||||
context.canRoll = true;
|
|
||||||
context.isLite = this.config.roll?.lite;
|
|
||||||
if (this.config.costs?.length) {
|
if (this.config.costs?.length) {
|
||||||
const updatedCosts = this.action.calcCosts(this.config.costs);
|
const updatedCosts = this.action.calcCosts(this.config.costs);
|
||||||
context.costs = updatedCosts;
|
context.costs = updatedCosts;
|
||||||
|
|
@ -85,8 +73,22 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
context.uses = this.action.calcUses(this.config.uses);
|
context.uses = this.action.calcUses(this.config.uses);
|
||||||
context.canRoll = context.canRoll && this.action.hasUses(context.uses);
|
context.canRoll = context.canRoll && this.action.hasUses(context.uses);
|
||||||
}
|
}
|
||||||
context.extraFormula = this.config.extraFormula;
|
if(this.roll) {
|
||||||
context.formula = this.roll.constructFormula(this.config);
|
context.roll = this.roll;
|
||||||
|
context.rollType = this.roll?.constructor.name;
|
||||||
|
context.experiences = Object.keys(this.config.data.experiences).map(id => ({
|
||||||
|
id,
|
||||||
|
...this.config.data.experiences[id]
|
||||||
|
}));
|
||||||
|
context.selectedExperiences = this.config.experiences;
|
||||||
|
context.advantage = this.config.roll?.advantage;
|
||||||
|
context.disadvantage = this.config.roll?.disadvantage;
|
||||||
|
context.diceOptions = CONFIG.DH.GENERAL.diceTypes;
|
||||||
|
context.canRoll = true;
|
||||||
|
context.isLite = this.config.roll?.lite;
|
||||||
|
context.extraFormula = this.config.extraFormula;
|
||||||
|
context.formula = this.roll.constructFormula(this.config);
|
||||||
|
}
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
|
||||||
context.config = CONFIG.DH;
|
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.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')
|
if (this.action.damage?.hasOwnProperty('includeBase') && this.action.type === 'attack')
|
||||||
context.hasBaseDamage = !!this.action.parent.damage;
|
context.hasBaseDamage = !!this.action.parent.attack;
|
||||||
context.getRealIndex = this.getRealIndex.bind(this);
|
context.getRealIndex = this.getRealIndex.bind(this);
|
||||||
context.getEffectDetails = this.getEffectDetails.bind(this);
|
context.getEffectDetails = this.getEffectDetails.bind(this);
|
||||||
context.disableOption = this.disableOption.bind(this);
|
context.disableOption = this.disableOption.bind(this);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ export default class AdversarySheet extends DHBaseActorSheet {
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
classes: ['adversary'],
|
classes: ['adversary'],
|
||||||
position: { width: 660, height: 766 },
|
position: { width: 660, height: 766 },
|
||||||
|
window: { resizable: true },
|
||||||
actions: {
|
actions: {
|
||||||
reactionRoll: AdversarySheet.#reactionRoll,
|
reactionRoll: AdversarySheet.#reactionRoll,
|
||||||
useItem: this.useItem,
|
useItem: this.useItem,
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) {
|
||||||
/** @inheritdoc */
|
/** @inheritdoc */
|
||||||
static TABS = {
|
static TABS = {
|
||||||
primary: {
|
primary: {
|
||||||
tabs: [{ id: 'description' }, { id: 'actions' }, { id: 'settings' }],
|
tabs: [{ id: 'description' }, { id: 'settings' }, { id: 'actions' }],
|
||||||
initial: 'description',
|
initial: 'description',
|
||||||
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
|
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,13 +31,12 @@ export default class WeaponSheet extends DHBaseItemSheet {
|
||||||
/**@inheritdoc */
|
/**@inheritdoc */
|
||||||
async _preparePartContext(partId, context) {
|
async _preparePartContext(partId, context) {
|
||||||
super._preparePartContext(partId, context);
|
super._preparePartContext(partId, context);
|
||||||
|
|
||||||
switch (partId) {
|
switch (partId) {
|
||||||
case 'settings':
|
case 'settings':
|
||||||
context.features = this.document.system.features.map(x => x.value);
|
context.features = this.document.system.features.map(x => x.value);
|
||||||
|
context.systemFields.attack.fields = this.document.system.attack.schema.fields;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
action =
|
action =
|
||||||
actor.system.attack?._id === actionId
|
actor.system.attack?._id === actionId
|
||||||
? actor.system.attack
|
? actor.system.attack
|
||||||
: item?.system?.actions?.find(a => a._id === actionId);
|
: item.system.attack?._id === actionId
|
||||||
|
? item.system.attack
|
||||||
|
: item?.system?.actions?.find(a => a._id === actionId);
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -158,7 +160,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
const targetSelection = event.target
|
const targetSelection = event.target
|
||||||
.closest('.message-content')
|
.closest('.message-content')
|
||||||
.querySelector('.button-target-selection.target-selected'),
|
.querySelector('.button-target-selection.target-selected'),
|
||||||
isHit = Boolean(targetSelection.dataset.targetHit);
|
isHit = Boolean(targetSelection?.dataset?.targetHit) ?? false;
|
||||||
return {
|
return {
|
||||||
isHit,
|
isHit,
|
||||||
targets: isHit
|
targets: isHit
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,20 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async setCombatantSpotlight(combatantId) {
|
||||||
|
const combatant = this.viewed.combatants.get(combatantId);
|
||||||
|
|
||||||
|
const toggleTurn = this.viewed.combatants.contents
|
||||||
|
.sort(this.viewed._sortCombatants)
|
||||||
|
.map(x => x.id)
|
||||||
|
.indexOf(combatantId);
|
||||||
|
|
||||||
|
if (this.viewed.turn !== toggleTurn) Hooks.callAll(CONFIG.DH.HOOKS.spotlight, {});
|
||||||
|
|
||||||
|
await this.viewed.update({ turn: this.viewed.turn === toggleTurn ? null : toggleTurn });
|
||||||
|
await combatant.update({ 'system.spotlight.requesting': false });
|
||||||
|
}
|
||||||
|
|
||||||
static async requestSpotlight(_, target) {
|
static async requestSpotlight(_, target) {
|
||||||
const { combatantId } = target.closest('[data-combatant-id]')?.dataset ?? {};
|
const { combatantId } = target.closest('[data-combatant-id]')?.dataset ?? {};
|
||||||
const combatant = this.viewed.combatants.get(combatantId);
|
const combatant = this.viewed.combatants.get(combatantId);
|
||||||
|
|
@ -79,17 +93,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
|
||||||
|
|
||||||
static async toggleSpotlight(_, target) {
|
static async toggleSpotlight(_, target) {
|
||||||
const { combatantId } = target.closest('[data-combatant-id]')?.dataset ?? {};
|
const { combatantId } = target.closest('[data-combatant-id]')?.dataset ?? {};
|
||||||
const combatant = this.viewed.combatants.get(combatantId);
|
await this.setCombatantSpotlight(combatantId);
|
||||||
|
|
||||||
const toggleTurn = this.viewed.combatants.contents
|
|
||||||
.sort(this.viewed._sortCombatants)
|
|
||||||
.map(x => x.id)
|
|
||||||
.indexOf(combatantId);
|
|
||||||
|
|
||||||
if (this.viewed.turn !== toggleTurn) Hooks.callAll(CONFIG.DH.HOOKS.spotlight, {});
|
|
||||||
|
|
||||||
await this.viewed.update({ turn: this.viewed.turn === toggleTurn ? null : toggleTurn });
|
|
||||||
await combatant.update({ 'system.spotlight.requesting': false });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static async setActionTokens(_, target) {
|
static async setActionTokens(_, target) {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ class Countdowns extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
get title() {
|
get title() {
|
||||||
return game.i18n.format('DAGGERHEART.APPLICATIONS.Countdown.Title', {
|
return game.i18n.format('DAGGERHEART.APPLICATIONS.Countdown.title', {
|
||||||
type: game.i18n.localize(`DAGGERHEART.APPLICATIONS.Countdown.types.${this.basePath}`)
|
type: game.i18n.localize(`DAGGERHEART.APPLICATIONS.Countdown.types.${this.basePath}`)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { emitAsGM, GMUpdateEvent, socketEvent } from "../../systemRegistration/socket.mjs";
|
||||||
|
|
||||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -96,6 +98,7 @@ export default class FearTracker extends HandlebarsApplicationMixin(ApplicationV
|
||||||
}
|
}
|
||||||
|
|
||||||
static async increaseFear(event, target) {
|
static async increaseFear(event, target) {
|
||||||
|
if (!game.user.isGM) return;
|
||||||
let value = target.dataset.increment ?? 0,
|
let value = target.dataset.increment ?? 0,
|
||||||
operator = value.split('')[0] ?? null;
|
operator = value.split('')[0] ?? null;
|
||||||
value = Number(value);
|
value = Number(value);
|
||||||
|
|
@ -103,8 +106,19 @@ export default class FearTracker extends HandlebarsApplicationMixin(ApplicationV
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateFear(value) {
|
async updateFear(value) {
|
||||||
if (!game.user.isGM) return;
|
return emitAsGM(GMUpdateEvent.UpdateFear, game.settings.set.bind(game.settings, CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear), value);
|
||||||
|
/* if(!game.user.isGM)
|
||||||
|
await game.socket.emit(`system.${CONFIG.DH.id}`, {
|
||||||
|
action: socketEvent.GMUpdate,
|
||||||
|
data: {
|
||||||
|
action: GMUpdateEvent.UpdateFear,
|
||||||
|
update: value
|
||||||
|
}
|
||||||
|
});
|
||||||
|
else
|
||||||
|
game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear, value); */
|
||||||
|
/* if (!game.user.isGM) return;
|
||||||
value = Math.max(0, Math.min(this.maxFear, value));
|
value = Math.max(0, Math.min(this.maxFear, value));
|
||||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear, value);
|
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear, value); */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,12 +58,14 @@ export const damageTypes = {
|
||||||
physical: {
|
physical: {
|
||||||
id: 'physical',
|
id: 'physical',
|
||||||
label: 'DAGGERHEART.CONFIG.DamageType.physical.name',
|
label: 'DAGGERHEART.CONFIG.DamageType.physical.name',
|
||||||
abbreviation: 'DAGGERHEART.CONFIG.DamageType.physical.abbreviation'
|
abbreviation: 'DAGGERHEART.CONFIG.DamageType.physical.abbreviation',
|
||||||
|
icon: ["fa-hand-fist"]
|
||||||
},
|
},
|
||||||
magical: {
|
magical: {
|
||||||
id: 'magical',
|
id: 'magical',
|
||||||
label: 'DAGGERHEART.CONFIG.DamageType.magical.name',
|
label: 'DAGGERHEART.CONFIG.DamageType.magical.name',
|
||||||
abbreviation: 'DAGGERHEART.CONFIG.DamageType.magical.abbreviation'
|
abbreviation: 'DAGGERHEART.CONFIG.DamageType.magical.abbreviation',
|
||||||
|
icon: ["fa-wand-sparkles"]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -344,26 +346,26 @@ export const refreshTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const abilityCosts = {
|
export const abilityCosts = {
|
||||||
|
hp: {
|
||||||
|
id: 'hp',
|
||||||
|
label: 'DAGGERHEART.CONFIG.HealingType.hitPoints.name',
|
||||||
|
group: 'Global'
|
||||||
|
},
|
||||||
|
stress: {
|
||||||
|
id: 'stress',
|
||||||
|
label: 'DAGGERHEART.CONFIG.HealingType.stress.name',
|
||||||
|
group: 'Global'
|
||||||
|
},
|
||||||
hope: {
|
hope: {
|
||||||
id: 'hope',
|
id: 'hope',
|
||||||
label: 'Hope',
|
label: 'Hope',
|
||||||
group: 'TYPES.Actor.character'
|
group: 'TYPES.Actor.character'
|
||||||
},
|
},
|
||||||
stress: {
|
|
||||||
id: 'stress',
|
|
||||||
label: 'DAGGERHEART.CONFIG.HealingType.Stress.Name',
|
|
||||||
group: 'TYPES.Actor.character'
|
|
||||||
},
|
|
||||||
armor: {
|
armor: {
|
||||||
id: 'armor',
|
id: 'armor',
|
||||||
label: 'Armor Stack',
|
label: 'Armor Stack',
|
||||||
group: 'TYPES.Actor.character'
|
group: 'TYPES.Actor.character'
|
||||||
},
|
},
|
||||||
hp: {
|
|
||||||
id: 'hp',
|
|
||||||
label: 'DAGGERHEART.CONFIG.HealingType.HitPoints.Name',
|
|
||||||
group: 'TYPES.Actor.character'
|
|
||||||
},
|
|
||||||
prayer: {
|
prayer: {
|
||||||
id: 'prayer',
|
id: 'prayer',
|
||||||
label: 'Prayer Dice',
|
label: 'Prayer Dice',
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,8 @@ export class DHActionRollData extends foundry.abstract.DataModel {
|
||||||
label: 'Should be'
|
label: 'Should be'
|
||||||
}),
|
}),
|
||||||
treshold: new fields.NumberField({ initial: 1, integer: true, min: 1, label: 'Treshold' })
|
treshold: new fields.NumberField({ initial: 1, integer: true, min: 1, label: 'Treshold' })
|
||||||
})
|
}),
|
||||||
|
useDefault: new fields.BooleanField({ initial: false })
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,7 +48,6 @@ export class DHActionRollData extends foundry.abstract.DataModel {
|
||||||
formula = `${multiplier}${this.diceRolling.dice}cs${CONFIG.DH.ACTIONS.diceCompare[this.diceRolling.compare].operator}${this.diceRolling.treshold}`;
|
formula = `${multiplier}${this.diceRolling.dice}cs${CONFIG.DH.ACTIONS.diceCompare[this.diceRolling.compare].operator}${this.diceRolling.treshold}`;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// formula = `${(!!this.parent?.actor?.system?.attack ? `@attackBonus` : `@traits.${this.trait}.total`)}`;
|
|
||||||
formula = '';
|
formula = '';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,15 @@ export default class DHAttackAction extends DHDamageAction {
|
||||||
|
|
||||||
prepareData() {
|
prepareData() {
|
||||||
super.prepareData();
|
super.prepareData();
|
||||||
if (this.damage.includeBase && !!this.item?.system?.damage) {
|
if(!!this.item?.system?.attack) {
|
||||||
const baseDamage = this.getParentDamage();
|
if (this.damage.includeBase) {
|
||||||
this.damage.parts.unshift(new DHDamageData(baseDamage));
|
const baseDamage = this.getParentDamage();
|
||||||
|
this.damage.parts.unshift(new DHDamageData(baseDamage));
|
||||||
|
}
|
||||||
|
if(this.roll.useDefault) {
|
||||||
|
this.roll.trait = this.item.system.attack.roll.trait;
|
||||||
|
this.roll.type = 'weapon';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -24,10 +30,10 @@ export default class DHAttackAction extends DHDamageAction {
|
||||||
return {
|
return {
|
||||||
value: {
|
value: {
|
||||||
multiplier: 'prof',
|
multiplier: 'prof',
|
||||||
dice: this.item?.system?.damage.dice,
|
dice: this.item?.system?.attack.damage.parts[0].value.dice,
|
||||||
bonus: this.item?.system?.damage.bonus ?? 0
|
bonus: this.item?.system?.attack.damage.parts[0].value.bonus ?? 0
|
||||||
},
|
},
|
||||||
type: this.item?.system?.damage.type,
|
type: this.item?.system?.attack.damage.parts[0].type,
|
||||||
base: true
|
base: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,10 @@ const fields = foundry.data.fields;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ToDo
|
ToDo
|
||||||
- Add setting and/or checkbox for cost and damage like
|
|
||||||
- Target Check / Target Picker
|
- Target Check / Target Picker
|
||||||
- Range Check
|
- Range Check
|
||||||
- Area of effect and measurement placement
|
- Area of effect and measurement placement
|
||||||
- Summon Action create method
|
- Summon Action create method
|
||||||
|
|
||||||
Other
|
|
||||||
- Auto use action <= Into Roll
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default class DHBaseAction extends foundry.abstract.DataModel {
|
export default class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
|
|
@ -160,17 +156,22 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
static getSourceConfig(parent) {
|
static getSourceConfig(parent) {
|
||||||
const updateSource = {};
|
const updateSource = {};
|
||||||
updateSource.img ??= parent?.img ?? parent?.system?.img;
|
updateSource.img ??= parent?.img ?? parent?.system?.img;
|
||||||
if (parent?.system?.trait) {
|
if (parent?.type === 'weapon') {
|
||||||
updateSource['roll'] = {
|
|
||||||
type: this.getRollType(parent),
|
|
||||||
trait: parent.system.trait
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (parent?.type === 'weapon' && !!this.schema.fields.damage) {
|
|
||||||
updateSource['damage'] = { includeBase: true };
|
updateSource['damage'] = { includeBase: true };
|
||||||
}
|
updateSource['range'] = parent?.system?.attack?.range;
|
||||||
if (parent?.system?.range) {
|
updateSource['roll'] = {
|
||||||
updateSource['range'] = parent?.system?.range;
|
useDefault: true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (parent?.system?.trait) {
|
||||||
|
updateSource['roll'] = {
|
||||||
|
type: this.getRollType(parent),
|
||||||
|
trait: parent.system.trait
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (parent?.system?.range) {
|
||||||
|
updateSource['range'] = parent?.system?.range;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return updateSource;
|
return updateSource;
|
||||||
}
|
}
|
||||||
|
|
@ -200,28 +201,23 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
const isFastForward = event.shiftKey || (!this.hasRoll && !this.hasSave);
|
const isFastForward = event.shiftKey || (!this.hasRoll && !this.hasSave);
|
||||||
// Prepare base Config
|
// Prepare base Config
|
||||||
const initConfig = this.initActionConfig(event);
|
const initConfig = this.initActionConfig(event);
|
||||||
// let config = this.initActionConfig(event);
|
|
||||||
|
|
||||||
// Prepare Targets
|
// Prepare Targets
|
||||||
const targetConfig = this.prepareTarget();
|
const targetConfig = this.prepareTarget();
|
||||||
if (isFastForward && !targetConfig) return ui.notifications.warn('Too many targets selected for that actions.');
|
if (isFastForward && !targetConfig) return ui.notifications.warn('Too many targets selected for that actions.');
|
||||||
// config = this.prepareTarget(config);
|
|
||||||
|
|
||||||
// Prepare Range
|
// Prepare Range
|
||||||
const rangeConfig = this.prepareRange();
|
const rangeConfig = this.prepareRange();
|
||||||
// config = this.prepareRange(config);
|
|
||||||
|
|
||||||
// Prepare Costs
|
// Prepare Costs
|
||||||
const costsConfig = this.prepareCost();
|
const costsConfig = this.prepareCost();
|
||||||
if (isFastForward && !this.hasCost(costsConfig))
|
if (isFastForward && !this.hasCost(costsConfig))
|
||||||
return ui.notifications.warn("You don't have the resources to use that action.");
|
return ui.notifications.warn("You don't have the resources to use that action.");
|
||||||
// config = this.prepareUseCost(config)
|
|
||||||
|
|
||||||
// Prepare Uses
|
// Prepare Uses
|
||||||
const usesConfig = this.prepareUse();
|
const usesConfig = this.prepareUse();
|
||||||
if (isFastForward && !this.hasUses(usesConfig))
|
if (isFastForward && !this.hasUses(usesConfig))
|
||||||
return ui.notifications.warn("That action doesn't have remaining uses.");
|
return ui.notifications.warn("That action doesn't have remaining uses.");
|
||||||
// config = this.prepareUseCost(config)
|
|
||||||
|
|
||||||
// Prepare Roll Data
|
// Prepare Roll Data
|
||||||
const actorData = this.getRollData();
|
const actorData = this.getRollData();
|
||||||
|
|
@ -238,8 +234,9 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
if (Hooks.call(`${CONFIG.DH.id}.preUseAction`, this, config) === false) return;
|
if (Hooks.call(`${CONFIG.DH.id}.preUseAction`, this, config) === false) return;
|
||||||
|
|
||||||
// Display configuration window if necessary
|
// Display configuration window if necessary
|
||||||
if (config.dialog?.configure && this.requireConfigurationDialog(config)) {
|
// if (config.dialog?.configure && this.requireConfigurationDialog(config)) {
|
||||||
config = await D20RollDialog.configure(config);
|
if (this.requireConfigurationDialog(config)) {
|
||||||
|
config = await D20RollDialog.configure(null, config);
|
||||||
if (!config) return;
|
if (!config) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -250,37 +247,6 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
if (!config) return;
|
if (!config) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasSave) {
|
|
||||||
/* config.targets.forEach((t) => {
|
|
||||||
if(t.hit) {
|
|
||||||
const target = game.canvas.tokens.get(t.id),
|
|
||||||
actor = target?.actor;
|
|
||||||
if(!actor) return;
|
|
||||||
actor.saveRoll({
|
|
||||||
event,
|
|
||||||
title: 'Roll Save',
|
|
||||||
roll: {
|
|
||||||
trait: this.save.trait,
|
|
||||||
difficulty: this.save.difficulty
|
|
||||||
},
|
|
||||||
dialog: {
|
|
||||||
configure: false
|
|
||||||
},
|
|
||||||
data: actor.getRollData()
|
|
||||||
}).then(async (result) => {
|
|
||||||
t.saved = result;
|
|
||||||
setTimeout(async () => {
|
|
||||||
const message = ui.chat.collection.get(config.message.id),
|
|
||||||
msgTargets = message.system.targets,
|
|
||||||
msgTarget = msgTargets.find(mt => mt.id === t.id);
|
|
||||||
msgTarget.saved = result;
|
|
||||||
await message.update({'system.targets': msgTargets});
|
|
||||||
},100)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}) */
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.doFollowUp()) {
|
if (this.doFollowUp()) {
|
||||||
if (this.rollDamage) await this.rollDamage(event, config);
|
if (this.rollDamage) await this.rollDamage(event, config);
|
||||||
if (this.rollHealing) await this.rollHealing(event, config);
|
if (this.rollHealing) await this.rollHealing(event, config);
|
||||||
|
|
@ -329,12 +295,12 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareTarget() {
|
prepareTarget() {
|
||||||
|
if(!this.target?.type) return [];
|
||||||
let targets;
|
let targets;
|
||||||
if (this.target?.type === CONFIG.DH.ACTIONS.targetTypes.self.id)
|
if (this.target?.type === CONFIG.DH.ACTIONS.targetTypes.self.id)
|
||||||
targets = this.constructor.formatTarget(this.actor.token ?? this.actor.prototypeToken);
|
targets = this.constructor.formatTarget(this.actor.token ?? this.actor.prototypeToken);
|
||||||
targets = Array.from(game.user.targets);
|
targets = Array.from(game.user.targets);
|
||||||
// foundry.CONST.TOKEN_DISPOSITIONS.FRIENDLY
|
if (this.target.type !== CONFIG.DH.ACTIONS.targetTypes.any.id) {
|
||||||
if (this.target?.type && this.target.type !== CONFIG.DH.ACTIONS.targetTypes.any.id) {
|
|
||||||
targets = targets.filter(t => this.isTargetFriendly(t));
|
targets = targets.filter(t => this.isTargetFriendly(t));
|
||||||
if (this.target.amount && targets.length > this.target.amount) targets = [];
|
if (this.target.amount && targets.length > this.target.amount) targets = [];
|
||||||
}
|
}
|
||||||
|
|
@ -540,6 +506,7 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/* SAVE */
|
||||||
|
|
||||||
async updateChatMessage(message, targetId, changes, chain = true) {
|
async updateChatMessage(message, targetId, changes, chain = true) {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
|
|
@ -558,7 +525,6 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* SAVE */
|
|
||||||
|
|
||||||
async toChat(origin) {
|
async toChat(origin) {
|
||||||
const cls = getDocumentClass('ChatMessage');
|
const cls = getDocumentClass('ChatMessage');
|
||||||
|
|
|
||||||
|
|
@ -3,38 +3,16 @@ import DHBaseAction from './baseAction.mjs';
|
||||||
export default class DHEffectAction extends DHBaseAction {
|
export default class DHEffectAction extends DHBaseAction {
|
||||||
static extraSchemas = ['effects', 'target'];
|
static extraSchemas = ['effects', 'target'];
|
||||||
|
|
||||||
async use(event, ...args) {
|
async trigger(event, data) {
|
||||||
const config = await super.use(event, args);
|
if(this.effects.length) {
|
||||||
if (['error', 'warning'].includes(config.type)) return;
|
const cls = getDocumentClass('ChatMessage'),
|
||||||
return await this.chatApplyEffects(event, config);
|
msg = {
|
||||||
}
|
type: 'applyEffect',
|
||||||
|
user: game.user.id,
|
||||||
|
system: data
|
||||||
|
};
|
||||||
|
|
||||||
async chatApplyEffects(event, data) {
|
return await cls.create(msg);
|
||||||
const cls = getDocumentClass('ChatMessage'),
|
} else this.toChat(this.id);
|
||||||
systemData = {
|
|
||||||
title: game.i18n.format('DAGGERHEART.UI.Chat.applyEffect.title', { name: this.name }),
|
|
||||||
origin: this.actor._id,
|
|
||||||
description: '',
|
|
||||||
targets: data.targets.map(x => ({ id: x.id, name: x.name, img: x.img, hit: true })),
|
|
||||||
action: {
|
|
||||||
itemId: this.item._id,
|
|
||||||
actionId: this._id
|
|
||||||
}
|
|
||||||
},
|
|
||||||
msg = new cls({
|
|
||||||
type: 'applyEffect',
|
|
||||||
user: game.user.id,
|
|
||||||
system: systemData,
|
|
||||||
content: await foundry.applications.handlebars.renderTemplate(
|
|
||||||
'systems/daggerheart/templates/ui/chat/apply-effects.hbs',
|
|
||||||
systemData
|
|
||||||
)
|
|
||||||
});
|
|
||||||
|
|
||||||
cls.create(msg.toObject());
|
|
||||||
}
|
|
||||||
|
|
||||||
get chatTemplate() {
|
|
||||||
return 'systems/daggerheart/templates/ui/chat/apply-effects.hbs';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,9 @@ export default class DhpAdversary extends BaseDataActor {
|
||||||
damage: {
|
damage: {
|
||||||
parts: [
|
parts: [
|
||||||
{
|
{
|
||||||
multiplier: 'flat'
|
value: {
|
||||||
|
multiplier: 'flat'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
|
import DHBaseAction from "../action/baseAction.mjs";
|
||||||
|
|
||||||
export default class DHApplyEffect extends foundry.abstract.TypeDataModel {
|
export default class DHApplyEffect extends foundry.abstract.TypeDataModel {
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: new fields.StringField(),
|
title: new fields.StringField(),
|
||||||
origin: new fields.StringField({}),
|
|
||||||
description: new fields.StringField({}),
|
|
||||||
targets: new fields.ArrayField(
|
targets: new fields.ArrayField(
|
||||||
new fields.SchemaField({
|
new fields.SchemaField({
|
||||||
id: new fields.StringField({ required: true }),
|
id: new fields.StringField({ required: true }),
|
||||||
|
|
@ -14,10 +14,24 @@ export default class DHApplyEffect extends foundry.abstract.TypeDataModel {
|
||||||
hit: new fields.BooleanField({ initial: false })
|
hit: new fields.BooleanField({ initial: false })
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
action: new fields.SchemaField({
|
targetSelection: new fields.BooleanField({ initial: true }),
|
||||||
itemId: new fields.StringField(),
|
source: new fields.SchemaField({
|
||||||
actionId: new fields.StringField()
|
actor: new fields.StringField(),
|
||||||
|
item: new fields.StringField(),
|
||||||
|
action: new fields.StringField()
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prepareDerivedData() {
|
||||||
|
this.hasHitTarget = this.targets.filter(t => t.hit === true).length > 0;
|
||||||
|
this.currentTargets =
|
||||||
|
this.targetSelection !== true
|
||||||
|
? Array.from(game.user.targets).map(t => DHBaseAction.formatTarget(t))
|
||||||
|
: this.targets;
|
||||||
|
}
|
||||||
|
|
||||||
|
get messageTemplate() {
|
||||||
|
return 'systems/daggerheart/templates/ui/chat/apply-effects.hbs';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
import { actionsTypes } from '../action/_module.mjs';
|
|
||||||
|
|
||||||
// Temporary Solution
|
|
||||||
export default class ActionField extends foundry.data.fields.ObjectField {
|
export default class ActionField extends foundry.data.fields.ObjectField {
|
||||||
getModel(value) {
|
getModel(value) {
|
||||||
return actionsTypes[value.type] ?? actionsTypes.attack;
|
return game.system.api.models.actions.actionsTypes[value.type] ?? game.system.api.models.actions.actionsTypes.attack;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
||||||
return this.parent.actor;
|
return this.parent.actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get actionsList() {
|
||||||
|
return this.actions;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain a data object used to evaluate any dice rolls associated with this Item Type
|
* Obtain a data object used to evaluate any dice rolls associated with this Item Type
|
||||||
* @param {object} [options] - Options which modify the getRollData method.
|
* @param {object} [options] - Options which modify the getRollData method.
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ export default class DHWeapon extends BaseDataItem {
|
||||||
hasDescription: true,
|
hasDescription: true,
|
||||||
isQuantifiable: true,
|
isQuantifiable: true,
|
||||||
isInventoryItem: true,
|
isInventoryItem: true,
|
||||||
hasInitialAction: true
|
// hasInitialAction: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -25,19 +25,8 @@ export default class DHWeapon extends BaseDataItem {
|
||||||
|
|
||||||
//SETTINGS
|
//SETTINGS
|
||||||
secondary: new fields.BooleanField({ initial: false }),
|
secondary: new fields.BooleanField({ initial: false }),
|
||||||
trait: new fields.StringField({ required: true, choices: CONFIG.DH.ACTOR.abilities, initial: 'agility' }),
|
|
||||||
range: new fields.StringField({ required: true, choices: CONFIG.DH.GENERAL.range, initial: 'melee' }),
|
|
||||||
burden: new fields.StringField({ required: true, choices: CONFIG.DH.GENERAL.burden, initial: 'oneHanded' }),
|
burden: new fields.StringField({ required: true, choices: CONFIG.DH.GENERAL.burden, initial: 'oneHanded' }),
|
||||||
//DAMAGE
|
|
||||||
damage: new fields.SchemaField({
|
|
||||||
dice: new fields.StringField({ choices: CONFIG.DH.GENERAL.diceTypes, initial: 'd6' }),
|
|
||||||
bonus: new fields.NumberField({ nullable: true, initial: null }),
|
|
||||||
type: new fields.StringField({
|
|
||||||
required: true,
|
|
||||||
choices: CONFIG.DH.GENERAL.damageTypes,
|
|
||||||
initial: 'physical'
|
|
||||||
})
|
|
||||||
}),
|
|
||||||
features: new fields.ArrayField(
|
features: new fields.ArrayField(
|
||||||
new fields.SchemaField({
|
new fields.SchemaField({
|
||||||
value: new fields.StringField({
|
value: new fields.StringField({
|
||||||
|
|
@ -49,10 +38,42 @@ export default class DHWeapon extends BaseDataItem {
|
||||||
actionIds: new fields.ArrayField(new fields.StringField({ required: true }))
|
actionIds: new fields.ArrayField(new fields.StringField({ required: true }))
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
|
attack: new ActionField({
|
||||||
|
initial: {
|
||||||
|
name: 'Attack',
|
||||||
|
img: 'icons/skills/melee/blood-slash-foam-red.webp',
|
||||||
|
_id: foundry.utils.randomID(),
|
||||||
|
systemPath: 'attack',
|
||||||
|
type: 'attack',
|
||||||
|
range: 'melee',
|
||||||
|
target: {
|
||||||
|
type: 'any',
|
||||||
|
amount: 1
|
||||||
|
},
|
||||||
|
roll: {
|
||||||
|
trait: 'agility',
|
||||||
|
type: 'weapon'
|
||||||
|
},
|
||||||
|
damage: {
|
||||||
|
parts: [
|
||||||
|
{
|
||||||
|
value: {
|
||||||
|
multiplier: 'prof',
|
||||||
|
dice: "d8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}),
|
||||||
actions: new fields.ArrayField(new ActionField())
|
actions: new fields.ArrayField(new ActionField())
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get actionsList() {
|
||||||
|
return [this.attack, ...this.actions];
|
||||||
|
}
|
||||||
|
|
||||||
async _preUpdate(changes, options, user) {
|
async _preUpdate(changes, options, user) {
|
||||||
const allowed = await super._preUpdate(changes, options, user);
|
const allowed = await super._preUpdate(changes, options, user);
|
||||||
if (allowed === false) return false;
|
if (allowed === false) return false;
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,21 @@ export default class DhAutomation extends foundry.abstract.DataModel {
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
return {
|
return {
|
||||||
hope: new fields.BooleanField({ required: true, initial: false }),
|
hope: new fields.BooleanField({
|
||||||
actionPoints: new fields.BooleanField({ required: true, initial: false }),
|
required: true,
|
||||||
countdowns: new fields.BooleanField({ requireD: true, initial: false })
|
initial: false,
|
||||||
|
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.hope.label'
|
||||||
|
}), // Label need to be updated into something like "Duality Roll Auto Gain" + a hint
|
||||||
|
actionPoints: new fields.BooleanField({
|
||||||
|
required: true,
|
||||||
|
initial: false,
|
||||||
|
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.actionPoints.label'
|
||||||
|
}),
|
||||||
|
countdowns: new fields.BooleanField({
|
||||||
|
requireD: true,
|
||||||
|
initial: false,
|
||||||
|
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.countdowns.label'
|
||||||
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export default class DHRoll extends Roll {
|
||||||
}
|
}
|
||||||
|
|
||||||
static async buildConfigure(config = {}, message = {}) {
|
static async buildConfigure(config = {}, message = {}) {
|
||||||
config.hooks = [...(config.hooks ?? []), ''];
|
config.hooks = [...this.getHooks(), ''];
|
||||||
config.dialog ??= {};
|
config.dialog ??= {};
|
||||||
for (const hook of config.hooks) {
|
for (const hook of config.hooks) {
|
||||||
if (Hooks.call(`${CONFIG.DH.id}.preRoll${hook.capitalize()}`, config, message) === false) return null;
|
if (Hooks.call(`${CONFIG.DH.id}.preRoll${hook.capitalize()}`, config, message) === false) return null;
|
||||||
|
|
@ -94,6 +94,10 @@ export default class DHRoll extends Roll {
|
||||||
config.dialog.configure ??= !(config.event.shiftKey || config.event.altKey || config.event.ctrlKey);
|
config.dialog.configure ??= !(config.event.shiftKey || config.event.altKey || config.event.ctrlKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getHooks(hooks) {
|
||||||
|
return hooks ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
formatModifier(modifier) {
|
formatModifier(modifier) {
|
||||||
const numTerm = modifier < 0 ? '-' : '+';
|
const numTerm = modifier < 0 ? '-' : '+';
|
||||||
return [
|
return [
|
||||||
|
|
@ -131,3 +135,32 @@ export default class DHRoll extends Roll {
|
||||||
return modifierTotal;
|
return modifierTotal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const registerRollDiceHooks = () => {
|
||||||
|
Hooks.on(`${CONFIG.DH.id}.postRollDuality`, async (config, message) => {
|
||||||
|
if (
|
||||||
|
!game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).hope ||
|
||||||
|
config.roll.type === 'reaction'
|
||||||
|
)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const actor = await fromUuid(config.source.actor),
|
||||||
|
updates = [];
|
||||||
|
if (!actor) return;
|
||||||
|
if (config.roll.isCritical || config.roll.result.duality === 1) updates.push({ type: 'hope', value: 1 });
|
||||||
|
if (config.roll.isCritical) updates.push({ type: 'stress', value: -1 });
|
||||||
|
if (config.roll.result.duality === -1) updates.push({ type: 'fear', value: 1 });
|
||||||
|
|
||||||
|
if (updates.length) actor.modifyResource(updates);
|
||||||
|
|
||||||
|
if (!config.roll.hasOwnProperty('success') && !config.targets.length) return;
|
||||||
|
|
||||||
|
const rollResult = config.roll.success || config.targets.some(t => t.hit),
|
||||||
|
looseSpotlight = !rollResult || config.roll.result.duality === -1;
|
||||||
|
|
||||||
|
if (looseSpotlight && game.combat?.active) {
|
||||||
|
const currentCombatant = game.combat.combatants.get(game.combat.current?.combatantId);
|
||||||
|
if (currentCombatant?.actorId == actor.id) ui.combat.setCombatantSpotlight(currentCombatant.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,10 @@ export default class DualityRoll extends D20Roll {
|
||||||
return game.i18n.localize(label);
|
return game.i18n.localize(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateFormula() {}
|
static getHooks(hooks) {
|
||||||
|
|
||||||
|
return [...(hooks ?? []), 'Duality'];
|
||||||
|
}
|
||||||
|
|
||||||
createBaseDice() {
|
createBaseDice() {
|
||||||
if (
|
if (
|
||||||
|
|
|
||||||
|
|
@ -77,10 +77,10 @@ export default class DHItem extends foundry.documents.Item {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectActionDialog() {
|
async selectActionDialog(prevEvent) {
|
||||||
const content = await foundry.applications.handlebars.renderTemplate(
|
const content = await foundry.applications.handlebars.renderTemplate(
|
||||||
'systems/daggerheart/templates/dialogs/actionSelect.hbs',
|
'systems/daggerheart/templates/dialogs/actionSelect.hbs',
|
||||||
{ actions: this.system.actions }
|
{ actions: this.system.actionsList }
|
||||||
),
|
),
|
||||||
title = 'Select Action';
|
title = 'Select Action';
|
||||||
|
|
||||||
|
|
@ -89,19 +89,23 @@ export default class DHItem extends foundry.documents.Item {
|
||||||
content,
|
content,
|
||||||
ok: {
|
ok: {
|
||||||
label: title,
|
label: title,
|
||||||
callback: (event, button, dialog) =>
|
callback: (event, button, dialog) => {
|
||||||
this.system.actions.find(a => a._id === button.form.elements.actionId.value)
|
Object.defineProperty(prevEvent, "shiftKey", {
|
||||||
|
get() { return event.shiftKey; },
|
||||||
|
});
|
||||||
|
return this.system.actionsList.find(a => a._id === button.form.elements.actionId.value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async use(event) {
|
async use(event) {
|
||||||
const actions = this.system.actions;
|
const actions = this.system.actionsList;
|
||||||
if (actions?.length) {
|
if (actions?.length) {
|
||||||
let action = actions[0];
|
let action = actions[0];
|
||||||
if (actions.length > 1 && !event?.shiftKey) {
|
if (actions.length > 1 && !event?.shiftKey) {
|
||||||
// Actions Choice Dialog
|
// Actions Choice Dialog
|
||||||
action = await this.selectActionDialog();
|
action = await this.selectActionDialog(event);
|
||||||
}
|
}
|
||||||
if (action) return action.use(event);
|
if (action) return action.use(event);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,20 +39,16 @@ export const registerSocketHooks = () => {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GMUpdateEvent.UpdateSetting:
|
case GMUpdateEvent.UpdateSetting:
|
||||||
if (game.user.isGM) {
|
await game.settings.set(CONFIG.DH.id, data.uuid, data.update);
|
||||||
await game.settings.set(CONFIG.DH.id, data.uuid, data.update);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case GMUpdateEvent.UpdateFear:
|
case GMUpdateEvent.UpdateFear:
|
||||||
if (game.user.isGM) {
|
await game.settings.set(
|
||||||
await game.settings.set(
|
CONFIG.DH.id,
|
||||||
CONFIG.DH.id,
|
CONFIG.DH.SETTINGS.gameSettings.Resources.Fear,
|
||||||
CONFIG.DH.SETTINGS.gameSettings.Resources.Fear,
|
Math.max(0, Math.min(game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxFear, data.update))
|
||||||
Math.max(Math.min(data.update, 6), 0)
|
);
|
||||||
);
|
/* Hooks.callAll(socketEvent.DhpFearUpdate);
|
||||||
Hooks.callAll(socketEvent.DhpFearUpdate);
|
await game.socket.emit(`system.${CONFIG.DH.id}`, { action: socketEvent.DhpFearUpdate }); */
|
||||||
await game.socket.emit(`system.${CONFIG.DH.id}`, { action: socketEvent.DhpFearUpdate });
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,3 +62,22 @@ export const registerSocketHooks = () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const emitAsGM = async (eventName, callback, args) => {
|
||||||
|
if(!game.user.isGM) {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
try {
|
||||||
|
const response = await game.socket.emit(`system.${CONFIG.DH.id}`, {
|
||||||
|
action: socketEvent.GMUpdate,
|
||||||
|
data: {
|
||||||
|
action: eventName,
|
||||||
|
update: args
|
||||||
|
}
|
||||||
|
});
|
||||||
|
resolve(response);
|
||||||
|
} catch (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else return callback(args);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -4069,10 +4069,11 @@ body.theme-light.application.daggerheart .character-sidebar-sheet .experience-va
|
||||||
.application.sheet.daggerheart.actor.dh-style.character .window-content {
|
.application.sheet.daggerheart.actor.dh-style.character .window-content {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 275px 1fr;
|
grid-template-columns: 275px 1fr;
|
||||||
grid-template-rows: 283px 1fr;
|
grid-template-rows: auto 1fr;
|
||||||
gap: 15px 0;
|
gap: 15px 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
.application.sheet.daggerheart.actor.dh-style.character .window-content .character-sidebar-sheet {
|
.application.sheet.daggerheart.actor.dh-style.character .window-content .character-sidebar-sheet {
|
||||||
grid-row: 1 / span 2;
|
grid-row: 1 / span 2;
|
||||||
|
|
@ -4313,7 +4314,7 @@ body.theme-light.application.daggerheart .character-sidebar-sheet .experience-va
|
||||||
.application.sheet.daggerheart.actor.dh-style.adversary .window-content {
|
.application.sheet.daggerheart.actor.dh-style.adversary .window-content {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 275px 1fr;
|
grid-template-columns: 275px 1fr;
|
||||||
grid-template-rows: 283px 1fr;
|
grid-template-rows: auto 1fr;
|
||||||
gap: 15px 0;
|
gap: 15px 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -5775,10 +5776,14 @@ body.theme-light.application.daggerheart.dialog {
|
||||||
outline: 2px solid light-dark(#222, #efe6d8);
|
outline: 2px solid light-dark(#222, #efe6d8);
|
||||||
}
|
}
|
||||||
.application.dh-style fieldset[disabled],
|
.application.dh-style fieldset[disabled],
|
||||||
|
.application.dh-style fieldset.child-disabled .form-group,
|
||||||
.application.dh-style fieldset select[disabled],
|
.application.dh-style fieldset select[disabled],
|
||||||
.application.dh-style fieldset input[disabled] {
|
.application.dh-style fieldset input[disabled] {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
.application.dh-style fieldset.child-disabled .form-group {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
.application.dh-style fieldset .nest-inputs {
|
.application.dh-style fieldset .nest-inputs {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -6383,6 +6388,7 @@ body.theme-light.application.daggerheart.dialog {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
gap: 4px;
|
||||||
}
|
}
|
||||||
.application.daggerheart.dh-style .inventory-item .controls {
|
.application.daggerheart.dh-style .inventory-item .controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
.window-content {
|
.window-content {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 275px 1fr;
|
grid-template-columns: 275px 1fr;
|
||||||
grid-template-rows: 283px 1fr;
|
grid-template-rows: auto 1fr;
|
||||||
gap: 15px 0;
|
gap: 15px 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,11 @@
|
||||||
.window-content {
|
.window-content {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 275px 1fr;
|
grid-template-columns: 275px 1fr;
|
||||||
grid-template-rows: 283px 1fr;
|
grid-template-rows: auto 1fr;
|
||||||
gap: 15px 0;
|
gap: 15px 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
.character-sidebar-sheet {
|
.character-sidebar-sheet {
|
||||||
grid-row: 1 / span 2;
|
grid-row: 1 / span 2;
|
||||||
|
|
|
||||||
|
|
@ -214,11 +214,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&[disabled],
|
&[disabled],
|
||||||
|
&.child-disabled .form-group,
|
||||||
select[disabled],
|
select[disabled],
|
||||||
input[disabled] {
|
input[disabled] {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.child-disabled .form-group {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
.nest-inputs {
|
.nest-inputs {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
gap: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,20 +4,20 @@
|
||||||
Damage
|
Damage
|
||||||
{{#unless (eq path 'system.attack.')}}<a><i class="fa-solid fa-plus icon-button" data-action="addDamage"></i></a>{{/unless}}
|
{{#unless (eq path 'system.attack.')}}<a><i class="fa-solid fa-plus icon-button" data-action="addDamage"></i></a>{{/unless}}
|
||||||
</legend>
|
</legend>
|
||||||
{{#unless @root.isNPC}}
|
{{#unless (or @root.isNPC path)}}
|
||||||
{{#if @root.hasBaseDamage}}
|
{{#if @root.hasBaseDamage}}
|
||||||
{{formField @root.fields.damage.fields.includeBase value=@root.source.damage.includeBase label="Include Item Damage" name="damage.includeBase" classes="checkbox" }}
|
{{formField @root.fields.damage.fields.includeBase value=@root.source.damage.includeBase label="Include Item Damage" name="damage.includeBase" classes="checkbox" }}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{#each source.parts as |dmg index|}}
|
{{#each source.parts as |dmg index|}}
|
||||||
{{#if @root.isNPC}}
|
{{#if (or @root.isNPC ../path)}}
|
||||||
{{formField ../fields.value.fields.custom.fields.enabled value=dmg.value.custom.enabled name=(concat ../path "damage.parts." index ".value.custom.enabled") classes="checkbox"}}
|
{{formField ../fields.value.fields.custom.fields.enabled value=dmg.value.custom.enabled name=(concat ../path "damage.parts." index ".value.custom.enabled") classes="checkbox"}}
|
||||||
<input type="hidden" name="{{../path}}damage.parts.{{index}}.value.multiplier" value="{{dmg.value.multiplier}}">
|
<input type="hidden" name="{{../path}}damage.parts.{{index}}.value.multiplier" value="{{dmg.value.multiplier}}">
|
||||||
{{#if dmg.value.custom.enabled}}
|
{{#if dmg.value.custom.enabled}}
|
||||||
{{formField ../fields.value.fields.custom.fields.formula value=dmg.value.custom.formula name=(concat ../path "damage.parts." index ".value.custom.formula") localize=true}}
|
{{formField ../fields.value.fields.custom.fields.formula value=dmg.value.custom.formula name=(concat ../path "damage.parts." index ".value.custom.formula") localize=true}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="nest-inputs">
|
<div class="nest-inputs">
|
||||||
{{formField ../fields.value.fields.flatMultiplier value=dmg.value.flatMultiplier name=(concat ../path "damage.parts." index ".value.flatMultiplier") label="Multiplier" classes="inline-child" }}
|
{{#if @root.isNPC}}{{formField ../fields.value.fields.flatMultiplier value=dmg.value.flatMultiplier name=(concat ../path "damage.parts." index ".value.flatMultiplier") label="Multiplier" classes="inline-child" }}{{/if}}
|
||||||
{{formField ../fields.value.fields.dice value=dmg.value.dice name=(concat ../path "damage.parts." index ".value.dice") classes="inline-child"}}
|
{{formField ../fields.value.fields.dice value=dmg.value.dice name=(concat ../path "damage.parts." index ".value.dice") classes="inline-child"}}
|
||||||
{{formField ../fields.value.fields.bonus value=dmg.value.bonus name=(concat ../path "damage.parts." index ".value.bonus") localize=true classes="inline-child"}}
|
{{formField ../fields.value.fields.bonus value=dmg.value.bonus name=(concat ../path "damage.parts." index ".value.bonus") localize=true classes="inline-child"}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
0
templates/actionTypes/part/damage-part.hbs
Normal file
0
templates/actionTypes/part/damage-part.hbs
Normal file
|
|
@ -1,5 +1,8 @@
|
||||||
<fieldset class="one-column">
|
<fieldset class="one-column{{#if source.useDefault}} child-disabled{{/if}}">
|
||||||
<legend>Roll</legend>
|
<legend>
|
||||||
|
Roll
|
||||||
|
{{#if @root.hasBaseDamage}}{{formInput fields.useDefault name="roll.useDefault" value=source.useDefault dataset=(object tooltip="Use default Item values" tooltipDirection="UP")}}{{/if}}
|
||||||
|
</legend>
|
||||||
{{#if @root.isNPC}}
|
{{#if @root.isNPC}}
|
||||||
{{formField fields.bonus label="Bonus" name="roll.bonus" value=source.bonus}}
|
{{formField fields.bonus label="Bonus" name="roll.bonus" value=source.bonus}}
|
||||||
{{formField fields.advState label= "Advantage State" name="roll.advState" value=source.advState localize=true}}
|
{{formField fields.advState label= "Advantage State" name="roll.advState" value=source.advState localize=true}}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<div>
|
<div>
|
||||||
{{#if @root.hasRoll}}
|
|
||||||
<div class="roll-dialog-container">
|
<div class="roll-dialog-container">
|
||||||
|
{{#if @root.hasRoll}}
|
||||||
{{#unless @root.isLite}}
|
{{#unless @root.isLite}}
|
||||||
<div class="dices-section">
|
<div class="dices-section">
|
||||||
{{#if (eq @root.rollType 'D20Roll')}}
|
{{#if (eq @root.rollType 'D20Roll')}}
|
||||||
|
|
@ -121,6 +121,10 @@
|
||||||
<i class="fa-solid fa-dice"></i>
|
<i class="fa-solid fa-dice"></i>
|
||||||
<span class="label">Roll</span>
|
<span class="label">Roll</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
{{else}}
|
||||||
|
<button class="sunmit-btn" data-action="submitRoll"{{#unless canRoll}} disabled{{/unless}}>
|
||||||
|
<span class="label">Continue</span>
|
||||||
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,22 +1,7 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="form-group">
|
{{formGroup settingFields.schema.fields.hope value=settingFields._source.hope localize=true}}
|
||||||
<label>{{localize "DAGGERHEART.SETTINGS.Automation.FIELDS.hope.label"}}</label>
|
{{formGroup settingFields.schema.fields.actionPoints value=settingFields._source.actionPoints localize=true}}
|
||||||
<div class="form-fields">
|
{{formGroup settingFields.schema.fields.countdowns value=settingFields._source.countdowns localize=true}}
|
||||||
{{formInput settingFields.schema.fields.hope value=settingFields._source.hope }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>{{localize "DAGGERHEART.SETTINGS.Automation.FIELDS.actionPoints.label"}}</label>
|
|
||||||
<div class="form-fields">
|
|
||||||
{{formInput settingFields.schema.fields.actionPoints value=settingFields._source.actionPoints }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>{{localize "DAGGERHEART.SETTINGS.Automation.FIELDS.countdowns.label"}}</label>
|
|
||||||
<div class="form-fields">
|
|
||||||
{{formInput settingFields.schema.fields.countdowns value=settingFields._source.countdowns }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer class="form-footer">
|
<footer class="form-footer">
|
||||||
<button data-action="reset">
|
<button data-action="reset">
|
||||||
|
|
|
||||||
|
|
@ -11,21 +11,28 @@
|
||||||
{{#if isSidebar}}
|
{{#if isSidebar}}
|
||||||
<div class="item-labels">
|
<div class="item-labels">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
{{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.trait '.name')}}
|
{{!-- {{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.short')}} --}}
|
||||||
{{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.range '.name')}}
|
{{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.short')}}
|
||||||
<span> - </span>
|
<span> - </span>
|
||||||
{{item.system.damage.value}}
|
{{item.system.attack.damage.parts.0.value.dice}}{{#if item.system.attack.damage.parts.0.value.bonus}} + {{item.system.attack.damage.parts.0.value.bonus}}{{/if}}
|
||||||
({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' item.system.damage.type '.abbreviation')}})
|
{{!-- ({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' item.system.attack.damage.parts.0.type '.abbreviation')}}) --}}
|
||||||
|
{{#with (lookup @root.config.GENERAL.damageTypes item.system.attack.damage.parts.0.type)}}
|
||||||
|
{{#each icon}}
|
||||||
|
<i class="fa-solid {{this}}"></i>
|
||||||
|
{{/each}}
|
||||||
|
{{/with}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="tag">
|
<div class="tag">
|
||||||
{{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.trait '.name')}}
|
{{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.name')}}
|
||||||
{{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.range '.name')}}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tag">
|
<div class="tag">
|
||||||
{{item.system.damage.value}}
|
{{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.name')}}
|
||||||
({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' item.system.damage.type '.abbreviation')}})
|
</div>
|
||||||
|
<div class="tag">
|
||||||
|
{{item.system.attack.damage.parts.0.value.dice}}{{#if item.system.attack.damage.parts.0.value.bonus}} + {{item.system.attack.damage.parts.0.value.bonus}}{{/if}}
|
||||||
|
({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' item.system.attack.damage.parts.0.type '.abbreviation')}})
|
||||||
</div>
|
</div>
|
||||||
<div class="tag">
|
<div class="tag">
|
||||||
{{localize (concat 'DAGGERHEART.CONFIG.Burden.' item.system.burden)}}
|
{{localize (concat 'DAGGERHEART.CONFIG.Burden.' item.system.burden)}}
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,12 @@
|
||||||
<h3>{{localize "DAGGERHEART.ITEMS.Weapon.primaryWeapon"}}</h3>
|
<h3>{{localize "DAGGERHEART.ITEMS.Weapon.primaryWeapon"}}</h3>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<h3>
|
<h3>
|
||||||
{{localize (concat 'DAGGERHEART.CONFIG.Traits.' source.system.trait '.short')}}
|
{{localize (concat 'DAGGERHEART.CONFIG.Traits.' source.system.attack.roll.trait '.short')}}
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
{{localize (concat 'DAGGERHEART.CONFIG.Range.' source.system.range '.name')}}
|
{{localize (concat 'DAGGERHEART.CONFIG.Range.' source.system.attack.range '.name')}}
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
{{source.system.damage.dice}} + {{source.system.damage.bonus}}
|
{{source.system.attack.damage.parts.0.value.dice}}{{#if source.system.attack.damage.parts.0.value.bonus}} + {{source.system.attack.damage.parts.0.value.bonus}}{{/if}}
|
||||||
({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' source.system.damage.type '.abbreviation')}})
|
({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' source.system.attack.damage.parts.0.type '.abbreviation')}})
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
{{localize (concat 'DAGGERHEART.CONFIG.Burden.' source.system.burden)}}
|
{{localize (concat 'DAGGERHEART.CONFIG.Burden.' source.system.burden)}}
|
||||||
</h3>
|
</h3>
|
||||||
|
|
|
||||||
|
|
@ -10,21 +10,26 @@
|
||||||
<span>{{localize "DAGGERHEART.ITEMS.Weapon.secondaryWeapon"}}</span>
|
<span>{{localize "DAGGERHEART.ITEMS.Weapon.secondaryWeapon"}}</span>
|
||||||
{{formField systemFields.secondary value=source.system.secondary}}
|
{{formField systemFields.secondary value=source.system.secondary}}
|
||||||
<span>{{localize "DAGGERHEART.GENERAL.Trait.single"}}</span>
|
<span>{{localize "DAGGERHEART.GENERAL.Trait.single"}}</span>
|
||||||
{{formField systemFields.trait value=source.system.trait localize=true}}
|
{{formInput systemFields.attack.fields.roll.fields.trait value=document.system.attack.roll.trait name="system.attack.roll.trait" label="DAGGERHEART.GENERAL.Trait.single" localize=true}}
|
||||||
<span>{{localize "DAGGERHEART.GENERAL.range"}}</span>
|
<span>{{localize "DAGGERHEART.GENERAL.range"}}</span>
|
||||||
{{formField systemFields.range value=source.system.range localize=true}}
|
{{formInput systemFields.attack.fields.range value=document.system.attack.range label="Range" name="system.attack.range" localize=true}}
|
||||||
<span>{{localize "DAGGERHEART.GENERAL.burden"}}</span>
|
<span>{{localize "DAGGERHEART.GENERAL.burden"}}</span>
|
||||||
{{formField systemFields.burden value=source.system.burden localize=true}}
|
{{formField systemFields.burden value=source.system.burden localize=true}}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class="two-columns">
|
<fieldset class="two-columns">
|
||||||
<legend>{{localize "DAGGERHEART.GENERAL.title"}}</legend>
|
{{#with systemFields.attack.fields.damage.fields.parts.element.fields as | fields | }}
|
||||||
<span>{{localize "DAGGERHEART.GENERAL.Dice.single"}}</span>
|
{{#with (lookup ../document.system.attack.damage.parts 0) as | source | }}
|
||||||
{{formGroup systemFields.damage.fields.dice value=source.system.damage.dice}}
|
<legend>{{localize "DAGGERHEART.GENERAL.title"}}</legend>
|
||||||
<span>{{localize "DAGGERHEART.GENERAL.bonus"}}</span>
|
<span>{{localize "DAGGERHEART.GENERAL.Dice.single"}}</span>
|
||||||
{{formGroup systemFields.damage.fields.bonus value=source.system.damage.bonus}}
|
{{formInput fields.value.fields.dice value=source.value.dice name="system.attack.damage.parts.0.value.dice"}}
|
||||||
<span>{{localize "DAGGERHEART.GENERAL.type"}}</span>
|
<span>{{localize "DAGGERHEART.GENERAL.bonus"}}</span>
|
||||||
{{formGroup systemFields.damage.fields.type value=source.system.damage.type localize=true}}
|
{{formInput fields.value.fields.bonus value=source.value.bonus name="system.attack.damage.parts.0.value.bonus" localize=true}}
|
||||||
|
<span>{{localize "DAGGERHEART.GENERAL.type"}}</span>
|
||||||
|
{{formInput fields.type value=source.type name="system.attack.damage.parts.0.type" localize=true}}
|
||||||
|
<input type="hidden" name="system.attack.damage.parts.0.value.multiplier" value="{{source.value.multiplier}}">
|
||||||
|
{{/with}}
|
||||||
|
{{/with}}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="two-columns">
|
<fieldset class="two-columns">
|
||||||
<legend>{{localize "TYPES.Item.feature"}}</legend>
|
<legend>{{localize "TYPES.Item.feature"}}</legend>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
||||||
<div class="dice-flavor">{{title}}</div>
|
<div class="dice-flavor">{{title}}</div>
|
||||||
<div>{{{description}}}</div>
|
<div>{{{description}}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
||||||
<div class="dice-result">
|
<div class="dice-result">
|
||||||
<div class="dice-actions">
|
<div class="dice-actions">
|
||||||
<button class="duality-action-effect">{{localize "DAGGERHEART.UI.Chat.attackRoll.applyEffect"}}</button>
|
<button class="duality-action-effect">{{localize "DAGGERHEART.UI.Chat.attackRoll.applyEffect"}}</button>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="dice-result">
|
<div class="dice-result">
|
||||||
<div class="dice-actions">
|
<div class="dice-actions">
|
||||||
<button class="damage-button" data-target-hit="true" {{#if (eq targets.length 0)}}disabled{{/if}}>{{localize "DAGGERHEART.UI.Chat.damageRoll.dealDamageToTargets"}}</button>
|
<button class="damage-button" data-target-hit="true" {{#if (eq targets.length 0)}}disabled{{/if}}>{{localize "DAGGERHEART.UI.Chat.damageRoll.dealDamageToTargets"}}</button>
|
||||||
<button class="damage-button">{{localize "DAGGERHEART.Chat.DamageRoll.DealDamage"}}</button>
|
<button class="damage-button">{{localize "DAGGERHEART.UI.Chat.damageRoll.dealDamage"}}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<div class="combat-tracker">
|
<div class="combat-tracker">
|
||||||
{{#if (gt this.characters.length 0)}}
|
{{#if (gt this.characters.length 0)}}
|
||||||
{{> 'systems/daggerheart/templates/ui/combat/combatTrackerSection.hbs' this title=(localize "DAGGERHEART.GENERAL.Character.plural") turns=this.characters}}
|
{{> 'systems/daggerheart/templates/ui/combatTracker/combatTrackerSection.hbs' this title=(localize "DAGGERHEART.GENERAL.Character.plural") turns=this.characters}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (gt this.adversaries.length 0)}}
|
{{#if (gt this.adversaries.length 0)}}
|
||||||
{{> 'systems/daggerheart/templates/ui/combat/combatTrackerSection.hbs' this title=(localize "DAGGERHEART.GENERAL.Adversary.plural") turns=this.adversaries}}
|
{{> 'systems/daggerheart/templates/ui/combatTracker/combatTrackerSection.hbs' this title=(localize "DAGGERHEART.GENERAL.Adversary.plural") turns=this.adversaries}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>{{fear}}</div>
|
<div>{{fear}}</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="encounter-countdowns" data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.Countdown.Title" type=(localize "DAGGERHEART.APPLICATIONS.Countdown.types.encounter")}}" data-action="openCountdowns"><i class="fa-solid fa-stopwatch"></i></a>
|
<a class="encounter-countdowns" data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.Countdown.title" type=(localize "DAGGERHEART.APPLICATIONS.Countdown.types.encounter")}}" data-action="openCountdowns"><i class="fa-solid fa-stopwatch"></i></a>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue