Fix calcul defense

This commit is contained in:
LeRatierBretonnien 2024-02-15 11:47:15 +01:00
parent 2c12ec38fb
commit 9e023d3f01
6 changed files with 34 additions and 12 deletions

View File

@ -76,6 +76,7 @@ export class HawkmoonActor extends Actor {
arme.system.totalDegats = arme.system.degats + "+" + combat.bonusDegatsTotal arme.system.totalDegats = arme.system.degats + "+" + combat.bonusDegatsTotal
arme.system.totalOffensif = this.system.attributs.pui.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff arme.system.totalOffensif = this.system.attributs.pui.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.seuildefense + bonusDefense arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.seuildefense + bonusDefense
console.log("Arme", arme.system.totalDefensif, combat, arme.system.competence.system.niveau, arme.system.seuildefense, bonusDefense)
arme.system.isdefense = true arme.system.isdefense = true
arme.system.isMelee = true arme.system.isMelee = true
arme.system.isDistance = false arme.system.isDistance = false
@ -175,7 +176,7 @@ export class HawkmoonActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
getDefenseBase() { getDefenseBase() {
return Math.max(this.system.attributs.tre.value, this.system.attributs.pui.value) return Math.max(this.system.attributs.tre.value, this.system.attributs.adr.value)
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -185,7 +186,7 @@ export class HawkmoonActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
getProtection() { getProtection() {
let equipProtection = 0 let equipProtection = 0
for (let armor in this.items) { for (let armor of this.items) {
if (armor.type == "protection" && armor.system.equipped) { if (armor.type == "protection" && armor.system.equipped) {
equipProtection += Number(armor.system.protection) equipProtection += Number(armor.system.protection)
} }

View File

@ -716,11 +716,11 @@ export class HawkmoonUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async confirmDelete(actorSheet, li) { static async confirmDelete(actorSheet, li) {
let itemId = li.data("item-id"); let itemId = li.data("item-id");
let msgTxt = "<p>Are you sure to remove this Item ?"; let msgTxt = "<p>Etes vous certain de vouloir supprimer cet item ?";
let buttons = { let buttons = {
delete: { delete: {
icon: '<i class="fas fa-check"></i>', icon: '<i class="fas fa-check"></i>',
label: "Yes, remove it", label: "Oui !",
callback: () => { callback: () => {
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]); actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
li.slideUp(200, () => actorSheet.render(false)); li.slideUp(200, () => actorSheet.render(false));
@ -728,12 +728,12 @@ export class HawkmoonUtility {
}, },
cancel: { cancel: {
icon: '<i class="fas fa-times"></i>', icon: '<i class="fas fa-times"></i>',
label: "Cancel" label: "Non"
} }
} }
msgTxt += "</p>"; msgTxt += "</p>";
let d = new Dialog({ let d = new Dialog({
title: "Confirm removal", title: "Confirmer la suppression",
content: msgTxt, content: msgTxt,
buttons: buttons, buttons: buttons,
default: "cancel" default: "cancel"
@ -752,7 +752,6 @@ export class HawkmoonUtility {
console.log(entryData) console.log(entryData)
htmlTab += `<tr><td>@UUID[Compendium.${compName}.${entryData._id}]{${entryData.name}}</td>` htmlTab += `<tr><td>@UUID[Compendium.${compName}.${entryData._id}]{${entryData.name}}</td>`
htmlTab += `<td>${entryData.system.description}</td>`; htmlTab += `<td>${entryData.system.description}</td>`;
//htmlTab += `<td>${entryData.system.resumebonus}</td>`;
htmlTab += "</tr>\n"; htmlTab += "</tr>\n";
} }
htmlTab += "</table>"; htmlTab += "</table>";

View File

@ -1,7 +1,7 @@
{ {
"id": "fvtt-hawkmoon-cyd", "id": "fvtt-hawkmoon-cyd",
"description": "Hawkmoon RPG for FoundryVTT (CYD system - French)", "description": "Hawkmoon RPG for FoundryVTT (CYD system - French)",
"version": "11.1.0", "version": "11.1.1",
"authors": [ "authors": [
{ {
"name": "Uberwald/LeRatierBretonnien", "name": "Uberwald/LeRatierBretonnien",
@ -35,7 +35,7 @@
"gridUnits": "m", "gridUnits": "m",
"license": "LICENSE.txt", "license": "LICENSE.txt",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/raw/branch/master/system.json", "manifest": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/raw/branch/master/system.json",
"download": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/archive/fvtt-hawkmoon-cyd-11.1.0.zip", "download": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/archive/fvtt-hawkmoon-cyd-11.1.1.zip",
"languages": [ "languages": [
{ {
"lang": "fr", "lang": "fr",

View File

@ -134,6 +134,10 @@
<label class="short-label">Résumé</label> <label class="short-label">Résumé</label>
</span> </span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="talent" title="Ajouter un Talent"><i
class="fas fa-plus"></i></a>
</div>
</li> </li>
{{#each talents as |talent key|}} {{#each talents as |talent key|}}
<li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="competence"> <li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="competence">
@ -162,7 +166,11 @@
<label class="short-label">Résumé</label> <label class="short-label">Résumé</label>
</span> </span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
</li> <div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="talent" title="Ajouter un Talent"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each talentsCell as |talent key|}} {{#each talentsCell as |talent key|}}
<li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="competence"> <li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="competence">
<img class="item-name-img" src="{{talent.img}}" /> <img class="item-name-img" src="{{talent.img}}" />
@ -346,6 +354,8 @@
</span> </span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if protection.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a> <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a> <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div> </div>

View File

@ -81,6 +81,10 @@
<label class="short-label">Résumé</label> <label class="short-label">Résumé</label>
</span> </span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="talent" title="Ajouter un Talent"><i
class="fas fa-plus"></i></a>
</div>
</li> </li>
{{#each talents as |talent key|}} {{#each talents as |talent key|}}
<li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="talent"> <li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="talent">

View File

@ -192,9 +192,13 @@
<label class="short-label">Résumé</label> <label class="short-label">Résumé</label>
</span> </span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="talent" title="Ajouter un Talent"><i
class="fas fa-plus"></i></a>
</div>
</li> </li>
{{#each talents as |talent key|}} {{#each talents as |talent key|}}
<li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="competence"> <li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="talent">
<img class="item-name-img" src="{{talent.img}}" /> <img class="item-name-img" src="{{talent.img}}" />
<span class="item-name-label competence-name">{{talent.name}}</span> <span class="item-name-label competence-name">{{talent.name}}</span>
<span class="item-name-label item-field-label-long2">{{talent.system.resumebonus}}</span> <span class="item-name-label item-field-label-long2">{{talent.system.resumebonus}}</span>
@ -221,9 +225,13 @@
<label class="short-label">Résumé</label> <label class="short-label">Résumé</label>
</span> </span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="talent" title="Ajouter un Talent"><i
class="fas fa-plus"></i></a>
</div>
</li> </li>
{{#each talentsCell as |talent key|}} {{#each talentsCell as |talent key|}}
<li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="competence"> <li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="talent">
<img class="item-name-img" src="{{talent.img}}" /> <img class="item-name-img" src="{{talent.img}}" />
<span class="item-name-label competence-name">{{talent.name}}</span> <span class="item-name-label competence-name">{{talent.name}}</span>
<span class="item-name-label item-field-label-long2">{{talent.system.resumebonus}}</span> <span class="item-name-label item-field-label-long2">{{talent.system.resumebonus}}</span>