Feature/253 weapon attack action (#290)

* Step #1

* Add Attack to Weapon & Override settings to Roll
This commit is contained in:
Dapoulp 2025-07-07 20:50:48 +02:00 committed by GitHub
parent 52be430eff
commit 7d7fb88035
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 168 additions and 91 deletions

View file

@ -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 thats 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 thats 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 thats 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 thats 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",

View file

@ -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);

View file

@ -35,7 +35,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'
} }

View file

@ -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;
} }

View file

@ -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;
} }

View file

@ -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',

View file

@ -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;
} }

View file

@ -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
}; };
} }

View file

@ -156,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;
} }

View file

@ -61,7 +61,9 @@ export default class DhpAdversary extends BaseDataActor {
damage: { damage: {
parts: [ parts: [
{ {
multiplier: 'flat' value: {
multiplier: 'flat'
}
} }
] ]
} }

View file

@ -42,6 +42,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.

View file

@ -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;

View file

@ -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);
} }

View file

@ -5776,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;
@ -6384,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;

View file

@ -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;

View file

@ -53,6 +53,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 12px; font-size: 12px;
gap: 4px;
} }
} }
} }

View file

@ -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>

View 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}}

View file

@ -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)}}

View file

@ -10,13 +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>
{{log this}} {{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}}
{{source.system.damage.dice}} + {{source.system.damage.bonus}} ({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' source.system.attack.damage.parts.0.type '.abbreviation')}})
({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' source.system.damage.type '.abbreviation')}})
<span>-</span> <span>-</span>
{{localize (concat 'DAGGERHEART.CONFIG.Burden.' source.system.burden)}} {{localize (concat 'DAGGERHEART.CONFIG.Burden.' source.system.burden)}}
</h3> </h3>

View file

@ -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>

View file

@ -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>