Roll recette de cuisine

This commit is contained in:
2025-10-03 01:37:12 +02:00
parent 37af0dd4f1
commit 54f470d531
9 changed files with 159 additions and 4 deletions

View File

@@ -0,0 +1,28 @@
import { DIFF, ROLL_TYPE_CUISINE } from "./roll-constants.mjs"
import { PART_CUISINE } from "./roll-part-cuisine.mjs"
import { RollType } from "./roll-type.mjs"
export class RollTypeCuisine extends RollType {
get code() { return ROLL_TYPE_CUISINE }
get name() { return `Interpréter une oeuvre` }
visible(rollData) { return rollData.active.actor.isPersonnage() }
title(rollData) {
const current = rollData.current[PART_CUISINE]
return `prépare une recette: ${current.label}`
}
onSelect(rollData) {
this.setDiffType(rollData, DIFF.AUCUN)
}
getResult(rollData){
const current = rollData.current[PART_CUISINE]
const qualite = rollData.rolled.isSuccess ? current.qualite : Math.min(current.qualite, current.comp.system.niveau)
return {
qualite: qualite + rollData.rolled.ptQualite
}
}
}