mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 16:09:03 +01:00
Fixed Weapon/Armor features. Fixed Feature actions
This commit is contained in:
parent
5243260b4d
commit
920ab3fd76
10 changed files with 84 additions and 63 deletions
|
|
@ -12,15 +12,15 @@ export default class DHItem extends foundry.documents.Item {
|
|||
/** @inheritDoc */
|
||||
getEmbeddedDocument(embeddedName, id, options) {
|
||||
let doc;
|
||||
switch ( embeddedName ) {
|
||||
case "Action":
|
||||
switch (embeddedName) {
|
||||
case 'Action':
|
||||
doc = this.system.actions?.get(id);
|
||||
if(!doc && this.system.attack?.id === id) doc = this.system.attack;
|
||||
if (!doc && this.system.attack?.id === id) doc = this.system.attack;
|
||||
break;
|
||||
default:
|
||||
return super.getEmbeddedDocument(embeddedName, id, options);
|
||||
}
|
||||
if ( options?.strict && !doc ) {
|
||||
if (options?.strict && !doc) {
|
||||
throw new Error(`The key ${id} does not exist in the ${embeddedName} Collection`);
|
||||
}
|
||||
return doc;
|
||||
|
|
@ -124,9 +124,9 @@ export default class DHItem extends foundry.documents.Item {
|
|||
|
||||
async use(event) {
|
||||
const actions = this.system.actionsList;
|
||||
if (actions?.length) {
|
||||
let action = actions[0];
|
||||
if (actions.length > 1 && !event?.shiftKey) {
|
||||
if (actions?.size) {
|
||||
let action = actions.contents[0];
|
||||
if (actions.size > 1 && !event?.shiftKey) {
|
||||
// Actions Choice Dialog
|
||||
action = await this.selectActionDialog(event);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue