Appv2 + DataModel migration completed
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* -------------------------------------------- */
|
||||
import { HawkmoonUtility } from "./hawkmoon-utility.js";
|
||||
import { HawkmoonRollDialog } from "./hawkmoon-roll-dialog.js";
|
||||
import { HawkmoonRollDialog } from "./applications/hawkmoon-roll-dialog.mjs";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const __degatsBonus = [-2, -2, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10]
|
||||
@@ -655,8 +655,7 @@ export class HawkmoonActor extends Actor {
|
||||
let rollData = this.getCommonRollData(attrKey)
|
||||
rollData.multiplier = (isInit) ? 1 : 2
|
||||
rollData.isInit = isInit
|
||||
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HawkmoonRollDialog.create(this, rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -664,22 +663,30 @@ export class HawkmoonActor extends Actor {
|
||||
let rollData = this.getCommonRollData(attrKey, compId)
|
||||
rollData.multiplier = 1 // Attr multiplier, always 1 in competence mode
|
||||
console.log("RollDatra", rollData)
|
||||
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HawkmoonRollDialog.create(this, rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollArmeOffensif(armeId) {
|
||||
let arme = this.items.get(armeId)
|
||||
if (!arme.system.equipped) {
|
||||
ui.notifications.warn("Cette arme doit être équipée pour pouvoir attaquer !")
|
||||
return
|
||||
}
|
||||
if (arme.type == "arme") {
|
||||
arme = this.prepareArme(arme)
|
||||
}
|
||||
if (!arme.system.competence) {
|
||||
ui.notifications.warn("Aucune compétence trouvée pour cette arme !")
|
||||
return
|
||||
}
|
||||
let rollData = this.getCommonRollData(arme.system.attrKey, arme.system.competence._id)
|
||||
rollData.arme = arme
|
||||
rollData.isCombat = true
|
||||
rollData.isTir = arme.system.isDistance || false
|
||||
HawkmoonUtility.updateWithTarget(rollData)
|
||||
console.log("ARME!", rollData)
|
||||
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HawkmoonRollDialog.create(this, rollData)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollAssommer() {
|
||||
@@ -687,8 +694,7 @@ export class HawkmoonActor extends Actor {
|
||||
rollData.assomer = true
|
||||
rollData.conditionsCommunes = true
|
||||
HawkmoonUtility.updateWithTarget(rollData)
|
||||
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HawkmoonRollDialog.create(this, rollData)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollCoupBas() {
|
||||
@@ -696,8 +702,7 @@ export class HawkmoonActor extends Actor {
|
||||
rollData.coupBas = true
|
||||
rollData.conditionsCommunes = true
|
||||
HawkmoonUtility.updateWithTarget(rollData)
|
||||
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HawkmoonRollDialog.create(this, rollData)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollImmobiliser() {
|
||||
@@ -706,8 +711,7 @@ export class HawkmoonActor extends Actor {
|
||||
rollData.conditionsCommunes = true
|
||||
rollData.cibleconsciente = true
|
||||
HawkmoonUtility.updateWithTarget(rollData)
|
||||
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HawkmoonRollDialog.create(this, rollData)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollRepousser() {
|
||||
@@ -716,8 +720,7 @@ export class HawkmoonActor extends Actor {
|
||||
rollData.conditionsCommunes = true
|
||||
rollData.cibleconsciente = true
|
||||
HawkmoonUtility.updateWithTarget(rollData)
|
||||
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HawkmoonRollDialog.create(this, rollData)
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async rollDesengager() {
|
||||
@@ -725,13 +728,16 @@ export class HawkmoonActor extends Actor {
|
||||
rollData.desengager = true
|
||||
rollData.conditionsCommunes = true
|
||||
HawkmoonUtility.updateWithTarget(rollData)
|
||||
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
|
||||
rollDialog.render(true)
|
||||
await HawkmoonRollDialog.create(this, rollData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollArmeDegats(armeId, targetVigueur = undefined, rollDataInput = undefined) {
|
||||
let arme = this.items.get(armeId)
|
||||
if (!arme.system.equipped) {
|
||||
ui.notifications.warn("Cette arme doit être équipée pour pouvoir infliger des dégâts !")
|
||||
return
|
||||
}
|
||||
if (arme.type == "arme") {
|
||||
arme = this.prepareArme(arme)
|
||||
}
|
||||
@@ -782,7 +788,7 @@ export class HawkmoonActor extends Actor {
|
||||
nbEtatPerdus: nbEtatPerdus
|
||||
}
|
||||
HawkmoonUtility.createChatWithRollMode(rollData.alias, {
|
||||
content: await renderTemplate(`systems/fvtt-hawkmoon-cyd/templates/chat-degats-result.html`, rollData)
|
||||
content: await foundry.applications.handlebars.renderTemplate(`systems/fvtt-hawkmoon-cyd/templates/chat-degats-result.html`, rollData)
|
||||
})
|
||||
|
||||
if (rollDataInput?.defenderTokenId && nbEtatPerdus) {
|
||||
|
||||
Reference in New Issue
Block a user