New combat management and various improvments
All checks were successful
Release Creation / build (release) Successful in 48s

This commit is contained in:
2026-01-19 23:22:32 +01:00
parent a06dfa0ae9
commit 52877e3a68
46 changed files with 4655 additions and 475 deletions

View File

@@ -273,7 +273,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
* @param {"="|"+"|"++"|"-"|"--"} rollAdvantage If there is an avantage (+), a disadvantage (-), a double advantage (++), a double disadvantage (--) or a normal roll (=).
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
*/
async roll(rollType, rollTarget) {
async roll(rollType, rollTarget, defenderId) {
const hasTarget = false
let roll = await LethalFantasyRoll.prompt({
rollType,
@@ -282,7 +282,8 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
actorName: this.parent.name,
actorImage: this.parent.img,
hasTarget,
target: false
target: false,
defenderId
})
if (!roll) return null
@@ -311,6 +312,13 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
}
async rollProgressionDice(combatId, combatantId, rollProgressionCount) {
let combatant = game.combats.get(combatId)?.combatants?.get(combatantId)
// Don't roll if the combatant is defeated
if (combatant?.isDefeated) {
ui.notifications.warn(`${this.parent.name} is defeated and cannot attack.`)
return
}
// Get all weapons from the actor
let weapons = this.parent.items.filter(i => i.type === "weapon" && i.system.weaponType === "melee")