Ajout fenetre de roll + gestion de base des rolls
This commit is contained in:
@ -81,11 +81,6 @@ export class MournbladeActor extends Actor {
|
||||
super._preUpdate(changed, options, user);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getActivePerks() {
|
||||
let perks = this.data.items.filter(item => item.type == 'perk' && item.data.data.active);
|
||||
return perks;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getItemById(id) {
|
||||
let item = this.data.items.find(item => item.id == id);
|
||||
@ -117,7 +112,7 @@ export class MournbladeActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getAttribute(attrKey) {
|
||||
return this.data.data.attributes[attrKey];
|
||||
return this.data.data.attributes[attrKey]
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -164,38 +159,30 @@ export class MournbladeActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getCommonRollData(statKey = undefined, useShield = false) {
|
||||
getCommonRollData(attrKey = undefined, compKey = undefined) {
|
||||
let rollData = MournbladeUtility.getBasicRollData()
|
||||
rollData.alias = this.name
|
||||
rollData.actorImg = this.img
|
||||
rollData.actorId = this.id
|
||||
rollData.img = this.img
|
||||
rollData.activePerks = duplicate(this.getActivePerks())
|
||||
|
||||
if (statKey) {
|
||||
rollData.statKey = statKey
|
||||
rollData.stat = this.getStat(statKey)
|
||||
rollData.statDicesLevel = rollData.stat.value
|
||||
rollData.statMod = rollData.stat.mod
|
||||
rollData.specList = this.getRelevantSpec(statKey)
|
||||
rollData.selectedSpec = "0"
|
||||
if (attrKey) {
|
||||
rollData.attrKey = attrKey
|
||||
rollData.attr = duplicate(this.data.data.attributs[attrKey])
|
||||
}
|
||||
if (compKey) {
|
||||
rollData.compKey = compKey
|
||||
// TODO!
|
||||
}
|
||||
|
||||
this.addEffects(rollData)
|
||||
this.addArmorsShields(rollData, statKey, useShield)
|
||||
this.addWeapons(rollData, statKey, useShield)
|
||||
this.addEquipments(rollData, statKey)
|
||||
|
||||
return rollData
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async startRoll(rollData) {
|
||||
this.syncRoll(rollData);
|
||||
//console.log("ROLL DATA", rollData)
|
||||
let rollDialog = await MournbladeRollDialog.create(this, rollData);
|
||||
console.log(rollDialog);
|
||||
rollDialog.render(true);
|
||||
async rollAttribut(attrKey) {
|
||||
let rollData = this.getCommonRollData(attrKey)
|
||||
console.log("RollDatra", rollData)
|
||||
let rollDialog = await MournbladeRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user