Add ranged actions for monsters
Release Creation / build (release) Successful in 54s

This commit is contained in:
2026-05-23 19:10:10 +02:00
parent 4724cdf2bb
commit 38eb1a8d3d
32 changed files with 407 additions and 85 deletions
+17
View File
@@ -283,6 +283,23 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
*/
async roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr = 0) {
const hasTarget = false
// Ranged weapon attacks from PCs use the ranged attack dialog (range, movement, aim modifiers)
if (rollType === "weapon-attack" && rollTarget?.isRangedAttack === true) {
let roll = await LethalFantasyRoll.promptRangedAttack({
rollType: "weapon-attack",
actorId: this.parent.id,
actorName: this.parent.name,
actorImage: this.parent.img,
rollTarget,
defenderId,
defenderTokenId,
})
if (!roll) return null
await roll.toMessage({}, { messageMode: roll.options.rollMode })
return
}
let roll = await LethalFantasyRoll.prompt({
rollType,
rollTarget,