All fixes requested
This commit is contained in:
@@ -15,8 +15,6 @@ export class Hero6Utility {
|
||||
Hero6Utility.dropItemOnToken(canvas, data)
|
||||
});*/
|
||||
|
||||
Hero6Commands.init();
|
||||
|
||||
Handlebars.registerHelper('count', function (list) {
|
||||
return list.length;
|
||||
})
|
||||
@@ -142,24 +140,6 @@ export class Hero6Utility {
|
||||
html.on("click", '.view-item-from-chat', event => {
|
||||
game.system.crucible.creator.openItemView(event)
|
||||
})
|
||||
html.on("click", '.roll-defense-melee', event => {
|
||||
let rollId = $(event.currentTarget).data("roll-id")
|
||||
let rollData = Hero6Utility.getRollData(rollId)
|
||||
rollData.defenseWeaponId = $(event.currentTarget).data("defense-weapon-id")
|
||||
let actor = game.canvas.tokens.get(rollData.defenderTokenId).actor
|
||||
if (actor && (game.user.isGM || actor.isOwner)) {
|
||||
actor.rollDefenseMelee(rollData)
|
||||
}
|
||||
})
|
||||
html.on("click", '.roll-defense-ranged', event => {
|
||||
let rollId = $(event.currentTarget).data("roll-id")
|
||||
let rollData = Hero6Utility.getRollData(rollId)
|
||||
let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor
|
||||
if (defender && (game.user.isGM || defender.isOwner)) {
|
||||
defender.rollDefenseRanged(rollData)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -376,10 +356,6 @@ export class Hero6Utility {
|
||||
}
|
||||
rollData.margin = target - rollData.result
|
||||
|
||||
if (rollData.item && rollData.item.system.computebody) {
|
||||
rollData.bodyValue = this.computeBody(myRoll)
|
||||
}
|
||||
|
||||
this.outputRollMessage(rollData)
|
||||
}
|
||||
|
||||
@@ -389,7 +365,7 @@ export class Hero6Utility {
|
||||
rollData.roll = roll
|
||||
|
||||
rollData.result = roll.total
|
||||
rollData.bodyValue = this.computeBody(rollData.roll)
|
||||
rollData.bodyValue = this.computeBodyValue(rollData.roll)
|
||||
|
||||
this.outputRollMessage(rollData)
|
||||
}
|
||||
@@ -403,6 +379,22 @@ export class Hero6Utility {
|
||||
console.log("Rolldata result", rollData)
|
||||
}
|
||||
|
||||
/* -------------- ----------------------------- */
|
||||
static convertRollHeroSyntax( hero6Formula) {
|
||||
// Ensure we have no space at all
|
||||
//hero6Formula = hero6Formula.replace(/\s/g, '')
|
||||
let hasHalfDice = ""
|
||||
if (hero6Formula.match("1/2d6")) {
|
||||
hero6Formula = hero6Formula.replace("1/2d6", "d6")
|
||||
hasHalfDice = "+round(1d6)"
|
||||
}
|
||||
|
||||
let foundryFormula = hero6Formula + hasHalfDice
|
||||
foundryFormula = foundryFormula.replace(' ', '')
|
||||
console.log("Parsed formula : ", hero6Formula, foundryFormula)
|
||||
return foundryFormula
|
||||
}
|
||||
|
||||
/* -------------- ----------------------------- */
|
||||
static sortArrayObjectsByName(myArray) {
|
||||
myArray.sort((a, b) => {
|
||||
|
Reference in New Issue
Block a user