Fix sur pouvoirs, heritage et 2 pts de tricherie

This commit is contained in:
2023-04-30 20:08:29 +02:00
parent 2dff59c829
commit 9b1600304a
8 changed files with 129 additions and 28 deletions

View File

@@ -501,9 +501,14 @@ export class HeritiersActor extends Actor {
incDecTricherie(value) {
let tricherie = this.system.rang.tricherie
tricherie.value += value
if ( tricherie.value < 0 || tricherie.value > tricherie.max) {
ui.notifications.warn("Pas assez de points de Tricherie !")
return false
}
tricherie.value = Math.max(tricherie.value, 0)
tricherie.value = Math.min(tricherie.value, tricherie.max)
this.update({ 'system.rang.tricherie': tricherie })
return true
}
/* -------------------------------------------- */
getPireCompetence(compName1, compName2) {