mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
. (#675)
This commit is contained in:
parent
48e386d8ab
commit
f5febe74fe
2 changed files with 12 additions and 1 deletions
|
|
@ -370,13 +370,18 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
);
|
||||
context.armor = {
|
||||
...this.equipment.armor,
|
||||
suggestion: { ...suggestions.armor, taken: suggestions.armor?.uuid === this.equipment.armor?.uuid },
|
||||
suggestion: {
|
||||
...suggestions.armor,
|
||||
uuid: suggestions.armor?.uuid,
|
||||
taken: suggestions.armor?.uuid === this.equipment.armor?.uuid
|
||||
},
|
||||
compendium: 'armors'
|
||||
};
|
||||
context.primaryWeapon = {
|
||||
...this.equipment.primaryWeapon,
|
||||
suggestion: {
|
||||
...suggestions.primaryWeapon,
|
||||
uuid: suggestions.primaryWeapon?.uuid,
|
||||
taken: suggestions.primaryWeapon?.uuid === this.equipment.primaryWeapon?.uuid
|
||||
},
|
||||
compendium: 'weapons'
|
||||
|
|
@ -385,6 +390,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
...this.equipment.secondaryWeapon,
|
||||
suggestion: {
|
||||
...suggestions.secondaryWeapon,
|
||||
uuid: suggestions.secondaryWeapon?.uuid,
|
||||
taken: suggestions.secondaryWeapon?.uuid === this.equipment.secondaryWeapon?.uuid
|
||||
},
|
||||
disabled: this.equipment.primaryWeapon?.system?.burden === burden.twoHanded.value,
|
||||
|
|
@ -679,6 +685,10 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
return;
|
||||
}
|
||||
|
||||
if (item.system.burden === CONFIG.DH.GENERAL.burden.twoHanded.value) {
|
||||
this.equipment.secondaryWeapon = {};
|
||||
}
|
||||
|
||||
this.equipment.primaryWeapon = { ...item, uuid: item.uuid };
|
||||
} else if (item.type === 'weapon' && event.target.closest('.secondary-weapon-card')) {
|
||||
if (this.equipment.primaryWeapon?.system?.burden === burden.twoHanded.value) {
|
||||
|
|
|
|||
|
|
@ -362,6 +362,7 @@ export async function createEmbeddedItemWithEffects(actor, baseData, update) {
|
|||
const [doc] = await actor.createEmbeddedDocuments('Item', [
|
||||
{
|
||||
...(update ?? data),
|
||||
...baseData,
|
||||
id: data.id,
|
||||
uuid: data.uuid,
|
||||
effects: data.effects?.map(effect => effect.toObject())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue