Add compendiums
All checks were successful
Release Creation / build (release) Successful in 1m40s

This commit is contained in:
2025-06-26 22:20:24 +02:00
parent b7dfc71335
commit 57eb9e76a4
44 changed files with 2284 additions and 99 deletions

View File

@@ -63,7 +63,7 @@ export default class FTLNomadRoll extends Roll {
static updateFullFormula(options) {
let fullFormula
if ( options.numericModifier >= 0) {
fullFormula = `${options.formula} + ${options.rollItem.value} + ${options.numericModifier}D`
fullFormula = `${options.formula} + ${options.rollItem.value} + ${options.numericModifier}D`
} else {
fullFormula = `${options.formula} + ${options.rollItem.value} - ${Math.abs(options.numericModifier)}D`
}
@@ -100,7 +100,7 @@ export default class FTLNomadRoll extends Roll {
});
return
case "weapon":
let actor = game.actors.get(options.actorId)
let actor = game.actors.get(options.actorId)
options.weapon = foundry.utils.duplicate(options.rollItem)
options.rollItem = actor.system.skills.combat
break
@@ -108,7 +108,7 @@ export default class FTLNomadRoll extends Roll {
break
}
const rollModes = Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
const rollModes = foundry.utils.duplicate(CONFIG.Dice.rollModes)
const fieldRollMode = new foundry.data.fields.StringField({
choices: rollModes,
blank: false,
@@ -125,7 +125,7 @@ export default class FTLNomadRoll extends Roll {
choiceRangeModifier[key] = { label: `${key} (${value}D)`, value: value }
if (!rangeModifier && value) {
rangeModifier = value
}
}
}
}
@@ -160,7 +160,7 @@ export default class FTLNomadRoll extends Roll {
hasTarget: options.hasTarget,
modifier,
}
const content = await renderTemplate("systems/fvtt-ftl-nomad/templates/roll-dialog.hbs", dialogContext)
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-ftl-nomad/templates/roll-dialog.hbs", dialogContext)
const title = FTLNomadRoll.createTitle(options.rollType, options.rollTarget)
const label = game.i18n.localize("FTLNOMAD.Roll.roll")
@@ -215,7 +215,7 @@ export default class FTLNomadRoll extends Roll {
rollData.targetScore = 8
if (Hooks.call("fvtt-ftl-nomad.preRoll", options, rollData) === false) return
let diceFormula = `${2+Math.abs(options.numericModifier)}D6`
if ( options.numericModifier > 0 ) {
diceFormula += `kh2 + ${options.rollItem.value}`
@@ -239,12 +239,12 @@ export default class FTLNomadRoll extends Roll {
let resultType = "failure"
if (this.total >= 8) {
resultType = "success"
// Detect if decimal == unit in the dire total result
// Detect if decimal == unit in the dire total result
}
this.options.resultType = resultType
this.options.isSuccess = resultType === "success"
this.options.isFailure = resultType === "failure"
this.options.isSuccess = resultType === "success"
this.options.isFailure = resultType === "failure"
this.options.isEncumbered = rollData.isEncumbered
this.options.rollData = foundry.utils.duplicate(rollData)
}
@@ -270,7 +270,7 @@ export default class FTLNomadRoll extends Roll {
/** @override */
async render(chatOptions = {}) {
let chatData = await this._getChatCardData(chatOptions.isPrivate)
return await renderTemplate(this.constructor.CHAT_TEMPLATE, chatData)
return await foundry.applications.handlebars.renderTemplate(this.constructor.CHAT_TEMPLATE, chatData)
}
/**