Initial release
This commit is contained in:
@ -155,25 +155,13 @@ export default class CthulhuEternalProtagonist extends foundry.abstract.TypeData
|
||||
/**
|
||||
* Rolls a dice for a character.
|
||||
* @param {("save"|"resource|damage")} rollType The type of the roll.
|
||||
* @param {number} rollTarget The target value for the roll. Which caracteristic or resource. If the roll is a damage roll, this is the id of the item.
|
||||
* @param {"="|"+"|"++"|"-"|"--"} rollAdvantage If there is an avantage (+), a disadvantage (-), a double advantage (++), a double disadvantage (--) or a normal roll (=).
|
||||
* @param {number} rollItem The target value for the roll. Which caracteristic or resource. If the roll is a damage roll, this is the id of the item.
|
||||
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
|
||||
*/
|
||||
async roll(rollType, rollTarget, rollAdvantage = "=") {
|
||||
let rollValue
|
||||
async roll(rollType, rollItem) {
|
||||
let opponentTarget
|
||||
switch (rollType) {
|
||||
default:
|
||||
// Handle other cases or do nothing
|
||||
break
|
||||
}
|
||||
await this._roll(rollType, rollTarget, rollValue, opponentTarget, rollAdvantage)
|
||||
}
|
||||
|
||||
/** Main roll function
|
||||
*/
|
||||
async _roll(rollType, rollItem, opponentTarget = undefined) {
|
||||
const hasTarget = opponentTarget !== undefined
|
||||
|
||||
let roll = await CthulhuEternalRoll.prompt({
|
||||
rollType,
|
||||
rollItem,
|
||||
|
@ -12,6 +12,7 @@ export default class CthulhuEternalSkill extends foundry.abstract.TypeDataModel
|
||||
schema.bonus = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
schema.diceEvolved = new fields.BooleanField({ required: true, initial: true })
|
||||
schema.rollFailed = new fields.BooleanField({ required: true, initial: false })
|
||||
schema.isAdversary = new fields.BooleanField({ required: true, initial: false })
|
||||
|
||||
return schema
|
||||
}
|
||||
|
Reference in New Issue
Block a user