Roll damages and so on
All checks were successful
Release Creation / build (release) Successful in 56s

This commit is contained in:
2025-12-14 21:18:00 +01:00
parent f6b35536de
commit 96062c6fd9
34 changed files with 285 additions and 100 deletions

View File

@@ -120,7 +120,7 @@ export default class LethalFantasyActor extends Actor {
}
/* *************************************************/
fuzzyNameSearchWeaponSkills(weaponName, weaponClass=null) {
fuzzyNameSearchWeaponSkills(weaponName, weaponClass = null) {
// Get all weapon skills without the " skill" suffix
let skills = this.items.filter((i) => i.type === "skill" && i.system.weaponClass === weaponClass && i.system.category === "weapon")
// Remove parenthesis in the weapon name for better matching
@@ -227,11 +227,14 @@ export default class LethalFantasyActor extends Actor {
ui.notifications.warn(game.i18n.localize("LETHALFANTASY.Notifications.skillNotFound"))
return
}
rollTarget = skill
rollTarget.weapon = weapon
rollTarget.weaponSkillModifier = skill.weaponSkillModifier
rollTarget.rollKey = rollKey
rollTarget.combat = foundry.utils.duplicate(this.system.combat)
// Créer un objet plain au lieu de modifier directement le skill
rollTarget = {
...skill,
weapon: weapon,
weaponSkillModifier: skill.weaponSkillModifier,
rollKey: rollKey,
combat: foundry.utils.duplicate(this.system.combat)
}
if (rollType === "weapon-damage-small" || rollType === "weapon-damage-medium") {
rollTarget.grantedDice = this.system.granted.damageDice
}