Init/progression dice

This commit is contained in:
2025-01-18 00:00:25 +01:00
parent e12476d64f
commit 4e673913a1
45 changed files with 660 additions and 504 deletions

View File

@ -6,7 +6,7 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
static DEFAULT_OPTIONS = {
classes: ["character"],
position: {
width: 1080,
width: 972,
height: 780,
},
window: {
@ -18,6 +18,10 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
rollInitiative: LethalFantasyCharacterSheet.#onRollInitiative,
armorHitPointsPlus: LethalFantasyCharacterSheet.#onArmorHitPointsPlus,
armorHitPointsMinus: LethalFantasyCharacterSheet.#onArmorHitPointsMinus,
divinityPointsPlus: LethalFantasyCharacterSheet.#onDivinityPointsPlus,
divinityPointsMinus: LethalFantasyCharacterSheet.#onDivinityPointsMinus,
aetherPointsPlus: LethalFantasyCharacterSheet.#onAetherPointsPlus,
aetherPointsMinus: LethalFantasyCharacterSheet.#onAetherPointsMinus,
},
}
@ -162,22 +166,7 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
}
static async #onRollInitiative(event, target) {
const hasTarget = false
let actorClass = this.actor.system.biodata.class;
let wisDef = SYSTEM.CHARACTERISTICS_TABLES.wis.find((c) => c.value === this.actor.system.characteristics.wis.value)
let maxInit = Number(wisDef.init_cap) || 1000
let roll = await LethalFantasyRoll.promptInitiative({
actorId: this.actor.id,
actorName: this.actor.name,
actorImage: this.actor.img,
actorClass,
maxInit,
})
if (!roll) return null
await roll.toMessage({}, { rollMode: roll.options.rollMode })
await this.document.system.rollInitiative()
}
static #onArmorHitPointsPlus(event, target) {
@ -192,6 +181,34 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
this.actor.update({ "system.combat.armorHitPoints": Math.max(armorHP, 0) })
}
static #onDivinityPointsPlus(event, target) {
let points = this.actor.system.divinityPoints.value
points += 1
points = Math.min(points, this.actor.system.divinityPoints.max)
this.actor.update({ "system.divinityPoints.value": points })
}
static #onDivinityPointsMinus(event, target) {
let points = this.actor.system.divinityPoints.value
points -= 1
points = Math.max(points, 0)
this.actor.update({ "system.divinityPoints.value": points })
}
static #onAetherPointsPlus(event, target) {
let points = this.actor.system.aetherPoints.value
points += 1
points = Math.min(points, this.actor.system.aetherPoints.max)
this.actor.update({ "system.aetherPoints.value": points })
}
static #onAetherPointsMinus(event, target) {
let points = this.actor.system.aetherPoints.value
points -= 1
points = Math.max(points, 0)
this.actor.update({ "system.aetherPoints.value": points })
}
static #onCreateEquipment(event, target) {
}

View File

@ -6,7 +6,7 @@ export default class LethalFantasyMonsterSheet extends LethalFantasyActorSheet {
static DEFAULT_OPTIONS = {
classes: ["monster"],
position: {
width: 980,
width: 1060,
height: 780,
},
window: {
@ -118,37 +118,7 @@ export default class LethalFantasyMonsterSheet extends LethalFantasyActorSheet {
}
static async #onRollInitiative(event, target) {
const hasTarget = false
let actorClass = this.actor.system.biodata.class;
let wisDef = SYSTEM.CHARACTERISTICS_TABLES.wis.find((c) => c.value === this.actor.system.characteristics.wis.value)
let maxInit = Number(wisDef.init_cap) || 1000
let roll = await LethalFantasyRoll.promptInitiative({
actorId: this.actor.id,
actorName: this.actor.name,
actorImage: this.actor.img,
actorClass,
maxInit,
})
if (!roll) return null
await roll.toMessage({}, { rollMode: roll.options.rollMode })
}
static #onArmorHitPointsPlus(event, target) {
let armorHP = this.actor.system.combat.armorHitPoints
armorHP += 1
this.actor.update({ "system.combat.armorHitPoints": armorHP })
}
static #onArmorHitPointsMinus(event, target) {
let armorHP = this.actor.system.combat.armorHitPoints
armorHP -= 1
this.actor.update({ "system.combat.armorHitPoints": Math.max(armorHP, 0) })
}
static #onCreateEquipment(event, target) {
await this.document.system.rollInitiative(event, target)
}
getBestWeaponClassSkill(skills, rollType, multiplier = 1.0) {