This commit is contained in:
@@ -609,7 +609,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
rollD30.total,
|
||||
options.rollType,
|
||||
options.rollTarget?.weapon,
|
||||
{ isRanged: isRangedForD30 }
|
||||
{ isRanged: isRangedForD30, isSpellSave: saveSpell }
|
||||
)
|
||||
options.D30message = d30Message
|
||||
}
|
||||
@@ -787,9 +787,18 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let buttons = []
|
||||
if (currentAction) {
|
||||
if (currentAction.type === "weapon") {
|
||||
let weaponLabel = "Roll progression dice"
|
||||
if (currentAction.rangedMode) {
|
||||
// Compute loading count from the speed formula (e.g. "3+1d6" → load=3)
|
||||
const speedStr = currentAction.system?.speed?.[currentAction.rangedMode] ?? ""
|
||||
const rangedLoad = currentAction.rangedLoad ?? (Number(speedStr.split("+")[0]) || 0)
|
||||
if (rangedLoad > 0 && !currentAction.weaponLoaded) {
|
||||
weaponLabel = "Load weapon"
|
||||
}
|
||||
}
|
||||
buttons.push({
|
||||
action: "roll",
|
||||
label: "Roll progression dice",
|
||||
label: weaponLabel,
|
||||
callback: (event, button) => {
|
||||
let pos = $('#combat-action-dialog').position()
|
||||
game.user.setFlag(SYSTEM.id, "combat-action-dialog-pos", pos)
|
||||
@@ -908,14 +917,15 @@ export default class LethalFantasyRoll extends Roll {
|
||||
if (rollContext === "rollLethargyDice") {
|
||||
if (currentAction.spellStatus === "castingTime") {
|
||||
let time = currentAction.type === "spell" ? currentAction.system.castingTime : currentAction.system.prayerTime
|
||||
if (currentAction.castingTime <= time) {
|
||||
if (currentAction.castingTime < time) {
|
||||
let message = `Casting time : ${currentAction.name}, count : ${currentAction.castingTime}/${time}`
|
||||
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||
currentAction.castingTime += 1
|
||||
await combatant.setFlag(SYSTEM.id, "currentAction", foundry.utils.duplicate(currentAction))
|
||||
return
|
||||
} else {
|
||||
let message = `Spell/Miracle ${currentAction.name} ready to be cast on next second !`
|
||||
// Last counting second — announce ready and transition immediately (no extra second consumed)
|
||||
let message = `Casting time : ${currentAction.name}, count : ${time}/${time} — ready to cast next second !`
|
||||
ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: combatant.actor }) })
|
||||
currentAction.castingTime = 1
|
||||
currentAction.spellStatus = "toBeCasted"
|
||||
|
||||
Reference in New Issue
Block a user