Skip to content

Commit

Permalink
Include thrown traits in isRanged test for melee items (foundryvtt#…
Browse files Browse the repository at this point in the history
  • Loading branch information
stwlam authored Jun 11, 2024
1 parent aa02bdb commit 0b45861
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/module/item/melee/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ class MeleePF2e<TParent extends ActorPF2e | null = ActorPF2e | null> extends Ite
}

get isRanged(): boolean {
return this.system.traits.value.some((t) => t.startsWith("range-"));
const traitPattern = /^(?:range|thrown)-/;
return this.system.traits.value.some((t) => traitPattern.test(t));
}

get isThrown(): boolean {
return this.isRanged && this.system.traits.value.some((t) => t.startsWith("thrown"));
return this.isRanged && this.system.traits.value.some((t) => t.startsWith("thrown-"));
}

/** The attribute this attack is based on: determines which of the Clumsy and Enfeebled conditions apply */
Expand Down

0 comments on commit 0b45861

Please sign in to comment.