Ajout pouvoirs et jets associés
This commit is contained in:
@@ -419,18 +419,22 @@ export class WastelandActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollAttribut(attrKey) {
|
||||
let rollData = this.getCommonRollData(attrKey)
|
||||
async launchRoll(rollData) {
|
||||
console.log("RollData", rollData)
|
||||
let rollDialog = await WastelandRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
rollAttribut(attrKey) {
|
||||
let rollData = this.getCommonRollData(attrKey)
|
||||
this.launchRoll(rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollCompetence(attrKey, compId) {
|
||||
rollCompetence(attrKey, compId) {
|
||||
let rollData = this.getCommonRollData(attrKey, compId)
|
||||
console.log("RollDatra", rollData)
|
||||
let rollDialog = await WastelandRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
this.launchRoll(rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -438,28 +442,22 @@ export class WastelandActor extends Actor {
|
||||
let rollData = this.getCommonRollData("cla")
|
||||
rollData.charme = duplicate(this.items.get(charmeId) || {})
|
||||
rollData.charmeDice = "1d4"
|
||||
console.log("RollDatra", rollData)
|
||||
let rollDialog = await WastelandRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
this.launchRoll(rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollPouvoir(pouvoirId) {
|
||||
let comp = this.items.find(comp => comp.type == "competence" && comp.name.toLowerCase() == "savoir : runes")
|
||||
if ( !comp) {
|
||||
ui.notifications.warn("La compétence Savoirs : Runes n'a pas été trouvée, abandon.")
|
||||
return
|
||||
async rollPouvoir(pouvoirId) {
|
||||
let pouvoir = duplicate(this.items.get(pouvoirId) || {})
|
||||
if (pouvoir?.system) {
|
||||
let rollData = this.getCommonRollData(pouvoir.system.attribut, undefined, pouvoir.system.competence)
|
||||
if (!rollData.competence) {
|
||||
ui.notifications.error("Le pouvoir " + pouvoir.name + " n'a pas de compétence associée. Editez le pouvoir avec la compétence associée.")
|
||||
return
|
||||
}
|
||||
rollData.pouvoir = pouvoir
|
||||
rollData.difficulte = pouvoir.system.seuil
|
||||
this.launchRoll(rollData)
|
||||
}
|
||||
let rollData = this.getCommonRollData("cla", undefined, "Savoir : Runes")
|
||||
rollData.rune = duplicate(this.items.get(runeId) || {})
|
||||
rollData.difficulte = rollData.rune?.system?.seuil || 0
|
||||
rollData.runemode = "prononcer"
|
||||
rollData.runeame = 1
|
||||
console.log("runeData", rollData)
|
||||
let rollDialog = await WastelandRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
}
|
||||
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollArmeOffensif(armeId) {
|
||||
let arme = this.items.get(armeId)
|
||||
@@ -471,9 +469,7 @@ export class WastelandActor extends Actor {
|
||||
}
|
||||
let rollData = this.getCommonRollData(arme.system.attrKey, arme.system.competence._id)
|
||||
rollData.arme = arme
|
||||
console.log("ARME!", rollData)
|
||||
let rollDialog = await WastelandRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
this.launchRoll(rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user