Combat tab

This commit is contained in:
LeRatierBretonnien 2023-03-22 22:43:30 +01:00
parent e0adf04753
commit 4ca23257cb
6 changed files with 26 additions and 19 deletions

View File

@ -152,6 +152,12 @@ export class Hero6ActorSheet extends ActorSheet {
const characKey = $(event.currentTarget).data("charac-key"); const characKey = $(event.currentTarget).data("charac-key");
this.actor.rollCharac(characKey); this.actor.rollCharac(characKey);
}); });
html.find('.roll-direct').click((event) => {
const rollFormula = $(event.currentTarget).data("roll-formula");
let roll = new Roll(rollFormula).roll({async: false})
roll.toMessage()
});
html.find('.roll-item').click((event) => { html.find('.roll-item').click((event) => {
const li = $(event.currentTarget).parents(".item"); const li = $(event.currentTarget).parents(".item");
let itemId = li.data("item-id") let itemId = li.data("item-id")

View File

@ -66,6 +66,10 @@ export class Hero6Actor extends Actor {
if (this.type == "character") { if (this.type == "character") {
} }
} }
computeDicesValue() {
this.system.biodata.presenceattack = Hero6Utility.getDerivatedDiceValue(this.system.characteristics.pre.value )
this.system.characteristics.str.strdice = Hero6Utility.getDerivatedDiceValue(this.system.characteristics.str.value )
}
/* -------------------------------------------- */ /* -------------------------------------------- */
prepareDerivedData() { prepareDerivedData() {
@ -73,6 +77,7 @@ export class Hero6Actor extends Actor {
this.system.encCapacity = this.getEncumbranceCapacity() this.system.encCapacity = this.getEncumbranceCapacity()
this.buildContainerTree() this.buildContainerTree()
this.computeHitPoints() this.computeHitPoints()
this.computeDicesValue()
} }
super.prepareDerivedData(); super.prepareDerivedData();

View File

@ -76,6 +76,15 @@ export class Hero6Utility {
}) */ }) */
} }
/*-------------------------------------------- */
static getDerivatedDiceValue(value) {
let dices = Math.floor(value/5) +"d6"
if ( value % 5 > 2) {
dices += "+1d3"
}
return dices
}
/*-------------------------------------------- */ /*-------------------------------------------- */
static upperFirst(text) { static upperFirst(text) {
if (typeof text !== 'string') return text if (typeof text !== 'string') return text

View File

@ -173,19 +173,6 @@ table { border: 1px solid #7a7971;}
grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-columns: repeat(12, minmax(0, 1fr));
} }
.flex-group-center,
.flex-group-left,
.flex-group-right {
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
text-align: center;
padding: 5px;
}
.flex-group-left { .flex-group-left {
-webkit-box-pack: start; -webkit-box-pack: start;
-ms-flex-pack: start; -ms-flex-pack: start;

View File

@ -91,7 +91,7 @@
"styles": [ "styles": [
"styles/simple.css" "styles/simple.css"
], ],
"version": "10.0.28", "version": "10.0.29",
"compatibility": { "compatibility": {
"minimum": "10", "minimum": "10",
"verified": "10", "verified": "10",
@ -99,7 +99,7 @@
}, },
"title": "Hero System v6 for FoundrtVTT (Official)", "title": "Hero System v6 for FoundrtVTT (Official)",
"manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/raw/branch/main/system.json", "manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/raw/branch/main/system.json",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.17.zip", "download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.29.zip",
"url": "https://www.uberwald.me/gitea/uberwald/", "url": "https://www.uberwald.me/gitea/uberwald/",
"background": "images/ui/hro6_welcome_page.webp", "background": "images/ui/hro6_welcome_page.webp",
"id": "fvtt-hero-system-6" "id": "fvtt-hero-system-6"

View File

@ -115,9 +115,9 @@
<div class="grid grid2col"> <div class="grid grid2col">
<div> <div>
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
<li class="flexrow item"> <li class="item">
<label class="item-field-label-medium">STR Dice</label> <label class="item-field-label-medium">STR Dice</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.str.strdice" value="{{characteristics.str.strdice}}" data-dtype="String" /> <a class="roll-direct" data-roll-formula="{{characteristics.str.strdice}}"><i class="fas fa-dice"></i>{{characteristics.str.strdice}}</a>
<label class="item-field-label-short">&nbsp;</label> <label class="item-field-label-short">&nbsp;</label>
<label class="item-field-label-medium">Lift</label> <label class="item-field-label-medium">Lift</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.str.lift" value="{{characteristics.str.lift}}" data-dtype="String" /> <input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.str.lift" value="{{characteristics.str.lift}}" data-dtype="String" />
@ -127,7 +127,7 @@
</li> </li>
<li class="flexrow item"> <li class="flexrow item">
<label class="item-field-label-long">Presence attack</label> <label class="item-field-label-long">Presence attack</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.biodata.presenceattack" value="{{system.biodata.presenceattack}}" data-dtype="Number" /> <a class="roll-direct" data-roll-formula="{{system.biodata.presenceattack}}"><i class="fas fa-dice"></i>{{system.biodata.presenceattack}}</a>
</li> </li>
</ul> </ul>
@ -246,7 +246,7 @@
</div> </div>
<div class="flexrow"> <div class="item">
<label class="item-field-label-short">OCV</label> <label class="item-field-label-short">OCV</label>
<input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.ocv.value" value="{{characteristics.ocv.value}}" data-dtype="Number" /> <input type="text" class="item-field-label-short update-field" data-field-name="system.characteristics.ocv.value" value="{{characteristics.ocv.value}}" data-dtype="Number" />
<label class="item-field-label-short">&nbsp;</label> <label class="item-field-label-short">&nbsp;</label>