Add rituals !
Some checks failed
Release Creation / build (release) Failing after 44s

This commit is contained in:
LeRatierBretonnien 2025-04-25 00:26:28 +02:00
parent a43bebc63b
commit b21c5ac9bb
12 changed files with 54 additions and 39 deletions

View File

@ -147,6 +147,24 @@ export default class CthulhuEternalRoll extends Roll {
options.isNudge = false
break
case "damage":
let isLethal = false
options.isNudge = false
if (options.rollItem.system.lethality > 0) {
let lethalityRoll = new Roll("1d100")
await lethalityRoll.evaluate()
isLethal = (lethalityRoll.total <= options.rollItem.system.lethality)
let flavor = `${options.rollItem.name} - <strong>Lethality Roll</strong> : ${lethalityRoll.total} <= ${options.rollItem.system.lethality} => ${isLethal}`
if ( isLethal) {
flavor += `<br>The target is lethally wounded => HP = 0`
} else {
let wounds = Math.floor(lethalityRoll.total/10) + (lethalityRoll.total % 10)
flavor += `<br>The target is not lethally wounded => HP loss = ${wounds}`
}
await lethalityRoll.toMessage({
flavor:flavor
});
return
}
let formula = options.rollItem.system.damage
if ( options.rollItem.system.weaponType === "melee" || options.rollItem.system.weaponType === "unarmed") {
formula += ` + ${options.rollItem.damageBonus}`
@ -156,16 +174,6 @@ export default class CthulhuEternalRoll extends Roll {
await damageRoll.toMessage({
flavor: `${options.rollItem.name} - Damage Roll`
});
let isLethal = false
options.isNudge = false
if (options.rollItem.system.lethality > 0) {
let lethalityRoll = new Roll("1d100")
await lethalityRoll.evaluate()
isLethal = (lethalityRoll.total <= options.rollItem.system.lethality)
await lethalityRoll.toMessage({
flavor: `${options.rollItem.name} - Lethality Roll : ${lethalityRoll.total} <= ${options.rollItem.system.lethality} => ${isLethal}`
});
}
return
case "weapon":
let era = game.settings.get("fvtt-cthulhu-eternal", "settings-era")
@ -186,7 +194,7 @@ export default class CthulhuEternalRoll extends Roll {
options.initialScore = options.weapon.system.directSkillValue
} else {
let skillName = game.i18n.localize(SYSTEM.WEAPON_SKILL_MAPPING[era][options.rollItem.system.weaponType])
let actor = game.actors.get(options.actorId)
let actor = game.actors.get(options.actorId)
options.rollItem = actor.items.find(i => i.type === "skill" && i.name.toLowerCase() === skillName.toLowerCase())
if (!options.rollItem) {
ui.notifications.error(game.i18n.localize("CTHULHUETERNAL.Notifications.NoWeaponSkill"))
@ -321,19 +329,19 @@ export default class CthulhuEternalRoll extends Roll {
let unit = this.total - (dec * 10)
if (this.total <= rollData.targetScore) {
resultType = "success"
// Detect if decimal == unit in the dire total result
// Detect if decimal == unit in the dire total result
if (dec === unit || this.total === 1) {
resultType = "successCritical"
}
} else {
// Detect if decimal == unit in the dire total result
// Detect if decimal == unit in the dire total result
if (dec === unit || this.total === 100) {
resultType = "failureCritical"
}
}
this.options.resultType = resultType
if (this.options.isNudgedRoll) {
if (this.options.isNudgedRoll) {
this.options.isSuccess = resultType === "success" || resultType === "successCritical"
this.options.isFailure = resultType === "failure" || resultType === "failureCritical"
this.options.isCritical = false

View File

@ -1 +1 @@
MANIFEST-000002
MANIFEST-000010

View File

@ -1,5 +1,8 @@
2025/04/24-23:51:45.159777 7fd07ffff6c0 Delete type=3 #1
2025/04/24-23:53:49.085539 7fd07effd6c0 Level-0 table #5: started
2025/04/24-23:53:49.093043 7fd07effd6c0 Level-0 table #5: 60804 bytes OK
2025/04/24-23:53:49.104293 7fd07effd6c0 Delete type=0 #3
2025/04/24-23:53:49.119460 7fd07effd6c0 Manual compaction at level-0 from '!items!4oyPRBWPBWAChrJP' @ 72057594037927935 : 1 .. '!items!zVFfp3o0G0Zg3Ia4' @ 0 : 0; will stop at (end)
2025/04/25-00:23:55.566074 7fd0855fa6c0 Recovering log #8
2025/04/25-00:23:55.627155 7fd0855fa6c0 Delete type=3 #6
2025/04/25-00:23:55.627214 7fd0855fa6c0 Delete type=0 #8
2025/04/25-00:24:39.296644 7fd07effd6c0 Level-0 table #13: started
2025/04/25-00:24:39.296707 7fd07effd6c0 Level-0 table #13: 0 bytes OK
2025/04/25-00:24:39.302890 7fd07effd6c0 Delete type=0 #11
2025/04/25-00:24:39.309638 7fd07effd6c0 Manual compaction at level-0 from '!items!4oyPRBWPBWAChrJP' @ 72057594037927935 : 1 .. '!items!zVFfp3o0G0Zg3Ia4' @ 0 : 0; will stop at (end)
2025/04/25-00:24:39.309671 7fd07effd6c0 Manual compaction at level-1 from '!items!4oyPRBWPBWAChrJP' @ 72057594037927935 : 1 .. '!items!zVFfp3o0G0Zg3Ia4' @ 0 : 0; will stop at (end)

View File

@ -0,0 +1,8 @@
2025/04/24-23:56:15.236151 7fd0855fa6c0 Recovering log #4
2025/04/24-23:56:15.247158 7fd0855fa6c0 Delete type=0 #4
2025/04/24-23:56:15.247228 7fd0855fa6c0 Delete type=3 #2
2025/04/25-00:23:51.709456 7fd07effd6c0 Level-0 table #9: started
2025/04/25-00:23:51.709498 7fd07effd6c0 Level-0 table #9: 0 bytes OK
2025/04/25-00:23:51.747489 7fd07effd6c0 Delete type=0 #7
2025/04/25-00:23:51.747677 7fd07effd6c0 Manual compaction at level-0 from '!items!4oyPRBWPBWAChrJP' @ 72057594037927935 : 1 .. '!items!zVFfp3o0G0Zg3Ia4' @ 0 : 0; will stop at (end)
2025/04/25-00:23:51.809910 7fd07effd6c0 Manual compaction at level-1 from '!items!4oyPRBWPBWAChrJP' @ 72057594037927935 : 1 .. '!items!zVFfp3o0G0Zg3Ia4' @ 0 : 0; will stop at (end)

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
MANIFEST-000166
MANIFEST-000174

View File

@ -1,7 +1,7 @@
2025/04/24-23:51:44.995311 7fd07f7fe6c0 Recovering log #163
2025/04/24-23:51:45.086446 7fd07f7fe6c0 Delete type=3 #161
2025/04/24-23:51:45.086502 7fd07f7fe6c0 Delete type=0 #163
2025/04/24-23:53:49.104456 7fd07effd6c0 Level-0 table #169: started
2025/04/24-23:53:49.104482 7fd07effd6c0 Level-0 table #169: 0 bytes OK
2025/04/24-23:53:49.119303 7fd07effd6c0 Delete type=0 #167
2025/04/24-23:53:49.119472 7fd07effd6c0 Manual compaction at level-0 from '!folders!5PrT9QmN1cFPzDFP' @ 72057594037927935 : 1 .. '!items!zvoUByzWSWZ87fxA' @ 0 : 0; will stop at (end)
2025/04/25-00:23:55.465639 7fd07f7fe6c0 Recovering log #172
2025/04/25-00:23:55.561118 7fd07f7fe6c0 Delete type=3 #170
2025/04/25-00:23:55.561198 7fd07f7fe6c0 Delete type=0 #172
2025/04/25-00:24:39.302991 7fd07effd6c0 Level-0 table #177: started
2025/04/25-00:24:39.303023 7fd07effd6c0 Level-0 table #177: 0 bytes OK
2025/04/25-00:24:39.309509 7fd07effd6c0 Delete type=0 #175
2025/04/25-00:24:39.309652 7fd07effd6c0 Manual compaction at level-0 from '!folders!5PrT9QmN1cFPzDFP' @ 72057594037927935 : 1 .. '!items!zvoUByzWSWZ87fxA' @ 0 : 0; will stop at (end)

View File

@ -1,11 +1,7 @@
2025/04/24-23:05:51.238532 7fd084df96c0 Delete type=3 #1
2025/04/24-23:51:01.552587 7fd07effd6c0 Level-0 table #164: started
2025/04/24-23:51:01.552623 7fd07effd6c0 Level-0 table #164: 0 bytes OK
2025/04/24-23:51:01.558928 7fd07effd6c0 Delete type=0 #162
2025/04/24-23:51:01.559084 7fd07effd6c0 Manual compaction at level-0 from '!folders!5PrT9QmN1cFPzDFP' @ 72057594037927935 : 1 .. '!items!zvoUByzWSWZ87fxA' @ 0 : 0; will stop at '!items!zvoUByzWSWZ87fxA' @ 526 : 1
2025/04/24-23:51:01.559089 7fd07effd6c0 Compacting 1@0 + 0@1 files
2025/04/24-23:51:01.565483 7fd07effd6c0 Generated table #165@0: 548 keys, 311006 bytes
2025/04/24-23:51:01.565520 7fd07effd6c0 Compacted 1@0 + 0@1 files => 311006 bytes
2025/04/24-23:51:01.572344 7fd07effd6c0 compacted to: files[ 0 1 0 0 0 0 0 ]
2025/04/24-23:51:01.572607 7fd07effd6c0 Delete type=2 #152
2025/04/24-23:51:01.585776 7fd07effd6c0 Manual compaction at level-0 from '!items!zvoUByzWSWZ87fxA' @ 526 : 1 .. '!items!zvoUByzWSWZ87fxA' @ 0 : 0; will stop at (end)
2025/04/24-23:56:15.221751 7fd07f7fe6c0 Recovering log #168
2025/04/24-23:56:15.231420 7fd07f7fe6c0 Delete type=0 #168
2025/04/24-23:56:15.231515 7fd07f7fe6c0 Delete type=3 #166
2025/04/25-00:23:51.673765 7fd07effd6c0 Level-0 table #173: started
2025/04/25-00:23:51.673830 7fd07effd6c0 Level-0 table #173: 0 bytes OK
2025/04/25-00:23:51.709271 7fd07effd6c0 Delete type=0 #171
2025/04/25-00:23:51.747663 7fd07effd6c0 Manual compaction at level-0 from '!folders!5PrT9QmN1cFPzDFP' @ 72057594037927935 : 1 .. '!items!zvoUByzWSWZ87fxA' @ 0 : 0; will stop at (end)