diff --git a/images/icone_parchement_vierge.svg b/images/icone_parchement_vierge.svg deleted file mode 100644 index 035129b..0000000 --- a/images/icone_parchement_vierge.svg +++ /dev/null @@ -1,4998 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/lang/fr.json b/lang/fr.json index fc5be0f..df942e3 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -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", diff --git a/module/actor/actor.js b/module/actor/actor.js index 577e9ca..5d29b1a 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -663,15 +663,23 @@ export class BoLActor extends Actor { } /*-------------------------------------------- */ - getInitiativeRank(rollData = undefined) { + 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) { + if (!rollData) { fvttInit = -1 + if ( isCombat ) { + ui.notifications.warn(game.i18n.localize("BOL.ui.warninitiative")) + } } else { if (rollData.isLegendary) { fvttInit = 10 diff --git a/module/system/bol-combat.js b/module/system/bol-combat.js index 9696d79..a4c1018 100644 --- a/module/system/bol-combat.js +++ b/module/system/bol-combat.js @@ -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 }]); } @@ -40,7 +40,16 @@ 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() + } } diff --git a/system.json b/system.json index 4598274..79e1b59 100644 --- a/system.json +++ b/system.json @@ -14,7 +14,7 @@ ], "url": "https://www.uberwald.me/gitea/public/bol", "license": "LICENSE.txt", - "version": "10.4.12", + "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.12.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", diff --git a/ui/page_accueil.webp b/ui/page_accueil.webp new file mode 100644 index 0000000..49e017b Binary files /dev/null and b/ui/page_accueil.webp differ