From fd6fbba9cb4b5d59070a4ad50f1901c8641c92e4 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Wed, 5 Oct 2022 20:00:42 +0200 Subject: [PATCH] Merge vk --- module/rdd-combat.js | 24 +++++++++++++++++------- system.json | 4 ++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/module/rdd-combat.js b/module/rdd-combat.js index 3c7f2ca8..bf201da2 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -351,6 +351,7 @@ export class RdDCombatManager extends Combat { game.combat.rollInitiative(combatantId, rollFormula, { initInfo: initInfo }); } + /* -------------------------------------------- */ static _baseInitOffset(categorie, arme) { if (categorie == "tir") { // Offset de principe pour les armes de jet return 8; @@ -448,7 +449,7 @@ export class RdDCombat { /* -------------------------------------------- */ static createUsingTarget(attacker) { - const target = RdDCombat.getTarget(); + const target = RdDCombat.getTarget() if (target == undefined) { ui.notifications.warn((game.user.targets?.size ?? 0) > 1 ? "Vous devez choisir une seule cible à attaquer!" @@ -555,12 +556,12 @@ export class RdDCombat { /* -------------------------------------------- */ constructor(attacker, defender, defenderTokenId, target) { - this.attacker = attacker; - this.defender = defender; - this.target = target; - this.attackerId = this.attacker.id; - this.defenderId = this.defender.id; - this.defenderTokenId = defenderTokenId; + this.attacker = attacker + this.defender = defender + this.target = target + this.attackerId = this.attacker.id + this.defenderId = this.defender.id + this.defenderTokenId = defenderTokenId } /* -------------------------------------------- */ @@ -686,6 +687,14 @@ export class RdDCombat { return rollData.rolled.isSuccess; } + /* -------------------------------------------- */ + verifierDistance( competence, arme) { + if ( competence.system.categorie == "tir" ) { + // TODO - ONGOING + + } + } + /* -------------------------------------------- */ async attaque(competence, arme) { if (!await this.accorderEntite('avant-attaque')) { @@ -708,6 +717,7 @@ export class RdDCombat { if (arme) { this.attacker.verifierForceMin(arme); } + this.verifierDistance(competence, arme) const dialog = await RdDRoll.create(this.attacker, rollData, { diff --git a/system.json b/system.json index 9a85b252..52c3f0c3 100644 --- a/system.json +++ b/system.json @@ -34,7 +34,7 @@ ], "url": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/", "license": "LICENSE.txt", - "version": "10.0.23", + "version": "10.0.24", "compatibility": { "minimum": "10", "verified": "10.286" @@ -333,7 +333,7 @@ ], "socket": true, "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json", - "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.0.23.zip", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.0.24.zip", "gridDistance": 1, "gridUnits": "m", "primaryTokenAttribute": "sante.vie",