Compare commits
5 Commits
bol-v10.4.
...
bol-v10.4.
Author | SHA1 | Date | |
---|---|---|---|
7a8cf9f8fd | |||
d74f7784bb | |||
6d6fec99b0 | |||
884823a1bc | |||
399c22d623 |
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 372 KiB |
@ -183,6 +183,7 @@
|
||||
"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.ui.warninitiative": "Votre initiative n'est pas disponible. Effectuez un jet d'Initiative pour ce combat.",
|
||||
|
||||
"BOL.featureCategory.origins": "Origines",
|
||||
"BOL.featureCategory.races": "Races",
|
||||
|
@ -148,7 +148,7 @@ export class BoLActorSheet extends ActorSheet {
|
||||
formData.options = this.options
|
||||
formData.owner = this.document.isOwner
|
||||
formData.editScore = this.options.editScore
|
||||
formData.useBougette = BoLUtility.getUseBougette()
|
||||
formData.useBougette = (this.actor.type == "character" && BoLUtility.getUseBougette()) || false
|
||||
formData.bougette = this.actor.getBougette()
|
||||
formData.charType = this.actor.getCharType()
|
||||
formData.villainy = this.actor.getVillainy()
|
||||
|
@ -40,26 +40,35 @@ export class BoLActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getBougette() {
|
||||
if ( this.type == "character") {
|
||||
let b = duplicate(this.system.bougette)
|
||||
b.label = game.i18n.localize( game.bol.config.bougetteState[String(this.system.bougette.value)] )
|
||||
b.diceImg = "icons/dice/" + game.bol.config.bougetteDice[String(this.system.bougette.value)] + "black.svg"
|
||||
return b
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollBougette() {
|
||||
//ui.notifications.info("Roll bougette done !")
|
||||
if ( this.type == "character") {
|
||||
let attribute = duplicate(this.system.attributes.vigor)
|
||||
let rollData = BoLRoll.getCommonRollData(this, "bougette", attribute, undefined )
|
||||
rollData.formula = game.bol.config.bougetteDice[String(this.system.bougette.value)]
|
||||
let r = new BoLDefaultRoll(rollData)
|
||||
r.roll()
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
decBougette() {
|
||||
if ( this.type == "character") {
|
||||
let bougette = duplicate(this.system.bougette)
|
||||
bougette.value = Math.max( Number(bougette.value) - 1, 0)
|
||||
this.update( { 'system.bougette': bougette } )
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
updateResourcesData() {
|
||||
if (this.type == 'character') {
|
||||
@ -648,19 +657,29 @@ 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")
|
||||
clearInitiative() {
|
||||
this.unsetFlag("world", "last-initiative" )
|
||||
}
|
||||
|
||||
/*-------------------------------------------- */
|
||||
getInitiativeRank(rollData = undefined, isCombat = false) {
|
||||
if (!rollData) {
|
||||
rollData = this.getFlag("world", "last-initiative")
|
||||
}
|
||||
let fvttInit = 4 // Pietaille par defaut
|
||||
if (this.type == 'character' ) {
|
||||
fvttInit = 5
|
||||
if (!rollData) {
|
||||
fvttInit = -1
|
||||
if ( isCombat ) {
|
||||
ui.notifications.warn(game.i18n.localize("BOL.ui.warninitiative"))
|
||||
}
|
||||
} else {
|
||||
if (rollData.isLegendary) {
|
||||
fvttInit = 10
|
||||
|
@ -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)
|
||||
|
@ -25,7 +25,7 @@ export class BoLCombatManager extends Combat {
|
||||
// calculate initiative
|
||||
for (let cId = 0; cId < ids.length; cId++) {
|
||||
const combatant = this.combatants.get(ids[cId])
|
||||
let fvttInit = combatant.actor.getInitiativeRank()
|
||||
let fvttInit = combatant.actor.getInitiativeRank(false, true)
|
||||
fvttInit += (cId / 100)
|
||||
await this.updateEmbeddedDocuments("Combatant", [{ _id: ids[cId], initiative: fvttInit }]);
|
||||
}
|
||||
@ -41,6 +41,15 @@ export class BoLCombatManager extends Combat {
|
||||
super.nextRound()
|
||||
}
|
||||
|
||||
/************************************************************************************/
|
||||
_onDelete() {
|
||||
let combatants = this.combatants.contents
|
||||
for (let c of combatants) {
|
||||
let actor = game.actors.get(c.data.actorId)
|
||||
actor.clearInitiative()
|
||||
}
|
||||
super._onDelete()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
],
|
||||
"url": "https://www.uberwald.me/gitea/public/bol",
|
||||
"license": "LICENSE.txt",
|
||||
"version": "10.4.9",
|
||||
"version": "10.4.13",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
"verified": "10",
|
||||
@ -203,8 +203,8 @@
|
||||
],
|
||||
"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.9.zip",
|
||||
"background": "systems/images/map_lemurie.webp",
|
||||
"download": "https://www.uberwald.me/gitea/public/bol/archive/bol-v10.4.13.zip",
|
||||
"background": "systems/bol/ui/page_accueil.webp",
|
||||
"gridDistance": 1.5,
|
||||
"gridUnits": "m",
|
||||
"primaryTokenAttribute": "resources.hp",
|
||||
|
@ -1,8 +1,8 @@
|
||||
<!--ARMES-->
|
||||
<button class="create_item">Créer un Equipement</button>
|
||||
|
||||
{{#if useBougette}}
|
||||
<ol class="items-list">
|
||||
{{#if useBougette}}
|
||||
<ol class="items-list">
|
||||
<li class="item flexrow item-header">
|
||||
<div class="item-name flex4 left">{{localize "BOL.ui.moneyTitle"}}</div>
|
||||
<div class="item-name flex4 left"> </div>
|
||||
@ -27,8 +27,8 @@
|
||||
<label class="">{{localize bougette.label}}</label></a>
|
||||
{{/if}}
|
||||
</li>
|
||||
</ol>
|
||||
{{/if}}
|
||||
</ol>
|
||||
{{/if}}
|
||||
|
||||
<ol class="items-list">
|
||||
<li class="item flexrow item-header">
|
||||
|
BIN
ui/page_accueil.webp
Normal file
BIN
ui/page_accueil.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 494 KiB |
Reference in New Issue
Block a user