forked from public/foundryvtt-reve-de-dragon
Nouvelle fenêtre de jets de dés
This commit is contained in:
33
module/roll/roll-part-astrologique.mjs
Normal file
33
module/roll/roll-part-astrologique.mjs
Normal file
@@ -0,0 +1,33 @@
|
||||
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() }
|
||||
}
|
Reference in New Issue
Block a user