From fdd72e9375e968f69189debd380d5bdbfa3cbb1c Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Tue, 15 Apr 2025 20:29:56 +0200 Subject: [PATCH] Fix reset progression roll --- module/applications/combat.mjs | 12 +++---- module/documents/roll.mjs | 32 +++++++++--------- .../lf-equipment/{000197.log => 000205.log} | 0 packs-system/lf-equipment/CURRENT | 2 +- packs-system/lf-equipment/LOG | 16 ++++----- packs-system/lf-equipment/LOG.old | 16 ++++----- .../{MANIFEST-000195 => MANIFEST-000203} | Bin 176 -> 176 bytes .../lf-gifts/{000196.log => 000204.log} | 0 packs-system/lf-gifts/CURRENT | 2 +- packs-system/lf-gifts/LOG | 16 ++++----- packs-system/lf-gifts/LOG.old | 16 ++++----- packs-system/lf-gifts/MANIFEST-000194 | Bin 140 -> 0 bytes packs-system/lf-gifts/MANIFEST-000202 | Bin 0 -> 140 bytes .../lf-skills/{000196.log => 000204.log} | 0 packs-system/lf-skills/CURRENT | 2 +- packs-system/lf-skills/LOG | 16 ++++----- packs-system/lf-skills/LOG.old | 16 ++++----- packs-system/lf-skills/MANIFEST-000194 | Bin 141 -> 0 bytes packs-system/lf-skills/MANIFEST-000202 | Bin 0 -> 141 bytes .../{000196.log => 000204.log} | 0 packs-system/lf-vulnerabilities/CURRENT | 2 +- packs-system/lf-vulnerabilities/LOG | 16 ++++----- packs-system/lf-vulnerabilities/LOG.old | 16 ++++----- .../{MANIFEST-000194 => MANIFEST-000202} | Bin 141 -> 141 bytes 24 files changed, 90 insertions(+), 90 deletions(-) rename packs-system/lf-equipment/{000197.log => 000205.log} (100%) rename packs-system/lf-equipment/{MANIFEST-000195 => MANIFEST-000203} (72%) rename packs-system/lf-gifts/{000196.log => 000204.log} (100%) delete mode 100644 packs-system/lf-gifts/MANIFEST-000194 create mode 100644 packs-system/lf-gifts/MANIFEST-000202 rename packs-system/lf-skills/{000196.log => 000204.log} (100%) delete mode 100644 packs-system/lf-skills/MANIFEST-000194 create mode 100644 packs-system/lf-skills/MANIFEST-000202 rename packs-system/lf-vulnerabilities/{000196.log => 000204.log} (100%) rename packs-system/lf-vulnerabilities/{MANIFEST-000194 => MANIFEST-000202} (71%) diff --git a/module/applications/combat.mjs b/module/applications/combat.mjs index 5de7f19..612346f 100644 --- a/module/applications/combat.mjs +++ b/module/applications/combat.mjs @@ -12,7 +12,7 @@ export class LethalFantasyCombatTracker extends CombatTracker { console.log("Combat Data", data); return data; } - + activateListeners(html) { super.activateListeners(html); // Display Combat settings @@ -23,6 +23,7 @@ export class LethalFantasyCombatTracker extends CombatTracker { c.update({ 'initiative': c.initiative + 1 }); console.log("Initiative Plus"); }); + html.find(".initiative-minus").click(ev => { ev.preventDefault(); let cId = ev.currentTarget.closest(".combatant").dataset.combatantId; @@ -131,7 +132,7 @@ export class LethalFantasyCombat extends Combat { let advanceTime = Math.max(this.turns.length - this.turn, 0) * CONFIG.time.turnTime; advanceTime += CONFIG.time.roundTime; let nextRound = this.round + 1; - + let initOK = true; for (let c of this.combatants) { if (c.initiative === null) { @@ -140,10 +141,10 @@ export class LethalFantasyCombat extends Combat { } } if (!initOK) { - ui.notifications.error("All combatants must have initiative rolled before the round can advance."); + ui.notifications.error("All combatants must have initiative rolled before the round can advance."); return this; } - + for (let c of this.combatants) { if ( nextRound >= c.initiative) { c.update({ 'system.progressionCount': c.system.progressionCount + 1 }); @@ -153,7 +154,7 @@ export class LethalFantasyCombat extends Combat { } else { user = game.users.find(u => u.active && u.isGM); c.actor.system.rollProgressionDice(this.id, c.id, c.system.progressionCount+1); - } + } } } @@ -169,4 +170,3 @@ export class LethalFantasyCombat extends Combat { return a.initiative - b.initiative; } } - diff --git a/module/documents/roll.mjs b/module/documents/roll.mjs index ab01c2c..5dc9e3c 100644 --- a/module/documents/roll.mjs +++ b/module/documents/roll.mjs @@ -237,25 +237,25 @@ export default class LethalFantasyRoll extends Roll { hasStaticModifier = options.rollType === "spell-power" hasModifier = options.rollType !== "miracle-attack" options.rollTarget.staticModifier = options.rollTarget.actorLevel - + } else if (options.rollType === "shield-roll") { - hasD30 = false + hasD30 = false options.rollName = "Shield Defense" dice = options.rollTarget.system.defense.toUpperCase() - baseFormula = dice + baseFormula = dice hasModifier = true hasChangeDice = false hasMaxValue = false hasExplode = false options.rollTarget.value = 0 - + } else if (options.rollType.includes("weapon-damage")) { options.rollName = options.rollTarget.name hasModifier = true hasChangeDice = false let damageBonus = (options.rollTarget.weapon.system.applyStrengthDamageBonus) ? options.rollTarget.combat.damageModifier : 0 options.rollTarget.value = damageBonus + options.rollTarget.weaponSkillModifier + options.rollTarget.weapon.system.bonuses.damageBonus - options.rollTarget.charModifier = damageBonus + options.rollTarget.charModifier = damageBonus if (options.rollType.includes("small")) { dice = options.rollTarget.weapon.system.damage.damageS } else { @@ -423,7 +423,7 @@ export default class LethalFantasyRoll extends Roll { /** * A hook event that fires before the roll is made. - * @function + * @function * @memberof hookEvents * @param {Object} options Options for the roll. * @param {Object} rollData All data related to the roll. @@ -530,7 +530,7 @@ export default class LethalFantasyRoll extends Roll { /** * A hook event that fires after the roll has been made. - * @function + * @function * @memberof hookEvents * @param {Object} options Options for the roll. * @param {Object} rollData All data related to the roll. @@ -651,7 +651,7 @@ export default class LethalFantasyRoll extends Roll { if (rollContext === null || !rollContext?.progressionDiceId) { let combat = game.combats.get(options.combatId) let combatant = combat.combatants.get(options.combatantId) - combatant.update({ 'system.progressionCount': 1 }) + combatant.update({ 'system.progressionCount': 0 }) return } @@ -680,15 +680,15 @@ export default class LethalFantasyRoll extends Roll { let message = `Spell casting time : ${spell.name}, count : ${options.rollProgressionCount}/${spell.system.castingTime}` ChatMessage.create({ content: message, speaker: ChatMessage.getSpeaker({ actor: actor }) }) return - } + } let formula = dice let roll = new Roll(formula) await roll.evaluate() let max = roll.dice[0].faces - 1 let toCompare = Math.min(options.rollProgressionCount-spell.system.castingTime, max) - let message + let message if (roll.total > toCompare) { - message = `Spell Lethargy ongoing ... (${roll.total}/${toCompare}, spell level ${spell.system.level})` + message = `Spell Lethargy ongoing ... (${roll.total}/${toCompare}, spell level ${spell.system.level})` } else { let combat = game.combats.get(options.combatId) combat.resetProgression(options.combatantId) @@ -697,7 +697,7 @@ export default class LethalFantasyRoll extends Roll { let msg = await roll.toMessage({ flavor: message }, { rollMode: rollContext.visibility }) if (game?.dice3d) { await game.dice3d.waitFor3DAnimationByMessageID(msg.id) - } + } return } @@ -709,8 +709,8 @@ export default class LethalFantasyRoll extends Roll { let toSplit = weapon.system.speed[rangedMode] let split = toSplit.split("+") rangedLoad = Number(split[0]) || 0 - formula = split[1] - console.log("Ranged Mode", rangedMode, rangedLoad, formula, options.rollProgressionCount) + formula = split[1] + console.log("Ranged Mode", rangedMode, rangedLoad, formula, options.rollProgressionCount) } if (rangedLoad && options.rollProgressionCount <= rangedLoad ) { @@ -859,7 +859,7 @@ export default class LethalFantasyRoll extends Roll { /** * A hook event that fires after the roll has been made. - * @function + * @function * @memberof hookEvents * @param {Object} options Options for the roll. * @param {Object} rollData All data related to the roll. @@ -910,7 +910,7 @@ export default class LethalFantasyRoll extends Roll { /** @override */ async render(chatOptions = {}) { let chatData = await this._getChatCardData(chatOptions.isPrivate) - console.log("ChatData", chatData) + console.log("ChatData", chatData) return await renderTemplate(this.constructor.CHAT_TEMPLATE, chatData) } diff --git a/packs-system/lf-equipment/000197.log b/packs-system/lf-equipment/000205.log similarity index 100% rename from packs-system/lf-equipment/000197.log rename to packs-system/lf-equipment/000205.log diff --git a/packs-system/lf-equipment/CURRENT b/packs-system/lf-equipment/CURRENT index 6504cac..183d782 100644 --- a/packs-system/lf-equipment/CURRENT +++ b/packs-system/lf-equipment/CURRENT @@ -1 +1 @@ -MANIFEST-000195 +MANIFEST-000203 diff --git a/packs-system/lf-equipment/LOG b/packs-system/lf-equipment/LOG index 4d5f239..4ca40b4 100644 --- a/packs-system/lf-equipment/LOG +++ b/packs-system/lf-equipment/LOG @@ -1,8 +1,8 @@ -2025/04/06-22:37:25.011079 7f9c6bfff6c0 Recovering log #193 -2025/04/06-22:37:25.094778 7f9c6bfff6c0 Delete type=3 #191 -2025/04/06-22:37:25.094854 7f9c6bfff6c0 Delete type=0 #193 -2025/04/06-23:13:03.158258 7f9c69bff6c0 Level-0 table #198: started -2025/04/06-23:13:03.158304 7f9c69bff6c0 Level-0 table #198: 0 bytes OK -2025/04/06-23:13:03.165495 7f9c69bff6c0 Delete type=0 #196 -2025/04/06-23:13:03.185973 7f9c69bff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end) -2025/04/06-23:13:03.186054 7f9c69bff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end) +2025/04/15-20:28:27.909693 7f5c827fc6c0 Recovering log #201 +2025/04/15-20:28:27.920405 7f5c827fc6c0 Delete type=3 #199 +2025/04/15-20:28:27.920498 7f5c827fc6c0 Delete type=0 #201 +2025/04/15-20:29:29.823399 7f5c81bff6c0 Level-0 table #206: started +2025/04/15-20:29:29.823453 7f5c81bff6c0 Level-0 table #206: 0 bytes OK +2025/04/15-20:29:29.855733 7f5c81bff6c0 Delete type=0 #204 +2025/04/15-20:29:29.869881 7f5c81bff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end) +2025/04/15-20:29:29.899952 7f5c81bff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end) diff --git a/packs-system/lf-equipment/LOG.old b/packs-system/lf-equipment/LOG.old index 401becd..fa7c909 100644 --- a/packs-system/lf-equipment/LOG.old +++ b/packs-system/lf-equipment/LOG.old @@ -1,8 +1,8 @@ -2025/04/06-22:20:18.232271 7f9c6bfff6c0 Recovering log #189 -2025/04/06-22:20:18.242369 7f9c6bfff6c0 Delete type=3 #187 -2025/04/06-22:20:18.242439 7f9c6bfff6c0 Delete type=0 #189 -2025/04/06-22:35:41.370139 7f9c69bff6c0 Level-0 table #194: started -2025/04/06-22:35:41.370201 7f9c69bff6c0 Level-0 table #194: 0 bytes OK -2025/04/06-22:35:41.376766 7f9c69bff6c0 Delete type=0 #192 -2025/04/06-22:35:41.396242 7f9c69bff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end) -2025/04/06-22:35:41.396304 7f9c69bff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end) +2025/04/15-20:12:44.848433 7f5c83fff6c0 Recovering log #197 +2025/04/15-20:12:44.863682 7f5c83fff6c0 Delete type=3 #195 +2025/04/15-20:12:44.863747 7f5c83fff6c0 Delete type=0 #197 +2025/04/15-20:17:42.198359 7f5c81bff6c0 Level-0 table #202: started +2025/04/15-20:17:42.198471 7f5c81bff6c0 Level-0 table #202: 0 bytes OK +2025/04/15-20:17:42.205479 7f5c81bff6c0 Delete type=0 #200 +2025/04/15-20:17:42.225325 7f5c81bff6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end) +2025/04/15-20:17:42.225430 7f5c81bff6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!znm6T1ef4qQI8BX7' @ 0 : 0; will stop at (end) diff --git a/packs-system/lf-equipment/MANIFEST-000195 b/packs-system/lf-equipment/MANIFEST-000203 similarity index 72% rename from packs-system/lf-equipment/MANIFEST-000195 rename to packs-system/lf-equipment/MANIFEST-000203 index 1f60d87f34d9d11f9c0758a1aaac60a67e41b030..e63e2ff37826566b50da631090d506ddc149170b 100644 GIT binary patch delta 41 scmdnMxPfs(pHh&UPYV|VBhwj1P6p<)j4WXbcidY85;zMII1dy60Qpr54FCWD delta 41 scmdnMxPfs(pVHfn>r%NG7@3YRaxyRAfv#~i15;zJHI1Us501$->6aWAK diff --git a/packs-system/lf-gifts/000196.log b/packs-system/lf-gifts/000204.log similarity index 100% rename from packs-system/lf-gifts/000196.log rename to packs-system/lf-gifts/000204.log diff --git a/packs-system/lf-gifts/CURRENT b/packs-system/lf-gifts/CURRENT index 1e046e0..5639343 100644 --- a/packs-system/lf-gifts/CURRENT +++ b/packs-system/lf-gifts/CURRENT @@ -1 +1 @@ -MANIFEST-000194 +MANIFEST-000202 diff --git a/packs-system/lf-gifts/LOG b/packs-system/lf-gifts/LOG index 08cf9fb..457df4c 100644 --- a/packs-system/lf-gifts/LOG +++ b/packs-system/lf-gifts/LOG @@ -1,8 +1,8 @@ -2025/04/06-22:37:25.097825 7f9c6affd6c0 Recovering log #192 -2025/04/06-22:37:25.151383 7f9c6affd6c0 Delete type=3 #190 -2025/04/06-22:37:25.151444 7f9c6affd6c0 Delete type=0 #192 -2025/04/06-23:13:03.179786 7f9c69bff6c0 Level-0 table #197: started -2025/04/06-23:13:03.179809 7f9c69bff6c0 Level-0 table #197: 0 bytes OK -2025/04/06-23:13:03.185776 7f9c69bff6c0 Delete type=0 #195 -2025/04/06-23:13:03.186038 7f9c69bff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end) -2025/04/06-23:13:03.186106 7f9c69bff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end) +2025/04/15-20:28:27.924832 7f5c83fff6c0 Recovering log #200 +2025/04/15-20:28:27.935942 7f5c83fff6c0 Delete type=3 #198 +2025/04/15-20:28:27.936056 7f5c83fff6c0 Delete type=0 #200 +2025/04/15-20:29:29.646786 7f5c81bff6c0 Level-0 table #205: started +2025/04/15-20:29:29.646851 7f5c81bff6c0 Level-0 table #205: 0 bytes OK +2025/04/15-20:29:29.673575 7f5c81bff6c0 Delete type=0 #203 +2025/04/15-20:29:29.759542 7f5c81bff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end) +2025/04/15-20:29:29.759654 7f5c81bff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end) diff --git a/packs-system/lf-gifts/LOG.old b/packs-system/lf-gifts/LOG.old index 5bbafe5..add613c 100644 --- a/packs-system/lf-gifts/LOG.old +++ b/packs-system/lf-gifts/LOG.old @@ -1,8 +1,8 @@ -2025/04/06-22:20:18.244978 7f9c6a7fc6c0 Recovering log #188 -2025/04/06-22:20:18.255487 7f9c6a7fc6c0 Delete type=3 #186 -2025/04/06-22:20:18.255607 7f9c6a7fc6c0 Delete type=0 #188 -2025/04/06-22:35:41.389186 7f9c69bff6c0 Level-0 table #193: started -2025/04/06-22:35:41.389226 7f9c69bff6c0 Level-0 table #193: 0 bytes OK -2025/04/06-22:35:41.396058 7f9c69bff6c0 Delete type=0 #191 -2025/04/06-22:35:41.396288 7f9c69bff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end) -2025/04/06-22:35:41.396321 7f9c69bff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end) +2025/04/15-20:12:44.869154 7f5c82ffd6c0 Recovering log #196 +2025/04/15-20:12:44.884227 7f5c82ffd6c0 Delete type=3 #194 +2025/04/15-20:12:44.884371 7f5c82ffd6c0 Delete type=0 #196 +2025/04/15-20:17:42.205662 7f5c81bff6c0 Level-0 table #201: started +2025/04/15-20:17:42.205704 7f5c81bff6c0 Level-0 table #201: 0 bytes OK +2025/04/15-20:17:42.212053 7f5c81bff6c0 Delete type=0 #199 +2025/04/15-20:17:42.225357 7f5c81bff6c0 Manual compaction at level-0 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end) +2025/04/15-20:17:42.225453 7f5c81bff6c0 Manual compaction at level-1 from '!folders!yPWGvxHJbDNHVSnY' @ 72057594037927935 : 1 .. '!items!zjvGljrLk5SshC9D' @ 0 : 0; will stop at (end) diff --git a/packs-system/lf-gifts/MANIFEST-000194 b/packs-system/lf-gifts/MANIFEST-000194 deleted file mode 100644 index 0af4af3fee24f180f2af8debfb3dc37dfb36f5e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 140 zcmZQ=x?Pvdz{n_-lUkOVlai$8R9TW*o>`pgoS$2eSd>_jU&PL2x}i)_F)cqQCAFwn zu`(dsy{y8+E6K&rBP=*Cl2L&H4CECvOHy--6|1t!+;g&ue6mf0i!+=pT^Ly)@+=-2 f0$dD?Ootgc8JLeSvMBtXE*1$AI06zl1{44Q;)o@g diff --git a/packs-system/lf-gifts/MANIFEST-000202 b/packs-system/lf-gifts/MANIFEST-000202 new file mode 100644 index 0000000000000000000000000000000000000000..4a2048b65eb940f93fe9e950c4bdcfd4e6472f9e GIT binary patch literal 140 zcmZQ=x?Pvdz{n_-lUkOVlai$8R9TW*o>`pgoS$2eSd>_jU&PL2x}i)_F)cqQCAFwn zu`(dsy{y8+E6K&rBP=*Cl2L&H4CECvOHy--6|1t!+;g&ue6mf0i!+=pT^Ly)^3rQg fedJ}8ygt#nI;;~5tNBhzU{P6p;Pj4U!wx0qRj1kQj2&H)7g>NyG5 delta 41 rcmeBW>}8ygt>ilK6*CtDBhz6