forked from public/bol
Add dice selection
This commit is contained in:
@ -28,6 +28,66 @@ export class BoLUtility {
|
||||
type: Boolean,
|
||||
onChange: lang => window.location.reload()
|
||||
})
|
||||
game.settings.register("bol", "dice-formula", {
|
||||
name: "Formule de dés",
|
||||
hint: "Sélectionne la formule de dés (par défaut 2d6)",
|
||||
scope: "world",
|
||||
config: true,
|
||||
default: "2d6",
|
||||
type: String,
|
||||
choices: { "6": "2d6", "8":"2d8", "10":"2d10", "12":"2d12", "20":"2d20"},
|
||||
onChange: value => {
|
||||
BoLUtility.setDiceFormula(value)
|
||||
}
|
||||
})
|
||||
game.settings.register("bol", "dice-success-value", {
|
||||
name: "Seuil de succès",
|
||||
hint: "Sélectionne le seuil de succès (9 par défaut pour 2d6)",
|
||||
scope: "world",
|
||||
config: true,
|
||||
default: 9,
|
||||
range: {
|
||||
min: 2,
|
||||
max: 40,
|
||||
step: 1
|
||||
},
|
||||
type: Number,
|
||||
onChange: value => {
|
||||
BoLUtility.setSuccessValue(value)
|
||||
}
|
||||
})
|
||||
game.settings.register("bol", "dice-critical-success-value", {
|
||||
name: "Valeur min de réussite critique",
|
||||
hint: "Indique le seuil minimum de réussite critique (12 par défaut pour 2d6). Si les réussites critiques sont sur 19 et 20, alors indiquez 19.",
|
||||
scope: "world",
|
||||
config: true,
|
||||
default: 12,
|
||||
range: {
|
||||
min: 2,
|
||||
max: 40,
|
||||
step: 1
|
||||
},
|
||||
type: Number,
|
||||
onChange: value => {
|
||||
BoLUtility.setCriticalSuccessValue(value)
|
||||
}
|
||||
})
|
||||
game.settings.register("bol", "dice-critical-failure-value", {
|
||||
name: "Valeur max d'échec critique",
|
||||
hint: "Indique le seuil maximum d'échec critique (2 par défaut pour 2d6). Si les échecs critiques sont sur 2 et 3, alors indiquez 3.",
|
||||
scope: "world",
|
||||
config: true,
|
||||
default: 2,
|
||||
range: {
|
||||
min: 2,
|
||||
max: 40,
|
||||
step: 1
|
||||
},
|
||||
type: Number,
|
||||
onChange: value => {
|
||||
BoLUtility.setCriticalFailureValue(value)
|
||||
}
|
||||
})
|
||||
game.settings.register("world", "character-summary-data", {
|
||||
name: "character-summary-data",
|
||||
scope: "world",
|
||||
@ -65,8 +125,34 @@ export class BoLUtility {
|
||||
this.useBougette = game.settings.get("bol", "useBougette") // Use optionnal bougette rules
|
||||
this.actorSheetLogo = game.settings.get("bol", "logoActorSheet") || "/systems/bol/ui/logo.webp"
|
||||
this.logoTopLeft = game.settings.get("bol", "logoTopLeft") || "/systems/bol/ui/logo2.webp"
|
||||
|
||||
this.diceFormula = game.settings.get("bol", "dice-formula")
|
||||
this.successValue = Number(game.settings.get("bol", "dice-success-value"))
|
||||
this.criticalSuccessValue = Number(game.settings.get("bol", "dice-critical-success-value"))
|
||||
this.criticalFailureValue = Number(game.settings.get("bol", "dice-critical-failure-value"))
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static setDiceFormula(value) {
|
||||
this.diceFormula = value
|
||||
}
|
||||
static setSuccessValue(value) {
|
||||
this.successValue = Number(value)
|
||||
}
|
||||
static setCriticalSuccessValue(value) {
|
||||
this.criticalSuccessValue = Number(value)
|
||||
}
|
||||
static setCriticalFailureValue(value) {
|
||||
this.criticalFailureValue = Number(value)
|
||||
}
|
||||
static getDiceData() {
|
||||
return {
|
||||
diceFormula: this.diceFormula,
|
||||
successValue : this.successValue,
|
||||
criticalSuccessValue: this.criticalSuccessValue,
|
||||
criticalFailureValue: this.criticalFailureValue
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static getRollArmor() {
|
||||
return this.rollArmor
|
||||
|
Reference in New Issue
Block a user