Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 60b351f50d | |||
| ace726a1fc | |||
| 67499bc199 | |||
| 7eae95cbbd | |||
| 1b53bf9152 | |||
| 2570bf707e | |||
| cbeaaeec99 | |||
| 37badf2619 | |||
| 5839616863 | |||
| 89298490ef | |||
| bb42de19bd | |||
| 53f9c33419 | |||
| 06eba5f835 | |||
| 46fa2d15a3 | |||
| 8aae7bada0 | |||
| ceb62bca3f | |||
| 110ac65ba5 | |||
| 9b75fd4d96 | |||
| 141d6048e0 | |||
| ea7acf6bf8 | |||
| c20750caa7 | |||
| ce630feb51 | |||
| b35b684d50 | |||
| f6fb0b68b8 | |||
| e45edd60c4 | |||
| d389a85a9f | |||
| c217490a5b | |||
| 38eb1a8d3d | |||
| 4724cdf2bb | |||
| 6d06c8ddad | |||
| 2770774aa3 | |||
| e417b61625 | |||
| 9a8d580ef6 | |||
| 9ccb0f90f0 | |||
| 6cf0880ad3 | |||
| 96306623e5 | |||
| 7279cd752d | |||
| db3e8b5d35 | |||
| 54421e4a83 | |||
| ac44419b7a | |||
| a3fc0a42b9 | |||
| c8ce840e98 | |||
| 55a040062a | |||
| 1818a76499 | |||
| 55d1b41ca4 | |||
| 841ed82277 | |||
| 968d156d09 | |||
| 59ff098fca | |||
| b8174d5e22 | |||
| 7f15450566 | |||
| 28fdaff2ec | |||
| 81584ed5d6 | |||
| 8c9a13faf1 | |||
| 6c6c473147 | |||
| 2e2a917a45 | |||
| 343abc32e2 | |||
| c37d92af25 | |||
| 42945d33db | |||
| 1bf88bac06 | |||
| 3ad5681539 | |||
| df6f8e5710 |
@@ -0,0 +1 @@
|
|||||||
|
packs/** filter=lfs diff=lfs merge=lfs -text
|
||||||
@@ -59,5 +59,5 @@ jobs:
|
|||||||
version: ${{github.event.release.tag_name}}
|
version: ${{github.event.release.tag_name}}
|
||||||
manifest: "https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/system.json"
|
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"
|
notes: "https://www.uberwald.me/gitea/public/fvtt-lethal-fantasy/raw/branch/main/changelog.md"
|
||||||
compatibility-minimum: "13"
|
compatibility-minimum: "14"
|
||||||
compatibility-verified: "13"
|
compatibility-verified: "14"
|
||||||
|
|||||||
+12
@@ -7,4 +7,16 @@ styles/*.css
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
.history
|
.history
|
||||||
|
.github/
|
||||||
|
|
||||||
|
# LevelDB internals (auto-generated, churn on every open)
|
||||||
|
packs-system/**/*.log
|
||||||
|
packs-system/**/LOG
|
||||||
|
packs-system/**/LOG.old
|
||||||
|
packs-system/**/CURRENT
|
||||||
|
packs-system/**/LOCK
|
||||||
|
packs-system/**/MANIFEST-*
|
||||||
|
|
||||||
|
# YAML source for pack round-trip
|
||||||
|
packs_src/
|
||||||
|
|
||||||
|
|||||||
Vendored
+6
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"biodata",
|
||||||
|
"LETHALFANTASY"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
# Lethal Fantasy FoundryVTT System — Session Context
|
||||||
|
|
||||||
|
## Current Goal
|
||||||
|
Fix Grit/Luck defense reaction dialog UX (stacking dialogs, multiple clicks, revert on close) and cross-client sync of defense bonuses.
|
||||||
|
|
||||||
|
## Accomplished
|
||||||
|
|
||||||
|
### Pass 1 — Critical Issues
|
||||||
|
- **Telemetry removed**: `ClassCounter`, `registerWorldCount`, orphaned `worldKey` setting deleted from system.json
|
||||||
|
- **globalThis side effects**: `globalThis.SYSTEM`, `globalThis.pendingDefenses` moved from top-level to `init` hook
|
||||||
|
- **console.log → log()**: All runtime console.log replaced with `log()` helper guarded by `lethalFantasy.debug` setting
|
||||||
|
- **Stale Tenebris refs**: `macros.mjs` — `TENEBRIS.Label.jet` → `LETHALFANTASY.Label.jet`, `TENEBRIS.Manager.*` → `LETHALFANTASY.Label.*`, `tenebris.macro` flag → `lethalFantasy.macro`
|
||||||
|
|
||||||
|
### Pass 2 — V1/V2 Mixing, Fire-and-Forget
|
||||||
|
- **V1 sheet registrations removed**: `foundry.appv1.sheets.*` in system.json
|
||||||
|
- **V1 `activateListeners`/jQuery**: removed dead `defaultOptions`, V1 tab code from `combat.mjs`
|
||||||
|
- **V2 API paths**: `FilePicker` → V2, `TextEditor.getDragEventData` → V2, `item.sheet.render(true)` → `render({force:true})`, `super._onRender()` → `super._onRender(context, options)`, `token._id` → `token.id`
|
||||||
|
- **Fire-and-forget Promises**: All `actor.update()`, `ChatMessage.create()`, `prepareRoll()`, `prepareMonsterRoll()`, socket handler calls now awaited
|
||||||
|
- **Misnamed class**: `LethalFantasySkill` → `LethalFantasyWeapon`; added missing `WEAPON_TYPE` import; fixed `weaponCategory`
|
||||||
|
|
||||||
|
### Pass 3 — Code Review Fixes
|
||||||
|
- **Duplicated dialogs**: Per-element `.rollable`/`.wound-data` bindings moved to `_onRender` (V2 destroys/recreates DOM each render); `_activateListeners` reverted
|
||||||
|
- **renderChatMessage reverted**: V2 hook `renderChatMessage` passes jQuery html, `querySelectorAll` fails; kept `renderChatMessageHTML`
|
||||||
|
- **Roll actions broken**: Fixed `async` base-actor-sheet methods; `_onRender` bindings for rollable elements restored
|
||||||
|
- **Token HUD guard**: `html.querySelector()` → `html.find().length` (html is jQuery object)
|
||||||
|
- **All review awaits confirmed**: `showDefenseRequest`/`socket` handlers all awaited
|
||||||
|
|
||||||
|
## Defense Dialog Investigation — Status
|
||||||
|
|
||||||
|
### Symptom (user process)
|
||||||
|
1. Monster (GM) attacks player — hits
|
||||||
|
2. Player uses Grit/Luck to boost defense
|
||||||
|
3. Defense now beats attack — reports new result
|
||||||
|
4. Dialog **stays open** — Grit/Luck/bonus dice options still visible
|
||||||
|
5. Closing dialog (Continue or X) causes "rolls vanish" — reverts to original result
|
||||||
|
|
||||||
|
### Root Cause Found — Duplicate cross-client processing (FIXED)
|
||||||
|
|
||||||
|
When monster (GM) attacks player, the `createChatMessage` hook fires on **both** clients:
|
||||||
|
|
||||||
|
```
|
||||||
|
Player's client: GM's client:
|
||||||
|
defense msg created defense msg synced
|
||||||
|
↓ ↓
|
||||||
|
hook fires (line 557) hook fires (line 557)
|
||||||
|
isPrimaryController(defender)=true isPrimaryController(defender)=false
|
||||||
|
↓ ↓
|
||||||
|
Defense dialog A shows Defense dialog skipped
|
||||||
|
Player spends Grit Cross-client code (line 1009):
|
||||||
|
defenseRoll=10→16 isPrimaryController(attacker)=true
|
||||||
|
While loop exits defenderOwner=player (≠GM)
|
||||||
|
Comparison: "miss" ↓
|
||||||
|
**Sends attackBoosted with ORIGINAL
|
||||||
|
defenseRoll=10 (stale!)**
|
||||||
|
↓
|
||||||
|
Player receives socket → handleAttackBoosted
|
||||||
|
→ Defense dialog B shows with OLD values
|
||||||
|
→ When closed, comparison: "hit" (overwrites!)
|
||||||
|
```
|
||||||
|
|
||||||
|
Player sees **two** dialogs (A then B). Dialog B uses unboosted values, so closing/ignoring it produces a stale "hit" result that overwrites the correct "miss."
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
`lethal-fantasy.mjs:1016` — only send `attackBoosted` socket when `attackerHandledBonus || attackerHasNonGMOwner`. Guards against stale-socket overwrite for GM→player combat (where hook-based processing works without socket), while preserving socket delegation for PC→PC cross-client (where `attackerIsCrossClient` suppresses the hook-based processing on the defender's client).
|
||||||
|
|
||||||
|
Before:
|
||||||
|
```js
|
||||||
|
if (defenderOwner && defenderOwner.id !== game.user.id) {
|
||||||
|
game.socket.emit(`system.${SYSTEM.id}`, { type: "attackBoosted", ... })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
After:
|
||||||
|
```js
|
||||||
|
if (defenderOwner && defenderOwner.id !== game.user.id) {
|
||||||
|
if (attackerHandledBonus || attackerHasNonGMOwner) {
|
||||||
|
game.socket.emit(`system.${SYSTEM.id}`, { type: "attackBoosted", ... })
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Same-Client Path
|
||||||
|
Code pattern is identical between attack and defense dialogs — both use `await DialogV2.wait({rejectClose:false})` in a while loop. Same-client defense works correctly because no duplicate socket messages arrive.
|
||||||
|
|
||||||
|
### Other Findings
|
||||||
|
- `offerGritLuckBonus` (`utils.mjs:1121`) is dead code — never called
|
||||||
|
- `promptCombatBonusDie` (`utils.mjs:975`) is correct — DialogV2 resolves to callback return value, not `action`
|
||||||
|
- Cross-client `handleAttackBoosted` (`utils.mjs:291`) still uses `else if` chain without `continue` — functionally correct but differs from same-client pattern
|
||||||
|
|
||||||
|
### Code Paths
|
||||||
|
| Flow | File | Line |
|
||||||
|
|------|------|------|
|
||||||
|
| Same-client attack | `lethal-fantasy.mjs` | 918-1004 |
|
||||||
|
| Same-client defense | `lethal-fantasy.mjs` | 697-870 |
|
||||||
|
| Cross-client defense | `module/utils.mjs` | 291-445 |
|
||||||
|
| Cross-client socket guard | `lethal-fantasy.mjs` | 1006-1037 |
|
||||||
|
| Attack Grit offer | `module/utils.mjs` | 1210-1290 |
|
||||||
|
|
||||||
|
### Key Files
|
||||||
|
- `lethal-fantasy.mjs` — Main system hooks, same-client attack/defense reactions
|
||||||
|
- `module/utils.mjs` — Cross-client defense flow, bonus dialogs, compareAttackDefense
|
||||||
|
- `module/documents/actor.mjs` — `prepareRoll()` entry point
|
||||||
|
- `module/documents/roll.mjs` — Roll resolution pipeline
|
||||||
@@ -1 +1,7 @@
|
|||||||
<svg style="height: 512px; width: 512px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g class="" style="" transform="translate(0,0)"><path d="M373.47 25.5c-33.475-.064-67.614 13.444-94.44 43.156l37.22 145.156-33.437.032 35.343 132.093-116.718-188.375 50.03 5.375L202.5 47.312C120.437-1.43 4.756 40.396 8.5 158.156c4.402 138.44 191.196 184.6 247.406 331.625 59.376-147.035 251.26-184.33 246.656-331.624-2.564-82.042-64.6-132.532-129.093-132.656z" fill="#fff" fill-opacity="1"></path></g></svg>
|
<svg style="height: 512px; width: 512px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
||||||
|
<g class="" style="" transform="translate(0,0)">
|
||||||
|
<path
|
||||||
|
d="M373.47 25.5c-33.475-.064-67.614 13.444-94.44 43.156l37.22 145.156-33.437.032 35.343 132.093-116.718-188.375 50.03 5.375L202.5 47.312C120.437-1.43 4.756 40.396 8.5 158.156c4.402 138.44 191.196 184.6 247.406 331.625 59.376-147.035 251.26-184.33 246.656-331.624-2.564-82.042-64.6-132.532-129.093-132.656z"
|
||||||
|
fill="#dc2626" fill-opacity="1"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 533 B |
@@ -0,0 +1,10 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||||
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<!-- Heart shape -->
|
||||||
|
<path
|
||||||
|
d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"
|
||||||
|
fill="#4ade80" stroke="#22c55e" />
|
||||||
|
<!-- Plus sign inside heart -->
|
||||||
|
<line x1="12" y1="8" x2="12" y2="14" stroke="#ffffff" stroke-width="2.5" />
|
||||||
|
<line x1="9" y1="11" x2="15" y2="11" stroke="#ffffff" stroke-width="2.5" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 572 B |
Binary file not shown.
+490
-36
@@ -529,16 +529,16 @@ i.lethalfantasy {
|
|||||||
}
|
}
|
||||||
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .armor-hp {
|
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .armor-hp {
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
min-width: 10rem;
|
min-width: 11rem;
|
||||||
max-width: 10rem;
|
max-width: 11rem;
|
||||||
}
|
}
|
||||||
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .armor-hp .name {
|
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .armor-hp .name {
|
||||||
min-width: 6rem;
|
min-width: 6rem;
|
||||||
max-width: 6rem;
|
max-width: 6rem;
|
||||||
}
|
}
|
||||||
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .armor-hp .input {
|
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .armor-hp .input {
|
||||||
min-width: 2.5rem;
|
min-width: 3.5rem;
|
||||||
max-width: 2.5rem;
|
max-width: 3.5rem;
|
||||||
}
|
}
|
||||||
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .granted {
|
.lethalfantasy .tab.character-combat .main-div .combat-details .combat-detail .granted {
|
||||||
min-width: 8rem;
|
min-width: 8rem;
|
||||||
@@ -1178,6 +1178,45 @@ i.lethalfantasy {
|
|||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
|
.lethalfantasy .tab.monster-combat .ranged-attacks {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
.lethalfantasy .tab.monster-combat .ranged-attacks .attack .name {
|
||||||
|
min-width: 10rem;
|
||||||
|
max-width: 10rem;
|
||||||
|
}
|
||||||
|
.lethalfantasy .tab.monster-combat .ranged-attacks .attack .damage-dice {
|
||||||
|
width: 5rem;
|
||||||
|
max-width: 5rem;
|
||||||
|
}
|
||||||
|
.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range {
|
||||||
|
margin-top: 8px;
|
||||||
|
border-top: 1px solid var(--color-border-light-tertiary, #ccc);
|
||||||
|
padding-top: 6px;
|
||||||
|
}
|
||||||
|
.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range > label {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range .range-fields {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range .range-fields .range-field {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range .range-fields .range-field label {
|
||||||
|
font-size: 0.7rem;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.lethalfantasy .tab.monster-combat .ranged-attacks .ranged-weapon-range .range-fields .range-field input {
|
||||||
|
width: 3.5rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
.lethalfantasy .tab.monster-combat .armors {
|
.lethalfantasy .tab.monster-combat .armors {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
@@ -1988,9 +2027,12 @@ i.lethalfantasy {
|
|||||||
background: #4a4940 !important;
|
background: #4a4940 !important;
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
}
|
}
|
||||||
|
.lethalfantasy .grit-luck-dialog {
|
||||||
|
color: var(--color-text-dark-primary, #191813);
|
||||||
|
}
|
||||||
.lethalfantasy .grit-luck-dialog .combat-status {
|
.lethalfantasy .grit-luck-dialog .combat-status {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
background: linear-gradient(to bottom, rgba(42, 41, 32, 0.8) 0%, rgba(26, 25, 16, 0.9) 100%);
|
background: linear-gradient(to bottom, rgba(42, 41, 32, 0.88) 0%, rgba(26, 25, 16, 0.95) 100%);
|
||||||
border: 1px solid rgba(212, 175, 55, 0.5);
|
border: 1px solid rgba(212, 175, 55, 0.5);
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
@@ -2010,11 +2052,25 @@ i.lethalfantasy {
|
|||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
.lethalfantasy .grit-luck-dialog .offer-text {
|
.lethalfantasy .grit-luck-dialog .offer-text {
|
||||||
color: #f0e6d2;
|
color: var(--color-text-dark-primary, #191813);
|
||||||
font-size: calc(var(--font-size-standard) * 1);
|
font-size: calc(var(--font-size-standard) * 1);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
margin: 0 0 8px 0;
|
||||||
|
}
|
||||||
|
.lethalfantasy .grit-luck-dialog .shield-warning {
|
||||||
|
color: #7a4000;
|
||||||
|
background: rgba(255, 160, 0, 0.12);
|
||||||
|
border: 1px solid rgba(255, 160, 0, 0.4);
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: calc(var(--font-size-standard) * 0.88);
|
||||||
|
padding: 6px 10px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.lethalfantasy .grit-luck-dialog .shield-warning i {
|
||||||
|
color: #c07000;
|
||||||
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
.lethalfantasy .attack-result {
|
.lethalfantasy .attack-result {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
@@ -2105,31 +2161,66 @@ i.lethalfantasy {
|
|||||||
color: #d4af37;
|
color: #d4af37;
|
||||||
}
|
}
|
||||||
.lethalfantasy .attack-result .attack-result-damage {
|
.lethalfantasy .attack-result .attack-result-damage {
|
||||||
display: flex;
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
justify-content: center;
|
}
|
||||||
|
.lethalfantasy .attack-result .attack-result-damage.single-btn {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
max-width: 280px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
.lethalfantasy .attack-result .attack-result-damage.spell-damage {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.lethalfantasy .attack-result .attack-result-damage .roll-damage-btn {
|
.lethalfantasy .attack-result .attack-result-damage .roll-damage-btn {
|
||||||
padding: 10px 16px;
|
padding: 10px 14px;
|
||||||
background: linear-gradient(to bottom, #8b0000 0%, #660000 100%);
|
background: linear-gradient(to bottom, #8b0000 0%, #660000 100%);
|
||||||
border: 1px solid #ff0000;
|
border: 1px solid #4b0000;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
color: #f0e6d2;
|
color: #f0e6d2;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
font-size: calc(var(--font-size-standard) * 0.9);
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.lethalfantasy .attack-result .attack-result-damage .roll-damage-btn::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: -100%;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
|
||||||
|
transition: left 0.5s;
|
||||||
|
}
|
||||||
|
.lethalfantasy .attack-result .attack-result-damage .roll-damage-btn:hover::before {
|
||||||
|
left: 100%;
|
||||||
|
}
|
||||||
|
.lethalfantasy .attack-result .attack-result-damage .roll-damage-btn i {
|
||||||
|
font-size: calc(var(--font-size-standard) * 1.1);
|
||||||
|
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.lethalfantasy .attack-result .attack-result-damage .roll-damage-btn:hover {
|
.lethalfantasy .attack-result .attack-result-damage .roll-damage-btn:hover {
|
||||||
background: linear-gradient(to bottom, #a00000 0%, #7b0000 100%);
|
background: linear-gradient(to bottom, #a00000 0%, #7b0000 100%);
|
||||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
|
border-color: #5b0000;
|
||||||
}
|
}
|
||||||
.lethalfantasy .attack-result .attack-result-damage .roll-damage-btn:active {
|
.lethalfantasy .attack-result .attack-result-damage .roll-damage-btn:active {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 3px rgba(0, 0, 0, 0.3);
|
||||||
.lethalfantasy .attack-result .attack-result-damage .roll-damage-btn i {
|
|
||||||
margin-right: 6px;
|
|
||||||
}
|
}
|
||||||
.lethalfantasy .equipment-content {
|
.lethalfantasy .equipment-content {
|
||||||
font-family: var(--font-primary);
|
font-family: var(--font-primary);
|
||||||
@@ -2595,6 +2686,21 @@ i.lethalfantasy {
|
|||||||
max-width: 8rem;
|
max-width: 8rem;
|
||||||
margin-left: 1rem;
|
margin-left: 1rem;
|
||||||
}
|
}
|
||||||
|
.dialog-warning {
|
||||||
|
margin: 0.4rem 0.2rem 0.2rem;
|
||||||
|
padding: 0.35rem 0.5rem;
|
||||||
|
border-left: 3px solid #c8941a;
|
||||||
|
background: rgba(200, 148, 26, 0.12);
|
||||||
|
border-radius: 3px;
|
||||||
|
font-family: var(--font-secondary);
|
||||||
|
font-size: calc(var(--font-size-standard) * 0.9);
|
||||||
|
color: #7a5400;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
.dialog-warning i {
|
||||||
|
color: #c8941a;
|
||||||
|
margin-right: 0.4rem;
|
||||||
|
}
|
||||||
.lethalfantasy.dice-roll,
|
.lethalfantasy.dice-roll,
|
||||||
.fvtt-lethal-fantasy.dice-roll,
|
.fvtt-lethal-fantasy.dice-roll,
|
||||||
.message.lethalfantasy.dice-roll,
|
.message.lethalfantasy.dice-roll,
|
||||||
@@ -2974,7 +3080,7 @@ i.lethalfantasy {
|
|||||||
.message.fvtt-lethal-fantasy.dice-roll .result-section .d30-result .d30-header .d30-label {
|
.message.fvtt-lethal-fantasy.dice-roll .result-section .d30-result .d30-header .d30-label {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #e0d5f0;
|
color: #2a1a3a;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 0.5px;
|
letter-spacing: 0.5px;
|
||||||
font-size: calc(var(--font-size-standard) * 0.9);
|
font-size: calc(var(--font-size-standard) * 0.9);
|
||||||
@@ -2986,11 +3092,11 @@ i.lethalfantasy {
|
|||||||
font-family: var(--font-primary);
|
font-family: var(--font-primary);
|
||||||
font-size: calc(var(--font-size-standard) * 1.5);
|
font-size: calc(var(--font-size-standard) * 1.5);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #ff69b4;
|
color: #3d006e;
|
||||||
background: rgba(255, 105, 180, 0.1);
|
background: rgba(255, 255, 255, 0.35);
|
||||||
padding: 4px 12px;
|
padding: 4px 12px;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
border: 1px solid rgba(255, 105, 180, 0.3);
|
border: 1px solid rgba(138, 43, 226, 0.4);
|
||||||
}
|
}
|
||||||
.lethalfantasy.dice-roll .result-section .d30-result .d30-message,
|
.lethalfantasy.dice-roll .result-section .d30-result .d30-message,
|
||||||
.fvtt-lethal-fantasy.dice-roll .result-section .d30-result .d30-message,
|
.fvtt-lethal-fantasy.dice-roll .result-section .d30-result .d30-message,
|
||||||
@@ -3174,16 +3280,10 @@ i.lethalfantasy {
|
|||||||
.message.lethalfantasy.dice-roll .damage-buttons .damage-buttons-grid,
|
.message.lethalfantasy.dice-roll .damage-buttons .damage-buttons-grid,
|
||||||
.message.fvtt-lethal-fantasy.dice-roll .damage-buttons .damage-buttons-grid {
|
.message.fvtt-lethal-fantasy.dice-roll .damage-buttons .damage-buttons-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
.lethalfantasy.dice-roll .damage-buttons .damage-buttons-grid.monster-damage,
|
|
||||||
.fvtt-lethal-fantasy.dice-roll .damage-buttons .damage-buttons-grid.monster-damage,
|
|
||||||
.message.lethalfantasy.dice-roll .damage-buttons .damage-buttons-grid.monster-damage,
|
|
||||||
.message.fvtt-lethal-fantasy.dice-roll .damage-buttons .damage-buttons-grid.monster-damage {
|
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
max-width: 280px;
|
max-width: 280px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
gap: 8px;
|
||||||
}
|
}
|
||||||
.lethalfantasy.dice-roll .damage-buttons .damage-buttons-grid .damage-roll-btn,
|
.lethalfantasy.dice-roll .damage-buttons .damage-buttons-grid .damage-roll-btn,
|
||||||
.fvtt-lethal-fantasy.dice-roll .damage-buttons .damage-buttons-grid .damage-roll-btn,
|
.fvtt-lethal-fantasy.dice-roll .damage-buttons .damage-buttons-grid .damage-roll-btn,
|
||||||
@@ -3443,6 +3543,7 @@ i.lethalfantasy {
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
justify-items: center;
|
||||||
}
|
}
|
||||||
.lethalfantasy.dice-roll .d30-message,
|
.lethalfantasy.dice-roll .d30-message,
|
||||||
.fvtt-lethal-fantasy.dice-roll .d30-message,
|
.fvtt-lethal-fantasy.dice-roll .d30-message,
|
||||||
@@ -3889,35 +3990,74 @@ i.lethalfantasy {
|
|||||||
}
|
}
|
||||||
.message .attack-result .attack-result-damage,
|
.message .attack-result .attack-result-damage,
|
||||||
.attack-result .attack-result-damage {
|
.attack-result .attack-result-damage {
|
||||||
display: flex;
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
justify-content: center;
|
}
|
||||||
|
.message .attack-result .attack-result-damage.single-btn,
|
||||||
|
.attack-result .attack-result-damage.single-btn {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
max-width: 280px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
.message .attack-result .attack-result-damage.spell-damage,
|
||||||
|
.attack-result .attack-result-damage.spell-damage {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.message .attack-result .attack-result-damage .roll-damage-btn,
|
.message .attack-result .attack-result-damage .roll-damage-btn,
|
||||||
.attack-result .attack-result-damage .roll-damage-btn {
|
.attack-result .attack-result-damage .roll-damage-btn {
|
||||||
padding: 10px 16px;
|
padding: 10px 14px;
|
||||||
background: linear-gradient(to bottom, #8b0000 0%, #660000 100%);
|
background: linear-gradient(to bottom, #8b0000 0%, #660000 100%);
|
||||||
border: 1px solid #ff0000;
|
border: 1px solid #4b0000;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
color: #f0e6d2;
|
color: #f0e6d2;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
font-size: calc(var(--font-size-standard) * 0.9);
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.message .attack-result .attack-result-damage .roll-damage-btn::before,
|
||||||
|
.attack-result .attack-result-damage .roll-damage-btn::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: -100%;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
|
||||||
|
transition: left 0.5s;
|
||||||
|
}
|
||||||
|
.message .attack-result .attack-result-damage .roll-damage-btn:hover::before,
|
||||||
|
.attack-result .attack-result-damage .roll-damage-btn:hover::before {
|
||||||
|
left: 100%;
|
||||||
|
}
|
||||||
|
.message .attack-result .attack-result-damage .roll-damage-btn i,
|
||||||
|
.attack-result .attack-result-damage .roll-damage-btn i {
|
||||||
|
font-size: calc(var(--font-size-standard) * 1.1);
|
||||||
|
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.message .attack-result .attack-result-damage .roll-damage-btn:hover,
|
.message .attack-result .attack-result-damage .roll-damage-btn:hover,
|
||||||
.attack-result .attack-result-damage .roll-damage-btn:hover {
|
.attack-result .attack-result-damage .roll-damage-btn:hover {
|
||||||
background: linear-gradient(to bottom, #a00000 0%, #7b0000 100%);
|
background: linear-gradient(to bottom, #a00000 0%, #7b0000 100%);
|
||||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
|
border-color: #5b0000;
|
||||||
}
|
}
|
||||||
.message .attack-result .attack-result-damage .roll-damage-btn:active,
|
.message .attack-result .attack-result-damage .roll-damage-btn:active,
|
||||||
.attack-result .attack-result-damage .roll-damage-btn:active {
|
.attack-result .attack-result-damage .roll-damage-btn:active {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 3px rgba(0, 0, 0, 0.3);
|
||||||
.message .attack-result .attack-result-damage .roll-damage-btn i,
|
|
||||||
.attack-result .attack-result-damage .roll-damage-btn i {
|
|
||||||
margin-right: 6px;
|
|
||||||
}
|
}
|
||||||
#token-hud .hp-loss-wrap {
|
#token-hud .hp-loss-wrap {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -3956,3 +4096,317 @@ i.lethalfantasy {
|
|||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
/* HP Gain Styles */
|
||||||
|
#token-hud .hp-gain-wrap {
|
||||||
|
position: absolute;
|
||||||
|
left: 75px;
|
||||||
|
display: none;
|
||||||
|
top: 50%;
|
||||||
|
width: 48px;
|
||||||
|
text-align: start;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-wrap-col1 {
|
||||||
|
transform: translate(-200%, -50%);
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-wrap-col2 {
|
||||||
|
transform: translate(-300%, -50%);
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-wrap-col3 {
|
||||||
|
transform: translate(-400%, -50%);
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-hud-active {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-hud-disabled {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#token-hud .hud-gain-hp-button-select {
|
||||||
|
max-width: 40px;
|
||||||
|
background-image: var(--background-image-base);
|
||||||
|
padding-top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
width: max-content;
|
||||||
|
margin: 0;
|
||||||
|
color: #252424;
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-wrap .hud-gain-hp-button-select {
|
||||||
|
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 */
|
||||||
|
/* -------------------------------------------------- */
|
||||||
|
.lf-dice-tray {
|
||||||
|
padding: 6px 8px;
|
||||||
|
background: linear-gradient(135deg, rgba(245, 232, 200, 0.97) 0%, rgba(238, 222, 185, 0.97) 100%), url("/systems/fvtt-lethal-fantasy/assets/ui/lethal_fantasy_background.webp") center / cover;
|
||||||
|
border-top: 2px solid rgba(139, 69, 19, 0.5);
|
||||||
|
border-bottom: 1px solid rgba(139, 69, 19, 0.25);
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
pointer-events: all;
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-label {
|
||||||
|
color: #3a2a10;
|
||||||
|
font-size: 15px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-count {
|
||||||
|
width: 44px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 3px 4px;
|
||||||
|
background: rgba(139, 69, 19, 0.15);
|
||||||
|
border: 1px solid rgba(139, 69, 19, 0.45);
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #2a1a08;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 700;
|
||||||
|
cursor: pointer;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-count option {
|
||||||
|
background: #f5ead0;
|
||||||
|
color: #2a1a08;
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-count:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: rgba(139, 69, 19, 0.7);
|
||||||
|
box-shadow: 0 0 4px rgba(139, 69, 19, 0.25);
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-dice {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 3px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-die-btn {
|
||||||
|
padding: 3px 7px;
|
||||||
|
background: rgba(139, 69, 19, 0.15);
|
||||||
|
border: 1px solid rgba(139, 69, 19, 0.4);
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #2a1a08;
|
||||||
|
font-size: 10px;
|
||||||
|
font-weight: 700;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
|
||||||
|
line-height: 1.5;
|
||||||
|
letter-spacing: 0.3px;
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-die-btn:hover {
|
||||||
|
background: rgba(139, 69, 19, 0.35);
|
||||||
|
border-color: rgba(139, 69, 19, 0.7);
|
||||||
|
color: #5a2a00;
|
||||||
|
box-shadow: 0 0 5px rgba(139, 69, 19, 0.3);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-die-btn:active {
|
||||||
|
transform: translateY(0);
|
||||||
|
box-shadow: none;
|
||||||
|
background: rgba(139, 69, 19, 0.5);
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-explode-label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 3px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: rgba(160, 80, 20, 0.7);
|
||||||
|
font-size: 14px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 3px 6px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: color 0.15s, border-color 0.15s, background 0.15s;
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-explode-label:hover {
|
||||||
|
color: rgba(200, 100, 30, 0.9);
|
||||||
|
border-color: rgba(139, 69, 19, 0.45);
|
||||||
|
background: rgba(139, 69, 19, 0.12);
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-explode-label input[type="checkbox"] {
|
||||||
|
appearance: none;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
position: absolute;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-explode-label input[type="checkbox"]:checked ~ i {
|
||||||
|
color: #cc4400;
|
||||||
|
filter: drop-shadow(0 0 4px rgba(200, 80, 0, 0.6));
|
||||||
|
}
|
||||||
|
.lf-dice-tray .lf-dt-explode-label:has(input:checked) {
|
||||||
|
color: #cc4400;
|
||||||
|
border-color: rgba(139, 69, 19, 0.55);
|
||||||
|
background: rgba(139, 60, 10, 0.2);
|
||||||
|
}
|
||||||
|
/* Free roll chat card — styled to match regular system roll cards */
|
||||||
|
.lf-free-roll-card {
|
||||||
|
border-radius: 6px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 6px 8px;
|
||||||
|
background: linear-gradient(135deg, rgba(40, 30, 20, 0.7) 0%, rgba(30, 22, 15, 0.9) 100%);
|
||||||
|
border-bottom: 2px solid rgba(139, 69, 19, 0.4);
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-header i {
|
||||||
|
color: #c9b896;
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 1.1);
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-header .lf-frc-title-text {
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.85);
|
||||||
|
color: #c9b896;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-header .lf-frc-badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 2px 8px;
|
||||||
|
background: rgba(139, 69, 19, 0.3);
|
||||||
|
border: 1px solid rgba(139, 69, 19, 0.5);
|
||||||
|
border-radius: 10px;
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.85);
|
||||||
|
font-weight: 600;
|
||||||
|
color: #d4c5a9;
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-dice {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 6px 8px;
|
||||||
|
background: rgba(0, 0, 0, 0.15);
|
||||||
|
border: 1px solid rgba(139, 69, 19, 0.3);
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-dice .lf-frc-die-chip {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 3px 8px;
|
||||||
|
background: rgba(139, 69, 19, 0.2);
|
||||||
|
border: 1px solid rgba(139, 69, 19, 0.3);
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-dice .lf-frc-die-chip .lf-frc-die-type {
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.85);
|
||||||
|
font-weight: 600;
|
||||||
|
color: #2a2a1a;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-dice .lf-frc-die-chip .lf-frc-die-sep {
|
||||||
|
color: rgba(0, 0, 0, 0.35);
|
||||||
|
font-weight: 300;
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.8);
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-dice .lf-frc-die-chip .lf-frc-die-val {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #ffd700;
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.95);
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-dice .lf-frc-die-chip .lf-frc-die-val .lf-dt-explode-icon {
|
||||||
|
font-size: 8px;
|
||||||
|
color: #ffcc00;
|
||||||
|
margin-left: 2px;
|
||||||
|
vertical-align: super;
|
||||||
|
text-shadow: 0 0 4px rgba(255, 200, 0, 0.8);
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-dice .lf-frc-die-chip.lf-frc-max {
|
||||||
|
background: rgba(139, 90, 19, 0.35);
|
||||||
|
border-color: rgba(200, 116, 42, 0.6);
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-dice .lf-frc-die-chip.lf-frc-max .lf-frc-die-val {
|
||||||
|
color: #ff9a40;
|
||||||
|
text-shadow: 0 0 6px rgba(200, 116, 42, 0.6);
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-dice .lf-frc-die-chip.lf-frc-min {
|
||||||
|
background: rgba(139, 20, 20, 0.25);
|
||||||
|
border-color: rgba(139, 34, 34, 0.5);
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-dice .lf-frc-die-chip.lf-frc-min .lf-frc-die-val {
|
||||||
|
color: #ff6b6b;
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-total-bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 6px 10px;
|
||||||
|
background: linear-gradient(135deg, rgba(40, 30, 20, 0.6) 0%, rgba(20, 15, 10, 0.8) 100%);
|
||||||
|
border: 2px solid rgba(139, 69, 19, 0.5);
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-total-bar .lf-frc-total-label {
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.85);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
color: #c9b896;
|
||||||
|
}
|
||||||
|
.lf-free-roll-card .lf-frc-total-bar .lf-frc-total-value {
|
||||||
|
font-family: var(--font-primary, serif);
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 1.6);
|
||||||
|
font-weight: bold;
|
||||||
|
color: #e8d5a0;
|
||||||
|
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
|
||||||
|
}
|
||||||
|
|||||||
+232
-19
@@ -1,8 +1,32 @@
|
|||||||
{
|
{
|
||||||
"COMBAT": {
|
"COMBAT": {
|
||||||
"Round": "Second {round}",
|
"Begin": "Begin Combat",
|
||||||
"Rounds": "Seconds",
|
"Create": "Create Encounter",
|
||||||
"RoundNext": "Next second"
|
"Delete": "Delete Encounter",
|
||||||
|
"Encounter": "Encounter",
|
||||||
|
"EncounterNext": "Next Encounter",
|
||||||
|
"EncounterPrevious": "Previous Encounter",
|
||||||
|
"End": "End Combat",
|
||||||
|
"InitiativeReset": "Reset Initiative",
|
||||||
|
"InitiativeRoll": "Roll Initiative",
|
||||||
|
"InitiativeScore": "Initiative Score",
|
||||||
|
"NavLabel": "Combat Tracker Navigation",
|
||||||
|
"None": "None",
|
||||||
|
"NotStarted": "Not Started",
|
||||||
|
"PanToCombatant": "Pan to Combatant",
|
||||||
|
"PingCombatant": "Ping Combatant",
|
||||||
|
"RollAll": "Roll All",
|
||||||
|
"RollNPC": "Roll NPCs",
|
||||||
|
"Round": "Second {round}",
|
||||||
|
"RoundNext": "Next second",
|
||||||
|
"RoundPrev": "Previous second",
|
||||||
|
"Rounds": "Seconds",
|
||||||
|
"Settings": "Combat Settings",
|
||||||
|
"ToggleDead": "Toggle Dead",
|
||||||
|
"ToggleVis": "Toggle Visible",
|
||||||
|
"TurnEnd": "End Turn",
|
||||||
|
"TurnNext": "Next Turn",
|
||||||
|
"TurnPrev": "Previous Turn"
|
||||||
},
|
},
|
||||||
"LETHALFANTASY": {
|
"LETHALFANTASY": {
|
||||||
"Armor": {
|
"Armor": {
|
||||||
@@ -152,6 +176,57 @@
|
|||||||
"wis": {
|
"wis": {
|
||||||
"label": "Wisdom"
|
"label": "Wisdom"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"agility": {
|
||||||
|
"label": "Agility"
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"label": "Appearance"
|
||||||
|
},
|
||||||
|
"cha": {
|
||||||
|
"label": "Charisma"
|
||||||
|
},
|
||||||
|
"con": {
|
||||||
|
"label": "Constitution"
|
||||||
|
},
|
||||||
|
"contagion": {
|
||||||
|
"label": "Contagion Save"
|
||||||
|
},
|
||||||
|
"dex": {
|
||||||
|
"label": "Dexterity"
|
||||||
|
},
|
||||||
|
"dodge": {
|
||||||
|
"label": "Dodge Save"
|
||||||
|
},
|
||||||
|
"dying": {
|
||||||
|
"label": "Dying Challenge"
|
||||||
|
},
|
||||||
|
"int": {
|
||||||
|
"label": "Intelligence"
|
||||||
|
},
|
||||||
|
"luc": {
|
||||||
|
"label": "Luck"
|
||||||
|
},
|
||||||
|
"pain": {
|
||||||
|
"label": "Pain Save"
|
||||||
|
},
|
||||||
|
"painCourage": {
|
||||||
|
"label": "Pain/Courage Save"
|
||||||
|
},
|
||||||
|
"poison": {
|
||||||
|
"label": "Poison Save"
|
||||||
|
},
|
||||||
|
"str": {
|
||||||
|
"label": "Strength"
|
||||||
|
},
|
||||||
|
"toughness": {
|
||||||
|
"label": "Toughness Save"
|
||||||
|
},
|
||||||
|
"will": {
|
||||||
|
"label": "Willpower Save"
|
||||||
|
},
|
||||||
|
"wis": {
|
||||||
|
"label": "Wisdom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Monster": {
|
"Monster": {
|
||||||
@@ -250,6 +325,21 @@
|
|||||||
"wis": {
|
"wis": {
|
||||||
"label": "Wisdom"
|
"label": "Wisdom"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"perception": {
|
||||||
|
"label": "Perception"
|
||||||
|
},
|
||||||
|
"resistIntimidation": {
|
||||||
|
"label": "Resist Intimidation"
|
||||||
|
},
|
||||||
|
"resistPerformance": {
|
||||||
|
"label": "Resist Performance"
|
||||||
|
},
|
||||||
|
"resistTorture": {
|
||||||
|
"label": "Resist Torture"
|
||||||
|
},
|
||||||
|
"stealth": {
|
||||||
|
"label": "Stealth"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Delete": "Delete",
|
"Delete": "Delete",
|
||||||
@@ -294,13 +384,13 @@
|
|||||||
"miracle-power": "Miracle - Power",
|
"miracle-power": "Miracle - Power",
|
||||||
"miracle-attack": "Miracle - Attack",
|
"miracle-attack": "Miracle - Attack",
|
||||||
"spell": "Spell",
|
"spell": "Spell",
|
||||||
"will":"Will",
|
"will": "Will",
|
||||||
"dodge":"Dodge",
|
"dodge": "Dodge",
|
||||||
"toughness":"Toughness",
|
"toughness": "Toughness",
|
||||||
"contagion":"Contagion",
|
"contagion": "Contagion",
|
||||||
"poison":"Poison",
|
"poison": "Poison",
|
||||||
"pain":"Pain",
|
"pain": "Pain",
|
||||||
"paincourage":"Pain/Courage",
|
"paincourage": "Pain/Courage",
|
||||||
"granted": "Granted Dice",
|
"granted": "Granted Dice",
|
||||||
"shields": "Shields",
|
"shields": "Shields",
|
||||||
"armorHitPoints": "Armor hit points",
|
"armorHitPoints": "Armor hit points",
|
||||||
@@ -316,11 +406,14 @@
|
|||||||
"rollProgressionCount": "Roll progression count",
|
"rollProgressionCount": "Roll progression count",
|
||||||
"rollProgressionDice": "Roll progression/Lethargy dice",
|
"rollProgressionDice": "Roll progression/Lethargy dice",
|
||||||
"earned": "Earned",
|
"earned": "Earned",
|
||||||
"divinityPoints": "Divinity points",
|
"divinityPoints": "Grace",
|
||||||
"aetherPoints": "Aether points",
|
"aetherPoints": "Aether points",
|
||||||
"attacks": "Attacks",
|
"attacks": "Attacks",
|
||||||
|
"attackMode": "Attack Mode",
|
||||||
|
"meleeModeLabel": "Melee (8 attacks)",
|
||||||
|
"rangedModeLabel": "Ranged (4 attacks)",
|
||||||
"monster": "Monster",
|
"monster": "Monster",
|
||||||
"Resist" :"Resist",
|
"Resist": "Resist",
|
||||||
"resist": "Resist",
|
"resist": "Resist",
|
||||||
"resistTorture": "Resist torture",
|
"resistTorture": "Resist torture",
|
||||||
"resistPerformance": "Resist performance",
|
"resistPerformance": "Resist performance",
|
||||||
@@ -393,8 +486,17 @@
|
|||||||
"notes": "Notes",
|
"notes": "Notes",
|
||||||
"pc": "PC",
|
"pc": "PC",
|
||||||
"perception": "Perception",
|
"perception": "Perception",
|
||||||
|
"pointBlank": "Point blank",
|
||||||
|
"short": "Short",
|
||||||
|
"medium": "Medium",
|
||||||
|
"long": "Long",
|
||||||
|
"extreme": "Extreme",
|
||||||
|
"outOfSkill": "Out of skill",
|
||||||
|
"range": "Range",
|
||||||
"rangeDefenseDialog": "Ranged defense dialog",
|
"rangeDefenseDialog": "Ranged defense dialog",
|
||||||
"rangeDefenseRoll": "Ranged defense roll",
|
"rangeDefenseRoll": "Ranged defense roll",
|
||||||
|
"rangeAttackDialog": "Ranged attack dialog",
|
||||||
|
"rangeAttackRoll": "Ranged attack roll",
|
||||||
"rangedAttackDefense": "Ranged attack defense",
|
"rangedAttackDefense": "Ranged attack defense",
|
||||||
"resource": "Resource",
|
"resource": "Resource",
|
||||||
"resources": "Resources",
|
"resources": "Resources",
|
||||||
@@ -427,8 +529,42 @@
|
|||||||
"monster-defense": "Monster defense",
|
"monster-defense": "Monster defense",
|
||||||
"weapons": "Weapons",
|
"weapons": "Weapons",
|
||||||
"wis": "WIS",
|
"wis": "WIS",
|
||||||
"weapon-damage-medium": "Weapon damage medium",
|
"combatProgressionStart": "Combat start threshold",
|
||||||
"weapon-damage-small": "Weapon damage small"
|
"miracle": "Miracle",
|
||||||
|
"titleStandard": "Standard Roll",
|
||||||
|
"privateRoll": "Private Roll",
|
||||||
|
"current": "Current",
|
||||||
|
"max": "Max",
|
||||||
|
"speed": "Speed",
|
||||||
|
"bonuses": "Bonuses",
|
||||||
|
"handToHandAttacks": "Hand To Hand Attacks",
|
||||||
|
"beyondSkill": "Beyond Skill",
|
||||||
|
"letItFly": "Let It Fly!",
|
||||||
|
"class": "Class",
|
||||||
|
"mortal": "Mortal",
|
||||||
|
"alignment": "Alignment",
|
||||||
|
"age": "Age",
|
||||||
|
"height": "Height",
|
||||||
|
"weight": "Weight",
|
||||||
|
"eyes": "Eyes",
|
||||||
|
"hair": "Hair",
|
||||||
|
"magicUser": "Magic User",
|
||||||
|
"clericUser": "Cleric User",
|
||||||
|
"lastHdRoll": "Last HD roll",
|
||||||
|
"naturalDR": "Natural DR",
|
||||||
|
"magicalDR": "Magical DR",
|
||||||
|
"saveBonus": "Save bonus (1/5 levels)",
|
||||||
|
"spellBonus": "Spell bonus (1/5 levels)",
|
||||||
|
"miracleBonus": "Miracle bonus (1/5 levels)",
|
||||||
|
"devPointsTotal": "Dev. Points (Total)",
|
||||||
|
"devPointsRem": "Dev. Points (Rem.)",
|
||||||
|
"length": "Length",
|
||||||
|
"vision": "Vision",
|
||||||
|
"damageType": "Damage Type",
|
||||||
|
"components": "Components",
|
||||||
|
"coverRanged": "Cover vs ranged attacks",
|
||||||
|
"standing": "Standing",
|
||||||
|
"crouching": "Crouching"
|
||||||
},
|
},
|
||||||
"Miracle": {
|
"Miracle": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
@@ -484,6 +620,15 @@
|
|||||||
},
|
},
|
||||||
"savingThrow": {
|
"savingThrow": {
|
||||||
"label": "Saving throw"
|
"label": "Saving throw"
|
||||||
|
},
|
||||||
|
"damageDiceOverpowered": {
|
||||||
|
"label": "Overpowered Damage Dice"
|
||||||
|
},
|
||||||
|
"damageDiceOverpowered2": {
|
||||||
|
"label": "Overpowered 2 Damage Dice"
|
||||||
|
},
|
||||||
|
"damageDice": {
|
||||||
|
"label": "Damage Dice"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -503,7 +648,9 @@
|
|||||||
"messageLethargyKO": "{spellName} : Lethargy still ongoing ... ( dice result : {roll} )",
|
"messageLethargyKO": "{spellName} : Lethargy still ongoing ... ( dice result : {roll} )",
|
||||||
"messageProgressionKO": "{name} can't attack this second.",
|
"messageProgressionKO": "{name} can't attack this second.",
|
||||||
"messageProgressionOKMonster": "{name} can attack this second with {weapon}.",
|
"messageProgressionOKMonster": "{name} can attack this second with {weapon}.",
|
||||||
"messageProgressionKOMonster": "{name} can't attack this second (dice result {roll})."
|
"messageProgressionKOMonster": "{name} can't attack this second (dice result {roll}).",
|
||||||
|
"bleedingCombatEnd": "Bleeding active out of combat: {names}",
|
||||||
|
"bleedingCombatStart": "Bleeding still active on: {names}"
|
||||||
},
|
},
|
||||||
"Opponent": {
|
"Opponent": {
|
||||||
"FIELDS": {}
|
"FIELDS": {}
|
||||||
@@ -518,7 +665,9 @@
|
|||||||
"save": "Save roll {save}",
|
"save": "Save roll {save}",
|
||||||
"success": "Success",
|
"success": "Success",
|
||||||
"visibility": "Visibility",
|
"visibility": "Visibility",
|
||||||
"favorDisfavor": "Favor/Disfavor"
|
"favorDisfavor": "Favor/Disfavor",
|
||||||
|
"displayArmor": "Target: {targetName} — Armor DR: {targetArmor} — Damage: {realDamage}",
|
||||||
|
"resourceLost": "Resource spent"
|
||||||
},
|
},
|
||||||
"Save": {
|
"Save": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
@@ -603,7 +752,8 @@
|
|||||||
"label": "Min"
|
"label": "Min"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"autoDestruction": "Auto-Destruction"
|
||||||
},
|
},
|
||||||
"Skill": {
|
"Skill": {
|
||||||
"Category": {
|
"Category": {
|
||||||
@@ -660,6 +810,9 @@
|
|||||||
"weaponClass": {
|
"weaponClass": {
|
||||||
"label": "Class"
|
"label": "Class"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"error": {
|
||||||
|
"weaponBonus": "Weapon bonus exceeds the allowed maximum (skill total / 10)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Spell": {
|
"Spell": {
|
||||||
@@ -699,6 +852,12 @@
|
|||||||
"cost": {
|
"cost": {
|
||||||
"label": "Cost"
|
"label": "Cost"
|
||||||
},
|
},
|
||||||
|
"costOverpowered": {
|
||||||
|
"label": "Cost (Overpowered)"
|
||||||
|
},
|
||||||
|
"costOverpowered2": {
|
||||||
|
"label": "Cost (Overpowered 2)"
|
||||||
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"label": "Description"
|
"label": "Description"
|
||||||
},
|
},
|
||||||
@@ -722,14 +881,35 @@
|
|||||||
},
|
},
|
||||||
"catalyst": {
|
"catalyst": {
|
||||||
"label": "Catalyst"
|
"label": "Catalyst"
|
||||||
|
},
|
||||||
|
"damageDice": {
|
||||||
|
"label": "Damage dice"
|
||||||
|
},
|
||||||
|
"damageDiceOverpowered": {
|
||||||
|
"label": "Overpowered Damage Dice"
|
||||||
|
},
|
||||||
|
"damageDiceOverpowered2": {
|
||||||
|
"label": "Overpowered 2 Damage Dice"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Range": {
|
||||||
|
"contact": "Contact",
|
||||||
|
"distant": "Distant",
|
||||||
|
"loin": "Far",
|
||||||
|
"na": "N/A",
|
||||||
|
"proche": "Close"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ToggleSheet": "Toggle mode",
|
"ToggleSheet": "Toggle mode",
|
||||||
"Tooltip": {
|
"Tooltip": {
|
||||||
"addEquipment": "New equipment",
|
"addEquipment": "New equipment",
|
||||||
"addSpell": "New spells",
|
"addSpell": "New spells",
|
||||||
"skill": "Skills list"
|
"skill": "Skills list",
|
||||||
|
"combatProgressionStart": "First attack of combat can succeed on a roll of 1 through this value. Resets to 1 for subsequent attacks.",
|
||||||
|
"addMiracle": "Add Miracle",
|
||||||
|
"gifts": "Gifts list",
|
||||||
|
"skills": "Skills list",
|
||||||
|
"vulnerabilities": "Vulnerabilities list"
|
||||||
},
|
},
|
||||||
"Vulnerability": {
|
"Vulnerability": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
@@ -744,7 +924,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Warning": {},
|
"Warning": {
|
||||||
|
"defenseShieldOrder": "To avoid a hit without using the shield, roll Grit or Luck first — then roll the shield."
|
||||||
|
},
|
||||||
"Weapon": {
|
"Weapon": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"isAgile": {
|
"isAgile": {
|
||||||
@@ -888,6 +1070,37 @@
|
|||||||
"cannotAct": "cannot act this second",
|
"cannotAct": "cannot act this second",
|
||||||
"diceResult": "Dice result",
|
"diceResult": "Dice result",
|
||||||
"progressionCount": "Progression count:"
|
"progressionCount": "Progression count:"
|
||||||
|
},
|
||||||
|
"Combat": {
|
||||||
|
"RollMonsters": "Roll Monsters",
|
||||||
|
"monstersNotRolledTitle": "Monsters Not Rolled",
|
||||||
|
"monstersNotRolledMsg": "Monsters have not rolled this second. Proceed anyway?",
|
||||||
|
"proceedYes": "Proceed",
|
||||||
|
"proceedNo": "Cancel",
|
||||||
|
"spellDRDialogTitle": "Spell Damage — Apply DR?",
|
||||||
|
"spellDRDialogMsg": "Enter a damage reduction value to subtract, or click No DR to apply full damage.",
|
||||||
|
"spellDRLabel": "DR:",
|
||||||
|
"spellNoDR": "No DR",
|
||||||
|
"spellApplyDR": "Apply DR"
|
||||||
|
},
|
||||||
|
"EquipmentCategories": {
|
||||||
|
"ClassKit": "Class Kit",
|
||||||
|
"Clothing": "Clothing",
|
||||||
|
"EssentialKit": "Essential Kit",
|
||||||
|
"FoodDrink": "Food & Drink",
|
||||||
|
"LandTransport": "Land Transport",
|
||||||
|
"Light": "Light",
|
||||||
|
"LoadBearing": "Load Bearing",
|
||||||
|
"Misc": "Miscellaneous",
|
||||||
|
"Mount": "Mount",
|
||||||
|
"Music": "Music",
|
||||||
|
"Sleeping": "Sleeping",
|
||||||
|
"WaterTransport": "Water Transport"
|
||||||
|
},
|
||||||
|
"DiceTray": {
|
||||||
|
"CountTitle": "Number of dice",
|
||||||
|
"ExplodeTitle": "Exploding dice — re-roll on maximum value",
|
||||||
|
"ChatTitle": "Free Roll"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"TYPES": {
|
"TYPES": {
|
||||||
|
|||||||
+1083
-274
File diff suppressed because it is too large
Load Diff
@@ -9,4 +9,5 @@ export { default as LethalFantasySpellSheet } from "./sheets/spell-sheet.mjs"
|
|||||||
export { default as LethalFantasyEquipmentSheet } from "./sheets/equipment-sheet.mjs"
|
export { default as LethalFantasyEquipmentSheet } from "./sheets/equipment-sheet.mjs"
|
||||||
export { default as LethalFantasyShieldSheet } from "./sheets/shield-sheet.mjs"
|
export { default as LethalFantasyShieldSheet } from "./sheets/shield-sheet.mjs"
|
||||||
export { default as LethalFantasyMiracleSheet } from "./sheets/miracle-sheet.mjs"
|
export { default as LethalFantasyMiracleSheet } from "./sheets/miracle-sheet.mjs"
|
||||||
|
export { injectDiceTray } from "./free-roll.mjs"
|
||||||
|
|
||||||
|
|||||||
@@ -18,62 +18,44 @@ export class LethalFantasyCombatTracker extends foundry.applications.sidebar.tab
|
|||||||
actions: {
|
actions: {
|
||||||
initiativePlus: LethalFantasyCombatTracker.#initiativePlus,
|
initiativePlus: LethalFantasyCombatTracker.#initiativePlus,
|
||||||
initiativeMinus: LethalFantasyCombatTracker.#initiativeMinus,
|
initiativeMinus: LethalFantasyCombatTracker.#initiativeMinus,
|
||||||
|
rollMonsterProgression: LethalFantasyCombatTracker.#rollMonsterProgression,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
async _prepareContext(options) {
|
async _prepareContext(options) {
|
||||||
let data = await super._prepareContext(options);
|
let data = await super._prepareContext(options);
|
||||||
console?.log("Combat Tracker Data", data);
|
log("Combat Tracker Data", data);
|
||||||
/*for (let u of data.turns) {
|
/*for (let u of data.turns) {
|
||||||
let c = game.combat.combatants.get(u.id);
|
let c = game.combat.combatants.get(u.id);
|
||||||
u.progressionCount = c.system.progressionCount
|
u.progressionCount = c.system.progressionCount
|
||||||
u.isMonster = c.actor.type === "monster"
|
u.isMonster = c.actor.type === "monster"
|
||||||
}
|
}
|
||||||
console.log("Combat Data", data);*/
|
log("Combat Data", data);*/
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static #initiativePlus(ev) {
|
static async #initiativePlus(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
let cId = ev.target.closest(".combatant").dataset.combatantId;
|
let cId = ev.target.closest(".combatant").dataset.combatantId;
|
||||||
let c = game.combat.combatants.get(cId);
|
let c = game.combat.combatants.get(cId);
|
||||||
c.update({ 'initiative': c.initiative + 1 });
|
await c.update({ 'initiative': c.initiative + 1 });
|
||||||
console.log("Initiative Plus");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static #initiativeMinus(ev) {
|
static async #initiativeMinus(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
let cId = ev.target.closest(".combatant").dataset.combatantId;
|
let cId = ev.target.closest(".combatant").dataset.combatantId;
|
||||||
let c = game.combat.combatants.get(cId);
|
let c = game.combat.combatants.get(cId);
|
||||||
let newInit = Math.max(c.initiative - 1, 0);
|
let newInit = Math.max(c.initiative - 1, 0);
|
||||||
c.update({ 'initiative': newInit });
|
await c.update({ 'initiative': newInit });
|
||||||
}
|
}
|
||||||
|
|
||||||
activateListeners(html) {
|
/**
|
||||||
super.activateListeners(html);
|
* Roll progression dice for all monster combatants that are eligible this round.
|
||||||
// Display Combat settings
|
* @param {Event} ev Click event.
|
||||||
html.find(".initiative-plus").click(ev => {
|
*/
|
||||||
ev.preventDefault();
|
static async #rollMonsterProgression(ev) {
|
||||||
let cId = ev.currentTarget.closest(".combatant").dataset.combatantId;
|
ev.preventDefault();
|
||||||
let c = game.combat.combatants.get(cId);
|
await game.combat.rollMonsterProgression();
|
||||||
c.update({ 'initiative': c.initiative + 1 });
|
|
||||||
});
|
|
||||||
|
|
||||||
html.find(".initiative-minus").click(ev => {
|
|
||||||
ev.preventDefault();
|
|
||||||
let cId = ev.currentTarget.closest(".combatant").dataset.combatantId;
|
|
||||||
let c = game.combat.combatants.get(cId);
|
|
||||||
c.update({ 'initiative': c.initiative - 1 });
|
|
||||||
console.log("Initiative Minus");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static get defaultOptions() {
|
|
||||||
let path = "systems/fvtt-lethal-fantasy/templates/combat-tracker.hbs";
|
|
||||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
|
||||||
template: path,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +66,7 @@ export class LethalFantasyCombat extends Combat {
|
|||||||
* @returns {Combatant[]}
|
* @returns {Combatant[]}
|
||||||
*/
|
*/
|
||||||
setupTurns() {
|
setupTurns() {
|
||||||
console?.log("Setup Turns....");
|
log("Setup Turns....");
|
||||||
this.turns ||= [];
|
this.turns ||= [];
|
||||||
|
|
||||||
// Determine the turn order and the current turn
|
// Determine the turn order and the current turn
|
||||||
@@ -100,42 +82,73 @@ export class LethalFantasyCombat extends Combat {
|
|||||||
return this.turns = turns;
|
return this.turns = turns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async startCombat() {
|
||||||
|
this._playCombatSound("startEncounter")
|
||||||
|
const updateData = { round: 0, turn: 0 }
|
||||||
|
Hooks.callAll("combatStart", this, updateData)
|
||||||
|
await this.update(updateData)
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
async rollInitiative(ids, options) {
|
async rollInitiative(ids, options) {
|
||||||
console.log("%%%%%%%%% Roll Initiative", ids, options);
|
|
||||||
|
|
||||||
ids = typeof ids === "string" ? [ids] : ids;
|
ids = typeof ids === "string" ? [ids] : ids;
|
||||||
let messages = [];
|
|
||||||
let rollMode = game.settings.get("core", "rollMode");
|
|
||||||
|
|
||||||
let updates = [];
|
|
||||||
for (let cId of ids) {
|
for (let cId of ids) {
|
||||||
const c = this.combatants.get(cId);
|
const c = this.combatants.get(cId);
|
||||||
let user = game.users.find(u => u.active && u.character && u.character.id === c.actor.id);
|
const playerOwner = game.users.find(u => u.active && !u.isGM && u.character?.id === c.actor.id);
|
||||||
if (user?.hasPlayerOwner) {
|
if (game.user.isGM && playerOwner) {
|
||||||
console.log("Rolling initiative for", c.actor.name);
|
game.socket.emit(`system.${SYSTEM.id}`, { type: "rollInitiative", userId: playerOwner.id, actorId: c.actor.id, combatId: this.id, combatantId: c.id });
|
||||||
game.socket.emit(`system.${SYSTEM.id}`, { type: "rollInitiative", actorId: c.actor.id, combatId: this.id, combatantId: c.id });
|
|
||||||
} else {
|
} else {
|
||||||
user = game.users.find(u => u.active && u.isGM);
|
await c.actor.system.rollInitiative(this.id, c.id);
|
||||||
c.actor.system.rollInitiative(this.id, c.id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
resetProgression(cId) {
|
/** Roll progression dice for all eligible monster combatants this round. Called manually by the GM. */
|
||||||
let c = this.combatants.get(cId);
|
async rollMonsterProgression() {
|
||||||
c.update({ 'system.progressionCount': 0 });
|
const currentRound = this.round;
|
||||||
|
const monsters = this.combatants.filter(c => c.actor?.type === "monster" && !c.isDefeated);
|
||||||
|
|
||||||
|
if (monsters.length === 0) {
|
||||||
|
ui.notifications.warn("No monsters in combat.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let rolled = 0;
|
||||||
|
for (let c of monsters) {
|
||||||
|
if (c.initiative !== null && currentRound >= c.initiative) {
|
||||||
|
await c.actor.system.rollProgressionDice(this.id, c.id);
|
||||||
|
rolled++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rolled === 0) {
|
||||||
|
const earliest = monsters.reduce((min, c) => (c.initiative !== null && c.initiative < min) ? c.initiative : min, Infinity);
|
||||||
|
if (earliest === Infinity) {
|
||||||
|
ui.notifications.warn("Monsters have no initiative set. Roll initiative first.");
|
||||||
|
} else {
|
||||||
|
ui.notifications.info(`No monsters act yet — earliest monster initiative is ${earliest} (current round: ${currentRound}).`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this._monsterProgressionRolledRound = currentRound;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setCasting(cId) {
|
async resetProgression(cId) {
|
||||||
let c = this.combatants.get(cId);
|
let c = this.combatants.get(cId);
|
||||||
c.setFlag(SYSTEM.id, "casting", true);
|
await c.update({ 'system.progressionCount': 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
resetCasting(cId) {
|
async setCasting(cId) {
|
||||||
let c = this.combatants.get(cId);
|
let c = this.combatants.get(cId);
|
||||||
c.setFlag(SYSTEM.id, "casting", false);
|
await c.setFlag(SYSTEM.id, "casting", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
async resetCasting(cId) {
|
||||||
|
let c = this.combatants.get(cId);
|
||||||
|
await c.setFlag(SYSTEM.id, "casting", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
isCasting(cId) {
|
isCasting(cId) {
|
||||||
@@ -144,15 +157,12 @@ export class LethalFantasyCombat extends Combat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async nextTurn() {
|
async nextTurn() {
|
||||||
console.log("NEXT TURN");
|
|
||||||
|
|
||||||
let turn = this.turn ?? -1;
|
let turn = this.turn ?? -1;
|
||||||
let skipDefeated = this.settings.skipDefeated;
|
let skipDefeated = this.settings.skipDefeated;
|
||||||
|
|
||||||
// Determine the next turn number
|
// Determine the next turn number
|
||||||
let next = null;
|
let next = null;
|
||||||
for (let [i, t] of this.turns.entries()) {
|
for (let [i, t] of this.turns.entries()) {
|
||||||
console.log("Turn", t);
|
|
||||||
if (i <= turn) continue;
|
if (i <= turn) continue;
|
||||||
if (skipDefeated && t.isDefeated) continue;
|
if (skipDefeated && t.isDefeated) continue;
|
||||||
next = i;
|
next = i;
|
||||||
@@ -176,7 +186,6 @@ export class LethalFantasyCombat extends Combat {
|
|||||||
this.turnsDone = false
|
this.turnsDone = false
|
||||||
|
|
||||||
let turn = this.turn === null ? null : 0; // Preserve the fact that it's no-one's turn currently.
|
let turn = this.turn === null ? null : 0; // Preserve the fact that it's no-one's turn currently.
|
||||||
console.log("ROUND", this);
|
|
||||||
|
|
||||||
let advanceTime = Math.max(this.turns.length - this.turn, 0) * CONFIG.time.turnTime;
|
let advanceTime = Math.max(this.turns.length - this.turn, 0) * CONFIG.time.turnTime;
|
||||||
advanceTime += CONFIG.time.roundTime;
|
advanceTime += CONFIG.time.roundTime;
|
||||||
@@ -194,14 +203,29 @@ export class LethalFantasyCombat extends Combat {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Warn if eligible monsters have not rolled progression dice this round
|
||||||
|
const eligibleMonsters = this.combatants.filter(
|
||||||
|
c => c.actor?.type === "monster" && !c.isDefeated && c.initiative !== null && this.round >= c.initiative
|
||||||
|
);
|
||||||
|
if (eligibleMonsters.length > 0 && this._monsterProgressionRolledRound !== this.round) {
|
||||||
|
const proceed = await foundry.applications.api.DialogV2.confirm({
|
||||||
|
window: { title: game.i18n.localize("LETHALFANTASY.Combat.monstersNotRolledTitle") },
|
||||||
|
content: `<p>${game.i18n.localize("LETHALFANTASY.Combat.monstersNotRolledMsg")}</p>`,
|
||||||
|
yes: { label: game.i18n.localize("LETHALFANTASY.Combat.proceedYes") },
|
||||||
|
no: { label: game.i18n.localize("LETHALFANTASY.Combat.proceedNo") },
|
||||||
|
rejectClose: false,
|
||||||
|
});
|
||||||
|
if (!proceed) return this;
|
||||||
|
}
|
||||||
|
|
||||||
for (let c of this.combatants) {
|
for (let c of this.combatants) {
|
||||||
if (nextRound >= c.initiative) {
|
if (nextRound >= c.initiative) {
|
||||||
let user = game.users.find(u => u.active && u.character && u.character.id === c.actor.id);
|
if (c.actor.type === "monster") continue; // Monsters roll manually via the "Roll Monsters" button
|
||||||
if (user?.hasPlayerOwner) {
|
const playerOwner = game.users.find(u => u.active && !u.isGM && u.character?.id === c.actor.id);
|
||||||
game.socket.emit(`system.${SYSTEM.id}`, { type: "rollProgressionDice", progressionCount: c.system.progressionCount + 1, actorId: c.actor.id, combatId: this.id, combatantId: c.id });
|
if (game.user.isGM && playerOwner) {
|
||||||
|
game.socket.emit(`system.${SYSTEM.id}`, { type: "rollProgressionDice", userId: playerOwner.id, progressionCount: c.system.progressionCount + 1, actorId: c.actor.id, combatId: this.id, combatantId: c.id });
|
||||||
} else {
|
} else {
|
||||||
user = game.users.find(u => u.active && u.isGM);
|
await c.actor.system.rollProgressionDice(this.id, c.id);
|
||||||
c.actor.system.rollProgressionDice(this.id, c.id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,155 @@
|
|||||||
|
/**
|
||||||
|
* Free Dice Tray — injected into the Foundry chat sidebar.
|
||||||
|
*
|
||||||
|
* Provides a compact bar for GM and players to roll any standard die (d4–d30)
|
||||||
|
* or its exploding variant (dXx) without needing an actor sheet.
|
||||||
|
* Supports selecting how many dice to roll (1–9).
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Standard dice available in Lethal Fantasy */
|
||||||
|
const DICE_TYPES = ["d4", "d6", "d8", "d10", "d12", "d20", "d30"]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inject the dice tray bar into the ChatLog HTML.
|
||||||
|
* Called from `Hooks.on("renderChatLog", ...)`.
|
||||||
|
*
|
||||||
|
* @param {Application} _chatLog
|
||||||
|
* @param {HTMLElement|jQuery} html
|
||||||
|
*/
|
||||||
|
export function injectDiceTray(_chatLog, html) {
|
||||||
|
const el = (html instanceof HTMLElement) ? html : (html[0] ?? html)
|
||||||
|
if (!el?.querySelector) return
|
||||||
|
if (el.querySelector(".lf-dice-tray")) return
|
||||||
|
|
||||||
|
const bar = document.createElement("div")
|
||||||
|
bar.className = "lf-dice-tray"
|
||||||
|
|
||||||
|
const diceButtons = DICE_TYPES.map(d =>
|
||||||
|
`<button type="button" class="lf-dt-die-btn" data-die="${d}" title="${d.toUpperCase()}">${d.toUpperCase()}</button>`
|
||||||
|
).join("")
|
||||||
|
|
||||||
|
const countOptions = Array.from({ length: 9 }, (_, i) =>
|
||||||
|
`<option value="${i + 1}">${i + 1}</option>`
|
||||||
|
).join("")
|
||||||
|
|
||||||
|
bar.innerHTML = `
|
||||||
|
<div class="lf-dt-row">
|
||||||
|
<span class="lf-dt-label"><i class="fa-solid fa-dice"></i></span>
|
||||||
|
<select class="lf-dt-count" title="${game.i18n.localize("LETHALFANTASY.DiceTray.CountTitle")}">
|
||||||
|
${countOptions}
|
||||||
|
</select>
|
||||||
|
<div class="lf-dt-dice">${diceButtons}</div>
|
||||||
|
<label class="lf-dt-explode-label" title="${game.i18n.localize("LETHALFANTASY.DiceTray.ExplodeTitle")}">
|
||||||
|
<input type="checkbox" class="lf-dt-explode" />
|
||||||
|
<i class="fa-solid fa-explosion"></i>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
|
||||||
|
bar.addEventListener("click", async ev => {
|
||||||
|
const btn = ev.target.closest(".lf-dt-die-btn")
|
||||||
|
if (!btn) return
|
||||||
|
ev.stopPropagation()
|
||||||
|
|
||||||
|
const dieType = btn.dataset.die
|
||||||
|
const count = parseInt(bar.querySelector(".lf-dt-count").value) || 1
|
||||||
|
const explode = bar.querySelector(".lf-dt-explode").checked
|
||||||
|
|
||||||
|
try {
|
||||||
|
await rollFreeDie(dieType, count, explode)
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Lethal Fantasy | Dice Tray error:", err)
|
||||||
|
ui.notifications?.error("Dice Tray roll failed — see console")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const anchor = el.querySelector(".chat-form")
|
||||||
|
?? el.querySelector(".chat-message-form")
|
||||||
|
?? el.querySelector("form")
|
||||||
|
if (anchor) {
|
||||||
|
anchor.parentElement.insertBefore(bar, anchor)
|
||||||
|
} else {
|
||||||
|
el.appendChild(bar)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll one or more dice of the given type and post the result to chat.
|
||||||
|
* For exploding dice, follows the Lethal Fantasy rule: each exploded reroll
|
||||||
|
* contributes (result − 1) to the total, same as all other system rolls.
|
||||||
|
*
|
||||||
|
* @param {string} dieType Die face, e.g. "d20"
|
||||||
|
* @param {number} count Number of dice to roll (1–9)
|
||||||
|
* @param {boolean} explode Whether to use the exploding variant (max triggers reroll at −1)
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
export async function rollFreeDie(dieType, count = 1, explode = false) {
|
||||||
|
const sides = parseInt(dieType.replace("d", "")) || 20
|
||||||
|
const baseFormula = `1d${sides}`
|
||||||
|
const label = explode
|
||||||
|
? `${count}${dieType.toUpperCase()}E`
|
||||||
|
: `${count}${dieType.toUpperCase()}`
|
||||||
|
|
||||||
|
const dieLabel = dieType.toUpperCase()
|
||||||
|
const dieChips = []
|
||||||
|
let total = 0
|
||||||
|
|
||||||
|
for (let i = 0; i < count; i++) {
|
||||||
|
const r0 = await new Roll(baseFormula).evaluate()
|
||||||
|
if (game?.dice3d) await game.dice3d.showForRoll(r0, game.user, true)
|
||||||
|
let diceResult = r0.dice[0].results[0].result
|
||||||
|
dieChips.push({ label: dieLabel, value: diceResult, exploded: false })
|
||||||
|
total += diceResult
|
||||||
|
|
||||||
|
if (explode) {
|
||||||
|
while (diceResult === sides) {
|
||||||
|
const rx = await new Roll(baseFormula).evaluate()
|
||||||
|
if (game?.dice3d) await game.dice3d.showForRoll(rx, game.user, true)
|
||||||
|
diceResult = rx.dice[0].results[0].result
|
||||||
|
const contrib = diceResult - 1
|
||||||
|
dieChips.push({ label: `${dieLabel}-1`, value: contrib, exploded: true })
|
||||||
|
total += contrib
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const resultHtml = dieChips.map(chip => {
|
||||||
|
const isMax = !chip.exploded && chip.value === sides
|
||||||
|
const isMin = chip.value === 1
|
||||||
|
const explodeIcon = chip.exploded ? `<i class="fa-solid fa-burst lf-dt-explode-icon"></i>` : ""
|
||||||
|
const classes = ["lf-frc-die-chip", isMax ? "lf-frc-max" : "", isMin ? "lf-frc-min" : ""].filter(Boolean).join(" ")
|
||||||
|
return `<div class="${classes}">
|
||||||
|
<span class="lf-frc-die-type">${chip.label}</span>
|
||||||
|
<span class="lf-frc-die-sep">→</span>
|
||||||
|
<span class="lf-frc-die-val">${chip.value}${explodeIcon}</span>
|
||||||
|
</div>`
|
||||||
|
}).join("")
|
||||||
|
|
||||||
|
const totalLabel = game.i18n.localize("LETHALFANTASY.Label.total").toUpperCase()
|
||||||
|
const content = `
|
||||||
|
<div class="lf-free-roll-card">
|
||||||
|
<div class="lf-frc-header">
|
||||||
|
<i class="fa-solid fa-dice"></i>
|
||||||
|
<span class="lf-frc-title-text">${game.i18n.localize("LETHALFANTASY.DiceTray.ChatTitle")}</span>
|
||||||
|
<span class="lf-frc-badge">${label}</span>
|
||||||
|
</div>
|
||||||
|
<div class="lf-frc-dice">${resultHtml}</div>
|
||||||
|
<div class="lf-frc-total-bar">
|
||||||
|
<span class="lf-frc-total-label">${totalLabel}</span>
|
||||||
|
<span class="lf-frc-total-value">${total}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
|
||||||
|
const rollMode = game.settings.get("core", "rollMode")
|
||||||
|
// Normalize old-style rollMode keys (v12/v13) to new-style (v14), fallback to "public"
|
||||||
|
const modeMap = { publicroll: "public", gmroll: "gm", blindroll: "blind", selfroll: "self" }
|
||||||
|
const mode = modeMap[rollMode] ?? rollMode ?? "public"
|
||||||
|
const msgData = {
|
||||||
|
speaker: ChatMessage.getSpeaker(),
|
||||||
|
content,
|
||||||
|
sound: CONFIG.sounds.dice,
|
||||||
|
mode,
|
||||||
|
}
|
||||||
|
await ChatMessage.create(msgData)
|
||||||
|
}
|
||||||
@@ -78,7 +78,6 @@ export default class LethalFantasyActorSheet extends HandlebarsApplicationMixin(
|
|||||||
/** @override */
|
/** @override */
|
||||||
_onRender(context, options) {
|
_onRender(context, options) {
|
||||||
this.#dragDrop.forEach((d) => d.bind(this.element))
|
this.#dragDrop.forEach((d) => d.bind(this.element))
|
||||||
// Add listeners to rollable elements
|
|
||||||
const rollables = this.element.querySelectorAll(".rollable")
|
const rollables = this.element.querySelectorAll(".rollable")
|
||||||
rollables.forEach((d) => d.addEventListener("click", this._onRoll.bind(this)))
|
rollables.forEach((d) => d.addEventListener("click", this._onRoll.bind(this)))
|
||||||
}
|
}
|
||||||
@@ -234,12 +233,12 @@ export default class LethalFantasyActorSheet extends HandlebarsApplicationMixin(
|
|||||||
const attr = target.dataset.edit
|
const attr = target.dataset.edit
|
||||||
const current = foundry.utils.getProperty(this.document, attr)
|
const current = foundry.utils.getProperty(this.document, attr)
|
||||||
const { img } = this.document.constructor.getDefaultArtwork?.(this.document.toObject()) ?? {}
|
const { img } = this.document.constructor.getDefaultArtwork?.(this.document.toObject()) ?? {}
|
||||||
const fp = new FilePicker({
|
const fp = new foundry.applications.ux.FilePicker.implementation({
|
||||||
current,
|
current,
|
||||||
type: "image",
|
type: "image",
|
||||||
redirectToRoot: img ? [img] : [],
|
redirectToRoot: img ? [img] : [],
|
||||||
callback: (path) => {
|
callback: async (path) => {
|
||||||
this.document.update({ [attr]: path })
|
await this.document.update({ [attr]: path })
|
||||||
},
|
},
|
||||||
top: this.position.top + 40,
|
top: this.position.top + 40,
|
||||||
left: this.position.left + 10,
|
left: this.position.left + 10,
|
||||||
@@ -261,7 +260,7 @@ export default class LethalFantasyActorSheet extends HandlebarsApplicationMixin(
|
|||||||
item = await fromUuid(uuid)
|
item = await fromUuid(uuid)
|
||||||
if (!item) item = this.document.items.get(id)
|
if (!item) item = this.document.items.get(id)
|
||||||
if (!item) return
|
if (!item) return
|
||||||
item.sheet.render(true)
|
item.sheet.render({ force: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -284,8 +283,8 @@ export default class LethalFantasyActorSheet extends HandlebarsApplicationMixin(
|
|||||||
* @private
|
* @private
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
static #onCreateSpell(event, target) {
|
static async #onCreateSpell(event, target) {
|
||||||
const item = this.document.createEmbeddedDocuments("Item", [{ name: "Nouveau sortilège", type: "spell" }])
|
await this.document.createEmbeddedDocuments("Item", [{ name: "Nouveau sortilège", type: "spell" }])
|
||||||
}
|
}
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|||||||
@@ -177,12 +177,12 @@ export default class LethalFantasyItemSheet extends HandlebarsApplicationMixin(f
|
|||||||
const attr = target.dataset.edit
|
const attr = target.dataset.edit
|
||||||
const current = foundry.utils.getProperty(this.document, attr)
|
const current = foundry.utils.getProperty(this.document, attr)
|
||||||
const { img } = this.document.constructor.getDefaultArtwork?.(this.document.toObject()) ?? {}
|
const { img } = this.document.constructor.getDefaultArtwork?.(this.document.toObject()) ?? {}
|
||||||
const fp = new FilePicker({
|
const fp = new foundry.applications.ux.FilePicker.implementation({
|
||||||
current,
|
current,
|
||||||
type: "image",
|
type: "image",
|
||||||
redirectToRoot: img ? [img] : [],
|
redirectToRoot: img ? [img] : [],
|
||||||
callback: (path) => {
|
callback: async (path) => {
|
||||||
this.document.update({ [attr]: path })
|
await this.document.update({ [attr]: path })
|
||||||
},
|
},
|
||||||
top: this.position.top + 40,
|
top: this.position.top + 40,
|
||||||
left: this.position.left + 10,
|
left: this.position.left + 10,
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
|||||||
divinityPointsMinus: LethalFantasyCharacterSheet.#onDivinityPointsMinus,
|
divinityPointsMinus: LethalFantasyCharacterSheet.#onDivinityPointsMinus,
|
||||||
aetherPointsPlus: LethalFantasyCharacterSheet.#onAetherPointsPlus,
|
aetherPointsPlus: LethalFantasyCharacterSheet.#onAetherPointsPlus,
|
||||||
aetherPointsMinus: LethalFantasyCharacterSheet.#onAetherPointsMinus,
|
aetherPointsMinus: LethalFantasyCharacterSheet.#onAetherPointsMinus,
|
||||||
|
rollSpellDamage: LethalFantasyCharacterSheet.#onRollSpellDamage,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,10 +71,10 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
|||||||
biography: { id: "biography", group: "sheet", icon: "fa-solid fa-book", label: "LETHALFANTASY.Label.biography" },
|
biography: { id: "biography", group: "sheet", icon: "fa-solid fa-book", label: "LETHALFANTASY.Label.biography" },
|
||||||
}
|
}
|
||||||
if (this.actor.system.biodata.magicUser) {
|
if (this.actor.system.biodata.magicUser) {
|
||||||
tabs.spells = { id: "spells", group: "sheet", icon: "fa-sharp-duotone fa-solid fa-wand-magic-sparkles", label: "LETHALFANTASY.Label.spells" }
|
tabs.spells = { id: "spells", group: "sheet", icon: "fa-solid fa-wand-magic-sparkles", label: "LETHALFANTASY.Label.spells" }
|
||||||
}
|
}
|
||||||
if (this.actor.system.biodata.clericUser) {
|
if (this.actor.system.biodata.clericUser) {
|
||||||
tabs.miracles = { id: "miracles", group: "sheet", icon: "fa-sharp-duotone fa-solid fa-hands-praying", label: "LETHALFANTASY.Label.miracles" }
|
tabs.miracles = { id: "miracles", group: "sheet", icon: "fa-solid fa-hands-praying", label: "LETHALFANTASY.Label.miracles" }
|
||||||
}
|
}
|
||||||
for (const v of Object.values(tabs)) {
|
for (const v of Object.values(tabs)) {
|
||||||
v.active = this.tabGroups[v.group] === v.id
|
v.active = this.tabGroups[v.group] === v.id
|
||||||
@@ -172,61 +173,132 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
|||||||
})
|
})
|
||||||
if (!roll) return null
|
if (!roll) return null
|
||||||
|
|
||||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
await roll.toMessage({}, { messageMode: roll.options.rollMode })
|
||||||
}
|
}
|
||||||
|
|
||||||
static async #onRollInitiative(event, target) {
|
static async #onRollInitiative(event, target) {
|
||||||
await this.document.system.rollInitiative()
|
await this.document.system.rollInitiative()
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onArmorHitPointsPlus(event, target) {
|
static async #onArmorHitPointsPlus(event, target) {
|
||||||
let armorHP = this.actor.system.combat.armorHitPoints
|
let armorHP = this.actor.system.combat.armorHitPoints
|
||||||
armorHP += 1
|
armorHP += 1
|
||||||
this.actor.update({ "system.combat.armorHitPoints": armorHP })
|
await this.actor.update({ "system.combat.armorHitPoints": armorHP })
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onArmorHitPointsMinus(event, target) {
|
static async #onArmorHitPointsMinus(event, target) {
|
||||||
let armorHP = this.actor.system.combat.armorHitPoints
|
let armorHP = this.actor.system.combat.armorHitPoints
|
||||||
armorHP -= 1
|
armorHP -= 1
|
||||||
this.actor.update({ "system.combat.armorHitPoints": Math.max(armorHP, 0) })
|
await this.actor.update({ "system.combat.armorHitPoints": Math.max(armorHP, 0) })
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onDivinityPointsPlus(event, target) {
|
static async #onDivinityPointsPlus(event, target) {
|
||||||
let points = this.actor.system.divinityPoints.value
|
let points = this.actor.system.divinityPoints.value
|
||||||
points += 1
|
points += 1
|
||||||
points = Math.min(points, this.actor.system.divinityPoints.max)
|
points = Math.min(points, this.actor.system.divinityPoints.max)
|
||||||
this.actor.update({ "system.divinityPoints.value": points })
|
await this.actor.update({ "system.divinityPoints.value": points })
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onDivinityPointsMinus(event, target) {
|
static async #onDivinityPointsMinus(event, target) {
|
||||||
let points = this.actor.system.divinityPoints.value
|
let points = this.actor.system.divinityPoints.value
|
||||||
points -= 1
|
points -= 1
|
||||||
points = Math.max(points, 0)
|
points = Math.max(points, 0)
|
||||||
this.actor.update({ "system.divinityPoints.value": points })
|
await this.actor.update({ "system.divinityPoints.value": points })
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onAetherPointsPlus(event, target) {
|
static async #onAetherPointsPlus(event, target) {
|
||||||
let points = this.actor.system.aetherPoints.value
|
let points = this.actor.system.aetherPoints.value
|
||||||
points += 1
|
points += 1
|
||||||
points = Math.min(points, this.actor.system.aetherPoints.max)
|
points = Math.min(points, this.actor.system.aetherPoints.max)
|
||||||
this.actor.update({ "system.aetherPoints.value": points })
|
await this.actor.update({ "system.aetherPoints.value": points })
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onAetherPointsMinus(event, target) {
|
static async #onAetherPointsMinus(event, target) {
|
||||||
let points = this.actor.system.aetherPoints.value
|
let points = this.actor.system.aetherPoints.value
|
||||||
points -= 1
|
points -= 1
|
||||||
points = Math.max(points, 0)
|
points = Math.max(points, 0)
|
||||||
this.actor.update({ "system.aetherPoints.value": points })
|
await this.actor.update({ "system.aetherPoints.value": points })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles spell damage roll from the spell sheet tab.
|
||||||
|
* Shows a DR dialog then rolls the appropriate damage formula.
|
||||||
|
* @param {PointerEvent} event
|
||||||
|
* @param {HTMLElement} target
|
||||||
|
*/
|
||||||
|
static async #onRollSpellDamage(event, target) {
|
||||||
|
if (this.isEditMode) return
|
||||||
|
const itemId = target.dataset.itemId
|
||||||
|
const tier = target.dataset.damageTier
|
||||||
|
const spell = this.actor.items.get(itemId)
|
||||||
|
if (!spell) return
|
||||||
|
|
||||||
|
const formulaMap = {
|
||||||
|
standard: spell.system.damageDice,
|
||||||
|
overpowered: spell.system.damageDiceOverpowered,
|
||||||
|
overpowered2: spell.system.damageDiceOverpowered2,
|
||||||
|
}
|
||||||
|
const formula = formulaMap[tier]
|
||||||
|
if (!formula) return
|
||||||
|
|
||||||
|
const manualDR = await foundry.applications.api.DialogV2.wait({
|
||||||
|
window: { title: game.i18n.localize("LETHALFANTASY.Combat.spellDRDialogTitle") },
|
||||||
|
classes: ["lethalfantasy"],
|
||||||
|
position: { width: 320 },
|
||||||
|
content: `<div style="padding:0.5rem 0">
|
||||||
|
<p style="margin-bottom:0.6rem">${game.i18n.localize("LETHALFANTASY.Combat.spellDRDialogMsg")}</p>
|
||||||
|
<div style="display:flex;align-items:center;gap:0.5rem">
|
||||||
|
<label style="font-weight:bold">${game.i18n.localize("LETHALFANTASY.Combat.spellDRLabel")}</label>
|
||||||
|
<input type="number" name="manualDr" value="0" min="0" style="width:5rem"/>
|
||||||
|
</div>
|
||||||
|
</div>`,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
action: "noDR",
|
||||||
|
type: "button",
|
||||||
|
label: game.i18n.localize("LETHALFANTASY.Combat.spellNoDR"),
|
||||||
|
icon: "fa-solid fa-wand-magic-sparkles",
|
||||||
|
callback: () => 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: "applyDR",
|
||||||
|
type: "button",
|
||||||
|
label: game.i18n.localize("LETHALFANTASY.Combat.spellApplyDR"),
|
||||||
|
icon: "fa-solid fa-shield",
|
||||||
|
callback: (event, button) => Number(button.form?.elements?.manualDr?.value) || 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: "cancel",
|
||||||
|
type: "button",
|
||||||
|
label: game.i18n.localize("LETHALFANTASY.Combat.proceedNo"),
|
||||||
|
callback: () => "cancel"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
rejectClose: false
|
||||||
|
})
|
||||||
|
if (manualDR === null || manualDR === "cancel") return
|
||||||
|
|
||||||
|
const rollOpts = {
|
||||||
|
type: "spell-damage",
|
||||||
|
rollType: "spell-damage",
|
||||||
|
rollName: `${spell.name} — ${formula}`,
|
||||||
|
isDamage: true,
|
||||||
|
rollData: { isDamage: true },
|
||||||
|
manualDR,
|
||||||
|
actorId: this.actor.id,
|
||||||
|
actorName: this.actor.name,
|
||||||
|
actorImage: this.actor.img
|
||||||
|
}
|
||||||
|
await LethalFantasyRoll.rollSpellDamageToMessage(formula, rollOpts)
|
||||||
}
|
}
|
||||||
|
|
||||||
static #onCreateEquipment(event, target) {
|
static #onCreateEquipment(event, target) {
|
||||||
}
|
}
|
||||||
|
|
||||||
_onRender(context, options) {
|
_onRender(context, options) {
|
||||||
// Inputs with class `item-quantity`
|
|
||||||
const woundDescription = this.element.querySelectorAll('.wound-data')
|
const woundDescription = this.element.querySelectorAll('.wound-data')
|
||||||
for (const input of woundDescription) {
|
for (const input of woundDescription) {
|
||||||
input.addEventListener("change", (e) => {
|
input.addEventListener("change", async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
const newValue = e.currentTarget.value
|
const newValue = e.currentTarget.value
|
||||||
@@ -234,11 +306,11 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
|||||||
const fieldName = e.currentTarget.dataset.name
|
const fieldName = e.currentTarget.dataset.name
|
||||||
let tab = foundry.utils.duplicate(this.actor.system.hp.wounds)
|
let tab = foundry.utils.duplicate(this.actor.system.hp.wounds)
|
||||||
tab[index][fieldName] = newValue
|
tab[index][fieldName] = newValue
|
||||||
console.log(tab, index, fieldName, newValue)
|
log(tab, index, fieldName, newValue)
|
||||||
this.actor.update({ "system.hp.wounds": tab });
|
await this.actor.update({ "system.hp.wounds": tab });
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
super._onRender();
|
super._onRender(context, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -259,9 +331,11 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
|||||||
|
|
||||||
async _onRoll(event, target) {
|
async _onRoll(event, target) {
|
||||||
if (this.isEditMode) return
|
if (this.isEditMode) return
|
||||||
const rollType = event.target.dataset.rollType
|
const el = event.currentTarget
|
||||||
let rollKey = event.target.dataset.rollKey;
|
const rollType = el.dataset.rollType
|
||||||
let rollDice = event.target.dataset?.rollDice;
|
if (!rollType) return
|
||||||
|
let rollKey = el.dataset.rollKey
|
||||||
|
let rollDice = el.dataset.rollDice
|
||||||
|
|
||||||
this.actor.prepareRoll(rollType, rollKey, rollDice)
|
this.actor.prepareRoll(rollType, rollKey, rollDice)
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export default class LethalFantasyMonsterSheet extends LethalFantasyActorSheet {
|
|||||||
*/
|
*/
|
||||||
async _onDrop(event) {
|
async _onDrop(event) {
|
||||||
if (!this.isEditable || !this.isEditMode) return
|
if (!this.isEditable || !this.isEditMode) return
|
||||||
const data = TextEditor.getDragEventData(event)
|
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event)
|
||||||
|
|
||||||
// Handle different data types
|
// Handle different data types
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
@@ -111,11 +111,13 @@ export default class LethalFantasyMonsterSheet extends LethalFantasyActorSheet {
|
|||||||
})
|
})
|
||||||
if (!roll) return null
|
if (!roll) return null
|
||||||
|
|
||||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
await roll.toMessage({}, { messageMode: roll.options.rollMode })
|
||||||
}
|
}
|
||||||
|
|
||||||
static async #onRollInitiative(event, target) {
|
static async #onRollInitiative(event, target) {
|
||||||
await this.document.system.rollInitiative(event, target)
|
const combat = game.combat
|
||||||
|
const combatant = combat?.combatants.find(c => c.actorId === this.document.id)
|
||||||
|
await this.document.system.rollInitiative(combat?.id, combatant?.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
getBestWeaponClassSkill(skills, rollType, multiplier = 1.0) {
|
getBestWeaponClassSkill(skills, rollType, multiplier = 1.0) {
|
||||||
|
|||||||
@@ -1,152 +1,673 @@
|
|||||||
{
|
{
|
||||||
"d30_dice_results": {
|
"d30_dice_results": {
|
||||||
"30": {
|
"30": {
|
||||||
"melee_attack": "Possible Lethal or Vital Strike or Add D20E to Attack",
|
"melee_attack": {
|
||||||
"ranged_attack": "Possible Lethal or Vital Strike or Add D20E to Attack",
|
"type": "choice",
|
||||||
"melee_defense": "Possible Flawless or Legendary Defense or Add D20E to Defense",
|
"choices": [
|
||||||
"arcane_spell_attack": "Possible Lethal or Vital Magical Strike or Add D20E to Spell Attack",
|
{
|
||||||
"arcane_spell_defense": "Possible Spell Catastrophe or adds D20E to Spell Defense",
|
"type": "special_strike",
|
||||||
"skill_rolls": "Skill Succeeds Regardless of Opposing Roll / Success at highest level / Matching 30s cancel each other out"
|
"options": [
|
||||||
|
"lethal",
|
||||||
|
"vital"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "attack"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Possible Lethal or Vital Strike or Add D20E to Attack"
|
||||||
|
},
|
||||||
|
"ranged_attack": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "special_strike",
|
||||||
|
"options": [
|
||||||
|
"lethal",
|
||||||
|
"vital"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "attack"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Possible Lethal or Vital Strike or Add D20E to Attack"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "special_defense",
|
||||||
|
"options": [
|
||||||
|
"flawless",
|
||||||
|
"legendary"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "defense"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Possible Flawless or Legendary Defense or Add D20E to Defense"
|
||||||
|
},
|
||||||
|
"arcane_spell_attack": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "special_strike",
|
||||||
|
"options": [
|
||||||
|
"lethal_magical",
|
||||||
|
"vital_magical"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "spell_attack"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Possible Lethal or Vital Magical Strike or Add D20E to Spell Attack"
|
||||||
|
},
|
||||||
|
"arcane_spell_defense": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "spell_calamity"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "spell_defense"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Possible Spell Catastrophe or adds D20E to Spell Defense"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "skill_auto_success",
|
||||||
|
"description": "Skill Succeeds Regardless of Opposing Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "special_defense",
|
||||||
|
"options": [
|
||||||
|
"flawless",
|
||||||
|
"legendary"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D20E",
|
||||||
|
"target": "defense"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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": {
|
"29": {
|
||||||
"melee_attack": "Gain 1 Grit",
|
"melee_attack": {
|
||||||
"ranged_attack": "Gain 1 Grit",
|
"type": "gain_grit",
|
||||||
"melee_defense": "Gain 1 Grit",
|
"amount": 1,
|
||||||
"arcane_spell_attack": "Gain 1 Grit",
|
"description": "Gain 1 Grit"
|
||||||
"arcane_spell_defense": "Gain 1 Grit",
|
},
|
||||||
"skill_rolls": "Gain 1 Grit"
|
"ranged_attack": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
},
|
||||||
|
"arcane_spell_attack": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
},
|
||||||
|
"arcane_spell_defense": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
},
|
||||||
|
"saving_throws": {
|
||||||
|
"type": "gain_grit",
|
||||||
|
"amount": 1,
|
||||||
|
"description": "Gain 1 Grit"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"28": {
|
"28": {
|
||||||
"melee_attack": "Shield Destruction",
|
"melee_attack": {
|
||||||
"ranged_attack": "empty",
|
"type": "shield_destruction",
|
||||||
"melee_defense": "empty",
|
"description": "Shield Destruction"
|
||||||
"arcane_spell_attack": "empty",
|
}
|
||||||
"arcane_spell_defense": "empty",
|
|
||||||
"skill_rolls": "empty"
|
|
||||||
},
|
},
|
||||||
"27": {
|
"27": {
|
||||||
"melee_attack": "Granted D6 (1-6) Attack Modifier for This Melee Attack",
|
"melee_attack": {
|
||||||
"ranged_attack": "Granted D6 (1-6) Attack Modifier for This Ranged Attack",
|
"type": "bonus_dice",
|
||||||
"melee_defense": "Granted 1 Luck dice for Use in This Combat Only",
|
"dice": "D6",
|
||||||
"arcane_spell_attack": "No Spell Lethargy (the Aether Approves)",
|
"target": "attack",
|
||||||
"arcane_spell_defense": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds",
|
"description": "Granted D6 (1-6) Attack Modifier for This Melee Attack"
|
||||||
"skill_rolls": "Granted D6 (1-6) Skill Modifier for this Skill Attempt"
|
},
|
||||||
|
"ranged_attack": {
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D6",
|
||||||
|
"target": "attack",
|
||||||
|
"description": "Granted D6 (1-6) Attack Modifier for This Ranged Attack"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "luck_die",
|
||||||
|
"scope": "combat",
|
||||||
|
"description": "Granted 1 Luck dice for Use in This Combat Only"
|
||||||
|
},
|
||||||
|
"arcane_spell_attack": {
|
||||||
|
"type": "no_lethargy",
|
||||||
|
"description": "No Spell Lethargy the Aether Approves of Characters Efforts"
|
||||||
|
},
|
||||||
|
"arcane_spell_defense": {
|
||||||
|
"type": "flash_of_pain",
|
||||||
|
"duration_dice": "1D6E",
|
||||||
|
"target": "caster",
|
||||||
|
"description": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "luck_die",
|
||||||
|
"scope": "combat",
|
||||||
|
"description": "Granted 1 Luck dice for Use in This Combat Only"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"26": {
|
"26": {
|
||||||
"melee_attack": "Shield Destruction",
|
"melee_attack": {
|
||||||
"ranged_attack": "empty",
|
"type": "shield_destruction",
|
||||||
"melee_defense": "empty",
|
"description": "Shield Destruction"
|
||||||
"arcane_spell_attack": "empty",
|
}
|
||||||
"arcane_spell_defense": "empty",
|
|
||||||
"skill_rolls": "empty"
|
|
||||||
},
|
},
|
||||||
"25": {
|
"25": {
|
||||||
"melee_attack": "Bleed, Knock-Back on Hit",
|
"skill_rolls": {
|
||||||
"ranged_attack": "Bleed",
|
"type": "bonus_flat",
|
||||||
"melee_defense": "Kick, Punch or Shield Bash",
|
"amount": 1,
|
||||||
"arcane_spell_attack": "empty",
|
"target": "skill",
|
||||||
"arcane_spell_defense": "empty",
|
"description": "Add 1 to Skill Roll"
|
||||||
"skill_rolls": "Add 1 to Skill Roll"
|
},
|
||||||
|
"saving_throws": {
|
||||||
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "save",
|
||||||
|
"description": "Add 1 to Saving Throw"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"21": {
|
"21": {
|
||||||
"melee_attack": "Hit Inflicts Flash of Pain 1D6E seconds",
|
"melee_attack": {
|
||||||
"ranged_attack": "Hit Inflicts Flash of Pain 1D6E seconds",
|
"type": "flash_of_pain",
|
||||||
"melee_defense": "Defender Recovers or ignores any flash of pain",
|
"duration_dice": "1D6E",
|
||||||
"arcane_spell_attack": "Magical Damage inflicts Flash of pain 1D6E seconds",
|
"target": "defender",
|
||||||
"arcane_spell_defense": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds",
|
"description": "Hit Inflicts Flash of Pain 1D6E seconds"
|
||||||
"skill_rolls": "empty"
|
},
|
||||||
|
"ranged_attack": {
|
||||||
|
"type": "flash_of_pain",
|
||||||
|
"duration_dice": "1D6E",
|
||||||
|
"target": "defender",
|
||||||
|
"description": "Hit Inflicts Flash of Pain 1D6E seconds"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "recover_pain",
|
||||||
|
"description": "Defender Recovers or ignores any flash of pain"
|
||||||
|
},
|
||||||
|
"arcane_spell_attack": {
|
||||||
|
"type": "flash_of_pain",
|
||||||
|
"duration_dice": "1D6E",
|
||||||
|
"target": "defender",
|
||||||
|
"description": "Magical Damage inflicts Flash of pain 1D6E seconds"
|
||||||
|
},
|
||||||
|
"arcane_spell_defense": {
|
||||||
|
"type": "flash_of_pain",
|
||||||
|
"duration_dice": "1D6E",
|
||||||
|
"target": "caster",
|
||||||
|
"description": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D6",
|
||||||
|
"target": "skill",
|
||||||
|
"description": "Granted D6 (1-6) Skill Modifier for this Skill Attempt"
|
||||||
|
},
|
||||||
|
"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": {
|
"20": {
|
||||||
"melee_attack": "Possible Vicious Strike. Bleed, Knock-back on Hit",
|
"melee_attack": {
|
||||||
"ranged_attack": "Possible Vicious Strike. Bleeding wound inflicted on hit.",
|
"type": "choice",
|
||||||
"melee_defense": "Possible 20/20 defense (avoids Any Attack Except a Lethal Strike). Grants a Kick, Punch or Shield Bash counter",
|
"choices": [
|
||||||
"arcane_spell_attack": "Possible Vicious Application of a Magical Attack",
|
{
|
||||||
"arcane_spell_defense": "Possible 20/20 Spell defense (Saves Against Any Magical Attack Except a Lethal Magical Strike)",
|
"type": "special_strike",
|
||||||
"skill_rolls": "20 Added to Skill Roll"
|
"options": [
|
||||||
|
"vicious"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "attack"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Possible Vicious Strike or Add D12 to attack"
|
||||||
|
},
|
||||||
|
"ranged_attack": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "special_strike",
|
||||||
|
"options": [
|
||||||
|
"vicious"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "attack"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Possible Vicious Strike or add D12 to attack"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "special_defense",
|
||||||
|
"options": [
|
||||||
|
"perfect"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "defense"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Possible 20/20 defense that avoids Any Attack Except a Lethal Strike or adds D12 to defense"
|
||||||
|
},
|
||||||
|
"arcane_spell_attack": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "special_strike",
|
||||||
|
"options": [
|
||||||
|
"vicious_magical"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "spell_attack"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Possible Vicious Application of a Magical Attack or add D12 to attack"
|
||||||
|
},
|
||||||
|
"arcane_spell_defense": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "special_defense",
|
||||||
|
"options": [
|
||||||
|
"perfect_spell"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "spell_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",
|
||||||
|
"amount": 20,
|
||||||
|
"target": "skill",
|
||||||
|
"description": "20 Added to Skill Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "choice",
|
||||||
|
"choices": [
|
||||||
|
{
|
||||||
|
"type": "special_defense",
|
||||||
|
"options": [
|
||||||
|
"perfect"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "defense"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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": {
|
"15": {
|
||||||
"melee_attack": "Bleed, Knock-back on Hit",
|
"melee_attack": {
|
||||||
"ranged_attack": "Bleed",
|
"type": "combo",
|
||||||
"melee_defense": "Kick, Punch or Shield Bash",
|
"effects": [
|
||||||
"arcane_spell_attack": "empty",
|
{
|
||||||
"arcane_spell_defense": "empty",
|
"type": "bleed"
|
||||||
"skill_rolls": "Add 1 to Skill Roll"
|
},
|
||||||
},
|
{
|
||||||
"13": {
|
"type": "internal_injury"
|
||||||
"melee_attack": "empty",
|
}
|
||||||
"ranged_attack": "empty",
|
],
|
||||||
"melee_defense": "empty",
|
"description": "Bleed, Internal Injury on Hit"
|
||||||
"arcane_spell_attack": "empty",
|
},
|
||||||
"arcane_spell_defense": "empty",
|
"ranged_attack": {
|
||||||
"skill_rolls": "empty"
|
"type": "bleed",
|
||||||
|
"description": "Bleed"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch"
|
||||||
|
],
|
||||||
|
"description": "Kick or Punch"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "skill",
|
||||||
|
"description": "Add 1 to Skill Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch"
|
||||||
|
],
|
||||||
|
"description": "Kick or Punch"
|
||||||
|
},
|
||||||
|
"saving_throws": {
|
||||||
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "save",
|
||||||
|
"description": "Add 1 to Saving Throw"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
"13": {},
|
||||||
"11": {
|
"11": {
|
||||||
"melee_attack": "Flurry Attack or Hit to Miss",
|
"melee_attack": {
|
||||||
"ranged_attack": "Roll 2x Damage Dice",
|
"type": "flurry",
|
||||||
"melee_defense": "empty",
|
"condition": "hit_or_miss",
|
||||||
"arcane_spell_attack": "empty",
|
"description": "Flurry Attack on Hit or Miss"
|
||||||
"arcane_spell_defense": "empty",
|
},
|
||||||
"skill_rolls": "empty"
|
"ranged_attack": {
|
||||||
|
"type": "double_damage_dice",
|
||||||
|
"description": "Roll 2x Damage Dice"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"10": {
|
"10": {
|
||||||
"melee_attack": "Bleed, Knock-back on Hit",
|
"melee_attack": {
|
||||||
"ranged_attack": "Bleed",
|
"type": "combo",
|
||||||
"melee_defense": "Kick, Punch or Shield Bash",
|
"effects": [
|
||||||
"arcane_spell_attack": "empty",
|
{
|
||||||
"arcane_spell_defense": "empty",
|
"type": "bleed"
|
||||||
"skill_rolls": "Add 1 to Skill Roll"
|
},
|
||||||
|
{
|
||||||
|
"type": "internal_injury"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Bleed, Internal Injury on Hit"
|
||||||
|
},
|
||||||
|
"ranged_attack": {
|
||||||
|
"type": "bleed",
|
||||||
|
"description": "Bleed"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch"
|
||||||
|
],
|
||||||
|
"description": "Kick or Punch"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "skill",
|
||||||
|
"description": "Add 1 to Skill Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch"
|
||||||
|
],
|
||||||
|
"description": "Kick or Punch"
|
||||||
|
},
|
||||||
|
"saving_throws": {
|
||||||
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "save",
|
||||||
|
"description": "Add 1 to Saving Throw"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"8": {
|
"8": {
|
||||||
"melee_attack": "Mulligan, Can Choose to Re-roll This Attack",
|
"melee_attack": {
|
||||||
"ranged_attack": "Mulligan, Can Choose to Re-Roll This Attack",
|
"type": "mulligan",
|
||||||
"melee_defense": "Mulligan, Can Choose to Re-Roll This Defense",
|
"description": "Mulligan, Can Choose to Re-roll This Attack"
|
||||||
"arcane_spell_attack": "Mulligan, Can Re-Roll This Spell Attack",
|
},
|
||||||
"arcane_spell_defense": "Mulligan, Can Re-Roll This Spell Defense",
|
"ranged_attack": {
|
||||||
"skill_rolls": "Mulligan, Can Re-Roll This Skill roll"
|
"type": "mulligan",
|
||||||
|
"description": "Mulligan, Can Choose to Re-Roll This Attack"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "mulligan",
|
||||||
|
"description": "Mulligan, Can Choose to Re-Roll This Defense"
|
||||||
|
},
|
||||||
|
"arcane_spell_attack": {
|
||||||
|
"type": "mulligan",
|
||||||
|
"description": "Mulligan, Can Re-Roll This Spell Attack"
|
||||||
|
},
|
||||||
|
"arcane_spell_defense": {
|
||||||
|
"type": "mulligan",
|
||||||
|
"description": "Mulligan, Can Re-Roll This Spell Defense"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "mulligan",
|
||||||
|
"description": "Mulligan, Can Re-Roll This Skill roll"
|
||||||
|
},
|
||||||
|
"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": {
|
"7": {
|
||||||
"melee_attack": "Flurry Attack on Hit or Miss",
|
"melee_attack": {
|
||||||
"ranged_attack": "Roll 2x Double Damage Dice",
|
"type": "flurry",
|
||||||
"melee_defense": "empty",
|
"condition": "hit_or_miss",
|
||||||
"arcane_spell_attack": "empty",
|
"description": "Flurry Attack on Hit or Miss"
|
||||||
"arcane_spell_defense": "empty",
|
},
|
||||||
"skill_rolls": "empty"
|
"ranged_attack": {
|
||||||
|
"type": "double_damage_dice",
|
||||||
|
"description": "Roll 2x Damage Dice"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"5": {
|
"5": {
|
||||||
"melee_attack": "Bleed, Knock-back on Hit",
|
"melee_attack": {
|
||||||
"ranged_attack": "Bleed",
|
"type": "combo",
|
||||||
"melee_defense": "Kick, Punch, or Shield Bash",
|
"effects": [
|
||||||
"arcane_spell_attack": "empty",
|
{
|
||||||
"arcane_spell_defense": "empty",
|
"type": "bleed"
|
||||||
"skill_rolls": "Add 1 to Skill Roll"
|
},
|
||||||
|
{
|
||||||
|
"type": "internal_injury"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Bleed, Internal Injury on Hit"
|
||||||
|
},
|
||||||
|
"ranged_attack": {
|
||||||
|
"type": "bleed",
|
||||||
|
"description": "Bleed"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch"
|
||||||
|
],
|
||||||
|
"description": "Kick or Punch"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "skill",
|
||||||
|
"description": "Add 1 to Skill Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch"
|
||||||
|
],
|
||||||
|
"description": "Kick or Punch"
|
||||||
|
},
|
||||||
|
"saving_throws": {
|
||||||
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "save",
|
||||||
|
"description": "Add 1 to Saving Throw"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"3": {
|
"3": {
|
||||||
"melee_attack": "Triple Damage",
|
"melee_attack": {
|
||||||
"ranged_attack": "Triple Damage",
|
"type": "damage_multiplier",
|
||||||
"melee_defense": "DR Tripled including Shield",
|
"multiplier": 3,
|
||||||
"arcane_spell_attack": "Triple Damage on Spell Damage",
|
"description": "Triple Damage"
|
||||||
"arcane_spell_defense": "D12 Added to Spell Defense Modifier",
|
},
|
||||||
"skill_rolls": "empty"
|
"ranged_attack": {
|
||||||
|
"type": "damage_multiplier",
|
||||||
|
"multiplier": 3,
|
||||||
|
"description": "Triple Damage"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "dr_multiplier",
|
||||||
|
"multiplier": 3,
|
||||||
|
"includes_shield": true,
|
||||||
|
"description": "DR Tripled including Shield"
|
||||||
|
},
|
||||||
|
"arcane_spell_attack": {
|
||||||
|
"type": "damage_multiplier",
|
||||||
|
"multiplier": 3,
|
||||||
|
"description": "Triple Damage on Spell Damage"
|
||||||
|
},
|
||||||
|
"arcane_spell_defense": {
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D12",
|
||||||
|
"target": "spell_defense",
|
||||||
|
"description": "D12 Added to Spell Defense Modifier"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "dr_multiplier",
|
||||||
|
"multiplier": 3,
|
||||||
|
"includes_shield": true,
|
||||||
|
"description": "DR Tripled including Shield"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"2": {
|
"2": {
|
||||||
"melee_attack": "Double Damage",
|
"melee_attack": {
|
||||||
"ranged_attack": "Double Damage",
|
"type": "damage_multiplier",
|
||||||
"melee_defense": "DR Doubled including Shield",
|
"multiplier": 2,
|
||||||
"arcane_spell_attack": "Double Damage on Spell Damage",
|
"description": "Double Damage"
|
||||||
"arcane_spell_defense": "D6 Added to Spell Defense Modifier",
|
},
|
||||||
"skill_rolls": "empty"
|
"ranged_attack": {
|
||||||
|
"type": "damage_multiplier",
|
||||||
|
"multiplier": 2,
|
||||||
|
"description": "Double Damage"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "dr_multiplier",
|
||||||
|
"multiplier": 2,
|
||||||
|
"includes_shield": true,
|
||||||
|
"description": "DR Doubled including Shield"
|
||||||
|
},
|
||||||
|
"arcane_spell_attack": {
|
||||||
|
"type": "damage_multiplier",
|
||||||
|
"multiplier": 2,
|
||||||
|
"description": "Double Damage on Spell Damage"
|
||||||
|
},
|
||||||
|
"arcane_spell_defense": {
|
||||||
|
"type": "bonus_dice",
|
||||||
|
"dice": "D6",
|
||||||
|
"target": "spell_defense",
|
||||||
|
"description": "D6 Added to Spell Defense Modifier"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "dr_multiplier",
|
||||||
|
"multiplier": 2,
|
||||||
|
"includes_shield": true,
|
||||||
|
"description": "DR Doubled including Shield"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"1": {
|
"1": {
|
||||||
"melee_attack": "empty",
|
"ranged_attack": {
|
||||||
"ranged_attack": "Possible Fumble Ranged ammo is broken unrecoverable",
|
"type": "fumble",
|
||||||
"melee_defense": "empty",
|
"detail": "ranged_ammo_broken",
|
||||||
"arcane_spell_attack": "Possible Spell Calamity or Catastrophe",
|
"description": "Possible Fumble Ranged ammo is broken unrecoverable"
|
||||||
"arcane_spell_defense": "empty",
|
},
|
||||||
"skill_rolls": "empty"
|
"arcane_spell_attack": {
|
||||||
|
"type": "spell_calamity",
|
||||||
|
"description": "A possible spell calamity has occurred"
|
||||||
|
},
|
||||||
|
"arcane_spell_defense": {
|
||||||
|
"type": "spell_calamity",
|
||||||
|
"description": "Possible Spell Calamity or Catastrophe"
|
||||||
|
},
|
||||||
|
"melee_attack": {
|
||||||
|
"type": "fumble",
|
||||||
|
"detail": "melee_fumble",
|
||||||
|
"description": "Possible Fumble"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"flash_of_pain": "Causes the victim to defend with disfavor. They can only walk and cannot attack, cast spells, call miracles or perform skills.",
|
"flash_of_pain": "Causes the victim to defend against melee and spell attacks with disfavor. They can only walk and cannot attack, cast spells, call miracles or perform skills.",
|
||||||
"shield_destruction_condition": "Occurs only if damage exceeds the shields DR."
|
"shield_destruction_condition": "Shield destruction occurs only if damage exceeds the shields DR.",
|
||||||
|
"matching_30s": "Matching 30s on skill rolls cancel each other out and is resolved by the skill roll.",
|
||||||
|
"skill_roll_30": "A 30 on a skill roll indicates success at highest level of the skill involved."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,11 +85,18 @@ export const RANGE_CHOICES = {
|
|||||||
"pointblank": { label: "Point Blank (Special)", value: "pointblank" },
|
"pointblank": { label: "Point Blank (Special)", value: "pointblank" },
|
||||||
"short": { label: "Short (+0)", value: "0" },
|
"short": { label: "Short (+0)", value: "0" },
|
||||||
"medium": { label: "Medium (Red +5)", value: "+5" },
|
"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" },
|
"extreme": { label: "Extreme (Grey +9)", value: "+9" },
|
||||||
"beyondskill": { label: "Beyond Skill (Blue +11)", value: "beyondskill" }
|
"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 = {
|
export const ATTACKER_AIM_CHOICES = {
|
||||||
"simple": { label: "Simple (+0)", value: "0" },
|
"simple": { label: "Simple (+0)", value: "0" },
|
||||||
"careful": { label: "Careful (Red +5)", value: "+4" },
|
"careful": { label: "Careful (Red +5)", value: "+4" },
|
||||||
@@ -193,6 +200,7 @@ export const DICE_VALUES = {
|
|||||||
export const CHARACTERISTIC_ATTACK = ["str", "int", "wis", "dex"]
|
export const CHARACTERISTIC_ATTACK = ["str", "int", "wis", "dex"]
|
||||||
export const CHARACTERISTIC_RANGED_ATTACK = ["int", "wis", "dex"]
|
export const CHARACTERISTIC_RANGED_ATTACK = ["int", "wis", "dex"]
|
||||||
export const CHARACTERISTIC_DEFENSE = ["int", "wis", "dex"]
|
export const CHARACTERISTIC_DEFENSE = ["int", "wis", "dex"]
|
||||||
|
export const CHARACTERISTIC_RANGED_DEFENSE = ["int", "wis", "dex"]
|
||||||
export const CHARACTERISTIC_DAMAGE = ["str"]
|
export const CHARACTERISTIC_DAMAGE = ["str"]
|
||||||
|
|
||||||
export const DEFENSE_DICE_VALUES = {
|
export const DEFENSE_DICE_VALUES = {
|
||||||
@@ -304,6 +312,7 @@ export const SYSTEM = {
|
|||||||
CHARACTERISTIC_ATTACK,
|
CHARACTERISTIC_ATTACK,
|
||||||
CHARACTERISTIC_RANGED_ATTACK,
|
CHARACTERISTIC_RANGED_ATTACK,
|
||||||
CHARACTERISTIC_DEFENSE,
|
CHARACTERISTIC_DEFENSE,
|
||||||
|
CHARACTERISTIC_RANGED_DEFENSE,
|
||||||
CHARACTERISTIC_DAMAGE,
|
CHARACTERISTIC_DAMAGE,
|
||||||
INITIATIVE_DICE_CHOICES_PER_CLASS,
|
INITIATIVE_DICE_CHOICES_PER_CLASS,
|
||||||
CHAR_CLASSES,
|
CHAR_CLASSES,
|
||||||
@@ -319,6 +328,7 @@ export const SYSTEM = {
|
|||||||
RANGE_CHOICES,
|
RANGE_CHOICES,
|
||||||
FAVOR_CHOICES,
|
FAVOR_CHOICES,
|
||||||
ATTACKER_AIM_CHOICES,
|
ATTACKER_AIM_CHOICES,
|
||||||
|
ATTACKER_MOVEMENT_CHOICES,
|
||||||
MORTAL_CHOICES,
|
MORTAL_CHOICES,
|
||||||
SPELL_CRITICAL,
|
SPELL_CRITICAL,
|
||||||
MIRACLE_TYPES,
|
MIRACLE_TYPES,
|
||||||
|
|||||||
+73
-17
@@ -72,23 +72,32 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
/* *************************************************/
|
/* *************************************************/
|
||||||
async applyDamage(hpLoss) {
|
async applyDamage(hpLoss) {
|
||||||
let hp = this.system.hp.value + hpLoss
|
let hp = this.system.hp.value + hpLoss
|
||||||
if (hp < 0) {
|
await this.update({ "system.hp.value": hp })
|
||||||
hp = 0
|
}
|
||||||
|
|
||||||
|
/* *************************************************/
|
||||||
|
getNaturalDR() {
|
||||||
|
if (this.type === "monster") {
|
||||||
|
return Number(this.system.hp?.damageResistance) || 0
|
||||||
}
|
}
|
||||||
this.update({ "system.hp.value": hp })
|
return Number(this.system.biodata?.naturalDR) || 0
|
||||||
|
}
|
||||||
|
|
||||||
|
/* *************************************************/
|
||||||
|
getMagicDR() {
|
||||||
|
if (this.type === "monster") return 0
|
||||||
|
return Number(this.system.biodata?.magicDR) || 0
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *************************************************/
|
/* *************************************************/
|
||||||
computeDamageReduction() {
|
computeDamageReduction() {
|
||||||
// Pour les monstres, utiliser hp.damageResistance et combat.damageReduction
|
|
||||||
if (this.type === "monster") {
|
if (this.type === "monster") {
|
||||||
let hpDR = Number(this.system.hp?.damageResistance) || 0
|
let hpDR = this.getNaturalDR()
|
||||||
let combatDR = Number(this.system.combat?.damageReduction) || 0
|
let combatDR = Number(this.system.combat?.damageReduction) || 0
|
||||||
return hpDR + combatDR
|
return hpDR + combatDR
|
||||||
}
|
}
|
||||||
// Pour les personnages, utiliser biodata et items
|
let naturalDR = this.getNaturalDR()
|
||||||
let naturalDR = Number(this.system.biodata?.naturalDR) || 0
|
let magicDR = this.getMagicDR()
|
||||||
let magicDR = Number(this.system.biodata?.magicDR) || 0
|
|
||||||
let armorDR = this.getArmorDR()
|
let armorDR = this.getArmorDR()
|
||||||
return naturalDR + magicDR + armorDR
|
return naturalDR + magicDR + armorDR
|
||||||
}
|
}
|
||||||
@@ -153,8 +162,8 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* *************************************************/
|
/* *************************************************/
|
||||||
async prepareRoll(rollType, rollKey, rollDice, defenderId) {
|
async prepareRoll(rollType, rollKey, rollDice, defenderId, defenderTokenId, extraShieldDr = 0, d30Effects = {}) {
|
||||||
console.log("Preparing roll", rollType, rollKey, rollDice, defenderId)
|
log("Preparing roll", rollType, rollKey, rollDice, defenderId)
|
||||||
let rollTarget
|
let rollTarget
|
||||||
switch (rollType) {
|
switch (rollType) {
|
||||||
case "granted":
|
case "granted":
|
||||||
@@ -196,8 +205,53 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
case "spell-power":
|
case "spell-power":
|
||||||
case "miracle-attack":
|
case "miracle-attack":
|
||||||
case "miracle-power":
|
case "miracle-power":
|
||||||
rollTarget = this.items.find((i) => (i.type === "miracle" || i.type == "spell") && i.id === rollKey)
|
rollTarget = foundry.utils.duplicate(this.items.find((i) => (i.type === "miracle" || i.type == "spell") && i.id === rollKey))
|
||||||
rollTarget.rollKey = 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")
|
||||||
|
let damageTier = currentAction?.damageTier
|
||||||
|
// No tier from combat action — prompt the user if multiple tiers exist
|
||||||
|
if (!damageTier) {
|
||||||
|
const tierMap = { standard: "damageDice", overpowered: "damageDiceOverpowered", overpowered2: "damageDiceOverpowered2" }
|
||||||
|
const available = Object.entries(tierMap).filter(([k, v]) => rollTarget.system?.[v])
|
||||||
|
if (available.length > 1) {
|
||||||
|
const buttons = available.map(([id]) => ({
|
||||||
|
action: id,
|
||||||
|
type: "button",
|
||||||
|
label: id.charAt(0).toUpperCase() + id.slice(1),
|
||||||
|
callback: () => id,
|
||||||
|
}))
|
||||||
|
damageTier = await foundry.applications.api.DialogV2.wait({
|
||||||
|
window: { title: "Choose spell tier" },
|
||||||
|
classes: ["lethalfantasy"],
|
||||||
|
content: `<p>Select the power level for <strong>${rollTarget.name}</strong>:</p>`,
|
||||||
|
buttons,
|
||||||
|
rejectClose: false,
|
||||||
|
}) || "standard"
|
||||||
|
} else {
|
||||||
|
damageTier = "standard"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rollTarget.damageTier = damageTier
|
||||||
|
if (rollType === "spell-attack" || rollType === "spell-power") {
|
||||||
|
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}).`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (rollType === "miracle-attack" || rollType === "miracle-power") {
|
||||||
|
const cost = Number(rollTarget.system?.level) || 0
|
||||||
|
const currentGrace = Number(this.system.divinityPoints?.value) || 0
|
||||||
|
if (cost > currentGrace) {
|
||||||
|
ui.notifications.warn(`${this.name} cannot invoke ${rollTarget.name}: insufficient Grace (needs ${cost}, has ${currentGrace}).`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case "shield-roll": {
|
case "shield-roll": {
|
||||||
rollTarget = this.items.find((i) => i.type === "shield" && i.id === rollKey)
|
rollTarget = this.items.find((i) => i.type === "shield" && i.id === rollKey)
|
||||||
@@ -206,8 +260,7 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
rollTarget.rollKey = rollKey
|
rollTarget.rollKey = rollKey
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "weapon-damage-small":
|
case "weapon-damage":
|
||||||
case "weapon-damage-medium":
|
|
||||||
case "weapon-attack":
|
case "weapon-attack":
|
||||||
case "weapon-defense": {
|
case "weapon-defense": {
|
||||||
let weapon = this.items.find((i) => i.type === "weapon" && i.id === rollKey)
|
let weapon = this.items.find((i) => i.type === "weapon" && i.id === rollKey)
|
||||||
@@ -245,9 +298,10 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
weapon: weapon,
|
weapon: weapon,
|
||||||
weaponSkillModifier: skill.weaponSkillModifier,
|
weaponSkillModifier: skill.weaponSkillModifier,
|
||||||
rollKey: rollKey,
|
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
|
rollTarget.grantedDice = this.system.granted.damageDice
|
||||||
}
|
}
|
||||||
if (rollType === "weapon-attack") {
|
if (rollType === "weapon-attack") {
|
||||||
@@ -256,19 +310,21 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
if (rollType === "weapon-defense") {
|
if (rollType === "weapon-defense") {
|
||||||
rollTarget.armorDefense = this.getArmorDefenseValue()
|
rollTarget.armorDefense = this.getArmorDefenseValue()
|
||||||
rollTarget.grantedDice = this.system.granted.defenseDice
|
rollTarget.grantedDice = this.system.granted.defenseDice
|
||||||
|
// Check if this is a ranged defense
|
||||||
|
rollTarget.isRangedDefense = game.lethalFantasy?.nextDefenseData?.isRanged ?? false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
ui.notifications.error(game.i18n.localize("LETHALFANTASY.Notifications.rollTypeNotFound") + String(rollType))
|
ui.notifications.error(game.i18n.localize("LETHALFANTASY.Notifications.rollTypeNotFound") + String(rollType))
|
||||||
break
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// In all cases
|
// In all cases
|
||||||
rollTarget.magicUser = this.system.biodata.magicUser
|
rollTarget.magicUser = this.system.biodata.magicUser
|
||||||
rollTarget.actorModifiers = foundry.utils.duplicate(this.system.modifiers)
|
rollTarget.actorModifiers = foundry.utils.duplicate(this.system.modifiers)
|
||||||
rollTarget.actorLevel = this.system.biodata.level
|
rollTarget.actorLevel = this.system.biodata.level
|
||||||
await this.system.roll(rollType, rollTarget, defenderId)
|
await this.system.roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr, d30Effects)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { log } from "../utils.mjs"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classe pour gérer les résultats du D30 dans Lethal Fantasy
|
* Classe pour gérer les résultats du D30 dans Lethal Fantasy
|
||||||
*/
|
*/
|
||||||
@@ -22,9 +24,11 @@ export default class D30Roll {
|
|||||||
MELEE_ATTACK: "melee_attack",
|
MELEE_ATTACK: "melee_attack",
|
||||||
RANGED_ATTACK: "ranged_attack",
|
RANGED_ATTACK: "ranged_attack",
|
||||||
MELEE_DEFENSE: "melee_defense",
|
MELEE_DEFENSE: "melee_defense",
|
||||||
|
RANGED_DEFENSE: "ranged_defense",
|
||||||
ARCANE_SPELL_ATTACK: "arcane_spell_attack",
|
ARCANE_SPELL_ATTACK: "arcane_spell_attack",
|
||||||
ARCANE_SPELL_DEFENSE: "arcane_spell_defense",
|
ARCANE_SPELL_DEFENSE: "arcane_spell_defense",
|
||||||
SKILL_ROLLS: "skill_rolls"
|
SKILL_ROLLS: "skill_rolls",
|
||||||
|
SAVING_THROWS: "saving_throws"
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,7 +43,7 @@ export default class D30Roll {
|
|||||||
this.resultsTable = data.d30_dice_results
|
this.resultsTable = data.d30_dice_results
|
||||||
this.definitions = data.definitions
|
this.definitions = data.definitions
|
||||||
|
|
||||||
console.log("D30Roll | D30 results table loaded successfully")
|
log("D30Roll | D30 results table loaded successfully")
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("D30Roll | Error loading D30 table:", error)
|
console.error("D30Roll | Error loading D30 table:", error)
|
||||||
ui.notifications.error("Unable to load D30 results table")
|
ui.notifications.error("Unable to load D30 results table")
|
||||||
@@ -47,26 +51,26 @@ export default class D30Roll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Récupère le résultat d'un jet de D30
|
* Récupère le résultat d'un jet de D30 sous forme d'objet structuré.
|
||||||
* @param {number} diceValue La valeur du dé (1-30)
|
* @param {number} diceValue La valeur du dé (1-30)
|
||||||
* @param {string} rollType Le type de jet externe (ex: "weapon-attack", "spell-attack", etc.)
|
* @param {string} rollType Le type de jet externe (ex: "weapon-attack", "spell-attack", etc.)
|
||||||
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel, nécessaire pour certains types)
|
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel, nécessaire pour certains types)
|
||||||
* @returns {string|null} Le résultat correspondant ou null si vide/non trouvé
|
* @param {Object} options Options supplémentaires (optionnel)
|
||||||
|
* @param {boolean} options.isRanged Si true, utilise ranged_defense au lieu de melee_defense
|
||||||
|
* @returns {Object|null} L'objet effet `{ type, description, ...fields }` ou null si aucun effet
|
||||||
*/
|
*/
|
||||||
static getResult(diceValue, rollType, weapon = null) {
|
static getResult(diceValue, rollType, weapon = null, options = {}) {
|
||||||
if (!this.resultsTable) {
|
if (!this.resultsTable) {
|
||||||
console.warn("D30Roll | Results table is not initialized. Call D30Roll.initialize() first.")
|
console.warn("D30Roll | Results table is not initialized. Call D30Roll.initialize() first.")
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validation des paramètres
|
|
||||||
if (diceValue < 1 || diceValue > 30) {
|
if (diceValue < 1 || diceValue > 30) {
|
||||||
console.warn(`D30Roll | Invalid dice value: ${diceValue}. Must be between 1 and 30.`)
|
console.warn(`D30Roll | Invalid dice value: ${diceValue}. Must be between 1 and 30.`)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert external rollType to internal rollType
|
const internalType = this.convertToInternalType(rollType, weapon, options)
|
||||||
const internalType = this.convertToInternalType(rollType, weapon)
|
|
||||||
|
|
||||||
if (!internalType) {
|
if (!internalType) {
|
||||||
console.warn(`D30Roll | Could not convert roll type: ${rollType}`)
|
console.warn(`D30Roll | Could not convert roll type: ${rollType}`)
|
||||||
@@ -85,37 +89,41 @@ export default class D30Roll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const result = resultEntry[internalType]
|
const result = resultEntry[internalType]
|
||||||
|
return result ?? null
|
||||||
|
}
|
||||||
|
|
||||||
// Retourne null si le résultat est "empty"
|
/**
|
||||||
if (result === "empty" || !result) {
|
* Retourne le type d'effet d'un résultat D30.
|
||||||
return null
|
* @param {Object|null} result L'objet retourné par getResult()
|
||||||
}
|
* @returns {string|null} Le type d'effet ou null
|
||||||
|
*/
|
||||||
return result
|
static getEffectType(result) {
|
||||||
|
return result?.type ?? null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convertit un rollType externe en rollType interne
|
* Convertit un rollType externe en rollType interne
|
||||||
* @param {string} externalType Le type de jet externe (ex: "weapon-attack")
|
* @param {string} externalType Le type de jet externe (ex: "weapon-attack")
|
||||||
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel)
|
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel)
|
||||||
|
* @param {Object} options Options supplémentaires (optionnel)
|
||||||
|
* @param {boolean} options.isRanged Si true, utilise ranged_defense au lieu de melee_defense
|
||||||
* @returns {string|null} Le type interne correspondant ou null
|
* @returns {string|null} Le type interne correspondant ou null
|
||||||
*/
|
*/
|
||||||
static convertToInternalType(externalType, weapon = null) {
|
static convertToInternalType(externalType, weapon = null, options = {}) {
|
||||||
// Attack types - need weapon to determine if melee or ranged
|
// Attack types - need weapon to determine if melee or ranged
|
||||||
if (externalType === "weapon-attack") {
|
if (externalType === "weapon-attack") {
|
||||||
if (!weapon) {
|
if (!weapon) {
|
||||||
console.warn("D30Roll | Weapon object required for weapon-attack type")
|
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.RANGED_ATTACK
|
||||||
: this.ROLL_TYPES.MELEE_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") {
|
if (externalType === "monster-attack") {
|
||||||
// Check if weapon object has range information
|
if (options.isRanged || weapon?.system?.weaponType === "ranged") {
|
||||||
if (weapon?.system?.weaponType === "ranged") {
|
|
||||||
return this.ROLL_TYPES.RANGED_ATTACK
|
return this.ROLL_TYPES.RANGED_ATTACK
|
||||||
}
|
}
|
||||||
return this.ROLL_TYPES.MELEE_ATTACK
|
return this.ROLL_TYPES.MELEE_ATTACK
|
||||||
@@ -123,7 +131,7 @@ export default class D30Roll {
|
|||||||
|
|
||||||
// Defense types
|
// Defense types
|
||||||
if (externalType === "weapon-defense" || externalType === "monster-defense") {
|
if (externalType === "weapon-defense" || externalType === "monster-defense") {
|
||||||
return this.ROLL_TYPES.MELEE_DEFENSE
|
return options.isRanged ? this.ROLL_TYPES.RANGED_DEFENSE : this.ROLL_TYPES.MELEE_DEFENSE
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spell types
|
// Spell types
|
||||||
@@ -132,11 +140,15 @@ export default class D30Roll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Skill types
|
// Skill types
|
||||||
if (externalType === "skill" || externalType === "monster-skill" ||
|
if (externalType === "skill" || externalType === "monster-skill" || externalType === "challenge") {
|
||||||
externalType === "save" || externalType === "challenge") {
|
|
||||||
return this.ROLL_TYPES.SKILL_ROLLS
|
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
|
// If no match, return null
|
||||||
console.warn(`D30Roll | Unknown external roll type: ${externalType}`)
|
console.warn(`D30Roll | Unknown external roll type: ${externalType}`)
|
||||||
return null
|
return null
|
||||||
@@ -177,11 +189,11 @@ export default class D30Roll {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Vérifie si un résultat est vide
|
* Vérifie si un résultat est vide
|
||||||
* @param {string} result Le résultat à vérifier
|
* @param {Object|null} result Le résultat à vérifier
|
||||||
* @returns {boolean} True si le résultat est vide
|
* @returns {boolean} True si le résultat est vide
|
||||||
*/
|
*/
|
||||||
static isEmptyResult(result) {
|
static isEmptyResult(result) {
|
||||||
return !result || result === "empty"
|
return !result || !result.type
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -189,11 +201,12 @@ export default class D30Roll {
|
|||||||
* @param {number} diceValue La valeur du dé (1-30)
|
* @param {number} diceValue La valeur du dé (1-30)
|
||||||
* @param {string} rollType Le type de jet externe
|
* @param {string} rollType Le type de jet externe
|
||||||
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel)
|
* @param {Object} weapon L'arme ou l'objet utilisé (optionnel)
|
||||||
|
* @param {Object} options Options supplémentaires (optionnel)
|
||||||
* @returns {Object} Un objet avec le résultat et des informations de formatage
|
* @returns {Object} Un objet avec le résultat et des informations de formatage
|
||||||
*/
|
*/
|
||||||
static getFormattedResult(diceValue, rollType, weapon = null) {
|
static getFormattedResult(diceValue, rollType, weapon = null, options = {}) {
|
||||||
const result = this.getResult(diceValue, rollType, weapon)
|
const result = this.getResult(diceValue, rollType, weapon, options)
|
||||||
const internalType = this.convertToInternalType(rollType, weapon)
|
const internalType = this.convertToInternalType(rollType, weapon, options)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
value: diceValue,
|
value: diceValue,
|
||||||
|
|||||||
+424
-120
@@ -127,6 +127,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
* @returns {Promise<Object|null>} The roll result or null if the dialog was cancelled.
|
* @returns {Promise<Object|null>} The roll result or null if the dialog was cancelled.
|
||||||
*/
|
*/
|
||||||
static async prompt(options = {}) {
|
static async prompt(options = {}) {
|
||||||
|
try {
|
||||||
let dice = "1D20"
|
let dice = "1D20"
|
||||||
let maxValue = 20
|
let maxValue = 20
|
||||||
let baseFormula = "1D20"
|
let baseFormula = "1D20"
|
||||||
@@ -139,7 +140,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
let hasGrantedDice = false
|
let hasGrantedDice = false
|
||||||
let pointBlank = false
|
let pointBlank = false
|
||||||
let letItFly = false
|
let letItFly = false
|
||||||
let saveSpell = false
|
let saveSpell = game.lethalFantasy?.spellDefense ?? false
|
||||||
let beyondSkill = false
|
let beyondSkill = false
|
||||||
let hasStaticModifier = false
|
let hasStaticModifier = false
|
||||||
let hasExplode = true
|
let hasExplode = true
|
||||||
@@ -182,6 +183,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
} else {
|
} else {
|
||||||
options.rollTarget.value = options.rollTarget.defenseModifier
|
options.rollTarget.value = options.rollTarget.defenseModifier
|
||||||
options.rollTarget.charModifier = 0
|
options.rollTarget.charModifier = 0
|
||||||
|
options.isRangedDefense = options.rollTarget.isRangedDefense ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (options.rollType === "monster-skill") {
|
} else if (options.rollType === "monster-skill") {
|
||||||
@@ -219,8 +221,14 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
options.rollTarget.charModifier = options.rollTarget.combat.rangedAttackModifier
|
options.rollTarget.charModifier = options.rollTarget.combat.rangedAttackModifier
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
options.rollTarget.value = options.rollTarget.combat.defenseModifier + options.rollTarget.weaponSkillModifier + options.rollTarget.weapon.system.bonuses.defenseBonus + options.rollTarget.armorDefense
|
// For defense, check if it's a ranged defense
|
||||||
options.rollTarget.charModifier = options.rollTarget.combat.defenseModifier
|
const defenseModifier = options.rollTarget.isRangedDefense
|
||||||
|
? options.rollTarget.combat.rangedDefenseModifier
|
||||||
|
: options.rollTarget.combat.defenseModifier
|
||||||
|
options.rollTarget.value = defenseModifier + options.rollTarget.weaponSkillModifier + options.rollTarget.weapon.system.bonuses.defenseBonus + options.rollTarget.armorDefense
|
||||||
|
options.rollTarget.charModifier = defenseModifier
|
||||||
|
// Store isRanged flag for D30 lookup
|
||||||
|
options.isRangedDefense = options.rollTarget.isRangedDefense
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (options.rollType === "spell" || options.rollType === "spell-attack" || options.rollType === "spell-power") {
|
} else if (options.rollType === "spell" || options.rollType === "spell-attack" || options.rollType === "spell-power") {
|
||||||
@@ -230,6 +238,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
baseFormula = "D20"
|
baseFormula = "D20"
|
||||||
hasModifier = true
|
hasModifier = true
|
||||||
hasChangeDice = false
|
hasChangeDice = false
|
||||||
|
hasFavor = true
|
||||||
options.rollTarget.value = options.rollTarget.actorModifiers.levelSpellModifier + options.rollTarget.actorModifiers.intSpellModifier
|
options.rollTarget.value = options.rollTarget.actorModifiers.levelSpellModifier + options.rollTarget.actorModifiers.intSpellModifier
|
||||||
options.rollTarget.charModifier = options.rollTarget.actorModifiers.intSpellModifier
|
options.rollTarget.charModifier = options.rollTarget.actorModifiers.intSpellModifier
|
||||||
hasStaticModifier = options.rollType === "spell-power"
|
hasStaticModifier = options.rollType === "spell-power"
|
||||||
@@ -246,6 +255,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
dice = "1D20"
|
dice = "1D20"
|
||||||
baseFormula = "D20"
|
baseFormula = "D20"
|
||||||
hasChangeDice = false
|
hasChangeDice = false
|
||||||
|
hasFavor = true
|
||||||
options.rollTarget.value = options.rollTarget.actorModifiers.levelMiracleModifier + options.rollTarget.actorModifiers.chaMiracleModifier
|
options.rollTarget.value = options.rollTarget.actorModifiers.levelMiracleModifier + options.rollTarget.actorModifiers.chaMiracleModifier
|
||||||
options.rollTarget.charModifier = options.rollTarget.actorModifiers.chaMiracleModifier
|
options.rollTarget.charModifier = options.rollTarget.actorModifiers.chaMiracleModifier
|
||||||
hasStaticModifier = options.rollType === "miracle-power"
|
hasStaticModifier = options.rollType === "miracle-power"
|
||||||
@@ -265,6 +275,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
hasChangeDice = false
|
hasChangeDice = false
|
||||||
hasMaxValue = false
|
hasMaxValue = false
|
||||||
hasExplode = false
|
hasExplode = false
|
||||||
|
hasFavor = true
|
||||||
options.rollTarget.value = 0
|
options.rollTarget.value = 0
|
||||||
|
|
||||||
} else if (options.rollType.includes("weapon-damage")) {
|
} else if (options.rollType.includes("weapon-damage")) {
|
||||||
@@ -275,14 +286,12 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
let damageBonus = (options.rollTarget.weapon.system.applyStrengthDamageBonus) ? options.rollTarget.combat.damageModifier : 0
|
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.value = damageBonus + options.rollTarget.weaponSkillModifier + options.rollTarget.weapon.system.bonuses.damageBonus
|
||||||
options.rollTarget.charModifier = damageBonus
|
options.rollTarget.charModifier = damageBonus
|
||||||
if (options.rollType.includes("small")) {
|
dice = options.rollTarget.weapon.system.damage.damageM
|
||||||
options.damageSmall = true
|
if (/NE$/i.test(dice)) {
|
||||||
dice = options.rollTarget.weapon.system.damage.damageS
|
hasMaxValue = false
|
||||||
} else {
|
hasExplode = false
|
||||||
options.damageMedium = true
|
|
||||||
dice = options.rollTarget.weapon.system.damage.damageM
|
|
||||||
}
|
}
|
||||||
dice = dice.replace("E", "")
|
dice = dice.replace(/NE$/i, "").replace("E", "")
|
||||||
baseFormula = dice
|
baseFormula = dice
|
||||||
|
|
||||||
} else if (options.rollType.includes("monster-damage")) {
|
} else if (options.rollType.includes("monster-damage")) {
|
||||||
@@ -295,6 +304,10 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
dice = options.rollTarget.damageDice
|
dice = options.rollTarget.damageDice
|
||||||
dice = dice.replace("E", "")
|
dice = dice.replace("E", "")
|
||||||
baseFormula = dice
|
baseFormula = dice
|
||||||
|
if (options.rollTarget.noExplode) {
|
||||||
|
hasMaxValue = false
|
||||||
|
hasExplode = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -304,8 +317,8 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
hasModifier = false
|
hasModifier = false
|
||||||
}
|
}
|
||||||
|
|
||||||
const rollModes = foundry.utils.duplicate(CONFIG.Dice.rollModes); // v12 : Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
|
const rollModes = foundry.utils.duplicate(CONFIG.ChatMessage.modes);
|
||||||
console.log("Roll mode", rollModes)
|
|
||||||
|
|
||||||
const fieldRollMode = new foundry.data.fields.StringField({
|
const fieldRollMode = new foundry.data.fields.StringField({
|
||||||
choices: rollModes,
|
choices: rollModes,
|
||||||
@@ -320,6 +333,10 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
let modifier = "+0"
|
let modifier = "+0"
|
||||||
let targetName
|
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 = {
|
let dialogContext = {
|
||||||
rollType: options.rollType,
|
rollType: options.rollType,
|
||||||
rollTarget: options.rollTarget,
|
rollTarget: options.rollTarget,
|
||||||
@@ -342,66 +359,86 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
dice,
|
dice,
|
||||||
hasTarget: options.hasTarget,
|
hasTarget: options.hasTarget,
|
||||||
modifier,
|
modifier,
|
||||||
saveSpell: false,
|
saveSpell,
|
||||||
favor: "none",
|
favor: "none",
|
||||||
targetName
|
targetName,
|
||||||
|
isRangedAttack
|
||||||
}
|
}
|
||||||
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-lethal-fantasy/templates/roll-dialog.hbs", dialogContext)
|
let rollContext
|
||||||
|
if (options.rollContext) {
|
||||||
|
rollContext = foundry.utils.duplicate(options.rollContext)
|
||||||
|
hasGrantedDice = !!rollContext.hasGrantedDice
|
||||||
|
pointBlank = !!rollContext.pointBlank
|
||||||
|
beyondSkill = !!rollContext.beyondSkill
|
||||||
|
letItFly = !!rollContext.letItFly
|
||||||
|
saveSpell = !!rollContext.saveSpell
|
||||||
|
const _rawMode = rollContext.rollMode || game.settings.get("core", "rollMode")
|
||||||
|
const _modeMap = { publicroll: "public", gmroll: "gm", blindroll: "blind", selfroll: "self" }
|
||||||
|
rollContext.visibility ||= _modeMap[_rawMode] ?? _rawMode ?? "public"
|
||||||
|
rollContext.modifier ||= modifier
|
||||||
|
rollContext.favor ||= "none"
|
||||||
|
rollContext.changeDice ||= `${dice}`
|
||||||
|
rollContext.attackerAim ||= "0"
|
||||||
|
} else {
|
||||||
|
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-lethal-fantasy/templates/roll-dialog.hbs", dialogContext)
|
||||||
|
|
||||||
let position = game.user.getFlag(SYSTEM.id, "roll-dialog-pos") || { top: -1, left: -1 }
|
let position = game.user.getFlag(SYSTEM.id, "roll-dialog-pos") || { top: -1, left: -1 }
|
||||||
const label = game.i18n.localize("LETHALFANTASY.Roll.roll")
|
const label = game.i18n.localize("LETHALFANTASY.Roll.roll")
|
||||||
const rollContext = await foundry.applications.api.DialogV2.wait({
|
rollContext = await foundry.applications.api.DialogV2.wait({
|
||||||
window: { title: "Roll dialog" },
|
window: { title: "Roll dialog" },
|
||||||
classes: ["lethalfantasy"],
|
classes: ["lethalfantasy"],
|
||||||
content,
|
content,
|
||||||
position,
|
position,
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
label: label,
|
action: "roll",
|
||||||
callback: (event, button, dialog) => {
|
type: "button",
|
||||||
console.log("Roll context", event, button, dialog)
|
label: label,
|
||||||
let position = dialog.position
|
callback: (event, button, dialog) => {
|
||||||
game.user.setFlag(SYSTEM.id, "roll-dialog-pos", foundry.utils.duplicate(position))
|
log("Roll context", event, button, dialog)
|
||||||
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
let position = dialog?.position
|
||||||
if (input.name) obj[input.name] = input.value
|
game.user.setFlag(SYSTEM.id, "roll-dialog-pos", foundry.utils.duplicate(position))
|
||||||
return obj
|
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
||||||
}, {})
|
if (input.name) obj[input.name] = input.value
|
||||||
return output
|
return obj
|
||||||
|
}, {})
|
||||||
|
return output
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
],
|
actions: {
|
||||||
actions: {
|
"selectGranted": (event, button) => {
|
||||||
"selectGranted": (event, button, dialog) => {
|
hasGrantedDice = event.target.checked
|
||||||
hasGrantedDice = event.target.checked
|
},
|
||||||
},
|
"selectBeyondSkill": (event, button) => {
|
||||||
"selectBeyondSkill": (event, button, dialog) => {
|
beyondSkill = button.checked
|
||||||
beyondSkill = button.checked
|
},
|
||||||
},
|
"selectPointBlank": (event, button) => {
|
||||||
"selectPointBlank": (event, button, dialog) => {
|
pointBlank = button.checked
|
||||||
pointBlank = button.checked
|
},
|
||||||
},
|
"selectLetItFly": (event, button) => {
|
||||||
"selectLetItFly": (event, button, dialog) => {
|
letItFly = button.checked
|
||||||
letItFly = button.checked
|
},
|
||||||
},
|
"saveSpellCheck": (event, button) => {
|
||||||
"saveSpellCheck": (event, button, dialog) => {
|
saveSpell = button.checked
|
||||||
saveSpell = button.checked
|
},
|
||||||
},
|
"gotoToken": (event, button) => {
|
||||||
"gotoToken": (event, button, dialog) => {
|
let tokenId = $(button).data("tokenId")
|
||||||
let tokenId = $(button).data("tokenId")
|
let token = canvas.tokens?.get(tokenId)
|
||||||
let token = canvas.tokens?.get(tokenId)
|
if (token) {
|
||||||
if (token) {
|
canvas.animatePan({ x: token.x, y: token.y, duration: 200 })
|
||||||
canvas.animatePan({ x: token.x, y: token.y, duration: 200 })
|
canvas.tokens.releaseAll()
|
||||||
canvas.tokens.releaseAll();
|
token.control({ releaseOthers: true })
|
||||||
token.control({ releaseOthers: true });
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
rejectClose: false // Click on Close button will not launch an error
|
||||||
rejectClose: false // Click on Close button will not launch an error
|
})
|
||||||
})
|
}
|
||||||
|
|
||||||
// If the user cancels the dialog, exit
|
// If the user cancels the dialog, exit
|
||||||
if (rollContext === null) return
|
if (rollContext === null) return
|
||||||
console.log("rollContext", rollContext, hasGrantedDice)
|
log("rollContext", rollContext, hasGrantedDice)
|
||||||
rollContext.saveSpell = saveSpell // Update fucking flag
|
rollContext.saveSpell = saveSpell // Update fucking flag
|
||||||
|
|
||||||
let fullModifier = 0
|
let fullModifier = 0
|
||||||
@@ -410,7 +447,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
if (hasModifier) {
|
if (hasModifier) {
|
||||||
let bonus = Number(options.rollTarget.value)
|
let bonus = Number(options.rollTarget.value)
|
||||||
fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus
|
fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus
|
||||||
fullModifier += (rollContext.saveSpell) ? options.rollTarget.actorModifiers.saveModifier : 0
|
fullModifier += (rollContext.saveSpell) ? (options.rollTarget.actorModifiers?.saveModifier ?? 0) : 0
|
||||||
if (Number(rollContext.attackerAim) > 0) {
|
if (Number(rollContext.attackerAim) > 0) {
|
||||||
fullModifier += Number(rollContext.attackerAim)
|
fullModifier += Number(rollContext.attackerAim)
|
||||||
}
|
}
|
||||||
@@ -475,7 +512,8 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rollContext.favor = "none"
|
rollContext.favor = "none"
|
||||||
}
|
}
|
||||||
|
|
||||||
maxValue = Number(baseFormula.match(/\d+$/)[0]) // Update the max value agains
|
const maxMatch = baseFormula ? baseFormula.match(/\d+$/) : null
|
||||||
|
maxValue = maxMatch ? Number(maxMatch[0]) : 0
|
||||||
|
|
||||||
const rollData = {
|
const rollData = {
|
||||||
type: options.rollType,
|
type: options.rollType,
|
||||||
@@ -488,8 +526,6 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rollMode: rollContext.visibility,
|
rollMode: rollContext.visibility,
|
||||||
hasTarget: options.hasTarget,
|
hasTarget: options.hasTarget,
|
||||||
isDamage: options.isDamage,
|
isDamage: options.isDamage,
|
||||||
damageSmall: options.damageSmall,
|
|
||||||
damageMedium: options.damageMedium,
|
|
||||||
pointBlank,
|
pointBlank,
|
||||||
beyondSkill,
|
beyondSkill,
|
||||||
letItFly,
|
letItFly,
|
||||||
@@ -519,7 +555,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
if (rollContext.favor === "favor") {
|
if (rollContext.favor === "favor") {
|
||||||
rollFavor = new this(baseFormula, options.data, rollData)
|
rollFavor = new this(baseFormula, options.data, rollData)
|
||||||
await rollFavor.evaluate()
|
await rollFavor.evaluate()
|
||||||
console.log("Rolling with favor", rollFavor)
|
log("Rolling with favor", rollFavor)
|
||||||
if (game?.dice3d) {
|
if (game?.dice3d) {
|
||||||
game.dice3d.showForRoll(rollFavor, game.user, true)
|
game.dice3d.showForRoll(rollFavor, game.user, true)
|
||||||
}
|
}
|
||||||
@@ -547,6 +583,10 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rollFavor = null
|
rollFavor = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.forceNoD30) {
|
||||||
|
hasD30 = false
|
||||||
|
}
|
||||||
|
|
||||||
if (hasD30) {
|
if (hasD30) {
|
||||||
let rollD30 = await new Roll("1D30").evaluate()
|
let rollD30 = await new Roll("1D30").evaluate()
|
||||||
if (game?.dice3d) {
|
if (game?.dice3d) {
|
||||||
@@ -554,11 +594,17 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
}
|
}
|
||||||
options.D30result = rollD30.total
|
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(
|
const d30Message = D30Roll.getResult(
|
||||||
rollD30.total,
|
rollD30.total,
|
||||||
options.rollType,
|
options.rollType,
|
||||||
options.rollTarget?.weapon
|
options.rollTarget?.weapon,
|
||||||
|
{ isRanged: isRangedForD30, isSpellSave: saveSpell }
|
||||||
)
|
)
|
||||||
options.D30message = d30Message
|
options.D30message = d30Message
|
||||||
}
|
}
|
||||||
@@ -577,9 +623,6 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
if (hasMaxValue) {
|
if (hasMaxValue) {
|
||||||
while (diceResult === maxValue) {
|
while (diceResult === maxValue) {
|
||||||
let r = await new Roll(baseFormula).evaluate()
|
let r = await new Roll(baseFormula).evaluate()
|
||||||
if (game?.dice3d) {
|
|
||||||
await game.dice3d.showForRoll(r, game.user, true)
|
|
||||||
}
|
|
||||||
diceResult = r.dice[0].results[0].result
|
diceResult = r.dice[0].results[0].result
|
||||||
diceResults.push({ dice: `${singleDice.toUpperCase()}-1`, value: diceResult - 1 })
|
diceResults.push({ dice: `${singleDice.toUpperCase()}-1`, value: diceResult - 1 })
|
||||||
diceSum += (diceResult - 1)
|
diceSum += (diceResult - 1)
|
||||||
@@ -620,6 +663,12 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rollBase.options.badResult = badResult
|
rollBase.options.badResult = badResult
|
||||||
rollBase.options.rollData = foundry.utils.duplicate(rollData)
|
rollBase.options.rollData = foundry.utils.duplicate(rollData)
|
||||||
rollBase.options.defenderId = options.defenderId
|
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.
|
* A hook event that fires after the roll has been made.
|
||||||
@@ -633,11 +682,15 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
if (Hooks.call("fvtt-lethal-fantasy.Roll", options, rollData, rollBase) === false) return
|
if (Hooks.call("fvtt-lethal-fantasy.Roll", options, rollData, rollBase) === false) return
|
||||||
|
|
||||||
return rollBase
|
return rollBase
|
||||||
|
} finally {
|
||||||
|
// Clear one-shot flag so it doesn't leak to subsequent non-spell saves
|
||||||
|
if (game.lethalFantasy) game.lethalFantasy.spellDefense = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ***********************************************************/
|
/* ***********************************************************/
|
||||||
static async promptInitiative(options = {}) {
|
static async promptInitiative(options = {}) {
|
||||||
const rollModes = foundry.utils.duplicate(CONFIG.Dice.rollModes); // v12 : Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
|
const rollModes = foundry.utils.duplicate(CONFIG.ChatMessage.modes); // v12 : Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
|
||||||
const fieldRollMode = new foundry.data.fields.StringField({
|
const fieldRollMode = new foundry.data.fields.StringField({
|
||||||
choices: rollModes,
|
choices: rollModes,
|
||||||
blank: false,
|
blank: false,
|
||||||
@@ -668,8 +721,10 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
content,
|
content,
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
|
action: "initiative",
|
||||||
|
type: "button",
|
||||||
label: label,
|
label: label,
|
||||||
callback: (event, button, dialog) => {
|
callback: (event, button) => {
|
||||||
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
||||||
if (input.name) obj[input.name] = input.value
|
if (input.name) obj[input.name] = input.value
|
||||||
return obj
|
return obj
|
||||||
@@ -681,23 +736,31 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rejectClose: false // Click on Close button will not launch an error
|
rejectClose: false // Click on Close button will not launch an error
|
||||||
})
|
})
|
||||||
|
|
||||||
let initRoll = new Roll(`min(${rollContext.initiativeDice}, ${options.maxInit})`, options.data, rollContext)
|
if (!rollContext) return
|
||||||
|
|
||||||
|
// When the value is a plain number (e.g. "1" for Declared Ready on Alert), wrapping it in
|
||||||
|
// min(1, maxInit) produces a dice-less formula that FoundryVTT cannot evaluate to a valid
|
||||||
|
// total. Use the constant directly; min() is only needed for actual dice expressions.
|
||||||
|
const isDiceFormula = /[dD]/.test(rollContext.initiativeDice)
|
||||||
|
const formula = isDiceFormula ? `min(${rollContext.initiativeDice}, ${options.maxInit})` : rollContext.initiativeDice
|
||||||
|
|
||||||
|
let initRoll = new Roll(formula, options.data)
|
||||||
await initRoll.evaluate()
|
await initRoll.evaluate()
|
||||||
let msg = await initRoll.toMessage({ flavor: `Initiative for ${options.actorName}` }, { rollMode: rollContext.visibility })
|
let msg = await initRoll.toMessage({ flavor: `Initiative for ${options.actorName}` }, { messageMode: rollContext.visibility })
|
||||||
if (game?.dice3d) {
|
if (game?.dice3d && initRoll.dice?.length) {
|
||||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.combatId && options.combatantId) {
|
if (options.combatId && options.combatantId) {
|
||||||
let combat = game.combats.get(options.combatId)
|
let combat = game.combats.get(options.combatId)
|
||||||
combat.updateEmbeddedDocuments("Combatant", [{ _id: options.combatantId, initiative: initRoll.total, 'system.progressionCount': 0 }]);
|
await combat.updateEmbeddedDocuments("Combatant", [{ _id: options.combatantId, initiative: initRoll.total, 'system.progressionCount': 0, [`flags.${SYSTEM.id}.firstActionTaken`]: false }])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ***********************************************************/
|
/* ***********************************************************/
|
||||||
static async promptCombatAction(options = {}) {
|
static async promptCombatAction(options = {}) {
|
||||||
|
|
||||||
const rollModes = foundry.utils.duplicate(CONFIG.Dice.rollModes); // v12 : Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
|
const rollModes = foundry.utils.duplicate(CONFIG.ChatMessage.modes); // v12 : Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
|
||||||
const fieldRollMode = new foundry.data.fields.StringField({
|
const fieldRollMode = new foundry.data.fields.StringField({
|
||||||
choices: rollModes,
|
choices: rollModes,
|
||||||
blank: false,
|
blank: false,
|
||||||
@@ -726,10 +789,20 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
let buttons = []
|
let buttons = []
|
||||||
if (currentAction) {
|
if (currentAction) {
|
||||||
if (currentAction.type === "weapon") {
|
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({
|
buttons.push({
|
||||||
action: "roll",
|
action: "roll",
|
||||||
label: "Roll progression dice",
|
type: "button",
|
||||||
callback: (event, button, dialog) => {
|
label: weaponLabel,
|
||||||
|
callback: (event, button) => {
|
||||||
let pos = $('#combat-action-dialog').position()
|
let pos = $('#combat-action-dialog').position()
|
||||||
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", pos)
|
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", pos)
|
||||||
return "rollProgressionDice"
|
return "rollProgressionDice"
|
||||||
@@ -754,8 +827,9 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
}
|
}
|
||||||
buttons.push({
|
buttons.push({
|
||||||
action: "roll",
|
action: "roll",
|
||||||
|
type: "button",
|
||||||
label: label,
|
label: label,
|
||||||
callback: (event, button, dialog) => {
|
callback: (event, button) => {
|
||||||
let pos = $('#combat-action-dialog').position()
|
let pos = $('#combat-action-dialog').position()
|
||||||
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", foundry.utils.duplicate(pos))
|
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", foundry.utils.duplicate(pos))
|
||||||
return "rollLethargyDice"
|
return "rollLethargyDice"
|
||||||
@@ -765,8 +839,9 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
} else {
|
} else {
|
||||||
buttons.push({
|
buttons.push({
|
||||||
action: "roll",
|
action: "roll",
|
||||||
|
type: "button",
|
||||||
label: "Select action",
|
label: "Select action",
|
||||||
callback: (event, button, dialog) => {
|
callback: (event, button) => {
|
||||||
let pos = $('#combat-action-dialog').position()
|
let pos = $('#combat-action-dialog').position()
|
||||||
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", foundry.utils.duplicate(pos))
|
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", foundry.utils.duplicate(pos))
|
||||||
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
||||||
@@ -780,8 +855,9 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
}
|
}
|
||||||
buttons.push({
|
buttons.push({
|
||||||
action: "cancel",
|
action: "cancel",
|
||||||
|
type: "button",
|
||||||
label: "Other action, not listed here",
|
label: "Other action, not listed here",
|
||||||
callback: (event, button, dialog) => {
|
callback: (event, button) => {
|
||||||
let pos = $('#combat-action-dialog').position()
|
let pos = $('#combat-action-dialog').position()
|
||||||
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", foundry.utils.duplicate(pos))
|
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", foundry.utils.duplicate(pos))
|
||||||
return null;
|
return null;
|
||||||
@@ -798,12 +874,12 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rejectClose: false // Click on Close button will not launch an error
|
rejectClose: false // Click on Close button will not launch an error
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log("RollContext", dialogContext, rollContext)
|
log("RollContext", dialogContext, rollContext)
|
||||||
// If action is cancelled, exit
|
// If action is cancelled, exit
|
||||||
if (rollContext === null || rollContext === "cancel") {
|
if (rollContext === null || rollContext === "cancel") {
|
||||||
await combatant.setFlag(SYSTEM.id, "currentAction", "")
|
await combatant.setFlag(SYSTEM.id, "currentAction", "")
|
||||||
let message = `${combatant.name} : Other action, progression reset`
|
let message = `${combatant.name} : Other action, progression reset`
|
||||||
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
await ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -827,14 +903,42 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
let selectedItem = combatant.actor.items.find(i => i.id === selectedChoice)
|
let selectedItem = combatant.actor.items.find(i => i.id === selectedChoice)
|
||||||
// Setup flag for combat action usage
|
// Setup flag for combat action usage
|
||||||
let actionItem = foundry.utils.duplicate(selectedItem)
|
let actionItem = foundry.utils.duplicate(selectedItem)
|
||||||
actionItem.progressionCount = 1
|
// First action of this combat: use the class-based starting threshold;
|
||||||
|
// all subsequent actions reset to 1 (normal progression).
|
||||||
|
const firstActionTaken = combatant.getFlag(SYSTEM.id, "firstActionTaken")
|
||||||
|
actionItem.progressionCount = firstActionTaken ? 1 : (combatant.actor.system.combat?.combatProgressionStart ?? 1)
|
||||||
|
if (!firstActionTaken) await combatant.setFlag(SYSTEM.id, "firstActionTaken", true)
|
||||||
actionItem.rangedMode = rangedMode
|
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,
|
||||||
|
type: "button",
|
||||||
|
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.castingTime = 1
|
||||||
actionItem.spellStatus = "castingTime"
|
actionItem.spellStatus = "castingTime"
|
||||||
// Set the flag on the combatant
|
// Set the flag on the combatant
|
||||||
await combatant.setFlag(SYSTEM.id, "currentAction", actionItem)
|
await combatant.setFlag(SYSTEM.id, "currentAction", actionItem)
|
||||||
let message = `${combatant.name} action : ${selectedItem.name}, start rolling progression dice or casting time`
|
let message = `${combatant.name} action : ${selectedItem.name}, start rolling progression dice or casting time`
|
||||||
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
await ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||||
rollContext = (actionItem.type === "weapon") ? "rollProgressionDice" : "rollLethargyDice" // Set the roll context to rollProgressionDice
|
rollContext = (actionItem.type === "weapon") ? "rollProgressionDice" : "rollLethargyDice" // Set the roll context to rollProgressionDice
|
||||||
currentAction = actionItem
|
currentAction = actionItem
|
||||||
}
|
}
|
||||||
@@ -845,13 +949,14 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
let time = currentAction.type === "spell" ? currentAction.system.castingTime : currentAction.system.prayerTime
|
let time = currentAction.type === "spell" ? currentAction.system.castingTime : currentAction.system.prayerTime
|
||||||
if (currentAction.castingTime < time) {
|
if (currentAction.castingTime < time) {
|
||||||
let message = `Casting time : ${currentAction.name}, count : ${currentAction.castingTime}/${time}`
|
let message = `Casting time : ${currentAction.name}, count : ${currentAction.castingTime}/${time}`
|
||||||
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
await ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||||
currentAction.castingTime += 1
|
currentAction.castingTime += 1
|
||||||
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
||||||
return
|
return
|
||||||
} else {
|
} 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)
|
||||||
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
let message = `Casting time : ${currentAction.name}, count : ${time}/${time} — ready to cast next second !`
|
||||||
|
await ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||||
currentAction.castingTime = 1
|
currentAction.castingTime = 1
|
||||||
currentAction.spellStatus = "toBeCasted"
|
currentAction.spellStatus = "toBeCasted"
|
||||||
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
||||||
@@ -891,7 +996,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
isLethargy: true
|
isLethargy: true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
await ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||||
// Update the combatant progression count
|
// Update the combatant progression count
|
||||||
await combatant.setFlag(SYSTEM.id, "currentAction", "")
|
await combatant.setFlag(SYSTEM.id, "currentAction", "")
|
||||||
// Display the action selection window again
|
// Display the action selection window again
|
||||||
@@ -911,7 +1016,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
isLethargy: true
|
isLethargy: true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
await ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -923,18 +1028,18 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
let split = toSplit.split("+")
|
let split = toSplit.split("+")
|
||||||
currentAction.rangedLoad = Number(split[0]) || 0
|
currentAction.rangedLoad = Number(split[0]) || 0
|
||||||
formula = split[1]
|
formula = split[1]
|
||||||
console.log("Ranged Mode", currentAction.rangedMode, currentAction.rangedLoad, formula)
|
log("Ranged Mode", currentAction.rangedMode, currentAction.rangedLoad, formula)
|
||||||
}
|
}
|
||||||
// Range weapon loading
|
// Range weapon loading
|
||||||
if (!currentAction.weaponLoaded && currentAction.rangedLoad) {
|
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}`
|
let message = `Ranged weapon ${currentAction.name} is loading, loading count : ${currentAction.progressionCount}/${currentAction.rangedLoad}`
|
||||||
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
await ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||||
currentAction.progressionCount += 1
|
currentAction.progressionCount += 1
|
||||||
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
||||||
} else {
|
} else {
|
||||||
let message = `Ranged weapon ${currentAction.name} is loaded !`
|
let message = `Ranged weapon ${currentAction.name} is loaded !`
|
||||||
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
await ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||||
currentAction.weaponLoaded = true
|
currentAction.weaponLoaded = true
|
||||||
currentAction.progressionCount = 1
|
currentAction.progressionCount = 1
|
||||||
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
||||||
@@ -950,7 +1055,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
|
|
||||||
let max = roll.dice[0].faces - 1
|
let max = roll.dice[0].faces - 1
|
||||||
max = Math.min(currentAction.progressionCount, max)
|
max = Math.min(currentAction.progressionCount, max)
|
||||||
let msg = await roll.toMessage({ flavor: `Progression Roll for ${currentAction.name}, progression count : ${currentAction.progressionCount}/${max}` }, { rollMode: rollContext.visibility })
|
let msg = await roll.toMessage({ flavor: `Progression Roll for ${currentAction.name}, progression count : ${currentAction.progressionCount}/${max}` }, { messageMode: rollContext.visibility })
|
||||||
if (game?.dice3d) {
|
if (game?.dice3d) {
|
||||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||||
}
|
}
|
||||||
@@ -966,13 +1071,13 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rollResult: roll.total
|
rollResult: roll.total
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
await ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||||
await combatant.setFlag(SYSTEM.id, "currentAction", "")
|
await combatant.setFlag(SYSTEM.id, "currentAction", "")
|
||||||
combatant.actor.prepareRoll(currentAction.type === "weapon" ? "weapon-attack" : "spell-attack", currentAction._id)
|
combatant.actor.prepareRoll(currentAction.type === "weapon" ? "weapon-attack" : "spell-attack", currentAction._id)
|
||||||
} else {
|
} else {
|
||||||
// Notify that the player cannot act now with a chat message
|
// Notify that the player cannot act now with a chat message
|
||||||
currentAction.progressionCount += 1
|
currentAction.progressionCount += 1
|
||||||
combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
||||||
const messageContent = await foundry.applications.handlebars.renderTemplate(
|
const messageContent = await foundry.applications.handlebars.renderTemplate(
|
||||||
"systems/fvtt-lethal-fantasy/templates/progression-message.hbs",
|
"systems/fvtt-lethal-fantasy/templates/progression-message.hbs",
|
||||||
{
|
{
|
||||||
@@ -983,7 +1088,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
progressionCount: currentAction.progressionCount
|
progressionCount: currentAction.progressionCount
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
await ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -992,7 +1097,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
/* ***********************************************************/
|
/* ***********************************************************/
|
||||||
static async promptRangedDefense(options = {}) {
|
static async promptRangedDefense(options = {}) {
|
||||||
|
|
||||||
const rollModes = foundry.utils.duplicate(CONFIG.Dice.rollModes);
|
const rollModes = foundry.utils.duplicate(CONFIG.ChatMessage.modes);
|
||||||
const fieldRollMode = new foundry.data.fields.StringField({
|
const fieldRollMode = new foundry.data.fields.StringField({
|
||||||
choices: rollModes,
|
choices: rollModes,
|
||||||
blank: false,
|
blank: false,
|
||||||
@@ -1023,8 +1128,10 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
content,
|
content,
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
|
action: "rangeDefense",
|
||||||
|
type: "button",
|
||||||
label: label,
|
label: label,
|
||||||
callback: (event, button, dialog) => {
|
callback: (event, button) => {
|
||||||
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
const output = Array.from(button.form.elements).reduce((obj, input) => {
|
||||||
if (input.name) obj[input.name] = input.value
|
if (input.name) obj[input.name] = input.value
|
||||||
return obj
|
return obj
|
||||||
@@ -1039,7 +1146,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
// If the user cancels the dialog, exit
|
// If the user cancels the dialog, exit
|
||||||
if (rollContext === null) return
|
if (rollContext === null) return
|
||||||
|
|
||||||
console.log("RollContext", rollContext)
|
log("RollContext", rollContext)
|
||||||
// Add disfavor/favor option if point blank range
|
// Add disfavor/favor option if point blank range
|
||||||
if (rollContext.range === "pointblank") {
|
if (rollContext.range === "pointblank") {
|
||||||
rollContext.movement = rollContext.movement.replace("kh", "")
|
rollContext.movement = rollContext.movement.replace("kh", "")
|
||||||
@@ -1072,6 +1179,9 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
// Merge rollContext object into options object
|
// Merge rollContext object into options object
|
||||||
options = { ...options, ...rollContext }
|
options = { ...options, ...rollContext }
|
||||||
options.rollName = "Ranged Defense"
|
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 rollBase = new this(rollContext.movement, options.data, rollData)
|
||||||
const rollModifier = new Roll(modifierFormula, options.data, rollData)
|
const rollModifier = new Roll(modifierFormula, options.data, rollData)
|
||||||
@@ -1079,6 +1189,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
await rollBase.evaluate()
|
await rollBase.evaluate()
|
||||||
let rollD30 = await new Roll("1D30").evaluate()
|
let rollD30 = await new Roll("1D30").evaluate()
|
||||||
options.D30result = rollD30.total
|
options.D30result = rollD30.total
|
||||||
|
options.D30message = D30Roll.getResult(rollD30.total, options.rollType, options.rollTarget?.weapon, { isRanged: true })
|
||||||
|
|
||||||
let badResult = 0
|
let badResult = 0
|
||||||
if (rollContext.movement.includes("kh")) {
|
if (rollContext.movement.includes("kh")) {
|
||||||
@@ -1121,6 +1232,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rollBase.options.rollTarget = options.rollTarget
|
rollBase.options.rollTarget = options.rollTarget
|
||||||
rollBase.options.titleFormula = `1D20E + ${modifierFormula}`
|
rollBase.options.titleFormula = `1D20E + ${modifierFormula}`
|
||||||
rollBase.options.D30result = options.D30result
|
rollBase.options.D30result = options.D30result
|
||||||
|
rollBase.options.D30message = options.D30message
|
||||||
rollBase.options.rollName = "Ranged Defense"
|
rollBase.options.rollName = "Ranged Defense"
|
||||||
rollBase.options.badResult = badResult
|
rollBase.options.badResult = badResult
|
||||||
rollBase.options.rollData = foundry.utils.duplicate(rollData)
|
rollBase.options.rollData = foundry.utils.duplicate(rollData)
|
||||||
@@ -1137,6 +1249,163 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
return rollBase
|
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: [
|
||||||
|
{
|
||||||
|
action: "rangedAttack",
|
||||||
|
type: "button",
|
||||||
|
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.
|
* Creates a title based on the given type.
|
||||||
*
|
*
|
||||||
@@ -1157,10 +1426,8 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-attack")}`
|
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-attack")}`
|
||||||
case "weapon-defense":
|
case "weapon-defense":
|
||||||
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-defense")}`
|
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-defense")}`
|
||||||
case "weapon-damage-small":
|
case "weapon-damage":
|
||||||
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-damage-small")}`
|
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-damage")}`
|
||||||
case "weapon-damage-medium":
|
|
||||||
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-damage-medium")}`
|
|
||||||
case "spell":
|
case "spell":
|
||||||
case "spell-attack":
|
case "spell-attack":
|
||||||
case "spell-power":
|
case "spell-power":
|
||||||
@@ -1177,7 +1444,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
/** @override */
|
/** @override */
|
||||||
async render(chatOptions = {}) {
|
async render(chatOptions = {}) {
|
||||||
let chatData = await this._getChatCardData(chatOptions.isPrivate)
|
let chatData = await this._getChatCardData(chatOptions.isPrivate)
|
||||||
console.log("ChatData", chatData)
|
log("ChatData", chatData)
|
||||||
return await foundry.applications.handlebars.renderTemplate(this.constructor.CHAT_TEMPLATE, chatData)
|
return await foundry.applications.handlebars.renderTemplate(this.constructor.CHAT_TEMPLATE, chatData)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1215,16 +1482,15 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
|
|
||||||
// Récupérer les informations de l'arme pour les attaques réussies
|
// Récupérer les informations de l'arme pour les attaques réussies
|
||||||
let weaponDamageOptions = null
|
let weaponDamageOptions = null
|
||||||
console.log("Roll type:", this.type, "rollTarget:", this.rollTarget, "Has weapon:", !!this.rollTarget?.weapon)
|
log("Roll type:", this.type, "rollTarget:", this.rollTarget, "Has weapon:", !!this.rollTarget?.weapon)
|
||||||
if (this.type === "weapon-attack" && this.rollTarget?.weapon) {
|
if (this.type === "weapon-attack" && this.rollTarget?.weapon) {
|
||||||
const weapon = this.rollTarget.weapon
|
const weapon = this.rollTarget.weapon
|
||||||
weaponDamageOptions = {
|
weaponDamageOptions = {
|
||||||
weaponId: weapon._id || weapon.id,
|
weaponId: weapon.id,
|
||||||
weaponName: weapon.name,
|
weaponName: weapon.name,
|
||||||
damageS: weapon.system?.damage?.damageS,
|
|
||||||
damageM: weapon.system?.damage?.damageM
|
damageM: weapon.system?.damage?.damageM
|
||||||
}
|
}
|
||||||
console.log("Weapon damage options:", weaponDamageOptions)
|
log("Weapon damage options:", weaponDamageOptions)
|
||||||
} else if (this.type === "monster-attack" && this.rollTarget) {
|
} else if (this.type === "monster-attack" && this.rollTarget) {
|
||||||
weaponDamageOptions = {
|
weaponDamageOptions = {
|
||||||
weaponId: this.rollTarget.rollKey,
|
weaponId: this.rollTarget.rollKey,
|
||||||
@@ -1233,7 +1499,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
damageModifier: this.rollTarget.damageModifier,
|
damageModifier: this.rollTarget.damageModifier,
|
||||||
isMonster: true
|
isMonster: true
|
||||||
}
|
}
|
||||||
console.log("Monster damage options:", weaponDamageOptions)
|
log("Monster damage options:", weaponDamageOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
const cardData = {
|
const cardData = {
|
||||||
@@ -1278,12 +1544,12 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
*
|
*
|
||||||
* @param {Object} [messageData={}] Additional data to include in the message.
|
* @param {Object} [messageData={}] Additional data to include in the message.
|
||||||
* @param {Object} options Options for message creation.
|
* @param {Object} options Options for message creation.
|
||||||
* @param {string} options.rollMode The mode of the roll (e.g., public, private).
|
* @param {string} options.messageMode The mode of the roll (e.g., public, private).
|
||||||
* @param {boolean} [options.create=true] Whether to create the message.
|
* @param {boolean} [options.create=true] Whether to create the message.
|
||||||
* @returns {Promise} - A promise that resolves when the message is created.
|
* @returns {Promise} - A promise that resolves when the message is created.
|
||||||
*/
|
*/
|
||||||
async toMessage(messageData = {}, { rollMode, create = true } = {}) {
|
async toMessage(messageData = {}, { messageMode, create = true } = {}) {
|
||||||
super.toMessage(
|
return await super.toMessage(
|
||||||
{
|
{
|
||||||
isSave: this.isSave,
|
isSave: this.isSave,
|
||||||
isChallenge: this.isChallenge,
|
isChallenge: this.isChallenge,
|
||||||
@@ -1300,8 +1566,46 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rollData: this.rollData,
|
rollData: this.rollData,
|
||||||
...messageData,
|
...messageData,
|
||||||
},
|
},
|
||||||
{ rollMode: rollMode },
|
{ messageMode, create },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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()
|
||||||
|
// 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()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -32,20 +32,20 @@ export class Macros {
|
|||||||
dropData.rollType === "save"
|
dropData.rollType === "save"
|
||||||
? `game.actors.get('${dropData.actorId}').system.roll('${dropData.rollType}', '${dropData.rollTarget}', '=');`
|
? `game.actors.get('${dropData.actorId}').system.roll('${dropData.rollType}', '${dropData.rollTarget}', '=');`
|
||||||
: `game.actors.get('${dropData.actorId}').system.roll('${dropData.rollType}', '${dropData.rollTarget}');`
|
: `game.actors.get('${dropData.actorId}').system.roll('${dropData.rollType}', '${dropData.rollTarget}');`
|
||||||
const rollName = `${game.i18n.localize("TENEBRIS.Label.jet")} ${game.i18n.localize(`TENEBRIS.Manager.${dropData.rollTarget}`)}`
|
const rollName = `${game.i18n.localize("LETHALFANTASY.Label.jet")} ${game.i18n.localize(`LETHALFANTASY.Label.${dropData.rollTarget}`)}`
|
||||||
this.createMacro(slot, rollName, rollCommand, "icons/svg/d20-grey.svg")
|
this.createMacro(slot, rollName, rollCommand, "icons/svg/d20-grey.svg")
|
||||||
break
|
break
|
||||||
|
|
||||||
case "rollDamage":
|
case "rollDamage":
|
||||||
const weapon = game.actors.get(dropData.actorId).items.get(dropData.rollTarget)
|
const weapon = game.actors.get(dropData.actorId).items.get(dropData.rollTarget)
|
||||||
const rollDamageCommand = `game.actors.get('${dropData.actorId}').system.roll('${dropData.rollType}', '${dropData.rollTarget}');`
|
const rollDamageCommand = `game.actors.get('${dropData.actorId}').system.roll('${dropData.rollType}', '${dropData.rollTarget}');`
|
||||||
const rollDamageName = `${game.i18n.localize("TENEBRIS.Label.jet")} ${weapon.name}`
|
const rollDamageName = `${game.i18n.localize("LETHALFANTASY.Label.jet")} ${weapon.name}`
|
||||||
this.createMacro(slot, rollDamageName, rollDamageCommand, weapon.img)
|
this.createMacro(slot, rollDamageName, rollDamageCommand, weapon.img)
|
||||||
break
|
break
|
||||||
|
|
||||||
case "rollAttack":
|
case "rollAttack":
|
||||||
const rollAttackCommand = `game.actors.get('${dropData.actorId}').system.roll('${dropData.rollValue}', '${dropData.rollTarget}');`
|
const rollAttackCommand = `game.actors.get('${dropData.actorId}').system.roll('${dropData.rollValue}', '${dropData.rollTarget}');`
|
||||||
const rollAttackName = `${game.i18n.localize("TENEBRIS.Label.jet")} ${dropData.rollTarget}`
|
const rollAttackName = `${game.i18n.localize("LETHALFANTASY.Label.jet")} ${dropData.rollTarget}`
|
||||||
this.createMacro(slot, rollAttackName, rollAttackCommand, "icons/svg/d20-grey.svg")
|
this.createMacro(slot, rollAttackName, rollAttackCommand, "icons/svg/d20-grey.svg")
|
||||||
break
|
break
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ export class Macros {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a macro
|
* Create a macro
|
||||||
* All macros are flaged with a tenebris.macro flag at true
|
* All macros are flaged with a lethalFantasy.macro flag at true
|
||||||
* @param {*} slot
|
* @param {*} slot
|
||||||
* @param {*} name
|
* @param {*} name
|
||||||
* @param {*} command
|
* @param {*} command
|
||||||
@@ -72,7 +72,7 @@ export class Macros {
|
|||||||
type: "script",
|
type: "script",
|
||||||
img: img,
|
img: img,
|
||||||
command: command,
|
command: command,
|
||||||
flags: { "tenebris.macro": true },
|
flags: { "lethalFantasy.macro": true },
|
||||||
},
|
},
|
||||||
{ displaySheet: false },
|
{ displaySheet: false },
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
}
|
}
|
||||||
|
|
||||||
schema.hp = new fields.SchemaField({
|
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 }),
|
max: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
||||||
painDamage: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
painDamage: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
wounds: new fields.ArrayField(new fields.SchemaField(woundFieldSchema), {
|
wounds: new fields.ArrayField(new fields.SchemaField(woundFieldSchema), {
|
||||||
@@ -152,9 +152,11 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
attackModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
attackModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
rangedAttackModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
rangedAttackModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
defenseModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
defenseModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
|
rangedDefenseModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
defenseBonus: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
defenseBonus: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
damageModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
damageModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
armorHitPoints: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
armorHitPoints: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
|
combatProgressionStart: new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 }),
|
||||||
})
|
})
|
||||||
|
|
||||||
const moneyField = (label) => {
|
const moneyField = (label) => {
|
||||||
@@ -258,6 +260,12 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
this.combat.defenseModifier += chaDef.defense
|
this.combat.defenseModifier += chaDef.defense
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.combat.rangedDefenseModifier = this.combat.defenseBonus
|
||||||
|
for (let chaKey of SYSTEM.CHARACTERISTIC_RANGED_DEFENSE) {
|
||||||
|
let chaDef = SYSTEM.CHARACTERISTICS_TABLES[chaKey].find(s => s.value === this.characteristics[chaKey].value)
|
||||||
|
this.combat.rangedDefenseModifier += chaDef.defense
|
||||||
|
}
|
||||||
|
|
||||||
this.combat.damageModifier = 0
|
this.combat.damageModifier = 0
|
||||||
for (let chaKey of SYSTEM.CHARACTERISTIC_DAMAGE) {
|
for (let chaKey of SYSTEM.CHARACTERISTIC_DAMAGE) {
|
||||||
let chaDef = SYSTEM.CHARACTERISTICS_TABLES[chaKey].find(s => s.value === this.characteristics[chaKey].value)
|
let chaDef = SYSTEM.CHARACTERISTICS_TABLES[chaKey].find(s => s.value === this.characteristics[chaKey].value)
|
||||||
@@ -273,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 (=).
|
* @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.
|
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
|
||||||
*/
|
*/
|
||||||
async roll(rollType, rollTarget, defenderId) {
|
async roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr = 0, d30Effects = {}) {
|
||||||
const hasTarget = false
|
const hasTarget = false
|
||||||
let roll = await LethalFantasyRoll.prompt({
|
let roll = await LethalFantasyRoll.prompt({
|
||||||
rollType,
|
rollType,
|
||||||
@@ -283,11 +291,17 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
actorImage: this.parent.img,
|
actorImage: this.parent.img,
|
||||||
hasTarget,
|
hasTarget,
|
||||||
target: false,
|
target: false,
|
||||||
defenderId
|
defenderId,
|
||||||
|
defenderTokenId,
|
||||||
|
extraShieldDr,
|
||||||
|
damageTier: rollTarget.damageTier || "standard",
|
||||||
|
d30Bleed: d30Effects.d30Bleed || false,
|
||||||
|
d30DamageMultiplier: d30Effects.d30DamageMultiplier || 1,
|
||||||
|
d30DrMultiplier: d30Effects.d30DrMultiplier || 1
|
||||||
})
|
})
|
||||||
if (!roll) return null
|
if (!roll) return null
|
||||||
|
|
||||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
await roll.toMessage({}, { messageMode: roll.options.rollMode })
|
||||||
}
|
}
|
||||||
|
|
||||||
async rollInitiative(combatId = undefined, combatantId = undefined) {
|
async rollInitiative(combatId = undefined, combatantId = undefined) {
|
||||||
@@ -308,7 +322,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
})
|
})
|
||||||
if (!roll) return null
|
if (!roll) return null
|
||||||
|
|
||||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
await roll.toMessage({}, { messageMode: roll.options.rollMode })
|
||||||
}
|
}
|
||||||
|
|
||||||
async rollProgressionDice(combatId, combatantId, rollProgressionCount) {
|
async rollProgressionDice(combatId, combatantId, rollProgressionCount) {
|
||||||
@@ -346,6 +360,11 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (weaponsChoices.length === 0) {
|
||||||
|
ui.notifications.warn(`${this.parent.name} has no weapons or spells available for combat. Add a weapon to the character sheet first.`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let roll = await LethalFantasyRoll.promptCombatAction({
|
let roll = await LethalFantasyRoll.promptCombatAction({
|
||||||
actorId: this.parent.id,
|
actorId: this.parent.id,
|
||||||
actorName: this.parent.name,
|
actorName: this.parent.name,
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ export default class LethalFantasyMiracle extends foundry.abstract.TypeDataModel
|
|||||||
|
|
||||||
schema.attackRoll = new fields.StringField({ required: true, initial: "" })
|
schema.attackRoll = new fields.StringField({ required: true, initial: "" })
|
||||||
schema.powerRoll = new fields.StringField({ required: true, initial: "" })
|
schema.powerRoll = new fields.StringField({ required: true, initial: "" })
|
||||||
|
schema.damageDice = new fields.StringField({ required: false, initial: "" })
|
||||||
|
schema.damageDiceOverpowered = new fields.StringField({ required: false, initial: "" })
|
||||||
|
schema.damageDiceOverpowered2 = new fields.StringField({ required: false, initial: "" })
|
||||||
|
|
||||||
return schema
|
return schema
|
||||||
}
|
}
|
||||||
|
|||||||
+91
-23
@@ -56,15 +56,33 @@ 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({
|
schema.hp = new fields.SchemaField({
|
||||||
value: new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 }),
|
value: new fields.NumberField({ ...requiredInteger, initial: 1 }),
|
||||||
average: 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 }),
|
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 }),
|
damageResistance: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
painDamage: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
painDamage: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||||
})
|
})
|
||||||
|
|
||||||
const attackField = (label) => {
|
const attackField = (label, initialNoExplode = false) => {
|
||||||
const schema = {
|
const schema = {
|
||||||
key: new fields.StringField({ required: true, nullable: false, initial: `attack${label}` }),
|
key: new fields.StringField({ required: true, nullable: false, initial: `attack${label}` }),
|
||||||
name: new fields.StringField({ required: true, nullable: false, initial: `Attack ${label}` }),
|
name: new fields.StringField({ required: true, nullable: false, initial: `Attack ${label}` }),
|
||||||
@@ -74,6 +92,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
damageDice: new fields.StringField({ required: true, nullable: false, initial: "1D6" }),
|
damageDice: new fields.StringField({ required: true, nullable: false, initial: "1D6" }),
|
||||||
damageModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
damageModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
enabled: new fields.BooleanField({ initial: true, required: true, nullable: false }),
|
enabled: new fields.BooleanField({ initial: true, required: true, nullable: false }),
|
||||||
|
noExplode: new fields.BooleanField({ initial: initialNoExplode, required: true, nullable: false }),
|
||||||
}
|
}
|
||||||
return new fields.SchemaField(schema, { label })
|
return new fields.SchemaField(schema, { label })
|
||||||
}
|
}
|
||||||
@@ -123,10 +142,32 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
shieldDefenseDice: new fields.StringField({ required: true, nullable: false, initial: "d4" })
|
shieldDefenseDice: new fields.StringField({ required: true, nullable: false, initial: "d4" })
|
||||||
})
|
})
|
||||||
schema.combatHTH = new fields.SchemaField({
|
schema.combatHTH = new fields.SchemaField({
|
||||||
attack1: attackField("1"),
|
attack1: attackField("1", true),
|
||||||
attack2: attackField("2")
|
attack2: attackField("2", true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
schema.attackMode = new fields.StringField({
|
||||||
|
required: true,
|
||||||
|
nullable: false,
|
||||||
|
initial: "melee",
|
||||||
|
choices: { melee: "Melee", ranged: "Ranged" }
|
||||||
|
})
|
||||||
|
|
||||||
|
schema.rangedAttacks = new fields.SchemaField({
|
||||||
|
attack1: attackField("1"),
|
||||||
|
attack2: attackField("2"),
|
||||||
|
attack3: attackField("3"),
|
||||||
|
attack4: attackField("4")
|
||||||
|
})
|
||||||
|
|
||||||
|
schema.rangedWeaponRange = new fields.SchemaField({
|
||||||
|
pointBlank: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }),
|
||||||
|
short: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }),
|
||||||
|
medium: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }),
|
||||||
|
long: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }),
|
||||||
|
extreme: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 }),
|
||||||
|
outOfSkill: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||||
|
})
|
||||||
|
|
||||||
return schema
|
return schema
|
||||||
}
|
}
|
||||||
@@ -141,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 (=).
|
* @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.
|
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
|
||||||
*/
|
*/
|
||||||
async roll(rollType, rollTarget, defenderId = undefined) {
|
async roll(rollType, rollTarget, defenderId = undefined, defenderTokenId = undefined, extraShieldDr = 0, d30Effects = {}) {
|
||||||
const hasTarget = false
|
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({
|
let roll = await LethalFantasyRoll.prompt({
|
||||||
rollType,
|
rollType,
|
||||||
rollTarget,
|
rollTarget,
|
||||||
@@ -151,26 +208,38 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
actorImage: this.parent.img,
|
actorImage: this.parent.img,
|
||||||
hasTarget,
|
hasTarget,
|
||||||
target: false,
|
target: false,
|
||||||
defenderId
|
defenderId,
|
||||||
|
defenderTokenId,
|
||||||
|
extraShieldDr,
|
||||||
|
damageTier: rollTarget.damageTier || "standard",
|
||||||
|
d30Bleed: d30Effects.d30Bleed || false,
|
||||||
|
d30DamageMultiplier: d30Effects.d30DamageMultiplier || 1,
|
||||||
|
d30DrMultiplier: d30Effects.d30DrMultiplier || 1
|
||||||
})
|
})
|
||||||
if (!roll) return null
|
if (!roll) return null
|
||||||
|
|
||||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
await roll.toMessage({}, { messageMode: roll.options.rollMode })
|
||||||
}
|
}
|
||||||
|
|
||||||
async prepareMonsterRoll(rollType, rollKey, rollDice = undefined, tokenId = undefined, damageModifier = undefined, defenderId = undefined) {
|
async prepareMonsterRoll(rollType, rollKey, rollDice = undefined, tokenId = undefined, damageModifier = undefined, defenderId = undefined, defenderTokenId = undefined, extraShieldDr = 0, d30Effects = {}) {
|
||||||
let rollTarget
|
let rollTarget
|
||||||
switch (rollType) {
|
switch (rollType) {
|
||||||
case "monster-attack":
|
case "monster-attack":
|
||||||
case "monster-defense":
|
case "monster-defense":
|
||||||
case "monster-damage":
|
case "monster-damage": {
|
||||||
rollTarget = foundry.utils.duplicate(this.attacks[rollKey])
|
const attacksSet = this.attackMode === "ranged" ? this.rangedAttacks : this.attacks
|
||||||
|
rollTarget = foundry.utils.duplicate(attacksSet[rollKey])
|
||||||
rollTarget.rollKey = rollKey
|
rollTarget.rollKey = rollKey
|
||||||
|
rollTarget.attackMode = this.attackMode
|
||||||
|
if (rollType === "monster-defense") {
|
||||||
|
rollTarget.isRangedDefense = game.lethalFantasy?.nextDefenseData?.isRanged ?? false
|
||||||
|
}
|
||||||
// Si damageModifier est fourni (depuis le chat), l'utiliser au lieu de celui de la fiche
|
// Si damageModifier est fourni (depuis le chat), l'utiliser au lieu de celui de la fiche
|
||||||
if (damageModifier !== undefined && rollType === "monster-damage") {
|
if (damageModifier !== undefined && rollType === "monster-damage") {
|
||||||
rollTarget.damageModifier = damageModifier
|
rollTarget.damageModifier = damageModifier
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
}
|
||||||
case "monster-attack-hth":
|
case "monster-attack-hth":
|
||||||
case "monster-defense-hth":
|
case "monster-defense-hth":
|
||||||
case "monster-damage-hth":
|
case "monster-damage-hth":
|
||||||
@@ -202,11 +271,10 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
await roll.toMessage({
|
await roll.toMessage({
|
||||||
flavor,
|
flavor,
|
||||||
speaker: ChatMessage.getSpeaker({ actor: this.parent })
|
speaker: ChatMessage.getSpeaker({ actor: this.parent })
|
||||||
})
|
}, { messageMode: roll.options.rollMode ?? game.settings.get("core", "rollMode") })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case "weapon-damage-small":
|
case "weapon-damage":
|
||||||
case "weapon-damage-medium":
|
|
||||||
case "weapon-attack":
|
case "weapon-attack":
|
||||||
case "weapon-defense": {
|
case "weapon-defense": {
|
||||||
let weapon = this.actor.items.find((i) => i.type === "weapon" && i.id === rollKey)
|
let weapon = this.actor.items.find((i) => i.type === "weapon" && i.id === rollKey)
|
||||||
@@ -239,7 +307,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
rollTarget = skill
|
rollTarget = skill
|
||||||
rollTarget.weapon = weapon
|
rollTarget.weapon = foundry.utils.duplicate(weapon)
|
||||||
rollTarget.weaponSkillModifier = skill.weaponSkillModifier
|
rollTarget.weaponSkillModifier = skill.weaponSkillModifier
|
||||||
rollTarget.rollKey = rollKey
|
rollTarget.rollKey = rollKey
|
||||||
rollTarget.combat = foundry.utils.duplicate(this.combat)
|
rollTarget.combat = foundry.utils.duplicate(this.combat)
|
||||||
@@ -253,8 +321,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
// In all cases
|
// In all cases
|
||||||
if (rollTarget) {
|
if (rollTarget) {
|
||||||
rollTarget.tokenId = tokenId
|
rollTarget.tokenId = tokenId
|
||||||
console.log(rollTarget)
|
await this.roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr, d30Effects)
|
||||||
await this.roll(rollType, rollTarget, defenderId)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,7 +341,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
})
|
})
|
||||||
if (!roll) return null
|
if (!roll) return null
|
||||||
|
|
||||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
await roll.toMessage({}, { messageMode: roll.options.rollMode })
|
||||||
}
|
}
|
||||||
|
|
||||||
async rollProgressionDice(combatId, combatantId) {
|
async rollProgressionDice(combatId, combatantId) {
|
||||||
@@ -286,7 +353,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const rollModes = foundry.utils.duplicate(CONFIG.Dice.rollModes)
|
const rollModes = foundry.utils.duplicate(CONFIG.ChatMessage.modes)
|
||||||
const fieldRollMode = new foundry.data.fields.StringField({
|
const fieldRollMode = new foundry.data.fields.StringField({
|
||||||
choices: rollModes,
|
choices: rollModes,
|
||||||
blank: false,
|
blank: false,
|
||||||
@@ -302,8 +369,9 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
let hasAttack = false
|
let hasAttack = false
|
||||||
for (let key in this.attacks) {
|
const attacksSet = this.attackMode === "ranged" ? this.rangedAttacks : this.attacks
|
||||||
let attack = this.attacks[key]
|
for (let key in attacksSet) {
|
||||||
|
let attack = attacksSet[key]
|
||||||
if (attack.enabled && attack.attackScore > 0 && attack.attackScore === roll.total) {
|
if (attack.enabled && attack.attackScore > 0 && attack.attackScore === roll.total) {
|
||||||
hasAttack = true
|
hasAttack = true
|
||||||
const messageContent = await foundry.applications.handlebars.renderTemplate(
|
const messageContent = await foundry.applications.handlebars.renderTemplate(
|
||||||
@@ -315,7 +383,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
rollResult: roll.total
|
rollResult: roll.total
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: this.parent }) })
|
await ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: this.parent }) })
|
||||||
let token = combatant?.token
|
let token = combatant?.token
|
||||||
this.prepareMonsterRoll("monster-attack", key, undefined, token?.id)
|
this.prepareMonsterRoll("monster-attack", key, undefined, token?.id)
|
||||||
if (token?.object) {
|
if (token?.object) {
|
||||||
@@ -339,7 +407,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
rollResult: roll.total
|
rollResult: roll.total
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: this.parent }) })
|
await ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: this.parent }) })
|
||||||
let token = combatant?.token
|
let token = combatant?.token
|
||||||
this.prepareMonsterRoll("monster-attack-hth", key, undefined, token?.id)
|
this.prepareMonsterRoll("monster-attack-hth", key, undefined, token?.id)
|
||||||
if (token?.object) {
|
if (token?.object) {
|
||||||
@@ -358,7 +426,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
rollResult: roll.total
|
rollResult: roll.total
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: this.parent }) })
|
await ChatMessage.create({ content: messageContent, speaker: ChatMessage.getSpeaker({ actor: this.parent }) })
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.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.memorized = new fields.BooleanField({ required: true, initial: false })
|
||||||
|
|
||||||
schema.components = new fields.SchemaField({
|
schema.components = new fields.SchemaField({
|
||||||
@@ -39,6 +41,9 @@ export default class LethalFantasySpell extends foundry.abstract.TypeDataModel {
|
|||||||
|
|
||||||
schema.attackRoll = new fields.StringField({ required: true, initial: "" })
|
schema.attackRoll = new fields.StringField({ required: true, initial: "" })
|
||||||
schema.powerRoll = new fields.StringField({ required: true, initial: "" })
|
schema.powerRoll = new fields.StringField({ required: true, initial: "" })
|
||||||
|
schema.damageDice = new fields.StringField({ required: false, initial: "" })
|
||||||
|
schema.damageDiceOverpowered = new fields.StringField({ required: false, initial: "" })
|
||||||
|
schema.damageDiceOverpowered2 = new fields.StringField({ required: false, initial: "" })
|
||||||
|
|
||||||
return schema
|
return schema
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { SYSTEM } from "../config/system.mjs"
|
import { SYSTEM } from "../config/system.mjs"
|
||||||
|
import { WEAPON_TYPE } from "../config/weapon.mjs"
|
||||||
|
|
||||||
export default class LethalFantasySkill extends foundry.abstract.TypeDataModel {
|
export default class LethalFantasyWeapon extends foundry.abstract.TypeDataModel {
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
const fields = foundry.data.fields
|
const fields = foundry.data.fields
|
||||||
const schema = {}
|
const schema = {}
|
||||||
@@ -45,9 +46,9 @@ export default class LethalFantasySkill extends foundry.abstract.TypeDataModel {
|
|||||||
})
|
})
|
||||||
|
|
||||||
schema.bonuses = new fields.SchemaField({
|
schema.bonuses = new fields.SchemaField({
|
||||||
attackBonus: 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, min: 0 }),
|
damageBonus: new fields.NumberField({ ...requiredInteger, required: true, initial: 0 }),
|
||||||
defenseBonus: new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
defenseBonus: new fields.NumberField({ ...requiredInteger, required: true, initial: 0 })
|
||||||
})
|
})
|
||||||
|
|
||||||
schema.encLoad = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
schema.encLoad = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||||
@@ -62,7 +63,7 @@ export default class LethalFantasySkill extends foundry.abstract.TypeDataModel {
|
|||||||
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Weapon"]
|
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Weapon"]
|
||||||
|
|
||||||
get weaponCategory() {
|
get weaponCategory() {
|
||||||
return game.i18n.localize(CATEGORY[this.weaponType].label)
|
return game.i18n.localize(WEAPON_TYPE[this.weaponType] || this.weaponType)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+938
-53
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
|||||||
MANIFEST-000527
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
2026/01/19-20:32:07.348929 7f14d8ff96c0 Recovering log #525
|
|
||||||
2026/01/19-20:32:07.358983 7f14d8ff96c0 Delete type=3 #523
|
|
||||||
2026/01/19-20:32:07.359059 7f14d8ff96c0 Delete type=0 #525
|
|
||||||
2026/01/19-22:34:04.043006 7f1243fff6c0 Level-0 table #530: started
|
|
||||||
2026/01/19-22:34:04.043050 7f1243fff6c0 Level-0 table #530: 0 bytes OK
|
|
||||||
2026/01/19-22:34:04.052889 7f1243fff6c0 Delete type=0 #528
|
|
||||||
2026/01/19-22:34:04.082744 7f1243fff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
|
||||||
2026/01/19-22:34:04.092309 7f1243fff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
2026/01/19-20:23:50.466717 7f14da7fc6c0 Recovering log #521
|
|
||||||
2026/01/19-20:23:50.476745 7f14da7fc6c0 Delete type=3 #519
|
|
||||||
2026/01/19-20:23:50.476798 7f14da7fc6c0 Delete type=0 #521
|
|
||||||
2026/01/19-20:32:02.937243 7f1243fff6c0 Level-0 table #526: started
|
|
||||||
2026/01/19-20:32:02.937265 7f1243fff6c0 Level-0 table #526: 0 bytes OK
|
|
||||||
2026/01/19-20:32:02.943907 7f1243fff6c0 Delete type=0 #524
|
|
||||||
2026/01/19-20:32:02.956456 7f1243fff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
|
||||||
2026/01/19-20:32:02.956498 7f1243fff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
|
||||||
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
MANIFEST-000524
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
2026/01/19-20:32:07.362345 7f14d9ffb6c0 Recovering log #522
|
|
||||||
2026/01/19-20:32:07.372537 7f14d9ffb6c0 Delete type=3 #520
|
|
||||||
2026/01/19-20:32:07.372596 7f14d9ffb6c0 Delete type=0 #522
|
|
||||||
2026/01/19-22:34:04.165591 7f1243fff6c0 Level-0 table #527: started
|
|
||||||
2026/01/19-22:34:04.165637 7f1243fff6c0 Level-0 table #527: 0 bytes OK
|
|
||||||
2026/01/19-22:34:04.175509 7f1243fff6c0 Delete type=0 #525
|
|
||||||
2026/01/19-22:34:04.175734 7f1243fff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
|
||||||
2026/01/19-22:34:04.175767 7f1243fff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
2026/01/19-20:23:50.482057 7f14d8ff96c0 Recovering log #518
|
|
||||||
2026/01/19-20:23:50.491682 7f14d8ff96c0 Delete type=3 #516
|
|
||||||
2026/01/19-20:23:50.491756 7f14d8ff96c0 Delete type=0 #518
|
|
||||||
2026/01/19-20:32:02.944004 7f1243fff6c0 Level-0 table #523: started
|
|
||||||
2026/01/19-20:32:02.944026 7f1243fff6c0 Level-0 table #523: 0 bytes OK
|
|
||||||
2026/01/19-20:32:02.950204 7f1243fff6c0 Delete type=0 #521
|
|
||||||
2026/01/19-20:32:02.956469 7f1243fff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
|
||||||
2026/01/19-20:32:02.956510 7f1243fff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
|
||||||
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
MANIFEST-000529
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
2026/01/19-20:32:07.335896 7f14d97fa6c0 Recovering log #527
|
|
||||||
2026/01/19-20:32:07.346053 7f14d97fa6c0 Delete type=3 #525
|
|
||||||
2026/01/19-20:32:07.346120 7f14d97fa6c0 Delete type=0 #527
|
|
||||||
2026/01/19-22:34:04.092377 7f1243fff6c0 Level-0 table #532: started
|
|
||||||
2026/01/19-22:34:04.092412 7f1243fff6c0 Level-0 table #532: 0 bytes OK
|
|
||||||
2026/01/19-22:34:04.101864 7f1243fff6c0 Delete type=0 #530
|
|
||||||
2026/01/19-22:34:04.133480 7f1243fff6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
|
||||||
2026/01/19-22:34:04.133550 7f1243fff6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
2026/01/19-20:23:50.451679 7f14d9ffb6c0 Recovering log #523
|
|
||||||
2026/01/19-20:23:50.462356 7f14d9ffb6c0 Delete type=3 #521
|
|
||||||
2026/01/19-20:23:50.462416 7f14d9ffb6c0 Delete type=0 #523
|
|
||||||
2026/01/19-20:32:02.930994 7f1243fff6c0 Level-0 table #528: started
|
|
||||||
2026/01/19-20:32:02.931037 7f1243fff6c0 Level-0 table #528: 0 bytes OK
|
|
||||||
2026/01/19-20:32:02.937118 7f1243fff6c0 Delete type=0 #526
|
|
||||||
2026/01/19-20:32:02.956440 7f1243fff6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
|
||||||
2026/01/19-20:32:02.956479 7f1243fff6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
|
||||||
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
MANIFEST-000224
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
2026/01/19-20:32:07.386680 7f14d97fa6c0 Recovering log #222
|
|
||||||
2026/01/19-20:32:07.397058 7f14d97fa6c0 Delete type=3 #220
|
|
||||||
2026/01/19-20:32:07.397159 7f14d97fa6c0 Delete type=0 #222
|
|
||||||
2026/01/19-22:34:04.082756 7f1243fff6c0 Level-0 table #227: started
|
|
||||||
2026/01/19-22:34:04.082796 7f1243fff6c0 Level-0 table #227: 0 bytes OK
|
|
||||||
2026/01/19-22:34:04.092156 7f1243fff6c0 Delete type=0 #225
|
|
||||||
2026/01/19-22:34:04.092321 7f1243fff6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
|
||||||
2026/01/19-22:34:04.092355 7f1243fff6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
2026/01/19-20:23:50.510934 7f14d97fa6c0 Recovering log #218
|
|
||||||
2026/01/19-20:23:50.520501 7f14d97fa6c0 Delete type=3 #216
|
|
||||||
2026/01/19-20:23:50.520578 7f14d97fa6c0 Delete type=0 #218
|
|
||||||
2026/01/19-20:32:02.976313 7f1243fff6c0 Level-0 table #223: started
|
|
||||||
2026/01/19-20:32:02.976359 7f1243fff6c0 Level-0 table #223: 0 bytes OK
|
|
||||||
2026/01/19-20:32:02.982272 7f1243fff6c0 Delete type=0 #221
|
|
||||||
2026/01/19-20:32:02.982509 7f1243fff6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
|
||||||
2026/01/19-20:32:02.982604 7f1243fff6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
|
||||||
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
MANIFEST-000523
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
2026/01/19-20:32:07.374730 7f14d8ff96c0 Recovering log #521
|
|
||||||
2026/01/19-20:32:07.384387 7f14d8ff96c0 Delete type=3 #519
|
|
||||||
2026/01/19-20:32:07.384466 7f14d8ff96c0 Delete type=0 #521
|
|
||||||
2026/01/19-22:34:04.031975 7f1243fff6c0 Level-0 table #526: started
|
|
||||||
2026/01/19-22:34:04.032019 7f1243fff6c0 Level-0 table #526: 0 bytes OK
|
|
||||||
2026/01/19-22:34:04.042831 7f1243fff6c0 Delete type=0 #524
|
|
||||||
2026/01/19-22:34:04.082725 7f1243fff6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
|
||||||
2026/01/19-22:34:04.092294 7f1243fff6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
2026/01/19-20:23:50.495445 7f14d9ffb6c0 Recovering log #517
|
|
||||||
2026/01/19-20:23:50.506507 7f14d9ffb6c0 Delete type=3 #515
|
|
||||||
2026/01/19-20:23:50.506583 7f14d9ffb6c0 Delete type=0 #517
|
|
||||||
2026/01/19-20:32:02.950374 7f1243fff6c0 Level-0 table #522: started
|
|
||||||
2026/01/19-20:32:02.950415 7f1243fff6c0 Level-0 table #522: 0 bytes OK
|
|
||||||
2026/01/19-20:32:02.956303 7f1243fff6c0 Delete type=0 #520
|
|
||||||
2026/01/19-20:32:02.956488 7f1243fff6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
|
||||||
2026/01/19-20:32:02.956546 7f1243fff6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
|
||||||
Binary file not shown.
@@ -387,11 +387,11 @@
|
|||||||
min-width: 6rem;
|
min-width: 6rem;
|
||||||
max-width: 6rem;
|
max-width: 6rem;
|
||||||
}
|
}
|
||||||
min-width: 10rem;
|
min-width: 11rem;
|
||||||
max-width: 10rem;
|
max-width: 11rem;
|
||||||
.input {
|
.input {
|
||||||
min-width: 2.5rem;
|
min-width: 3.5rem;
|
||||||
max-width: 2.5rem;
|
max-width: 3.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.granted {
|
.granted {
|
||||||
|
|||||||
+69
-12
@@ -145,9 +145,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.grit-luck-dialog {
|
.grit-luck-dialog {
|
||||||
|
color: var(--color-text-dark-primary, #191813);
|
||||||
|
|
||||||
.combat-status {
|
.combat-status {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
background: linear-gradient(to bottom, rgba(42, 41, 32, 0.8) 0%, rgba(26, 25, 16, 0.9) 100%);
|
background: linear-gradient(to bottom, rgba(42, 41, 32, 0.88) 0%, rgba(26, 25, 16, 0.95) 100%);
|
||||||
border: 1px solid rgba(212, 175, 55, 0.5);
|
border: 1px solid rgba(212, 175, 55, 0.5);
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
@@ -171,11 +173,27 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.offer-text {
|
.offer-text {
|
||||||
color: #f0e6d2;
|
color: var(--color-text-dark-primary, #191813);
|
||||||
font-size: calc(var(--font-size-standard) * 1);
|
font-size: calc(var(--font-size-standard) * 1);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
margin: 0 0 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shield-warning {
|
||||||
|
color: #7a4000;
|
||||||
|
background: rgba(255, 160, 0, 0.12);
|
||||||
|
border: 1px solid rgba(255, 160, 0, 0.4);
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: calc(var(--font-size-standard) * 0.88);
|
||||||
|
padding: 6px 10px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
i {
|
||||||
|
color: #c07000;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,33 +301,72 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.attack-result-damage {
|
.attack-result-damage {
|
||||||
display: flex;
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
justify-content: center;
|
|
||||||
|
&.single-btn {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
max-width: 280px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.spell-damage {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.roll-damage-btn {
|
.roll-damage-btn {
|
||||||
padding: 10px 16px;
|
padding: 10px 14px;
|
||||||
background: linear-gradient(to bottom, #8b0000 0%, #660000 100%);
|
background: linear-gradient(to bottom, #8b0000 0%, #660000 100%);
|
||||||
border: 1px solid #ff0000;
|
border: 1px solid #4b0000;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
color: #f0e6d2;
|
color: #f0e6d2;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
font-size: calc(var(--font-size-standard) * 0.9);
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: -100%;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
|
||||||
|
transition: left 0.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover::before {
|
||||||
|
left: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: calc(var(--font-size-standard) * 1.1);
|
||||||
|
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: linear-gradient(to bottom, #a00000 0%, #7b0000 100%);
|
background: linear-gradient(to bottom, #a00000 0%, #7b0000 100%);
|
||||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
|
border-color: #5b0000;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 3px rgba(0, 0, 0, 0.3);
|
||||||
|
|
||||||
i {
|
|
||||||
margin-right: 6px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+354
-2
@@ -35,10 +35,362 @@
|
|||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
width: max-content;
|
width: max-content;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color:#252424;
|
color: #252424;
|
||||||
}
|
}
|
||||||
|
|
||||||
#token-hud .hp-loss-wrap .hud-loss-hp-button-select {
|
#token-hud .hp-loss-wrap .hud-loss-hp-button-select {
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* HP Gain Styles */
|
||||||
|
#token-hud .hp-gain-wrap {
|
||||||
|
position: absolute;
|
||||||
|
left: 75px;
|
||||||
|
display: none;
|
||||||
|
top: 50%;
|
||||||
|
width: 48px;
|
||||||
|
text-align: start;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-wrap-col1 {
|
||||||
|
transform: translate(-200%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-wrap-col2 {
|
||||||
|
transform: translate(-300%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-wrap-col3 {
|
||||||
|
transform: translate(-400%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-hud-active {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-hud-disabled {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hud-gain-hp-button-select {
|
||||||
|
max-width: 40px;
|
||||||
|
background-image: var(--background-image-base);
|
||||||
|
padding-top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
width: max-content;
|
||||||
|
margin: 0;
|
||||||
|
color: #252424;
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-wrap .hud-gain-hp-button-select {
|
||||||
|
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;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: rgba(139, 69, 19, 0.5);
|
||||||
|
border-color: rgba(139, 69, 19, 0.7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------------- */
|
||||||
|
/* Dice Tray — injected into the Foundry chat sidebar */
|
||||||
|
/* -------------------------------------------------- */
|
||||||
|
|
||||||
|
.lf-dice-tray {
|
||||||
|
padding: 6px 8px;
|
||||||
|
background:
|
||||||
|
linear-gradient(135deg, rgba(245, 232, 200, 0.97) 0%, rgba(238, 222, 185, 0.97) 100%),
|
||||||
|
url("/systems/fvtt-lethal-fantasy/assets/ui/lethal_fantasy_background.webp") center / cover;
|
||||||
|
border-top: 2px solid rgba(139, 69, 19, 0.5);
|
||||||
|
border-bottom: 1px solid rgba(139, 69, 19, 0.25);
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
pointer-events: all;
|
||||||
|
|
||||||
|
.lf-dt-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lf-dt-label {
|
||||||
|
color: #3a2a10;
|
||||||
|
font-size: 15px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lf-dt-count {
|
||||||
|
width: 44px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 3px 4px;
|
||||||
|
background: rgba(139, 69, 19, 0.15);
|
||||||
|
border: 1px solid rgba(139, 69, 19, 0.45);
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #2a1a08;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 700;
|
||||||
|
cursor: pointer;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
option { background: #f5ead0; color: #2a1a08; }
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: rgba(139, 69, 19, 0.7);
|
||||||
|
box-shadow: 0 0 4px rgba(139, 69, 19, 0.25);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lf-dt-dice {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 3px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lf-dt-die-btn {
|
||||||
|
padding: 3px 7px;
|
||||||
|
background: rgba(139, 69, 19, 0.15);
|
||||||
|
border: 1px solid rgba(139, 69, 19, 0.4);
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #2a1a08;
|
||||||
|
font-size: 10px;
|
||||||
|
font-weight: 700;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
|
||||||
|
line-height: 1.5;
|
||||||
|
letter-spacing: 0.3px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: rgba(139, 69, 19, 0.35);
|
||||||
|
border-color: rgba(139, 69, 19, 0.7);
|
||||||
|
color: #5a2a00;
|
||||||
|
box-shadow: 0 0 5px rgba(139, 69, 19, 0.3);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
transform: translateY(0);
|
||||||
|
box-shadow: none;
|
||||||
|
background: rgba(139, 69, 19, 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lf-dt-explode-label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 3px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: rgba(160, 80, 20, 0.7);
|
||||||
|
font-size: 14px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 3px 6px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: color 0.15s, border-color 0.15s, background 0.15s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: rgba(200, 100, 30, 0.9);
|
||||||
|
border-color: rgba(139, 69, 19, 0.45);
|
||||||
|
background: rgba(139, 69, 19, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"] {
|
||||||
|
appearance: none;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
position: absolute;
|
||||||
|
opacity: 0;
|
||||||
|
|
||||||
|
&:checked ~ i {
|
||||||
|
color: #cc4400;
|
||||||
|
filter: drop-shadow(0 0 4px rgba(200, 80, 0, 0.6));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:has(input:checked) {
|
||||||
|
color: #cc4400;
|
||||||
|
border-color: rgba(139, 69, 19, 0.55);
|
||||||
|
background: rgba(139, 60, 10, 0.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Free roll chat card — styled to match regular system roll cards */
|
||||||
|
.lf-free-roll-card {
|
||||||
|
border-radius: 6px;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.lf-frc-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 6px 8px;
|
||||||
|
background: linear-gradient(135deg, rgba(40, 30, 20, 0.7) 0%, rgba(30, 22, 15, 0.9) 100%);
|
||||||
|
border-bottom: 2px solid rgba(139, 69, 19, 0.4);
|
||||||
|
|
||||||
|
i { color: #c9b896; font-size: calc(var(--font-size-standard, 14px) * 1.1); }
|
||||||
|
|
||||||
|
.lf-frc-title-text {
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.85);
|
||||||
|
color: #c9b896;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lf-frc-badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 2px 8px;
|
||||||
|
background: rgba(139, 69, 19, 0.3);
|
||||||
|
border: 1px solid rgba(139, 69, 19, 0.5);
|
||||||
|
border-radius: 10px;
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.85);
|
||||||
|
font-weight: 600;
|
||||||
|
color: #d4c5a9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lf-frc-dice {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 6px 8px;
|
||||||
|
background: rgba(0, 0, 0, 0.15);
|
||||||
|
border: 1px solid rgba(139, 69, 19, 0.3);
|
||||||
|
border-top: none;
|
||||||
|
|
||||||
|
.lf-frc-die-chip {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 3px 8px;
|
||||||
|
background: rgba(139, 69, 19, 0.2);
|
||||||
|
border: 1px solid rgba(139, 69, 19, 0.3);
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
.lf-frc-die-type {
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.85);
|
||||||
|
font-weight: 600;
|
||||||
|
color: #2a2a1a;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lf-frc-die-sep {
|
||||||
|
color: rgba(0, 0, 0, 0.35);
|
||||||
|
font-weight: 300;
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.lf-frc-die-val {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #ffd700;
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.95);
|
||||||
|
|
||||||
|
.lf-dt-explode-icon {
|
||||||
|
font-size: 8px;
|
||||||
|
color: #ffcc00;
|
||||||
|
margin-left: 2px;
|
||||||
|
vertical-align: super;
|
||||||
|
text-shadow: 0 0 4px rgba(255, 200, 0, 0.8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.lf-frc-max {
|
||||||
|
background: rgba(139, 90, 19, 0.35);
|
||||||
|
border-color: rgba(200, 116, 42, 0.6);
|
||||||
|
.lf-frc-die-val { color: #ff9a40; text-shadow: 0 0 6px rgba(200, 116, 42, 0.6); }
|
||||||
|
}
|
||||||
|
|
||||||
|
&.lf-frc-min {
|
||||||
|
background: rgba(139, 20, 20, 0.25);
|
||||||
|
border-color: rgba(139, 34, 34, 0.5);
|
||||||
|
.lf-frc-die-val { color: #ff6b6b; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lf-frc-total-bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 6px 10px;
|
||||||
|
background: linear-gradient(135deg, rgba(40, 30, 20, 0.6) 0%, rgba(20, 15, 10, 0.8) 100%);
|
||||||
|
border: 2px solid rgba(139, 69, 19, 0.5);
|
||||||
|
|
||||||
|
.lf-frc-total-label {
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 0.85);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
color: #c9b896;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lf-frc-total-value {
|
||||||
|
font-family: var(--font-primary, serif);
|
||||||
|
font-size: calc(var(--font-size-standard, 14px) * 1.6);
|
||||||
|
font-weight: bold;
|
||||||
|
color: #e8d5a0;
|
||||||
|
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -410,6 +410,48 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ranged-attacks {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
.attack {
|
||||||
|
.name {
|
||||||
|
min-width: 10rem;
|
||||||
|
max-width: 10rem;
|
||||||
|
}
|
||||||
|
.damage-dice {
|
||||||
|
width: 5rem;
|
||||||
|
max-width: 5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ranged-weapon-range {
|
||||||
|
margin-top: 8px;
|
||||||
|
border-top: 1px solid var(--color-border-light-tertiary, #ccc);
|
||||||
|
padding-top: 6px;
|
||||||
|
> label {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.range-fields {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 6px;
|
||||||
|
.range-field {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
label {
|
||||||
|
font-size: 0.7rem;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
width: 3.5rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.armors {
|
.armors {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
|||||||
+73
-21
@@ -176,6 +176,22 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dialog-warning {
|
||||||
|
margin: 0.4rem 0.2rem 0.2rem;
|
||||||
|
padding: 0.35rem 0.5rem;
|
||||||
|
border-left: 3px solid #c8941a;
|
||||||
|
background: rgba(200, 148, 26, 0.12);
|
||||||
|
border-radius: 3px;
|
||||||
|
font-family: var(--font-secondary);
|
||||||
|
font-size: calc(var(--font-size-standard) * 0.9);
|
||||||
|
color: #7a5400;
|
||||||
|
line-height: 1.4;
|
||||||
|
i {
|
||||||
|
color: #c8941a;
|
||||||
|
margin-right: 0.4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.lethalfantasy,
|
.lethalfantasy,
|
||||||
.fvtt-lethal-fantasy,
|
.fvtt-lethal-fantasy,
|
||||||
.message.lethalfantasy,
|
.message.lethalfantasy,
|
||||||
@@ -467,7 +483,7 @@
|
|||||||
.d30-label {
|
.d30-label {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #e0d5f0;
|
color: #2a1a3a;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 0.5px;
|
letter-spacing: 0.5px;
|
||||||
font-size: calc(var(--font-size-standard) * 0.9);
|
font-size: calc(var(--font-size-standard) * 0.9);
|
||||||
@@ -477,11 +493,11 @@
|
|||||||
font-family: var(--font-primary);
|
font-family: var(--font-primary);
|
||||||
font-size: calc(var(--font-size-standard) * 1.5);
|
font-size: calc(var(--font-size-standard) * 1.5);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #ff69b4;
|
color: #3d006e;
|
||||||
background: rgba(255, 105, 180, 0.1);
|
background: rgba(255, 255, 255, 0.35);
|
||||||
padding: 4px 12px;
|
padding: 4px 12px;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
border: 1px solid rgba(255, 105, 180, 0.3);
|
border: 1px solid rgba(138, 43, 226, 0.4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -631,15 +647,11 @@
|
|||||||
|
|
||||||
.damage-buttons-grid {
|
.damage-buttons-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: 1fr;
|
||||||
|
max-width: 280px;
|
||||||
|
margin: 0 auto;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
|
||||||
&.monster-damage {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
max-width: 280px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.damage-roll-btn {
|
.damage-roll-btn {
|
||||||
padding: 10px 14px;
|
padding: 10px 14px;
|
||||||
background: linear-gradient(to bottom, #8b4513 0%, #6b3410 100%);
|
background: linear-gradient(to bottom, #8b4513 0%, #6b3410 100%);
|
||||||
@@ -831,6 +843,7 @@
|
|||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
justify-items: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1269,33 +1282,72 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.attack-result-damage {
|
.attack-result-damage {
|
||||||
display: flex;
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
justify-content: center;
|
|
||||||
|
&.single-btn {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
max-width: 280px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.spell-damage {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.roll-damage-btn {
|
.roll-damage-btn {
|
||||||
padding: 10px 16px;
|
padding: 10px 14px;
|
||||||
background: linear-gradient(to bottom, #8b0000 0%, #660000 100%);
|
background: linear-gradient(to bottom, #8b0000 0%, #660000 100%);
|
||||||
border: 1px solid #ff0000;
|
border: 1px solid #4b0000;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
color: #f0e6d2;
|
color: #f0e6d2;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
font-size: calc(var(--font-size-standard) * 0.9);
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: -100%;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
|
||||||
|
transition: left 0.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover::before {
|
||||||
|
left: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: calc(var(--font-size-standard) * 1.1);
|
||||||
|
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: linear-gradient(to bottom, #a00000 0%, #7b0000 100%);
|
background: linear-gradient(to bottom, #a00000 0%, #7b0000 100%);
|
||||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
|
border-color: #5b0000;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 3px rgba(0, 0, 0, 0.3);
|
||||||
|
|
||||||
i {
|
|
||||||
margin-right: 6px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@
|
|||||||
"download": "#{DOWNLOAD}#",
|
"download": "#{DOWNLOAD}#",
|
||||||
"url": "#{URL}#",
|
"url": "#{URL}#",
|
||||||
"license": "LICENSE",
|
"license": "LICENSE",
|
||||||
"version": "13.0.0",
|
"version": "14.0.0",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Uberwald",
|
"name": "Uberwald",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
],
|
],
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "13",
|
"minimum": "13",
|
||||||
"verified": "13"
|
"verified": "14"
|
||||||
},
|
},
|
||||||
"esmodules": ["lethal-fantasy.mjs"],
|
"esmodules": ["lethal-fantasy.mjs"],
|
||||||
"styles": ["css/fvtt-lethal-fantasy.css"],
|
"styles": ["css/fvtt-lethal-fantasy.css"],
|
||||||
|
|||||||
@@ -9,95 +9,95 @@
|
|||||||
<legend>{{localize "LETHALFANTASY.Label.biodata"}}</legend>
|
<legend>{{localize "LETHALFANTASY.Label.biodata"}}</legend>
|
||||||
<div class="biodata">
|
<div class="biodata">
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Class</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.class"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.class
|
systemFields.biodata.fields.class
|
||||||
value=system.biodata.class
|
value=system.biodata.class
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Level</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.level"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.level
|
systemFields.biodata.fields.level
|
||||||
value=system.biodata.level
|
value=system.biodata.level
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Mortal</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.mortal"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.mortal
|
systemFields.biodata.fields.mortal
|
||||||
value=system.biodata.mortal
|
value=system.biodata.mortal
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Alignment</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.alignment"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.alignment
|
systemFields.biodata.fields.alignment
|
||||||
value=system.biodata.alignment
|
value=system.biodata.alignment
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Age</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.age"}}</span>
|
||||||
{{formInput systemFields.biodata.fields.age value=system.biodata.age}}
|
{{formInput systemFields.biodata.fields.age value=system.biodata.age}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Height</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.height"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.height
|
systemFields.biodata.fields.height
|
||||||
value=system.biodata.height
|
value=system.biodata.height
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Weight</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.weight"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.weight
|
systemFields.biodata.fields.weight
|
||||||
value=system.biodata.weight
|
value=system.biodata.weight
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Eyes</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.eyes"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.eyes
|
systemFields.biodata.fields.eyes
|
||||||
value=system.biodata.eyes
|
value=system.biodata.eyes
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Hair</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.hair"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.hair
|
systemFields.biodata.fields.hair
|
||||||
value=system.biodata.hair
|
value=system.biodata.hair
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Dev. Points (Total)</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.devPointsTotal"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.developmentPoints.fields.total
|
systemFields.developmentPoints.fields.total
|
||||||
value=system.developmentPoints.total
|
value=system.developmentPoints.total
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Dev. Points (Rem.)</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.devPointsRem"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.developmentPoints.fields.remaining
|
systemFields.developmentPoints.fields.remaining
|
||||||
value=system.developmentPoints.remaining
|
value=system.developmentPoints.remaining
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Magic User</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.magicUser"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.magicUser
|
systemFields.biodata.fields.magicUser
|
||||||
value=system.biodata.magicUser
|
value=system.biodata.magicUser
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Cleric User</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.clericUser"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.clericUser
|
systemFields.biodata.fields.clericUser
|
||||||
value=system.biodata.clericUser
|
value=system.biodata.clericUser
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Save bonus (1/5levels)</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.saveBonus"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.modifiers.fields.saveModifier
|
systemFields.modifiers.fields.saveModifier
|
||||||
value=system.modifiers.saveModifier
|
value=system.modifiers.saveModifier
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
{{#if system.biodata.magicUser}}
|
{{#if system.biodata.magicUser}}
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Spell bonus (1/5levels)</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.spellBonus"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.modifiers.fields.levelSpellModifier
|
systemFields.modifiers.fields.levelSpellModifier
|
||||||
value=system.modifiers.levelSpellModifier
|
value=system.modifiers.levelSpellModifier
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if system.biodata.clericUser}}
|
{{#if system.biodata.clericUser}}
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Miracle bonus (1/5levels)</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.miracleBonus"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.modifiers.fields.levelMiracleModifier
|
systemFields.modifiers.fields.levelMiracleModifier
|
||||||
value=system.modifiers.levelMiracleModifier
|
value=system.modifiers.levelMiracleModifier
|
||||||
@@ -127,7 +127,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Last HD roll</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.lastHdRoll"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.hpPerLevel
|
systemFields.biodata.fields.hpPerLevel
|
||||||
value=system.biodata.hpPerLevel
|
value=system.biodata.hpPerLevel
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Natural DR</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.naturalDR"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.naturalDR
|
systemFields.biodata.fields.naturalDR
|
||||||
value=system.biodata.naturalDR
|
value=system.biodata.naturalDR
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Magical DR</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.magicalDR"}}</span>
|
||||||
{{formInput
|
{{formInput
|
||||||
systemFields.biodata.fields.magicDR
|
systemFields.biodata.fields.magicDR
|
||||||
value=system.biodata.magicDR
|
value=system.biodata.magicDR
|
||||||
|
|||||||
@@ -21,6 +21,11 @@
|
|||||||
<a data-action="armorHitPointsMinus"><i class="fa-solid fa-hexagon-minus"></i></a>
|
<a data-action="armorHitPointsMinus"><i class="fa-solid fa-hexagon-minus"></i></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flexrow armor-hp">
|
||||||
|
<span class="name" data-tooltip="{{localize 'LETHALFANTASY.Tooltip.combatProgressionStart'}}">{{localize "LETHALFANTASY.Label.combatProgressionStart"}}</span>
|
||||||
|
{{formInput systemFields.combat.fields.combatProgressionStart value=system.combat.combatProgressionStart disabled=isPlayMode }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flexrow granted">
|
<div class="flexrow granted">
|
||||||
<span class="">{{localize
|
<span class="">{{localize
|
||||||
"LETHALFANTASY.Label.grantedAttackDice"}}</a></span>
|
"LETHALFANTASY.Label.grantedAttackDice"}}</a></span>
|
||||||
@@ -82,16 +87,10 @@
|
|||||||
<i class="fa-solid fa-shield-halved" data-roll-type="weapon-defense" data-roll-key="{{item.id}}"></i>
|
<i class="fa-solid fa-shield-halved" data-roll-type="weapon-defense" data-roll-key="{{item.id}}"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="rollable" data-roll-type="weapon-damage-small" data-roll-key="{{item.id}}"
|
<a class="rollable" data-roll-type="weapon-damage" data-roll-key="{{item.id}}"
|
||||||
data-tooltip="Roll Damage (Small)">
|
data-tooltip="Roll Damage">
|
||||||
<i class="fa-regular fa-face-head-bandage" data-roll-type="weapon-damage-small"
|
<i class="fa-regular fa-face-head-bandage" data-roll-type="weapon-damage"
|
||||||
data-roll-key="{{item.id}}"></i>S
|
data-roll-key="{{item.id}}"></i>
|
||||||
</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>
|
</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
<legend>{{localize "LETHALFANTASY.Label.divinityPoints"}}</legend>
|
<legend>{{localize "LETHALFANTASY.Label.divinityPoints"}}</legend>
|
||||||
<div class="miracle-details">
|
<div class="miracle-details">
|
||||||
<div class="miracle-detail">
|
<div class="miracle-detail">
|
||||||
<span>Current</span>
|
<span>{{localize "LETHALFANTASY.Label.current"}}</span>
|
||||||
{{formField systemFields.divinityPoints.fields.value value=system.divinityPoints.value localize=true}}
|
{{formField systemFields.divinityPoints.fields.value value=system.divinityPoints.value localize=true}}
|
||||||
<a data-action="divinityPointsPlus"><i class="fa-solid fa-hexagon-plus"></i></a>
|
<a data-action="divinityPointsPlus"><i class="fa-solid fa-hexagon-plus"></i></a>
|
||||||
<a data-action="divinityPointsMinus"><i class="fa-solid fa-hexagon-minus"></i></a>
|
<a data-action="divinityPointsMinus"><i class="fa-solid fa-hexagon-minus"></i></a>
|
||||||
|
|
||||||
<span>Max</span>
|
<span>{{localize "LETHALFANTASY.Label.max"}}</span>
|
||||||
{{formField systemFields.divinityPoints.fields.max value=system.divinityPoints.max localize=true
|
{{formField systemFields.divinityPoints.fields.max value=system.divinityPoints.max localize=true
|
||||||
disabled=isPlayMode}}
|
disabled=isPlayMode}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
<legend>{{localize "LETHALFANTASY.Label.aetherPoints"}}</legend>
|
<legend>{{localize "LETHALFANTASY.Label.aetherPoints"}}</legend>
|
||||||
<div class="spell-details">
|
<div class="spell-details">
|
||||||
<div class="spell-detail">
|
<div class="spell-detail">
|
||||||
<span>Current</span>
|
<span>{{localize "LETHALFANTASY.Label.current"}}</span>
|
||||||
{{formField systemFields.aetherPoints.fields.value value=system.aetherPoints.value localize=true}}
|
{{formField systemFields.aetherPoints.fields.value value=system.aetherPoints.value localize=true}}
|
||||||
<a data-action="aetherPointsPlus"><i class="fa-solid fa-hexagon-plus"></i></a>
|
<a data-action="aetherPointsPlus"><i class="fa-solid fa-hexagon-plus"></i></a>
|
||||||
<a data-action="aetherPointsMinus"><i class="fa-solid fa-hexagon-minus"></i></a>
|
<a data-action="aetherPointsMinus"><i class="fa-solid fa-hexagon-minus"></i></a>
|
||||||
|
|
||||||
<span>Max</span>
|
<span>{{localize "LETHALFANTASY.Label.max"}}</span>
|
||||||
{{formField systemFields.aetherPoints.fields.max value=system.aetherPoints.max localize=true
|
{{formField systemFields.aetherPoints.fields.max value=system.aetherPoints.max localize=true
|
||||||
disabled=isPlayMode}}
|
disabled=isPlayMode}}
|
||||||
</div>
|
</div>
|
||||||
@@ -37,6 +37,25 @@
|
|||||||
<i class="fa-duotone fa-solid fa-stars" data-roll-type="spell-power" data-roll-key="{{item.id}}"></i>
|
<i class="fa-duotone fa-solid fa-stars" data-roll-type="spell-power" data-roll-key="{{item.id}}"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
{{#if item.system.damageDice}}
|
||||||
|
<a data-action="rollSpellDamage" data-item-id="{{item.id}}" data-damage-tier="standard"
|
||||||
|
data-tooltip="Spell Damage (Standard)">
|
||||||
|
<i class="fa-solid fa-wand-magic-sparkles"></i>S
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
{{#if item.system.damageDiceOverpowered}}
|
||||||
|
<a data-action="rollSpellDamage" data-item-id="{{item.id}}" data-damage-tier="overpowered"
|
||||||
|
data-tooltip="Spell Damage (Overpowered)">
|
||||||
|
<i class="fa-solid fa-wand-magic-sparkles"></i>O
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
{{#if item.system.damageDiceOverpowered2}}
|
||||||
|
<a data-action="rollSpellDamage" data-item-id="{{item.id}}" data-damage-tier="overpowered2"
|
||||||
|
data-tooltip="Spell Damage (Overpowered 2)">
|
||||||
|
<i class="fa-solid fa-wand-magic-sparkles"></i>O2
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<a data-tooltip="{{localize 'LETHALFANTASY.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
|
<a data-tooltip="{{localize 'LETHALFANTASY.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
|
||||||
data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
|
data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
|
||||||
|
|||||||
+12
-31
@@ -40,45 +40,39 @@
|
|||||||
{{#if (eq rollData.favor "favor")}}
|
{{#if (eq rollData.favor "favor")}}
|
||||||
<div class="detail-badge favor-badge">
|
<div class="detail-badge favor-badge">
|
||||||
<i class="fa-solid fa-sparkles"></i>
|
<i class="fa-solid fa-sparkles"></i>
|
||||||
<span>Favor</span>
|
<span>{{localize "LETHALFANTASY.Label.favor"}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (eq rollData.favor "disfavor")}}
|
{{#if (eq rollData.favor "disfavor")}}
|
||||||
<div class="detail-badge disfavor-badge">
|
<div class="detail-badge disfavor-badge">
|
||||||
<i class="fa-solid fa-skull"></i>
|
<i class="fa-solid fa-skull"></i>
|
||||||
<span>Disfavor</span>
|
<span>{{localize "LETHALFANTASY.Label.disfavor"}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if rollData.letItFly}}
|
{{#if rollData.letItFly}}
|
||||||
<div class="detail-badge special-badge">
|
<div class="detail-badge special-badge">
|
||||||
<i class="fa-solid fa-bow-arrow"></i>
|
<i class="fa-solid fa-bow-arrow"></i>
|
||||||
<span>Let It Fly!</span>
|
<span>{{localize "LETHALFANTASY.Label.letItFly"}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if rollData.pointBlank}}
|
{{#if rollData.pointBlank}}
|
||||||
<div class="detail-badge special-badge">
|
<div class="detail-badge special-badge">
|
||||||
<i class="fa-solid fa-bullseye-arrow"></i>
|
<i class="fa-solid fa-bullseye-arrow"></i>
|
||||||
<span>Point Blank</span>
|
<span>{{localize "LETHALFANTASY.Label.pointBlank"}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if rollData.beyondSkill}}
|
{{#if rollData.beyondSkill}}
|
||||||
<div class="detail-badge special-badge">
|
<div class="detail-badge special-badge">
|
||||||
<i class="fa-solid fa-target-lock"></i>
|
<i class="fa-solid fa-target-lock"></i>
|
||||||
<span>Beyond Skill</span>
|
<span>{{localize "LETHALFANTASY.Label.beyondSkill"}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if rollData.damageSmall}}
|
{{#if rollData.isDamage}}
|
||||||
<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}}
|
|
||||||
<div class="detail-badge damage-badge">
|
<div class="detail-badge damage-badge">
|
||||||
<i class="fa-solid fa-dice-d20"></i>
|
<i class="fa-solid fa-dice-d20"></i>
|
||||||
<span>{{localize "LETHALFANTASY.Label.weapon-damage-medium"}}</span>
|
<span>{{localize "LETHALFANTASY.Label.weapon-damage"}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
@@ -111,7 +105,7 @@
|
|||||||
{{#unless isPrivate}}
|
{{#unless isPrivate}}
|
||||||
<div class="result-section">
|
<div class="result-section">
|
||||||
<div class="main-result">
|
<div class="main-result">
|
||||||
<div class="result-label">Total</div>
|
<div class="result-label">{{localize "LETHALFANTASY.Label.total"}}</div>
|
||||||
<div class="result-value {{#if (eq resultType 'success')}}success{{else}}failure{{/if}}">
|
<div class="result-value {{#if (eq resultType 'success')}}success{{else}}failure{{/if}}">
|
||||||
{{total}}
|
{{total}}
|
||||||
</div>
|
</div>
|
||||||
@@ -127,7 +121,7 @@
|
|||||||
{{#if D30message}}
|
{{#if D30message}}
|
||||||
<div class="d30-message">
|
<div class="d30-message">
|
||||||
<i class="fa-solid fa-wand-magic-sparkles"></i>
|
<i class="fa-solid fa-wand-magic-sparkles"></i>
|
||||||
<span>{{D30message}}</span>
|
<span>{{D30message.description}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
@@ -177,7 +171,7 @@
|
|||||||
{{else}}
|
{{else}}
|
||||||
<div class="private-result">
|
<div class="private-result">
|
||||||
<i class="fa-solid fa-eye-slash"></i>
|
<i class="fa-solid fa-eye-slash"></i>
|
||||||
<span>Private Roll</span>
|
<span>{{localize "LETHALFANTASY.Label.privateRoll"}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
||||||
@@ -202,19 +196,6 @@
|
|||||||
}}+{{weaponDamageOptions.damageModifier}}{{/if}}
|
}}+{{weaponDamageOptions.damageModifier}}{{/if}}
|
||||||
</button>
|
</button>
|
||||||
{{else}}
|
{{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}}
|
{{#if weaponDamageOptions.damageM}}
|
||||||
<button
|
<button
|
||||||
class="damage-roll-btn"
|
class="damage-roll-btn"
|
||||||
@@ -225,7 +206,7 @@
|
|||||||
title="{{localize 'LETHALFANTASY.Label.rollDamage'}}"
|
title="{{localize 'LETHALFANTASY.Label.rollDamage'}}"
|
||||||
>
|
>
|
||||||
<i class="fa-solid fa-dice-d20"></i>
|
<i class="fa-solid fa-dice-d20"></i>
|
||||||
Damage Medium
|
{{localize "LETHALFANTASY.Label.damage"}}
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@@ -239,7 +220,7 @@
|
|||||||
<div class="damage-result auto-applied">
|
<div class="damage-result auto-applied">
|
||||||
<div class="auto-damage-notice">
|
<div class="auto-damage-notice">
|
||||||
<i class="fa-solid fa-check-circle"></i>
|
<i class="fa-solid fa-check-circle"></i>
|
||||||
<span>Damage automatically applied to defender (with Armor DR)</span>
|
<span>Damage automatically applied to defender (with damage reduction)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
{{!-- GM Controls --}}
|
{{!-- GM Controls --}}
|
||||||
{{#if user.isGM}}
|
{{#if user.isGM}}
|
||||||
{{#if combat.round}}
|
{{#if (or combat.round (eq combat.turn 0))}}
|
||||||
<!-- <button type="button" class="inline-control combat-control icon fa-solid fa-backward-step"
|
<!-- <button type="button" class="inline-control combat-control icon fa-solid fa-backward-step"
|
||||||
data-action="previousRound" data-tooltip aria-label="{{ localize "COMBAT.RoundPrev" }}"></button>
|
data-action="previousRound" data-tooltip aria-label="{{ localize "COMBAT.RoundPrev" }}"></button>
|
||||||
<button type="button" class="inline-control combat-control icon fa-solid fa-arrow-left" data-action="previousTurn"
|
<button type="button" class="inline-control combat-control icon fa-solid fa-arrow-left" data-action="previousTurn"
|
||||||
@@ -13,6 +13,14 @@
|
|||||||
<span>{{ localize "COMBAT.End" }}</span>
|
<span>{{ localize "COMBAT.End" }}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
{{#if combat.round}}
|
||||||
|
<button type="button" class="combat-control combat-control-lg" data-action="rollMonsterProgression"
|
||||||
|
data-tooltip="{{ localize 'LETHALFANTASY.Combat.RollMonsters' }}">
|
||||||
|
<i class="fa-solid fa-dragon" inert></i>
|
||||||
|
<span>{{ localize "LETHALFANTASY.Combat.RollMonsters" }}</span>
|
||||||
|
</button>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<!-- <button type="button" class="inline-control combat-control icon fa-solid fa-arrow-right" data-action="nextTurn"
|
<!-- <button type="button" class="inline-control combat-control icon fa-solid fa-arrow-right" data-action="nextTurn"
|
||||||
data-tooltip aria-label="{{ localize "COMBAT.TurnNext" }}"></button> -->
|
data-tooltip aria-label="{{ localize "COMBAT.TurnNext" }}"></button> -->
|
||||||
<button type="button" class="inline-control combat-control icon fa-solid fa-forward-step" data-action="nextRound"
|
<button type="button" class="inline-control combat-control icon fa-solid fa-forward-step" data-action="nextRound"
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
{{!-- Combat Status --}}
|
{{!-- Combat Status --}}
|
||||||
<strong class="encounter-title">
|
<strong class="encounter-title">
|
||||||
{{#if combats.length}}
|
{{#if combats.length}}
|
||||||
{{#if combat.round}}
|
{{#if (or combat.round (eq combat.turn 0))}}
|
||||||
{{ localize "COMBAT.Round" round=combat.round }}
|
{{ localize "COMBAT.Round" round=combat.round }}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{ localize "COMBAT.NotStarted" }}
|
{{ localize "COMBAT.NotStarted" }}
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
<div class="control-icon" data-action="lethal-gain-hp-hud">
|
||||||
|
<img
|
||||||
|
class="lethal-hp-gain-hud"
|
||||||
|
src="systems/fvtt-lethal-fantasy/assets/icons/health-increase.svg"
|
||||||
|
width="36"
|
||||||
|
height="36"
|
||||||
|
title="Restore HP"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div class="hp-gain-wrap hp-gain-wrap-col1 hp-gain-hud-disabled">
|
||||||
|
{{#for 1 11 1}}
|
||||||
|
<button
|
||||||
|
class="hud-gain-hp-button-select gain-hp-hud-click"
|
||||||
|
data-hp-value="{{this}}"
|
||||||
|
>
|
||||||
|
<span class="">+{{this}}</span>
|
||||||
|
</button>
|
||||||
|
{{/for}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="hp-gain-wrap hp-gain-wrap-col2 hp-gain-hud-disabled">
|
||||||
|
{{#for 11 21 1}}
|
||||||
|
<button
|
||||||
|
class="hud-gain-hp-button-select gain-hp-hud-click"
|
||||||
|
data-hp-value="{{this}}"
|
||||||
|
>
|
||||||
|
<span class="">+{{this}}</span>
|
||||||
|
</button>
|
||||||
|
{{/for}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="hp-gain-wrap hp-gain-wrap-col3 hp-gain-hud-disabled">
|
||||||
|
{{#for 21 31 1}}
|
||||||
|
<button
|
||||||
|
class="hud-gain-hp-button-select gain-hp-hud-click"
|
||||||
|
data-hp-value="{{this}}"
|
||||||
|
>
|
||||||
|
<span class="">+{{this}}</span>
|
||||||
|
</button>
|
||||||
|
{{/for}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<div class="control-icon lethal-luck-grit-hud" 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>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
{{formField systemFields.miracleType value=system.miracleType}}
|
{{formField systemFields.miracleType value=system.miracleType}}
|
||||||
{{formField systemFields.level value=system.level}}
|
{{formField systemFields.level value=system.level}}
|
||||||
|
|
||||||
<label>Components</label>
|
<label>{{localize "LETHALFANTASY.Label.components"}}</label>
|
||||||
<div class="shift-right">
|
<div class="shift-right">
|
||||||
{{formField systemFields.components.fields.verbal value=system.components.verbal}}
|
{{formField systemFields.components.fields.verbal value=system.components.verbal}}
|
||||||
{{formField systemFields.components.fields.somatic value=system.components.somatic}}
|
{{formField systemFields.components.fields.somatic value=system.components.somatic}}
|
||||||
@@ -27,6 +27,9 @@
|
|||||||
{{formField systemFields.areaAffected value=system.areaAffected}}
|
{{formField systemFields.areaAffected value=system.areaAffected}}
|
||||||
{{formField systemFields.duration value=system.duration}}
|
{{formField systemFields.duration value=system.duration}}
|
||||||
{{formField systemFields.savingThrow value=system.savingThrow}}
|
{{formField systemFields.savingThrow value=system.savingThrow}}
|
||||||
|
{{formField systemFields.damageDice value=system.damageDice}}
|
||||||
|
{{formField systemFields.damageDiceOverpowered value=system.damageDiceOverpowered}}
|
||||||
|
{{formField systemFields.damageDiceOverpowered2 value=system.damageDiceOverpowered2}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,23 +6,23 @@
|
|||||||
<div class="biodata">
|
<div class="biodata">
|
||||||
|
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Alignment</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.alignment"}}</span>
|
||||||
{{formInput systemFields.biodata.fields.alignment value=system.biodata.alignment }}
|
{{formInput systemFields.biodata.fields.alignment value=system.biodata.alignment }}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Height</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.height"}}</span>
|
||||||
{{formInput systemFields.biodata.fields.height value=system.biodata.height }}
|
{{formInput systemFields.biodata.fields.height value=system.biodata.height }}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Weight</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.weight"}}</span>
|
||||||
{{formInput systemFields.biodata.fields.weight value=system.biodata.weight }}
|
{{formInput systemFields.biodata.fields.weight value=system.biodata.weight }}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Length</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.length"}}</span>
|
||||||
{{formInput systemFields.biodata.fields.length value=system.biodata.length }}
|
{{formInput systemFields.biodata.fields.length value=system.biodata.length }}
|
||||||
</div>
|
</div>
|
||||||
<div class="biodata-elem">
|
<div class="biodata-elem">
|
||||||
<span class="name">Vision</span>
|
<span class="name">{{localize "LETHALFANTASY.Label.vision"}}</span>
|
||||||
{{formInput systemFields.biodata.fields.vision value=system.biodata.vision }}
|
{{formInput systemFields.biodata.fields.vision value=system.biodata.vision }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,16 @@
|
|||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{{localize "LETHALFANTASY.Label.attacks"}}</legend>
|
<legend>{{localize "LETHALFANTASY.Label.attacks"}}</legend>
|
||||||
<div class="attacks">
|
<div class="attack-mode-selector">
|
||||||
|
<label>{{localize "LETHALFANTASY.Label.attackMode"}}</label>
|
||||||
|
<select name="system.attackMode">
|
||||||
|
<option value="melee" {{#if (eq system.attackMode "melee")}}selected{{/if}}>{{localize "LETHALFANTASY.Label.meleeModeLabel"}}</option>
|
||||||
|
<option value="ranged" {{#if (eq system.attackMode "ranged")}}selected{{/if}}>{{localize "LETHALFANTASY.Label.rangedModeLabel"}}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{#if (eq system.attackMode "melee")}}
|
||||||
|
<div class="attacks melee-attacks">
|
||||||
{{#each system.attacks as |item key|}}
|
{{#each system.attacks as |item key|}}
|
||||||
<div class="attack" data-attack-key="{{key}}" >
|
<div class="attack" data-attack-key="{{key}}" >
|
||||||
<div class="">
|
<div class="">
|
||||||
@@ -42,6 +51,9 @@
|
|||||||
<div class="numeric">
|
<div class="numeric">
|
||||||
<input type="number" name="system.attacks.{{item.key}}.damageModifier" value="{{item.damageModifier}}" data-tooltip="Damage modifier"/>
|
<input type="number" name="system.attacks.{{item.key}}.damageModifier" value="{{item.damageModifier}}" data-tooltip="Damage modifier"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" name="system.attacks.{{item.key}}.noExplode" {{checked item.noExplode}} data-tooltip="No exploding dice on damage" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="attack-icons">
|
<div class="attack-icons">
|
||||||
|
|
||||||
@@ -64,10 +76,91 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<div class="attacks ranged-attacks">
|
||||||
|
{{#each system.rangedAttacks as |item key|}}
|
||||||
|
<div class="attack" data-attack-key="{{key}}" >
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" name="system.rangedAttacks.{{item.key}}.enabled" {{checked item.enabled}} data-tooltip="Attack enabled/disabled" />
|
||||||
|
</div>
|
||||||
|
<div class="name">
|
||||||
|
<input type="text" name="system.rangedAttacks.{{item.key}}.name" value="{{item.name}}" data-tooltip="Attack name" />
|
||||||
|
</div>
|
||||||
|
<div class="numeric">
|
||||||
|
<input type="number" name="system.rangedAttacks.{{item.key}}.attackScore" value="{{item.attackScore}}" data-tooltip="Progression number" />
|
||||||
|
</div>
|
||||||
|
<div class="numeric">
|
||||||
|
<input type="number" name="system.rangedAttacks.{{item.key}}.attackModifier" value="{{item.attackModifier}}" data-tooltip="Attack modifier" />
|
||||||
|
</div>
|
||||||
|
<div class="numeric">
|
||||||
|
<input type="number" name="system.rangedAttacks.{{item.key}}.defenseModifier" value="{{item.defenseModifier}}" data-tooltip="Defense modifier"/>
|
||||||
|
</div>
|
||||||
|
<div class="damage-dice">
|
||||||
|
<input type="text" name="system.rangedAttacks.{{item.key}}.damageDice" value="{{item.damageDice}}" data-tooltip="Damage dice"/>
|
||||||
|
</div>
|
||||||
|
<div class="numeric">
|
||||||
|
<input type="number" name="system.rangedAttacks.{{item.key}}.damageModifier" value="{{item.damageModifier}}" data-tooltip="Damage modifier"/>
|
||||||
|
</div>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" name="system.rangedAttacks.{{item.key}}.noExplode" {{checked item.noExplode}} data-tooltip="No exploding dice on damage" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="attack-icons">
|
||||||
|
|
||||||
|
<a class="rollable" data-roll-type="monster-attack" data-roll-key="{{item.key}}" data-tooltip="Roll Attack">
|
||||||
|
<i class="lf-roll-small fa-solid fa-bow-arrow" data-roll-type="monster-attack" data-roll-key="{{item.key}}"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a class="rollable" data-roll-type="monster-defense" data-roll-key="{{item.key}}" data-tooltip="Roll Defense">
|
||||||
|
<i class="fa-solid fa-shield-halved" data-roll-type="monster-defense" data-roll-key="{{item.key}}"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a class="rollable" data-roll-type="monster-damage" data-roll-key="{{item.key}}"
|
||||||
|
data-tooltip="Roll Damage">
|
||||||
|
<i class="fa-regular fa-face-head-bandage" data-roll-type="monster-damage"
|
||||||
|
data-roll-key="{{item.key}}"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
<div class="ranged-weapon-range">
|
||||||
|
<label>{{localize "LETHALFANTASY.Label.range"}}</label>
|
||||||
|
<div class="range-fields">
|
||||||
|
<div class="range-field">
|
||||||
|
<label>{{localize "LETHALFANTASY.Label.pointBlank"}}</label>
|
||||||
|
<input type="number" name="system.rangedWeaponRange.pointBlank" value="{{system.rangedWeaponRange.pointBlank}}" />
|
||||||
|
</div>
|
||||||
|
<div class="range-field">
|
||||||
|
<label>{{localize "LETHALFANTASY.Label.short"}}</label>
|
||||||
|
<input type="number" name="system.rangedWeaponRange.short" value="{{system.rangedWeaponRange.short}}" />
|
||||||
|
</div>
|
||||||
|
<div class="range-field">
|
||||||
|
<label>{{localize "LETHALFANTASY.Label.medium"}}</label>
|
||||||
|
<input type="number" name="system.rangedWeaponRange.medium" value="{{system.rangedWeaponRange.medium}}" />
|
||||||
|
</div>
|
||||||
|
<div class="range-field">
|
||||||
|
<label>{{localize "LETHALFANTASY.Label.long"}}</label>
|
||||||
|
<input type="number" name="system.rangedWeaponRange.long" value="{{system.rangedWeaponRange.long}}" />
|
||||||
|
</div>
|
||||||
|
<div class="range-field">
|
||||||
|
<label>{{localize "LETHALFANTASY.Label.extreme"}}</label>
|
||||||
|
<input type="number" name="system.rangedWeaponRange.extreme" value="{{system.rangedWeaponRange.extreme}}" />
|
||||||
|
</div>
|
||||||
|
<div class="range-field">
|
||||||
|
<label>{{localize "LETHALFANTASY.Label.outOfSkill"}}</label>
|
||||||
|
<input type="number" name="system.rangedWeaponRange.outOfSkill" value="{{system.rangedWeaponRange.outOfSkill}}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Hand To Hand Attacks</legend>
|
<legend>{{localize "LETHALFANTASY.Label.handToHandAttacks"}}</legend>
|
||||||
<div class="attacks">
|
<div class="attacks">
|
||||||
{{#each system.combatHTH as |item key|}}
|
{{#each system.combatHTH as |item key|}}
|
||||||
<div class="attack" data-attack-key="{{key}}" >
|
<div class="attack" data-attack-key="{{key}}" >
|
||||||
@@ -92,6 +185,9 @@
|
|||||||
<div class="numeric">
|
<div class="numeric">
|
||||||
<input type="number" name="system.combatHTH.{{item.key}}.damageModifier" value="{{item.damageModifier}}" data-tooltip="Damage modifier"/>
|
<input type="number" name="system.combatHTH.{{item.key}}.damageModifier" value="{{item.damageModifier}}" data-tooltip="Damage modifier"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" name="system.combatHTH.{{item.key}}.noExplode" {{checked item.noExplode}} data-tooltip="No exploding dice on damage" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="attack-icons">
|
<div class="attack-icons">
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
+41
-40
@@ -55,35 +55,33 @@
|
|||||||
<div class="dialog-save">Add Granted Attack Dice
|
<div class="dialog-save">Add Granted Attack Dice
|
||||||
<input type="checkbox" data-action="selectGranted" name="granted" />
|
<input type="checkbox" data-action="selectGranted" name="granted" />
|
||||||
</div>
|
</div>
|
||||||
{{#if rollTarget.weapon}}
|
{{#if isRangedAttack}}
|
||||||
{{#if (eq rollTarget.weapon.system.weaponType "melee")}}{{else}}
|
<div class="dialog-save">Point Blank Range Attack
|
||||||
<div class="dialog-save">Point Blank Range Attack
|
<input
|
||||||
<input
|
type="checkbox"
|
||||||
type="checkbox"
|
data-action="selectPointBlank"
|
||||||
data-action="selectPointBlank"
|
name="pointBlankV"
|
||||||
name="pointBlankV"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<div class="dialog-save">Beyond Skill Range Attack
|
||||||
<div class="dialog-save">Beyond Skill Range Attack
|
<input
|
||||||
<input
|
type="checkbox"
|
||||||
type="checkbox"
|
data-action="selectBeyondSkill"
|
||||||
data-action="selectBeyondSkill"
|
name="beyondSkillV"
|
||||||
name="beyondSkillV"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<div class="dialog-save">Let it Fly (Pure D20E)
|
||||||
<div class="dialog-save">Let it Fly (Pure D20E)
|
<input
|
||||||
<input
|
type="checkbox"
|
||||||
type="checkbox"
|
data-action="selectLetItFly"
|
||||||
data-action="selectLetItFly"
|
name="letItFlyV"
|
||||||
name="letItFlyV"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<div class="dialog-save">Aiming
|
||||||
<div class="dialog-save">Aiming
|
<select name="attackerAim" data-tooltip-direction="UP">
|
||||||
<select name="attackerAim" data-tooltip-direction="UP">
|
{{selectOptions attackerAimChoices selected=attackerAim}}
|
||||||
{{selectOptions attackerAimChoices selected=attackerAim}}
|
</select>
|
||||||
</select>
|
</div>
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@@ -91,6 +89,10 @@
|
|||||||
<div class="dialog-save">Add Granted Defense Dice
|
<div class="dialog-save">Add Granted Defense Dice
|
||||||
<input type="checkbox" data-action="selectGranted" name="granted" />
|
<input type="checkbox" data-action="selectGranted" name="granted" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="dialog-warning">
|
||||||
|
<i class="fa-solid fa-triangle-exclamation"></i>
|
||||||
|
{{localize "LETHALFANTASY.Warning.defenseShieldOrder"}}
|
||||||
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (match rollType "damage")}}
|
{{#if (match rollType "damage")}}
|
||||||
<div class="dialog-save">Add Granted Damage Dice
|
<div class="dialog-save">Add Granted Damage Dice
|
||||||
@@ -121,17 +123,16 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
{{#if (eq rollType "save")}}
|
{{#if (eq rollType "save")}}
|
||||||
{{#if rollTarget.magicUser}}
|
<div>
|
||||||
<div>
|
<span>Save against spell (+{{rollTarget.actorModifiers.saveModifier}})
|
||||||
<span>Save against spell (+{{rollTarget.actorModifiers.saveModifier}})
|
?</span>
|
||||||
?</span>
|
<input
|
||||||
<input
|
type="checkbox"
|
||||||
type="checkbox"
|
name="saveSpellCheck"
|
||||||
name="saveSpellCheck"
|
data-action="saveSpellCheck"
|
||||||
data-action="saveSpellCheck"
|
{{#if saveSpell}}checked{{/if}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</fieldSet>
|
</fieldSet>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
{{formField systemFields.hascover value=system.hascover}}
|
{{formField systemFields.hascover value=system.hascover}}
|
||||||
|
|
||||||
{{#if system.hascover}}
|
{{#if system.hascover}}
|
||||||
<label>Cover vs ranged attacks</label>
|
<label>{{localize "LETHALFANTASY.Label.coverRanged"}}</label>
|
||||||
<div class="shift-right">
|
<div class="shift-right">
|
||||||
<label>Standing </label>
|
<label>{{localize "LETHALFANTASY.Label.standing"}}</label>
|
||||||
<div class="flexrow">{{formField
|
<div class="flexrow">{{formField
|
||||||
systemFields.standing.fields.min
|
systemFields.standing.fields.min
|
||||||
value=system.standing.min
|
value=system.standing.min
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="shift-right">
|
<div class="shift-right">
|
||||||
<label>Crouching</label>
|
<label>{{localize "LETHALFANTASY.Label.crouching"}}</label>
|
||||||
<div class="flexrow">{{formField
|
<div class="flexrow">{{formField
|
||||||
systemFields.crouching.fields.min
|
systemFields.crouching.fields.min
|
||||||
value=system.crouching.min
|
value=system.crouching.min
|
||||||
|
|||||||
+6
-1
@@ -6,8 +6,10 @@
|
|||||||
|
|
||||||
{{formField systemFields.level value=system.level}}
|
{{formField systemFields.level value=system.level}}
|
||||||
{{formField systemFields.cost value=system.cost}}
|
{{formField systemFields.cost value=system.cost}}
|
||||||
|
{{formField systemFields.costOverpowered value=system.costOverpowered}}
|
||||||
|
{{formField systemFields.costOverpowered2 value=system.costOverpowered2}}
|
||||||
|
|
||||||
<label>Components</label>
|
<label>{{localize "LETHALFANTASY.Label.components"}}</label>
|
||||||
<div class="shift-right">
|
<div class="shift-right">
|
||||||
{{formField systemFields.components.fields.verbal value=system.components.verbal}}
|
{{formField systemFields.components.fields.verbal value=system.components.verbal}}
|
||||||
{{formField systemFields.components.fields.somatic value=system.components.somatic}}
|
{{formField systemFields.components.fields.somatic value=system.components.somatic}}
|
||||||
@@ -30,6 +32,9 @@
|
|||||||
{{formField systemFields.savingThrow value=system.savingThrow}}
|
{{formField systemFields.savingThrow value=system.savingThrow}}
|
||||||
{{formField systemFields.extraAetherPoints value=system.extraAetherPoints}}
|
{{formField systemFields.extraAetherPoints value=system.extraAetherPoints}}
|
||||||
{{formField systemFields.criticalType value=system.criticalType}}
|
{{formField systemFields.criticalType value=system.criticalType}}
|
||||||
|
{{formField systemFields.damageDice value=system.damageDice}}
|
||||||
|
{{formField systemFields.damageDiceOverpowered value=system.damageDiceOverpowered}}
|
||||||
|
{{formField systemFields.damageDiceOverpowered2 value=system.damageDiceOverpowered2}}
|
||||||
|
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|||||||
@@ -10,18 +10,14 @@
|
|||||||
{{formField systemFields.weaponType value=system.weaponType localize=true}}
|
{{formField systemFields.weaponType value=system.weaponType localize=true}}
|
||||||
{{formField systemFields.weaponClass value=system.weaponClass localize=true}}
|
{{formField systemFields.weaponClass value=system.weaponClass localize=true}}
|
||||||
|
|
||||||
<label>Damage Type</label>
|
<label>{{localize "LETHALFANTASY.Label.damageType"}}</label>
|
||||||
<div class="shift-right">
|
<div class="shift-right">
|
||||||
{{formField systemFields.damageType.fields.typeP value=system.damageType.typeP}}
|
{{formField systemFields.damageType.fields.typeP value=system.damageType.typeP}}
|
||||||
{{formField systemFields.damageType.fields.typeB value=system.damageType.typeB}}
|
{{formField systemFields.damageType.fields.typeB value=system.damageType.typeB}}
|
||||||
{{formField systemFields.damageType.fields.typeS value=system.damageType.typeS}}
|
{{formField systemFields.damageType.fields.typeS value=system.damageType.typeS}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label>Damage</label>
|
{{formField systemFields.damage.fields.damageM value=system.damage.damageM label=(localize "LETHALFANTASY.Label.damage")}}
|
||||||
<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.applyStrengthDamageBonus value=system.applyStrengthDamageBonus localize=true}}
|
{{formField systemFields.applyStrengthDamageBonus value=system.applyStrengthDamageBonus localize=true}}
|
||||||
|
|
||||||
@@ -34,7 +30,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if (eq system.weaponType "ranged")}}
|
{{#if (eq system.weaponType "ranged")}}
|
||||||
<label>Speed</label>
|
<label>{{localize "LETHALFANTASY.Label.speed"}}</label>
|
||||||
<div class="shift-right">
|
<div class="shift-right">
|
||||||
{{formField systemFields.speed.fields.simpleAim value=system.speed.simpleAim}}
|
{{formField systemFields.speed.fields.simpleAim value=system.speed.simpleAim}}
|
||||||
{{formField systemFields.speed.fields.carefulAim value=system.speed.carefulAim}}
|
{{formField systemFields.speed.fields.carefulAim value=system.speed.carefulAim}}
|
||||||
@@ -47,7 +43,7 @@
|
|||||||
|
|
||||||
{{formField systemFields.defense value=system.defense}}
|
{{formField systemFields.defense value=system.defense}}
|
||||||
|
|
||||||
<label>Range</label>
|
<label>{{localize "LETHALFANTASY.Label.range"}}</label>
|
||||||
<div class="shift-right">
|
<div class="shift-right">
|
||||||
{{formField systemFields.weaponRange.fields.pointBlank value=system.weaponRange.pointBlank}}
|
{{formField systemFields.weaponRange.fields.pointBlank value=system.weaponRange.pointBlank}}
|
||||||
{{formField systemFields.weaponRange.fields.short value=system.weaponRange.short}}
|
{{formField systemFields.weaponRange.fields.short value=system.weaponRange.short}}
|
||||||
@@ -60,7 +56,7 @@
|
|||||||
|
|
||||||
{{formField systemFields.equipped value=system.equipped}}
|
{{formField systemFields.equipped value=system.equipped}}
|
||||||
|
|
||||||
<label>Bonuses</label>
|
<label>{{localize "LETHALFANTASY.Label.bonuses"}}</label>
|
||||||
<div class="shift-right">
|
<div class="shift-right">
|
||||||
{{formField systemFields.bonuses.fields.attackBonus value=system.bonuses.attackBonus}}
|
{{formField systemFields.bonuses.fields.attackBonus value=system.bonuses.attackBonus}}
|
||||||
{{formField systemFields.bonuses.fields.defenseBonus value=system.bonuses.defenseBonus}}
|
{{formField systemFields.bonuses.fields.defenseBonus value=system.bonuses.defenseBonus}}
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
import { CompendiumsManager } from './CompendiumsManager.mjs';
|
||||||
|
CompendiumsManager.packToDistDir('packs_src', 'packs-system');
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
import { CompendiumsManager } from './CompendiumsManager.mjs';
|
||||||
|
CompendiumsManager.unpackToSrcDir('packs_src', 'packs-system');
|
||||||
Reference in New Issue
Block a user