Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 96306623e5 | |||
| 7279cd752d | |||
| db3e8b5d35 | |||
| 54421e4a83 | |||
| ac44419b7a | |||
| a3fc0a42b9 | |||
| c8ce840e98 | |||
| 55a040062a | |||
| 1818a76499 | |||
| 55d1b41ca4 | |||
| 841ed82277 | |||
| 968d156d09 | |||
| 59ff098fca | |||
| b8174d5e22 | |||
| 7f15450566 | |||
| 28fdaff2ec | |||
| 81584ed5d6 | |||
| 8c9a13faf1 | |||
| 6c6c473147 | |||
| 2e2a917a45 | |||
| 343abc32e2 | |||
| c37d92af25 |
@@ -60,4 +60,4 @@ jobs:
|
|||||||
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: "13"
|
||||||
compatibility-verified: "13"
|
compatibility-verified: "14"
|
||||||
|
|||||||
Binary file not shown.
+281
-4
@@ -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);
|
||||||
@@ -2595,6 +2634,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 +3028,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 +3040,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,
|
||||||
@@ -3994,3 +4048,226 @@ i.lethalfantasy {
|
|||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
/* -------------------------------------------------- */
|
||||||
|
/* 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);
|
||||||
|
}
|
||||||
|
|||||||
+186
-7
@@ -152,6 +152,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 +301,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",
|
||||||
@@ -316,9 +382,12 @@
|
|||||||
"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",
|
||||||
@@ -393,6 +462,13 @@
|
|||||||
"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",
|
||||||
"rangedAttackDefense": "Ranged attack defense",
|
"rangedAttackDefense": "Ranged attack defense",
|
||||||
@@ -429,7 +505,42 @@
|
|||||||
"wis": "WIS",
|
"wis": "WIS",
|
||||||
"weapon-damage-medium": "Weapon damage medium",
|
"weapon-damage-medium": "Weapon damage medium",
|
||||||
"weapon-damage-small": "Weapon damage small",
|
"weapon-damage-small": "Weapon damage small",
|
||||||
"combatProgressionStart": "Combat start threshold"
|
"combatProgressionStart": "Combat start threshold",
|
||||||
|
"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": {
|
||||||
@@ -485,6 +596,15 @@
|
|||||||
},
|
},
|
||||||
"savingThrow": {
|
"savingThrow": {
|
||||||
"label": "Saving throw"
|
"label": "Saving throw"
|
||||||
|
},
|
||||||
|
"damageDiceOverpowered": {
|
||||||
|
"label": "Overpowered Damage Dice"
|
||||||
|
},
|
||||||
|
"damageDiceOverpowered2": {
|
||||||
|
"label": "Overpowered 2 Damage Dice"
|
||||||
|
},
|
||||||
|
"damageDice": {
|
||||||
|
"label": "Damage Dice"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -519,7 +639,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": {
|
||||||
@@ -604,7 +726,8 @@
|
|||||||
"label": "Min"
|
"label": "Min"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"autoDestruction": "Auto-Destruction"
|
||||||
},
|
},
|
||||||
"Skill": {
|
"Skill": {
|
||||||
"Category": {
|
"Category": {
|
||||||
@@ -661,6 +784,9 @@
|
|||||||
"weaponClass": {
|
"weaponClass": {
|
||||||
"label": "Class"
|
"label": "Class"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"error": {
|
||||||
|
"weaponBonus": "Weapon bonus exceeds the allowed maximum (skill total / 10)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Spell": {
|
"Spell": {
|
||||||
@@ -723,7 +849,23 @@
|
|||||||
},
|
},
|
||||||
"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",
|
||||||
@@ -731,7 +873,11 @@
|
|||||||
"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."
|
"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": {
|
||||||
@@ -746,7 +892,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": {
|
||||||
@@ -890,6 +1038,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": {
|
||||||
@@ -910,4 +1089,4 @@
|
|||||||
"weapon": "Weapon"
|
"weapon": "Weapon"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+632
-220
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,6 +18,7 @@ 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,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -49,6 +50,15 @@ export class LethalFantasyCombatTracker extends foundry.applications.sidebar.tab
|
|||||||
c.update({ 'initiative': newInit });
|
c.update({ 'initiative': newInit });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll progression dice for all monster combatants that are eligible this round.
|
||||||
|
* @param {Event} ev Click event.
|
||||||
|
*/
|
||||||
|
static async #rollMonsterProgression(ev) {
|
||||||
|
ev.preventDefault();
|
||||||
|
await game.combat.rollMonsterProgression();
|
||||||
|
}
|
||||||
|
|
||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
super.activateListeners(html);
|
super.activateListeners(html);
|
||||||
// Display Combat settings
|
// Display Combat settings
|
||||||
@@ -100,29 +110,60 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Roll progression dice for all eligible monster combatants this round. Called manually by the GM. */
|
||||||
|
async rollMonsterProgression() {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
resetProgression(cId) {
|
resetProgression(cId) {
|
||||||
let c = this.combatants.get(cId);
|
let c = this.combatants.get(cId);
|
||||||
c.update({ 'system.progressionCount': 0 });
|
c.update({ 'system.progressionCount': 0 });
|
||||||
@@ -144,15 +185,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 +214,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 +231,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)
|
||||||
|
}
|
||||||
@@ -172,7 +172,7 @@ 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) {
|
||||||
@@ -259,9 +259,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)
|
||||||
|
|
||||||
|
|||||||
@@ -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,621 @@
|
|||||||
{
|
{
|
||||||
"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"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"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"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"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"
|
}
|
||||||
},
|
},
|
||||||
"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"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"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 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"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"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": "knockback"
|
||||||
"melee_attack": "empty",
|
}
|
||||||
"ranged_attack": "empty",
|
],
|
||||||
"melee_defense": "empty",
|
"description": "Bleed, Knock-back 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",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
|
"description": "Kick, Punch or Shield Bash"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "skill",
|
||||||
|
"description": "Add 1 to Skill Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
|
"description": "Kick, Punch or Shield Bash"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
"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 or Hit to 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": "knockback"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Bleed, Knock-back on Hit"
|
||||||
|
},
|
||||||
|
"ranged_attack": {
|
||||||
|
"type": "bleed",
|
||||||
|
"description": "Bleed"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
|
"description": "Kick, Punch or Shield Bash"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "skill",
|
||||||
|
"description": "Add 1 to Skill Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
|
"description": "Kick, Punch or Shield Bash"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"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"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"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": "knockback"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Bleed, Knock-back on Hit"
|
||||||
|
},
|
||||||
|
"ranged_attack": {
|
||||||
|
"type": "bleed",
|
||||||
|
"description": "Bleed"
|
||||||
|
},
|
||||||
|
"melee_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
|
"description": "Kick, Punch, or Shield Bash"
|
||||||
|
},
|
||||||
|
"skill_rolls": {
|
||||||
|
"type": "bonus_flat",
|
||||||
|
"amount": 1,
|
||||||
|
"target": "skill",
|
||||||
|
"description": "Add 1 to Skill Roll"
|
||||||
|
},
|
||||||
|
"ranged_defense": {
|
||||||
|
"type": "counter_attack",
|
||||||
|
"options": [
|
||||||
|
"kick",
|
||||||
|
"punch",
|
||||||
|
"shield_bash"
|
||||||
|
],
|
||||||
|
"description": "Kick, Punch, or Shield Bash"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"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": "Possible Spell Calamity or Catastrophe"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"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."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -193,6 +193,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 +305,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,
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* *************************************************/
|
/* *************************************************/
|
||||||
async prepareRoll(rollType, rollKey, rollDice, defenderId, defenderTokenId) {
|
async prepareRoll(rollType, rollKey, rollDice, defenderId, defenderTokenId, extraShieldDr = 0) {
|
||||||
console.log("Preparing roll", rollType, rollKey, rollDice, defenderId)
|
console.log("Preparing roll", rollType, rollKey, rollDice, defenderId)
|
||||||
let rollTarget
|
let rollTarget
|
||||||
switch (rollType) {
|
switch (rollType) {
|
||||||
@@ -198,6 +198,22 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
case "miracle-power":
|
case "miracle-power":
|
||||||
rollTarget = this.items.find((i) => (i.type === "miracle" || i.type == "spell") && i.id === rollKey)
|
rollTarget = this.items.find((i) => (i.type === "miracle" || i.type == "spell") && i.id === rollKey)
|
||||||
rollTarget.rollKey = rollKey
|
rollTarget.rollKey = rollKey
|
||||||
|
if (rollType === "spell-attack" || rollType === "spell-power") {
|
||||||
|
const cost = Number(rollTarget.system?.cost) || 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)
|
||||||
@@ -256,19 +272,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, defenderTokenId)
|
await this.system.roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ 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"
|
||||||
@@ -47,26 +48,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,22 +86,27 @@ 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) {
|
||||||
@@ -123,7 +129,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
|
||||||
@@ -177,11 +183,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 +195,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,
|
||||||
|
|||||||
+109
-66
@@ -182,6 +182,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 +220,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") {
|
||||||
@@ -265,6 +272,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")) {
|
||||||
@@ -282,7 +290,11 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
options.damageMedium = true
|
options.damageMedium = true
|
||||||
dice = options.rollTarget.weapon.system.damage.damageM
|
dice = options.rollTarget.weapon.system.damage.damageM
|
||||||
}
|
}
|
||||||
dice = dice.replace("E", "")
|
if (/NE$/i.test(dice)) {
|
||||||
|
hasMaxValue = false
|
||||||
|
hasExplode = false
|
||||||
|
}
|
||||||
|
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 +307,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 +320,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,
|
||||||
@@ -346,58 +362,75 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
favor: "none",
|
favor: "none",
|
||||||
targetName
|
targetName
|
||||||
}
|
}
|
||||||
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,
|
label: label,
|
||||||
callback: (event, button, dialog) => {
|
callback: (event, button, dialog) => {
|
||||||
console.log("Roll context", event, button, dialog)
|
console.log("Roll context", event, button, dialog)
|
||||||
let position = dialog.position
|
let position = dialog.position
|
||||||
game.user.setFlag(SYSTEM.id, "roll-dialog-pos", foundry.utils.duplicate(position))
|
game.user.setFlag(SYSTEM.id, "roll-dialog-pos", foundry.utils.duplicate(position))
|
||||||
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
|
||||||
}, {})
|
}, {})
|
||||||
return output
|
return output
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
],
|
||||||
],
|
actions: {
|
||||||
actions: {
|
"selectGranted": (event, button, dialog) => {
|
||||||
"selectGranted": (event, button, dialog) => {
|
hasGrantedDice = event.target.checked
|
||||||
hasGrantedDice = event.target.checked
|
},
|
||||||
},
|
"selectBeyondSkill": (event, button, dialog) => {
|
||||||
"selectBeyondSkill": (event, button, dialog) => {
|
beyondSkill = button.checked
|
||||||
beyondSkill = button.checked
|
},
|
||||||
},
|
"selectPointBlank": (event, button, dialog) => {
|
||||||
"selectPointBlank": (event, button, dialog) => {
|
pointBlank = button.checked
|
||||||
pointBlank = button.checked
|
},
|
||||||
},
|
"selectLetItFly": (event, button, dialog) => {
|
||||||
"selectLetItFly": (event, button, dialog) => {
|
letItFly = button.checked
|
||||||
letItFly = button.checked
|
},
|
||||||
},
|
"saveSpellCheck": (event, button, dialog) => {
|
||||||
"saveSpellCheck": (event, button, dialog) => {
|
saveSpell = button.checked
|
||||||
saveSpell = button.checked
|
},
|
||||||
},
|
"gotoToken": (event, button, dialog) => {
|
||||||
"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
|
||||||
@@ -475,7 +508,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,
|
||||||
@@ -547,6 +581,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) {
|
||||||
@@ -558,7 +596,8 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
const d30Message = D30Roll.getResult(
|
const d30Message = D30Roll.getResult(
|
||||||
rollD30.total,
|
rollD30.total,
|
||||||
options.rollType,
|
options.rollType,
|
||||||
options.rollTarget?.weapon
|
options.rollTarget?.weapon,
|
||||||
|
{ isRanged: options.isRangedDefense }
|
||||||
)
|
)
|
||||||
options.D30message = d30Message
|
options.D30message = d30Message
|
||||||
}
|
}
|
||||||
@@ -621,6 +660,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
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.defenderTokenId = options.defenderTokenId
|
||||||
|
rollBase.options.extraShieldDr = options.extraShieldDr || 0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A hook event that fires after the roll has been made.
|
* A hook event that fires after the roll has been made.
|
||||||
@@ -638,7 +678,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
|
|
||||||
/* ***********************************************************/
|
/* ***********************************************************/
|
||||||
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,
|
||||||
@@ -692,8 +732,8 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
|
|
||||||
let initRoll = new Roll(formula, options.data)
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -706,7 +746,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
/* ***********************************************************/
|
/* ***********************************************************/
|
||||||
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,
|
||||||
@@ -963,7 +1003,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)
|
||||||
}
|
}
|
||||||
@@ -1005,7 +1045,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,
|
||||||
@@ -1085,6 +1125,7 @@ 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"
|
||||||
|
|
||||||
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)
|
||||||
@@ -1092,6 +1133,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")) {
|
||||||
@@ -1134,6 +1176,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)
|
||||||
@@ -1291,12 +1334,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,
|
||||||
@@ -1313,7 +1356,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rollData: this.rollData,
|
rollData: this.rollData,
|
||||||
...messageData,
|
...messageData,
|
||||||
},
|
},
|
||||||
{ rollMode: rollMode },
|
{ messageMode, create },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ 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 }),
|
||||||
@@ -259,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)
|
||||||
@@ -274,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, defenderTokenId) {
|
async roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr = 0) {
|
||||||
const hasTarget = false
|
const hasTarget = false
|
||||||
let roll = await LethalFantasyRoll.prompt({
|
let roll = await LethalFantasyRoll.prompt({
|
||||||
rollType,
|
rollType,
|
||||||
@@ -285,11 +292,12 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
hasTarget,
|
hasTarget,
|
||||||
target: false,
|
target: false,
|
||||||
defenderId,
|
defenderId,
|
||||||
defenderTokenId
|
defenderTokenId,
|
||||||
|
extraShieldDr
|
||||||
})
|
})
|
||||||
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) {
|
||||||
@@ -310,7 +318,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) {
|
||||||
@@ -348,6 +356,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
|
||||||
}
|
}
|
||||||
|
|||||||
+47
-17
@@ -64,7 +64,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
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 +74,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 +124,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,7 +164,7 @@ 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, defenderTokenId = undefined) {
|
async roll(rollType, rollTarget, defenderId = undefined, defenderTokenId = undefined, extraShieldDr = 0) {
|
||||||
const hasTarget = false
|
const hasTarget = false
|
||||||
let roll = await LethalFantasyRoll.prompt({
|
let roll = await LethalFantasyRoll.prompt({
|
||||||
rollType,
|
rollType,
|
||||||
@@ -152,26 +175,33 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
hasTarget,
|
hasTarget,
|
||||||
target: false,
|
target: false,
|
||||||
defenderId,
|
defenderId,
|
||||||
defenderTokenId
|
defenderTokenId,
|
||||||
|
extraShieldDr
|
||||||
})
|
})
|
||||||
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, defenderTokenId = undefined) {
|
async prepareMonsterRoll(rollType, rollKey, rollDice = undefined, tokenId = undefined, damageModifier = undefined, defenderId = undefined, defenderTokenId = undefined, extraShieldDr = 0) {
|
||||||
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":
|
||||||
@@ -203,7 +233,7 @@ 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-small":
|
||||||
@@ -240,7 +270,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)
|
||||||
@@ -254,8 +284,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)
|
||||||
await this.roll(rollType, rollTarget, defenderId, defenderTokenId)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,7 +304,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) {
|
||||||
@@ -287,7 +316,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,
|
||||||
@@ -303,8 +332,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(
|
||||||
|
|||||||
@@ -39,6 +39,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
|
||||||
}
|
}
|
||||||
|
|||||||
+347
-20
@@ -124,10 +124,12 @@ export default class LethalFantasyUtils {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
case "rollInitiative":
|
case "rollInitiative":
|
||||||
|
if (msg.userId && msg.userId !== game.user.id) break
|
||||||
actor = game.actors.get(msg.actorId)
|
actor = game.actors.get(msg.actorId)
|
||||||
actor.system.rollInitiative(msg.combatId, msg.combatantId)
|
actor.system.rollInitiative(msg.combatId, msg.combatantId)
|
||||||
break
|
break
|
||||||
case "rollProgressionDice":
|
case "rollProgressionDice":
|
||||||
|
if (msg.userId && msg.userId !== game.user.id) break
|
||||||
actor = game.actors.get(msg.actorId)
|
actor = game.actors.get(msg.actorId)
|
||||||
actor.system.rollProgressionDice(msg.combatId, msg.combatantId, msg.rollProgressionCount)
|
actor.system.rollProgressionDice(msg.combatId, msg.combatantId, msg.rollProgressionCount)
|
||||||
break
|
break
|
||||||
@@ -190,6 +192,9 @@ export default class LethalFantasyUtils {
|
|||||||
const attackWeaponId = msg.attackWeaponId
|
const attackWeaponId = msg.attackWeaponId
|
||||||
const attackRollType = msg.attackRollType
|
const attackRollType = msg.attackRollType
|
||||||
const attackRollKey = msg.attackRollKey
|
const attackRollKey = msg.attackRollKey
|
||||||
|
const attackD30result = msg.attackD30result
|
||||||
|
const attackD30message = msg.attackD30message
|
||||||
|
const attackRerollContext = msg.attackRerollContext
|
||||||
const combatantId = msg.combatantId
|
const combatantId = msg.combatantId
|
||||||
const tokenId = msg.tokenId
|
const tokenId = msg.tokenId
|
||||||
|
|
||||||
@@ -230,9 +235,77 @@ export default class LethalFantasyUtils {
|
|||||||
|
|
||||||
const isMonster = defender.type === "monster"
|
const isMonster = defender.type === "monster"
|
||||||
|
|
||||||
|
console.log(`[LF] showDefenseRequest | attackRollType=${attackRollType} isMonster=${isMonster} defender=${defender?.name}`)
|
||||||
|
|
||||||
|
// Spell/miracle attacks use saving throws instead of weapon defense
|
||||||
|
const isSpellAttack = attackRollType === "spell-attack" || attackRollType === "miracle-attack"
|
||||||
|
if (isSpellAttack) {
|
||||||
|
const savesConfig = isMonster ? SYSTEM.MONSTER_SAVES : SYSTEM.SAVES
|
||||||
|
const combatSaves = ["will", "dodge", "toughness"]
|
||||||
|
const savesHTML = Object.values(savesConfig)
|
||||||
|
.filter(s => combatSaves.includes(s.id))
|
||||||
|
.map(s => `<option value="${s.id}">${game.i18n.localize(s.label)}</option>`)
|
||||||
|
.join("")
|
||||||
|
|
||||||
|
const content = `
|
||||||
|
<div class="defense-request-dialog">
|
||||||
|
<div class="attack-info">
|
||||||
|
<p><strong>${attackerName}</strong> targets <strong>${defenderName}</strong> with <strong>${weaponName}</strong>!</p>
|
||||||
|
<p>Attack roll: <strong>${attackRoll}</strong></p>
|
||||||
|
</div>
|
||||||
|
<div class="weapon-selection">
|
||||||
|
<label for="save-type">Choose saving throw:</label>
|
||||||
|
<select id="save-type" name="saveKey" style="width: 100%; margin-top: 8px;">
|
||||||
|
${savesHTML}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
|
||||||
|
const result = await foundry.applications.api.DialogV2.wait({
|
||||||
|
window: { title: "Saving Throw vs Spell" },
|
||||||
|
classes: ["lethalfantasy"],
|
||||||
|
content,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
action: "rollSave",
|
||||||
|
label: "Roll Save",
|
||||||
|
icon: "fa-solid fa-person-running",
|
||||||
|
callback: (event, button) => button.form.elements.saveKey.value,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
rejectClose: false
|
||||||
|
})
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
game.lethalFantasy = game.lethalFantasy || {}
|
||||||
|
game.lethalFantasy.nextDefenseData = {
|
||||||
|
attackerId,
|
||||||
|
attackRoll,
|
||||||
|
attackerName,
|
||||||
|
defenderName,
|
||||||
|
attackWeaponId,
|
||||||
|
attackRollType,
|
||||||
|
attackRollKey,
|
||||||
|
attackD30result,
|
||||||
|
attackD30message,
|
||||||
|
attackRerollContext,
|
||||||
|
defenderId: defender.id,
|
||||||
|
defenderTokenId
|
||||||
|
}
|
||||||
|
if (isMonster) {
|
||||||
|
defender.system.prepareMonsterRoll("save", result)
|
||||||
|
} else {
|
||||||
|
defender.prepareRoll("save", result)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Pour les monstres, récupérer les attaques activées
|
// Pour les monstres, récupérer les attaques activées
|
||||||
if (isMonster) {
|
if (isMonster) {
|
||||||
const enabledAttacks = Object.entries(defender.system.attacks).filter(([key, attack]) => attack.enabled)
|
const attacksSet = defender.system.attackMode === "ranged" ? defender.system.rangedAttacks : defender.system.attacks
|
||||||
|
const enabledAttacks = Object.entries(attacksSet).filter(([key, attack]) => attack.enabled)
|
||||||
|
|
||||||
if (enabledAttacks.length === 0) {
|
if (enabledAttacks.length === 0) {
|
||||||
ui.notifications.warn("No enabled attacks available for defense")
|
ui.notifications.warn("No enabled attacks available for defense")
|
||||||
@@ -261,7 +334,7 @@ export default class LethalFantasyUtils {
|
|||||||
|
|
||||||
// Afficher le dialogue
|
// Afficher le dialogue
|
||||||
const result = await foundry.applications.api.DialogV2.wait({
|
const result = await foundry.applications.api.DialogV2.wait({
|
||||||
window: { title: "Defense Roll" },
|
window: { title: msg.isRanged ? "Ranged Defense Roll" : "Defense Roll" },
|
||||||
classes: ["lethalfantasy"],
|
classes: ["lethalfantasy"],
|
||||||
content,
|
content,
|
||||||
buttons: [
|
buttons: [
|
||||||
@@ -289,8 +362,12 @@ export default class LethalFantasyUtils {
|
|||||||
attackWeaponId,
|
attackWeaponId,
|
||||||
attackRollType,
|
attackRollType,
|
||||||
attackRollKey,
|
attackRollKey,
|
||||||
|
attackD30result,
|
||||||
|
attackD30message,
|
||||||
|
attackRerollContext,
|
||||||
defenderId: defender.id,
|
defenderId: defender.id,
|
||||||
defenderTokenId
|
defenderTokenId,
|
||||||
|
isRanged: msg.isRanged
|
||||||
}
|
}
|
||||||
|
|
||||||
defender.system.prepareMonsterRoll("monster-defense", result)
|
defender.system.prepareMonsterRoll("monster-defense", result)
|
||||||
@@ -298,6 +375,37 @@ export default class LethalFantasyUtils {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pour les personnages, récupérer les armes équipées
|
||||||
|
// Si l'attaque est une attaque à distance, utiliser le dialogue de défense à distance
|
||||||
|
if (msg.isRanged) {
|
||||||
|
const { default: LethalFantasyRoll } = await import("./documents/roll.mjs")
|
||||||
|
const roll = await LethalFantasyRoll.promptRangedDefense({
|
||||||
|
actorId: defender.id,
|
||||||
|
actorName: defender.name,
|
||||||
|
actorImage: defender.img,
|
||||||
|
})
|
||||||
|
if (roll) {
|
||||||
|
game.lethalFantasy = game.lethalFantasy || {}
|
||||||
|
game.lethalFantasy.nextDefenseData = {
|
||||||
|
attackerId,
|
||||||
|
attackRoll,
|
||||||
|
attackerName,
|
||||||
|
defenderName,
|
||||||
|
attackWeaponId,
|
||||||
|
attackRollType,
|
||||||
|
attackRollKey,
|
||||||
|
attackD30result,
|
||||||
|
attackD30message,
|
||||||
|
attackRerollContext,
|
||||||
|
defenderId: defender.id,
|
||||||
|
defenderTokenId,
|
||||||
|
isRanged: true
|
||||||
|
}
|
||||||
|
await roll.toMessage({}, { messageMode: roll.options.rollMode })
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Pour les personnages, récupérer les armes équipées
|
// Pour les personnages, récupérer les armes équipées
|
||||||
const equippedWeapons = defender.items.filter(i =>
|
const equippedWeapons = defender.items.filter(i =>
|
||||||
i.type === "weapon" && i.system.equipped === true
|
i.type === "weapon" && i.system.equipped === true
|
||||||
@@ -358,8 +466,12 @@ export default class LethalFantasyUtils {
|
|||||||
attackWeaponId,
|
attackWeaponId,
|
||||||
attackRollType,
|
attackRollType,
|
||||||
attackRollKey,
|
attackRollKey,
|
||||||
|
attackD30result,
|
||||||
|
attackD30message,
|
||||||
|
attackRerollContext,
|
||||||
defenderId: defender.id,
|
defenderId: defender.id,
|
||||||
defenderTokenId
|
defenderTokenId,
|
||||||
|
isRanged: msg.isRanged
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Storing defense data for character:", defender.id)
|
console.log("Storing defense data for character:", defender.id)
|
||||||
@@ -368,6 +480,188 @@ export default class LethalFantasyUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static hasD30Reroll(d30Message) {
|
||||||
|
return d30Message?.type === "mulligan"
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static getCombatBonusDiceChoices() {
|
||||||
|
return ["1d4", "1d6", "1d8", "1d10", "1d12", "1d20", "1d20e"]
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static getShieldReactionData(actor) {
|
||||||
|
if (!actor) return null
|
||||||
|
if (actor.type === "monster") {
|
||||||
|
const formula = actor.system.combat?.shieldDefenseDice
|
||||||
|
const damageReduction = actor.getShieldDR()
|
||||||
|
if (!formula || damageReduction <= 0) return null
|
||||||
|
return {
|
||||||
|
label: game.i18n.localize("LETHALFANTASY.Label.shieldDefenseDice"),
|
||||||
|
formula,
|
||||||
|
damageReduction
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const equippedShields = actor.items.filter(item => item.type === "shield" && item.system.equipped)
|
||||||
|
if (equippedShields.length === 0) return null
|
||||||
|
|
||||||
|
const shield = equippedShields[0]
|
||||||
|
return {
|
||||||
|
label: shield.name,
|
||||||
|
formula: shield.system.defense,
|
||||||
|
damageReduction: actor.getShieldDR(),
|
||||||
|
shieldId: shield.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static async promptCombatBonusDie(actorName, sideLabel, currentRoll, opposingRoll) {
|
||||||
|
const choices = this.getCombatBonusDiceChoices()
|
||||||
|
const optionsHtml = choices.map(choice => `<option value="${choice}">${choice.toUpperCase()}</option>`).join("")
|
||||||
|
const content = `
|
||||||
|
<div class="grit-luck-dialog">
|
||||||
|
<div class="combat-status">
|
||||||
|
<p><strong>${actorName}</strong> currently has <strong>${currentRoll}</strong></p>
|
||||||
|
<p>Opposing ${sideLabel} roll: <strong>${opposingRoll}</strong></p>
|
||||||
|
</div>
|
||||||
|
<div class="weapon-selection">
|
||||||
|
<label for="bonus-die">Choose a bonus die:</label>
|
||||||
|
<select id="bonus-die" name="bonusDie" style="width: 100%; margin-top: 8px;">
|
||||||
|
${optionsHtml}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
|
||||||
|
return await foundry.applications.api.DialogV2.wait({
|
||||||
|
window: { title: "Add Bonus Die" },
|
||||||
|
classes: ["lethalfantasy"],
|
||||||
|
content,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
action: "roll",
|
||||||
|
label: "Roll Bonus Die",
|
||||||
|
icon: "fa-solid fa-dice",
|
||||||
|
callback: (event, button) => {
|
||||||
|
const sel = button.form?.elements?.bonusDie ?? button.closest("form")?.elements?.bonusDie
|
||||||
|
return sel?.value ?? choices[0]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: "cancel",
|
||||||
|
label: "Cancel",
|
||||||
|
icon: "fa-solid fa-xmark",
|
||||||
|
callback: () => null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
rejectClose: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
/**
|
||||||
|
* Prompt the GM or player to choose an ad-hoc shield dice and DR value.
|
||||||
|
* Used when the defender has no pre-configured shield equipment.
|
||||||
|
* @param {string} defenderName
|
||||||
|
* @param {number} attackRoll
|
||||||
|
* @param {number} defenseRoll
|
||||||
|
* @returns {Promise<{formula: string, damageReduction: number}|null>}
|
||||||
|
*/
|
||||||
|
static async promptAdHocShield(defenderName, attackRoll, defenseRoll) {
|
||||||
|
const choices = this.getCombatBonusDiceChoices()
|
||||||
|
const optionsHtml = choices.map(c => `<option value="${c}">${c.toUpperCase()}</option>`).join("")
|
||||||
|
const content = `
|
||||||
|
<div class="grit-luck-dialog">
|
||||||
|
<div class="combat-status">
|
||||||
|
<p><strong>${defenderName}</strong> uses a shield (not equipped)</p>
|
||||||
|
<p>Attack: <strong>${attackRoll}</strong> — Current defense: <strong>${defenseRoll}</strong></p>
|
||||||
|
</div>
|
||||||
|
<div class="weapon-selection" style="margin-top:8px;">
|
||||||
|
<label for="shield-dice">Shield dice:</label>
|
||||||
|
<select id="shield-dice" name="shieldDice" style="width: 100%; margin-top: 4px;">
|
||||||
|
${optionsHtml}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="weapon-selection" style="margin-top:8px;">
|
||||||
|
<label for="shield-dr">Shield DR value:</label>
|
||||||
|
<input id="shield-dr" name="shieldDR" type="number" min="0" value="0" style="width: 100%; margin-top: 4px;" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
|
||||||
|
const raw = await foundry.applications.api.DialogV2.wait({
|
||||||
|
window: { title: "Ad-hoc Shield Roll" },
|
||||||
|
classes: ["lethalfantasy"],
|
||||||
|
content,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
action: "roll",
|
||||||
|
label: "Roll Shield",
|
||||||
|
icon: "fa-solid fa-shield",
|
||||||
|
callback: (event, button) => {
|
||||||
|
const shieldDice = button.form?.elements?.shieldDice ?? button.closest("form")?.elements?.shieldDice
|
||||||
|
const shieldDR = button.form?.elements?.shieldDR ?? button.closest("form")?.elements?.shieldDR
|
||||||
|
return {
|
||||||
|
formula: shieldDice?.value ?? "1d6",
|
||||||
|
damageReduction: Number(shieldDR?.value) || 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: "cancel",
|
||||||
|
label: "Cancel",
|
||||||
|
icon: "fa-solid fa-xmark",
|
||||||
|
callback: () => null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
rejectClose: false
|
||||||
|
})
|
||||||
|
|
||||||
|
return raw ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
/**
|
||||||
|
* Roll a bonus die formula, optionally showing Dice So Nice animation and posting a chat message.
|
||||||
|
* @param {string} formula
|
||||||
|
* @param {Actor} actor
|
||||||
|
* @param {Function} [messageContent]
|
||||||
|
* @returns {Promise<number>}
|
||||||
|
*/
|
||||||
|
static async rollBonusDie(formula, actor, messageContent) {
|
||||||
|
const roll = new Roll(formula)
|
||||||
|
await roll.evaluate()
|
||||||
|
if (game?.dice3d) {
|
||||||
|
await game.dice3d.showForRoll(roll, game.user, true)
|
||||||
|
}
|
||||||
|
if (messageContent) {
|
||||||
|
await ChatMessage.create({
|
||||||
|
content: messageContent(roll.total, formula),
|
||||||
|
speaker: ChatMessage.getSpeaker({ actor })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return roll.total
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static async rerollConfiguredRoll(rerollContext = {}) {
|
||||||
|
const RollClass = CONFIG.Dice.rolls.find(r => r.name === "LethalFantasyRoll")
|
||||||
|
if (typeof RollClass?.prompt !== "function") {
|
||||||
|
ui.notifications.error("Lethal Fantasy roll class not available for reroll")
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
return await RollClass.prompt({
|
||||||
|
...foundry.utils.duplicate(rerollContext),
|
||||||
|
rollContext: foundry.utils.duplicate(rerollContext.rollContext || {}),
|
||||||
|
forceNoD30: true,
|
||||||
|
hasTarget: false,
|
||||||
|
target: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async offerGritLuckBonus(defender, attackRoll, currentDefenseRoll, attackerName, defenderName) {
|
static async offerGritLuckBonus(defender, attackRoll, currentDefenseRoll, attackerName, defenderName) {
|
||||||
let totalBonus = 0
|
let totalBonus = 0
|
||||||
@@ -538,7 +832,8 @@ export default class LethalFantasyUtils {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async compareAttackDefense(data) {
|
static async compareAttackDefense(data) {
|
||||||
console.log("compareAttackDefense called with:", data)
|
console.log("compareAttackDefense called with:", data)
|
||||||
const isAttackWin = data.attackRoll > data.defenseRoll
|
const outcome = data.outcome || (data.attackRoll > data.defenseRoll ? "hit" : "miss")
|
||||||
|
const isAttackWin = outcome !== "miss"
|
||||||
console.log("isAttackWin:", isAttackWin, "attackRoll:", data.attackRoll, "defenseRoll:", data.defenseRoll)
|
console.log("isAttackWin:", isAttackWin, "attackRoll:", data.attackRoll, "defenseRoll:", data.defenseRoll)
|
||||||
|
|
||||||
let damageButton = ""
|
let damageButton = ""
|
||||||
@@ -548,10 +843,10 @@ export default class LethalFantasyUtils {
|
|||||||
if (data.attackRollType === "weapon-attack") {
|
if (data.attackRollType === "weapon-attack") {
|
||||||
damageButton = `
|
damageButton = `
|
||||||
<div class="attack-result-damage">
|
<div class="attack-result-damage">
|
||||||
<button class="roll-damage-btn" data-attacker-id="${data.attackerId}" data-defender-id="${data.defenderId}" data-defender-token-id="${data.defenderTokenId || ""}" data-weapon-id="${data.attackWeaponId}" data-damage-type="small">
|
<button class="roll-damage-btn" data-attacker-id="${data.attackerId}" data-defender-id="${data.defenderId}" data-defender-token-id="${data.defenderTokenId || ""}" data-extra-shield-dr="${data.shieldDamageReduction || 0}" data-weapon-id="${data.attackWeaponId}" data-damage-type="small">
|
||||||
<i class="fa-solid fa-dice-d6"></i> Damage (Small)
|
<i class="fa-solid fa-dice-d6"></i> Damage (Small)
|
||||||
</button>
|
</button>
|
||||||
<button class="roll-damage-btn" data-attacker-id="${data.attackerId}" data-defender-id="${data.defenderId}" data-defender-token-id="${data.defenderTokenId || ""}" data-weapon-id="${data.attackWeaponId}" data-damage-type="medium">
|
<button class="roll-damage-btn" data-attacker-id="${data.attackerId}" data-defender-id="${data.defenderId}" data-defender-token-id="${data.defenderTokenId || ""}" data-extra-shield-dr="${data.shieldDamageReduction || 0}" data-weapon-id="${data.attackWeaponId}" data-damage-type="medium">
|
||||||
<i class="fa-solid fa-dice-d20"></i> Damage (Medium)
|
<i class="fa-solid fa-dice-d20"></i> Damage (Medium)
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -559,11 +854,34 @@ export default class LethalFantasyUtils {
|
|||||||
} else if (data.attackRollType === "monster-attack") {
|
} else if (data.attackRollType === "monster-attack") {
|
||||||
damageButton = `
|
damageButton = `
|
||||||
<div class="attack-result-damage">
|
<div class="attack-result-damage">
|
||||||
<button class="roll-damage-btn" data-attacker-id="${data.attackerId}" data-defender-id="${data.defenderId}" data-defender-token-id="${data.defenderTokenId || ""}" data-attack-key="${data.attackRollKey}" data-damage-type="monster">
|
<button class="roll-damage-btn" data-attacker-id="${data.attackerId}" data-defender-id="${data.defenderId}" data-defender-token-id="${data.defenderTokenId || ""}" data-extra-shield-dr="${data.shieldDamageReduction || 0}" data-attack-key="${data.attackRollKey}" data-damage-type="monster">
|
||||||
<i class="fa-solid fa-burst"></i> Damage
|
<i class="fa-solid fa-burst"></i> Damage
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
} else if (data.attackRollType === "spell-attack" || data.attackRollType === "miracle-attack") {
|
||||||
|
const attacker = game.actors.get(data.attackerId)
|
||||||
|
const spell = attacker?.items.get(data.attackWeaponId)
|
||||||
|
const tiers = [
|
||||||
|
{ formula: spell?.system?.damageDice, label: "Standard" },
|
||||||
|
{ formula: spell?.system?.damageDiceOverpowered, label: "Overpowered" },
|
||||||
|
{ formula: spell?.system?.damageDiceOverpowered2, label: "Overpowered 2" },
|
||||||
|
].filter(t => t.formula)
|
||||||
|
if (tiers.length) {
|
||||||
|
const buttons = tiers.map(t => {
|
||||||
|
const escapedFormula = Handlebars.escapeExpression(t.formula)
|
||||||
|
return `
|
||||||
|
<button class="roll-damage-btn"
|
||||||
|
data-attacker-id="${data.attackerId}"
|
||||||
|
data-defender-id="${data.defenderId}"
|
||||||
|
data-defender-token-id="${data.defenderTokenId || ""}"
|
||||||
|
data-damage-type="spell"
|
||||||
|
data-damage-formula="${escapedFormula}">
|
||||||
|
<i class="fa-solid fa-wand-magic-sparkles"></i> ${t.label} (${escapedFormula})
|
||||||
|
</button>`
|
||||||
|
}).join("")
|
||||||
|
damageButton = `<div class="attack-result-damage">${buttons}</div>`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -588,9 +906,11 @@ export default class LethalFantasyUtils {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="combat-result-text">
|
<div class="combat-result-text">
|
||||||
${isAttackWin ?
|
${outcome === "shielded-hit"
|
||||||
`<i class="fa-solid fa-circle-check"></i> <strong>${data.attackerName}</strong> hits <strong>${data.defenderName}</strong>!` :
|
? `<i class="fa-solid fa-shield"></i> <strong>${data.defenderName}</strong> has blocked with shield — apply armor DR + shield DR <strong>${data.shieldDamageReduction || 0}</strong>.`
|
||||||
`<i class="fa-solid fa-shield-halved"></i> <strong>${data.defenderName}</strong> parries the attack!`
|
: isAttackWin
|
||||||
|
? `<i class="fa-solid fa-circle-check"></i> <strong>${data.attackerName}</strong> hits <strong>${data.defenderName}</strong>!`
|
||||||
|
: `<i class="fa-solid fa-shield-halved"></i> <strong>${data.defenderName}</strong> avoided the attack!`
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
${damageButton}
|
${damageButton}
|
||||||
@@ -777,25 +1097,32 @@ export default class LethalFantasyUtils {
|
|||||||
static async applyDamage(message, event) {
|
static async applyDamage(message, event) {
|
||||||
// Récupérer les données du message
|
// Récupérer les données du message
|
||||||
let combatantId = event.currentTarget.dataset.combatantId
|
let combatantId = event.currentTarget.dataset.combatantId
|
||||||
if (!combatantId || !game.combat) {
|
if (!combatantId) {
|
||||||
ui.notifications.error("No combatant selected")
|
ui.notifications.error("No combatant selected")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let combatant = game.combat.combatants.get(combatantId)
|
// Try to find the target: first as a combat combatant, then as a scene token
|
||||||
if (!combatant) {
|
let targetActor = null
|
||||||
ui.notifications.error("Combatant not found")
|
if (game.combat) {
|
||||||
return
|
const combatant = game.combat.combatants.get(combatantId)
|
||||||
|
if (combatant) {
|
||||||
|
targetActor = combatant.token?.actor || game.actors.get(combatant.actorId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!targetActor) {
|
||||||
|
// Fall back to scene token lookup (non-combat tokens use tokenId as their combatantId)
|
||||||
|
const token = canvas.tokens?.placeables?.find(t => t.id === combatantId)
|
||||||
|
targetActor = token?.actor
|
||||||
}
|
}
|
||||||
|
|
||||||
let targetActor = combatant.token?.actor || game.actors.get(combatant.actorId)
|
|
||||||
if (!targetActor) {
|
if (!targetActor) {
|
||||||
ui.notifications.error("Target actor not found")
|
ui.notifications.error("Target actor not found")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Récupérer les données de dégâts du message
|
// Récupérer les données de dégâts du message
|
||||||
let damageTotal = message.rolls[0]?.total || 0
|
// Use options.rollTotal (includes weapon modifier bonus) rather than roll.total (dice formula only)
|
||||||
|
let damageTotal = message.rolls[0]?.options?.rollTotal ?? message.rolls[0]?.total ?? 0
|
||||||
let weaponName = message.rolls[0]?.options?.rollName || "Unknown Weapon"
|
let weaponName = message.rolls[0]?.options?.rollName || "Unknown Weapon"
|
||||||
|
|
||||||
// Calculer les DR
|
// Calculer les DR
|
||||||
@@ -873,7 +1200,7 @@ export default class LethalFantasyUtils {
|
|||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
speaker: { alias: targetActor.name },
|
speaker: { alias: targetActor.name },
|
||||||
rollMode: "gmroll",
|
mode: "gm",
|
||||||
content: messageContent
|
content: messageContent
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
MANIFEST-000543
|
MANIFEST-000599
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/04/07-20:41:02.007080 7f6820dfe6c0 Recovering log #541
|
2026/05/18-17:40:11.769288 7f5a477fe6c0 Recovering log #597
|
||||||
2026/04/07-20:41:02.061052 7f6820dfe6c0 Delete type=3 #539
|
2026/05/18-17:40:11.780605 7f5a477fe6c0 Delete type=3 #595
|
||||||
2026/04/07-20:41:02.061103 7f6820dfe6c0 Delete type=0 #541
|
2026/05/18-17:40:11.780699 7f5a477fe6c0 Delete type=0 #597
|
||||||
2026/04/07-20:44:04.752043 7f656afef6c0 Level-0 table #546: started
|
2026/05/18-20:25:54.228818 7f5a467fc6c0 Level-0 table #602: started
|
||||||
2026/04/07-20:44:04.752063 7f656afef6c0 Level-0 table #546: 0 bytes OK
|
2026/05/18-20:25:54.230037 7f5a467fc6c0 Level-0 table #602: 0 bytes OK
|
||||||
2026/04/07-20:44:04.788614 7f656afef6c0 Delete type=0 #544
|
2026/05/18-20:25:54.236369 7f5a467fc6c0 Delete type=0 #600
|
||||||
2026/04/07-20:44:04.864197 7f656afef6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
2026/05/18-20:25:54.251050 7f5a467fc6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||||
2026/04/07-20:44:04.864237 7f656afef6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
2026/05/18-20:25:54.251106 7f5a467fc6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/02/06-21:03:10.117032 7f71b6ffd6c0 Recovering log #537
|
2026/05/18-07:32:52.671725 7f5a94bff6c0 Recovering log #593
|
||||||
2026/02/06-21:03:10.127068 7f71b6ffd6c0 Delete type=3 #535
|
2026/05/18-07:32:52.684619 7f5a94bff6c0 Delete type=3 #591
|
||||||
2026/02/06-21:03:10.127128 7f71b6ffd6c0 Delete type=0 #537
|
2026/05/18-07:32:52.684760 7f5a94bff6c0 Delete type=0 #593
|
||||||
2026/02/06-21:51:23.216143 7f71b67fc6c0 Level-0 table #542: started
|
2026/05/18-07:58:12.225439 7f5a467fc6c0 Level-0 table #598: started
|
||||||
2026/02/06-21:51:23.216190 7f71b67fc6c0 Level-0 table #542: 0 bytes OK
|
2026/05/18-07:58:12.225593 7f5a467fc6c0 Level-0 table #598: 0 bytes OK
|
||||||
2026/02/06-21:51:23.251149 7f71b67fc6c0 Delete type=0 #540
|
2026/05/18-07:58:12.232817 7f5a467fc6c0 Delete type=0 #596
|
||||||
2026/02/06-21:51:23.327713 7f71b67fc6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
2026/05/18-07:58:12.252837 7f5a467fc6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||||
2026/02/06-21:51:23.327750 7f71b67fc6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
2026/05/18-07:58:12.252955 7f5a467fc6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000540
|
MANIFEST-000596
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/04/07-20:41:02.075476 7f67ebfff6c0 Recovering log #538
|
2026/05/18-17:40:11.793894 7f5a94bff6c0 Recovering log #594
|
||||||
2026/04/07-20:41:02.123121 7f67ebfff6c0 Delete type=3 #536
|
2026/05/18-17:40:11.804447 7f5a94bff6c0 Delete type=3 #592
|
||||||
2026/04/07-20:41:02.123187 7f67ebfff6c0 Delete type=0 #538
|
2026/05/18-17:40:11.804549 7f5a94bff6c0 Delete type=0 #594
|
||||||
2026/04/07-20:44:04.788736 7f656afef6c0 Level-0 table #543: started
|
2026/05/18-20:25:54.236611 7f5a467fc6c0 Level-0 table #599: started
|
||||||
2026/04/07-20:44:04.788765 7f656afef6c0 Level-0 table #543: 0 bytes OK
|
2026/05/18-20:25:54.236652 7f5a467fc6c0 Level-0 table #599: 0 bytes OK
|
||||||
2026/04/07-20:44:04.826947 7f656afef6c0 Delete type=0 #541
|
2026/05/18-20:25:54.243997 7f5a467fc6c0 Delete type=0 #597
|
||||||
2026/04/07-20:44:04.864207 7f656afef6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
2026/05/18-20:25:54.251069 7f5a467fc6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||||
2026/04/07-20:44:04.864245 7f656afef6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
2026/05/18-20:25:54.264439 7f5a467fc6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/02/06-21:03:10.133019 7f71b7fff6c0 Recovering log #534
|
2026/05/18-07:32:52.700651 7f5a477fe6c0 Recovering log #590
|
||||||
2026/02/06-21:03:10.144336 7f71b7fff6c0 Delete type=3 #532
|
2026/05/18-07:32:52.712680 7f5a477fe6c0 Delete type=3 #588
|
||||||
2026/02/06-21:03:10.144427 7f71b7fff6c0 Delete type=0 #534
|
2026/05/18-07:32:52.712814 7f5a477fe6c0 Delete type=0 #590
|
||||||
2026/02/06-21:51:23.291316 7f71b67fc6c0 Level-0 table #539: started
|
2026/05/18-07:58:12.232998 7f5a467fc6c0 Level-0 table #595: started
|
||||||
2026/02/06-21:51:23.291356 7f71b67fc6c0 Level-0 table #539: 0 bytes OK
|
2026/05/18-07:58:12.233130 7f5a467fc6c0 Level-0 table #595: 0 bytes OK
|
||||||
2026/02/06-21:51:23.327518 7f71b67fc6c0 Delete type=0 #537
|
2026/05/18-07:58:12.244133 7f5a467fc6c0 Delete type=0 #593
|
||||||
2026/02/06-21:51:23.327733 7f71b67fc6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
2026/05/18-07:58:12.252873 7f5a467fc6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||||
2026/02/06-21:51:23.327757 7f71b67fc6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
2026/05/18-07:58:12.252977 7f5a467fc6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000545
|
MANIFEST-000601
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/04/07-20:41:01.946718 7f67eb7fe6c0 Recovering log #543
|
2026/05/18-17:40:11.749971 7f5a46ffd6c0 Recovering log #599
|
||||||
2026/04/07-20:41:01.999435 7f67eb7fe6c0 Delete type=3 #541
|
2026/05/18-17:40:11.761423 7f5a46ffd6c0 Delete type=3 #597
|
||||||
2026/04/07-20:41:01.999504 7f67eb7fe6c0 Delete type=0 #543
|
2026/05/18-17:40:11.761520 7f5a46ffd6c0 Delete type=0 #599
|
||||||
2026/04/07-20:44:04.712609 7f656afef6c0 Level-0 table #548: started
|
2026/05/18-20:25:54.219239 7f5a467fc6c0 Level-0 table #604: started
|
||||||
2026/04/07-20:44:04.712651 7f656afef6c0 Level-0 table #548: 0 bytes OK
|
2026/05/18-20:25:54.219522 7f5a467fc6c0 Level-0 table #604: 0 bytes OK
|
||||||
2026/04/07-20:44:04.751939 7f656afef6c0 Delete type=0 #546
|
2026/05/18-20:25:54.228610 7f5a467fc6c0 Delete type=0 #602
|
||||||
2026/04/07-20:44:04.864184 7f656afef6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
2026/05/18-20:25:54.251028 7f5a467fc6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||||
2026/04/07-20:44:04.864223 7f656afef6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
2026/05/18-20:25:54.251085 7f5a467fc6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/02/06-21:03:10.101791 7f71b77fe6c0 Recovering log #539
|
2026/05/18-07:32:52.650924 7f5a47fff6c0 Recovering log #595
|
||||||
2026/02/06-21:03:10.111914 7f71b77fe6c0 Delete type=3 #537
|
2026/05/18-07:32:52.662191 7f5a47fff6c0 Delete type=3 #593
|
||||||
2026/02/06-21:03:10.111991 7f71b77fe6c0 Delete type=0 #539
|
2026/05/18-07:32:52.662331 7f5a47fff6c0 Delete type=0 #595
|
||||||
2026/02/06-21:51:23.251285 7f71b67fc6c0 Level-0 table #544: started
|
2026/05/18-07:58:12.218060 7f5a467fc6c0 Level-0 table #600: started
|
||||||
2026/02/06-21:51:23.251325 7f71b67fc6c0 Level-0 table #544: 0 bytes OK
|
2026/05/18-07:58:12.218402 7f5a467fc6c0 Level-0 table #600: 0 bytes OK
|
||||||
2026/02/06-21:51:23.291180 7f71b67fc6c0 Delete type=0 #542
|
2026/05/18-07:58:12.225237 7f5a467fc6c0 Delete type=0 #598
|
||||||
2026/02/06-21:51:23.327724 7f71b67fc6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
2026/05/18-07:58:12.244392 7f5a467fc6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||||
2026/02/06-21:51:23.327764 7f71b67fc6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
2026/05/18-07:58:12.252899 7f5a467fc6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000240
|
MANIFEST-000296
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/04/07-20:41:02.201674 7f6820dfe6c0 Recovering log #238
|
2026/05/18-17:40:11.831491 7f5a94bff6c0 Recovering log #294
|
||||||
2026/04/07-20:41:02.254572 7f6820dfe6c0 Delete type=3 #236
|
2026/05/18-17:40:11.842913 7f5a94bff6c0 Delete type=3 #292
|
||||||
2026/04/07-20:41:02.254638 7f6820dfe6c0 Delete type=0 #238
|
2026/05/18-17:40:11.843005 7f5a94bff6c0 Delete type=0 #294
|
||||||
2026/04/07-20:44:04.827060 7f656afef6c0 Level-0 table #243: started
|
2026/05/18-20:25:54.257813 7f5a467fc6c0 Level-0 table #299: started
|
||||||
2026/04/07-20:44:04.827088 7f656afef6c0 Level-0 table #243: 0 bytes OK
|
2026/05/18-20:25:54.257869 7f5a467fc6c0 Level-0 table #299: 0 bytes OK
|
||||||
2026/04/07-20:44:04.864062 7f656afef6c0 Delete type=0 #241
|
2026/05/18-20:25:54.264186 7f5a467fc6c0 Delete type=0 #297
|
||||||
2026/04/07-20:44:04.864215 7f656afef6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
2026/05/18-20:25:54.267118 7f5a467fc6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||||
2026/04/07-20:44:04.864230 7f656afef6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
2026/05/18-20:25:54.296812 7f5a467fc6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/02/06-21:03:10.160494 7f71b6ffd6c0 Recovering log #234
|
2026/05/18-07:32:52.738234 7f5a477fe6c0 Recovering log #290
|
||||||
2026/02/06-21:03:10.170771 7f71b6ffd6c0 Delete type=3 #232
|
2026/05/18-07:32:52.749839 7f5a477fe6c0 Delete type=3 #288
|
||||||
2026/02/06-21:03:10.170846 7f71b6ffd6c0 Delete type=0 #234
|
2026/05/18-07:32:52.749970 7f5a477fe6c0 Delete type=0 #290
|
||||||
2026/02/06-21:51:23.435610 7f71b67fc6c0 Level-0 table #239: started
|
2026/05/18-07:58:12.253340 7f5a467fc6c0 Level-0 table #295: started
|
||||||
2026/02/06-21:51:23.435649 7f71b67fc6c0 Level-0 table #239: 0 bytes OK
|
2026/05/18-07:58:12.253449 7f5a467fc6c0 Level-0 table #295: 0 bytes OK
|
||||||
2026/02/06-21:51:23.473038 7f71b67fc6c0 Delete type=0 #237
|
2026/05/18-07:58:12.261029 7f5a467fc6c0 Delete type=0 #293
|
||||||
2026/02/06-21:51:23.473211 7f71b67fc6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
2026/05/18-07:58:12.286385 7f5a467fc6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||||
2026/02/06-21:51:23.473250 7f71b67fc6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
2026/05/18-07:58:12.286487 7f5a467fc6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000539
|
MANIFEST-000595
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/04/07-20:41:02.136268 7f67eb7fe6c0 Recovering log #537
|
2026/05/18-17:40:11.812004 7f5a47fff6c0 Recovering log #593
|
||||||
2026/04/07-20:41:02.189277 7f67eb7fe6c0 Delete type=3 #535
|
2026/05/18-17:40:11.823277 7f5a47fff6c0 Delete type=3 #591
|
||||||
2026/04/07-20:41:02.189349 7f67eb7fe6c0 Delete type=0 #537
|
2026/05/18-17:40:11.823388 7f5a47fff6c0 Delete type=0 #593
|
||||||
2026/04/07-20:44:04.864322 7f656afef6c0 Level-0 table #542: started
|
2026/05/18-20:25:54.244177 7f5a467fc6c0 Level-0 table #598: started
|
||||||
2026/04/07-20:44:04.864350 7f656afef6c0 Level-0 table #542: 0 bytes OK
|
2026/05/18-20:25:54.244222 7f5a467fc6c0 Level-0 table #598: 0 bytes OK
|
||||||
2026/04/07-20:44:04.894847 7f656afef6c0 Delete type=0 #540
|
2026/05/18-20:25:54.250810 7f5a467fc6c0 Delete type=0 #596
|
||||||
2026/04/07-20:44:05.055029 7f656afef6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
2026/05/18-20:25:54.251096 7f5a467fc6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||||
2026/04/07-20:44:05.055068 7f656afef6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
2026/05/18-20:25:54.264461 7f5a467fc6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/02/06-21:03:10.146976 7f71b77fe6c0 Recovering log #533
|
2026/05/18-07:32:52.720162 7f5a94bff6c0 Recovering log #589
|
||||||
2026/02/06-21:03:10.156549 7f71b77fe6c0 Delete type=3 #531
|
2026/05/18-07:32:52.731519 7f5a94bff6c0 Delete type=3 #587
|
||||||
2026/02/06-21:03:10.156610 7f71b77fe6c0 Delete type=0 #533
|
2026/05/18-07:32:52.731690 7f5a94bff6c0 Delete type=0 #589
|
||||||
2026/02/06-21:51:23.327858 7f71b67fc6c0 Level-0 table #538: started
|
2026/05/18-07:58:12.244424 7f5a467fc6c0 Level-0 table #594: started
|
||||||
2026/02/06-21:51:23.327892 7f71b67fc6c0 Level-0 table #538: 0 bytes OK
|
2026/05/18-07:58:12.244618 7f5a467fc6c0 Level-0 table #594: 0 bytes OK
|
||||||
2026/02/06-21:51:23.359727 7f71b67fc6c0 Delete type=0 #536
|
2026/05/18-07:58:12.252579 7f5a467fc6c0 Delete type=0 #592
|
||||||
2026/02/06-21:51:23.473179 7f71b67fc6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
2026/05/18-07:58:12.252922 7f5a467fc6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||||
2026/02/06-21:51:23.473221 7f71b67fc6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
2026/05/18-07:58:12.252996 7f5a467fc6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
BIN
Binary file not shown.
+246
@@ -88,3 +88,249 @@
|
|||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------------- */
|
||||||
|
/* 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);
|
||||||
|
|||||||
+20
-4
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
+10
-10
@@ -40,32 +40,32 @@
|
|||||||
{{#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}}
|
||||||
|
|
||||||
@@ -111,7 +111,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 +127,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 +177,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}}
|
||||||
|
|
||||||
@@ -239,7 +239,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}}
|
||||||
@@ -288,4 +288,4 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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" }}
|
||||||
|
|||||||
@@ -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">
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
+4
-1
@@ -7,7 +7,7 @@
|
|||||||
{{formField systemFields.level value=system.level}}
|
{{formField systemFields.level value=system.level}}
|
||||||
{{formField systemFields.cost value=system.cost}}
|
{{formField systemFields.cost value=system.cost}}
|
||||||
|
|
||||||
<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 +30,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,14 +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>
|
<label>{{localize "LETHALFANTASY.Label.damage"}}</label>
|
||||||
<div class="shift-right">
|
<div class="shift-right">
|
||||||
{{formField systemFields.damage.fields.damageS value=system.damage.damageS}}
|
{{formField systemFields.damage.fields.damageS value=system.damage.damageS}}
|
||||||
{{formField systemFields.damage.fields.damageM value=system.damage.damageM}}
|
{{formField systemFields.damage.fields.damageM value=system.damage.damageM}}
|
||||||
@@ -34,7 +34,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 +47,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 +60,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}}
|
||||||
|
|||||||
Reference in New Issue
Block a user