v13 - DataModels & SheetV2 pour les monnaies #747

Merged
uberwald merged 3 commits from VincentVk/foundryvtt-reve-de-dragon:v13 into v13 2025-02-06 10:42:17 +01:00
Showing only changes of commit bafdec9924 - Show all commits

View File

@ -19,11 +19,13 @@ export class RdDItemRace extends RdDItem {
return false
}
}
if (code == LIST_CARAC_PERSONNAGE.taille.code) {
const carac = RdDCarac.carac(code)
if (race.isMax(actor, code, value - 1)) {
ui.notifications.warn(`${value} est supérieure au maximum de ${carac.label}`)
return false
}
}
return true
}
@ -59,7 +61,8 @@ export class RdDItemRace extends RdDItem {
if (code == LIST_CARAC_PERSONNAGE.force.code) {
return value >= this.getForceMax(actor)
}
const max = foundry.utils.getProperty(this, path) ?? -1
const pathMax = path.replace(".value", ".max");
const max = foundry.utils.getProperty(this, pathMax) ?? -1
return (max > 0 && value >= max)
}