Combat tab
This commit is contained in:
@@ -152,6 +152,12 @@ export class Hero6ActorSheet extends ActorSheet {
|
||||
const characKey = $(event.currentTarget).data("charac-key");
|
||||
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) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
let itemId = li.data("item-id")
|
||||
|
@@ -66,6 +66,10 @@ export class Hero6Actor extends Actor {
|
||||
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() {
|
||||
|
||||
@@ -73,6 +77,7 @@ export class Hero6Actor extends Actor {
|
||||
this.system.encCapacity = this.getEncumbranceCapacity()
|
||||
this.buildContainerTree()
|
||||
this.computeHitPoints()
|
||||
this.computeDicesValue()
|
||||
}
|
||||
|
||||
super.prepareDerivedData();
|
||||
|
@@ -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) {
|
||||
if (typeof text !== 'string') return text
|
||||
|
Reference in New Issue
Block a user