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 = {
|
context.armor = {
|
||||||
...this.equipment.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'
|
compendium: 'armors'
|
||||||
};
|
};
|
||||||
context.primaryWeapon = {
|
context.primaryWeapon = {
|
||||||
...this.equipment.primaryWeapon,
|
...this.equipment.primaryWeapon,
|
||||||
suggestion: {
|
suggestion: {
|
||||||
...suggestions.primaryWeapon,
|
...suggestions.primaryWeapon,
|
||||||
|
uuid: suggestions.primaryWeapon?.uuid,
|
||||||
taken: suggestions.primaryWeapon?.uuid === this.equipment.primaryWeapon?.uuid
|
taken: suggestions.primaryWeapon?.uuid === this.equipment.primaryWeapon?.uuid
|
||||||
},
|
},
|
||||||
compendium: 'weapons'
|
compendium: 'weapons'
|
||||||
|
|
@ -385,6 +390,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
||||||
...this.equipment.secondaryWeapon,
|
...this.equipment.secondaryWeapon,
|
||||||
suggestion: {
|
suggestion: {
|
||||||
...suggestions.secondaryWeapon,
|
...suggestions.secondaryWeapon,
|
||||||
|
uuid: suggestions.secondaryWeapon?.uuid,
|
||||||
taken: suggestions.secondaryWeapon?.uuid === this.equipment.secondaryWeapon?.uuid
|
taken: suggestions.secondaryWeapon?.uuid === this.equipment.secondaryWeapon?.uuid
|
||||||
},
|
},
|
||||||
disabled: this.equipment.primaryWeapon?.system?.burden === burden.twoHanded.value,
|
disabled: this.equipment.primaryWeapon?.system?.burden === burden.twoHanded.value,
|
||||||
|
|
@ -679,6 +685,10 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.system.burden === CONFIG.DH.GENERAL.burden.twoHanded.value) {
|
||||||
|
this.equipment.secondaryWeapon = {};
|
||||||
|
}
|
||||||
|
|
||||||
this.equipment.primaryWeapon = { ...item, uuid: item.uuid };
|
this.equipment.primaryWeapon = { ...item, uuid: item.uuid };
|
||||||
} else if (item.type === 'weapon' && event.target.closest('.secondary-weapon-card')) {
|
} else if (item.type === 'weapon' && event.target.closest('.secondary-weapon-card')) {
|
||||||
if (this.equipment.primaryWeapon?.system?.burden === burden.twoHanded.value) {
|
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', [
|
const [doc] = await actor.createEmbeddedDocuments('Item', [
|
||||||
{
|
{
|
||||||
...(update ?? data),
|
...(update ?? data),
|
||||||
|
...baseData,
|
||||||
id: data.id,
|
id: data.id,
|
||||||
uuid: data.uuid,
|
uuid: data.uuid,
|
||||||
effects: data.effects?.map(effect => effect.toObject())
|
effects: data.effects?.map(effect => effect.toObject())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue