15 Commits

Author SHA1 Message Date
a3c6509862 Update compendiums
All checks were successful
Release Creation / build (release) Successful in 52s
2025-05-06 10:53:25 +02:00
c2fe34e7a6 Update README 2025-05-03 16:04:29 +02:00
46176b2782 Update README 2025-05-03 09:46:43 +02:00
b7f13500a6 Update README.md 2025-05-03 08:26:22 +02:00
bd8b098b35 Fix HP loss
All checks were successful
Release Creation / build (release) Successful in 1m20s
2025-05-02 18:24:14 +02:00
71d3f777bf Implements HP loss HUD button
All checks were successful
Release Creation / build (release) Successful in 41s
2025-04-27 22:32:32 +02:00
157163672c Implements HP loss HUD button
All checks were successful
Release Creation / build (release) Successful in 54s
2025-04-27 22:11:10 +02:00
a043117ec7 Enhance rolls and fix dialog position
All checks were successful
Release Creation / build (release) Successful in 47s
2025-04-25 21:28:17 +02:00
791a7d6b67 Enhance rolls and fix dialog position 2025-04-25 21:28:02 +02:00
2ce5088471 Fix mortal+shield again
All checks were successful
Release Creation / build (release) Successful in 44s
2025-04-24 07:08:02 +02:00
ebb7bfe3d6 Fix prayer roll
All checks were successful
Release Creation / build (release) Successful in 45s
2025-04-23 16:05:01 +02:00
16959dd52e 8 attcks for monster + fix lethargy
All checks were successful
Release Creation / build (release) Successful in 46s
2025-04-22 23:44:04 +02:00
ccebf8dc1f Auto-jump to monster token when activated 2025-04-22 16:28:10 +02:00
a2364e1252 Fix spells 2025-04-22 15:48:25 +02:00
d961e130e0 Fix actions again
All checks were successful
Release Creation / build (release) Successful in 58s
2025-04-22 08:42:01 +02:00
62 changed files with 546 additions and 420 deletions

View File

@ -1,6 +1,20 @@
<h2><em>Lethal Fantasy RPG</em> for Foundry Virtual TableTop</h2>
## Lethal Fantasy RPG for Foundry Virtual TableTop
<div align="center">
The Official game system for playing Lethal Fantasy TTRPG: The Role Playing Game on FoundryVTT. This fully functional system is the foundational framework to build your game.
</div>
This product's format, programming code, and presentation is copyrighted by Lethal Fantasy Games LLC.
This system & product are used with permission granted as part of the partnership agreement between Foundry Gaming LLC and Lethal Fantasy Games LLC. It uses the following trademarks and/or copyrights:
© 2025 Lethal Fantasy Games. Content copyright Ted McClintock, Lethal Fantasy Games LLC. All Rights Reserved. Lethal Fantasy® is a Registered Trademark of Lethal Fantasy Games LLC. All Rights Reserved.
Lethal Fantasy Games is ©2025 Lethal Fantasy Games, LLC. All rights reserved. Lethal Fantasy, Lethal Fantasy Games, and their associated logos are trademarks of Lethal Fantasy Games, LLC. https://lethalfantasy.com/
For inquiries on developing content for this ruleset please contact Lethalted@lethalfantasy.com
## Community
Please join our Discord server Lethal Fantasy games https://discord.gg/UDvnnyvreV
It's the place to ask questions on how to use the system, make feature request and follow the development of the system.

View File

@ -0,0 +1 @@
<svg style="height: 512px; width: 512px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g class="" style="" transform="translate(0,0)"><path d="M373.47 25.5c-33.475-.064-67.614 13.444-94.44 43.156l37.22 145.156-33.437.032 35.343 132.093-116.718-188.375 50.03 5.375L202.5 47.312C120.437-1.43 4.756 40.396 8.5 158.156c4.402 138.44 191.196 184.6 247.406 331.625 59.376-147.035 251.26-184.33 246.656-331.624-2.564-82.042-64.6-132.532-129.093-132.656z" fill="#fff" fill-opacity="1"></path></g></svg>

After

Width:  |  Height:  |  Size: 506 B

View File

@ -1951,6 +1951,18 @@ i.lethalfantasy {
.lethalfantasy-roll-dialog fieldset {
padding: 4px;
}
.lethalfantasy-roll-dialog .goto-token-button {
justify-content: center;
align-items: center;
align-content: center;
margin-left: 0.5rem;
max-width: 8rem;
background-color: var(--color-dark-6);
color: var(--color-dark-2);
border: none;
border-radius: 4px;
padding: 0.5rem;
}
.lethalfantasy-range-defense-dialog {
width: 18rem;
}
@ -2058,22 +2070,39 @@ i.lethalfantasy {
font-size: calc(var(--font-size-standard) * 1);
text-shadow: 0 0 10px var(--color-shadow-primary);
}
#lethalfantasy-application-manager {
display: flex;
font-family: var(--font-primary);
font-size: calc(var(--font-size-standard) * 1);
color: var(--color-dark-1);
#token-hud .hp-loss-wrap {
position: absolute;
left: 75px;
display: none;
top: 50%;
width: 48px;
text-align: start;
overflow-y: auto;
}
#token-hud .hp-loss-wrap-col1 {
transform: translate(-200%, -50%);
}
#token-hud .hp-loss-wrap-col2 {
transform: translate(-300%, -50%);
}
#token-hud .hp-loss-wrap-col3 {
transform: translate(-400%, -50%);
}
#token-hud .hp-loss-hud-active {
display: block;
}
#token-hud .hp-loss-hud-disabled {
display: none;
}
#token-hud .hud-loss-hp-button-select {
max-width: 40px;
background-image: var(--background-image-base);
background-repeat: no-repeat;
background-size: 100% 100%;
}
#lethalfantasy-application-manager .lethalfantasy-table {
margin: 1rem;
background: none;
padding: 0;
padding-top: 0;
padding-bottom: 0;
width: max-content;
margin: 0;
text-align: center;
}
#lethalfantasy-application-manager .lethalfantasy-table .player {
font-size: calc(var(--font-size-standard) * 1);
#token-hud .hp-loss-wrap .hud-loss-hp-button-select {
padding-left: 8px;
font-size: 0.7rem;
}

View File

@ -281,6 +281,7 @@
}
},
"Label": {
"gotoToken": "Go to token",
"combatAction": "Combat action",
"currentAction": "Current ongoing action",
"selectAction": "Select an action",
@ -288,6 +289,7 @@
"spell-attack": "Spell - Attack",
"miracle-power": "Miracle - Power",
"miracle-attack": "Miracle - Attack",
"spell": "Spell",
"will":"Will",
"dodge":"Dodge",
"toughness":"Toughness",
@ -489,11 +491,11 @@
"rollTypeNotFound": "Roll type not found",
"skillNotFound": "Skill not found",
"messageProgressionOK": "{name} can perform his action !",
"messageLethargyOK": "Lethargy ended. <br>{name} can perform a new action !",
"messageLethargyKO": "Lethargy stil ongoing ...",
"messageLethargyOK": "{spellName} : Lethargy ended ( dice result {roll}). <br>{name} can perform a new action !",
"messageLethargyKO": "{spellName} : Lethargy still ongoing ... ( dice result : {roll} )",
"messageProgressionKO": "{name} can't attack this second.",
"messageProgressionOKMonster": "{name} can attack this second with {weapon}.",
"messageProgressionKOMonster": "{name} can't attack this second."
"messageProgressionKOMonster": "{name} can't attack this second (dice result {roll})."
},
"Opponent": {
"FIELDS": {}

View File

@ -89,12 +89,13 @@ Hooks.once("init", function () {
setupTextEnrichers()
LethalFantasyUtils.registerHandlebarsHelpers()
LethalFantasyUtils.setHookListeners( )
console.info("LETHAL FANTASY | System Initialized")
})
/**
* Perform one-time configuration of system configuration objects.
* Perform one-time configuration of system configuration objects.f
*/
function preLocalizeConfig() {
const localizeConfigObject = (obj, keys) => {
@ -117,6 +118,7 @@ Hooks.once("ready", function () {
if (!SYSTEM.DEV_MODE) {
registerWorldCount("lethalFantasy")
}
_showUserGuide()
/**
@ -129,7 +131,12 @@ Hooks.once("ready", function () {
}
})
Hooks.on("renderChatMessage", (message, html, data) => {
// Test if version below 13
let hookName = "renderChatMessage"
if (foundry.utils.isNewerVersion(game.version, "12.0", )) {
hookName = "renderChatMessageHTML"
}
Hooks.on(hookName, (message, html, data) => {
const typeMessage = data.message.flags.lethalFantasy?.typeMessage
// Message de demande de jet de dés
if (typeMessage === "askRoll") {

View File

@ -138,7 +138,6 @@ export class LethalFantasyCombat extends Combat {
}
async nextRound() {
console.log('NEXT ROUND')
this.turnsDone = false
let turn = this.turn === null ? null : 0; // Preserve the fact that it's no-one's turn currently.
@ -162,13 +161,12 @@ export class LethalFantasyCombat extends Combat {
for (let c of this.combatants) {
if ( nextRound >= c.initiative) {
c.update({ 'system.progressionCount': c.system.progressionCount + 1 });
let user = game.users.find(u => u.active && u.character && u.character.id === c.actor.id);
if (user?.hasPlayerOwner) {
game.socket.emit(`system.${SYSTEM.id}`, { type: "rollProgressionDice", progressionCount: c.system.progressionCount+1, actorId: c.actor.id, combatId: this.id, combatantId: c.id });
} else {
user = game.users.find(u => u.active && u.isGM);
c.actor.system.rollProgressionDice(this.id, c.id, c.system.progressionCount+1);
c.actor.system.rollProgressionDice(this.id, c.id);
}
}
}

View File

@ -250,6 +250,7 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
async _onRoll(event, target) {
if (this.isEditMode) return
console.log("Roll event", event)
const rollType = event.target.dataset.rollType
let rollKey = event.target.dataset.rollKey;
let rollDice = event.target.dataset?.rollDice;

View File

@ -166,71 +166,8 @@ export default class LethalFantasyMonsterSheet extends LethalFantasyActorSheet {
async _onRoll(event, target) {
if (this.isEditMode) return
const rollType = event.target.dataset.rollType
let rollTarget
let rollKey = event.target.dataset.rollKey
switch (rollType) {
case "monster-attack":
case "monster-defense":
case "monster-damage":
rollTarget = foundry.utils.duplicate(this.document.system.attacks[rollKey])
rollTarget.rollKey = rollKey
break
case "monster-skill":
rollTarget = foundry.utils.duplicate(this.document.system.resists[rollKey])
rollTarget.rollKey = rollKey
break
case "save":
rollTarget = foundry.utils.duplicate(this.document.system.saves[rollKey])
rollTarget.rollKey = rollKey
rollTarget.rollDice = event.target.dataset?.rollDice
break
case "weapon-damage-small":
case "weapon-damage-medium":
case "weapon-attack":
case "weapon-defense":
let weapon = this.actor.items.find((i) => i.type === "weapon" && i.id === rollKey)
let skill
let skills = this.actor.items.filter((i) => i.type === "skill" && i.name.toLowerCase() === weapon.name.toLowerCase())
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 1.0)
} else {
skills = this.actor.items.filter((i) => i.type === "skill" && i.name.toLowerCase().replace(" skill", "") === weapon.name.toLowerCase())
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 1.0)
} else {
skills = this.actor.items.filter((i) => i.type === "skill" && i.system.weaponClass === weapon.system.weaponClass)
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 0.5)
} else {
skills = this.actor.items.filter((i) => i.type === "skill" && i.system.weaponClass.includes(SYSTEM.WEAPON_CATEGORIES[weapon.system.weaponClass]))
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 0.25)
} else {
ui.notifications.warn(game.i18n.localize("LETHALFANTASY.Notifications.skillNotFound"))
return
let rollDice = event.target.dataset?.rollDice || "0"
this.actor.system.prepareMonsterRoll(rollType, rollKey, rollDice)
}
}
}
}
if (!weapon || !skill) {
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)
break
default:
ui.notifications.error(game.i18n.localize("LETHALFANTASY.Notifications.rollTypeNotFound") + String(rollType))
break
}
// In all cases
console.log(rollTarget)
await this.document.system.roll(rollType, rollTarget)
}
// #endregion
}

View File

@ -53,10 +53,12 @@ export const MORTAL_CHOICES = {
"shirefolk": {label: "Shire Folk", value: "Shire Folk", defenseBonus: 2},
"Elf": {label: "Elf", value: "Elf", defenseBonus: 0},
"Half-orc": {label: "Half-Orc", value: "Half-Orc", defenseBonus: 0},
"Half-Orc": {label: "Half-Orc", value: "Half-Orc", defenseBonus: 0},
"Dwarf": {label: "Dwarf", value: "Dwarf", defenseBonus: 0},
"Half-elf": {label: "Half-Elf", value: "Half-Elf", defenseBonus: 0},
"Gnome": {label: "Gnome", value: "Gnome", defenseBonus: 2},
"Shire Folk": {label: "Shire Folk", value: "Shire Folk", defenseBonus: 2},
"Shire folk": {label: "Shire Folk", value: "Shire Folk", defenseBonus: 2},
"Mankind": {label: "Human", value: "Human", defenseBonus: 0},
}
@ -191,6 +193,7 @@ export const CHARACTERISTIC_DEFENSE = [ "int", "wis", "dex" ]
export const CHARACTERISTIC_DAMAGE = [ "str" ]
export const DEFENSE_DICE_VALUES = {
"0": "0",
"d3": "D3",
"d4": "D4",
"d6": "D6",

View File

@ -41,6 +41,7 @@ export default class LethalFantasyActor extends Actor {
}
}
/* *************************************************/
getBestWeaponClassSkill(skills, rollType, multiplier = 1.0) {
let maxValue = 0
let goodSkill = skills[0]
@ -68,6 +69,16 @@ export default class LethalFantasyActor extends Actor {
return goodSkill
}
/* *************************************************/
async applyDamage(hpLoss) {
let hp = this.system.hp.value + hpLoss
if (hp < 0) {
hp = 0
}
this.update({ "system.hp.value": hp })
}
/* *************************************************/
async prepareRoll(rollType, rollKey, rollDice ) {
console.log("Preparing roll", rollType, rollKey, rollDice)
let rollTarget

View File

@ -221,9 +221,13 @@ export default class LethalFantasyRoll extends Roll {
hasChangeDice = false
options.rollTarget.value = options.rollTarget.actorModifiers.levelSpellModifier + options.rollTarget.actorModifiers.intSpellModifier
options.rollTarget.charModifier = options.rollTarget.actorModifiers.intSpellModifier
hasStaticModifier = true // options.rollType === "spell-power"
hasModifier = true //options.rollType !== "spell-attack"
hasStaticModifier = options.rollType === "spell-power"
//hasModifier = options.rollType !== "spell-attack"
if (hasStaticModifier) {
options.rollTarget.staticModifier = options.rollTarget.actorLevel
} else {
options.rollTarget.staticModifier = 0
}
} else if (options.rollType === "miracle" || options.rollType === "miracle-attack" || options.rollType === "miracle-power") {
hasD30 = true
@ -234,9 +238,13 @@ export default class LethalFantasyRoll extends Roll {
hasChangeDice = false
options.rollTarget.value = options.rollTarget.actorModifiers.levelMiracleModifier + options.rollTarget.actorModifiers.chaMiracleModifier
options.rollTarget.charModifier = options.rollTarget.actorModifiers.chaMiracleModifier
hasStaticModifier = true // options.rollType === "spell-power"
hasModifier = true // options.rollType !== "miracle-attack"
hasStaticModifier = options.rollType === "miracle-power"
//hasModifier = options.rollType !== "miracle-attack"
if (hasStaticModifier) {
options.rollTarget.staticModifier = options.rollTarget.actorLevel
} else {
options.rollTarget.staticModifier = 0
}
} else if (options.rollType === "shield-roll") {
hasD30 = false
@ -284,7 +292,10 @@ export default class LethalFantasyRoll extends Roll {
hasModifier = false
}
console.log("Roll mode", CONFIG.Dice.rollModes)
const rollModes = Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
console.log("Roll mode", rollModes)
const fieldRollMode = new foundry.data.fields.StringField({
choices: rollModes,
blank: false,
@ -302,6 +313,7 @@ export default class LethalFantasyRoll extends Roll {
rollType: options.rollType,
rollTarget: options.rollTarget,
rollName: options.rollName,
actorName: options.actorName,
rollModes,
hasModifier,
hasFavor,
@ -322,16 +334,19 @@ export default class LethalFantasyRoll extends Roll {
}
const content = await renderTemplate("systems/fvtt-lethal-fantasy/templates/roll-dialog.hbs", dialogContext)
const title = LethalFantasyRoll.createTitle(options.rollType, options.rollTarget)
let position = game.user.getFlag(SYSTEM.id, "roll-dialog-pos") || { top: -1, left: -1 }
const label = game.i18n.localize("LETHALFANTASY.Roll.roll")
const rollContext = await foundry.applications.api.DialogV2.wait({
window: { title: title },
window: { title: "Roll dialog" },
classes: ["lethalfantasy"],
content,
position,
buttons: [
{
label: label,
callback: (event, button, dialog) => {
let position = $(dialog).position()
game.user.setFlag(SYSTEM.id, "roll-dialog-pos", foundry.utils.duplicate(position))
const output = Array.from(button.form.elements).reduce((obj, input) => {
if (input.name) obj[input.name] = input.value
return obj
@ -343,6 +358,15 @@ export default class LethalFantasyRoll extends Roll {
actions: {
"selectGranted": (event, button, dialog) => {
hasGrantedDice = true
},
"gotoToken" : (event, button, dialog) => {
let tokenId = $(button).data("tokenId")
let token = canvas.tokens?.get(tokenId)
if (token) {
canvas.animatePan({ x: token.x, y: token.y, duration: 200 })
canvas.tokens.releaseAll();
token.control({ releaseOthers: true });
}
}
},
rejectClose: false // Click on Close button will not launch an error
@ -373,7 +397,7 @@ export default class LethalFantasyRoll extends Roll {
if (hasStaticModifier) {
modifierFormula += ` + ${options.rollTarget.staticModifier}`
}
modifierFormula += ` + ${options.rollTarget.charModifier}`
// modifierFormula += ` + ${options.rollTarget.charModifier}`
let sign = fullModifier < 0 ? "-" : "+"
if (hasExplode) {
titleFormula = `${dice}E ${sign} ${modifierFormula}`
@ -543,6 +567,7 @@ export default class LethalFantasyRoll extends Roll {
return rollBase
}
/* ***********************************************************/
static async promptInitiative(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({
@ -603,6 +628,7 @@ export default class LethalFantasyRoll extends Roll {
}
/* ***********************************************************/
static async promptCombatAction(options = {}) {
const rollModes = Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
@ -619,6 +645,8 @@ export default class LethalFantasyRoll extends Roll {
}
let currentAction = combatant.getFlag(SYSTEM.id, "currentAction")
let position = game.user.getFlag(SYSTEM.id, "combat-action-dialog-pos") || { top: -1, left: -1 }
let dialogContext = {
progressionDiceId: "",
fieldRollMode,
@ -636,24 +664,34 @@ export default class LethalFantasyRoll extends Roll {
action: "roll",
label: "Roll progression dice",
callback: (event, button, dialog) => {
let pos = $('#combat-action-dialog').position()
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", pos)
return "rollProgressionDice"
},
})
} else if (currentAction.type === "spell" || currentAction.type === "miracle") {
let label = ""
if (currentAction.spellStatus === "castingTime") {
let pos = $('#combat-action-dialog').position()
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", pos)
label = "Wait casting time"
}
if (currentAction.spellStatus === "toBeCasted") {
let pos = $('#combat-action-dialog').position()
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", pos)
label = "Cast spell/miracle"
}
if (currentAction.spellStatus === "lethargy") {
let pos = $('#combat-action-dialog').position()
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", pos)
label = "Roll lethargy dice"
}
buttons.push({
action: "roll",
label: label,
callback: (event, button, dialog) => {
let pos = $('#combat-action-dialog').position()
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", foundry.utils.duplicate(pos))
return "rollLethargyDice"
},
})
@ -663,6 +701,8 @@ export default class LethalFantasyRoll extends Roll {
action: "roll",
label: "Select action",
callback: (event, button, dialog) => {
let pos = $('#combat-action-dialog').position()
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", foundry.utils.duplicate(pos))
const output = Array.from(button.form.elements).reduce((obj, input) => {
if (input.name) obj[input.name] = input.value
return obj
@ -676,13 +716,17 @@ export default class LethalFantasyRoll extends Roll {
action: "cancel",
label: "Other action, not listed here",
callback: (event, button, dialog) => {
let pos = $('#combat-action-dialog').position()
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", foundry.utils.duplicate(pos))
return null;
}
})
let rollContext = await foundry.applications.api.DialogV2.wait({
window: { title: "Combat Action Dialog" },
id: "combat-action-dialog",
classes: ["lethalfantasy"],
position,
content,
buttons,
rejectClose: false // Click on Close button will not launch an error
@ -723,7 +767,7 @@ export default class LethalFantasyRoll extends Roll {
actionItem.spellStatus = "castingTime"
// Set the flag on the combatant
await combatant.setFlag(SYSTEM.id, "currentAction", actionItem)
let message = `${combatant.name} action : ${selectedItem.name}, start rolling progression dice`
let message = `${combatant.name} action : ${selectedItem.name}, start rolling progression dice or casting time`
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
rollContext = (actionItem.type == "weapon") ? "rollProgressionDice" : "rollLethargyDice" // Set the roll context to rollProgressionDice
currentAction = actionItem
@ -732,14 +776,15 @@ export default class LethalFantasyRoll extends Roll {
if (currentAction) {
if (rollContext === "rollLethargyDice") {
if (currentAction.spellStatus === "castingTime") {
if ( currentAction.castingTime < currentAction.system.castingTime) {
let message = `Casting time : ${currentAction.name}, count : ${currentAction.castingTime}/${currentAction.system.castingTime}`
let time = currentAction.type === "spell" ? currentAction.system.castingTime : currentAction.system.prayerTime
if (currentAction.castingTime < time) {
let message = `Casting time : ${currentAction.name}, count : ${currentAction.castingTime}/${time}`
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
currentAction.castingTime += 1
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
return
} else {
let message = `Spell ${currentAction.name} ready to be cast on next second !`
let message = `Spell/Miracle ${currentAction.name} ready to be cast on next second !`
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
currentAction.castingTime = 1
currentAction.spellStatus = "toBeCasted"
@ -763,11 +808,14 @@ export default class LethalFantasyRoll extends Roll {
let dice = LethalFantasyUtils.getLethargyDice(currentAction.system.level)
let roll = new Roll(dice)
await roll.evaluate()
if (game?.dice3d) {
await game.dice3d.showForRoll(roll)
}
let max = roll.dice[0].faces - 1
let toCompare = Math.min(options.rollProgressionCount, max)
let toCompare = Math.min(currentAction.progressionCount, max)
if (roll.total <= toCompare) {
// Notify that the player can act now with a chat message
let message = game.i18n.format("LETHALFANTASY.Notifications.messageLethargyOK", { name: combatant.actor.name, weapon: currentAction.name, roll: roll.total })
let message = game.i18n.format("LETHALFANTASY.Notifications.messageLethargyOK", { name: combatant.actor.name, spellName: currentAction.name, roll: roll.total })
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
// Update the combatant progression count
await combatant.setFlag(SYSTEM.id, "currentAction", "")
@ -776,8 +824,8 @@ export default class LethalFantasyRoll extends Roll {
} else {
// Notify that the player cannot act now with a chat message
currentAction.progressionCount += 1
combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
let message = game.i18n.format("LETHALFANTASY.Notifications.messageLethargyKO", { name: combatant.actor.name, weapon: currentAction.name, roll: roll.total })
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
let message = game.i18n.format("LETHALFANTASY.Notifications.messageLethargyKO", { name: combatant.actor.name, spellName: currentAction.name, roll: roll.total })
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
}
}
@ -839,178 +887,7 @@ export default class LethalFantasyRoll extends Roll {
}
}
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 = {
progressionDiceId: "",
fieldRollMode,
rollModes,
...options
}
const content = await renderTemplate("systems/fvtt-lethal-fantasy/templates/roll-progression-dice-dialog.hbs", dialogContext)
const label = game.i18n.localize("LETHALFANTASY.Label.rollProgressionDice")
const rollContext = await foundry.applications.api.DialogV2.wait({
window: { title: "Progression Roll" },
classes: ["lethalfantasy"],
content,
buttons: [
{
action: "roll",
label: "Roll Progression Dice or Continue Loading",
callback: (event, button, dialog) => {
const output = Array.from(button.form.elements).reduce((obj, input) => {
if (input.name) obj[input.name] = input.value
return obj
}, {})
return output
},
},
{
action: "cast",
label: "Cast a spell",
callback: (event, button, dialog) => {
return "casting"
},
},
{
action: "cancel",
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", dialogContext, rollContext)
let combat = game.combats.get(options.combatId)
let actor = game.actors.get(options.actorId)
if (rollContext === "casting") {
combat.setCasting(options.combatantId)
let message = `Starting casting a spell !`
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: actor }) })
return
}
if (rollContext === null || !rollContext?.progressionDiceId) {
c.resetCasting(options.combatantId)
combat.resetProgression(options.combatantId)
let message = `${actor.name} : Other action, progression reset`
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: actor }) })
return
}
// Get the weapons from the actor items
let rangedMode
let searchId = rollContext.progressionDiceId
if (searchId.match("simpleAim")) {
searchId = searchId.replace("simpleAim", "")
rangedMode = "simpleAim"
}
if (searchId.match("carefulAim")) {
searchId = searchId.replace("carefulAim", "")
rangedMode = "carefulAim"
}
if (searchId.match("focusedAim")) {
searchId = searchId.replace("focusedAim", "")
rangedMode = "focusedAim"
}
if (searchId.match("spell")) {
searchId = searchId.replace("spell", "")
let spell = actor.items.find(i => i.type === "spell" && i.id === searchId)
let dice = LethalFantasyUtils.getLethargyDice(spell.system.level)
if (combat.isCasting(options.combatantId)) {
if (options.rollProgressionCount <= spell.system.castingTime) {
let message = `Spell casting time : ${spell.name}, count : ${options.rollProgressionCount}/${spell.system.castingTime}`
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: actor }) })
return
}
if (options.rollProgressionCount > spell.system.castingTime) {
let message = `Spell ${spell.name} has been cast !`
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: actor }) })
combat.resetCasting(options.combatantId)
combat.resetProgression(options.combatantId)
return
}
} else {
let formula = dice
let roll = new Roll(formula)
await roll.evaluate()
let max = roll.dice[0].faces - 1
let toCompare = Math.min(options.rollProgressionCount, max)
let message
if (roll.total > toCompare) {
message = `Spell Lethargy ongoing ... (${roll.total}/${toCompare}, spell level ${spell.system.level})`
} else {
combat.resetProgression(options.combatantId)
message = `Spell Lethargy ended ! (${roll.total}/${toCompare}, spell level ${spell.system.level})<br>${actor.name} can return to normal actions.`
}
let msg = await roll.toMessage({ flavor: message }, { rollMode: rollContext.visibility })
if (game?.dice3d) {
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
}
}
return
}
let weapon = actor.items.find(i => i.type === "weapon" && i.id === searchId)
let formula = weapon.system.combatProgressionDice
let rangedLoad
if (rangedMode) {
let toSplit = weapon.system.speed[rangedMode]
let split = toSplit.split("+")
rangedLoad = Number(split[0]) || 0
formula = split[1]
console.log("Ranged Mode", rangedMode, rangedLoad, formula, options.rollProgressionCount)
}
if (rangedLoad && options.rollProgressionCount <= rangedLoad) {
let message = `Ranged weapon ${weapon.name} is loading, loading count : ${options.rollProgressionCount}/${rangedLoad}`
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: actor }) })
return
}
let isMonster = actor.type === "monster"
// Get the dice and roll it if
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 })
if (game?.dice3d) {
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
}
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 })
} 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 })
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: actor }) })
}
}
/* ***********************************************************/
static async promptRangedDefense(rollTarget) {
const rollModes = Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))

View File

@ -298,8 +298,17 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
if (this.biodata.magicUser || this.biodata.clericUser) {
let spells = this.parent.items.filter(i => i.type === "spell" || i.type === "miracle")
for (let s of spells) {
let title = ""
let formula = ""
if (s.type === "spell") {
let dice = LethalFantasyUtils.getLethargyDice(s.system.level)
weaponsChoices.push({ id: s.id, name: `${s.name} (Time: ${s.system.castingTime}, Lethargy: ${dice})`, combatProgressionDice: `${s.system.castingTime}+${dice}` })
title = `${s.name} (Casting time: ${s.system.castingTime}, Lethargy: ${dice})`
formula = `${s.system.castingTime}+${dice}`
} else {
title = `${s.name} (Prayer time: ${s.system.prayerTime})`
formula = `${s.system.prayerTime}`
}
weaponsChoices.push({ id: s.id, name: title, combatProgressionDice: formula })
}
}

View File

@ -82,6 +82,10 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
attack2: attackField("2"),
attack3: attackField("3"),
attack4: attackField("4"),
attack5: attackField("5"),
attack6: attackField("6"),
attack7: attackField("7"),
attack8: attackField("8")
})
schema.perception = new fields.SchemaField({
@ -145,6 +149,74 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
await roll.toMessage({}, { rollMode: roll.options.rollMode })
}
async prepareMonsterRoll(rollType, rollKey, rollDice = undefined, tokenId = undefined) {
let rollTarget
switch (rollType) {
case "monster-attack":
case "monster-defense":
case "monster-damage":
rollTarget = foundry.utils.duplicate(this.attacks[rollKey])
rollTarget.rollKey = rollKey
break
case "monster-skill":
rollTarget = foundry.utils.duplicate(this.resists[rollKey])
rollTarget.rollKey = rollKey
break
case "save":
rollTarget = foundry.utils.duplicate(this.saves[rollKey])
rollTarget.rollKey = rollKey
rollTarget.rollDice = rollDice
break
case "weapon-damage-small":
case "weapon-damage-medium":
case "weapon-attack":
case "weapon-defense":
let weapon = this.actor.items.find((i) => i.type === "weapon" && i.id === rollKey)
let skill
let skills = this.actor.items.filter((i) => i.type === "skill" && i.name.toLowerCase() === weapon.name.toLowerCase())
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 1.0)
} else {
skills = this.actor.items.filter((i) => i.type === "skill" && i.name.toLowerCase().replace(" skill", "") === weapon.name.toLowerCase())
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 1.0)
} else {
skills = this.actor.items.filter((i) => i.type === "skill" && i.system.weaponClass === weapon.system.weaponClass)
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 0.5)
} else {
skills = this.actor.items.filter((i) => i.type === "skill" && i.system.weaponClass.includes(SYSTEM.WEAPON_CATEGORIES[weapon.system.weaponClass]))
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 0.25)
} else {
ui.notifications.warn(game.i18n.localize("LETHALFANTASY.Notifications.skillNotFound"))
return
}
}
}
}
if (!weapon || !skill) {
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.combat)
break
default:
ui.notifications.error(game.i18n.localize("LETHALFANTASY.Notifications.rollTypeNotFound") + String(rollType))
break
}
// In all cases
rollTarget.tokenId = tokenId
console.log(rollTarget)
await this.roll(rollType, rollTarget)
}
async rollInitiative(combatId = undefined, combatantId = undefined) {
const hasTarget = false
@ -164,7 +236,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
await roll.toMessage({}, { rollMode: roll.options.rollMode })
}
async rollProgressionDice(combatId, combatantId, rollProgressionCount) {
async rollProgressionDice(combatId, combatantId) {
const rollModes = Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
const fieldRollMode = new foundry.data.fields.StringField({
@ -175,7 +247,8 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
let roll = new Roll("1D8")
await roll.evaluate()
let max = rollProgressionCount
let combatant = game.combats.get(combatId)?.combatants?.get(combatantId)
let msg = await roll.toMessage({ flavor: `Progression Roll for ${this.parent.name}` } )
if (game?.dice3d) {
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
@ -188,6 +261,12 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
hasAttack = true
let message = game.i18n.format("LETHALFANTASY.Notifications.messageProgressionOKMonster", { isMonster: true, name: this.parent.name, weapon: attack.name, roll: roll.total })
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: this.parent }) })
let token = combatant?.token
this.prepareMonsterRoll("monster-attack", key, undefined, token?.id)
if ( token?.object ) {
token.object?.control({releaseOthers: true});
return canvas.animatePan(token.object.center);
}
}
}
if (!hasAttack) {
@ -198,4 +277,3 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
}
}

View File

@ -18,6 +18,51 @@ export default class LethalFantasyUtils {
options.push({ name: "Reset Progression", condition: true, icon: '<i class="fas fa-rotate-right"></i>', callback: target => { game.combat.resetProgression(target.data('combatant-id')); } })
}
/* -------------------------------------------- */
static setHookListeners() {
Hooks.on('renderTokenHUD', async (hud, html, token) => {
const lossHPButton = await renderTemplate('systems/fvtt-lethal-fantasy/templates/loss-hp-hud.hbs', {} )
html.find('div.left').append(lossHPButton);
html.find('img.lethal-hp-loss-hud').click((event) => {
event.preventDefault();
let hpMenu = html.find('.hp-loss-wrap')[0]
if (hpMenu.classList.contains("hp-loss-hud-disabled")) {
html.find('.hp-loss-wrap')[0].classList.add('hp-loss-hud-active');
html.find('.hp-loss-wrap')[0].classList.remove('hp-loss-hud-disabled');
html.find('.hp-loss-wrap')[1].classList.add('hp-loss-hud-active');
html.find('.hp-loss-wrap')[1].classList.remove('hp-loss-hud-disabled');
html.find('.hp-loss-wrap')[2].classList.add('hp-loss-hud-active');
html.find('.hp-loss-wrap')[2].classList.remove('hp-loss-hud-disabled');
} else {
html.find('.hp-loss-wrap')[0].classList.remove('hp-loss-hud-active');
html.find('.hp-loss-wrap')[0].classList.add('hp-loss-hud-disabled');
html.find('.hp-loss-wrap')[1].classList.remove('hp-loss-hud-active');
html.find('.hp-loss-wrap')[1].classList.add('hp-loss-hud-disabled');
html.find('.hp-loss-wrap')[2].classList.remove('hp-loss-hud-active');
html.find('.hp-loss-wrap')[2].classList.add('hp-loss-hud-disabled');
}
})
html.find('.loss-hp-hud-click').click((event) => {
event.preventDefault();
let hpLoss = event.currentTarget.dataset.hpValue;
if (token) {
let tokenFull = canvas.tokens.placeables.find( t => t.id === token._id);
console.log(tokenFull, token)
let actor = tokenFull.actor;
actor.applyDamage(Number(hpLoss));
html.find('.hp-loss-wrap')[0].classList.remove('hp-loss-hud-active');
html.find('.hp-loss-wrap')[0].classList.add('hp-loss-hud-disabled');
html.find('.hp-loss-wrap')[1].classList.remove('hp-loss-hud-active');
html.find('.hp-loss-wrap')[1].classList.add('hp-loss-hud-disabled');
html.find('.hp-loss-wrap')[2].classList.remove('hp-loss-hud-active');
html.find('.hp-loss-wrap')[2].classList.add('hp-loss-hud-disabled');
}
})
})
}
/* -------------------------------------------- */
static handleSocketEvent(msg = {}) {
console.log(`handleSocketEvent !`, msg)
let actor

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
MANIFEST-000219
MANIFEST-000303

View File

@ -1,8 +1,8 @@
2025/04/21-17:09:30.765172 7f5dceffd6c0 Recovering log #217
2025/04/21-17:09:30.774995 7f5dceffd6c0 Delete type=3 #215
2025/04/21-17:09:30.775106 7f5dceffd6c0 Delete type=0 #217
2025/04/21-17:40:19.481504 7f5dcd3ff6c0 Level-0 table #222: started
2025/04/21-17:40:19.481549 7f5dcd3ff6c0 Level-0 table #222: 0 bytes OK
2025/04/21-17:40:19.518709 7f5dcd3ff6c0 Delete type=0 #220
2025/04/21-17:40:19.572101 7f5dcd3ff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end)
2025/04/21-17:40:19.634424 7f5dcd3ff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end)
2025/05/06-10:52:19.288970 7fc4e7fff6c0 Recovering log #300
2025/05/06-10:52:19.300271 7fc4e7fff6c0 Delete type=3 #298
2025/05/06-10:52:19.300323 7fc4e7fff6c0 Delete type=0 #300
2025/05/06-10:53:10.017977 7fc4e73ff6c0 Level-0 table #306: started
2025/05/06-10:53:10.018020 7fc4e73ff6c0 Level-0 table #306: 0 bytes OK
2025/05/06-10:53:10.024080 7fc4e73ff6c0 Delete type=0 #304
2025/05/06-10:53:10.044191 7fc4e73ff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
2025/05/06-10:53:10.044277 7fc4e73ff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)

View File

@ -1,8 +1,15 @@
2025/04/17-17:21:12.564483 7f5c837fe6c0 Recovering log #213
2025/04/17-17:21:12.575284 7f5c837fe6c0 Delete type=3 #211
2025/04/17-17:21:12.575342 7f5c837fe6c0 Delete type=0 #213
2025/04/17-17:34:42.493086 7f5c81bff6c0 Level-0 table #218: started
2025/04/17-17:34:42.493111 7f5c81bff6c0 Level-0 table #218: 0 bytes OK
2025/04/17-17:34:42.499036 7f5c81bff6c0 Delete type=0 #216
2025/04/17-17:34:42.518959 7f5c81bff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end)
2025/04/17-17:34:42.519032 7f5c81bff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end)
2025/05/06-10:45:53.342160 7fc4ecbf86c0 Recovering log #296
2025/05/06-10:45:53.353010 7fc4ecbf86c0 Delete type=3 #294
2025/05/06-10:45:53.353081 7fc4ecbf86c0 Delete type=0 #296
2025/05/06-10:51:12.708848 7fc4e73ff6c0 Level-0 table #301: started
2025/05/06-10:51:12.714248 7fc4e73ff6c0 Level-0 table #301: 213746 bytes OK
2025/05/06-10:51:12.720525 7fc4e73ff6c0 Delete type=0 #299
2025/05/06-10:51:12.748598 7fc4e73ff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
2025/05/06-10:51:12.748667 7fc4e73ff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at '!items!zw9RQocTdz3HRjZK' @ 564 : 1
2025/05/06-10:51:12.748677 7fc4e73ff6c0 Compacting 1@1 + 1@2 files
2025/05/06-10:51:12.755813 7fc4e73ff6c0 Generated table #302@1: 485 keys, 214492 bytes
2025/05/06-10:51:12.755833 7fc4e73ff6c0 Compacted 1@1 + 1@2 files => 214492 bytes
2025/05/06-10:51:12.761728 7fc4e73ff6c0 compacted to: files[ 0 0 1 0 0 0 0 ]
2025/05/06-10:51:12.761886 7fc4e73ff6c0 Delete type=2 #289
2025/05/06-10:51:12.762144 7fc4e73ff6c0 Delete type=2 #301
2025/05/06-10:51:12.795034 7fc4e73ff6c0 Manual compaction at level-1 from '!items!zw9RQocTdz3HRjZK' @ 564 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
MANIFEST-000218
MANIFEST-000302

View File

@ -1,8 +1,8 @@
2025/04/21-17:09:30.778463 7f5dcdffb6c0 Recovering log #216
2025/04/21-17:09:30.789411 7f5dcdffb6c0 Delete type=3 #214
2025/04/21-17:09:30.789468 7f5dcdffb6c0 Delete type=0 #216
2025/04/21-17:40:19.406720 7f5dcd3ff6c0 Level-0 table #221: started
2025/04/21-17:40:19.406774 7f5dcd3ff6c0 Level-0 table #221: 0 bytes OK
2025/04/21-17:40:19.446347 7f5dcd3ff6c0 Delete type=0 #219
2025/04/21-17:40:19.572073 7f5dcd3ff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end)
2025/04/21-17:40:19.572119 7f5dcd3ff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end)
2025/05/06-10:52:19.304583 7fc4ed3f96c0 Recovering log #299
2025/05/06-10:52:19.314806 7fc4ed3f96c0 Delete type=3 #297
2025/05/06-10:52:19.314910 7fc4ed3f96c0 Delete type=0 #299
2025/05/06-10:53:10.030599 7fc4e73ff6c0 Level-0 table #305: started
2025/05/06-10:53:10.030635 7fc4e73ff6c0 Level-0 table #305: 0 bytes OK
2025/05/06-10:53:10.036964 7fc4e73ff6c0 Delete type=0 #303
2025/05/06-10:53:10.044214 7fc4e73ff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end)
2025/05/06-10:53:10.044269 7fc4e73ff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end)

View File

@ -1,8 +1,15 @@
2025/04/17-17:21:12.578876 7f5c82ffd6c0 Recovering log #212
2025/04/17-17:21:12.589060 7f5c82ffd6c0 Delete type=3 #210
2025/04/17-17:21:12.589120 7f5c82ffd6c0 Delete type=0 #212
2025/04/17-17:34:42.486913 7f5c81bff6c0 Level-0 table #217: started
2025/04/17-17:34:42.486964 7f5c81bff6c0 Level-0 table #217: 0 bytes OK
2025/04/17-17:34:42.492952 7f5c81bff6c0 Delete type=0 #215
2025/04/17-17:34:42.518936 7f5c81bff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end)
2025/04/17-17:34:42.519016 7f5c81bff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end)
2025/05/06-10:45:53.355849 7fc4edbfa6c0 Recovering log #295
2025/05/06-10:45:53.366571 7fc4edbfa6c0 Delete type=3 #293
2025/05/06-10:45:53.366637 7fc4edbfa6c0 Delete type=0 #295
2025/05/06-10:51:12.732133 7fc4e73ff6c0 Level-0 table #300: started
2025/05/06-10:51:12.736129 7fc4e73ff6c0 Level-0 table #300: 15304 bytes OK
2025/05/06-10:51:12.742079 7fc4e73ff6c0 Delete type=0 #298
2025/05/06-10:51:12.748632 7fc4e73ff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end)
2025/05/06-10:51:12.771871 7fc4e73ff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at '!items!zjvGljrLk5SshC9D' @ 65 : 1
2025/05/06-10:51:12.771882 7fc4e73ff6c0 Compacting 1@1 + 1@2 files
2025/05/06-10:51:12.776442 7fc4e73ff6c0 Generated table #301@1: 31 keys, 15417 bytes
2025/05/06-10:51:12.776461 7fc4e73ff6c0 Compacted 1@1 + 1@2 files => 15417 bytes
2025/05/06-10:51:12.782727 7fc4e73ff6c0 compacted to: files[ 0 0 1 0 0 0 0 ]
2025/05/06-10:51:12.782835 7fc4e73ff6c0 Delete type=2 #288
2025/05/06-10:51:12.782952 7fc4e73ff6c0 Delete type=2 #300
2025/05/06-10:51:12.795077 7fc4e73ff6c0 Manual compaction at level-1 from '!items!zjvGljrLk5SshC9D' @ 65 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
MANIFEST-000218
MANIFEST-000302

View File

@ -1,8 +1,8 @@
2025/04/21-17:09:30.749204 7f5dce7fc6c0 Recovering log #216
2025/04/21-17:09:30.759893 7f5dce7fc6c0 Delete type=3 #214
2025/04/21-17:09:30.760044 7f5dce7fc6c0 Delete type=0 #216
2025/04/21-17:40:19.292988 7f5dcd3ff6c0 Level-0 table #221: started
2025/04/21-17:40:19.293026 7f5dcd3ff6c0 Level-0 table #221: 0 bytes OK
2025/04/21-17:40:19.329102 7f5dcd3ff6c0 Delete type=0 #219
2025/04/21-17:40:19.406586 7f5dcd3ff6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
2025/04/21-17:40:19.406620 7f5dcd3ff6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
2025/05/06-10:52:19.275594 7fc4ecbf86c0 Recovering log #299
2025/05/06-10:52:19.285984 7fc4ecbf86c0 Delete type=3 #297
2025/05/06-10:52:19.286069 7fc4ecbf86c0 Delete type=0 #299
2025/05/06-10:53:10.024277 7fc4e73ff6c0 Level-0 table #305: started
2025/05/06-10:53:10.024336 7fc4e73ff6c0 Level-0 table #305: 0 bytes OK
2025/05/06-10:53:10.030435 7fc4e73ff6c0 Delete type=0 #303
2025/05/06-10:53:10.044204 7fc4e73ff6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
2025/05/06-10:53:10.044252 7fc4e73ff6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)

View File

@ -1,8 +1,15 @@
2025/04/17-17:21:12.549824 7f5c827fc6c0 Recovering log #212
2025/04/17-17:21:12.560061 7f5c827fc6c0 Delete type=3 #210
2025/04/17-17:21:12.560203 7f5c827fc6c0 Delete type=0 #212
2025/04/17-17:34:42.505447 7f5c81bff6c0 Level-0 table #217: started
2025/04/17-17:34:42.505471 7f5c81bff6c0 Level-0 table #217: 0 bytes OK
2025/04/17-17:34:42.518767 7f5c81bff6c0 Delete type=0 #215
2025/04/17-17:34:42.518998 7f5c81bff6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
2025/04/17-17:34:42.519066 7f5c81bff6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
2025/05/06-10:45:53.317135 7fc4e7fff6c0 Recovering log #295
2025/05/06-10:45:53.339293 7fc4e7fff6c0 Delete type=3 #293
2025/05/06-10:45:53.339350 7fc4e7fff6c0 Delete type=0 #295
2025/05/06-10:51:12.783010 7fc4e73ff6c0 Level-0 table #300: started
2025/05/06-10:51:12.787977 7fc4e73ff6c0 Level-0 table #300: 154604 bytes OK
2025/05/06-10:51:12.794741 7fc4e73ff6c0 Delete type=0 #298
2025/05/06-10:51:12.795090 7fc4e73ff6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
2025/05/06-10:51:12.795140 7fc4e73ff6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at '!items!zt8s7564ep1La4XQ' @ 281 : 1
2025/05/06-10:51:12.795156 7fc4e73ff6c0 Compacting 1@1 + 1@2 files
2025/05/06-10:51:12.800410 7fc4e73ff6c0 Generated table #301@1: 95 keys, 121769 bytes
2025/05/06-10:51:12.800436 7fc4e73ff6c0 Compacted 1@1 + 1@2 files => 121769 bytes
2025/05/06-10:51:12.806480 7fc4e73ff6c0 compacted to: files[ 0 0 1 0 0 0 0 ]
2025/05/06-10:51:12.806620 7fc4e73ff6c0 Delete type=2 #288
2025/05/06-10:51:12.806871 7fc4e73ff6c0 Delete type=2 #300
2025/05/06-10:51:12.827417 7fc4e73ff6c0 Manual compaction at level-1 from '!items!zt8s7564ep1La4XQ' @ 281 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
MANIFEST-000002

View File

View File

@ -0,0 +1,5 @@
2025/05/06-10:52:19.344307 7fc4e7fff6c0 Delete type=3 #1
2025/05/06-10:53:10.044408 7fc4e73ff6c0 Level-0 table #5: started
2025/05/06-10:53:10.051976 7fc4e73ff6c0 Level-0 table #5: 433603 bytes OK
2025/05/06-10:53:10.058524 7fc4e73ff6c0 Delete type=0 #3
2025/05/06-10:53:10.078387 7fc4e73ff6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
MANIFEST-000218
MANIFEST-000302

View File

@ -1,8 +1,8 @@
2025/04/21-17:09:30.792733 7f5dcf7fe6c0 Recovering log #216
2025/04/21-17:09:30.802787 7f5dcf7fe6c0 Delete type=3 #214
2025/04/21-17:09:30.802873 7f5dcf7fe6c0 Delete type=0 #216
2025/04/21-17:40:19.329256 7f5dcd3ff6c0 Level-0 table #221: started
2025/04/21-17:40:19.329290 7f5dcd3ff6c0 Level-0 table #221: 0 bytes OK
2025/04/21-17:40:19.360850 7f5dcd3ff6c0 Delete type=0 #219
2025/04/21-17:40:19.406600 7f5dcd3ff6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
2025/04/21-17:40:19.406634 7f5dcd3ff6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
2025/05/06-10:52:19.317853 7fc4edbfa6c0 Recovering log #299
2025/05/06-10:52:19.327788 7fc4edbfa6c0 Delete type=3 #297
2025/05/06-10:52:19.327923 7fc4edbfa6c0 Delete type=0 #299
2025/05/06-10:53:10.037095 7fc4e73ff6c0 Level-0 table #305: started
2025/05/06-10:53:10.037121 7fc4e73ff6c0 Level-0 table #305: 0 bytes OK
2025/05/06-10:53:10.044101 7fc4e73ff6c0 Delete type=0 #303
2025/05/06-10:53:10.044224 7fc4e73ff6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
2025/05/06-10:53:10.044260 7fc4e73ff6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)

View File

@ -1,8 +1,15 @@
2025/04/17-17:21:12.592168 7f5c83fff6c0 Recovering log #212
2025/04/17-17:21:12.602692 7f5c83fff6c0 Delete type=3 #210
2025/04/17-17:21:12.602743 7f5c83fff6c0 Delete type=0 #212
2025/04/17-17:34:42.499156 7f5c81bff6c0 Level-0 table #217: started
2025/04/17-17:34:42.499188 7f5c81bff6c0 Level-0 table #217: 0 bytes OK
2025/04/17-17:34:42.505329 7f5c81bff6c0 Delete type=0 #215
2025/04/17-17:34:42.518977 7f5c81bff6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
2025/04/17-17:34:42.519047 7f5c81bff6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
2025/05/06-10:45:53.369722 7fc4ed3f96c0 Recovering log #295
2025/05/06-10:45:53.379868 7fc4ed3f96c0 Delete type=3 #293
2025/05/06-10:45:53.379989 7fc4ed3f96c0 Delete type=0 #295
2025/05/06-10:51:12.720972 7fc4e73ff6c0 Level-0 table #300: started
2025/05/06-10:51:12.724909 7fc4e73ff6c0 Level-0 table #300: 20719 bytes OK
2025/05/06-10:51:12.731912 7fc4e73ff6c0 Delete type=0 #298
2025/05/06-10:51:12.748619 7fc4e73ff6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
2025/05/06-10:51:12.762241 7fc4e73ff6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at '!items!zkK6ixtCsCw3RH9X' @ 62 : 1
2025/05/06-10:51:12.762247 7fc4e73ff6c0 Compacting 1@1 + 1@2 files
2025/05/06-10:51:12.765506 7fc4e73ff6c0 Generated table #301@1: 27 keys, 20869 bytes
2025/05/06-10:51:12.765523 7fc4e73ff6c0 Compacted 1@1 + 1@2 files => 20869 bytes
2025/05/06-10:51:12.771435 7fc4e73ff6c0 compacted to: files[ 0 0 1 0 0 0 0 ]
2025/05/06-10:51:12.771569 7fc4e73ff6c0 Delete type=2 #288
2025/05/06-10:51:12.771746 7fc4e73ff6c0 Delete type=2 #300
2025/05/06-10:51:12.795060 7fc4e73ff6c0 Manual compaction at level-1 from '!items!zkK6ixtCsCw3RH9X' @ 62 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

@ -1,21 +0,0 @@
#lethalfantasy-application-manager {
display: flex;
font-family: var(--font-primary);
font-size: calc(var(--font-size-standard) * 1);
color: var(--color-dark-1);
background-image: var(--background-image-base);
background-repeat: no-repeat;
background-size: 100% 100%;
.lethalfantasy-table {
margin: 1rem;
background: none;
padding: 0;
margin: 0;
text-align: center;
.player {
font-size: calc(var(--font-size-standard) * 1);
}
}
}

View File

@ -18,4 +18,4 @@
}
@import "roll.less";
@import "application-manager.less";
@import "hud.less";

43
styles/hud.less Normal file
View File

@ -0,0 +1,43 @@
#token-hud .hp-loss-wrap {
position: absolute;
left: 75px;
display: none;
top: 50%;
width: 48px;
text-align: start;
overflow-y: auto;
}
#token-hud .hp-loss-wrap-col1 {
transform: translate(-200%, -50%);
}
#token-hud .hp-loss-wrap-col2 {
transform: translate(-300%, -50%);
}
#token-hud .hp-loss-wrap-col3 {
transform: translate(-400%, -50%);
}
#token-hud .hp-loss-hud-active {
display: block;
}
#token-hud .hp-loss-hud-disabled {
display: none;
}
#token-hud .hud-loss-hp-button-select {
max-width: 40px;
background-image: var(--background-image-base);
padding-top: 0;
padding-bottom: 0;
width: max-content;
margin: 0;
}
#token-hud .hp-loss-wrap .hud-loss-hp-button-select {
padding-left: 8px;
font-size: 0.7rem;
}

View File

@ -13,6 +13,19 @@
fieldset {
padding: 4px;
}
.goto-token-button {
justify-content: center;
align-items: center;
align-content: center;
margin-left: 0.5rem;
max-width: 8rem;
background-color: var(--color-dark-6);
color: var(--color-dark-2);
border: none;
border-radius: 4px;
padding: 0.5rem;
}
}
.lethalfantasy-range-defense-dialog {

View File

@ -82,6 +82,14 @@
"system": "fvtt-lethal-fantasy",
"path": "packs-system/lf-vulnerabilities",
"type": "Item"
},
{
"name": "lf-spells-miracles",
"banner": "",
"label": "Spells & Miracles",
"system": "fvtt-lethal-fantasy",
"path": "packs-system/lf-spells-miracles",
"type": "Item"
}
],
"flags": {

View File

@ -1,7 +1,7 @@
<div class="lethalfantasy-combat-action-dialog">
<fieldSet class="">
<legend>{{localize "LETHALFANTASY.Label.combatAction"}}</legend>
<legend>{{localize "LETHALFANTASY.Label.combatAction"}} for {{actorName}}</legend>
{{#if currentAction}}
<label>{{localize "LETHALFANTASY.Label.currentAction"}} : {{currentAction.name}}</label>

29
templates/loss-hp-hud.hbs Normal file
View File

@ -0,0 +1,29 @@
<div class="control-icon" data-action="lethal-loss-hp-hud">
<img class="lethal-hp-loss-hud" src="systems/fvtt-lethal-fantasy/assets/icons/broken-heart.svg"
width="36" height="36" title="Open token journal" />
<div class="hp-loss-wrap hp-loss-wrap-col1 hp-loss-hud-disabled">
{{#for -10 0 1}}
<button class="hud-loss-hp-button-select loss-hp-hud-click " data-hp-value="{{this}}" >
<span class="">{{this}}</span>
</button>
{{/for}}
</div>
<div class="hp-loss-wrap hp-loss-wrap-col2 hp-loss-hud-disabled">
{{#for -20 -10 1}}
<button class="hud-loss-hp-button-select loss-hp-hud-click " data-hp-value="{{this}}" >
<span class="">{{this}}</span>
</button>
{{/for}}
</div>
<div class="hp-loss-wrap hp-loss-wrap-col3 hp-loss-hud-disabled">
{{#for -30 -20 1}}
<button class="hud-loss-hp-button-select loss-hp-hud-click " data-hp-value="{{this}}" >
<span class="">{{this}}</span>
</button>
{{/for}}
</div>
</div>

View File

@ -1,13 +1,19 @@
<div class="lethalfantasy-roll-dialog">
<fieldSet class="">
<legend>{{localize (concat "LETHALFANTASY.Label." rollType)}}</legend>
<legend>{{localize (concat "LETHALFANTASY.Label." rollType)}} - {{actorName}}</legend>
{{#if rollTarget.tokenId}}
<div class="dialog-save">
<a class="goto-token-button" data-action="gotoToken" data-token-id="{{rollTarget.tokenId}}">{{localize "LETHALFANTASY.Label.gotoToken"}} </a>
</div>
{{/if}}
{{#if (match rollType "attack")}}
<div class="dialog-save">Attack roll !</div>
<div class="dialog-save">Attack roll ! - {{rollTarget.name}}</div>
{{/if}}
{{#if (match rollType "defense")}}
<div class="dialog-save">Defense roll !</div>
<div class="dialog-save">Defense roll ! - {{rollTarget.name}}</div>
{{/if}}
{{#if hasModifier}}
@ -87,4 +93,6 @@
{{selectOptions rollModes selected=visibility}}
</select>
</fieldSet>
</div>