Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ce630feb51 | |||
| b35b684d50 | |||
| f6fb0b68b8 | |||
| e45edd60c4 | |||
| d389a85a9f | |||
| c217490a5b | |||
| 38eb1a8d3d | |||
| 4724cdf2bb | |||
| 6d06c8ddad | |||
| 2770774aa3 |
@@ -59,5 +59,5 @@ jobs:
|
||||
version: ${{github.event.release.tag_name}}
|
||||
manifest: "https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json"
|
||||
notes: "https://www.uberwald.me/gitea/public/fvtt-lethal-fantasy/raw/branch/main/changelog.md"
|
||||
compatibility-minimum: "13"
|
||||
compatibility-minimum: "14"
|
||||
compatibility-verified: "14"
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with this repository.
|
||||
|
||||
## Overview
|
||||
|
||||
FoundryVTT v13+ game system for the **Lethal Fantasy RPG**. Entry point: `lethal-fantasy.mjs`.
|
||||
|
||||
## Commands
|
||||
|
||||
```bash
|
||||
# Compile LESS styles (styles/ -> css/)
|
||||
npx gulp css # one-shot
|
||||
npx gulp # compile + watch
|
||||
|
||||
# Lint
|
||||
npx eslint .
|
||||
|
||||
# Compendium pack management (LevelDB <-> YAML source)
|
||||
npm run pushLDBtoYML # export packs-system/ LevelDB -> source YAML
|
||||
npm run pullYMLtoLDB # import source YAML -> packs-system/ LevelDB
|
||||
```
|
||||
|
||||
No test suite exists.
|
||||
|
||||
## Architecture
|
||||
|
||||
Four layers in `module/`, all wired in `lethal-fantasy.mjs` via the `init` hook:
|
||||
|
||||
| Layer | Path | Purpose |
|
||||
|---|---|---|
|
||||
| Config | `module/config/` | Game constants. `SYSTEM` is `globalThis.SYSTEM` — always use `SYSTEM.*` for enumerations. |
|
||||
| Models | `module/models/` | `TypeDataModel` subclasses — data schemas per document type. |
|
||||
| Documents | `module/documents/` | Actor/Item/Roll/ChatMessage subclasses — game logic, roll processing, hooks. |
|
||||
| Applications | `module/applications/` | `ApplicationV2` sheets + custom combat tracker. |
|
||||
|
||||
**Actor types**: `character`, `monster`
|
||||
**Item types**: `skill`, `gift`, `vulnerability`, `weapon`, `armor`, `shield`, `spell`, `miracle`, `equipment`
|
||||
|
||||
Each layer has an `_module.mjs` barrel file that re-exports all classes from that layer.
|
||||
|
||||
Templates (`.hbs`) live in `templates/`. Styles are authored in LESS under `styles/` and compiled to `css/`.
|
||||
|
||||
### Key Patterns
|
||||
|
||||
- **Sheets**: Extend `HandlebarsApplicationMixin(foundry.applications.sheets.ActorSheetV2)` — imported from `foundry.applications.api`. **Not** the legacy `ActorSheet`. Child sheets (e.g. `character-sheet.mjs`) extend `base-actor-sheet.mjs` and override `static PARTS` and `DEFAULT_OPTIONS.actions`. Template paths are prefixed `systems/fvtt-lethal-fantasy/templates/`. Actor sheets have a play/edit toggle via `_sheetMode` and `SHEET_MODES`.
|
||||
- **Models**: `static defineSchema()` using `foundry.data.fields.*`. Field definitions derived from SYSTEM config objects.
|
||||
- **Rolls**: `LethalFantasyRoll` extends `Roll` with rich metadata via `this.options`. `D30Roll` is a separate class for D30 result tables (initialized in the `ready` hook).
|
||||
- **Socket**: Events use `game.socket.on(\`system.${SYSTEM.id}\`, ...)`. Multi-player attack-defense uses a global `pendingDefenses` Map.
|
||||
- **i18n**: All user-visible strings are keys in `lang/en.json` as `LETHALFANTASY.Category.Key`. Always use `game.i18n.localize(key)`.
|
||||
|
||||
### Compendium Packs
|
||||
|
||||
Five LevelDB packs in `packs-system/`: skills, equipment, gifts, vulnerabilities, spells-miracles. Use the `tools/` scripts to export/import editable YAML.
|
||||
|
||||
## Code Style
|
||||
|
||||
- No semicolons, double quotes, 2-space indent
|
||||
- JSDoc `/** */` required on all functions/classes
|
||||
- Max line length 180 (strings/templates exempt)
|
||||
- Arrow functions: omit parens for single param
|
||||
- ESLint + Prettier config in `eslint.config.mjs`
|
||||
@@ -529,16 +529,16 @@ i.lethalfantasy {
|
||||
}
|
||||
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .armor-hp {
|
||||
margin-right: 4px;
|
||||
min-width: 10rem;
|
||||
max-width: 10rem;
|
||||
min-width: 11rem;
|
||||
max-width: 11rem;
|
||||
}
|
||||
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .armor-hp .name {
|
||||
min-width: 6rem;
|
||||
max-width: 6rem;
|
||||
}
|
||||
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .armor-hp .input {
|
||||
min-width: 2.5rem;
|
||||
max-width: 2.5rem;
|
||||
min-width: 3.5rem;
|
||||
max-width: 3.5rem;
|
||||
}
|
||||
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .granted {
|
||||
min-width: 8rem;
|
||||
@@ -4139,6 +4139,59 @@ i.lethalfantasy {
|
||||
padding-left: 8px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
/* Luck/Grit Styles */
|
||||
#token-hud .luck-grit-wrap {
|
||||
position: absolute;
|
||||
left: 75px;
|
||||
display: none;
|
||||
top: 50%;
|
||||
width: 80px;
|
||||
text-align: start;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
border: 1px solid rgba(139, 69, 19, 0.5);
|
||||
border-radius: 4px;
|
||||
padding: 4px 6px;
|
||||
transform: translate(-100%, -50%);
|
||||
}
|
||||
#token-hud .luck-grit-hud-active {
|
||||
display: block;
|
||||
}
|
||||
#token-hud .luck-grit-hud-disabled {
|
||||
display: none;
|
||||
}
|
||||
#token-hud .luck-grit-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
margin: 2px 0;
|
||||
}
|
||||
#token-hud .luck-grit-label {
|
||||
flex: 1;
|
||||
color: #c9b896;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
#token-hud .luck-grit-btn {
|
||||
width: 28px;
|
||||
height: 22px;
|
||||
padding: 0;
|
||||
background: rgba(139, 69, 19, 0.25);
|
||||
border: 1px solid rgba(139, 69, 19, 0.4);
|
||||
border-radius: 3px;
|
||||
color: #d4c5a9;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
#token-hud .luck-grit-btn:hover {
|
||||
background: rgba(139, 69, 19, 0.5);
|
||||
border-color: rgba(139, 69, 19, 0.7);
|
||||
}
|
||||
/* -------------------------------------------------- */
|
||||
/* Dice Tray — injected into the Foundry chat sidebar */
|
||||
/* -------------------------------------------------- */
|
||||
|
||||
+8
-2
@@ -471,6 +471,8 @@
|
||||
"range": "Range",
|
||||
"rangeDefenseDialog": "Ranged defense dialog",
|
||||
"rangeDefenseRoll": "Ranged defense roll",
|
||||
"rangeAttackDialog": "Ranged attack dialog",
|
||||
"rangeAttackRoll": "Ranged attack roll",
|
||||
"rangedAttackDefense": "Ranged attack defense",
|
||||
"resource": "Resource",
|
||||
"resources": "Resources",
|
||||
@@ -503,8 +505,6 @@
|
||||
"monster-defense": "Monster defense",
|
||||
"weapons": "Weapons",
|
||||
"wis": "WIS",
|
||||
"weapon-damage-medium": "Weapon damage medium",
|
||||
"weapon-damage-small": "Weapon damage small",
|
||||
"combatProgressionStart": "Combat start threshold",
|
||||
"miracle": "Miracle",
|
||||
"titleStandard": "Standard Roll",
|
||||
@@ -826,6 +826,12 @@
|
||||
"cost": {
|
||||
"label": "Cost"
|
||||
},
|
||||
"costOverpowered": {
|
||||
"label": "Cost (Overpowered)"
|
||||
},
|
||||
"costOverpowered2": {
|
||||
"label": "Cost (Overpowered 2)"
|
||||
},
|
||||
"description": {
|
||||
"label": "Description"
|
||||
},
|
||||
|
||||
+278
-61
@@ -242,6 +242,9 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
|
||||
console.log(`[LF] request-defense-btn | attackRollType=${attackRollType} defender=${defenderName} defenderType=${combatant.actor?.type}`)
|
||||
const attackD30result = message.rolls[0]?.options?.D30result || null
|
||||
const attackD30message = message.rolls[0]?.options?.D30message || null
|
||||
const attackDiceResults = message.rolls[0]?.options?.diceResults || null
|
||||
const attackNaturalRoll = attackDiceResults?.[0]?.value || null
|
||||
const damageTier = message.rolls[0]?.options?.damageTier || "standard"
|
||||
const attackRerollContext = {
|
||||
rollType: message.rolls[0]?.options?.rollType,
|
||||
rollTarget: foundry.utils.duplicate(message.rolls[0]?.options?.rollTarget ?? {}),
|
||||
@@ -262,6 +265,7 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
|
||||
const isRangedAttack = (rollTargetOptions?.attackMode === "ranged")
|
||||
|| (attacker?.type === "monster" && attacker.system.attackMode === "ranged")
|
||||
|| (attackerWeapon?.system?.weaponType === "ranged")
|
||||
|| (rollTargetOptions?.isRangedAttack === true)
|
||||
|
||||
const defenseMsg = {
|
||||
type: "requestDefense",
|
||||
@@ -276,6 +280,8 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
|
||||
attackD30result,
|
||||
attackD30message,
|
||||
attackRerollContext,
|
||||
attackNaturalRoll,
|
||||
damageTier,
|
||||
combatantId,
|
||||
tokenId,
|
||||
isRanged: isRangedAttack
|
||||
@@ -337,6 +343,9 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
|
||||
const damageFormula = btn.dataset.damageFormula
|
||||
const damageModifier = btn.dataset.damageModifier
|
||||
const isMonster = btn.dataset.isMonster
|
||||
const d30Bleed = btn.dataset.d30Bleed === "true"
|
||||
const d30DamageMultiplier = Number(btn.dataset.d30DamageMult) || 1
|
||||
const d30DrMultiplier = Number(btn.dataset.d30DrMult) || 1
|
||||
|
||||
// Récupérer l'acteur (soit depuis le message, soit depuis attackerId)
|
||||
const actor = attackerId ? game.actors.get(attackerId) : game.actors.get(message.rolls[0]?.actorId)
|
||||
@@ -374,12 +383,12 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
|
||||
{
|
||||
action: "cancel",
|
||||
label: game.i18n.localize("LETHALFANTASY.Combat.proceedNo"),
|
||||
callback: () => null
|
||||
callback: () => "cancel"
|
||||
}
|
||||
],
|
||||
rejectClose: false
|
||||
})
|
||||
if (manualDR === null) return
|
||||
if (manualDR === null || manualDR === "cancel") return
|
||||
const rollOpts = {
|
||||
type: "spell-damage",
|
||||
rollType: "spell-damage",
|
||||
@@ -391,31 +400,24 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
|
||||
defenderTokenId,
|
||||
actorId: actor.id,
|
||||
actorName: actor.name,
|
||||
actorImage: actor.img
|
||||
actorImage: actor.img,
|
||||
d30Bleed,
|
||||
d30DamageMultiplier,
|
||||
d30DrMultiplier
|
||||
}
|
||||
const roll = new documents.LethalFantasyRoll(damageFormula, {}, rollOpts)
|
||||
await roll.evaluate()
|
||||
const diceResults = []
|
||||
for (const term of roll.dice) {
|
||||
for (const r of term.results) {
|
||||
diceResults.push({ dice: `1D${term.faces}`, value: r.result })
|
||||
}
|
||||
}
|
||||
roll.options.diceResults = diceResults
|
||||
roll.options.rollTotal = roll.total
|
||||
await roll.toMessage()
|
||||
await documents.LethalFantasyRoll.rollSpellDamageToMessage(damageFormula, rollOpts)
|
||||
return
|
||||
}
|
||||
|
||||
// Pour les boutons de résultat de combat (monster damage)
|
||||
if (damageType === "monster" && attackKey) {
|
||||
await actor.system.prepareMonsterRoll("monster-damage", attackKey, undefined, undefined, undefined, defenderId, defenderTokenId, extraShieldDr)
|
||||
await actor.system.prepareMonsterRoll("monster-damage", attackKey, undefined, undefined, undefined, defenderId, defenderTokenId, extraShieldDr, { d30Bleed, d30DamageMultiplier, d30DrMultiplier })
|
||||
return
|
||||
}
|
||||
|
||||
// Pour les monstres, utiliser prepareMonsterRoll
|
||||
if (isMonster === "true" || actor.type === "monster") {
|
||||
await actor.system.prepareMonsterRoll("monster-damage", weaponId, undefined, undefined, damageModifier)
|
||||
await actor.system.prepareMonsterRoll("monster-damage", weaponId, undefined, undefined, damageModifier, defenderId, defenderTokenId, extraShieldDr, { d30Bleed, d30DamageMultiplier, d30DrMultiplier })
|
||||
return
|
||||
}
|
||||
|
||||
@@ -426,9 +428,9 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => {
|
||||
return
|
||||
}
|
||||
|
||||
// Lancer les dégâts avec la bonne méthode
|
||||
const rollType = damageType === "small" ? "weapon-damage-small" : "weapon-damage-medium"
|
||||
await actor.prepareRoll(rollType, weaponId, undefined, defenderId, defenderTokenId, extraShieldDr)
|
||||
// Lancer les dégâts
|
||||
const rollType = "weapon-damage"
|
||||
await actor.prepareRoll(rollType, weaponId, undefined, defenderId, defenderTokenId, extraShieldDr, { d30Bleed, d30DamageMultiplier, d30DrMultiplier })
|
||||
})
|
||||
}
|
||||
|
||||
@@ -492,6 +494,8 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
attackRollKey,
|
||||
attackD30message,
|
||||
attackRerollContext,
|
||||
attackNaturalRoll,
|
||||
damageTier,
|
||||
defenderId,
|
||||
defenderTokenId
|
||||
} = attackData
|
||||
@@ -535,19 +539,69 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
})
|
||||
}
|
||||
|
||||
// Si le défenseur est un personnage qui perd, proposer Grit/Luck (seulement s'il a des points)
|
||||
// Seulement si l'utilisateur actuel est le propriétaire du défenseur
|
||||
// Reaction phase — both sides may use grit/luck/shield/mulligan before the outcome is resolved.
|
||||
// After a mulligan reroll (either side), the comparison restarts so both sides can react to the new numbers.
|
||||
let defenderHandledBonus = false
|
||||
let attackerHandledBonus = false
|
||||
let shieldReaction = null
|
||||
let shieldBlocked = false
|
||||
const isSpellOrMiracle = attackRollType === "spell-attack" || attackRollType === "miracle-attack"
|
||||
if (defender && defenseRoll < attackRoll && isPrimaryController(defender) && !isSpellOrMiracle) {
|
||||
|
||||
// These persist across mulligan restarts (once used they stay consumed)
|
||||
const shieldData = LethalFantasyUtils.getShieldReactionData(defender)
|
||||
let canRerollDefense = LethalFantasyUtils.hasD30Reroll(defenseD30message)
|
||||
let canShieldReact = !!shieldData
|
||||
let canAdHocShield = !shieldData
|
||||
let attackRollFinal = attackRoll
|
||||
let canRerollAttack = LethalFantasyUtils.hasD30Reroll(attackD30message)
|
||||
let mulliganRestart = false
|
||||
// These persist across mulligan restarts (D30 bonus only applied once)
|
||||
let defenseD30Processed = false
|
||||
let attackD30Processed = false
|
||||
// D30 combat effects for damage application
|
||||
let d30Bleed = false
|
||||
let d30DamageMultiplier = 1
|
||||
let d30DrMultiplier = 1
|
||||
|
||||
while (defenseRoll < attackRoll) {
|
||||
do {
|
||||
mulliganRestart = false
|
||||
defenderHandledBonus = false
|
||||
attackerHandledBonus = false
|
||||
|
||||
// ── D30 bonus dice (defense) — resolved before grit/luck/shield ───────
|
||||
if (defenseD30message && !defenseD30Processed && isPrimaryController(defender)) {
|
||||
const d30Result = await LethalFantasyUtils.processD30BonusDice(defenseD30message, "defense", null, defender)
|
||||
if (d30Result.modifier) {
|
||||
defenseRoll += d30Result.modifier
|
||||
if (d30Result.modifier > 0) {
|
||||
await createReactionMessage(defender,
|
||||
`<p><strong>${defenderName}</strong> gains <strong>+${d30Result.modifier}</strong> from D30 bonus die for defense.</p>`
|
||||
)
|
||||
}
|
||||
}
|
||||
if (d30Result.specialEffect === "auto") {
|
||||
defenseRoll = attackRollFinal + 1 // auto-block
|
||||
await createReactionMessage(defender,
|
||||
`<p><strong>${defenderName}</strong> uses <strong>${d30Result.specialName || "Special Defense"}</strong> from D30 — defense automatically succeeds!</p>`
|
||||
)
|
||||
}
|
||||
if (d30Result.specialEffect === "flag") {
|
||||
await createReactionMessage(defender,
|
||||
`<p>D30 — <strong>${d30Result.specialName || "Special Effect"}</strong> triggered for ${defenderName}!</p>`
|
||||
)
|
||||
}
|
||||
if (d30Result.specialEffect === "drMultiplier") {
|
||||
d30DrMultiplier = d30Result.multiplier
|
||||
await createReactionMessage(defender,
|
||||
`<p>D30 — Defense grants <strong>x${d30Result.multiplier} DR</strong> (choose which DR types to multiply when damage is applied)</p>`
|
||||
)
|
||||
}
|
||||
defenseD30Processed = true
|
||||
}
|
||||
|
||||
// ── Defense reaction loop ──────────────────────────────────────────────
|
||||
if (defender && defenseRoll < attackRollFinal && isPrimaryController(defender) && !isSpellOrMiracle) {
|
||||
while (defenseRoll < attackRollFinal) {
|
||||
const currentGrit = Number(defender.system?.grit?.current) || 0
|
||||
const currentLuck = Number(defender.system?.luck?.current) || 0
|
||||
const buttons = []
|
||||
@@ -580,7 +634,7 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
if (canRerollDefense) {
|
||||
buttons.push({
|
||||
action: "rerollDefense",
|
||||
label: "Re-roll defense",
|
||||
label: "Re-roll defense (Mulligan)",
|
||||
icon: "fa-solid fa-rotate-right",
|
||||
callback: () => "rerollDefense"
|
||||
})
|
||||
@@ -594,7 +648,6 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
callback: () => "shieldReact"
|
||||
})
|
||||
} else if (canAdHocShield) {
|
||||
// No pre-configured shield — offer ad-hoc shield option (useful for monsters)
|
||||
buttons.push({
|
||||
action: "adHocShield",
|
||||
label: "Roll ad-hoc shield (choose dice + DR)",
|
||||
@@ -616,7 +669,7 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
content: `
|
||||
<div class="grit-luck-dialog">
|
||||
<div class="combat-status">
|
||||
<p><strong>${attackerName}</strong> rolled <strong>${attackRoll}</strong></p>
|
||||
<p><strong>${attackerName}</strong> rolled <strong>${attackRollFinal}</strong></p>
|
||||
<p><strong>${defenderName}</strong> currently has <strong>${defenseRoll}</strong></p>
|
||||
${defenseD30message ? `<p class="bonus-info">D30 special: ${defenseD30message.description}</p>` : ""}
|
||||
</div>
|
||||
@@ -632,21 +685,21 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
defenderHandledBonus = true
|
||||
|
||||
if (choice === "grit") {
|
||||
const bonusRoll = await LethalFantasyUtils.rollBonusDie("1d6", defender, (total) => `<p><strong>${defenderName}</strong> spends 1 Grit and rolls <strong>${total}</strong> for defense.</p>`)
|
||||
const bonusRoll = await LethalFantasyUtils.rollBonusDie("1d6", defender, total => `<p><strong>${defenderName}</strong> spends 1 Grit and rolls <strong>${total}</strong> for defense.</p>`)
|
||||
defenseRoll += bonusRoll
|
||||
await defender.update({ "system.grit.current": currentGrit - 1 })
|
||||
continue
|
||||
}
|
||||
|
||||
if (choice === "luck") {
|
||||
const bonusRoll = await LethalFantasyUtils.rollBonusDie("1d6", defender, (total) => `<p><strong>${defenderName}</strong> spends 1 Luck and rolls <strong>${total}</strong> for defense.</p>`)
|
||||
const bonusRoll = await LethalFantasyUtils.rollBonusDie("1d6", defender, total => `<p><strong>${defenderName}</strong> spends 1 Luck and rolls <strong>${total}</strong> for defense.</p>`)
|
||||
defenseRoll += bonusRoll
|
||||
await defender.update({ "system.luck.current": currentLuck - 1 })
|
||||
continue
|
||||
}
|
||||
|
||||
if (choice === "bonusDie") {
|
||||
const bonusDie = await LethalFantasyUtils.promptCombatBonusDie(defenderName, "attack", defenseRoll, attackRoll)
|
||||
const bonusDie = await LethalFantasyUtils.promptCombatBonusDie(defenderName, "attack", defenseRoll, attackRollFinal)
|
||||
if (!bonusDie) continue
|
||||
const bonusRoll = await LethalFantasyUtils.rollBonusDie(bonusDie, defender, (total, formula) => `<p><strong>${defenderName}</strong> adds <strong>${formula.toUpperCase()}</strong> and rolls <strong>${total}</strong> for defense.</p>`)
|
||||
defenseRoll += bonusRoll
|
||||
@@ -659,8 +712,10 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
canRerollDefense = false
|
||||
if (!reroll) continue
|
||||
defenseRoll = reroll.options?.rollTotal || reroll.total || oldDefenseRoll
|
||||
await createReactionMessage(defender, `<p><strong>${defenderName}</strong> uses Mulligan and re-rolls defense: <strong>${oldDefenseRoll}</strong> → <strong>${defenseRoll}</strong>.</p>`)
|
||||
continue
|
||||
await createReactionMessage(defender, `<p><strong>${defenderName}</strong> uses Mulligan and re-rolls defense: <strong>${oldDefenseRoll}</strong> → <strong>${defenseRoll}</strong>. Both sides may now react to the new numbers.</p>`)
|
||||
// Restart the full comparison so both sides can react to the new roll
|
||||
mulliganRestart = true
|
||||
break
|
||||
}
|
||||
|
||||
if (choice === "shieldReact" && canShieldReact) {
|
||||
@@ -669,7 +724,7 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
defenseRoll = newDefenseTotal
|
||||
canShieldReact = false
|
||||
|
||||
if (newDefenseTotal >= attackRoll) {
|
||||
if (newDefenseTotal >= attackRollFinal) {
|
||||
shieldBlocked = true
|
||||
shieldReaction = {
|
||||
damageReduction: shieldData.damageReduction,
|
||||
@@ -678,19 +733,19 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
}
|
||||
await createReactionMessage(
|
||||
defender,
|
||||
`<p><strong>${defenderName}</strong> rolls <strong>${shieldData.label}</strong> and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} ≥ ${attackRoll}). <strong>Shield blocked the attack!</strong> Both armor DR and shield DR <strong>${shieldData.damageReduction}</strong> will apply to damage.</p>`
|
||||
`<p><strong>${defenderName}</strong> rolls <strong>${shieldData.label}</strong> and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} ≥ ${attackRollFinal}). <strong>Shield blocked the attack!</strong> Both armor DR and shield DR <strong>${shieldData.damageReduction}</strong> will apply to damage.</p>`
|
||||
)
|
||||
} else {
|
||||
shieldReaction = null
|
||||
await createReactionMessage(
|
||||
defender,
|
||||
`<p><strong>${defenderName}</strong> rolls <strong>${shieldData.label}</strong> and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} < ${attackRoll}). Shield did not block — normal hit, armor DR only.</p>`
|
||||
`<p><strong>${defenderName}</strong> rolls <strong>${shieldData.label}</strong> and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} < ${attackRollFinal}). Shield did not block — normal hit, armor DR only.</p>`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (choice === "adHocShield") {
|
||||
const adHoc = await LethalFantasyUtils.promptAdHocShield(defenderName, attackRoll, defenseRoll)
|
||||
const adHoc = await LethalFantasyUtils.promptAdHocShield(defenderName, attackRollFinal, defenseRoll)
|
||||
if (!adHoc) continue
|
||||
const shieldBonus = await LethalFantasyUtils.rollBonusDie(adHoc.formula, defender)
|
||||
const newDefenseTotal = defenseRoll + shieldBonus
|
||||
@@ -698,7 +753,7 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
canShieldReact = false
|
||||
canAdHocShield = false
|
||||
|
||||
if (newDefenseTotal >= attackRoll) {
|
||||
if (newDefenseTotal >= attackRollFinal) {
|
||||
shieldBlocked = true
|
||||
shieldReaction = {
|
||||
damageReduction: adHoc.damageReduction,
|
||||
@@ -707,27 +762,60 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
}
|
||||
await createReactionMessage(
|
||||
defender,
|
||||
`<p><strong>${defenderName}</strong> rolls <strong>${adHoc.formula.toUpperCase()}</strong> shield and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} ≥ ${attackRoll}). <strong>Shield blocked the attack!</strong> Both armor DR and shield DR <strong>${adHoc.damageReduction}</strong> will apply to damage.</p>`
|
||||
`<p><strong>${defenderName}</strong> rolls <strong>${adHoc.formula.toUpperCase()}</strong> shield and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} ≥ ${attackRollFinal}). <strong>Shield blocked the attack!</strong> Both armor DR and shield DR <strong>${adHoc.damageReduction}</strong> will apply to damage.</p>`
|
||||
)
|
||||
} else {
|
||||
shieldReaction = null
|
||||
await createReactionMessage(
|
||||
defender,
|
||||
`<p><strong>${defenderName}</strong> rolls <strong>${adHoc.formula.toUpperCase()}</strong> shield and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} < ${attackRoll}). Shield did not block — normal hit, armor DR only.</p>`
|
||||
`<p><strong>${defenderName}</strong> rolls <strong>${adHoc.formula.toUpperCase()}</strong> shield and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} < ${attackRollFinal}). Shield did not block — normal hit, armor DR only.</p>`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let attackRollFinal = attackRoll
|
||||
let attackerHandledBonus = false
|
||||
if (mulliganRestart) continue
|
||||
|
||||
// Si l'attaquant est un personnage qui perd et a du Grit
|
||||
// Seulement si l'utilisateur actuel est le propriétaire de l'attaquant (pas le MJ)
|
||||
// ── D30 bonus dice (attack) — resolved before grit/luck ────────────────
|
||||
if (attackD30message && !attackD30Processed && isPrimaryController(attacker)) {
|
||||
const d30Result = await LethalFantasyUtils.processD30BonusDice(attackD30message, "attack", attackNaturalRoll, attacker)
|
||||
if (d30Result.modifier) {
|
||||
attackRollFinal += d30Result.modifier
|
||||
if (d30Result.modifier > 0) {
|
||||
await createReactionMessage(attacker,
|
||||
`<p><strong>${attackerName}</strong> gains <strong>+${d30Result.modifier}</strong> from D30 bonus die for attack.</p>`
|
||||
)
|
||||
}
|
||||
}
|
||||
if (d30Result.specialEffect === "auto") {
|
||||
attackRollFinal = defenseRoll + 1 // auto-hit
|
||||
await createReactionMessage(attacker,
|
||||
`<p><strong>${attackerName}</strong> uses <strong>${d30Result.specialName || "Special Strike"}</strong> from D30 — attack automatically hits!</p>`
|
||||
)
|
||||
}
|
||||
if (d30Result.specialEffect === "flag") {
|
||||
await createReactionMessage(attacker,
|
||||
`<p>D30 — <strong>${d30Result.specialName || "Special Effect"}</strong> triggered for ${attackerName}!</p>`
|
||||
)
|
||||
}
|
||||
if (d30Result.specialEffect === "bleed") {
|
||||
d30Bleed = true
|
||||
await createReactionMessage(attacker,
|
||||
`<p>D30 — <strong>Bleeding/Internal Injury</strong> on hit! Damage past DR will cause a bleeding wound.</p>`
|
||||
)
|
||||
}
|
||||
if (d30Result.specialEffect === "damageMultiplier") {
|
||||
d30DamageMultiplier = d30Result.multiplier
|
||||
await createReactionMessage(attacker,
|
||||
`<p>D30 — <strong>x${d30Result.multiplier} damage</strong> before damage reduction!</p>`
|
||||
)
|
||||
}
|
||||
attackD30Processed = true
|
||||
}
|
||||
|
||||
// ── Attack reaction loop ───────────────────────────────────────────────
|
||||
if (!defenderHandledBonus && attacker && attackRollFinal <= defenseRoll && isPrimaryController(attacker)) {
|
||||
let canRerollAttack = LethalFantasyUtils.hasD30Reroll(attackD30message)
|
||||
|
||||
while (attackRollFinal <= defenseRoll) {
|
||||
const currentGrit = Number(attacker.system?.grit?.current) || 0
|
||||
const buttons = []
|
||||
@@ -751,7 +839,7 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
if (canRerollAttack && attackRerollContext) {
|
||||
buttons.push({
|
||||
action: "rerollAttack",
|
||||
label: "Re-roll attack",
|
||||
label: "Re-roll attack (Mulligan)",
|
||||
icon: "fa-solid fa-rotate-right",
|
||||
callback: () => "rerollAttack"
|
||||
})
|
||||
@@ -786,7 +874,7 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
attackerHandledBonus = true
|
||||
|
||||
if (choice === "grit") {
|
||||
const attackBonus = await LethalFantasyUtils.rollBonusDie("1d6", attacker, (total) => `<p><strong>${attackerName}</strong> spends 1 Grit and rolls <strong>${total}</strong> for attack.</p>`)
|
||||
const attackBonus = await LethalFantasyUtils.rollBonusDie("1d6", attacker, total => `<p><strong>${attackerName}</strong> spends 1 Grit and rolls <strong>${total}</strong> for attack.</p>`)
|
||||
attackRollFinal += attackBonus
|
||||
await attacker.update({ "system.grit.current": currentGrit - 1 })
|
||||
continue
|
||||
@@ -806,10 +894,14 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
canRerollAttack = false
|
||||
if (!reroll) continue
|
||||
attackRollFinal = reroll.options?.rollTotal || reroll.total || oldAttackRoll
|
||||
await createReactionMessage(attacker, `<p><strong>${attackerName}</strong> uses Mulligan and re-rolls attack: <strong>${oldAttackRoll}</strong> → <strong>${attackRollFinal}</strong>.</p>`)
|
||||
await createReactionMessage(attacker, `<p><strong>${attackerName}</strong> uses Mulligan and re-rolls attack: <strong>${oldAttackRoll}</strong> → <strong>${attackRollFinal}</strong>. Both sides may now react to the new numbers.</p>`)
|
||||
// Restart the full comparison so both sides can react to the new roll
|
||||
mulliganRestart = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (mulliganRestart)
|
||||
|
||||
const shieldDamageReduction = shieldBlocked ? shieldReaction.damageReduction : 0
|
||||
const outcome = shieldBlocked ? "shielded-hit" : (attackRollFinal > defenseRoll ? "hit" : "miss")
|
||||
@@ -833,7 +925,11 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
defenderTokenId,
|
||||
defenseRoll,
|
||||
outcome,
|
||||
shieldDamageReduction
|
||||
shieldDamageReduction,
|
||||
d30Bleed: d30Bleed ? "true" : "",
|
||||
d30DamageMultiplier: d30DamageMultiplier,
|
||||
d30DrMultiplier: d30DrMultiplier,
|
||||
damageTier: damageTier || "standard"
|
||||
})
|
||||
} else {
|
||||
console.log("Skipping message creation", { attackerHandledBonus, defenderHandledBonus })
|
||||
@@ -861,15 +957,19 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
const spell = spellId ? actor.items.get(spellId) : null
|
||||
if (!spell || spell.type !== "spell") return
|
||||
|
||||
const cost = Number(spell.system?.cost) || 0
|
||||
const damageTier = message.rolls[0]?.options?.damageTier || "standard"
|
||||
const tierCostMap = { standard: "cost", overpowered: "costOverpowered", overpowered2: "costOverpowered2" }
|
||||
const costField = tierCostMap[damageTier] || "cost"
|
||||
const cost = Number(spell.system?.[costField]) || 0
|
||||
if (cost <= 0) return
|
||||
|
||||
const currentAether = Number(actor.system.aetherPoints?.value) || 0
|
||||
const newAether = Math.max(0, currentAether - cost)
|
||||
await actor.update({ "system.aetherPoints.value": newAether })
|
||||
|
||||
const tierLabel = damageTier === "standard" ? "" : ` (${damageTier})`
|
||||
await ChatMessage.create({
|
||||
content: `<p>🔮 <strong>${actor.name}</strong> casts <em>${spell.name}</em> — spends <strong>${cost}</strong> Aether <span style="color:#888;">(${currentAether} → ${newAether})</span>.</p>`,
|
||||
content: `<p>🔮 <strong>${actor.name}</strong> casts <em>${spell.name}${tierLabel}</em> — spends <strong>${cost}</strong> Aether <span style="color:#888;">(${currentAether} → ${newAether})</span>.</p>`,
|
||||
speaker: ChatMessage.getSpeaker({ actor })
|
||||
})
|
||||
})
|
||||
@@ -962,13 +1062,94 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
const attackerName = message.rolls[0]?.options?.actorName || "Unknown Attacker"
|
||||
const rollType = message.rolls[0]?.options?.rollType
|
||||
|
||||
// Lire les effets D30
|
||||
const d30Bleed = message.rolls[0]?.options?.d30Bleed || false
|
||||
const d30DamageMultiplier = message.rolls[0]?.options?.d30DamageMultiplier || 1
|
||||
const d30DrMultiplier = message.rolls[0]?.options?.d30DrMultiplier || 1
|
||||
|
||||
// Appliquer le multiplicateur de dégâts D30 au total AVANT DR
|
||||
const rawDamage = damageTotal * d30DamageMultiplier
|
||||
|
||||
// Calculer les DR — les sorts utilisent une DR manuelle saisie par l'utilisateur
|
||||
const isSpellDamage = rollType === "spell-damage"
|
||||
const manualDR = message.rolls[0]?.options?.manualDR ?? 0
|
||||
const extraShieldDr = Number(message.rolls[0]?.options?.extraShieldDr) || 0
|
||||
const armorDR = isSpellDamage ? manualDR : (defender.computeDamageReduction() || 0)
|
||||
const totalDR = isSpellDamage ? manualDR : armorDR + extraShieldDr
|
||||
const finalDamage = Math.max(0, damageTotal - totalDR)
|
||||
|
||||
// Décomposer les DR en composants
|
||||
let baseDR = 0
|
||||
let shieldDR = 0
|
||||
let magicDR = 0
|
||||
|
||||
if (isSpellDamage) {
|
||||
baseDR = manualDR
|
||||
} else {
|
||||
const totalDefDR = defender.computeDamageReduction() || 0
|
||||
magicDR = defender.getMagicDR() || 0
|
||||
baseDR = totalDefDR - magicDR // naturalDR + armorDR (ou hpDR + combatDR pour les monstres)
|
||||
shieldDR = extraShieldDr
|
||||
}
|
||||
|
||||
// Appliquer le multiplicateur de DR D30 si actif — boîte de dialogue
|
||||
let appliedBaseDR = baseDR
|
||||
let appliedShieldDR = shieldDR
|
||||
let appliedMagicDR = magicDR
|
||||
|
||||
if (d30DrMultiplier > 1) {
|
||||
const drResult = await (async () => {
|
||||
const checks = {
|
||||
base: true,
|
||||
shield: shieldDR > 0,
|
||||
magic: magicDR > 0
|
||||
}
|
||||
const html = `
|
||||
<div class="grit-luck-dialog">
|
||||
<p><strong>D30 DR Multiplier ×${d30DrMultiplier}</strong></p>
|
||||
<p>Choose which DR types to multiply:</p>
|
||||
<label style="display:block;margin:0.3rem 0">
|
||||
<input type="checkbox" id="d30-dr-base" ${checks.base ? "checked" : ""} ${baseDR <= 0 ? "disabled" : ""}>
|
||||
Base DR (Armor/Natural): ${baseDR} → ×${d30DrMultiplier} = ${baseDR * d30DrMultiplier}
|
||||
</label>
|
||||
<label style="display:block;margin:0.3rem 0">
|
||||
<input type="checkbox" id="d30-dr-shield" ${checks.shield ? "checked" : ""} ${shieldDR <= 0 ? "disabled" : ""}>
|
||||
Shield DR: ${shieldDR} → ×${d30DrMultiplier} = ${shieldDR * d30DrMultiplier}
|
||||
</label>
|
||||
<label style="display:block;margin:0.3rem 0">
|
||||
<input type="checkbox" id="d30-dr-magic" ${checks.magic ? "checked" : ""} ${magicDR <= 0 ? "disabled" : ""}>
|
||||
Magic DR: ${magicDR} → ×${d30DrMultiplier} = ${magicDR * d30DrMultiplier}
|
||||
</label>
|
||||
</div>
|
||||
`
|
||||
const result = await foundry.applications.api.DialogV2.wait({
|
||||
window: { title: "Apply D30 DR Multiplier" },
|
||||
classes: ["lethalfantasy"],
|
||||
content: html,
|
||||
buttons: [
|
||||
{
|
||||
action: "apply",
|
||||
label: "Apply Damage",
|
||||
icon: "fa-solid fa-check",
|
||||
callback: (event, button) => {
|
||||
const form = button.form || button.closest("form")
|
||||
return {
|
||||
applyBase: form.querySelector("#d30-dr-base")?.checked || false,
|
||||
applyShield: form.querySelector("#d30-dr-shield")?.checked || false,
|
||||
applyMagic: form.querySelector("#d30-dr-magic")?.checked || false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
rejectClose: false
|
||||
})
|
||||
return result || { applyBase: false, applyShield: false, applyMagic: false }
|
||||
})()
|
||||
|
||||
appliedBaseDR = drResult.applyBase ? baseDR * d30DrMultiplier : baseDR
|
||||
appliedShieldDR = drResult.applyShield ? shieldDR * d30DrMultiplier : shieldDR
|
||||
appliedMagicDR = drResult.applyMagic ? magicDR * d30DrMultiplier : magicDR
|
||||
}
|
||||
|
||||
const totalDR = appliedBaseDR + appliedShieldDR + appliedMagicDR
|
||||
const finalDamage = Math.max(0, rawDamage - totalDR)
|
||||
|
||||
// Prefer the token ID stored in roll options (set at attack time when the exact token is known).
|
||||
// For unlinked tokens (default for monsters), this ensures we target the right instance even
|
||||
@@ -983,16 +1164,48 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
// Apply damage. If the current user does not own the defender (e.g. player hitting a GM monster),
|
||||
// route the HP update to the GM via socket. The confirmation message is still created here
|
||||
// since all users can create chat messages.
|
||||
const applyDamageToActor = async (actor) => {
|
||||
await actor.applyDamage(-finalDamage)
|
||||
// Create bleeding wound if D30 triggered it
|
||||
if (d30Bleed && finalDamage > 0 && actor.system.hp?.wounds) {
|
||||
const wounds = foundry.utils.duplicate(actor.system.hp.wounds)
|
||||
const slot = wounds.findIndex(w => !w.value && !w.duration)
|
||||
if (slot !== -1) {
|
||||
wounds[slot] = { value: finalDamage, duration: finalDamage, description: "Bleeding" }
|
||||
await actor.update({ "system.hp.wounds": wounds })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defender.isOwner) {
|
||||
// Resolve the token actor: prefer lookup by token ID (exact match for unlinked monsters),
|
||||
// fall back to combatant actor, then base world actor.
|
||||
const tokenActor = (defenderTokenId
|
||||
? canvas.tokens?.placeables?.find(t => t.id === defenderTokenId)?.actor
|
||||
: defenderCombatant?.actor) ?? defender
|
||||
await tokenActor.applyDamage(-finalDamage)
|
||||
await applyDamageToActor(tokenActor)
|
||||
} else {
|
||||
game.socket.emit(`system.${SYSTEM.id}`, { type: "applyDamage", actorId: defender.id, tokenId: defenderTokenId, damage: -finalDamage })
|
||||
// Also emit wound creation for bleeding
|
||||
if (d30Bleed && finalDamage > 0 && defender.system.hp?.wounds) {
|
||||
game.socket.emit(`system.${SYSTEM.id}`, { type: "applyBleeding", actorId: defender.id, tokenId: defenderTokenId, damage: finalDamage })
|
||||
}
|
||||
}
|
||||
|
||||
// Build DR text for confirmation message
|
||||
let drText = ""
|
||||
if (isSpellDamage) {
|
||||
drText = manualDR > 0 ? `Spell DR: ${manualDR}` : "No DR applied"
|
||||
} else {
|
||||
const parts = []
|
||||
if (appliedBaseDR > 0) parts.push(`Base DR: ${appliedBaseDR}${d30DrMultiplier > 1 && appliedBaseDR !== baseDR ? ` (×${d30DrMultiplier})` : ""}`)
|
||||
if (appliedShieldDR > 0) parts.push(`Shield DR: ${appliedShieldDR}${d30DrMultiplier > 1 && appliedShieldDR !== shieldDR ? ` (×${d30DrMultiplier})` : ""}`)
|
||||
if (appliedMagicDR > 0) parts.push(`Magic DR: ${appliedMagicDR}${d30DrMultiplier > 1 && appliedMagicDR !== magicDR ? ` (×${d30DrMultiplier})` : ""}`)
|
||||
drText = parts.length > 0 ? parts.join(" + ") : "No DR applied"
|
||||
}
|
||||
|
||||
// Build raw damage text showing D30 multiplier if active
|
||||
const rawDamageText = d30DamageMultiplier > 1
|
||||
? `${damageTotal} × ${d30DamageMultiplier} = ${rawDamage}`
|
||||
: String(damageTotal)
|
||||
|
||||
// Créer un message de confirmation (visible to GM only)
|
||||
const messageContent = await foundry.applications.handlebars.renderTemplate(
|
||||
@@ -1000,17 +1213,21 @@ Hooks.on("createChatMessage", async (message) => {
|
||||
{
|
||||
targetName: defender.name,
|
||||
damage: finalDamage,
|
||||
drText: isSpellDamage
|
||||
? (manualDR > 0 ? `Spell DR: ${manualDR}` : "No DR applied")
|
||||
: (totalDR > 0 ? `Armor DR: ${armorDR}${extraShieldDr > 0 ? ` + Shield DR: ${extraShieldDr}` : ""}` : ""),
|
||||
drText,
|
||||
weaponName: weaponName,
|
||||
attackerName: attackerName,
|
||||
rawDamage: damageTotal
|
||||
rawDamage: rawDamageText
|
||||
}
|
||||
)
|
||||
|
||||
// Add bleeding notification
|
||||
let bleedContent = ""
|
||||
if (d30Bleed && finalDamage > 0) {
|
||||
bleedContent = `<p><strong>Bleeding:</strong> Wound of ${finalDamage} HP for ${finalDamage} seconds.</p>`
|
||||
}
|
||||
|
||||
await ChatMessage.create({
|
||||
content: messageContent,
|
||||
content: messageContent + bleedContent,
|
||||
speaker: ChatMessage.getSpeaker({ actor: defender }),
|
||||
whisper: ChatMessage.getWhisperRecipients("GM")
|
||||
})
|
||||
|
||||
@@ -268,12 +268,12 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
||||
{
|
||||
action: "cancel",
|
||||
label: game.i18n.localize("LETHALFANTASY.Combat.proceedNo"),
|
||||
callback: () => null
|
||||
callback: () => "cancel"
|
||||
}
|
||||
],
|
||||
rejectClose: false
|
||||
})
|
||||
if (manualDR === null) return
|
||||
if (manualDR === null || manualDR === "cancel") return
|
||||
|
||||
const rollOpts = {
|
||||
type: "spell-damage",
|
||||
@@ -286,17 +286,7 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
||||
actorName: this.actor.name,
|
||||
actorImage: this.actor.img
|
||||
}
|
||||
const roll = new LethalFantasyRoll(formula, {}, rollOpts)
|
||||
await roll.evaluate()
|
||||
const diceResults = []
|
||||
for (const term of roll.dice) {
|
||||
for (const r of term.results) {
|
||||
diceResults.push({ dice: `1D${term.faces}`, value: r.result })
|
||||
}
|
||||
}
|
||||
roll.options.diceResults = diceResults
|
||||
roll.options.rollTotal = roll.total
|
||||
await roll.toMessage()
|
||||
await LethalFantasyRoll.rollSpellDamageToMessage(formula, rollOpts)
|
||||
}
|
||||
|
||||
static #onCreateEquipment(event, target) {
|
||||
|
||||
@@ -108,6 +108,10 @@
|
||||
}
|
||||
],
|
||||
"description": "Possible Flawless or Legendary Defense or Add D20E to Defense"
|
||||
},
|
||||
"saving_throws": {
|
||||
"type": "save_auto_success",
|
||||
"description": "Saving Throw Succeeds Regardless of Opposing Roll"
|
||||
}
|
||||
},
|
||||
"29": {
|
||||
@@ -145,6 +149,11 @@
|
||||
"type": "gain_grit",
|
||||
"amount": 1,
|
||||
"description": "Gain 1 Grit"
|
||||
},
|
||||
"saving_throws": {
|
||||
"type": "gain_grit",
|
||||
"amount": 1,
|
||||
"description": "Gain 1 Grit"
|
||||
}
|
||||
},
|
||||
"28": {
|
||||
@@ -199,6 +208,12 @@
|
||||
"amount": 1,
|
||||
"target": "skill",
|
||||
"description": "Add 1 to Skill Roll"
|
||||
},
|
||||
"saving_throws": {
|
||||
"type": "bonus_flat",
|
||||
"amount": 1,
|
||||
"target": "save",
|
||||
"description": "Add 1 to Saving Throw"
|
||||
}
|
||||
},
|
||||
"21": {
|
||||
@@ -239,6 +254,12 @@
|
||||
"ranged_defense": {
|
||||
"type": "recover_pain",
|
||||
"description": "Defender Recovers or ignores any flash of pain"
|
||||
},
|
||||
"saving_throws": {
|
||||
"type": "bonus_dice",
|
||||
"dice": "D6",
|
||||
"target": "save",
|
||||
"description": "Granted D6 (1-6) Saving Throw Modifier for this Saving Throw Attempt"
|
||||
}
|
||||
},
|
||||
"20": {
|
||||
@@ -325,7 +346,7 @@
|
||||
"target": "spell_defense"
|
||||
}
|
||||
],
|
||||
"description": "Possible 20/20 Spell defense that Saves Against Any Magical Attack Except a Lethal Magical Strike or add D12 to defense"
|
||||
"description": "Possible 20/20 Spell defense that Saves Against Any Magical Attack Except a Lethal Magical Strike or add D12 to spell defense"
|
||||
},
|
||||
"skill_rolls": {
|
||||
"type": "bonus_flat",
|
||||
@@ -349,6 +370,12 @@
|
||||
}
|
||||
],
|
||||
"description": "Possible 20/20 defense that avoids Any Attack Except a Lethal Strike or adds D12 to defense"
|
||||
},
|
||||
"saving_throws": {
|
||||
"type": "bonus_flat",
|
||||
"amount": 20,
|
||||
"target": "save",
|
||||
"description": "20 Added to Saving Throw"
|
||||
}
|
||||
},
|
||||
"15": {
|
||||
@@ -359,10 +386,10 @@
|
||||
"type": "bleed"
|
||||
},
|
||||
{
|
||||
"type": "knockback"
|
||||
"type": "internal_injury"
|
||||
}
|
||||
],
|
||||
"description": "Bleed, Knock-back on Hit"
|
||||
"description": "Bleed, Internal Injury on Hit"
|
||||
},
|
||||
"ranged_attack": {
|
||||
"type": "bleed",
|
||||
@@ -372,10 +399,9 @@
|
||||
"type": "counter_attack",
|
||||
"options": [
|
||||
"kick",
|
||||
"punch",
|
||||
"shield_bash"
|
||||
"punch"
|
||||
],
|
||||
"description": "Kick, Punch or Shield Bash"
|
||||
"description": "Kick or Punch"
|
||||
},
|
||||
"skill_rolls": {
|
||||
"type": "bonus_flat",
|
||||
@@ -387,10 +413,15 @@
|
||||
"type": "counter_attack",
|
||||
"options": [
|
||||
"kick",
|
||||
"punch",
|
||||
"shield_bash"
|
||||
"punch"
|
||||
],
|
||||
"description": "Kick, Punch or Shield Bash"
|
||||
"description": "Kick or Punch"
|
||||
},
|
||||
"saving_throws": {
|
||||
"type": "bonus_flat",
|
||||
"amount": 1,
|
||||
"target": "save",
|
||||
"description": "Add 1 to Saving Throw"
|
||||
}
|
||||
},
|
||||
"13": {},
|
||||
@@ -413,10 +444,10 @@
|
||||
"type": "bleed"
|
||||
},
|
||||
{
|
||||
"type": "knockback"
|
||||
"type": "internal_injury"
|
||||
}
|
||||
],
|
||||
"description": "Bleed, Knock-back on Hit"
|
||||
"description": "Bleed, Internal Injury on Hit"
|
||||
},
|
||||
"ranged_attack": {
|
||||
"type": "bleed",
|
||||
@@ -426,10 +457,9 @@
|
||||
"type": "counter_attack",
|
||||
"options": [
|
||||
"kick",
|
||||
"punch",
|
||||
"shield_bash"
|
||||
"punch"
|
||||
],
|
||||
"description": "Kick, Punch or Shield Bash"
|
||||
"description": "Kick or Punch"
|
||||
},
|
||||
"skill_rolls": {
|
||||
"type": "bonus_flat",
|
||||
@@ -441,10 +471,15 @@
|
||||
"type": "counter_attack",
|
||||
"options": [
|
||||
"kick",
|
||||
"punch",
|
||||
"shield_bash"
|
||||
"punch"
|
||||
],
|
||||
"description": "Kick, Punch or Shield Bash"
|
||||
"description": "Kick or Punch"
|
||||
},
|
||||
"saving_throws": {
|
||||
"type": "bonus_flat",
|
||||
"amount": 1,
|
||||
"target": "save",
|
||||
"description": "Add 1 to Saving Throw"
|
||||
}
|
||||
},
|
||||
"8": {
|
||||
@@ -475,6 +510,10 @@
|
||||
"ranged_defense": {
|
||||
"type": "mulligan",
|
||||
"description": "Mulligan, Can Choose to Re-Roll This Defense"
|
||||
},
|
||||
"saving_throws": {
|
||||
"type": "mulligan",
|
||||
"description": "Mulligan, Can Re-Roll This Saving Throw"
|
||||
}
|
||||
},
|
||||
"7": {
|
||||
@@ -496,10 +535,10 @@
|
||||
"type": "bleed"
|
||||
},
|
||||
{
|
||||
"type": "knockback"
|
||||
"type": "internal_injury"
|
||||
}
|
||||
],
|
||||
"description": "Bleed, Knock-back on Hit"
|
||||
"description": "Bleed, Internal Injury on Hit"
|
||||
},
|
||||
"ranged_attack": {
|
||||
"type": "bleed",
|
||||
@@ -509,10 +548,9 @@
|
||||
"type": "counter_attack",
|
||||
"options": [
|
||||
"kick",
|
||||
"punch",
|
||||
"shield_bash"
|
||||
"punch"
|
||||
],
|
||||
"description": "Kick, Punch, or Shield Bash"
|
||||
"description": "Kick or Punch"
|
||||
},
|
||||
"skill_rolls": {
|
||||
"type": "bonus_flat",
|
||||
@@ -524,10 +562,15 @@
|
||||
"type": "counter_attack",
|
||||
"options": [
|
||||
"kick",
|
||||
"punch",
|
||||
"shield_bash"
|
||||
"punch"
|
||||
],
|
||||
"description": "Kick, Punch, or Shield Bash"
|
||||
"description": "Kick or Punch"
|
||||
},
|
||||
"saving_throws": {
|
||||
"type": "bonus_flat",
|
||||
"amount": 1,
|
||||
"target": "save",
|
||||
"description": "Add 1 to Saving Throw"
|
||||
}
|
||||
},
|
||||
"3": {
|
||||
|
||||
@@ -85,11 +85,18 @@ export const RANGE_CHOICES = {
|
||||
"pointblank": { label: "Point Blank (Special)", value: "pointblank" },
|
||||
"short": { label: "Short (+0)", value: "0" },
|
||||
"medium": { label: "Medium (Red +5)", value: "+5" },
|
||||
"long": { label: "Long (Purle +7)", value: "+7" },
|
||||
"long": { label: "Long (Purple +7)", value: "+7" },
|
||||
"extreme": { label: "Extreme (Grey +9)", value: "+9" },
|
||||
"beyondskill": { label: "Beyond Skill (Blue +11)", value: "beyondskill" }
|
||||
}
|
||||
|
||||
export const ATTACKER_MOVEMENT_CHOICES = {
|
||||
"none": { label: "None / Stationary (D20E Favor)", favor: true, value: "2D20kh" },
|
||||
"walk": { label: "Walk (D20E)", value: "D20" },
|
||||
"incombat": { label: "In Combat (D20E)", value: "D20" },
|
||||
"run": { label: "Jog/Run/Sprint (D20E Disfavor)", disfavor: true, value: "2D20kl" }
|
||||
}
|
||||
|
||||
export const ATTACKER_AIM_CHOICES = {
|
||||
"simple": { label: "Simple (+0)", value: "0" },
|
||||
"careful": { label: "Careful (Red +5)", value: "+4" },
|
||||
@@ -321,6 +328,7 @@ export const SYSTEM = {
|
||||
RANGE_CHOICES,
|
||||
FAVOR_CHOICES,
|
||||
ATTACKER_AIM_CHOICES,
|
||||
ATTACKER_MOVEMENT_CHOICES,
|
||||
MORTAL_CHOICES,
|
||||
SPELL_CRITICAL,
|
||||
MIRACLE_TYPES,
|
||||
|
||||
+32
-13
@@ -79,16 +79,28 @@ export default class LethalFantasyActor extends Actor {
|
||||
}
|
||||
|
||||
/* *************************************************/
|
||||
computeDamageReduction() {
|
||||
// Pour les monstres, utiliser hp.damageResistance et combat.damageReduction
|
||||
getNaturalDR() {
|
||||
if (this.type === "monster") {
|
||||
let hpDR = Number(this.system.hp?.damageResistance) || 0
|
||||
return Number(this.system.hp?.damageResistance) || 0
|
||||
}
|
||||
return Number(this.system.biodata?.naturalDR) || 0
|
||||
}
|
||||
|
||||
/* *************************************************/
|
||||
getMagicDR() {
|
||||
if (this.type === "monster") return 0
|
||||
return Number(this.system.biodata?.magicDR) || 0
|
||||
}
|
||||
|
||||
/* *************************************************/
|
||||
computeDamageReduction() {
|
||||
if (this.type === "monster") {
|
||||
let hpDR = this.getNaturalDR()
|
||||
let combatDR = Number(this.system.combat?.damageReduction) || 0
|
||||
return hpDR + combatDR
|
||||
}
|
||||
// Pour les personnages, utiliser biodata et items
|
||||
let naturalDR = Number(this.system.biodata?.naturalDR) || 0
|
||||
let magicDR = Number(this.system.biodata?.magicDR) || 0
|
||||
let naturalDR = this.getNaturalDR()
|
||||
let magicDR = this.getMagicDR()
|
||||
let armorDR = this.getArmorDR()
|
||||
return naturalDR + magicDR + armorDR
|
||||
}
|
||||
@@ -153,7 +165,7 @@ export default class LethalFantasyActor extends Actor {
|
||||
}
|
||||
|
||||
/* *************************************************/
|
||||
async prepareRoll(rollType, rollKey, rollDice, defenderId, defenderTokenId, extraShieldDr = 0) {
|
||||
async prepareRoll(rollType, rollKey, rollDice, defenderId, defenderTokenId, extraShieldDr = 0, d30Effects = {}) {
|
||||
console.log("Preparing roll", rollType, rollKey, rollDice, defenderId)
|
||||
let rollTarget
|
||||
switch (rollType) {
|
||||
@@ -198,8 +210,15 @@ export default class LethalFantasyActor extends Actor {
|
||||
case "miracle-power":
|
||||
rollTarget = this.items.find((i) => (i.type === "miracle" || i.type == "spell") && i.id === rollKey)
|
||||
rollTarget.rollKey = rollKey
|
||||
// Read damage tier from combatant currentAction if available
|
||||
const activeCombatant = game.combat?.combatants?.find(c => c.actorId === this.id)
|
||||
const currentAction = activeCombatant?.getFlag(SYSTEM.id, "currentAction")
|
||||
const damageTier = currentAction?.damageTier || "standard"
|
||||
rollTarget.damageTier = damageTier
|
||||
if (rollType === "spell-attack" || rollType === "spell-power") {
|
||||
const cost = Number(rollTarget.system?.cost) || 0
|
||||
const tierCostMap = { standard: "cost", overpowered: "costOverpowered", overpowered2: "costOverpowered2" }
|
||||
const costField = tierCostMap[damageTier] || "cost"
|
||||
const cost = Number(rollTarget.system?.[costField]) || 0
|
||||
const currentAether = Number(this.system.aetherPoints?.value) || 0
|
||||
if (cost > currentAether) {
|
||||
ui.notifications.warn(`${this.name} cannot cast ${rollTarget.name}: insufficient Aether (needs ${cost}, has ${currentAether}).`)
|
||||
@@ -222,8 +241,7 @@ export default class LethalFantasyActor extends Actor {
|
||||
rollTarget.rollKey = rollKey
|
||||
}
|
||||
break;
|
||||
case "weapon-damage-small":
|
||||
case "weapon-damage-medium":
|
||||
case "weapon-damage":
|
||||
case "weapon-attack":
|
||||
case "weapon-defense": {
|
||||
let weapon = this.items.find((i) => i.type === "weapon" && i.id === rollKey)
|
||||
@@ -261,9 +279,10 @@ export default class LethalFantasyActor extends Actor {
|
||||
weapon: weapon,
|
||||
weaponSkillModifier: skill.weaponSkillModifier,
|
||||
rollKey: rollKey,
|
||||
combat: foundry.utils.duplicate(this.system.combat)
|
||||
combat: foundry.utils.duplicate(this.system.combat),
|
||||
isRangedAttack: weapon.system.weaponType === "ranged"
|
||||
}
|
||||
if (rollType === "weapon-damage-small" || rollType === "weapon-damage-medium") {
|
||||
if (rollType === "weapon-damage") {
|
||||
rollTarget.grantedDice = this.system.granted.damageDice
|
||||
}
|
||||
if (rollType === "weapon-attack") {
|
||||
@@ -286,7 +305,7 @@ export default class LethalFantasyActor extends Actor {
|
||||
rollTarget.magicUser = this.system.biodata.magicUser
|
||||
rollTarget.actorModifiers = foundry.utils.duplicate(this.system.modifiers)
|
||||
rollTarget.actorLevel = this.system.biodata.level
|
||||
await this.system.roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr)
|
||||
await this.system.roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr, d30Effects)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ export default class D30Roll {
|
||||
RANGED_DEFENSE: "ranged_defense",
|
||||
ARCANE_SPELL_ATTACK: "arcane_spell_attack",
|
||||
ARCANE_SPELL_DEFENSE: "arcane_spell_defense",
|
||||
SKILL_ROLLS: "skill_rolls"
|
||||
SKILL_ROLLS: "skill_rolls",
|
||||
SAVING_THROWS: "saving_throws"
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,17 +112,16 @@ export default class D30Roll {
|
||||
if (externalType === "weapon-attack") {
|
||||
if (!weapon) {
|
||||
console.warn("D30Roll | Weapon object required for weapon-attack type")
|
||||
return this.ROLL_TYPES.MELEE_ATTACK // Default to melee
|
||||
// Fall through to use options.isRanged if available, otherwise default melee
|
||||
}
|
||||
return weapon.system?.weaponType === "ranged"
|
||||
return (options.isRanged || weapon?.system?.weaponType === "ranged")
|
||||
? this.ROLL_TYPES.RANGED_ATTACK
|
||||
: this.ROLL_TYPES.MELEE_ATTACK
|
||||
}
|
||||
|
||||
// Monster attacks - default to melee
|
||||
// Monster attacks - check options.isRanged (set from rollTarget.attackMode) or weapon type
|
||||
if (externalType === "monster-attack") {
|
||||
// Check if weapon object has range information
|
||||
if (weapon?.system?.weaponType === "ranged") {
|
||||
if (options.isRanged || weapon?.system?.weaponType === "ranged") {
|
||||
return this.ROLL_TYPES.RANGED_ATTACK
|
||||
}
|
||||
return this.ROLL_TYPES.MELEE_ATTACK
|
||||
@@ -138,11 +138,15 @@ export default class D30Roll {
|
||||
}
|
||||
|
||||
// Skill types
|
||||
if (externalType === "skill" || externalType === "monster-skill" ||
|
||||
externalType === "save" || externalType === "challenge") {
|
||||
if (externalType === "skill" || externalType === "monster-skill" || externalType === "challenge") {
|
||||
return this.ROLL_TYPES.SKILL_ROLLS
|
||||
}
|
||||
|
||||
// Saving throw types
|
||||
if (externalType === "save") {
|
||||
return options.isSpellSave ? this.ROLL_TYPES.ARCANE_SPELL_DEFENSE : this.ROLL_TYPES.SAVING_THROWS
|
||||
}
|
||||
|
||||
// If no match, return null
|
||||
console.warn(`D30Roll | Unknown external roll type: ${externalType}`)
|
||||
return null
|
||||
|
||||
+258
-19
@@ -237,6 +237,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
baseFormula = "D20"
|
||||
hasModifier = true
|
||||
hasChangeDice = false
|
||||
hasFavor = true
|
||||
options.rollTarget.value = options.rollTarget.actorModifiers.levelSpellModifier + options.rollTarget.actorModifiers.intSpellModifier
|
||||
options.rollTarget.charModifier = options.rollTarget.actorModifiers.intSpellModifier
|
||||
hasStaticModifier = options.rollType === "spell-power"
|
||||
@@ -253,6 +254,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
dice = "1D20"
|
||||
baseFormula = "D20"
|
||||
hasChangeDice = false
|
||||
hasFavor = true
|
||||
options.rollTarget.value = options.rollTarget.actorModifiers.levelMiracleModifier + options.rollTarget.actorModifiers.chaMiracleModifier
|
||||
options.rollTarget.charModifier = options.rollTarget.actorModifiers.chaMiracleModifier
|
||||
hasStaticModifier = options.rollType === "miracle-power"
|
||||
@@ -283,13 +285,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let damageBonus = (options.rollTarget.weapon.system.applyStrengthDamageBonus) ? options.rollTarget.combat.damageModifier : 0
|
||||
options.rollTarget.value = damageBonus + options.rollTarget.weaponSkillModifier + options.rollTarget.weapon.system.bonuses.damageBonus
|
||||
options.rollTarget.charModifier = damageBonus
|
||||
if (options.rollType.includes("small")) {
|
||||
options.damageSmall = true
|
||||
dice = options.rollTarget.weapon.system.damage.damageS
|
||||
} else {
|
||||
options.damageMedium = true
|
||||
dice = options.rollTarget.weapon.system.damage.damageM
|
||||
}
|
||||
if (/NE$/i.test(dice)) {
|
||||
hasMaxValue = false
|
||||
hasExplode = false
|
||||
@@ -336,6 +332,10 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let modifier = "+0"
|
||||
let targetName
|
||||
|
||||
// True for any ranged attack: PC weapon (ranged type) or monster attack (ranged mode)
|
||||
const isRangedAttack = (options.rollType === "weapon-attack" && options.rollTarget?.weapon?.system?.weaponType === "ranged")
|
||||
|| (options.rollType === "monster-attack" && options.rollTarget?.attackMode === "ranged")
|
||||
|
||||
let dialogContext = {
|
||||
rollType: options.rollType,
|
||||
rollTarget: options.rollTarget,
|
||||
@@ -360,7 +360,8 @@ export default class LethalFantasyRoll extends Roll {
|
||||
modifier,
|
||||
saveSpell: false,
|
||||
favor: "none",
|
||||
targetName
|
||||
targetName,
|
||||
isRangedAttack
|
||||
}
|
||||
let rollContext
|
||||
if (options.rollContext) {
|
||||
@@ -522,8 +523,6 @@ export default class LethalFantasyRoll extends Roll {
|
||||
rollMode: rollContext.visibility,
|
||||
hasTarget: options.hasTarget,
|
||||
isDamage: options.isDamage,
|
||||
damageSmall: options.damageSmall,
|
||||
damageMedium: options.damageMedium,
|
||||
pointBlank,
|
||||
beyondSkill,
|
||||
letItFly,
|
||||
@@ -592,16 +591,26 @@ export default class LethalFantasyRoll extends Roll {
|
||||
}
|
||||
options.D30result = rollD30.total
|
||||
|
||||
// Récupérer le message D30 correspondant
|
||||
// Compute isRanged for D30: covers defense (isRangedDefense), monster ranged attacks (attackMode),
|
||||
// and PC weapon attacks (isRangedAttack or weaponType)
|
||||
const isRangedForD30 = options.isRangedDefense
|
||||
|| options.rollTarget?.attackMode === "ranged"
|
||||
|| options.rollTarget?.isRangedAttack === true
|
||||
|| options.rollTarget?.weapon?.system?.weaponType === "ranged"
|
||||
const d30Message = D30Roll.getResult(
|
||||
rollD30.total,
|
||||
options.rollType,
|
||||
options.rollTarget?.weapon,
|
||||
{ isRanged: options.isRangedDefense }
|
||||
{ isRanged: isRangedForD30, isSpellSave: saveSpell }
|
||||
)
|
||||
options.D30message = d30Message
|
||||
}
|
||||
|
||||
// Show main roll before explosion dice so Dice So Nice animates in correct order
|
||||
if (game?.dice3d && rollContext.favor !== "favor" && rollContext.favor !== "disfavor") {
|
||||
await game.dice3d.showForRoll(rollBase, game.user, true)
|
||||
}
|
||||
|
||||
let rollTotal = 0
|
||||
let diceResults = []
|
||||
let resultType
|
||||
@@ -661,6 +670,10 @@ export default class LethalFantasyRoll extends Roll {
|
||||
rollBase.options.defenderId = options.defenderId
|
||||
rollBase.options.defenderTokenId = options.defenderTokenId
|
||||
rollBase.options.extraShieldDr = options.extraShieldDr || 0
|
||||
rollBase.options.damageTier = options.damageTier || "standard"
|
||||
rollBase.options.d30Bleed = options.d30Bleed || false
|
||||
rollBase.options.d30DamageMultiplier = options.d30DamageMultiplier || 1
|
||||
rollBase.options.d30DrMultiplier = options.d30DrMultiplier || 1
|
||||
|
||||
/**
|
||||
* A hook event that fires after the roll has been made.
|
||||
@@ -775,9 +788,18 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let buttons = []
|
||||
if (currentAction) {
|
||||
if (currentAction.type === "weapon") {
|
||||
let weaponLabel = "Roll progression dice"
|
||||
if (currentAction.rangedMode) {
|
||||
// Compute loading count from the speed formula (e.g. "3+1d6" → load=3)
|
||||
const speedStr = currentAction.system?.speed?.[currentAction.rangedMode] ?? ""
|
||||
const rangedLoad = currentAction.rangedLoad ?? (Number(speedStr.split("+")[0]) || 0)
|
||||
if (rangedLoad > 0 && !currentAction.weaponLoaded) {
|
||||
weaponLabel = "Load weapon"
|
||||
}
|
||||
}
|
||||
buttons.push({
|
||||
action: "roll",
|
||||
label: "Roll progression dice",
|
||||
label: weaponLabel,
|
||||
callback: (event, button) => {
|
||||
let pos = $('#combat-action-dialog').position()
|
||||
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", pos)
|
||||
@@ -882,6 +904,29 @@ export default class LethalFantasyRoll extends Roll {
|
||||
actionItem.progressionCount = firstActionTaken ? 1 : (combatant.actor.system.combat?.combatProgressionStart ?? 1)
|
||||
if (!firstActionTaken) await combatant.setFlag(SYSTEM.id, "firstActionTaken", true)
|
||||
actionItem.rangedMode = rangedMode
|
||||
// If this is a spell/miracle with multiple damage tiers, prompt tier choice
|
||||
if (actionItem.system?.damageDice) {
|
||||
const tiers = [
|
||||
{ id: "standard", label: "Standard", dice: actionItem.system.damageDice },
|
||||
{ id: "overpowered", label: "Overpowered", dice: actionItem.system.damageDiceOverpowered },
|
||||
{ id: "overpowered2", label: "Overpowered 2", dice: actionItem.system.damageDiceOverpowered2 },
|
||||
].filter(t => t.dice)
|
||||
if (tiers.length > 1) {
|
||||
const tierChoice = await foundry.applications.api.DialogV2.wait({
|
||||
window: { title: "Choose Damage Tier" },
|
||||
classes: ["lethalfantasy"],
|
||||
content: `<div class="grit-luck-dialog"><p><strong>${selectedItem.name}</strong> has multiple damage tiers.</p><p>Choose which damage to use when the attack lands:</p></div>`,
|
||||
buttons: tiers.map(t => ({
|
||||
action: t.id,
|
||||
label: `${t.label} (${t.dice.toUpperCase()})`,
|
||||
icon: "fa-solid fa-wand-magic-sparkles",
|
||||
callback: () => t.id
|
||||
})),
|
||||
rejectClose: false
|
||||
})
|
||||
actionItem.damageTier = tierChoice || "standard"
|
||||
}
|
||||
}
|
||||
actionItem.castingTime = 1
|
||||
actionItem.spellStatus = "castingTime"
|
||||
// Set the flag on the combatant
|
||||
@@ -903,7 +948,8 @@ export default class LethalFantasyRoll extends Roll {
|
||||
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
||||
return
|
||||
} else {
|
||||
let message = `Spell/Miracle ${currentAction.name} ready to be cast on next second !`
|
||||
// Last counting second — announce ready and transition immediately (no extra second consumed)
|
||||
let message = `Casting time : ${currentAction.name}, count : ${time}/${time} — ready to cast next second !`
|
||||
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||
currentAction.castingTime = 1
|
||||
currentAction.spellStatus = "toBeCasted"
|
||||
@@ -980,7 +1026,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
}
|
||||
// Range weapon loading
|
||||
if (!currentAction.weaponLoaded && currentAction.rangedLoad) {
|
||||
if (currentAction.progressionCount <= currentAction.rangedLoad) {
|
||||
if (currentAction.progressionCount < currentAction.rangedLoad) {
|
||||
let message = `Ranged weapon ${currentAction.name} is loading, loading count : ${currentAction.progressionCount}/${currentAction.rangedLoad}`
|
||||
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||
currentAction.progressionCount += 1
|
||||
@@ -1126,6 +1172,8 @@ export default class LethalFantasyRoll extends Roll {
|
||||
options = { ...options, ...rollContext }
|
||||
options.rollName = "Ranged Defense"
|
||||
options.rollType = "weapon-defense"
|
||||
options.type = options.rollType // Required: this.type reads options.type
|
||||
options.rollMode = rollContext.visibility // Required: callers pass roll.options.rollMode to toMessage
|
||||
|
||||
const rollBase = new this(rollContext.movement, options.data, rollData)
|
||||
const rollModifier = new Roll(modifierFormula, options.data, rollData)
|
||||
@@ -1193,6 +1241,161 @@ export default class LethalFantasyRoll extends Roll {
|
||||
return rollBase
|
||||
}
|
||||
|
||||
/**
|
||||
* Prompts the GM for ranged attack context (movement, range, target size, aim) when a monster
|
||||
* attacks with a ranged weapon, then evaluates an exploding D20 attack roll with the resulting modifiers.
|
||||
*
|
||||
* @param {Object} options Options for the roll.
|
||||
* @param {string} options.actorId The attacker actor ID.
|
||||
* @param {string} options.actorName The attacker actor name.
|
||||
* @param {Object} options.rollTarget The rollTarget containing attackModifier and related data.
|
||||
* @returns {Promise<LethalFantasyRoll|null>} The resulting roll, or null if cancelled.
|
||||
*/
|
||||
static async promptRangedAttack(options = {}) {
|
||||
const rollModes = foundry.utils.duplicate(CONFIG.ChatMessage.modes)
|
||||
const fieldRollMode = new foundry.data.fields.StringField({
|
||||
choices: rollModes,
|
||||
blank: false,
|
||||
default: "public",
|
||||
})
|
||||
|
||||
let dialogContext = {
|
||||
attackerMovementChoices: SYSTEM.ATTACKER_MOVEMENT_CHOICES,
|
||||
rangeChoices: SYSTEM.RANGE_CHOICES,
|
||||
sizeChoices: SYSTEM.SIZE_CHOICES,
|
||||
attackerAimChoices: SYSTEM.ATTACKER_AIM_CHOICES,
|
||||
movement: "none",
|
||||
range: "short",
|
||||
size: "+5",
|
||||
attackerAim: "simple",
|
||||
fieldRollMode,
|
||||
rollModes
|
||||
}
|
||||
|
||||
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-lethal-fantasy/templates/range-attack-dialog.hbs", dialogContext)
|
||||
|
||||
const label = game.i18n.localize("LETHALFANTASY.Label.rangeAttackRoll")
|
||||
const rollContext = await foundry.applications.api.DialogV2.wait({
|
||||
window: { title: "Ranged Attack" },
|
||||
classes: ["lethalfantasy"],
|
||||
content,
|
||||
buttons: [
|
||||
{
|
||||
label,
|
||||
callback: (event, button) => {
|
||||
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
||||
if (input.name) obj[input.name] = input.value
|
||||
return obj
|
||||
}, {})
|
||||
return output
|
||||
},
|
||||
},
|
||||
],
|
||||
rejectClose: false
|
||||
})
|
||||
|
||||
if (rollContext === null) return null
|
||||
|
||||
// Handle pointblank: attacker at point blank gets favor (standing still easier to aim)
|
||||
if (rollContext.range === "pointblank") {
|
||||
rollContext.movement = rollContext.movement.replace("kh", "")
|
||||
rollContext.movement = rollContext.movement.replace("kl", "")
|
||||
rollContext.movement += "kh" // Favor for attacker at point blank
|
||||
rollContext.range = "0"
|
||||
}
|
||||
// Handle beyondskill: extreme range gives disfavor to attacker
|
||||
if (rollContext.range === "beyondskill") {
|
||||
rollContext.movement = rollContext.movement.replace("kh", "")
|
||||
rollContext.movement = rollContext.movement.replace("kl", "")
|
||||
rollContext.movement += "kl" // Disfavor for attacker beyond skill range
|
||||
rollContext.range = "+11"
|
||||
}
|
||||
|
||||
// Compute contextual penalty: range + target_size, reduced by aim bonus and attack modifier
|
||||
const attackModifier = options.rollTarget?.attackModifier ?? 0
|
||||
const contextualPenalty = Number(rollContext.range) + Number(rollContext.size)
|
||||
const aimBonus = Number(rollContext.attackerAim || 0)
|
||||
const fullModifier = contextualPenalty - aimBonus - attackModifier
|
||||
|
||||
let modifierFormula
|
||||
if (fullModifier === 0) {
|
||||
modifierFormula = "0"
|
||||
} else {
|
||||
const modAbs = Math.abs(fullModifier)
|
||||
modifierFormula = `D${modAbs + 1} -1`
|
||||
}
|
||||
|
||||
const rollData = { ...rollContext }
|
||||
options = { ...options, ...rollContext }
|
||||
options.rollName = "Ranged Attack"
|
||||
options.rollType = options.rollType || "monster-attack"
|
||||
options.type = options.rollType // Required: this.type reads options.type, used to build weaponDamageOptions in toHTML
|
||||
options.rollMode = rollContext.visibility // Required: callers pass roll.options.rollMode to toMessage
|
||||
options.isRangedAttack = true
|
||||
|
||||
const rollBase = new this(rollContext.movement, options.data, rollData)
|
||||
const rollModifier = new Roll(modifierFormula, options.data, rollData)
|
||||
rollModifier.evaluate()
|
||||
await rollBase.evaluate()
|
||||
const rollD30 = await new Roll("1D30").evaluate()
|
||||
options.D30result = rollD30.total
|
||||
options.D30message = D30Roll.getResult(rollD30.total, options.rollType, undefined, { isRanged: true })
|
||||
|
||||
// Determine favor from dice formula
|
||||
let badResult = 0
|
||||
if (rollContext.movement.includes("kh")) {
|
||||
rollData.favor = "favor"
|
||||
badResult = Math.min(rollBase.terms[0].results[0].result, rollBase.terms[0].results[1]?.result || 20)
|
||||
}
|
||||
if (rollContext.movement.includes("kl")) {
|
||||
rollData.favor = "disfavor"
|
||||
badResult = Math.max(rollBase.terms[0].results[0].result, rollBase.terms[0].results[1]?.result || 1)
|
||||
}
|
||||
|
||||
const dice = rollContext.movement
|
||||
const maxValue = 20
|
||||
let rollTotal = -1
|
||||
let diceResults = []
|
||||
|
||||
let diceResult = rollBase.dice[0].results[0].result
|
||||
diceResults.push({ dice: `${dice.toUpperCase()}`, value: diceResult })
|
||||
let diceSum = diceResult
|
||||
// Exploding dice
|
||||
while (diceResult === maxValue) {
|
||||
const r = await new Roll(dice).evaluate()
|
||||
diceResult = r.dice[0].results[0].result
|
||||
diceResults.push({ dice: `${dice.toUpperCase()}-1`, value: diceResult - 1 })
|
||||
diceSum += (diceResult - 1)
|
||||
}
|
||||
|
||||
if (fullModifier !== 0) {
|
||||
diceResults.push({ dice: `${rollModifier.formula.toUpperCase()}`, value: rollModifier.total })
|
||||
if (fullModifier > 0) {
|
||||
// Net penalty: subtract from roll
|
||||
rollTotal = Math.max(diceSum - rollModifier.total, 0)
|
||||
} else {
|
||||
// Net bonus: add to roll
|
||||
rollTotal = diceSum + rollModifier.total
|
||||
}
|
||||
} else {
|
||||
rollTotal = diceSum
|
||||
}
|
||||
|
||||
rollBase.options = { ...rollBase.options, ...options }
|
||||
rollBase.options.resultType = undefined
|
||||
rollBase.options.rollTotal = rollTotal
|
||||
rollBase.options.diceResults = diceResults
|
||||
rollBase.options.rollTarget = options.rollTarget
|
||||
rollBase.options.titleFormula = `1D20E + ${modifierFormula}`
|
||||
rollBase.options.D30result = options.D30result
|
||||
rollBase.options.D30message = options.D30message
|
||||
rollBase.options.rollName = "Ranged Attack"
|
||||
rollBase.options.badResult = badResult
|
||||
rollBase.options.rollData = foundry.utils.duplicate(rollData)
|
||||
|
||||
return rollBase
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a title based on the given type.
|
||||
*
|
||||
@@ -1213,10 +1416,8 @@ export default class LethalFantasyRoll extends Roll {
|
||||
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-attack")}`
|
||||
case "weapon-defense":
|
||||
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-defense")}`
|
||||
case "weapon-damage-small":
|
||||
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-damage-small")}`
|
||||
case "weapon-damage-medium":
|
||||
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-damage-medium")}`
|
||||
case "weapon-damage":
|
||||
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-damage")}`
|
||||
case "spell":
|
||||
case "spell-attack":
|
||||
case "spell-power":
|
||||
@@ -1277,7 +1478,6 @@ export default class LethalFantasyRoll extends Roll {
|
||||
weaponDamageOptions = {
|
||||
weaponId: weapon._id || weapon.id,
|
||||
weaponName: weapon.name,
|
||||
damageS: weapon.system?.damage?.damageS,
|
||||
damageM: weapon.system?.damage?.damageM
|
||||
}
|
||||
console.log("Weapon damage options:", weaponDamageOptions)
|
||||
@@ -1360,4 +1560,43 @@ export default class LethalFantasyRoll extends Roll {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluate a spell/miracle damage formula with per-die explosion, then post to chat.
|
||||
* Explosion dice are shown manually via showForRoll; the main roll is shown automatically
|
||||
* by toMessage() (which triggers Dice So Nice via its createChatMessage hook).
|
||||
* Append "NE" to the formula to disable explosion.
|
||||
*
|
||||
* @param {string} formula Dice formula, e.g. "1d8", "2d6", "1d8NE"
|
||||
* @param {Object} rollOpts Options for LethalFantasyRoll (rollType, actorId, defenderId, etc.)
|
||||
* @returns {Promise<ChatMessage>}
|
||||
*/
|
||||
static async rollSpellDamageToMessage(formula, rollOpts) {
|
||||
const roll = new LethalFantasyRoll(formula, {}, rollOpts)
|
||||
await roll.evaluate()
|
||||
const shouldExplode = !/NE$/i.test(formula)
|
||||
const diceResults = []
|
||||
let diceSum = 0
|
||||
for (const term of roll.dice) {
|
||||
const singleDice = `1D${term.faces}`
|
||||
for (const r of term.results) {
|
||||
let diceResult = r.result
|
||||
diceResults.push({ dice: singleDice.toUpperCase(), value: diceResult })
|
||||
diceSum += diceResult
|
||||
if (shouldExplode && term.faces > 0) {
|
||||
while (diceResult === term.faces) {
|
||||
const xr = await new Roll(singleDice).evaluate()
|
||||
if (game?.dice3d) await game.dice3d.showForRoll(xr, game.user, true)
|
||||
// Optional chaining guards against unexpected roll structure
|
||||
diceResult = xr.dice?.[0]?.results?.[0]?.result ?? (term.faces - 1)
|
||||
diceResults.push({ dice: `${singleDice.toUpperCase()}-1`, value: diceResult - 1 })
|
||||
diceSum += (diceResult - 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
roll.options.diceResults = diceResults
|
||||
roll.options.rollTotal = diceSum
|
||||
return roll.toMessage()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
||||
}
|
||||
|
||||
schema.hp = new fields.SchemaField({
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 1 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||
painDamage: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
wounds: new fields.ArrayField(new fields.SchemaField(woundFieldSchema), {
|
||||
@@ -281,7 +281,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
||||
* @param {"="|"+"|"++"|"-"|"--"} rollAdvantage If there is an avantage (+), a disadvantage (-), a double advantage (++), a double disadvantage (--) or a normal roll (=).
|
||||
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
|
||||
*/
|
||||
async roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr = 0) {
|
||||
async roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr = 0, d30Effects = {}) {
|
||||
const hasTarget = false
|
||||
let roll = await LethalFantasyRoll.prompt({
|
||||
rollType,
|
||||
@@ -293,7 +293,11 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
||||
target: false,
|
||||
defenderId,
|
||||
defenderTokenId,
|
||||
extraShieldDr
|
||||
extraShieldDr,
|
||||
damageTier: rollTarget.damageTier || "standard",
|
||||
d30Bleed: d30Effects.d30Bleed || false,
|
||||
d30DamageMultiplier: d30Effects.d30DamageMultiplier || 1,
|
||||
d30DrMultiplier: d30Effects.d30DrMultiplier || 1
|
||||
})
|
||||
if (!roll) return null
|
||||
|
||||
|
||||
@@ -56,10 +56,28 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
||||
}, {}),
|
||||
)
|
||||
|
||||
const woundFieldSchema = {
|
||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
duration: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
description: new fields.StringField({ initial: "", required: false, nullable: true }),
|
||||
}
|
||||
|
||||
schema.hp = new fields.SchemaField({
|
||||
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 }),
|
||||
wounds: new fields.ArrayField(new fields.SchemaField(woundFieldSchema), {
|
||||
initial: [
|
||||
{ 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 },
|
||||
{ description: "", value: 0, duration: 0 },
|
||||
{ description: "", value: 0, duration: 0 }
|
||||
], min: 8
|
||||
}),
|
||||
damageResistance: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
painDamage: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
})
|
||||
@@ -164,8 +182,24 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
||||
* @param {"="|"+"|"++"|"-"|"--"} rollAdvantage If there is an avantage (+), a disadvantage (-), a double advantage (++), a double disadvantage (--) or a normal roll (=).
|
||||
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
|
||||
*/
|
||||
async roll(rollType, rollTarget, defenderId = undefined, defenderTokenId = undefined, extraShieldDr = 0) {
|
||||
async roll(rollType, rollTarget, defenderId = undefined, defenderTokenId = undefined, extraShieldDr = 0, d30Effects = {}) {
|
||||
const hasTarget = false
|
||||
|
||||
// Ranged monster defense uses the ranged defense dialog (movement, range, size modifiers)
|
||||
if (rollType === "monster-defense" && rollTarget?.isRangedDefense === true) {
|
||||
let roll = await LethalFantasyRoll.promptRangedDefense({
|
||||
actorId: this.parent.id,
|
||||
actorName: this.parent.name,
|
||||
actorImage: this.parent.img,
|
||||
rollTarget,
|
||||
defenderId,
|
||||
defenderTokenId,
|
||||
})
|
||||
if (!roll) return null
|
||||
await roll.toMessage({}, { messageMode: roll.options.rollMode })
|
||||
return
|
||||
}
|
||||
|
||||
let roll = await LethalFantasyRoll.prompt({
|
||||
rollType,
|
||||
rollTarget,
|
||||
@@ -176,14 +210,18 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
||||
target: false,
|
||||
defenderId,
|
||||
defenderTokenId,
|
||||
extraShieldDr
|
||||
extraShieldDr,
|
||||
damageTier: rollTarget.damageTier || "standard",
|
||||
d30Bleed: d30Effects.d30Bleed || false,
|
||||
d30DamageMultiplier: d30Effects.d30DamageMultiplier || 1,
|
||||
d30DrMultiplier: d30Effects.d30DrMultiplier || 1
|
||||
})
|
||||
if (!roll) return null
|
||||
|
||||
await roll.toMessage({}, { messageMode: roll.options.rollMode })
|
||||
}
|
||||
|
||||
async prepareMonsterRoll(rollType, rollKey, rollDice = undefined, tokenId = undefined, damageModifier = undefined, defenderId = undefined, defenderTokenId = undefined, extraShieldDr = 0) {
|
||||
async prepareMonsterRoll(rollType, rollKey, rollDice = undefined, tokenId = undefined, damageModifier = undefined, defenderId = undefined, defenderTokenId = undefined, extraShieldDr = 0, d30Effects = {}) {
|
||||
let rollTarget
|
||||
switch (rollType) {
|
||||
case "monster-attack":
|
||||
@@ -236,8 +274,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
||||
}, { messageMode: roll.options.rollMode ?? game.settings.get("core", "rollMode") })
|
||||
return
|
||||
}
|
||||
case "weapon-damage-small":
|
||||
case "weapon-damage-medium":
|
||||
case "weapon-damage":
|
||||
case "weapon-attack":
|
||||
case "weapon-defense": {
|
||||
let weapon = this.actor.items.find((i) => i.type === "weapon" && i.id === rollKey)
|
||||
@@ -284,7 +321,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
||||
// In all cases
|
||||
if (rollTarget) {
|
||||
rollTarget.tokenId = tokenId
|
||||
await this.roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr)
|
||||
await this.roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr, d30Effects)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ export default class LethalFantasySpell extends foundry.abstract.TypeDataModel {
|
||||
})
|
||||
|
||||
schema.cost = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
schema.costOverpowered = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
schema.costOverpowered2 = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
schema.memorized = new fields.BooleanField({ required: true, initial: false })
|
||||
|
||||
schema.components = new fields.SchemaField({
|
||||
|
||||
@@ -45,9 +45,9 @@ export default class LethalFantasySkill extends foundry.abstract.TypeDataModel {
|
||||
})
|
||||
|
||||
schema.bonuses = new fields.SchemaField({
|
||||
attackBonus: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }),
|
||||
damageBonus: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }),
|
||||
defenseBonus: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||
attackBonus: new fields.NumberField({ ...requiredInteger, required: true, initial: 0 }),
|
||||
damageBonus: new fields.NumberField({ ...requiredInteger, required: true, initial: 0 }),
|
||||
defenseBonus: new fields.NumberField({ ...requiredInteger, required: true, initial: 0 })
|
||||
})
|
||||
|
||||
schema.encLoad = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||
|
||||
+240
-13
@@ -105,6 +105,35 @@ export default class LethalFantasyUtils {
|
||||
$(html).find('.hp-gain-wrap')[2].classList.add('hp-gain-hud-disabled');
|
||||
}
|
||||
})
|
||||
|
||||
// Luck/Grit Buttons
|
||||
const luckGritButton = await foundry.applications.handlebars.renderTemplate('systems/fvtt-lethal-fantasy/templates/luck-grit-hud.hbs', {})
|
||||
$(html).find('div.left').append(luckGritButton);
|
||||
$(html).find('.lethal-luck-grit-hud').click((event) => {
|
||||
event.preventDefault();
|
||||
let wrap = $(html).find('.luck-grit-wrap')[0]
|
||||
if (wrap.classList.contains("luck-grit-hud-disabled")) {
|
||||
wrap.classList.add('luck-grit-hud-active');
|
||||
wrap.classList.remove('luck-grit-hud-disabled');
|
||||
} else {
|
||||
wrap.classList.remove('luck-grit-hud-active');
|
||||
wrap.classList.add('luck-grit-hud-disabled');
|
||||
}
|
||||
})
|
||||
$(html).find('.luck-grit-btn').click((event) => {
|
||||
event.preventDefault();
|
||||
if (token) {
|
||||
let tokenFull = canvas.tokens.placeables.find(t => t.id === token._id);
|
||||
let actor = tokenFull.actor;
|
||||
const resource = event.currentTarget.dataset.resource;
|
||||
const amount = Number(event.currentTarget.dataset.amount);
|
||||
const current = Number(foundry.utils.getProperty(actor.system, `${resource}.current`)) || 0;
|
||||
const newValue = Math.max(0, current + amount);
|
||||
actor.update({ [`system.${resource}.current`]: newValue });
|
||||
$(html).find('.luck-grit-wrap')[0].classList.remove('luck-grit-hud-active');
|
||||
$(html).find('.luck-grit-wrap')[0].classList.add('luck-grit-hud-disabled');
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -145,6 +174,21 @@ export default class LethalFantasyUtils {
|
||||
LethalFantasyUtils.handleAttackerGritOffer(msg)
|
||||
}
|
||||
break
|
||||
case "applyBleeding":
|
||||
if (game.user.isGM) {
|
||||
actor = msg.tokenId
|
||||
? canvas.tokens?.placeables?.find(t => t.id === msg.tokenId)?.actor
|
||||
: game.actors.get(msg.actorId)
|
||||
if (actor && actor.system.hp?.wounds && msg.damage > 0) {
|
||||
const wounds = foundry.utils.duplicate(actor.system.hp.wounds)
|
||||
const slot = wounds.findIndex(w => !w.value && !w.duration)
|
||||
if (slot !== -1) {
|
||||
wounds[slot] = { value: msg.damage, duration: msg.damage, description: "Bleeding" }
|
||||
actor.update({ "system.hp.wounds": wounds })
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,6 +334,8 @@ export default class LethalFantasyUtils {
|
||||
attackD30result,
|
||||
attackD30message,
|
||||
attackRerollContext,
|
||||
attackNaturalRoll: msg.attackNaturalRoll,
|
||||
damageTier: msg.damageTier,
|
||||
defenderId: defender.id,
|
||||
defenderTokenId
|
||||
}
|
||||
@@ -365,6 +411,8 @@ export default class LethalFantasyUtils {
|
||||
attackD30result,
|
||||
attackD30message,
|
||||
attackRerollContext,
|
||||
attackNaturalRoll: msg.attackNaturalRoll,
|
||||
damageTier: msg.damageTier,
|
||||
defenderId: defender.id,
|
||||
defenderTokenId,
|
||||
isRanged: msg.isRanged
|
||||
@@ -397,6 +445,7 @@ export default class LethalFantasyUtils {
|
||||
attackD30result,
|
||||
attackD30message,
|
||||
attackRerollContext,
|
||||
damageTier: msg.damageTier,
|
||||
defenderId: defender.id,
|
||||
defenderTokenId,
|
||||
isRanged: true
|
||||
@@ -469,6 +518,8 @@ export default class LethalFantasyUtils {
|
||||
attackD30result,
|
||||
attackD30message,
|
||||
attackRerollContext,
|
||||
attackNaturalRoll: msg.attackNaturalRoll,
|
||||
damageTier: msg.damageTier,
|
||||
defenderId: defender.id,
|
||||
defenderTokenId,
|
||||
isRanged: msg.isRanged
|
||||
@@ -485,6 +536,180 @@ export default class LethalFantasyUtils {
|
||||
return d30Message?.type === "mulligan"
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
* Process D30 bonus dice for attack or defense.
|
||||
* Rolls and applies bonus dice BEFORE grit/luck/shield decisions.
|
||||
* For `choice` type results (D30=20, 30), shows dialog to choose between bonus dice and special effect.
|
||||
* For `bonus_dice` type results (D30=27, 2, 3), auto-rolls the dice.
|
||||
* @param {Object|null} d30Message The D30 result object
|
||||
* @param {"attack"|"defense"} side Whether processing the attack or defense side
|
||||
* @param {number|null} naturalRoll The natural D20 roll (for special strike type detection)
|
||||
* @param {Object} actor The actor (for dice3d display)
|
||||
* @returns {Promise<{modifier: number, specialEffect: string|null, specialName: string|null}>}
|
||||
*/
|
||||
static async processD30BonusDice(d30Message, side, naturalRoll = null, actor = null) {
|
||||
if (!d30Message) return { modifier: 0, specialEffect: null, specialName: null }
|
||||
|
||||
const validTargets = side === "attack" ? ["attack", "spell_attack"] : ["defense", "spell_defense"]
|
||||
|
||||
// ── Simple bonus_dice type ── auto-roll if target matches
|
||||
if (d30Message.type === "bonus_dice") {
|
||||
if (!validTargets.includes(d30Message.target)) return { modifier: 0, specialEffect: null, specialName: null }
|
||||
const modifier = await this._rollD30BonusDie(d30Message.dice, actor)
|
||||
return { modifier, specialEffect: null, specialName: null }
|
||||
}
|
||||
|
||||
// ── Choice type ── present all options to the player
|
||||
if (d30Message.type === "choice") {
|
||||
const buttons = d30Message.choices.map(c => {
|
||||
let label
|
||||
let icon
|
||||
if (c.type === "bonus_dice") {
|
||||
label = `Roll ${c.dice.toUpperCase()} and add to ${side}`
|
||||
icon = "fa-solid fa-dice"
|
||||
} else if (c.type === "special_strike") {
|
||||
label = this._buildSpecialLabel(c, naturalRoll)
|
||||
icon = "fa-solid fa-star"
|
||||
} else if (c.type === "special_defense") {
|
||||
label = this._buildSpecialLabel(c, naturalRoll)
|
||||
icon = "fa-solid fa-shield-halved"
|
||||
} else {
|
||||
label = c.type.replace(/_/g, " ").replace(/\b\w/g, l => l.toUpperCase())
|
||||
icon = "fa-solid fa-question"
|
||||
}
|
||||
return {
|
||||
action: c.type,
|
||||
label,
|
||||
icon,
|
||||
callback: () => c
|
||||
}
|
||||
})
|
||||
|
||||
const choice = await foundry.applications.api.DialogV2.wait({
|
||||
window: { title: "D30 Special — Choose Effect" },
|
||||
classes: ["lethalfantasy"],
|
||||
content: `
|
||||
<div class="grit-luck-dialog">
|
||||
<p><strong>D30 result:</strong> ${d30Message.description}</p>
|
||||
<p>Choose how to use this result:</p>
|
||||
</div>
|
||||
`,
|
||||
buttons,
|
||||
rejectClose: false
|
||||
})
|
||||
|
||||
if (!choice) return { modifier: 0, specialEffect: null, specialName: null }
|
||||
|
||||
if (choice.type === "bonus_dice") {
|
||||
const modifier = await this._rollD30BonusDie(choice.dice, actor)
|
||||
return { modifier, specialEffect: null, specialName: null }
|
||||
}
|
||||
|
||||
if (choice.type === "special_strike" || choice.type === "special_defense") {
|
||||
return { modifier: 0, specialEffect: "auto", specialName: this._buildSpecialName(choice, naturalRoll) }
|
||||
}
|
||||
|
||||
// Non-standard choice (spell_calamity, etc.) — report it
|
||||
return { modifier: 0, specialEffect: "flag", specialName: choice.type }
|
||||
}
|
||||
|
||||
// ── Combo type (bleed / internal injury) — flag for wound creation
|
||||
if (d30Message.type === "combo") {
|
||||
const hasBleed = d30Message.effects?.some(e => e.type === "bleed" || e.type === "internal_injury")
|
||||
if (hasBleed) {
|
||||
return { modifier: 0, specialEffect: "bleed", specialName: "Bleeding/Internal Injury" }
|
||||
}
|
||||
}
|
||||
|
||||
// ── Damage multiplier type (2x/3x damage before DR)
|
||||
if (d30Message.type === "damage_multiplier") {
|
||||
return { modifier: 0, specialEffect: "damageMultiplier", specialName: `x${d30Message.multiplier} Damage`, multiplier: d30Message.multiplier }
|
||||
}
|
||||
|
||||
// ── DR multiplier type (2x/3x DR including shield)
|
||||
if (d30Message.type === "dr_multiplier") {
|
||||
return { modifier: 0, specialEffect: "drMultiplier", specialName: `x${d30Message.multiplier} DR`, multiplier: d30Message.multiplier }
|
||||
}
|
||||
|
||||
return { modifier: 0, specialEffect: null, specialName: null }
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
* Roll a D30 bonus die and show with 3D dice if available.
|
||||
* @param {string} formula Dice formula (e.g. "D6", "D12", "D20E")
|
||||
* @param {Object} actor Actor for chat message speaker
|
||||
* @returns {Promise<number>} The roll total
|
||||
*/
|
||||
static async _rollD30BonusDie(formula, actor) {
|
||||
const cleaned = formula.replace(/NE$/i, "").replace("E", "")
|
||||
const roll = new Roll(cleaned)
|
||||
await roll.evaluate()
|
||||
if (game?.dice3d) {
|
||||
await game.dice3d.showForRoll(roll, game.user, true)
|
||||
}
|
||||
await ChatMessage.create({
|
||||
content: `<p>D30 bonus: rolled <strong>${cleaned.toUpperCase()}</strong> = <strong>${roll.total}</strong></p>`,
|
||||
speaker: ChatMessage.getSpeaker({ actor })
|
||||
})
|
||||
return roll.total
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
* Build a human-readable label for a special strike/defense choice in the D30 prompt.
|
||||
* @param {Object} specialChoice The choice object with type and options
|
||||
* @param {number|null} naturalRoll The natural D20 roll
|
||||
* @returns {string} Display label
|
||||
*/
|
||||
static _buildSpecialLabel(specialChoice, naturalRoll) {
|
||||
if (specialChoice.type === "special_strike") {
|
||||
if (specialChoice.options.includes("lethal")) {
|
||||
if (naturalRoll === 20) return "Lethal Strike (auto-hit)"
|
||||
if (naturalRoll >= 16 && naturalRoll <= 19) return "Vital Strike (auto-hit)"
|
||||
return "Lethal/Vital Strike (auto-hit)"
|
||||
}
|
||||
if (specialChoice.options.includes("vicious")) return "Vicious Strike (auto-hit)"
|
||||
return "Special Strike (auto-hit)"
|
||||
}
|
||||
if (specialChoice.type === "special_defense") {
|
||||
if (specialChoice.options.includes("perfect_spell")) return "Perfect Spell Defense (auto-block)"
|
||||
if (specialChoice.options.includes("flawless")) return "Flawless Defense (auto-block)"
|
||||
if (specialChoice.options.includes("legendary")) return "Legendary Defense (auto-block)"
|
||||
if (specialChoice.options.includes("perfect")) return "Perfect Defense (auto-block)"
|
||||
return "Special Defense (auto-block)"
|
||||
}
|
||||
return "Special Effect"
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
* Build the special effect name based on the D30 result and natural roll.
|
||||
* @param {Object} specialChoice The choice object with type and options
|
||||
* @param {number|null} naturalRoll The natural D20 roll
|
||||
* @returns {string} The special effect name
|
||||
*/
|
||||
static _buildSpecialName(specialChoice, naturalRoll) {
|
||||
if (specialChoice.type === "special_strike") {
|
||||
if (specialChoice.options.includes("lethal")) {
|
||||
if (naturalRoll === 20) return "Lethal Strike"
|
||||
if (naturalRoll >= 16 && naturalRoll <= 19) return "Vital Strike"
|
||||
return "Lethal/Vital Strike"
|
||||
}
|
||||
if (specialChoice.options.includes("vicious")) return "Vicious Strike"
|
||||
return "Special Strike"
|
||||
}
|
||||
if (specialChoice.type === "special_defense") {
|
||||
if (specialChoice.options.includes("perfect_spell")) return "Perfect Spell Defense"
|
||||
if (specialChoice.options.includes("flawless")) return "Flawless Defense"
|
||||
if (specialChoice.options.includes("legendary")) return "Legendary Defense"
|
||||
if (specialChoice.options.includes("perfect")) return "Perfect Defense"
|
||||
return "Special Defense"
|
||||
}
|
||||
return "Special Effect"
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getCombatBonusDiceChoices() {
|
||||
return ["1d4", "1d6", "1d8", "1d10", "1d12", "1d20", "1d20e"]
|
||||
@@ -843,19 +1068,16 @@ export default class LethalFantasyUtils {
|
||||
// Déterminer le type de dégâts à lancer
|
||||
if (data.attackRollType === "weapon-attack") {
|
||||
damageButton = `
|
||||
<div class="attack-result-damage">
|
||||
<button class="roll-damage-btn" data-attacker-id="${data.attackerId}" data-defender-id="${data.defenderId}" data-defender-token-id="${data.defenderTokenId || ""}" data-extra-shield-dr="${data.shieldDamageReduction || 0}" data-weapon-id="${data.attackWeaponId}" data-damage-type="small">
|
||||
<i class="fa-solid fa-dice-d6"></i> Damage (Small)
|
||||
</button>
|
||||
<button class="roll-damage-btn" data-attacker-id="${data.attackerId}" data-defender-id="${data.defenderId}" data-defender-token-id="${data.defenderTokenId || ""}" data-extra-shield-dr="${data.shieldDamageReduction || 0}" data-weapon-id="${data.attackWeaponId}" data-damage-type="medium">
|
||||
<i class="fa-solid fa-dice-d20"></i> Damage (Medium)
|
||||
<div class="attack-result-damage single-btn">
|
||||
<button class="roll-damage-btn" data-attacker-id="${data.attackerId}" data-defender-id="${data.defenderId}" data-defender-token-id="${data.defenderTokenId || ""}" data-extra-shield-dr="${data.shieldDamageReduction || 0}" data-weapon-id="${data.attackWeaponId}" data-damage-type="medium" data-d30-bleed="${data.d30Bleed || ""}" data-d30-damage-mult="${data.d30DamageMultiplier || 1}" data-d30-dr-mult="${data.d30DrMultiplier || 1}">
|
||||
<i class="fa-solid fa-dice-d20"></i> Damage
|
||||
</button>
|
||||
</div>
|
||||
`
|
||||
} else if (data.attackRollType === "monster-attack") {
|
||||
damageButton = `
|
||||
<div class="attack-result-damage single-btn">
|
||||
<button class="roll-damage-btn" data-attacker-id="${data.attackerId}" data-defender-id="${data.defenderId}" data-defender-token-id="${data.defenderTokenId || ""}" data-extra-shield-dr="${data.shieldDamageReduction || 0}" data-attack-key="${data.attackRollKey}" data-damage-type="monster">
|
||||
<button class="roll-damage-btn" data-attacker-id="${data.attackerId}" data-defender-id="${data.defenderId}" data-defender-token-id="${data.defenderTokenId || ""}" data-extra-shield-dr="${data.shieldDamageReduction || 0}" data-attack-key="${data.attackRollKey}" data-damage-type="monster" data-d30-bleed="${data.d30Bleed || ""}" data-d30-damage-mult="${data.d30DamageMultiplier || 1}" data-d30-dr-mult="${data.d30DrMultiplier || 1}">
|
||||
<i class="fa-solid fa-burst"></i> Damage
|
||||
</button>
|
||||
</div>
|
||||
@@ -863,11 +1085,13 @@ export default class LethalFantasyUtils {
|
||||
} else if (data.attackRollType === "spell-attack" || data.attackRollType === "miracle-attack") {
|
||||
const attacker = game.actors.get(data.attackerId)
|
||||
const spell = attacker?.items.get(data.attackWeaponId || data.attackRollKey)
|
||||
const tiers = [
|
||||
{ formula: spell?.system?.damageDice, label: "Standard" },
|
||||
{ formula: spell?.system?.damageDiceOverpowered, label: "Overpowered" },
|
||||
{ formula: spell?.system?.damageDiceOverpowered2, label: "Overpowered 2" },
|
||||
].filter(t => t.formula)
|
||||
const chosenTier = data.damageTier || "standard"
|
||||
const allTiers = [
|
||||
{ id: "standard", formula: spell?.system?.damageDice, label: "Standard" },
|
||||
{ id: "overpowered", formula: spell?.system?.damageDiceOverpowered, label: "Overpowered" },
|
||||
{ id: "overpowered2", formula: spell?.system?.damageDiceOverpowered2, label: "Overpowered 2" },
|
||||
]
|
||||
const tiers = allTiers.filter(t => t.id === chosenTier && t.formula)
|
||||
if (tiers.length) {
|
||||
const buttons = tiers.map(t => {
|
||||
const escapedFormula = Handlebars.escapeExpression(t.formula)
|
||||
@@ -877,7 +1101,10 @@ export default class LethalFantasyUtils {
|
||||
data-defender-id="${data.defenderId}"
|
||||
data-defender-token-id="${data.defenderTokenId || ""}"
|
||||
data-damage-type="spell"
|
||||
data-damage-formula="${escapedFormula}">
|
||||
data-damage-formula="${escapedFormula}"
|
||||
data-d30-bleed="${data.d30Bleed || ""}"
|
||||
data-d30-damage-mult="${data.d30DamageMultiplier || 1}"
|
||||
data-d30-dr-mult="${data.d30DrMultiplier || 1}">
|
||||
<i class="fa-solid fa-wand-magic-sparkles"></i> ${t.label} (${escapedFormula})
|
||||
</button>`
|
||||
}).join("")
|
||||
|
||||
@@ -1 +1 @@
|
||||
MANIFEST-000611
|
||||
MANIFEST-000623
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
2026/05/20-23:09:33.153266 7f179e7ed6c0 Recovering log #609
|
||||
2026/05/20-23:09:33.205459 7f179e7ed6c0 Delete type=3 #607
|
||||
2026/05/20-23:09:33.205507 7f179e7ed6c0 Delete type=0 #609
|
||||
2026/05/20-23:16:53.517842 7f179d7eb6c0 Level-0 table #614: started
|
||||
2026/05/20-23:16:53.517893 7f179d7eb6c0 Level-0 table #614: 0 bytes OK
|
||||
2026/05/20-23:16:53.523991 7f179d7eb6c0 Delete type=0 #612
|
||||
2026/05/20-23:16:53.536989 7f179d7eb6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||
2026/05/20-23:16:53.537026 7f179d7eb6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||
2026/05/25-11:43:40.059603 7f88315ff6c0 Recovering log #621
|
||||
2026/05/25-11:43:40.071136 7f88315ff6c0 Delete type=3 #619
|
||||
2026/05/25-11:43:40.071202 7f88315ff6c0 Delete type=0 #621
|
||||
2026/05/25-12:29:17.727995 7f87e2ffd6c0 Level-0 table #626: started
|
||||
2026/05/25-12:29:17.728028 7f87e2ffd6c0 Level-0 table #626: 0 bytes OK
|
||||
2026/05/25-12:29:17.733783 7f87e2ffd6c0 Delete type=0 #624
|
||||
2026/05/25-12:29:17.740143 7f87e2ffd6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||
2026/05/25-12:29:17.740167 7f87e2ffd6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
2026/05/20-00:10:37.079181 7f0b1e7ee6c0 Recovering log #605
|
||||
2026/05/20-00:10:37.089613 7f0b1e7ee6c0 Delete type=3 #603
|
||||
2026/05/20-00:10:37.089671 7f0b1e7ee6c0 Delete type=0 #605
|
||||
2026/05/20-10:53:40.566713 7f0b1cfeb6c0 Level-0 table #610: started
|
||||
2026/05/20-10:53:40.566740 7f0b1cfeb6c0 Level-0 table #610: 0 bytes OK
|
||||
2026/05/20-10:53:40.572741 7f0b1cfeb6c0 Delete type=0 #608
|
||||
2026/05/20-10:53:40.587356 7f0b1cfeb6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||
2026/05/20-10:53:40.587409 7f0b1cfeb6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||
2026/05/24-09:22:43.041326 7fdfa95ff6c0 Recovering log #617
|
||||
2026/05/24-09:22:43.083988 7fdfa95ff6c0 Delete type=3 #615
|
||||
2026/05/24-09:22:43.084045 7fdfa95ff6c0 Delete type=0 #617
|
||||
2026/05/24-09:42:00.304351 7fdf5affd6c0 Level-0 table #622: started
|
||||
2026/05/24-09:42:00.304423 7fdf5affd6c0 Level-0 table #622: 0 bytes OK
|
||||
2026/05/24-09:42:00.311333 7fdf5affd6c0 Delete type=0 #620
|
||||
2026/05/24-09:42:00.334170 7fdf5affd6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||
2026/05/24-09:42:00.334370 7fdf5affd6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
MANIFEST-000608
|
||||
MANIFEST-000620
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
2026/05/20-23:09:33.234730 7f179e7ed6c0 Recovering log #606
|
||||
2026/05/20-23:09:33.288868 7f179e7ed6c0 Delete type=3 #604
|
||||
2026/05/20-23:09:33.288920 7f179e7ed6c0 Delete type=0 #606
|
||||
2026/05/20-23:16:53.524172 7f179d7eb6c0 Level-0 table #611: started
|
||||
2026/05/20-23:16:53.524219 7f179d7eb6c0 Level-0 table #611: 0 bytes OK
|
||||
2026/05/20-23:16:53.530312 7f179d7eb6c0 Delete type=0 #609
|
||||
2026/05/20-23:16:53.537003 7f179d7eb6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||
2026/05/20-23:16:53.537059 7f179d7eb6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||
2026/05/25-11:43:40.077580 7f87e37fe6c0 Recovering log #618
|
||||
2026/05/25-11:43:40.087750 7f87e37fe6c0 Delete type=3 #616
|
||||
2026/05/25-11:43:40.087800 7f87e37fe6c0 Delete type=0 #618
|
||||
2026/05/25-12:29:17.758832 7f87e2ffd6c0 Level-0 table #623: started
|
||||
2026/05/25-12:29:17.758858 7f87e2ffd6c0 Level-0 table #623: 0 bytes OK
|
||||
2026/05/25-12:29:17.764622 7f87e2ffd6c0 Delete type=0 #621
|
||||
2026/05/25-12:29:17.777473 7f87e2ffd6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||
2026/05/25-12:29:17.784124 7f87e2ffd6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
2026/05/20-00:10:37.107483 7f0b1efef6c0 Recovering log #602
|
||||
2026/05/20-00:10:37.117907 7f0b1efef6c0 Delete type=3 #600
|
||||
2026/05/20-00:10:37.117968 7f0b1efef6c0 Delete type=0 #602
|
||||
2026/05/20-10:53:40.572909 7f0b1cfeb6c0 Level-0 table #607: started
|
||||
2026/05/20-10:53:40.572948 7f0b1cfeb6c0 Level-0 table #607: 0 bytes OK
|
||||
2026/05/20-10:53:40.579001 7f0b1cfeb6c0 Delete type=0 #605
|
||||
2026/05/20-10:53:40.587370 7f0b1cfeb6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||
2026/05/20-10:53:40.587430 7f0b1cfeb6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||
2026/05/24-09:22:43.091828 7fdfa8dfe6c0 Recovering log #614
|
||||
2026/05/24-09:22:43.131041 7fdfa8dfe6c0 Delete type=3 #612
|
||||
2026/05/24-09:22:43.131104 7fdfa8dfe6c0 Delete type=0 #614
|
||||
2026/05/24-09:42:00.326388 7fdf5affd6c0 Level-0 table #619: started
|
||||
2026/05/24-09:42:00.326417 7fdf5affd6c0 Level-0 table #619: 0 bytes OK
|
||||
2026/05/24-09:42:00.334051 7fdf5affd6c0 Delete type=0 #617
|
||||
2026/05/24-09:42:00.334205 7fdf5affd6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||
2026/05/24-09:42:00.334364 7fdf5affd6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
MANIFEST-000613
|
||||
MANIFEST-000625
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
2026/05/20-23:09:33.082007 7f179dfec6c0 Recovering log #611
|
||||
2026/05/20-23:09:33.140910 7f179dfec6c0 Delete type=3 #609
|
||||
2026/05/20-23:09:33.140962 7f179dfec6c0 Delete type=0 #611
|
||||
2026/05/20-23:16:53.510592 7f179d7eb6c0 Level-0 table #616: started
|
||||
2026/05/20-23:16:53.510664 7f179d7eb6c0 Level-0 table #616: 0 bytes OK
|
||||
2026/05/20-23:16:53.517661 7f179d7eb6c0 Delete type=0 #614
|
||||
2026/05/20-23:16:53.536973 7f179d7eb6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||
2026/05/20-23:16:53.537037 7f179d7eb6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||
2026/05/25-11:43:40.044921 7f87e3fff6c0 Recovering log #623
|
||||
2026/05/25-11:43:40.054992 7f87e3fff6c0 Delete type=3 #621
|
||||
2026/05/25-11:43:40.055048 7f87e3fff6c0 Delete type=0 #623
|
||||
2026/05/25-12:29:17.710484 7f87e2ffd6c0 Level-0 table #628: started
|
||||
2026/05/25-12:29:17.710568 7f87e2ffd6c0 Level-0 table #628: 0 bytes OK
|
||||
2026/05/25-12:29:17.716928 7f87e2ffd6c0 Delete type=0 #626
|
||||
2026/05/25-12:29:17.740121 7f87e2ffd6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||
2026/05/25-12:29:17.758707 7f87e2ffd6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
2026/05/20-00:10:37.061485 7f0b1efef6c0 Recovering log #607
|
||||
2026/05/20-00:10:37.071572 7f0b1efef6c0 Delete type=3 #605
|
||||
2026/05/20-00:10:37.071684 7f0b1efef6c0 Delete type=0 #607
|
||||
2026/05/20-10:53:40.579189 7f0b1cfeb6c0 Level-0 table #612: started
|
||||
2026/05/20-10:53:40.579229 7f0b1cfeb6c0 Level-0 table #612: 0 bytes OK
|
||||
2026/05/20-10:53:40.587176 7f0b1cfeb6c0 Delete type=0 #610
|
||||
2026/05/20-10:53:40.587386 7f0b1cfeb6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||
2026/05/20-10:53:40.587419 7f0b1cfeb6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||
2026/05/24-09:22:42.993966 7fdfa8dfe6c0 Recovering log #619
|
||||
2026/05/24-09:22:43.035467 7fdfa8dfe6c0 Delete type=3 #617
|
||||
2026/05/24-09:22:43.035518 7fdfa8dfe6c0 Delete type=0 #619
|
||||
2026/05/24-09:42:00.319082 7fdf5affd6c0 Level-0 table #624: started
|
||||
2026/05/24-09:42:00.319109 7fdf5affd6c0 Level-0 table #624: 0 bytes OK
|
||||
2026/05/24-09:42:00.326261 7fdf5affd6c0 Delete type=0 #622
|
||||
2026/05/24-09:42:00.334196 7fdf5affd6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||
2026/05/24-09:42:00.334355 7fdf5affd6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
MANIFEST-000308
|
||||
MANIFEST-000320
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
2026/05/20-23:09:33.368596 7f179e7ed6c0 Recovering log #306
|
||||
2026/05/20-23:09:33.422152 7f179e7ed6c0 Delete type=3 #304
|
||||
2026/05/20-23:09:33.422210 7f179e7ed6c0 Delete type=0 #306
|
||||
2026/05/20-23:16:53.560903 7f179d7eb6c0 Level-0 table #311: started
|
||||
2026/05/20-23:16:53.560969 7f179d7eb6c0 Level-0 table #311: 0 bytes OK
|
||||
2026/05/20-23:16:53.568455 7f179d7eb6c0 Delete type=0 #309
|
||||
2026/05/20-23:16:53.568616 7f179d7eb6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||
2026/05/20-23:16:53.578679 7f179d7eb6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||
2026/05/25-11:43:40.107633 7f8830dfe6c0 Recovering log #318
|
||||
2026/05/25-11:43:40.118039 7f8830dfe6c0 Delete type=3 #316
|
||||
2026/05/25-11:43:40.118104 7f8830dfe6c0 Delete type=0 #318
|
||||
2026/05/25-12:29:17.777484 7f87e2ffd6c0 Level-0 table #323: started
|
||||
2026/05/25-12:29:17.777511 7f87e2ffd6c0 Level-0 table #323: 0 bytes OK
|
||||
2026/05/25-12:29:17.784021 7f87e2ffd6c0 Delete type=0 #321
|
||||
2026/05/25-12:29:17.784188 7f87e2ffd6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||
2026/05/25-12:29:17.803354 7f87e2ffd6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
2026/05/20-00:10:37.136939 7f0b1efef6c0 Recovering log #302
|
||||
2026/05/20-00:10:37.146957 7f0b1efef6c0 Delete type=3 #300
|
||||
2026/05/20-00:10:37.147030 7f0b1efef6c0 Delete type=0 #302
|
||||
2026/05/20-10:53:40.615430 7f0b1cfeb6c0 Level-0 table #307: started
|
||||
2026/05/20-10:53:40.615467 7f0b1cfeb6c0 Level-0 table #307: 0 bytes OK
|
||||
2026/05/20-10:53:40.621586 7f0b1cfeb6c0 Delete type=0 #305
|
||||
2026/05/20-10:53:40.621713 7f0b1cfeb6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||
2026/05/20-10:53:40.633723 7f0b1cfeb6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||
2026/05/24-09:22:43.194643 7fdfa8dfe6c0 Recovering log #314
|
||||
2026/05/24-09:22:43.231409 7fdfa8dfe6c0 Delete type=3 #312
|
||||
2026/05/24-09:22:43.231470 7fdfa8dfe6c0 Delete type=0 #314
|
||||
2026/05/24-09:42:00.341818 7fdf5affd6c0 Level-0 table #319: started
|
||||
2026/05/24-09:42:00.341853 7fdf5affd6c0 Level-0 table #319: 0 bytes OK
|
||||
2026/05/24-09:42:00.348538 7fdf5affd6c0 Delete type=0 #317
|
||||
2026/05/24-09:42:00.367125 7fdf5affd6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||
2026/05/24-09:42:00.367348 7fdf5affd6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||
|
||||
BIN
Binary file not shown.
@@ -1 +1 @@
|
||||
MANIFEST-000607
|
||||
MANIFEST-000619
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
2026/05/20-23:09:33.302872 7f179efee6c0 Recovering log #605
|
||||
2026/05/20-23:09:33.362229 7f179efee6c0 Delete type=3 #603
|
||||
2026/05/20-23:09:33.362319 7f179efee6c0 Delete type=0 #605
|
||||
2026/05/20-23:16:53.530498 7f179d7eb6c0 Level-0 table #610: started
|
||||
2026/05/20-23:16:53.530547 7f179d7eb6c0 Level-0 table #610: 0 bytes OK
|
||||
2026/05/20-23:16:53.536854 7f179d7eb6c0 Delete type=0 #608
|
||||
2026/05/20-23:16:53.537015 7f179d7eb6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||
2026/05/20-23:16:53.537048 7f179d7eb6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||
2026/05/25-11:43:40.093877 7f87e3fff6c0 Recovering log #617
|
||||
2026/05/25-11:43:40.103670 7f87e3fff6c0 Delete type=3 #615
|
||||
2026/05/25-11:43:40.103720 7f87e3fff6c0 Delete type=0 #617
|
||||
2026/05/25-12:29:17.764689 7f87e2ffd6c0 Level-0 table #622: started
|
||||
2026/05/25-12:29:17.764705 7f87e2ffd6c0 Level-0 table #622: 0 bytes OK
|
||||
2026/05/25-12:29:17.770486 7f87e2ffd6c0 Delete type=0 #620
|
||||
2026/05/25-12:29:17.784104 7f87e2ffd6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||
2026/05/25-12:29:17.784130 7f87e2ffd6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
2026/05/20-00:10:37.121340 7f0b1e7ee6c0 Recovering log #601
|
||||
2026/05/20-00:10:37.132435 7f0b1e7ee6c0 Delete type=3 #599
|
||||
2026/05/20-00:10:37.132491 7f0b1e7ee6c0 Delete type=0 #601
|
||||
2026/05/20-10:53:40.559937 7f0b1cfeb6c0 Level-0 table #606: started
|
||||
2026/05/20-10:53:40.560028 7f0b1cfeb6c0 Level-0 table #606: 0 bytes OK
|
||||
2026/05/20-10:53:40.566605 7f0b1cfeb6c0 Delete type=0 #604
|
||||
2026/05/20-10:53:40.587338 7f0b1cfeb6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||
2026/05/20-10:53:40.587398 7f0b1cfeb6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||
2026/05/24-09:22:43.141936 7fdf5bfff6c0 Recovering log #613
|
||||
2026/05/24-09:22:43.189387 7fdf5bfff6c0 Delete type=3 #611
|
||||
2026/05/24-09:22:43.189438 7fdf5bfff6c0 Delete type=0 #613
|
||||
2026/05/24-09:42:00.311436 7fdf5affd6c0 Level-0 table #618: started
|
||||
2026/05/24-09:42:00.311459 7fdf5affd6c0 Level-0 table #618: 0 bytes OK
|
||||
2026/05/24-09:42:00.318964 7fdf5affd6c0 Delete type=0 #616
|
||||
2026/05/24-09:42:00.334187 7fdf5affd6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||
2026/05/24-09:42:00.334334 7fdf5affd6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||
|
||||
BIN
Binary file not shown.
@@ -387,11 +387,11 @@
|
||||
min-width: 6rem;
|
||||
max-width: 6rem;
|
||||
}
|
||||
min-width: 10rem;
|
||||
max-width: 10rem;
|
||||
min-width: 11rem;
|
||||
max-width: 11rem;
|
||||
.input {
|
||||
min-width: 2.5rem;
|
||||
max-width: 2.5rem;
|
||||
min-width: 3.5rem;
|
||||
max-width: 3.5rem;
|
||||
}
|
||||
}
|
||||
.granted {
|
||||
|
||||
@@ -89,6 +89,66 @@
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* Luck/Grit Styles */
|
||||
#token-hud .luck-grit-wrap {
|
||||
position: absolute;
|
||||
left: 75px;
|
||||
display: none;
|
||||
top: 50%;
|
||||
width: 80px;
|
||||
text-align: start;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
border: 1px solid rgba(139, 69, 19, 0.5);
|
||||
border-radius: 4px;
|
||||
padding: 4px 6px;
|
||||
transform: translate(-100%, -50%);
|
||||
}
|
||||
|
||||
#token-hud .luck-grit-hud-active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#token-hud .luck-grit-hud-disabled {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#token-hud .luck-grit-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
||||
#token-hud .luck-grit-label {
|
||||
flex: 1;
|
||||
color: #c9b896;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
#token-hud .luck-grit-btn {
|
||||
width: 28px;
|
||||
height: 22px;
|
||||
padding: 0;
|
||||
background: rgba(139, 69, 19, 0.25);
|
||||
border: 1px solid rgba(139, 69, 19, 0.4);
|
||||
border-radius: 3px;
|
||||
color: #d4c5a9;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
&:hover {
|
||||
background: rgba(139, 69, 19, 0.5);
|
||||
border-color: rgba(139, 69, 19, 0.7);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------------- */
|
||||
/* Dice Tray — injected into the Foundry chat sidebar */
|
||||
/* -------------------------------------------------- */
|
||||
|
||||
@@ -87,16 +87,10 @@
|
||||
<i class="fa-solid fa-shield-halved" data-roll-type="weapon-defense" data-roll-key="{{item.id}}"></i>
|
||||
</a>
|
||||
|
||||
<a class="rollable" data-roll-type="weapon-damage-small" data-roll-key="{{item.id}}"
|
||||
data-tooltip="Roll Damage (Small)">
|
||||
<i class="fa-regular fa-face-head-bandage" data-roll-type="weapon-damage-small"
|
||||
data-roll-key="{{item.id}}"></i>S
|
||||
</a>
|
||||
|
||||
<a class="rollable" data-roll-type="weapon-damage-medium" data-roll-key="{{item.id}}"
|
||||
data-tooltip="Roll Damage (Medium)">
|
||||
<i class="fa-regular fa-face-head-bandage" data-roll-type="weapon-damage-medium"
|
||||
data-roll-key="{{item.id}}"></i>M
|
||||
<a class="rollable" data-roll-type="weapon-damage" data-roll-key="{{item.id}}"
|
||||
data-tooltip="Roll Damage">
|
||||
<i class="fa-regular fa-face-head-bandage" data-roll-type="weapon-damage"
|
||||
data-roll-key="{{item.id}}"></i>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -69,16 +69,10 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if rollData.damageSmall}}
|
||||
<div class="detail-badge damage-badge">
|
||||
<i class="fa-solid fa-dice-d6"></i>
|
||||
<span>{{localize "LETHALFANTASY.Label.weapon-damage-small"}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if rollData.damageMedium}}
|
||||
{{#if rollData.isDamage}}
|
||||
<div class="detail-badge damage-badge">
|
||||
<i class="fa-solid fa-dice-d20"></i>
|
||||
<span>{{localize "LETHALFANTASY.Label.weapon-damage-medium"}}</span>
|
||||
<span>{{localize "LETHALFANTASY.Label.weapon-damage"}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
@@ -202,19 +196,6 @@
|
||||
}}+{{weaponDamageOptions.damageModifier}}{{/if}}
|
||||
</button>
|
||||
{{else}}
|
||||
{{#if weaponDamageOptions.damageS}}
|
||||
<button
|
||||
class="damage-roll-btn"
|
||||
data-weapon-id="{{weaponDamageOptions.weaponId}}"
|
||||
data-damage-type="small"
|
||||
data-damage-formula="{{weaponDamageOptions.damageS}}"
|
||||
data-is-monster="false"
|
||||
title="{{localize 'LETHALFANTASY.Label.rollDamage'}}"
|
||||
>
|
||||
<i class="fa-solid fa-dice-d6"></i>
|
||||
Damage Small
|
||||
</button>
|
||||
{{/if}}
|
||||
{{#if weaponDamageOptions.damageM}}
|
||||
<button
|
||||
class="damage-roll-btn"
|
||||
@@ -225,7 +206,7 @@
|
||||
title="{{localize 'LETHALFANTASY.Label.rollDamage'}}"
|
||||
>
|
||||
<i class="fa-solid fa-dice-d20"></i>
|
||||
Damage Medium
|
||||
{{localize "LETHALFANTASY.Label.damage"}}
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<div class="control-icon" data-action="lethal-luck-grit-hud">
|
||||
<i class="fa-solid fa-dice" title="Adjust Luck/Grit" style="width:36px;height:36px;display:flex;align-items:center;justify-content:center;font-size:18px;cursor:pointer"></i>
|
||||
|
||||
<div class="luck-grit-wrap luck-grit-hud-disabled">
|
||||
<div class="luck-grit-row">
|
||||
<span class="luck-grit-label">Luck</span>
|
||||
<button class="luck-grit-btn" data-resource="luck" data-amount="-1">−1</button>
|
||||
<button class="luck-grit-btn" data-resource="luck" data-amount="1">+1</button>
|
||||
</div>
|
||||
<div class="luck-grit-row">
|
||||
<span class="luck-grit-label">Grit</span>
|
||||
<button class="luck-grit-btn" data-resource="grit" data-amount="-1">−1</button>
|
||||
<button class="luck-grit-btn" data-resource="grit" data-amount="1">+1</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,45 @@
|
||||
<div class="lethalfantasy-range-defense-dialog">
|
||||
|
||||
<fieldSet class="">
|
||||
<legend>{{localize "LETHALFANTASY.Label.rangeAttackDialog"}}</legend>
|
||||
|
||||
<div class="field-section">
|
||||
<span class="field-name">Attacker Movement :</span>
|
||||
<select name="movement" data-tooltip-direction="UP">
|
||||
{{selectOptions attackerMovementChoices selected=movement}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="field-section">
|
||||
<span class="field-name">Range :</span>
|
||||
<select name="range" data-tooltip-direction="UP">
|
||||
{{selectOptions rangeChoices selected=range}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="field-section">
|
||||
<span class="field-name">Target Size :</span>
|
||||
<select name="size" data-tooltip-direction="UP">
|
||||
{{selectOptions sizeChoices selected=size}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="field-section">
|
||||
<span class="field-name">Aim :</span>
|
||||
<select name="attackerAim" data-tooltip-direction="UP">
|
||||
{{selectOptions attackerAimChoices selected=attackerAim}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</fieldSet>
|
||||
|
||||
<fieldSet>
|
||||
<legend>{{localize "LETHALFANTASY.Roll.visibility"}}</legend>
|
||||
<span class="fieldset-centered">
|
||||
<select name="visibility">
|
||||
{{selectOptions rollModes selected=visibility localize=true}}
|
||||
</select>
|
||||
</span>
|
||||
</fieldSet>
|
||||
|
||||
</div>
|
||||
@@ -55,8 +55,7 @@
|
||||
<div class="dialog-save">Add Granted Attack Dice
|
||||
<input type="checkbox" data-action="selectGranted" name="granted" />
|
||||
</div>
|
||||
{{#if rollTarget.weapon}}
|
||||
{{#if (eq rollTarget.weapon.system.weaponType "melee")}}{{else}}
|
||||
{{#if isRangedAttack}}
|
||||
<div class="dialog-save">Point Blank Range Attack
|
||||
<input
|
||||
type="checkbox"
|
||||
@@ -84,7 +83,6 @@
|
||||
</select>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{/if}}
|
||||
{{#if (match rollType "defense")}}
|
||||
@@ -125,7 +123,6 @@
|
||||
</select>
|
||||
|
||||
{{#if (eq rollType "save")}}
|
||||
{{#if rollTarget.magicUser}}
|
||||
<div>
|
||||
<span>Save against spell (+{{rollTarget.actorModifiers.saveModifier}})
|
||||
?</span>
|
||||
@@ -136,7 +133,6 @@
|
||||
/>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</fieldSet>
|
||||
{{/if}}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
{{formField systemFields.level value=system.level}}
|
||||
{{formField systemFields.cost value=system.cost}}
|
||||
{{formField systemFields.costOverpowered value=system.costOverpowered}}
|
||||
{{formField systemFields.costOverpowered2 value=system.costOverpowered2}}
|
||||
|
||||
<label>{{localize "LETHALFANTASY.Label.components"}}</label>
|
||||
<div class="shift-right">
|
||||
|
||||
@@ -17,11 +17,7 @@
|
||||
{{formField systemFields.damageType.fields.typeS value=system.damageType.typeS}}
|
||||
</div>
|
||||
|
||||
<label>{{localize "LETHALFANTASY.Label.damage"}}</label>
|
||||
<div class="shift-right">
|
||||
{{formField systemFields.damage.fields.damageS value=system.damage.damageS}}
|
||||
{{formField systemFields.damage.fields.damageM value=system.damage.damageM}}
|
||||
</div>
|
||||
{{formField systemFields.damage.fields.damageM value=system.damage.damageM label="LETHALFANTASY.Label.damage"}}
|
||||
|
||||
{{formField systemFields.applyStrengthDamageBonus value=system.applyStrengthDamageBonus localize=true}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user