Fix init creature + minor changes

This commit is contained in:
2023-01-04 09:57:13 +01:00
parent 1bbefd3499
commit 1ac9605f08
9 changed files with 58 additions and 25 deletions

View File

@ -756,6 +756,14 @@ export class BoLActor extends Actor {
this.unsetFlag("world", "last-initiative" )
}
/*-------------------------------------------- */
getSize() {
if (this.system.details.size.length > 0 && game.bol.config.creatureSize[this.system.details.size]) {
return game.bol.config.creatureSize[this.system.details.size].order
}
return game.bol.config.creatureSize["medium"].order // Medium size per default
}
/*-------------------------------------------- */
getInitiativeRank(rollData = undefined, isCombat = false) {
if (!rollData) {
@ -787,6 +795,17 @@ export class BoLActor extends Actor {
if ( this.getCharType() == 'tough') {
fvttInit = 6
}
if ( this.getCharType() == 'creature') {
let mySize = this.getSize()
let sizeSmall = game.bol.config.creatureSize["small"].order
let sizeMedium = game.bol.config.creatureSize["medium"].order
if ( mySize >= sizeSmall && mySize <= sizeMedium) {
fvttInit = 6
}
if ( mySize > sizeMedium) {
fvttInit = 7
}
}
return fvttInit
}