Update sheet again...
This commit is contained in:
@ -119,12 +119,13 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
||||
context.tab = context.tabs.combat
|
||||
context.weapons = doc.itemTypes.weapon
|
||||
context.armors = doc.itemTypes.armor
|
||||
context.shields = doc.itemTypes.shield
|
||||
break
|
||||
case "equipment":
|
||||
context.tab = context.tabs.equipment
|
||||
context.equipments = doc.itemTypes.equipment
|
||||
break
|
||||
case "biography":
|
||||
case "biography":
|
||||
context.tab = context.tabs.biography
|
||||
context.enrichedDescription = await TextEditor.enrichHTML(doc.system.description, { async: true })
|
||||
context.enrichedNotes = await TextEditor.enrichHTML(doc.system.notes, { async: true })
|
||||
@ -190,7 +191,7 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
||||
|
||||
static #onDivinityPointsMinus(event, target) {
|
||||
let points = this.actor.system.divinityPoints.value
|
||||
points -= 1
|
||||
points -= 1
|
||||
points = Math.max(points, 0)
|
||||
this.actor.update({ "system.divinityPoints.value": points })
|
||||
}
|
||||
@ -208,7 +209,7 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
||||
points = Math.max(points, 0)
|
||||
this.actor.update({ "system.aetherPoints.value": points })
|
||||
}
|
||||
|
||||
|
||||
static #onCreateEquipment(event, target) {
|
||||
}
|
||||
|
||||
@ -225,8 +226,8 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
||||
let tab = foundry.utils.duplicate(this.actor.system.hp.wounds)
|
||||
tab[index][fieldName] = newValue
|
||||
console.log(tab, index, fieldName, newValue)
|
||||
this.actor.update( { "system.hp.wounds": tab } );
|
||||
})
|
||||
this.actor.update({ "system.hp.wounds": tab });
|
||||
})
|
||||
}
|
||||
super._onRender();
|
||||
}
|
||||
@ -279,6 +280,16 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
||||
let rollTarget
|
||||
let rollKey = event.target.dataset.rollKey
|
||||
switch (rollType) {
|
||||
case "granted":
|
||||
rollTarget = {
|
||||
name: rollKey,
|
||||
formula: foundry.utils.duplicate(this.document.system.granted[rollKey]),
|
||||
rollKey: rollKey
|
||||
}
|
||||
if ( rollTarget.formula === "" || rollTarget.formula === undefined) {
|
||||
rollTarget.formula = 0
|
||||
}
|
||||
break;
|
||||
case "challenge":
|
||||
rollTarget = foundry.utils.duplicate(this.document.system.challenges[rollKey])
|
||||
rollTarget.rollKey = rollKey
|
||||
@ -336,12 +347,21 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
||||
console.error("Weapon or skill not found", weapon, skill)
|
||||
ui.notifications.warn(game.i18n.localize("LETHALFANTASY.Notifications.skillNotFound"))
|
||||
return
|
||||
}
|
||||
}
|
||||
rollTarget = skill
|
||||
rollTarget.weapon = weapon
|
||||
rollTarget.weaponSkillModifier = skill.weaponSkillModifier
|
||||
rollTarget.rollKey = rollKey
|
||||
rollTarget.combat = foundry.utils.duplicate(this.actor.system.combat)
|
||||
if ( rollType === "weapon-damage-small" || rollType === "weapon-damage-medium") {
|
||||
rollTarget.grantedDice = this.actor.system.granted.damageDice
|
||||
}
|
||||
if ( rollType === "weapon-attack") {
|
||||
rollTarget.grantedDice = this.actor.system.granted.attackDice
|
||||
}
|
||||
if ( rollType === "weapon-defense") {
|
||||
rollTarget.grantedDice = this.actor.system.granted.defenseDice
|
||||
}
|
||||
break
|
||||
default:
|
||||
ui.notifications.error(game.i18n.localize("LETHALFANTASY.Notifications.rollTypeNotFound") + String(rollType))
|
||||
@ -351,7 +371,7 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
||||
// In all cases
|
||||
rollTarget.magicUser = this.actor.system.biodata.magicUser
|
||||
rollTarget.actorModifiers = foundry.utils.duplicate(this.actor.system.modifiers)
|
||||
console.log(rollTarget)
|
||||
console.log("ROLLTARGET", rollTarget)
|
||||
await this.document.system.roll(rollType, rollTarget)
|
||||
}
|
||||
// #endregion
|
||||
|
@ -25,6 +25,10 @@ export const MONSTER_RESIST = Object.freeze({
|
||||
perception: {
|
||||
id: "perception",
|
||||
label: "LETHALFANTASY.Monster.perception.label"
|
||||
},
|
||||
stealth: {
|
||||
id: "stealth",
|
||||
label: "LETHALFANTASY.Monster.stealth.label"
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -17,7 +17,7 @@ export default class LethalFantasyActor extends Actor {
|
||||
const skills = await LethalFantasyUtils.loadCompendium("fvtt-lethal-fantasy.lf-skills")
|
||||
data.items = data.items || []
|
||||
for (let skill of skills) {
|
||||
if (skill.system.category === "layperson" || skill.system.category === "professional") {
|
||||
if (skill.system.category === "layperson") {
|
||||
data.items.push(skill.toObject())
|
||||
}
|
||||
}
|
||||
|
@ -122,6 +122,8 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let hasChangeDice = false
|
||||
let hasD30 = false
|
||||
let hasFavor = false
|
||||
let hasMaxValue = true
|
||||
let hasGrantedDice = false
|
||||
|
||||
if (options.rollType === "challenge" || options.rollType === "save") {
|
||||
options.rollName = options.rollTarget.rollKey
|
||||
@ -138,6 +140,17 @@ export default class LethalFantasyRoll extends Roll {
|
||||
hasFavor = true
|
||||
}
|
||||
|
||||
} else if (options.rollType === "granted") {
|
||||
hasD30 = false
|
||||
options.rollName = `Granted ${options.rollTarget.rollKey}`
|
||||
dice = options.rollTarget.formula
|
||||
baseFormula = options.rollTarget.formula
|
||||
hasModifier = false
|
||||
maxValue = 100
|
||||
hasMaxValue = false
|
||||
hasChangeDice = false
|
||||
hasFavor = false
|
||||
|
||||
} else if (options.rollType === "monster-attack" || options.rollType === "monster-defense") {
|
||||
hasD30 = true
|
||||
options.rollName = options.rollTarget.name
|
||||
@ -148,10 +161,10 @@ export default class LethalFantasyRoll extends Roll {
|
||||
hasChangeDice = false
|
||||
hasFavor = true
|
||||
if (options.rollType === "monster-attack") {
|
||||
options.rollTarget.value = options.rollTarget.attackModifier
|
||||
options.rollTarget.value = options.rollTarget.attackModifier
|
||||
options.rollTarget.charModifier = 0
|
||||
} else {
|
||||
options.rollTarget.value = options.rollTarget.defenseModifier
|
||||
options.rollTarget.value = options.rollTarget.defenseModifier
|
||||
options.rollTarget.charModifier = 0
|
||||
}
|
||||
|
||||
@ -170,7 +183,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
hasFavor = true
|
||||
hasChangeDice = false
|
||||
options.rollTarget.value = options.rollTarget.system.skillTotal
|
||||
|
||||
|
||||
} else if (options.rollType === "weapon-attack" || options.rollType === "weapon-defense") {
|
||||
hasD30 = true
|
||||
options.rollName = options.rollTarget.name
|
||||
@ -224,7 +237,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
dice = dice.replace("E", "")
|
||||
baseFormula = dice
|
||||
maxValue = 20
|
||||
|
||||
|
||||
} else if (options.rollType.includes("monster-damage")) {
|
||||
options.rollName = options.rollTarget.name
|
||||
hasModifier = true
|
||||
@ -277,10 +290,9 @@ export default class LethalFantasyRoll extends Roll {
|
||||
hasTarget: options.hasTarget,
|
||||
modifier,
|
||||
saveSpell: false,
|
||||
favor : "none",
|
||||
favor: "none",
|
||||
targetName
|
||||
}
|
||||
console.log("dialogContext", dialogContext)
|
||||
const content = await renderTemplate("systems/fvtt-lethal-fantasy/templates/roll-dialog.hbs", dialogContext)
|
||||
|
||||
const title = LethalFantasyRoll.createTitle(options.rollType, options.rollTarget)
|
||||
@ -301,26 +313,32 @@ export default class LethalFantasyRoll extends Roll {
|
||||
},
|
||||
},
|
||||
],
|
||||
actions: {
|
||||
"selectGranted": (event, button, dialog) => {
|
||||
hasGrantedDice = true
|
||||
}
|
||||
},
|
||||
rejectClose: false // Click on Close button will not launch an error
|
||||
})
|
||||
|
||||
// If the user cancels the dialog, exit
|
||||
if (rollContext === null) return
|
||||
console.log("rollContext", rollContext, hasGrantedDice)
|
||||
|
||||
let fullModifier = 0
|
||||
let titleFormula = ""
|
||||
dice = rollContext.changeDice || dice
|
||||
if (hasModifier) {
|
||||
let bonus = Number(options.rollTarget.value)
|
||||
let bonus = Number(options.rollTarget.value)
|
||||
fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus
|
||||
fullModifier += (rollContext.saveSpell) ? options.rollTarget.actorModifiers.saveModifier : 0
|
||||
fullModifier += (rollContext.saveSpell) ? options.rollTarget.actorModifiers.saveModifier : 0
|
||||
|
||||
if (fullModifier === 0) {
|
||||
modifierFormula = "0"
|
||||
} else {
|
||||
if (options.rollType === "skill") {
|
||||
if (options.rollType === "skill") {
|
||||
modifierFormula = `${fullModifier}`
|
||||
} else {
|
||||
} else {
|
||||
let modAbs = Math.abs(fullModifier)
|
||||
modifierFormula = `d${modAbs + 1} - 1`
|
||||
}
|
||||
@ -346,7 +364,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
if (options.rollType === "save" && (options.rollTarget.rollKey === "pain" || options.rollTarget.rollKey === "poison" || options.rollTarget.rollKey === "contagion")) {
|
||||
hasD30 = false
|
||||
}
|
||||
|
||||
|
||||
maxValue = Number(baseFormula.match(/\d+$/)[0]) // Update the max value agains
|
||||
|
||||
const rollData = {
|
||||
@ -359,6 +377,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
actorImage: options.actorImage,
|
||||
rollMode: rollContext.visibility,
|
||||
hasTarget: options.hasTarget,
|
||||
hasGrantedDice,
|
||||
titleFormula,
|
||||
targetName,
|
||||
...rollContext,
|
||||
@ -378,7 +397,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
const rollModifier = new Roll(modifierFormula, options.data, rollData)
|
||||
await rollModifier.evaluate()
|
||||
await rollBase.evaluate()
|
||||
|
||||
|
||||
let rollFavor
|
||||
let badResult
|
||||
if (rollContext.favor === "favor") {
|
||||
@ -412,7 +431,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
if (hasD30) {
|
||||
let rollD30 = await new Roll("1D30").evaluate()
|
||||
if (game?.dice3d) {
|
||||
game.dice3d.showForRoll(rollD30, game.user, true)
|
||||
await game.dice3d.showForRoll(rollD30, game.user, true)
|
||||
}
|
||||
options.D30result = rollD30.total
|
||||
}
|
||||
@ -428,14 +447,30 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let diceResult = rollBase.dice[i].results[j].result
|
||||
diceResults.push({ dice: `${singleDice}`, value: diceResult })
|
||||
diceSum += diceResult
|
||||
while (diceResult === maxValue) {
|
||||
let r = await new Roll(baseFormula).evaluate()
|
||||
diceResult = r.dice[0].results[0].result
|
||||
diceResults.push({ dice: `${singleDice}-1`, value: diceResult - 1 })
|
||||
diceSum += (diceResult - 1)
|
||||
if (hasMaxValue) {
|
||||
while (diceResult === maxValue) {
|
||||
let r = await new Roll(baseFormula).evaluate()
|
||||
if (game?.dice3d) {
|
||||
await game.dice3d.showForRoll(r, game.user, true)
|
||||
}
|
||||
diceResult = r.dice[0].results[0].result
|
||||
diceResults.push({ dice: `${singleDice}-1`, value: diceResult - 1 })
|
||||
diceSum += (diceResult - 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( hasGrantedDice) {
|
||||
let grantedRoll = new Roll(options.rollTarget.grantedDice)
|
||||
await grantedRoll.evaluate()
|
||||
if (game?.dice3d) {
|
||||
await game.dice3d.showForRoll(grantedRoll, game.user, true)
|
||||
}
|
||||
diceResults.push({ dice: `${options.rollTarget.grantedDice}`, value: grantedRoll.total })
|
||||
rollTotal += grantedRoll.total
|
||||
}
|
||||
|
||||
if (fullModifier !== 0) {
|
||||
diceResults.push({ dice: `${rollModifier.formula}`, value: rollModifier.total })
|
||||
if (fullModifier < 0) {
|
||||
@ -477,9 +512,9 @@ export default class LethalFantasyRoll extends Roll {
|
||||
default: "public",
|
||||
})
|
||||
|
||||
if ( SYSTEM.INITIATIVE_DICE_CHOICES_PER_CLASS[options.actorClass] ) {
|
||||
if (SYSTEM.INITIATIVE_DICE_CHOICES_PER_CLASS[options.actorClass]) {
|
||||
options.initiativeDiceChoice = SYSTEM.INITIATIVE_DICE_CHOICES_PER_CLASS[options.actorClass]
|
||||
} else {
|
||||
} else {
|
||||
options.initiativeDiceChoice = SYSTEM.INITIATIVE_DICE_CHOICES_PER_CLASS["untrained"]
|
||||
}
|
||||
|
||||
@ -492,7 +527,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
rollModes
|
||||
}
|
||||
console.log("CTX", dialogContext)
|
||||
|
||||
|
||||
const content = await renderTemplate("systems/fvtt-lethal-fantasy/templates/roll-initiative-dialog.hbs", dialogContext)
|
||||
|
||||
const label = game.i18n.localize("LETHALFANTASY.Label.initiative")
|
||||
@ -517,31 +552,33 @@ export default class LethalFantasyRoll extends Roll {
|
||||
|
||||
let initRoll = new Roll(`min(${rollContext.initiativeDice}, ${options.maxInit})`, options.data, rollContext)
|
||||
await initRoll.evaluate()
|
||||
let msg = await initRoll.toMessage( {flavor: `Initiative for ${options.actorName}`}, {rollMode: rollContext.visibility} )
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||
let msg = await initRoll.toMessage({ flavor: `Initiative for ${options.actorName}` }, { rollMode: rollContext.visibility })
|
||||
if (game?.dice3d) {
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||
}
|
||||
|
||||
if (options.combatId && options.combatantId) {
|
||||
let combat = game.combats.get(options.combatId)
|
||||
combat.updateEmbeddedDocuments("Combatant", [ { _id: options.combatantId, initiative: initRoll.total, 'system.progressionCount': 0 } ]);
|
||||
combat.updateEmbeddedDocuments("Combatant", [{ _id: options.combatantId, initiative: initRoll.total, 'system.progressionCount': 0 }]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static async promptProgressionDice(options = {}) {
|
||||
|
||||
|
||||
const rollModes = Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
|
||||
const fieldRollMode = new foundry.data.fields.StringField({
|
||||
choices: rollModes,
|
||||
blank: false,
|
||||
default: "public",
|
||||
})
|
||||
let dialogContext = {
|
||||
let dialogContext = {
|
||||
progressionDiceId: "",
|
||||
fieldRollMode,
|
||||
rollModes,
|
||||
...options
|
||||
}
|
||||
|
||||
|
||||
console.log("CTX PROGRESSION", dialogContext)
|
||||
|
||||
const content = await renderTemplate("systems/fvtt-lethal-fantasy/templates/roll-progression-dice-dialog.hbs", dialogContext)
|
||||
@ -565,23 +602,23 @@ export default class LethalFantasyRoll extends Roll {
|
||||
},
|
||||
{
|
||||
action: "cancel",
|
||||
label: "Other action, no progression dice",
|
||||
callback: (event, button, dialog) => {
|
||||
return null;
|
||||
}
|
||||
label: "Other action, no progression dice",
|
||||
callback: (event, button, dialog) => {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
],
|
||||
rejectClose: false // Click on Close button will not launch an error
|
||||
})
|
||||
|
||||
|
||||
console.log("RollContext", rollContext)
|
||||
if (rollContext === null || !rollContext?.progressionDiceId) {
|
||||
if (rollContext === null || !rollContext?.progressionDiceId) {
|
||||
let combat = game.combats.get(options.combatId)
|
||||
let combatant = combat.combatants.get(options.combatantId)
|
||||
combatant.update({ 'system.progressionCount': 1 })
|
||||
combatant.update({ 'system.progressionCount': 1 })
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// Get the weapons from the actor items
|
||||
let actor = game.actors.get(options.actorId)
|
||||
let weapon = actor.items.find(i => i.type === "weapon" && i.id === rollContext.progressionDiceId)
|
||||
@ -590,20 +627,22 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let formula = weapon.system.combatProgressionDice
|
||||
let roll = new Roll(formula)
|
||||
await roll.evaluate()
|
||||
|
||||
|
||||
let max = roll.dice[0].faces - 1
|
||||
max = Math.min(options.rollProgressionCount, max)
|
||||
let msg = await roll.toMessage( {flavor: `Progression Roll for ${weapon.name}, progression count : ${options.rollProgressionCount}/${max}`}, {rollMode: rollContext.visibility} )
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||
let msg = await roll.toMessage({ flavor: `Progression Roll for ${weapon.name}, progression count : ${options.rollProgressionCount}/${max}` }, { rollMode: rollContext.visibility })
|
||||
if (game?.dice3d) {
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||
}
|
||||
|
||||
if (roll.total <= max ) {
|
||||
if (roll.total <= max) {
|
||||
// Notify that the player can act now with a chat message
|
||||
let message = game.i18n.format("LETHALFANTASY.Notifications.messageProgressionOK", { isMonster, name: actor.name, weapon: weapon.name, roll: roll.total })
|
||||
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: actor }) })
|
||||
// Update the combatant progression count
|
||||
let combat = game.combats.get(options.combatId)
|
||||
let combatant = combat.combatants.get(options.combatantId)
|
||||
combatant.update({ 'system.progressionCount': 0 })
|
||||
combatant.update({ 'system.progressionCount': 0 })
|
||||
} else {
|
||||
// Notify that the player cannot act now with a chat message
|
||||
let message = game.i18n.format("LETHALFANTASY.Notifications.messageProgressionKO", { isMonster, name: actor.name, weapon: weapon.name, roll: roll.total })
|
||||
@ -612,7 +651,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
}
|
||||
|
||||
static async promptRangedDefense(rollTarget) {
|
||||
|
||||
|
||||
const rollModes = Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
|
||||
const fieldRollMode = new foundry.data.fields.StringField({
|
||||
choices: rollModes,
|
||||
@ -621,11 +660,11 @@ export default class LethalFantasyRoll extends Roll {
|
||||
})
|
||||
|
||||
let dialogContext = {
|
||||
movementChoices : SYSTEM.MOVEMENT_CHOICES,
|
||||
moveDirectionChoices : SYSTEM.MOVE_DIRECTION_CHOICES,
|
||||
sizeChoices : SYSTEM.SIZE_CHOICES,
|
||||
rangeChoices : SYSTEM.RANGE_CHOICES,
|
||||
attackerAimChoices : SYSTEM.ATTACKER_AIM_CHOICES,
|
||||
movementChoices: SYSTEM.MOVEMENT_CHOICES,
|
||||
moveDirectionChoices: SYSTEM.MOVE_DIRECTION_CHOICES,
|
||||
sizeChoices: SYSTEM.SIZE_CHOICES,
|
||||
rangeChoices: SYSTEM.RANGE_CHOICES,
|
||||
attackerAimChoices: SYSTEM.ATTACKER_AIM_CHOICES,
|
||||
movement: "none",
|
||||
moveDirection: "none",
|
||||
size: "medium",
|
||||
@ -657,15 +696,15 @@ export default class LethalFantasyRoll extends Roll {
|
||||
],
|
||||
rejectClose: false // Click on Close button will not launch an error
|
||||
})
|
||||
|
||||
|
||||
console.log("RollContext", rollContext)
|
||||
// Build the final modifier
|
||||
let fullModifier = Number(rollContext.moveDirection) +
|
||||
Number(rollContext.size) +
|
||||
Number(rollContext.range) +
|
||||
let fullModifier = Number(rollContext.moveDirection) +
|
||||
Number(rollContext.size) +
|
||||
Number(rollContext.range) +
|
||||
Number(rollContext.attackerAim)
|
||||
console.log("Modifier", fullModifier)
|
||||
|
||||
|
||||
let modifierFormula
|
||||
if (fullModifier === 0) {
|
||||
modifierFormula = "0"
|
||||
@ -677,8 +716,8 @@ export default class LethalFantasyRoll extends Roll {
|
||||
// If the user cancels the dialog, exit
|
||||
if (rollContext === null) return
|
||||
|
||||
let rollData = {...rollContext}
|
||||
let options = {...rollContext}
|
||||
let rollData = { ...rollContext }
|
||||
let options = { ...rollContext }
|
||||
options.rollName = "Ranged Defense"
|
||||
|
||||
const rollBase = new this(rollContext.movement, options.data, rollData)
|
||||
@ -758,7 +797,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-damage-small")}`
|
||||
case "weapon-damage-medium":
|
||||
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-damage-medium")}`
|
||||
case "spell":
|
||||
case "spell":
|
||||
return `${game.i18n.localize("LETHALFANTASY.Label.spell")}`
|
||||
default:
|
||||
return game.i18n.localize("LETHALFANTASY.Label.titleStandard")
|
||||
|
@ -73,6 +73,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
||||
{ description: "", value: 0, duration: 0 }, { description: "", value: 0, duration: 0 }, { description: "", value: 0, duration: 0 }, { description: "", value: 0, duration: 0 },
|
||||
{ description: "", value: 0, duration: 0 }, { description: "", value: 0, duration: 0 }], min: 8
|
||||
}),
|
||||
damageResistance: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
})
|
||||
|
||||
schema.perception = new fields.SchemaField({
|
||||
@ -88,6 +89,12 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
||||
earned: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
current: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
})
|
||||
schema.granted = new fields.SchemaField({
|
||||
attackDice: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
defenseDice: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
damageDice: new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
})
|
||||
|
||||
schema.movement = new fields.SchemaField({
|
||||
walk: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
jog: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
@ -111,6 +118,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
||||
hair: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
magicUser: new fields.BooleanField({ initial: false }),
|
||||
clericUser: new fields.BooleanField({ initial: false }),
|
||||
hpPerLevel: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
})
|
||||
|
||||
schema.modifiers = new fields.SchemaField({
|
||||
|
@ -60,6 +60,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
average: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
damageResistance: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
})
|
||||
|
||||
const attackField = (label) => {
|
||||
@ -102,9 +103,9 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
||||
schema.biodata = new fields.SchemaField({
|
||||
alignment: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
vision: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
height: new fields.NumberField({ ...requiredInteger, initial: 170, min: 50 }),
|
||||
height: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
length: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||
weight: new fields.NumberField({ ...requiredInteger, initial: 70, min: 0 })
|
||||
weight: new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
})
|
||||
schema.combat = new fields.SchemaField({
|
||||
attackModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
@ -174,7 +175,9 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
||||
await roll.evaluate()
|
||||
let max = rollProgressionCount
|
||||
let msg = await roll.toMessage({ flavor: `Progression Roll for ${this.parent.name}` } )
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||
if (game?.dice3d) {
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||
}
|
||||
|
||||
let hasAttack = false
|
||||
for (let key in this.attacks) {
|
||||
|
Reference in New Issue
Block a user