Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f15450566 | |||
| 28fdaff2ec | |||
| 81584ed5d6 | |||
| 8c9a13faf1 | |||
| 6c6c473147 | |||
| 2e2a917a45 | |||
| 343abc32e2 | |||
| c37d92af25 | |||
| 42945d33db | |||
| 1bf88bac06 | |||
| 3ad5681539 | |||
| df6f8e5710 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,4 +7,5 @@ styles/*.css
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
.history
|
.history
|
||||||
|
.github/
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,7 @@
|
|||||||
<svg style="height: 512px; width: 512px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><g class="" style="" transform="translate(0,0)"><path d="M373.47 25.5c-33.475-.064-67.614 13.444-94.44 43.156l37.22 145.156-33.437.032 35.343 132.093-116.718-188.375 50.03 5.375L202.5 47.312C120.437-1.43 4.756 40.396 8.5 158.156c4.402 138.44 191.196 184.6 247.406 331.625 59.376-147.035 251.26-184.33 246.656-331.624-2.564-82.042-64.6-132.532-129.093-132.656z" fill="#fff" fill-opacity="1"></path></g></svg>
|
<svg style="height: 512px; width: 512px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
||||||
|
<g class="" style="" transform="translate(0,0)">
|
||||||
|
<path
|
||||||
|
d="M373.47 25.5c-33.475-.064-67.614 13.444-94.44 43.156l37.22 145.156-33.437.032 35.343 132.093-116.718-188.375 50.03 5.375L202.5 47.312C120.437-1.43 4.756 40.396 8.5 158.156c4.402 138.44 191.196 184.6 247.406 331.625 59.376-147.035 251.26-184.33 246.656-331.624-2.564-82.042-64.6-132.532-129.093-132.656z"
|
||||||
|
fill="#dc2626" fill-opacity="1"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 533 B |
10
assets/icons/health-increase.svg
Normal file
10
assets/icons/health-increase.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||||
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<!-- Heart shape -->
|
||||||
|
<path
|
||||||
|
d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"
|
||||||
|
fill="#4ade80" stroke="#22c55e" />
|
||||||
|
<!-- Plus sign inside heart -->
|
||||||
|
<line x1="12" y1="8" x2="12" y2="14" stroke="#ffffff" stroke-width="2.5" />
|
||||||
|
<line x1="9" y1="11" x2="15" y2="11" stroke="#ffffff" stroke-width="2.5" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 572 B |
BIN
assets/rules/dice_30_effects.xlsx
Normal file
BIN
assets/rules/dice_30_effects.xlsx
Normal file
Binary file not shown.
@@ -2974,7 +2974,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 +2986,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,
|
||||||
@@ -3956,3 +3956,264 @@ i.lethalfantasy {
|
|||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
/* HP Gain Styles */
|
||||||
|
#token-hud .hp-gain-wrap {
|
||||||
|
position: absolute;
|
||||||
|
left: 75px;
|
||||||
|
display: none;
|
||||||
|
top: 50%;
|
||||||
|
width: 48px;
|
||||||
|
text-align: start;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-wrap-col1 {
|
||||||
|
transform: translate(-200%, -50%);
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-wrap-col2 {
|
||||||
|
transform: translate(-300%, -50%);
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-wrap-col3 {
|
||||||
|
transform: translate(-400%, -50%);
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-hud-active {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-hud-disabled {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#token-hud .hud-gain-hp-button-select {
|
||||||
|
max-width: 40px;
|
||||||
|
background-image: var(--background-image-base);
|
||||||
|
padding-top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
width: max-content;
|
||||||
|
margin: 0;
|
||||||
|
color: #252424;
|
||||||
|
}
|
||||||
|
#token-hud .hp-gain-wrap .hud-gain-hp-button-select {
|
||||||
|
padding-left: 8px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
/* -------------------------------------------------- */
|
||||||
|
/* 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);
|
||||||
|
}
|
||||||
|
|||||||
136
lang/en.json
136
lang/en.json
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"COMBAT": {
|
"COMBAT": {
|
||||||
"Round": "Second {round}",
|
"Round": "Second {round}",
|
||||||
"Rounds": "Seconds",
|
"Rounds": "Seconds",
|
||||||
"RoundNext": "Next second"
|
"RoundNext": "Next second"
|
||||||
},
|
},
|
||||||
"LETHALFANTASY": {
|
"LETHALFANTASY": {
|
||||||
"Armor": {
|
"Armor": {
|
||||||
@@ -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",
|
||||||
@@ -294,13 +360,13 @@
|
|||||||
"miracle-power": "Miracle - Power",
|
"miracle-power": "Miracle - Power",
|
||||||
"miracle-attack": "Miracle - Attack",
|
"miracle-attack": "Miracle - Attack",
|
||||||
"spell": "Spell",
|
"spell": "Spell",
|
||||||
"will":"Will",
|
"will": "Will",
|
||||||
"dodge":"Dodge",
|
"dodge": "Dodge",
|
||||||
"toughness":"Toughness",
|
"toughness": "Toughness",
|
||||||
"contagion":"Contagion",
|
"contagion": "Contagion",
|
||||||
"poison":"Poison",
|
"poison": "Poison",
|
||||||
"pain":"Pain",
|
"pain": "Pain",
|
||||||
"paincourage":"Pain/Courage",
|
"paincourage": "Pain/Courage",
|
||||||
"granted": "Granted Dice",
|
"granted": "Granted Dice",
|
||||||
"shields": "Shields",
|
"shields": "Shields",
|
||||||
"armorHitPoints": "Armor hit points",
|
"armorHitPoints": "Armor hit points",
|
||||||
@@ -320,7 +386,7 @@
|
|||||||
"aetherPoints": "Aether points",
|
"aetherPoints": "Aether points",
|
||||||
"attacks": "Attacks",
|
"attacks": "Attacks",
|
||||||
"monster": "Monster",
|
"monster": "Monster",
|
||||||
"Resist" :"Resist",
|
"Resist": "Resist",
|
||||||
"resist": "Resist",
|
"resist": "Resist",
|
||||||
"resistTorture": "Resist torture",
|
"resistTorture": "Resist torture",
|
||||||
"resistPerformance": "Resist performance",
|
"resistPerformance": "Resist performance",
|
||||||
@@ -428,7 +494,10 @@
|
|||||||
"weapons": "Weapons",
|
"weapons": "Weapons",
|
||||||
"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",
|
||||||
|
"miracle": "Miracle",
|
||||||
|
"titleStandard": "Standard Roll"
|
||||||
},
|
},
|
||||||
"Miracle": {
|
"Miracle": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
@@ -518,7 +587,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": {
|
||||||
@@ -660,6 +731,9 @@
|
|||||||
"weaponClass": {
|
"weaponClass": {
|
||||||
"label": "Class"
|
"label": "Class"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"error": {
|
||||||
|
"weaponBonus": "Weapon bonus exceeds the allowed maximum (skill total / 10)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Spell": {
|
"Spell": {
|
||||||
@@ -722,14 +796,29 @@
|
|||||||
},
|
},
|
||||||
"catalyst": {
|
"catalyst": {
|
||||||
"label": "Catalyst"
|
"label": "Catalyst"
|
||||||
|
},
|
||||||
|
"damageDice": {
|
||||||
|
"label": "Damage dice"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Range": {
|
||||||
|
"contact": "Contact",
|
||||||
|
"distant": "Distant",
|
||||||
|
"loin": "Far",
|
||||||
|
"na": "N/A",
|
||||||
|
"proche": "Close"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ToggleSheet": "Toggle mode",
|
"ToggleSheet": "Toggle mode",
|
||||||
"Tooltip": {
|
"Tooltip": {
|
||||||
"addEquipment": "New equipment",
|
"addEquipment": "New equipment",
|
||||||
"addSpell": "New spells",
|
"addSpell": "New spells",
|
||||||
"skill": "Skills list"
|
"skill": "Skills list",
|
||||||
|
"combatProgressionStart": "First attack of combat can succeed on a roll of 1 through this value. Resets to 1 for subsequent attacks.",
|
||||||
|
"addMiracle": "Add Miracle",
|
||||||
|
"gifts": "Gifts list",
|
||||||
|
"skills": "Skills list",
|
||||||
|
"vulnerabilities": "Vulnerabilities list"
|
||||||
},
|
},
|
||||||
"Vulnerability": {
|
"Vulnerability": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
@@ -888,6 +977,25 @@
|
|||||||
"cannotAct": "cannot act this second",
|
"cannotAct": "cannot act this second",
|
||||||
"diceResult": "Dice result",
|
"diceResult": "Dice result",
|
||||||
"progressionCount": "Progression count:"
|
"progressionCount": "Progression count:"
|
||||||
|
},
|
||||||
|
"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": {
|
||||||
|
|||||||
@@ -250,6 +250,19 @@ Hooks.on(hookName, (message, html, data) => {
|
|||||||
const attackWeaponId = message.rolls[0]?.rollTarget?.weapon?.id || message.rolls[0]?.rollTarget?.weapon?._id
|
const attackWeaponId = message.rolls[0]?.rollTarget?.weapon?.id || message.rolls[0]?.rollTarget?.weapon?._id
|
||||||
const attackRollType = message.rolls[0]?.type
|
const attackRollType = message.rolls[0]?.type
|
||||||
const attackRollKey = message.rolls[0]?.rollTarget?.rollKey
|
const attackRollKey = message.rolls[0]?.rollTarget?.rollKey
|
||||||
|
console.log(`[LF] request-defense-btn | attackRollType=${attackRollType} defender=${defenderName} defenderType=${combatant.actor?.type}`)
|
||||||
|
const attackD30result = message.rolls[0]?.options?.D30result || null
|
||||||
|
const attackD30message = message.rolls[0]?.options?.D30message || null
|
||||||
|
const attackRerollContext = {
|
||||||
|
rollType: message.rolls[0]?.options?.rollType,
|
||||||
|
rollTarget: foundry.utils.duplicate(message.rolls[0]?.options?.rollTarget ?? {}),
|
||||||
|
actorId: message.rolls[0]?.options?.actorId,
|
||||||
|
actorName: message.rolls[0]?.options?.actorName,
|
||||||
|
actorImage: message.rolls[0]?.options?.actorImage,
|
||||||
|
defenderId: combatant.actor?.id || null,
|
||||||
|
defenderTokenId: tokenId || combatant.token?.id || null,
|
||||||
|
rollContext: foundry.utils.duplicate(message.rolls[0]?.options?.rollData ?? {})
|
||||||
|
}
|
||||||
|
|
||||||
// Préparer le message de demande de défense
|
// Préparer le message de demande de défense
|
||||||
const defenseMsg = {
|
const defenseMsg = {
|
||||||
@@ -262,23 +275,34 @@ Hooks.on(hookName, (message, html, data) => {
|
|||||||
attackWeaponId: attackWeaponId,
|
attackWeaponId: attackWeaponId,
|
||||||
attackRollType: attackRollType,
|
attackRollType: attackRollType,
|
||||||
attackRollKey: attackRollKey,
|
attackRollKey: attackRollKey,
|
||||||
|
attackD30result: attackD30result,
|
||||||
|
attackD30message: attackD30message,
|
||||||
|
attackRerollContext: attackRerollContext,
|
||||||
combatantId: combatantId,
|
combatantId: combatantId,
|
||||||
tokenId: tokenId
|
tokenId: tokenId
|
||||||
}
|
}
|
||||||
|
|
||||||
// Envoyer le message socket à l'utilisateur contrôlant le combatant
|
// Envoyer le message socket à l'utilisateur contrôlant le combatant
|
||||||
const owners = game.users.filter(u =>
|
// Only consider active (online) users; fall back to any active GM for unowned/GM monsters.
|
||||||
combatant.actor.testUserPermission(u, "OWNER")
|
let owners = game.users.filter(u =>
|
||||||
|
u.active && combatant.actor.testUserPermission(u, "OWNER")
|
||||||
)
|
)
|
||||||
|
if (owners.length === 0) {
|
||||||
|
owners = game.users.filter(u => u.active && u.isGM)
|
||||||
|
}
|
||||||
|
|
||||||
// Récupérer l'acteur attaquant pour vérifier qui l'a lancé
|
// Récupérer l'acteur attaquant pour vérifier qui l'a lancé
|
||||||
const attacker = game.actors.get(attackerId)
|
const attacker = game.actors.get(attackerId)
|
||||||
const attackerOwners = attacker ? game.users.filter(u => attacker.testUserPermission(u, "OWNER")).map(u => u.id) : []
|
const attackerOwners = attacker ? game.users.filter(u => attacker.testUserPermission(u, "OWNER")).map(u => u.id) : []
|
||||||
|
|
||||||
|
// Monsters always need their owner (usually the GM) to roll a save/defense,
|
||||||
|
// even if that owner also controls the attacker. Only skip for same-player PC-vs-PC.
|
||||||
|
const defenderIsMonster = combatant.actor?.type === "monster"
|
||||||
|
|
||||||
let messageSent = false
|
let messageSent = false
|
||||||
owners.forEach(owner => {
|
owners.forEach(owner => {
|
||||||
// Ne pas afficher le dialogue à l'attaquant lui-même s'il contrôle aussi le défenseur
|
// Don't let a player be both attacker and defender for their own PC, unless defending a monster.
|
||||||
if (attackerOwners.includes(owner.id) && owner.id === game.user.id) {
|
if (attackerOwners.includes(owner.id) && owner.id === game.user.id && !defenderIsMonster) {
|
||||||
// Ne rien faire - on ne veut pas que l'attaquant se défende contre lui-même
|
// Ne rien faire - on ne veut pas que l'attaquant se défende contre lui-même
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -313,6 +337,8 @@ Hooks.on(hookName, (message, html, data) => {
|
|||||||
const attackKey = button.data("attack-key")
|
const attackKey = button.data("attack-key")
|
||||||
let attackerId = button.data("attacker-id")
|
let attackerId = button.data("attacker-id")
|
||||||
const defenderId = button.data("defender-id")
|
const defenderId = button.data("defender-id")
|
||||||
|
const defenderTokenId = button.data("defender-token-id") || null
|
||||||
|
const extraShieldDr = Number(button.data("extra-shield-dr") || 0)
|
||||||
const damageType = button.data("damage-type")
|
const damageType = button.data("damage-type")
|
||||||
const damageFormula = button.data("damage-formula")
|
const damageFormula = button.data("damage-formula")
|
||||||
const damageModifier = button.data("damage-modifier")
|
const damageModifier = button.data("damage-modifier")
|
||||||
@@ -325,9 +351,39 @@ Hooks.on(hookName, (message, html, data) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pour les sorts, rouler les dés de dégâts avec option bypass DR
|
||||||
|
if (damageType === "spell" && damageFormula) {
|
||||||
|
const bypassArmor = await foundry.applications.api.DialogV2.confirm({
|
||||||
|
window: { title: "Spell Damage" },
|
||||||
|
classes: ["lethalfantasy"],
|
||||||
|
content: "<p>Does this spell's damage bypass armor DR?</p>",
|
||||||
|
yes: { label: "Yes (ignore armor)", icon: "fa-solid fa-wand-magic-sparkles" },
|
||||||
|
no: { label: "No (apply armor DR)", icon: "fa-solid fa-shield" }
|
||||||
|
})
|
||||||
|
const rollOpts = {
|
||||||
|
type: "spell-damage",
|
||||||
|
rollType: "spell-damage",
|
||||||
|
rollName: damageFormula,
|
||||||
|
isDamage: true,
|
||||||
|
rollData: { isDamage: true },
|
||||||
|
bypassArmor: bypassArmor ?? false,
|
||||||
|
defenderId,
|
||||||
|
defenderTokenId,
|
||||||
|
actorId: actor.id,
|
||||||
|
actorName: actor.name,
|
||||||
|
actorImage: actor.img
|
||||||
|
}
|
||||||
|
const roll = new LethalFantasyRoll(damageFormula, {}, rollOpts)
|
||||||
|
await roll.evaluate()
|
||||||
|
roll.options.rollTotal = roll.total
|
||||||
|
if (game?.dice3d) await game.dice3d.showForRoll(roll, game.user, true)
|
||||||
|
await roll.toMessage()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Pour les boutons de résultat de combat (monster damage)
|
// Pour les boutons de résultat de combat (monster damage)
|
||||||
if (damageType === "monster" && attackKey) {
|
if (damageType === "monster" && attackKey) {
|
||||||
await actor.system.prepareMonsterRoll("monster-damage", attackKey, undefined, undefined, undefined, defenderId)
|
await actor.system.prepareMonsterRoll("monster-damage", attackKey, undefined, undefined, undefined, defenderId, defenderTokenId, extraShieldDr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,7 +402,7 @@ Hooks.on(hookName, (message, html, data) => {
|
|||||||
|
|
||||||
// Lancer les dégâts avec la bonne méthode
|
// Lancer les dégâts avec la bonne méthode
|
||||||
const rollType = damageType === "small" ? "weapon-damage-small" : "weapon-damage-medium"
|
const rollType = damageType === "small" ? "weapon-damage-small" : "weapon-damage-medium"
|
||||||
await actor.prepareRoll(rollType, weaponId, undefined, defenderId)
|
await actor.prepareRoll(rollType, weaponId, undefined, defenderId, defenderTokenId, extraShieldDr)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Masquer les boutons de dommages dans les messages de résultat de combat si l'utilisateur n'est pas l'attaquant
|
// Masquer les boutons de dommages dans les messages de résultat de combat si l'utilisateur n'est pas l'attaquant
|
||||||
@@ -373,7 +429,7 @@ Hooks.on("preCreateChatMessage", (message) => {
|
|||||||
const rollType = message.rolls[0]?.options?.rollType
|
const rollType = message.rolls[0]?.options?.rollType
|
||||||
|
|
||||||
// Si c'est un message de défense et qu'on a des données en attente
|
// Si c'est un message de défense et qu'on a des données en attente
|
||||||
if ((rollType === "weapon-defense" || rollType === "monster-defense") && game.lethalFantasy?.nextDefenseData) {
|
if ((rollType === "weapon-defense" || rollType === "monster-defense" || rollType === "save") && game.lethalFantasy?.nextDefenseData) {
|
||||||
// Ajouter les données dans les flags du message
|
// Ajouter les données dans les flags du message
|
||||||
message.updateSource({
|
message.updateSource({
|
||||||
[`flags.${SYSTEM.id}.attackData`]: game.lethalFantasy.nextDefenseData
|
[`flags.${SYSTEM.id}.attackData`]: game.lethalFantasy.nextDefenseData
|
||||||
@@ -393,7 +449,7 @@ Hooks.on("createChatMessage", async (message) => {
|
|||||||
console.log("Defense hook checking message, rollType:", rollType)
|
console.log("Defense hook checking message, rollType:", rollType)
|
||||||
|
|
||||||
// Vérifier si c'est un message de défense
|
// Vérifier si c'est un message de défense
|
||||||
if (rollType !== "weapon-defense" && rollType !== "monster-defense") return
|
if (rollType !== "weapon-defense" && rollType !== "monster-defense" && rollType !== "save") return
|
||||||
|
|
||||||
// Récupérer les données d'attaque depuis les flags
|
// Récupérer les données d'attaque depuis les flags
|
||||||
const attackData = message.flags?.[SYSTEM.id]?.attackData
|
const attackData = message.flags?.[SYSTEM.id]?.attackData
|
||||||
@@ -405,8 +461,21 @@ Hooks.on("createChatMessage", async (message) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const { attackerId, attackRoll, attackerName, defenderName, attackWeaponId, attackRollType, attackRollKey, defenderId } = attackData
|
const {
|
||||||
|
attackerId,
|
||||||
|
attackRoll,
|
||||||
|
attackerName,
|
||||||
|
defenderName,
|
||||||
|
attackWeaponId,
|
||||||
|
attackRollType,
|
||||||
|
attackRollKey,
|
||||||
|
attackD30message,
|
||||||
|
attackRerollContext,
|
||||||
|
defenderId,
|
||||||
|
defenderTokenId
|
||||||
|
} = attackData
|
||||||
let defenseRoll = message.rolls[0]?.options?.rollTotal || message.rolls[0]?.total || 0
|
let defenseRoll = message.rolls[0]?.options?.rollTotal || message.rolls[0]?.total || 0
|
||||||
|
const defenseD30message = message.rolls[0]?.options?.D30message || null
|
||||||
|
|
||||||
console.log("Processing defense:", { attackRoll, defenseRoll, attackerId, defenderId })
|
console.log("Processing defense:", { attackRoll, defenseRoll, attackerId, defenderId })
|
||||||
|
|
||||||
@@ -418,26 +487,216 @@ Hooks.on("createChatMessage", async (message) => {
|
|||||||
// Récupérer le défenseur et l'attaquant
|
// Récupérer le défenseur et l'attaquant
|
||||||
const defender = game.actors.get(defenderId)
|
const defender = game.actors.get(defenderId)
|
||||||
const attacker = game.actors.get(attackerId)
|
const attacker = game.actors.get(attackerId)
|
||||||
|
const defenseRerollContext = {
|
||||||
|
rollType: message.rolls[0]?.options?.rollType,
|
||||||
|
rollTarget: foundry.utils.duplicate(message.rolls[0]?.options?.rollTarget ?? {}),
|
||||||
|
actorId: message.rolls[0]?.options?.actorId,
|
||||||
|
actorName: message.rolls[0]?.options?.actorName,
|
||||||
|
actorImage: message.rolls[0]?.options?.actorImage,
|
||||||
|
defenderId,
|
||||||
|
defenderTokenId,
|
||||||
|
rollContext: foundry.utils.duplicate(message.rolls[0]?.options?.rollData ?? {})
|
||||||
|
}
|
||||||
|
|
||||||
|
const isPrimaryController = actor => {
|
||||||
|
if (!actor) return false
|
||||||
|
const activePlayerOwners = game.users.filter(u => u.active && !u.isGM && actor.testUserPermission(u, "OWNER"))
|
||||||
|
if (activePlayerOwners.length > 0) {
|
||||||
|
return activePlayerOwners[0].id === game.user.id
|
||||||
|
}
|
||||||
|
return game.user.isGM
|
||||||
|
}
|
||||||
|
|
||||||
|
const createReactionMessage = async (actorDocument, content) => {
|
||||||
|
await ChatMessage.create({
|
||||||
|
content,
|
||||||
|
speaker: ChatMessage.getSpeaker({ actor: actorDocument })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Si le défenseur est un personnage qui perd, proposer Grit/Luck (seulement s'il a des points)
|
// Si le défenseur est un personnage qui perd, proposer Grit/Luck (seulement s'il a des points)
|
||||||
// Seulement si l'utilisateur actuel est le propriétaire du défenseur
|
// Seulement si l'utilisateur actuel est le propriétaire du défenseur
|
||||||
let defenderHandledBonus = false
|
let defenderHandledBonus = false
|
||||||
if (defender?.type === "character" && defenseRoll < attackRoll && !game.user.isGM && defender.isOwner) {
|
let shieldReaction = null
|
||||||
const hasGritOrLuck = (defender.system.grit.current > 0) || (defender.system.luck.current > 0)
|
let shieldBlocked = false
|
||||||
|
const isSpellOrMiracle = attackRollType === "spell-attack" || attackRollType === "miracle-attack"
|
||||||
|
if (defender && defenseRoll < attackRoll && isPrimaryController(defender) && !isSpellOrMiracle) {
|
||||||
|
const shieldData = LethalFantasyUtils.getShieldReactionData(defender)
|
||||||
|
let canRerollDefense = LethalFantasyUtils.hasD30Reroll(defenseD30message)
|
||||||
|
let canShieldReact = !!shieldData
|
||||||
|
let canAdHocShield = !shieldData
|
||||||
|
|
||||||
if (hasGritOrLuck) {
|
while (defenseRoll < attackRoll) {
|
||||||
const bonusRoll = await LethalFantasyUtils.offerGritLuckBonus(
|
const currentGrit = Number(defender.system?.grit?.current) || 0
|
||||||
defender,
|
const currentLuck = Number(defender.system?.luck?.current) || 0
|
||||||
attackRoll,
|
const buttons = []
|
||||||
defenseRoll,
|
|
||||||
attackerName,
|
if (currentGrit > 0) {
|
||||||
defenderName
|
buttons.push({
|
||||||
)
|
action: "grit",
|
||||||
if (bonusRoll > 0) {
|
label: `Spend 1 Grit (+1D6) [${currentGrit} left]`,
|
||||||
|
icon: "fa-solid fa-fist-raised",
|
||||||
|
callback: () => "grit"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentLuck > 0) {
|
||||||
|
buttons.push({
|
||||||
|
action: "luck",
|
||||||
|
label: `Spend 1 Luck (+1D6) [${currentLuck} left]`,
|
||||||
|
icon: "fa-solid fa-clover",
|
||||||
|
callback: () => "luck"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
buttons.push({
|
||||||
|
action: "bonusDie",
|
||||||
|
label: "Add bonus die",
|
||||||
|
icon: "fa-solid fa-dice",
|
||||||
|
callback: () => "bonusDie"
|
||||||
|
})
|
||||||
|
|
||||||
|
if (canRerollDefense) {
|
||||||
|
buttons.push({
|
||||||
|
action: "rerollDefense",
|
||||||
|
label: "Re-roll defense",
|
||||||
|
icon: "fa-solid fa-rotate-right",
|
||||||
|
callback: () => "rerollDefense"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canShieldReact) {
|
||||||
|
buttons.push({
|
||||||
|
action: "shieldReact",
|
||||||
|
label: `Roll shield (${shieldData.label})`,
|
||||||
|
icon: "fa-solid fa-shield",
|
||||||
|
callback: () => "shieldReact"
|
||||||
|
})
|
||||||
|
} else if (canAdHocShield) {
|
||||||
|
// No pre-configured shield — offer ad-hoc shield option (useful for monsters)
|
||||||
|
buttons.push({
|
||||||
|
action: "adHocShield",
|
||||||
|
label: "Roll ad-hoc shield (choose dice + DR)",
|
||||||
|
icon: "fa-solid fa-shield-halved",
|
||||||
|
callback: () => "adHocShield"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
buttons.push({
|
||||||
|
action: "continue",
|
||||||
|
label: "Continue (no defense bonus)",
|
||||||
|
icon: "fa-solid fa-forward",
|
||||||
|
callback: () => "continue"
|
||||||
|
})
|
||||||
|
|
||||||
|
const choice = await foundry.applications.api.DialogV2.wait({
|
||||||
|
window: { title: "Defense reactions" },
|
||||||
|
classes: ["lethalfantasy"],
|
||||||
|
content: `
|
||||||
|
<div class="grit-luck-dialog">
|
||||||
|
<div class="combat-status">
|
||||||
|
<p><strong>${attackerName}</strong> rolled <strong>${attackRoll}</strong></p>
|
||||||
|
<p><strong>${defenderName}</strong> currently has <strong>${defenseRoll}</strong></p>
|
||||||
|
${defenseD30message ? `<p class="bonus-info">D30 special: ${defenseD30message}</p>` : ""}
|
||||||
|
</div>
|
||||||
|
<p class="offer-text">Choose how to improve the defense before resolving the hit.</p>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
buttons,
|
||||||
|
rejectClose: false
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!choice || choice === "continue") break
|
||||||
|
|
||||||
|
defenderHandledBonus = true
|
||||||
|
|
||||||
|
if (choice === "grit") {
|
||||||
|
const bonusRoll = await LethalFantasyUtils.rollBonusDie("1d6", defender, (total) => `<p><strong>${defenderName}</strong> spends 1 Grit and rolls <strong>${total}</strong> for defense.</p>`)
|
||||||
defenseRoll += bonusRoll
|
defenseRoll += bonusRoll
|
||||||
|
await defender.update({ "system.grit.current": currentGrit - 1 })
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (choice === "luck") {
|
||||||
|
const bonusRoll = await LethalFantasyUtils.rollBonusDie("1d6", defender, (total) => `<p><strong>${defenderName}</strong> spends 1 Luck and rolls <strong>${total}</strong> for defense.</p>`)
|
||||||
|
defenseRoll += bonusRoll
|
||||||
|
await defender.update({ "system.luck.current": currentLuck - 1 })
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (choice === "bonusDie") {
|
||||||
|
const bonusDie = await LethalFantasyUtils.promptCombatBonusDie(defenderName, "attack", defenseRoll, attackRoll)
|
||||||
|
if (!bonusDie) continue
|
||||||
|
const bonusRoll = await LethalFantasyUtils.rollBonusDie(bonusDie, defender, (total, formula) => `<p><strong>${defenderName}</strong> adds <strong>${formula.toUpperCase()}</strong> and rolls <strong>${total}</strong> for defense.</p>`)
|
||||||
|
defenseRoll += bonusRoll
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (choice === "rerollDefense" && canRerollDefense) {
|
||||||
|
const oldDefenseRoll = defenseRoll
|
||||||
|
const reroll = await LethalFantasyUtils.rerollConfiguredRoll(defenseRerollContext)
|
||||||
|
canRerollDefense = false
|
||||||
|
if (!reroll) continue
|
||||||
|
defenseRoll = reroll.options?.rollTotal || reroll.total || oldDefenseRoll
|
||||||
|
await createReactionMessage(defender, `<p><strong>${defenderName}</strong> uses Mulligan and re-rolls defense: <strong>${oldDefenseRoll}</strong> → <strong>${defenseRoll}</strong>.</p>`)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (choice === "shieldReact" && canShieldReact) {
|
||||||
|
const shieldBonus = await LethalFantasyUtils.rollBonusDie(shieldData.formula, defender)
|
||||||
|
const newDefenseTotal = defenseRoll + shieldBonus
|
||||||
|
defenseRoll = newDefenseTotal
|
||||||
|
canShieldReact = false
|
||||||
|
|
||||||
|
if (newDefenseTotal >= attackRoll) {
|
||||||
|
shieldBlocked = true
|
||||||
|
shieldReaction = {
|
||||||
|
damageReduction: shieldData.damageReduction,
|
||||||
|
label: shieldData.label,
|
||||||
|
bonus: shieldBonus
|
||||||
|
}
|
||||||
|
await createReactionMessage(
|
||||||
|
defender,
|
||||||
|
`<p><strong>${defenderName}</strong> rolls <strong>${shieldData.label}</strong> and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} ≥ ${attackRoll}). <strong>Shield blocked the attack!</strong> Both armor DR and shield DR <strong>${shieldData.damageReduction}</strong> will apply to damage.</p>`
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
shieldReaction = null
|
||||||
|
await createReactionMessage(
|
||||||
|
defender,
|
||||||
|
`<p><strong>${defenderName}</strong> rolls <strong>${shieldData.label}</strong> and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} < ${attackRoll}). Shield did not block — normal hit, armor DR only.</p>`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (choice === "adHocShield") {
|
||||||
|
const adHoc = await LethalFantasyUtils.promptAdHocShield(defenderName, attackRoll, defenseRoll)
|
||||||
|
if (!adHoc) continue
|
||||||
|
const shieldBonus = await LethalFantasyUtils.rollBonusDie(adHoc.formula, defender)
|
||||||
|
const newDefenseTotal = defenseRoll + shieldBonus
|
||||||
|
defenseRoll = newDefenseTotal
|
||||||
|
canShieldReact = false
|
||||||
|
canAdHocShield = false
|
||||||
|
|
||||||
|
if (newDefenseTotal >= attackRoll) {
|
||||||
|
shieldBlocked = true
|
||||||
|
shieldReaction = {
|
||||||
|
damageReduction: adHoc.damageReduction,
|
||||||
|
label: `${adHoc.formula.toUpperCase()} shield`,
|
||||||
|
bonus: shieldBonus
|
||||||
|
}
|
||||||
|
await createReactionMessage(
|
||||||
|
defender,
|
||||||
|
`<p><strong>${defenderName}</strong> rolls <strong>${adHoc.formula.toUpperCase()}</strong> shield and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} ≥ ${attackRoll}). <strong>Shield blocked the attack!</strong> Both armor DR and shield DR <strong>${adHoc.damageReduction}</strong> will apply to damage.</p>`
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
shieldReaction = null
|
||||||
|
await createReactionMessage(
|
||||||
|
defender,
|
||||||
|
`<p><strong>${defenderName}</strong> rolls <strong>${adHoc.formula.toUpperCase()}</strong> shield and adds <strong>${shieldBonus}</strong> to defense (${newDefenseTotal} < ${attackRoll}). Shield did not block — normal hit, armor DR only.</p>`
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defenderHandledBonus = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let attackRollFinal = attackRoll
|
let attackRollFinal = attackRoll
|
||||||
@@ -445,31 +704,98 @@ Hooks.on("createChatMessage", async (message) => {
|
|||||||
|
|
||||||
// Si l'attaquant est un personnage qui perd et a du Grit
|
// Si l'attaquant est un personnage qui perd et a du Grit
|
||||||
// Seulement si l'utilisateur actuel est le propriétaire de l'attaquant (pas le MJ)
|
// Seulement si l'utilisateur actuel est le propriétaire de l'attaquant (pas le MJ)
|
||||||
if (attacker?.type === "character" && attackRollFinal <= defenseRoll && attacker.system.grit.current > 0) {
|
if (!defenderHandledBonus && attacker && attackRollFinal <= defenseRoll && isPrimaryController(attacker)) {
|
||||||
// Vérifier si l'utilisateur est un propriétaire non-GM de l'attaquant
|
let canRerollAttack = LethalFantasyUtils.hasD30Reroll(attackD30message)
|
||||||
const isAttackerOwner = !game.user.isGM && attacker.testUserPermission(game.user, "OWNER")
|
|
||||||
|
|
||||||
if (isAttackerOwner) {
|
while (attackRollFinal <= defenseRoll) {
|
||||||
console.log("Offering Grit to attacker")
|
const currentGrit = Number(attacker.system?.grit?.current) || 0
|
||||||
|
const buttons = []
|
||||||
|
|
||||||
const attackBonus = await LethalFantasyUtils.offerAttackerGritBonus(
|
if (currentGrit > 0) {
|
||||||
attacker,
|
buttons.push({
|
||||||
attackRollFinal,
|
action: "grit",
|
||||||
defenseRoll,
|
label: `Spend 1 Grit (+1D6) [${currentGrit} left]`,
|
||||||
attackerName,
|
icon: "fa-solid fa-fist-raised",
|
||||||
defenderName
|
callback: () => "grit"
|
||||||
)
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
buttons.push({
|
||||||
|
action: "bonusDie",
|
||||||
|
label: "Add bonus die",
|
||||||
|
icon: "fa-solid fa-dice",
|
||||||
|
callback: () => "bonusDie"
|
||||||
|
})
|
||||||
|
|
||||||
|
if (canRerollAttack && attackRerollContext) {
|
||||||
|
buttons.push({
|
||||||
|
action: "rerollAttack",
|
||||||
|
label: "Re-roll attack",
|
||||||
|
icon: "fa-solid fa-rotate-right",
|
||||||
|
callback: () => "rerollAttack"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
buttons.push({
|
||||||
|
action: "continue",
|
||||||
|
label: "Continue (no attack bonus)",
|
||||||
|
icon: "fa-solid fa-forward",
|
||||||
|
callback: () => "continue"
|
||||||
|
})
|
||||||
|
|
||||||
|
const choice = await foundry.applications.api.DialogV2.wait({
|
||||||
|
window: { title: "Attack reactions" },
|
||||||
|
classes: ["lethalfantasy"],
|
||||||
|
content: `
|
||||||
|
<div class="grit-luck-dialog">
|
||||||
|
<div class="combat-status">
|
||||||
|
<p><strong>${attackerName}</strong> currently has <strong>${attackRollFinal}</strong></p>
|
||||||
|
<p><strong>${defenderName}</strong> rolled <strong>${defenseRoll}</strong></p>
|
||||||
|
${attackD30message ? `<p class="bonus-info">D30 special: ${attackD30message}</p>` : ""}
|
||||||
|
</div>
|
||||||
|
<p class="offer-text">Choose how to improve the attack before resolving the combat result.</p>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
buttons,
|
||||||
|
rejectClose: false
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!choice || choice === "continue") break
|
||||||
|
|
||||||
attackRollFinal += attackBonus
|
|
||||||
attackerHandledBonus = true
|
attackerHandledBonus = true
|
||||||
} else {
|
|
||||||
console.log("Not attacker owner or is GM, skipping Grit offer")
|
if (choice === "grit") {
|
||||||
|
const attackBonus = await LethalFantasyUtils.rollBonusDie("1d6", attacker, (total) => `<p><strong>${attackerName}</strong> spends 1 Grit and rolls <strong>${total}</strong> for attack.</p>`)
|
||||||
|
attackRollFinal += attackBonus
|
||||||
|
await attacker.update({ "system.grit.current": currentGrit - 1 })
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (choice === "bonusDie") {
|
||||||
|
const bonusDie = await LethalFantasyUtils.promptCombatBonusDie(attackerName, "defense", attackRollFinal, defenseRoll)
|
||||||
|
if (!bonusDie) continue
|
||||||
|
const attackBonus = await LethalFantasyUtils.rollBonusDie(bonusDie, attacker, (total, formula) => `<p><strong>${attackerName}</strong> adds <strong>${formula.toUpperCase()}</strong> and rolls <strong>${total}</strong> for attack.</p>`)
|
||||||
|
attackRollFinal += attackBonus
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (choice === "rerollAttack" && canRerollAttack && attackRerollContext) {
|
||||||
|
const oldAttackRoll = attackRollFinal
|
||||||
|
const reroll = await LethalFantasyUtils.rerollConfiguredRoll(attackRerollContext)
|
||||||
|
canRerollAttack = false
|
||||||
|
if (!reroll) continue
|
||||||
|
attackRollFinal = reroll.options?.rollTotal || reroll.total || oldAttackRoll
|
||||||
|
await createReactionMessage(attacker, `<p><strong>${attackerName}</strong> uses Mulligan and re-rolls attack: <strong>${oldAttackRoll}</strong> → <strong>${attackRollFinal}</strong>.</p>`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const shieldDamageReduction = shieldBlocked ? shieldReaction.damageReduction : 0
|
||||||
|
const outcome = shieldBlocked ? "shielded-hit" : (attackRollFinal > defenseRoll ? "hit" : "miss")
|
||||||
|
|
||||||
// Créer le message de comparaison - uniquement par le client qui a géré le dernier bonus
|
// Créer le message de comparaison - uniquement par le client qui a géré le dernier bonus
|
||||||
// Priorité: attaquant si il a géré le bonus, sinon défenseur si il a géré le bonus, sinon défenseur
|
// Priorité: attaquant si il a géré le bonus, sinon défenseur si il a géré le bonus, sinon défenseur
|
||||||
const shouldCreateMessage = attackerHandledBonus || (!attackerHandledBonus && defenderHandledBonus) || (!attackerHandledBonus && !defenderHandledBonus && defender.isOwner)
|
const shouldCreateMessage = attackerHandledBonus || (!attackerHandledBonus && defenderHandledBonus) || (!attackerHandledBonus && !defenderHandledBonus && isPrimaryController(defender))
|
||||||
|
|
||||||
if (shouldCreateMessage) {
|
if (shouldCreateMessage) {
|
||||||
console.log("Creating comparison message", { attackerHandledBonus, defenderHandledBonus, isDefenderOwner: defender.isOwner })
|
console.log("Creating comparison message", { attackerHandledBonus, defenderHandledBonus, isDefenderOwner: defender.isOwner })
|
||||||
@@ -483,7 +809,10 @@ Hooks.on("createChatMessage", async (message) => {
|
|||||||
attackRollKey,
|
attackRollKey,
|
||||||
defenderName,
|
defenderName,
|
||||||
defenderId,
|
defenderId,
|
||||||
defenseRoll
|
defenderTokenId,
|
||||||
|
defenseRoll,
|
||||||
|
outcome,
|
||||||
|
shieldDamageReduction
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
console.log("Skipping message creation", { attackerHandledBonus, defenderHandledBonus })
|
console.log("Skipping message creation", { attackerHandledBonus, defenderHandledBonus })
|
||||||
@@ -508,7 +837,7 @@ Hooks.on("createChatMessage", async (message) => {
|
|||||||
// 1. Si l'attaquant a un propriétaire joueur, seul ce joueur applique
|
// 1. Si l'attaquant a un propriétaire joueur, seul ce joueur applique
|
||||||
// 2. Si l'attaquant n'a que le MJ comme propriétaire (monstre), seul le MJ applique
|
// 2. Si l'attaquant n'a que le MJ comme propriétaire (monstre), seul le MJ applique
|
||||||
const attackerOwners = attacker ? game.users.filter(u =>
|
const attackerOwners = attacker ? game.users.filter(u =>
|
||||||
!u.isGM && attacker.testUserPermission(u, "OWNER")
|
u.active && !u.isGM && attacker.testUserPermission(u, "OWNER")
|
||||||
) : []
|
) : []
|
||||||
|
|
||||||
let shouldApplyDamage = false
|
let shouldApplyDamage = false
|
||||||
@@ -545,19 +874,43 @@ Hooks.on("createChatMessage", async (message) => {
|
|||||||
const attackerName = message.rolls[0]?.options?.actorName || "Unknown Attacker"
|
const attackerName = message.rolls[0]?.options?.actorName || "Unknown Attacker"
|
||||||
|
|
||||||
// Calculer les DR
|
// Calculer les DR
|
||||||
const armorDR = defender.computeDamageReduction() || 0
|
const bypassArmor = message.rolls[0]?.options?.bypassArmor || false
|
||||||
|
const armorDR = bypassArmor ? 0 : (defender.computeDamageReduction() || 0)
|
||||||
|
const extraShieldDr = Number(message.rolls[0]?.options?.extraShieldDr) || 0
|
||||||
|
const totalDR = armorDR + extraShieldDr
|
||||||
|
const finalDamage = Math.max(0, damageTotal - totalDR)
|
||||||
|
|
||||||
// Appliquer les dégâts avec armure DR par défaut
|
// Prefer the token ID stored in roll options (set at attack time when the exact token is known).
|
||||||
const finalDamage = Math.max(0, damageTotal - armorDR)
|
// For unlinked tokens (default for monsters), this ensures we target the right instance even
|
||||||
await defender.applyDamage(-finalDamage)
|
// when multiple unlinked copies of the same monster type are in combat.
|
||||||
|
const rollDefenderTokenId = message.rolls[0]?.options?.defenderTokenId
|
||||||
|
const defenderCombatant = game.combat?.combatants?.find(c => c.actorId === defender.id)
|
||||||
|
const defenderTokenId = rollDefenderTokenId
|
||||||
|
?? defenderCombatant?.token?.id
|
||||||
|
?? canvas.tokens?.placeables?.find(t => t.actor?.id === defender.id)?.id
|
||||||
|
?? null
|
||||||
|
|
||||||
// Créer un message de confirmation
|
// Apply damage. If the current user does not own the defender (e.g. player hitting a GM monster),
|
||||||
|
// route the HP update to the GM via socket. The confirmation message is still created here
|
||||||
|
// since all users can create chat messages.
|
||||||
|
if (defender.isOwner) {
|
||||||
|
// Resolve the token actor: prefer lookup by token ID (exact match for unlinked monsters),
|
||||||
|
// fall back to combatant actor, then base world actor.
|
||||||
|
const tokenActor = (defenderTokenId
|
||||||
|
? canvas.tokens?.placeables?.find(t => t.id === defenderTokenId)?.actor
|
||||||
|
: defenderCombatant?.actor) ?? defender
|
||||||
|
await tokenActor.applyDamage(-finalDamage)
|
||||||
|
} else {
|
||||||
|
game.socket.emit(`system.${SYSTEM.id}`, { type: "applyDamage", actorId: defender.id, tokenId: defenderTokenId, damage: -finalDamage })
|
||||||
|
}
|
||||||
|
|
||||||
|
// Créer un message de confirmation (visible to GM only)
|
||||||
const messageContent = await foundry.applications.handlebars.renderTemplate(
|
const messageContent = await foundry.applications.handlebars.renderTemplate(
|
||||||
"systems/fvtt-lethal-fantasy/templates/damage-applied-message.hbs",
|
"systems/fvtt-lethal-fantasy/templates/damage-applied-message.hbs",
|
||||||
{
|
{
|
||||||
targetName: defender.name,
|
targetName: defender.name,
|
||||||
damage: finalDamage,
|
damage: finalDamage,
|
||||||
drText: armorDR > 0 ? `Armor DR: ${armorDR}` : "",
|
drText: bypassArmor ? "Armor DR bypassed (spell)" : (totalDR > 0 ? `Armor DR: ${armorDR}${extraShieldDr > 0 ? ` + Shield DR: ${extraShieldDr}` : ""}` : ""),
|
||||||
weaponName: weaponName,
|
weaponName: weaponName,
|
||||||
attackerName: attackerName,
|
attackerName: attackerName,
|
||||||
rawDamage: damageTotal
|
rawDamage: damageTotal
|
||||||
@@ -566,7 +919,8 @@ Hooks.on("createChatMessage", async (message) => {
|
|||||||
|
|
||||||
await ChatMessage.create({
|
await ChatMessage.create({
|
||||||
content: messageContent,
|
content: messageContent,
|
||||||
speaker: ChatMessage.getSpeaker({ actor: defender })
|
speaker: ChatMessage.getSpeaker({ actor: defender }),
|
||||||
|
whisper: ChatMessage.getWhisperRecipients("GM")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -584,6 +938,12 @@ Hooks.on("hotbarDrop", (bar, data, slot) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
/**
|
||||||
|
* Inject the Lethal Fantasy dice tray into the chat sidebar.
|
||||||
|
*/
|
||||||
|
Hooks.on("renderChatLog", (_chatLog, html) => applications.injectDiceTray(_chatLog, html))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register world usage statistics
|
* Register world usage statistics
|
||||||
* @param {string} registerKey
|
* @param {string} registerKey
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,14 @@ 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);
|
console.log("%%%%%%%%% Roll Initiative", ids, options);
|
||||||
|
|
||||||
@@ -110,13 +118,12 @@ export class LethalFantasyCombat extends Combat {
|
|||||||
let updates = [];
|
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);
|
console.log("Rolling initiative for", c.actor.name);
|
||||||
game.socket.emit(`system.${SYSTEM.id}`, { type: "rollInitiative", actorId: c.actor.id, combatId: this.id, combatantId: c.id });
|
game.socket.emit(`system.${SYSTEM.id}`, { type: "rollInitiative", userId: playerOwner.id, 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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,12 +203,11 @@ export class LethalFantasyCombat extends Combat {
|
|||||||
|
|
||||||
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);
|
const playerOwner = game.users.find(u => u.active && !u.isGM && u.character?.id === c.actor.id);
|
||||||
if (user?.hasPlayerOwner) {
|
if (game.user.isGM && playerOwner) {
|
||||||
game.socket.emit(`system.${SYSTEM.id}`, { type: "rollProgressionDice", progressionCount: c.system.progressionCount + 1, actorId: c.actor.id, combatId: this.id, combatantId: c.id });
|
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
139
module/applications/free-roll.mjs
Normal file
139
module/applications/free-roll.mjs
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* @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 modifier (x = max-value explode)
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
export async function rollFreeDie(dieType, count = 1, explode = false) {
|
||||||
|
const sides = parseInt(dieType.replace("d", "")) || 20
|
||||||
|
const formula = explode ? `${count}d${sides}x` : `${count}d${sides}`
|
||||||
|
const label = explode
|
||||||
|
? `${count}${dieType.toUpperCase()}E`
|
||||||
|
: `${count}${dieType.toUpperCase()}`
|
||||||
|
|
||||||
|
const roll = new Roll(formula)
|
||||||
|
await roll.evaluate()
|
||||||
|
|
||||||
|
const results = roll.terms
|
||||||
|
.filter(t => t.results)
|
||||||
|
.flatMap(t => t.results)
|
||||||
|
|
||||||
|
const total = roll.total
|
||||||
|
|
||||||
|
const dieLabel = dieType.toUpperCase()
|
||||||
|
const resultHtml = results.map(r => {
|
||||||
|
const val = r.result
|
||||||
|
const isMax = val === sides
|
||||||
|
const isMin = val === 1
|
||||||
|
const explodeIcon = r.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">${dieLabel}</span>
|
||||||
|
<span class="lf-frc-die-sep">→</span>
|
||||||
|
<span class="lf-frc-die-val">${val}${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")
|
||||||
|
const msgData = {
|
||||||
|
speaker: ChatMessage.getSpeaker(),
|
||||||
|
content,
|
||||||
|
rolls: [roll],
|
||||||
|
sound: CONFIG.sounds.dice,
|
||||||
|
}
|
||||||
|
ChatMessage.applyRollMode(msgData, rollMode)
|
||||||
|
await ChatMessage.create(msgData)
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"melee_defense": "Possible Flawless or Legendary Defense or Add D20E to Defense",
|
"melee_defense": "Possible Flawless or Legendary Defense or Add D20E to Defense",
|
||||||
"arcane_spell_attack": "Possible Lethal or Vital Magical Strike or Add D20E to Spell Attack",
|
"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",
|
"arcane_spell_defense": "Possible Spell Catastrophe or adds D20E to Spell Defense",
|
||||||
"skill_rolls": "Skill Succeeds Regardless of Opposing Roll / Success at highest level / Matching 30s cancel each other out"
|
"skill_rolls": "Skill Succeeds Regardless of Opposing Roll"
|
||||||
},
|
},
|
||||||
"29": {
|
"29": {
|
||||||
"melee_attack": "Gain 1 Grit",
|
"melee_attack": "Gain 1 Grit",
|
||||||
@@ -28,9 +28,9 @@
|
|||||||
"melee_attack": "Granted D6 (1-6) Attack Modifier for This Melee Attack",
|
"melee_attack": "Granted D6 (1-6) Attack Modifier for This Melee Attack",
|
||||||
"ranged_attack": "Granted D6 (1-6) Attack Modifier for This Ranged Attack",
|
"ranged_attack": "Granted D6 (1-6) Attack Modifier for This Ranged Attack",
|
||||||
"melee_defense": "Granted 1 Luck dice for Use in This Combat Only",
|
"melee_defense": "Granted 1 Luck dice for Use in This Combat Only",
|
||||||
"arcane_spell_attack": "No Spell Lethargy (the Aether Approves)",
|
"arcane_spell_attack": "No Spell Lethargy the Aether Approves of Characters Efforts",
|
||||||
"arcane_spell_defense": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds",
|
"arcane_spell_defense": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds",
|
||||||
"skill_rolls": "Granted D6 (1-6) Skill Modifier for this Skill Attempt"
|
"skill_rolls": "empty"
|
||||||
},
|
},
|
||||||
"26": {
|
"26": {
|
||||||
"melee_attack": "Shield Destruction",
|
"melee_attack": "Shield Destruction",
|
||||||
@@ -41,9 +41,9 @@
|
|||||||
"skill_rolls": "empty"
|
"skill_rolls": "empty"
|
||||||
},
|
},
|
||||||
"25": {
|
"25": {
|
||||||
"melee_attack": "Bleed, Knock-Back on Hit",
|
"melee_attack": "empty",
|
||||||
"ranged_attack": "Bleed",
|
"ranged_attack": "empty",
|
||||||
"melee_defense": "Kick, Punch or Shield Bash",
|
"melee_defense": "empty",
|
||||||
"arcane_spell_attack": "empty",
|
"arcane_spell_attack": "empty",
|
||||||
"arcane_spell_defense": "empty",
|
"arcane_spell_defense": "empty",
|
||||||
"skill_rolls": "Add 1 to Skill Roll"
|
"skill_rolls": "Add 1 to Skill Roll"
|
||||||
@@ -54,14 +54,14 @@
|
|||||||
"melee_defense": "Defender Recovers or ignores any flash of pain",
|
"melee_defense": "Defender Recovers or ignores any flash of pain",
|
||||||
"arcane_spell_attack": "Magical Damage inflicts Flash of pain 1D6E seconds",
|
"arcane_spell_attack": "Magical Damage inflicts Flash of pain 1D6E seconds",
|
||||||
"arcane_spell_defense": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds",
|
"arcane_spell_defense": "Caster Suffers Severe pain and will be under a flash of pain for 1D6E seconds",
|
||||||
"skill_rolls": "empty"
|
"skill_rolls": "Granted D6 (1-6) Skill Modifier for this Skill Attempt"
|
||||||
},
|
},
|
||||||
"20": {
|
"20": {
|
||||||
"melee_attack": "Possible Vicious Strike. Bleed, Knock-back on Hit",
|
"melee_attack": "Possible Vicious Strike or Add D12 to attack",
|
||||||
"ranged_attack": "Possible Vicious Strike. Bleeding wound inflicted on hit.",
|
"ranged_attack": "Possible Vicious Strike or add D12 to attack",
|
||||||
"melee_defense": "Possible 20/20 defense (avoids Any Attack Except a Lethal Strike). Grants a Kick, Punch or Shield Bash counter",
|
"melee_defense": "Possible 20/20 defense that avoids Any Attack Except a Lethal Strike or adds D12 to defense",
|
||||||
"arcane_spell_attack": "Possible Vicious Application of a Magical Attack",
|
"arcane_spell_attack": "Possible Vicious Application of a Magical Attack or add D12 to attack",
|
||||||
"arcane_spell_defense": "Possible 20/20 Spell defense (Saves Against Any Magical Attack Except a Lethal Magical Strike)",
|
"arcane_spell_defense": "Possible 20/20 Spell defense that Saves Against Any Magical Attack Except a Lethal Magical Strike or add D12 to defense",
|
||||||
"skill_rolls": "20 Added to Skill Roll"
|
"skill_rolls": "20 Added to Skill Roll"
|
||||||
},
|
},
|
||||||
"15": {
|
"15": {
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
},
|
},
|
||||||
"7": {
|
"7": {
|
||||||
"melee_attack": "Flurry Attack on Hit or Miss",
|
"melee_attack": "Flurry Attack on Hit or Miss",
|
||||||
"ranged_attack": "Roll 2x Double Damage Dice",
|
"ranged_attack": "Roll 2x Damage Dice",
|
||||||
"melee_defense": "empty",
|
"melee_defense": "empty",
|
||||||
"arcane_spell_attack": "empty",
|
"arcane_spell_attack": "empty",
|
||||||
"arcane_spell_defense": "empty",
|
"arcane_spell_defense": "empty",
|
||||||
@@ -146,7 +146,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"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."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* *************************************************/
|
/* *************************************************/
|
||||||
async prepareRoll(rollType, rollKey, rollDice, defenderId) {
|
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) {
|
||||||
@@ -268,7 +268,7 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
rollTarget.magicUser = this.system.biodata.magicUser
|
rollTarget.magicUser = this.system.biodata.magicUser
|
||||||
rollTarget.actorModifiers = foundry.utils.duplicate(this.system.modifiers)
|
rollTarget.actorModifiers = foundry.utils.duplicate(this.system.modifiers)
|
||||||
rollTarget.actorLevel = this.system.biodata.level
|
rollTarget.actorLevel = this.system.biodata.level
|
||||||
await this.system.roll(rollType, rollTarget, defenderId)
|
await this.system.roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -346,58 +346,73 @@ 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
|
||||||
|
rollContext.visibility ||= rollContext.rollMode || game.settings.get("core", "rollMode")
|
||||||
|
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
|
||||||
@@ -547,6 +562,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) {
|
||||||
@@ -620,6 +639,8 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rollBase.options.badResult = badResult
|
rollBase.options.badResult = badResult
|
||||||
rollBase.options.rollData = foundry.utils.duplicate(rollData)
|
rollBase.options.rollData = foundry.utils.duplicate(rollData)
|
||||||
rollBase.options.defenderId = options.defenderId
|
rollBase.options.defenderId = options.defenderId
|
||||||
|
rollBase.options.defenderTokenId = options.defenderTokenId
|
||||||
|
rollBase.options.extraShieldDr = options.extraShieldDr || 0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A hook event that fires after the roll has been made.
|
* A hook event that fires after the roll has been made.
|
||||||
@@ -681,16 +702,24 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rejectClose: false // Click on Close button will not launch an error
|
rejectClose: false // Click on Close button will not launch an error
|
||||||
})
|
})
|
||||||
|
|
||||||
let initRoll = new Roll(`min(${rollContext.initiativeDice}, ${options.maxInit})`, options.data, rollContext)
|
if (!rollContext) return
|
||||||
|
|
||||||
|
// When the value is a plain number (e.g. "1" for Declared Ready on Alert), wrapping it in
|
||||||
|
// min(1, maxInit) produces a dice-less formula that FoundryVTT cannot evaluate to a valid
|
||||||
|
// total. Use the constant directly; min() is only needed for actual dice expressions.
|
||||||
|
const isDiceFormula = /[dD]/.test(rollContext.initiativeDice)
|
||||||
|
const formula = isDiceFormula ? `min(${rollContext.initiativeDice}, ${options.maxInit})` : rollContext.initiativeDice
|
||||||
|
|
||||||
|
let initRoll = new Roll(formula, options.data)
|
||||||
await initRoll.evaluate()
|
await initRoll.evaluate()
|
||||||
let msg = await initRoll.toMessage({ flavor: `Initiative for ${options.actorName}` }, { rollMode: rollContext.visibility })
|
let msg = await initRoll.toMessage({ flavor: `Initiative for ${options.actorName}` }, { rollMode: rollContext.visibility })
|
||||||
if (game?.dice3d) {
|
if (game?.dice3d && initRoll.dice?.length) {
|
||||||
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
await game.dice3d.waitFor3DAnimationByMessageID(msg.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.combatId && options.combatantId) {
|
if (options.combatId && options.combatantId) {
|
||||||
let combat = game.combats.get(options.combatId)
|
let combat = game.combats.get(options.combatId)
|
||||||
combat.updateEmbeddedDocuments("Combatant", [{ _id: options.combatantId, initiative: initRoll.total, 'system.progressionCount': 0 }]);
|
await combat.updateEmbeddedDocuments("Combatant", [{ _id: options.combatantId, initiative: initRoll.total, 'system.progressionCount': 0, [`flags.${SYSTEM.id}.firstActionTaken`]: false }])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -827,7 +856,11 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
let selectedItem = combatant.actor.items.find(i => i.id === selectedChoice)
|
let selectedItem = combatant.actor.items.find(i => i.id === selectedChoice)
|
||||||
// Setup flag for combat action usage
|
// Setup flag for combat action usage
|
||||||
let actionItem = foundry.utils.duplicate(selectedItem)
|
let actionItem = foundry.utils.duplicate(selectedItem)
|
||||||
actionItem.progressionCount = 1
|
// First action of this combat: use the class-based starting threshold;
|
||||||
|
// all subsequent actions reset to 1 (normal progression).
|
||||||
|
const firstActionTaken = combatant.getFlag(SYSTEM.id, "firstActionTaken")
|
||||||
|
actionItem.progressionCount = firstActionTaken ? 1 : (combatant.actor.system.combat?.combatProgressionStart ?? 1)
|
||||||
|
if (!firstActionTaken) await combatant.setFlag(SYSTEM.id, "firstActionTaken", true)
|
||||||
actionItem.rangedMode = rangedMode
|
actionItem.rangedMode = rangedMode
|
||||||
actionItem.castingTime = 1
|
actionItem.castingTime = 1
|
||||||
actionItem.spellStatus = "castingTime"
|
actionItem.spellStatus = "castingTime"
|
||||||
@@ -1283,7 +1316,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
* @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 = {}, { rollMode, create = true } = {}) {
|
||||||
super.toMessage(
|
return await super.toMessage(
|
||||||
{
|
{
|
||||||
isSave: this.isSave,
|
isSave: this.isSave,
|
||||||
isChallenge: this.isChallenge,
|
isChallenge: this.isChallenge,
|
||||||
@@ -1300,7 +1333,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
rollData: this.rollData,
|
rollData: this.rollData,
|
||||||
...messageData,
|
...messageData,
|
||||||
},
|
},
|
||||||
{ rollMode: rollMode },
|
{ rollMode, create },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
defenseBonus: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
defenseBonus: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
damageModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
damageModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
armorHitPoints: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
armorHitPoints: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
|
combatProgressionStart: new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 }),
|
||||||
})
|
})
|
||||||
|
|
||||||
const moneyField = (label) => {
|
const moneyField = (label) => {
|
||||||
@@ -273,7 +274,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
* @param {"="|"+"|"++"|"-"|"--"} rollAdvantage If there is an avantage (+), a disadvantage (-), a double advantage (++), a double disadvantage (--) or a normal roll (=).
|
* @param {"="|"+"|"++"|"-"|"--"} rollAdvantage If there is an avantage (+), a disadvantage (-), a double advantage (++), a double disadvantage (--) or a normal roll (=).
|
||||||
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
|
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
|
||||||
*/
|
*/
|
||||||
async roll(rollType, rollTarget, defenderId) {
|
async roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr = 0) {
|
||||||
const hasTarget = false
|
const hasTarget = false
|
||||||
let roll = await LethalFantasyRoll.prompt({
|
let roll = await LethalFantasyRoll.prompt({
|
||||||
rollType,
|
rollType,
|
||||||
@@ -283,7 +284,9 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
actorImage: this.parent.img,
|
actorImage: this.parent.img,
|
||||||
hasTarget,
|
hasTarget,
|
||||||
target: false,
|
target: false,
|
||||||
defenderId
|
defenderId,
|
||||||
|
defenderTokenId,
|
||||||
|
extraShieldDr
|
||||||
})
|
})
|
||||||
if (!roll) return null
|
if (!roll) return null
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,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) {
|
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,
|
||||||
@@ -151,14 +151,16 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
actorImage: this.parent.img,
|
actorImage: this.parent.img,
|
||||||
hasTarget,
|
hasTarget,
|
||||||
target: false,
|
target: false,
|
||||||
defenderId
|
defenderId,
|
||||||
|
defenderTokenId,
|
||||||
|
extraShieldDr
|
||||||
})
|
})
|
||||||
if (!roll) return null
|
if (!roll) return null
|
||||||
|
|
||||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
||||||
}
|
}
|
||||||
|
|
||||||
async prepareMonsterRoll(rollType, rollKey, rollDice = undefined, tokenId = undefined, damageModifier = undefined, defenderId = undefined) {
|
async prepareMonsterRoll(rollType, rollKey, rollDice = undefined, tokenId = undefined, damageModifier = undefined, defenderId = undefined, defenderTokenId = undefined, extraShieldDr = 0) {
|
||||||
let rollTarget
|
let rollTarget
|
||||||
switch (rollType) {
|
switch (rollType) {
|
||||||
case "monster-attack":
|
case "monster-attack":
|
||||||
@@ -254,7 +256,7 @@ export default class LethalFantasyMonster extends foundry.abstract.TypeDataModel
|
|||||||
if (rollTarget) {
|
if (rollTarget) {
|
||||||
rollTarget.tokenId = tokenId
|
rollTarget.tokenId = tokenId
|
||||||
console.log(rollTarget)
|
console.log(rollTarget)
|
||||||
await this.roll(rollType, rollTarget, defenderId)
|
await this.roll(rollType, rollTarget, defenderId, defenderTokenId, extraShieldDr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ 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: "" })
|
||||||
|
|
||||||
return schema
|
return schema
|
||||||
}
|
}
|
||||||
|
|||||||
369
module/utils.mjs
369
module/utils.mjs
@@ -28,6 +28,7 @@ export default class LethalFantasyUtils {
|
|||||||
static setHookListeners() {
|
static setHookListeners() {
|
||||||
|
|
||||||
Hooks.on('renderTokenHUD', async (hud, html, token) => {
|
Hooks.on('renderTokenHUD', async (hud, html, token) => {
|
||||||
|
// HP Loss Button (existing)
|
||||||
const lossHPButton = await foundry.applications.handlebars.renderTemplate('systems/fvtt-lethal-fantasy/templates/loss-hp-hud.hbs', {})
|
const lossHPButton = await foundry.applications.handlebars.renderTemplate('systems/fvtt-lethal-fantasy/templates/loss-hp-hud.hbs', {})
|
||||||
$(html).find('div.left').append(lossHPButton);
|
$(html).find('div.left').append(lossHPButton);
|
||||||
$(html).find('img.lethal-hp-loss-hud').click((event) => {
|
$(html).find('img.lethal-hp-loss-hud').click((event) => {
|
||||||
@@ -65,6 +66,45 @@ export default class LethalFantasyUtils {
|
|||||||
$(html).find('.hp-loss-wrap')[2].classList.add('hp-loss-hud-disabled');
|
$(html).find('.hp-loss-wrap')[2].classList.add('hp-loss-hud-disabled');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// HP Gain Button (new)
|
||||||
|
const gainHPButton = await foundry.applications.handlebars.renderTemplate('systems/fvtt-lethal-fantasy/templates/gain-hp-hud.hbs', {})
|
||||||
|
$(html).find('div.left').append(gainHPButton);
|
||||||
|
$(html).find('img.lethal-hp-gain-hud').click((event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
let hpMenu = $(html).find('.hp-gain-wrap')[0]
|
||||||
|
if (hpMenu.classList.contains("hp-gain-hud-disabled")) {
|
||||||
|
$(html).find('.hp-gain-wrap')[0].classList.add('hp-gain-hud-active');
|
||||||
|
$(html).find('.hp-gain-wrap')[0].classList.remove('hp-gain-hud-disabled');
|
||||||
|
$(html).find('.hp-gain-wrap')[1].classList.add('hp-gain-hud-active');
|
||||||
|
$(html).find('.hp-gain-wrap')[1].classList.remove('hp-gain-hud-disabled');
|
||||||
|
$(html).find('.hp-gain-wrap')[2].classList.add('hp-gain-hud-active');
|
||||||
|
$(html).find('.hp-gain-wrap')[2].classList.remove('hp-gain-hud-disabled');
|
||||||
|
} else {
|
||||||
|
$(html).find('.hp-gain-wrap')[0].classList.remove('hp-gain-hud-active');
|
||||||
|
$(html).find('.hp-gain-wrap')[0].classList.add('hp-gain-hud-disabled');
|
||||||
|
$(html).find('.hp-gain-wrap')[1].classList.remove('hp-gain-hud-active');
|
||||||
|
$(html).find('.hp-gain-wrap')[1].classList.add('hp-gain-hud-disabled');
|
||||||
|
$(html).find('.hp-gain-wrap')[2].classList.remove('hp-gain-hud-active');
|
||||||
|
$(html).find('.hp-gain-wrap')[2].classList.add('hp-gain-hud-disabled');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$(html).find('.gain-hp-hud-click').click((event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
let hpGain = event.currentTarget.dataset.hpValue;
|
||||||
|
if (token) {
|
||||||
|
let tokenFull = canvas.tokens.placeables.find(t => t.id === token._id);
|
||||||
|
console.log(tokenFull, token)
|
||||||
|
let actor = tokenFull.actor;
|
||||||
|
actor.applyDamage(Number(hpGain)); // Positive value to add HP
|
||||||
|
$(html).find('.hp-gain-wrap')[0].classList.remove('hp-gain-hud-active');
|
||||||
|
$(html).find('.hp-gain-wrap')[0].classList.add('hp-gain-hud-disabled');
|
||||||
|
$(html).find('.hp-gain-wrap')[1].classList.remove('hp-gain-hud-active');
|
||||||
|
$(html).find('.hp-gain-wrap')[1].classList.add('hp-gain-hud-disabled');
|
||||||
|
$(html).find('.hp-gain-wrap')[2].classList.remove('hp-gain-hud-active');
|
||||||
|
$(html).find('.hp-gain-wrap')[2].classList.add('hp-gain-hud-disabled');
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,11 +113,23 @@ export default class LethalFantasyUtils {
|
|||||||
console.log(`handleSocketEvent !`, msg)
|
console.log(`handleSocketEvent !`, msg)
|
||||||
let actor
|
let actor
|
||||||
switch (msg.type) {
|
switch (msg.type) {
|
||||||
|
case "applyDamage":
|
||||||
|
if (game.user.isGM) {
|
||||||
|
// Prefer the specific token actor (correct for unlinked monsters); fall back to world actor.
|
||||||
|
actor = msg.tokenId
|
||||||
|
? canvas.tokens?.placeables?.find(t => t.id === msg.tokenId)?.actor
|
||||||
|
: (game.combat?.combatants?.find(c => c.actorId === msg.actorId)?.actor
|
||||||
|
?? game.actors.get(msg.actorId))
|
||||||
|
if (actor) actor.applyDamage(msg.damage)
|
||||||
|
}
|
||||||
|
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
|
||||||
@@ -140,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
|
||||||
|
|
||||||
@@ -166,9 +221,88 @@ export default class LethalFantasyUtils {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Resolve the specific token ID now while we still have combatant/token context.
|
||||||
|
// This is passed through to the damage roll so the GM-side socket handler can find the
|
||||||
|
// correct synthetic actor for unlinked tokens (avoids wrong-instance damage with multiple
|
||||||
|
// unlinked copies of the same monster).
|
||||||
|
const defenderTokenId = (() => {
|
||||||
|
if (game.combat && combatantId) {
|
||||||
|
const cbt = game.combat.combatants.get(combatantId)
|
||||||
|
if (cbt?.token?.id) return cbt.token.id
|
||||||
|
}
|
||||||
|
return tokenId ?? canvas.tokens?.placeables?.find(t => t.actor?.id === defender.id)?.id ?? null
|
||||||
|
})()
|
||||||
|
|
||||||
const isMonster = defender.type === "monster"
|
const isMonster = defender.type === "monster"
|
||||||
|
|
||||||
// Pour les monstres, récupérer les attaques activées
|
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
|
||||||
if (isMonster) {
|
if (isMonster) {
|
||||||
const enabledAttacks = Object.entries(defender.system.attacks).filter(([key, attack]) => attack.enabled)
|
const enabledAttacks = Object.entries(defender.system.attacks).filter(([key, attack]) => attack.enabled)
|
||||||
|
|
||||||
@@ -227,11 +361,13 @@ export default class LethalFantasyUtils {
|
|||||||
attackWeaponId,
|
attackWeaponId,
|
||||||
attackRollType,
|
attackRollType,
|
||||||
attackRollKey,
|
attackRollKey,
|
||||||
defenderId: defender.id
|
attackD30result,
|
||||||
|
attackD30message,
|
||||||
|
attackRerollContext,
|
||||||
|
defenderId: defender.id,
|
||||||
|
defenderTokenId
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Storing defense data for monster:", defender.id)
|
|
||||||
|
|
||||||
defender.system.prepareMonsterRoll("monster-defense", result)
|
defender.system.prepareMonsterRoll("monster-defense", result)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@@ -297,7 +433,11 @@ export default class LethalFantasyUtils {
|
|||||||
attackWeaponId,
|
attackWeaponId,
|
||||||
attackRollType,
|
attackRollType,
|
||||||
attackRollKey,
|
attackRollKey,
|
||||||
defenderId: defender.id
|
attackD30result,
|
||||||
|
attackD30message,
|
||||||
|
attackRerollContext,
|
||||||
|
defenderId: defender.id,
|
||||||
|
defenderTokenId
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Storing defense data for character:", defender.id)
|
console.log("Storing defense data for character:", defender.id)
|
||||||
@@ -306,6 +446,188 @@ export default class LethalFantasyUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static hasD30Reroll(d30Message) {
|
||||||
|
return /mulligan|re-?roll/i.test(d30Message || "")
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
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
|
||||||
@@ -476,7 +798,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 = ""
|
||||||
@@ -486,10 +809,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-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-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>
|
||||||
@@ -497,11 +820,29 @@ 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-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 damageDice = spell?.system?.damageDice
|
||||||
|
if (damageDice) {
|
||||||
|
damageButton = `
|
||||||
|
<div class="attack-result-damage">
|
||||||
|
<button class="roll-damage-btn"
|
||||||
|
data-attacker-id="${data.attackerId}"
|
||||||
|
data-defender-id="${data.defenderId}"
|
||||||
|
data-defender-token-id="${data.defenderTokenId || ""}"
|
||||||
|
data-damage-type="spell"
|
||||||
|
data-damage-formula="${damageDice}">
|
||||||
|
<i class="fa-solid fa-wand-magic-sparkles"></i> Spell Damage (${damageDice})
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,10 +867,12 @@ 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.attackerName}</strong> hits <strong>${data.defenderName}</strong>, but the shield blocked — 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> parries the attack!`
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
${damageButton}
|
${damageButton}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
MANIFEST-000527
|
MANIFEST-000567
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/01/19-20:32:07.348929 7f14d8ff96c0 Recovering log #525
|
2026/04/17-15:59:28.854423 7fc1d9fbd6c0 Recovering log #565
|
||||||
2026/01/19-20:32:07.358983 7f14d8ff96c0 Delete type=3 #523
|
2026/04/17-15:59:28.865018 7fc1d9fbd6c0 Delete type=3 #563
|
||||||
2026/01/19-20:32:07.359059 7f14d8ff96c0 Delete type=0 #525
|
2026/04/17-15:59:28.865088 7fc1d9fbd6c0 Delete type=0 #565
|
||||||
2026/01/19-22:34:04.043006 7f1243fff6c0 Level-0 table #530: started
|
2026/04/17-17:32:42.752073 7fc1d8fbb6c0 Level-0 table #570: started
|
||||||
2026/01/19-22:34:04.043050 7f1243fff6c0 Level-0 table #530: 0 bytes OK
|
2026/04/17-17:32:42.752102 7fc1d8fbb6c0 Level-0 table #570: 0 bytes OK
|
||||||
2026/01/19-22:34:04.052889 7f1243fff6c0 Delete type=0 #528
|
2026/04/17-17:32:42.757979 7fc1d8fbb6c0 Delete type=0 #568
|
||||||
2026/01/19-22:34:04.082744 7f1243fff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
2026/04/17-17:32:42.764071 7fc1d8fbb6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||||
2026/01/19-22:34:04.092309 7f1243fff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
2026/04/17-17:32:42.764104 7fc1d8fbb6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/01/19-20:23:50.466717 7f14da7fc6c0 Recovering log #521
|
2026/04/16-08:58:49.556234 7fc1d97bc6c0 Recovering log #561
|
||||||
2026/01/19-20:23:50.476745 7f14da7fc6c0 Delete type=3 #519
|
2026/04/16-08:58:49.566786 7fc1d97bc6c0 Delete type=3 #559
|
||||||
2026/01/19-20:23:50.476798 7f14da7fc6c0 Delete type=0 #521
|
2026/04/16-08:58:49.566849 7fc1d97bc6c0 Delete type=0 #561
|
||||||
2026/01/19-20:32:02.937243 7f1243fff6c0 Level-0 table #526: started
|
2026/04/16-10:53:23.903167 7fc1d8fbb6c0 Level-0 table #566: started
|
||||||
2026/01/19-20:32:02.937265 7f1243fff6c0 Level-0 table #526: 0 bytes OK
|
2026/04/16-10:53:23.903203 7fc1d8fbb6c0 Level-0 table #566: 0 bytes OK
|
||||||
2026/01/19-20:32:02.943907 7f1243fff6c0 Delete type=0 #524
|
2026/04/16-10:53:23.909050 7fc1d8fbb6c0 Delete type=0 #564
|
||||||
2026/01/19-20:32:02.956456 7f1243fff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
2026/04/16-10:53:23.921766 7fc1d8fbb6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
||||||
2026/01/19-20:32:02.956498 7f1243fff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end)
|
2026/04/16-10:53:23.921790 7fc1d8fbb6c0 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-000524
|
MANIFEST-000564
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/01/19-20:32:07.362345 7f14d9ffb6c0 Recovering log #522
|
2026/04/17-15:59:28.871085 7fc1dafbf6c0 Recovering log #562
|
||||||
2026/01/19-20:32:07.372537 7f14d9ffb6c0 Delete type=3 #520
|
2026/04/17-15:59:28.880683 7fc1dafbf6c0 Delete type=3 #560
|
||||||
2026/01/19-20:32:07.372596 7f14d9ffb6c0 Delete type=0 #522
|
2026/04/17-15:59:28.880729 7fc1dafbf6c0 Delete type=0 #562
|
||||||
2026/01/19-22:34:04.165591 7f1243fff6c0 Level-0 table #527: started
|
2026/04/17-17:32:42.744598 7fc1d8fbb6c0 Level-0 table #567: started
|
||||||
2026/01/19-22:34:04.165637 7f1243fff6c0 Level-0 table #527: 0 bytes OK
|
2026/04/17-17:32:42.744627 7fc1d8fbb6c0 Level-0 table #567: 0 bytes OK
|
||||||
2026/01/19-22:34:04.175509 7f1243fff6c0 Delete type=0 #525
|
2026/04/17-17:32:42.751972 7fc1d8fbb6c0 Delete type=0 #565
|
||||||
2026/01/19-22:34:04.175734 7f1243fff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
2026/04/17-17:32:42.764061 7fc1d8fbb6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||||
2026/01/19-22:34:04.175767 7f1243fff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
2026/04/17-17:32:42.764085 7fc1d8fbb6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/01/19-20:23:50.482057 7f14d8ff96c0 Recovering log #518
|
2026/04/16-08:58:49.571861 7fc1da7be6c0 Recovering log #558
|
||||||
2026/01/19-20:23:50.491682 7f14d8ff96c0 Delete type=3 #516
|
2026/04/16-08:58:49.581625 7fc1da7be6c0 Delete type=3 #556
|
||||||
2026/01/19-20:23:50.491756 7f14d8ff96c0 Delete type=0 #518
|
2026/04/16-08:58:49.581687 7fc1da7be6c0 Delete type=0 #558
|
||||||
2026/01/19-20:32:02.944004 7f1243fff6c0 Level-0 table #523: started
|
2026/04/16-10:53:23.896992 7fc1d8fbb6c0 Level-0 table #563: started
|
||||||
2026/01/19-20:32:02.944026 7f1243fff6c0 Level-0 table #523: 0 bytes OK
|
2026/04/16-10:53:23.897059 7fc1d8fbb6c0 Level-0 table #563: 0 bytes OK
|
||||||
2026/01/19-20:32:02.950204 7f1243fff6c0 Delete type=0 #521
|
2026/04/16-10:53:23.903074 7fc1d8fbb6c0 Delete type=0 #561
|
||||||
2026/01/19-20:32:02.956469 7f1243fff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
2026/04/16-10:53:23.921755 7fc1d8fbb6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
||||||
2026/01/19-20:32:02.956510 7f1243fff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!x5gLtqlW4sdDmHTd' @ 0 : 0; will stop at (end)
|
2026/04/16-10:53:23.921797 7fc1d8fbb6c0 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-000529
|
MANIFEST-000569
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/01/19-20:32:07.335896 7f14d97fa6c0 Recovering log #527
|
2026/04/17-15:59:28.839432 7fc1da7be6c0 Recovering log #567
|
||||||
2026/01/19-20:32:07.346053 7f14d97fa6c0 Delete type=3 #525
|
2026/04/17-15:59:28.849242 7fc1da7be6c0 Delete type=3 #565
|
||||||
2026/01/19-20:32:07.346120 7f14d97fa6c0 Delete type=0 #527
|
2026/04/17-15:59:28.849292 7fc1da7be6c0 Delete type=0 #567
|
||||||
2026/01/19-22:34:04.092377 7f1243fff6c0 Level-0 table #532: started
|
2026/04/17-17:32:42.764151 7fc1d8fbb6c0 Level-0 table #572: started
|
||||||
2026/01/19-22:34:04.092412 7f1243fff6c0 Level-0 table #532: 0 bytes OK
|
2026/04/17-17:32:42.764181 7fc1d8fbb6c0 Level-0 table #572: 0 bytes OK
|
||||||
2026/01/19-22:34:04.101864 7f1243fff6c0 Delete type=0 #530
|
2026/04/17-17:32:42.770357 7fc1d8fbb6c0 Delete type=0 #570
|
||||||
2026/01/19-22:34:04.133480 7f1243fff6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
2026/04/17-17:32:42.789018 7fc1d8fbb6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||||
2026/01/19-22:34:04.133550 7f1243fff6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
2026/04/17-17:32:42.789049 7fc1d8fbb6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/01/19-20:23:50.451679 7f14d9ffb6c0 Recovering log #523
|
2026/04/16-08:58:49.542216 7fc1dafbf6c0 Recovering log #563
|
||||||
2026/01/19-20:23:50.462356 7f14d9ffb6c0 Delete type=3 #521
|
2026/04/16-08:58:49.551998 7fc1dafbf6c0 Delete type=3 #561
|
||||||
2026/01/19-20:23:50.462416 7f14d9ffb6c0 Delete type=0 #523
|
2026/04/16-08:58:49.552067 7fc1dafbf6c0 Delete type=0 #563
|
||||||
2026/01/19-20:32:02.930994 7f1243fff6c0 Level-0 table #528: started
|
2026/04/16-10:53:23.915570 7fc1d8fbb6c0 Level-0 table #568: started
|
||||||
2026/01/19-20:32:02.931037 7f1243fff6c0 Level-0 table #528: 0 bytes OK
|
2026/04/16-10:53:23.915589 7fc1d8fbb6c0 Level-0 table #568: 0 bytes OK
|
||||||
2026/01/19-20:32:02.937118 7f1243fff6c0 Delete type=0 #526
|
2026/04/16-10:53:23.921669 7fc1d8fbb6c0 Delete type=0 #566
|
||||||
2026/01/19-20:32:02.956440 7f1243fff6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
2026/04/16-10:53:23.921782 7fc1d8fbb6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
||||||
2026/01/19-20:32:02.956479 7f1243fff6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end)
|
2026/04/16-10:53:23.921813 7fc1d8fbb6c0 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-000224
|
MANIFEST-000264
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/01/19-20:32:07.386680 7f14d97fa6c0 Recovering log #222
|
2026/04/17-15:59:28.899464 7fc1d97bc6c0 Recovering log #262
|
||||||
2026/01/19-20:32:07.397058 7f14d97fa6c0 Delete type=3 #220
|
2026/04/17-15:59:28.910004 7fc1d97bc6c0 Delete type=3 #260
|
||||||
2026/01/19-20:32:07.397159 7f14d97fa6c0 Delete type=0 #222
|
2026/04/17-15:59:28.910074 7fc1d97bc6c0 Delete type=0 #262
|
||||||
2026/01/19-22:34:04.082756 7f1243fff6c0 Level-0 table #227: started
|
2026/04/17-17:32:42.770457 7fc1d8fbb6c0 Level-0 table #267: started
|
||||||
2026/01/19-22:34:04.082796 7f1243fff6c0 Level-0 table #227: 0 bytes OK
|
2026/04/17-17:32:42.770479 7fc1d8fbb6c0 Level-0 table #267: 0 bytes OK
|
||||||
2026/01/19-22:34:04.092156 7f1243fff6c0 Delete type=0 #225
|
2026/04/17-17:32:42.777091 7fc1d8fbb6c0 Delete type=0 #265
|
||||||
2026/01/19-22:34:04.092321 7f1243fff6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
2026/04/17-17:32:42.789028 7fc1d8fbb6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||||
2026/01/19-22:34:04.092355 7f1243fff6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
2026/04/17-17:32:42.789054 7fc1d8fbb6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/01/19-20:23:50.510934 7f14d97fa6c0 Recovering log #218
|
2026/04/16-08:58:49.600337 7fc1dafbf6c0 Recovering log #258
|
||||||
2026/01/19-20:23:50.520501 7f14d97fa6c0 Delete type=3 #216
|
2026/04/16-08:58:49.610136 7fc1dafbf6c0 Delete type=3 #256
|
||||||
2026/01/19-20:23:50.520578 7f14d97fa6c0 Delete type=0 #218
|
2026/04/16-08:58:49.610209 7fc1dafbf6c0 Delete type=0 #258
|
||||||
2026/01/19-20:32:02.976313 7f1243fff6c0 Level-0 table #223: started
|
2026/04/16-10:53:23.940580 7fc1d8fbb6c0 Level-0 table #263: started
|
||||||
2026/01/19-20:32:02.976359 7f1243fff6c0 Level-0 table #223: 0 bytes OK
|
2026/04/16-10:53:23.940611 7fc1d8fbb6c0 Level-0 table #263: 0 bytes OK
|
||||||
2026/01/19-20:32:02.982272 7f1243fff6c0 Delete type=0 #221
|
2026/04/16-10:53:23.947242 7fc1d8fbb6c0 Delete type=0 #261
|
||||||
2026/01/19-20:32:02.982509 7f1243fff6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
2026/04/16-10:53:23.947402 7fc1d8fbb6c0 Manual compaction at level-0 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||||
2026/01/19-20:32:02.982604 7f1243fff6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
2026/04/16-10:53:23.947419 7fc1d8fbb6c0 Manual compaction at level-1 from '!folders!37mu4dxsSuftlnmP' @ 72057594037927935 : 1 .. '!items!zKOpU34oLziGJW6y' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000523
|
MANIFEST-000563
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/01/19-20:32:07.374730 7f14d8ff96c0 Recovering log #521
|
2026/04/17-15:59:28.886104 7fc1da7be6c0 Recovering log #561
|
||||||
2026/01/19-20:32:07.384387 7f14d8ff96c0 Delete type=3 #519
|
2026/04/17-15:59:28.896104 7fc1da7be6c0 Delete type=3 #559
|
||||||
2026/01/19-20:32:07.384466 7f14d8ff96c0 Delete type=0 #521
|
2026/04/17-15:59:28.896157 7fc1da7be6c0 Delete type=0 #561
|
||||||
2026/01/19-22:34:04.031975 7f1243fff6c0 Level-0 table #526: started
|
2026/04/17-17:32:42.758102 7fc1d8fbb6c0 Level-0 table #566: started
|
||||||
2026/01/19-22:34:04.032019 7f1243fff6c0 Level-0 table #526: 0 bytes OK
|
2026/04/17-17:32:42.758128 7fc1d8fbb6c0 Level-0 table #566: 0 bytes OK
|
||||||
2026/01/19-22:34:04.042831 7f1243fff6c0 Delete type=0 #524
|
2026/04/17-17:32:42.763950 7fc1d8fbb6c0 Delete type=0 #564
|
||||||
2026/01/19-22:34:04.082725 7f1243fff6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
2026/04/17-17:32:42.764079 7fc1d8fbb6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||||
2026/01/19-22:34:04.092294 7f1243fff6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
2026/04/17-17:32:42.764099 7fc1d8fbb6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
2026/01/19-20:23:50.495445 7f14d9ffb6c0 Recovering log #517
|
2026/04/16-08:58:49.586323 7fc1d9fbd6c0 Recovering log #557
|
||||||
2026/01/19-20:23:50.506507 7f14d9ffb6c0 Delete type=3 #515
|
2026/04/16-08:58:49.596973 7fc1d9fbd6c0 Delete type=3 #555
|
||||||
2026/01/19-20:23:50.506583 7f14d9ffb6c0 Delete type=0 #517
|
2026/04/16-08:58:49.597026 7fc1d9fbd6c0 Delete type=0 #557
|
||||||
2026/01/19-20:32:02.950374 7f1243fff6c0 Level-0 table #522: started
|
2026/04/16-10:53:23.909144 7fc1d8fbb6c0 Level-0 table #562: started
|
||||||
2026/01/19-20:32:02.950415 7f1243fff6c0 Level-0 table #522: 0 bytes OK
|
2026/04/16-10:53:23.909174 7fc1d8fbb6c0 Level-0 table #562: 0 bytes OK
|
||||||
2026/01/19-20:32:02.956303 7f1243fff6c0 Delete type=0 #520
|
2026/04/16-10:53:23.915478 7fc1d8fbb6c0 Delete type=0 #560
|
||||||
2026/01/19-20:32:02.956488 7f1243fff6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
2026/04/16-10:53:23.921775 7fc1d8fbb6c0 Manual compaction at level-0 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||||
2026/01/19-20:32:02.956546 7f1243fff6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
2026/04/16-10:53:23.921804 7fc1d8fbb6c0 Manual compaction at level-1 from '!folders!mnO9OzE7BEE2KDfh' @ 72057594037927935 : 1 .. '!items!zkK6ixtCsCw3RH9X' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
296
styles/hud.less
296
styles/hud.less
@@ -35,10 +35,302 @@
|
|||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
width: max-content;
|
width: max-content;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color:#252424;
|
color: #252424;
|
||||||
}
|
}
|
||||||
|
|
||||||
#token-hud .hp-loss-wrap .hud-loss-hp-button-select {
|
#token-hud .hp-loss-wrap .hud-loss-hp-button-select {
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* HP Gain Styles */
|
||||||
|
#token-hud .hp-gain-wrap {
|
||||||
|
position: absolute;
|
||||||
|
left: 75px;
|
||||||
|
display: none;
|
||||||
|
top: 50%;
|
||||||
|
width: 48px;
|
||||||
|
text-align: start;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-wrap-col1 {
|
||||||
|
transform: translate(-200%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-wrap-col2 {
|
||||||
|
transform: translate(-300%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-wrap-col3 {
|
||||||
|
transform: translate(-400%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-hud-active {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-hud-disabled {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hud-gain-hp-button-select {
|
||||||
|
max-width: 40px;
|
||||||
|
background-image: var(--background-image-base);
|
||||||
|
padding-top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
width: max-content;
|
||||||
|
margin: 0;
|
||||||
|
color: #252424;
|
||||||
|
}
|
||||||
|
|
||||||
|
#token-hud .hp-gain-wrap .hud-gain-hp-button-select {
|
||||||
|
padding-left: 8px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------------- */
|
||||||
|
/* 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -467,7 +467,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 +477,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,11 @@
|
|||||||
<a data-action="armorHitPointsMinus"><i class="fa-solid fa-hexagon-minus"></i></a>
|
<a data-action="armorHitPointsMinus"><i class="fa-solid fa-hexagon-minus"></i></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flexrow armor-hp">
|
||||||
|
<span class="name" data-tooltip="{{localize 'LETHALFANTASY.Tooltip.combatProgressionStart'}}">{{localize "LETHALFANTASY.Label.combatProgressionStart"}}</span>
|
||||||
|
{{formInput systemFields.combat.fields.combatProgressionStart value=system.combat.combatProgressionStart disabled=isPlayMode }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flexrow granted">
|
<div class="flexrow granted">
|
||||||
<span class="">{{localize
|
<span class="">{{localize
|
||||||
"LETHALFANTASY.Label.grantedAttackDice"}}</a></span>
|
"LETHALFANTASY.Label.grantedAttackDice"}}</a></span>
|
||||||
|
|||||||
@@ -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}}
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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" }}
|
||||||
|
|||||||
43
templates/gain-hp-hud.hbs
Normal file
43
templates/gain-hp-hud.hbs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<div class="control-icon" data-action="lethal-gain-hp-hud">
|
||||||
|
<img
|
||||||
|
class="lethal-hp-gain-hud"
|
||||||
|
src="systems/fvtt-lethal-fantasy/assets/icons/health-increase.svg"
|
||||||
|
width="36"
|
||||||
|
height="36"
|
||||||
|
title="Restore HP"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div class="hp-gain-wrap hp-gain-wrap-col1 hp-gain-hud-disabled">
|
||||||
|
{{#for 1 11 1}}
|
||||||
|
<button
|
||||||
|
class="hud-gain-hp-button-select gain-hp-hud-click"
|
||||||
|
data-hp-value="{{this}}"
|
||||||
|
>
|
||||||
|
<span class="">+{{this}}</span>
|
||||||
|
</button>
|
||||||
|
{{/for}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="hp-gain-wrap hp-gain-wrap-col2 hp-gain-hud-disabled">
|
||||||
|
{{#for 11 21 1}}
|
||||||
|
<button
|
||||||
|
class="hud-gain-hp-button-select gain-hp-hud-click"
|
||||||
|
data-hp-value="{{this}}"
|
||||||
|
>
|
||||||
|
<span class="">+{{this}}</span>
|
||||||
|
</button>
|
||||||
|
{{/for}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="hp-gain-wrap hp-gain-wrap-col3 hp-gain-hud-disabled">
|
||||||
|
{{#for 21 31 1}}
|
||||||
|
<button
|
||||||
|
class="hud-gain-hp-button-select gain-hp-hud-click"
|
||||||
|
data-hp-value="{{this}}"
|
||||||
|
>
|
||||||
|
<span class="">+{{this}}</span>
|
||||||
|
</button>
|
||||||
|
{{/for}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
{{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}}
|
||||||
|
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|||||||
Reference in New Issue
Block a user