Compare commits

..

4 Commits

Author SHA1 Message Date
884823a1bc Init again !!!! 2022-12-02 13:16:42 +01:00
399c22d623 Init again !!!! 2022-12-02 13:15:48 +01:00
085265df5d initiative bugfix 2022-12-01 23:57:33 +01:00
593db9ba5b initiative bugfix 2022-12-01 23:46:27 +01:00
5 changed files with 34 additions and 28 deletions

View File

@ -182,6 +182,7 @@
"BOL.ui.armornoformula": "L'armure {protect.name} n'a pas de formule pour la protection !",
"BOL.ui.selectactor": "Selectionnez votre personnage pour utiliser la macro",
"BOL.ui.itemnotfound": "Impossible de trouver l'objet de cette macro",
"BOL.ui.noinit": "Pas d'initiative trouvée, veuillez en enregistrer une.",
"BOL.featureCategory.origins": "Origines",
"BOL.featureCategory.races": "Races",

View File

@ -648,16 +648,22 @@ export class BoLActor extends Actor {
}
/*-------------------------------------------- */
registerInit(rollData) {
async registerInit(rollData) {
rollData.actor = undefined // Cleanup if present
this.setFlag("world", "last-initiative", rollData)
await this.setFlag("world", "last-initiative", rollData)
}
/*-------------------------------------------- */
getInitiativeRank() {
let rollData = this.getFlag("world", "last-initiative")
let fvttInit = 5
if (this.type == 'character') {
getInitiativeRank(rollData = undefined) {
if (!rollData) {
rollData = this.getFlag("world", "last-initiative")
}
let fvttInit = 4 // Pietaille par defaut
if (this.type == 'character' ) {
fvttInit = 5
if (!rollData) {
fvttInit = -1
} else {
if (rollData.isLegendary) {
fvttInit = 10
} else if (rollData.isCritical) {
@ -667,15 +673,14 @@ export class BoLActor extends Actor {
} else if (rollData.isFumble) {
fvttInit = 3
}
} else {
fvttInit = 4 // Pietaille par defautco
}
}
if ( this.getCharType() == 'adversary') {
fvttInit = 7
}
if ( this.getCharType() == 'tough') {
fvttInit = 6
}
}
return fvttInit
}

View File

@ -548,7 +548,7 @@ export class BoLDefaultRoll {
async roll() {
const r = new Roll(this.rollData.formula)
// console.log("Roll formula", this.rollData.formula)
//console.log("Roll formula", this.rollData.formula)
await r.roll({ "async": false })
const activeDice = r.terms[0].results.filter(r => r.active)
const diceTotal = activeDice.map(r => r.result).reduce((a, b) => a + b)
@ -571,7 +571,7 @@ export class BoLDefaultRoll {
if (this.rollData.registerInit) {
actor.registerInit(this.rollData)
this.rollData.initiativeRank = actor.getInitiativeRank()
this.rollData.initiativeRank = actor.getInitiativeRank(this.rollData)
}
if (this.rollData.isSuccess && this.rollData.mode == "spell") { // PP cost management
this.rollData.remainingPP = actor.spendPowerPoint(this.rollData.ppCost + this.rollData.ppCostArmor)

View File

@ -20,7 +20,7 @@ export class BoLCombatManager extends Combat {
console.log(`${game.system.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
// Structure input data
ids = typeof ids === "string" ? [ids] : ids;
const currentId = this.combatant.id;
//const currentId = this.combatant.id;
// calculate initiative
for (let cId = 0; cId < ids.length; cId++) {

View File

@ -14,7 +14,7 @@
],
"url": "https://www.uberwald.me/gitea/public/bol",
"license": "LICENSE.txt",
"version": "10.4.7",
"version": "10.4.10",
"compatibility": {
"minimum": "10",
"verified": "10",
@ -203,7 +203,7 @@
],
"socket": true,
"manifest": "https://www.uberwald.me/gitea/public/bol/raw/v10/system.json",
"download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.4.7.zip",
"download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.4.10.zip",
"background": "systems/images/map_lemurie.webp",
"gridDistance": 1.5,
"gridUnits": "m",