Update release
This commit is contained in:
parent
0368be050b
commit
b9b8fa7c0d
@ -49,7 +49,7 @@ export class Hero6Utility {
|
|||||||
return __locationNames[key]
|
return __locationNames[key]
|
||||||
})
|
})
|
||||||
Handlebars.registerHelper('isSkillCustom', function (key) {
|
Handlebars.registerHelper('isSkillCustom', function (key) {
|
||||||
if (key == "custom" ) {
|
if (key == "custom") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
@ -82,15 +82,15 @@ export class Hero6Utility {
|
|||||||
|
|
||||||
/*-------------------------------------------- */
|
/*-------------------------------------------- */
|
||||||
static getDerivatedDiceFormulas(value) {
|
static getDerivatedDiceFormulas(value) {
|
||||||
let rollFormula = Math.floor(value/5) +"d6"
|
let rollFormula = Math.floor(value / 5) + "d6"
|
||||||
let displayFormula = Math.floor(value/5)
|
let displayFormula = Math.floor(value / 5)
|
||||||
if ( value % 5 > 2) {
|
if (value % 5 > 2) {
|
||||||
rollFormula += "+round(1d6/2)"
|
rollFormula += "+round(1d6/2)"
|
||||||
displayFormula += " 1/2d6"
|
displayFormula += " 1/2d6"
|
||||||
} else {
|
} else {
|
||||||
displayFormula += "d6"
|
displayFormula += "d6"
|
||||||
}
|
}
|
||||||
return {rollFormula:rollFormula, displayFormula: displayFormula}
|
return { rollFormula: rollFormula, displayFormula: displayFormula }
|
||||||
}
|
}
|
||||||
/*-------------------------------------------- */
|
/*-------------------------------------------- */
|
||||||
static upperFirst(text) {
|
static upperFirst(text) {
|
||||||
@ -308,6 +308,33 @@ export class Hero6Utility {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------- ----------------------------- */
|
||||||
|
static computeBodyValue(roll) {
|
||||||
|
let bodyValue = 0
|
||||||
|
for (let term of roll.terms) {
|
||||||
|
if (term.constructor.name == "Die") {
|
||||||
|
for (let value of term.values) {
|
||||||
|
if (value > 1) {
|
||||||
|
bodyValue += 1
|
||||||
|
}
|
||||||
|
if (value == 6) {
|
||||||
|
bodyValue += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (term.constructor.name == "NumericTerm") {
|
||||||
|
if (term.total > 1) {
|
||||||
|
bodyValue += 1
|
||||||
|
}
|
||||||
|
if (term.total == 6) {
|
||||||
|
bodyValue += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bodyValue
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async rollHero6(rollData) {
|
static async rollHero6(rollData) {
|
||||||
|
|
||||||
@ -331,6 +358,7 @@ export class Hero6Utility {
|
|||||||
myRoll = new Roll(diceFormula).roll({ async: false })
|
myRoll = new Roll(diceFormula).roll({ async: false })
|
||||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||||
}
|
}
|
||||||
|
|
||||||
rollData.roll = myRoll
|
rollData.roll = myRoll
|
||||||
rollData.target = target
|
rollData.target = target
|
||||||
rollData.diceFormula = diceFormula
|
rollData.diceFormula = diceFormula
|
||||||
@ -339,47 +367,28 @@ export class Hero6Utility {
|
|||||||
if (rollData.result <= target) {
|
if (rollData.result <= target) {
|
||||||
rollData.isSuccess = true
|
rollData.isSuccess = true
|
||||||
}
|
}
|
||||||
if ( myRoll.terms[0].total == 3) { // Always a success
|
if (myRoll.terms[0].total == 3) { // Always a success
|
||||||
rollData.isSuccess = true
|
rollData.isSuccess = true
|
||||||
}
|
}
|
||||||
if ( myRoll.terms[0].total == 18) { // Always a failure
|
if (myRoll.terms[0].total == 18) { // Always a failure
|
||||||
rollData.isSuccess = false
|
rollData.isSuccess = false
|
||||||
}
|
}
|
||||||
rollData.margin = target - rollData.result
|
rollData.margin = target - rollData.result
|
||||||
|
|
||||||
|
if (rollData.item && rollData.item.system.computebody) {
|
||||||
|
rollData.bodyValue = this.computeBody(myRoll)
|
||||||
|
}
|
||||||
|
|
||||||
this.outputRollMessage(rollData)
|
this.outputRollMessage(rollData)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------- ----------------------------- */
|
/* -------------- ----------------------------- */
|
||||||
static processDirectRoll(rollData ) {
|
static processDirectRoll(rollData) {
|
||||||
let roll = new Roll(rollData.rollFormula).roll({async: false})
|
let roll = new Roll(rollData.rollFormula).roll({ async: false })
|
||||||
rollData.roll = roll
|
rollData.roll = roll
|
||||||
|
|
||||||
// Compute BODY
|
|
||||||
let bodyValue = 0
|
|
||||||
for (let term of roll.terms) {
|
|
||||||
if ( term.constructor.name == "Die") {
|
|
||||||
for (let value of term.values) {
|
|
||||||
if (value > 1) {
|
|
||||||
bodyValue +=1
|
|
||||||
}
|
|
||||||
if (value == 6) {
|
|
||||||
bodyValue +=1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( term.constructor.name == "NumericTerm") {
|
|
||||||
if (term.total > 1) {
|
|
||||||
bodyValue +=1
|
|
||||||
}
|
|
||||||
if (term.total == 6) {
|
|
||||||
bodyValue +=1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rollData.result = roll.total
|
rollData.result = roll.total
|
||||||
rollData.bodyValue = bodyValue
|
rollData.bodyValue = this.computeBody(rollData.roll)
|
||||||
|
|
||||||
this.outputRollMessage(rollData)
|
this.outputRollMessage(rollData)
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
"styles": [
|
"styles": [
|
||||||
"styles/simple.css"
|
"styles/simple.css"
|
||||||
],
|
],
|
||||||
"version": "10.0.32",
|
"version": "10.0.33",
|
||||||
"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.32.zip",
|
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-hero-system-6/archive/fvtt-hero-system-6-v10.0.33.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"
|
||||||
|
@ -345,6 +345,7 @@
|
|||||||
"endurance": 0,
|
"endurance": 0,
|
||||||
"hasroll": false,
|
"hasroll": false,
|
||||||
"roll": 0,
|
"roll": 0,
|
||||||
|
"computebody": false,
|
||||||
"items": {}
|
"items": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -135,7 +135,7 @@
|
|||||||
<ul class="stat-list alternate-list">
|
<ul class="stat-list alternate-list">
|
||||||
<li class="item flexrow list-item items-title-bg">
|
<li class="item flexrow list-item items-title-bg">
|
||||||
<span class="item-field-label-long-img">
|
<span class="item-field-label-long-img">
|
||||||
<label class="">{{upperFirst key}} Maneuvers</label>
|
<label class="">{{upperFirst key}} Standard Maneuver</label>
|
||||||
</span>
|
</span>
|
||||||
<span class="item-field-label-short">
|
<span class="item-field-label-short">
|
||||||
<label class="short-label">PHA</label>
|
<label class="short-label">PHA</label>
|
||||||
|
@ -6,4 +6,8 @@
|
|||||||
<li class="flexrow"><label class="item-field-label-long">Roll</label>
|
<li class="flexrow"><label class="item-field-label-long">Roll</label>
|
||||||
<input type="text" class="item-field-label-medium" name="system.roll" value="{{system.roll}}" data-dtype="Number"/>
|
<input type="text" class="item-field-label-medium" name="system.roll" value="{{system.roll}}" data-dtype="Number"/>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="flexrow"><label class="item-field-label-long">Computes BODY ?</label>
|
||||||
|
<label class="item-field-label-medium"><input type="checkbox" name="system.computebody" {{checked system.computebody}}/></label>
|
||||||
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user