Fix malus

This commit is contained in:
LeRatierBretonnien 2023-04-23 23:13:31 +02:00
parent 2da1f56a91
commit 55a2a8e3c3
3 changed files with 7 additions and 8 deletions

View File

@ -304,12 +304,12 @@ export class HeritiersActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
getPvMalus() { getPvMalus() {
if (this.system.pv.value > 0) { if (this.system.pv.value > 0) {
if (this.system.pv.value < this.system.pv.max / 2) {
return { name: "Santé", value: -1 }
}
if (this.system.pv.value < 5) { if (this.system.pv.value < 5) {
return { name: "Santé", value: -2 } return { name: "Santé", value: -2 }
} }
if (this.system.pv.value < this.system.pv.max / 2) {
return { name: "Santé", value: -1 }
}
return { name: "Santé", value: 0 } return { name: "Santé", value: 0 }
} }
return { name: "Moribond(e)", value: -50 } return { name: "Moribond(e)", value: -50 }

View File

@ -1,7 +1,7 @@
{ {
"id": "fvtt-les-heritiers", "id": "fvtt-les-heritiers",
"description": "Les Héritiers pour FoundryVTT", "description": "Les Héritiers pour FoundryVTT",
"version": "10.1.1", "version": "10.1.2",
"authors": [ "authors": [
{ {
"name": "Uberwald/LeRatierBretonnien", "name": "Uberwald/LeRatierBretonnien",
@ -19,7 +19,7 @@
"gridUnits": "m", "gridUnits": "m",
"license": "LICENSE.txt", "license": "LICENSE.txt",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/raw/branch/master/system.json", "manifest": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/raw/branch/master/system.json",
"download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-les-heritiers-10.1.1.zip", "download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-les-heritiers-10.1.2.zip",
"languages": [ "languages": [
{ {
"lang": "fr", "lang": "fr",
@ -122,7 +122,6 @@
"background": "systems/fvtt-les-heritiers/assets/ui/wallpaper_foundry2.webp", "background": "systems/fvtt-les-heritiers/assets/ui/wallpaper_foundry2.webp",
"compatibility": { "compatibility": {
"minimum": "10", "minimum": "10",
"verified": "10", "verified": "10"
"maximum": "10"
} }
} }

View File

@ -47,7 +47,7 @@
<input type="text" class="item-field-label-short" name="system.pv.value" value="{{system.pv.value}}" data-dtype="Number" /> <input type="text" class="item-field-label-short" name="system.pv.value" value="{{system.pv.value}}" data-dtype="Number" />
<input type="text" class="item-field-label-short" name="system.pv.max" value="{{system.pv.max}}" data-dtype="Number" /> <input type="text" class="item-field-label-short" name="system.pv.max" value="{{system.pv.max}}" data-dtype="Number" />
<label class="item-field-label-short">Malus</label> <label class="item-field-label-short">Malus</label>
<input type="text" class="item-field-label-short" value="{{pvMalus}}" data-dtype="Number" disabled /> <input type="text" class="item-field-label-short" value="{{pvMalus.value}}" data-dtype="Number" disabled />
<span>&nbsp;&nbsp;</span> <span>&nbsp;&nbsp;</span>
<select class="item-field-label-medium" type="text" name="system.statutmasque" value="{{system.statutmasque}}" data-dtype="string"> <select class="item-field-label-medium" type="text" name="system.statutmasque" value="{{system.statutmasque}}" data-dtype="string">