forked from public/foundryvtt-reve-de-dragon
34 lines
916 B
JavaScript
34 lines
916 B
JavaScript
import { Grammar } from "../grammar.js"
|
|
import { ReglesOptionnelles } from "../settings/regles-optionnelles.js"
|
|
import { RollPartCheckbox } from "./roll-part-checkbox.mjs"
|
|
|
|
export const PART_ASTROLOGIQUE = "astrologique"
|
|
|
|
export class RollPartAstrologique extends RollPartCheckbox {
|
|
|
|
get code() { return PART_ASTROLOGIQUE }
|
|
get useCheckboxTemplate() { return false }
|
|
|
|
visible(rollData) {
|
|
return this.$isUsingAstrologie() && (
|
|
this.isJetChance(rollData)
|
|
|| this.isLancementRituel(rollData)
|
|
)
|
|
}
|
|
|
|
isLancementRituel(rollData) {
|
|
return false
|
|
}
|
|
|
|
isJetChance(rollData) {
|
|
return Grammar.includesLowerCaseNoAccent(rollData.current.carac.key, 'chance')
|
|
}
|
|
|
|
$isUsingAstrologie() {
|
|
return ReglesOptionnelles.isUsing("astrologie")
|
|
}
|
|
|
|
getCheckboxLabel(rollData) { return "Astrologique" }
|
|
getCheckboxValue(rollData) { return rollData.active.actor.ajustementAstrologique() }
|
|
}
|