2 Commits

Author SHA1 Message Date
c180365a61 Add optionnal modifier
All checks were successful
Release Creation / build (release) Successful in 1m17s
2025-10-27 20:07:22 +00:00
ace607d05c Add optionnal modifier 2025-10-27 20:06:24 +00:00
14 changed files with 62 additions and 31 deletions

View File

@@ -495,6 +495,7 @@
"max": "Max",
"maximum": "Maximum",
"modifier": "Modifier",
"numericModifier": "Additionnal Modifier",
"multiplier": "Multiplier",
"newArmor": "New Armor",
"newWeapon": "New Weapon",

View File

@@ -144,6 +144,20 @@ export const MODIFIER_CHOICES = {
"impossible6": { id: "impossible6", label: "FTLNOMAD.Label.Impossible6", value: "-6" }
}
export const NUMERIC_MODIFIER_CHOICES = {
"-5": { label: "-5", value: -5 },
"-4": { label: "-4", value: -4 },
"-3": { label: "-3", value: -3 },
"-2": { label: "-2", value: -2 },
"-1": { label: "-1", value: -1 },
"0": { label: "0", value: 0 },
"+1": { label: "+1", value: 1 },
"+2": { label: "+2", value: 2 },
"+3": { label: "+3", value: 3 },
"+4": { label: "+4", value: 4 },
"+5": { label: "+5", value: 5 }
}
export const STARSHIP_HULL = {
"pod": { id: "pod", label: "FTLNOMAD.Starship.Hull.Pod" },
"micro": { id: "micro", label: "FTLNOMAD.Starship.Hull.Micro" },
@@ -163,6 +177,7 @@ export const STARSHIP_HULL = {
export const SYSTEM = {
id: SYSTEM_ID,
MODIFIER_CHOICES,
NUMERIC_MODIFIER_CHOICES,
ATTACK_MODIFIERS,
TECH_AGES,
WEAPON_TYPES,

View File

@@ -66,7 +66,7 @@ export default class FTLNomadRoll extends Roll {
fullFormula = `${options.formula} + ${options.damageModifier}D6 `
} else {
let mod = options.rollItem?.value || 0
fullFormula = `${options.formula} + ${options.skillModifier}D + ${mod} + ${options.rangeModifier}D + ${options.numericModifier}D`
fullFormula = `${options.formula} + ${options.skillModifier}D + ${mod} + ${options.rangeModifier}D + ${options.numericModifier}D + ${options.numericModifierSelect}`
}
// Replace all the "+ -" with "-"
fullFormula = fullFormula.replace(/\+\s*\-/g, "- ")
@@ -116,6 +116,7 @@ export default class FTLNomadRoll extends Roll {
})
const choiceModifier = SYSTEM.MODIFIER_CHOICES
const choiceNumericModifier = SYSTEM.NUMERIC_MODIFIER_CHOICES
let choiceRangeModifier = {}
let rangeModifier = 0
if (options.weapon) {
@@ -129,8 +130,10 @@ export default class FTLNomadRoll extends Roll {
let damageModifier = "0"
let modifier = "0"
let numericModifierSelect = 0
options.skillModifier = 0
options.numericModifier = 0
options.numericModifierSelect = 0
options.rangeModifier = rangeModifier
options.damageModifier = damageModifier
let fullFormula = `${formula} + ${options.rollItem.value}`
@@ -152,6 +155,7 @@ export default class FTLNomadRoll extends Roll {
rollModes,
fieldRollMode,
choiceModifier,
choiceNumericModifier,
choiceRangeModifier,
choiceDamageModifier,
rangeModifier,
@@ -159,6 +163,7 @@ export default class FTLNomadRoll extends Roll {
formula,
hasTarget: options.hasTarget,
modifier,
numericModifierSelect,
}
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-ftl-nomad/templates/roll-dialog.hbs", dialogContext)
@@ -189,6 +194,10 @@ export default class FTLNomadRoll extends Roll {
options.skillModifier = Number(event.target.value)
FTLNomadRoll.updateFullFormula(options)
})
$(".roll-numeric-modifier").change(event => {
options.numericModifierSelect = Number(event.target.value)
FTLNomadRoll.updateFullFormula(options)
})
$(".roll-damage-modifier").change(event => {
options.damageModifier = Number(event.target.value)
FTLNomadRoll.updateFullFormula(options)
@@ -223,8 +232,10 @@ export default class FTLNomadRoll extends Roll {
options.numericModifier = Number(rollData.numericModifier) || 0
options.skillModifier = Number(rollData.skillModifier) || 0
options.rangeModifier = Number(rollData.rangeModifier) || 0
options.numericModifierSelect = Number(rollData.numericModifierSelect) || 0
options.finalModifier = options.numericModifier + options.skillModifier + options.rangeModifier
let mod = options.rollItem?.value || 0
mod += options.numericModifierSelect
// Build the dice formula
let diceFormula = "2d6"

View File

@@ -1 +1 @@
MANIFEST-000099
MANIFEST-000107

View File

@@ -1,7 +1,7 @@
2025/10/18-17:56:08.077097 7f7b75bfa6c0 Recovering log #97
2025/10/18-17:56:08.086491 7f7b75bfa6c0 Delete type=3 #95
2025/10/18-17:56:08.086541 7f7b75bfa6c0 Delete type=0 #97
2025/10/18-18:03:15.510704 7f7b6f3ff6c0 Level-0 table #102: started
2025/10/18-18:03:15.510749 7f7b6f3ff6c0 Level-0 table #102: 0 bytes OK
2025/10/18-18:03:15.548325 7f7b6f3ff6c0 Delete type=0 #100
2025/10/18-18:03:15.624002 7f7b6f3ff6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)
2025/10/27-20:06:28.536125 7f2a23fff6c0 Recovering log #105
2025/10/27-20:06:28.547660 7f2a23fff6c0 Delete type=3 #103
2025/10/27-20:06:28.547796 7f2a23fff6c0 Delete type=0 #105
2025/10/27-20:07:11.806730 7f2a213ff6c0 Level-0 table #110: started
2025/10/27-20:07:11.806798 7f2a213ff6c0 Level-0 table #110: 0 bytes OK
2025/10/27-20:07:11.813240 7f2a213ff6c0 Delete type=0 #108
2025/10/27-20:07:11.813543 7f2a213ff6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)

View File

@@ -1,7 +1,7 @@
2025/10/16-19:48:48.571698 7f18a4ffa6c0 Recovering log #93
2025/10/16-19:48:48.582163 7f18a4ffa6c0 Delete type=3 #91
2025/10/16-19:48:48.582233 7f18a4ffa6c0 Delete type=0 #93
2025/10/16-19:50:49.674486 7f189e7fc6c0 Level-0 table #98: started
2025/10/16-19:50:49.674520 7f189e7fc6c0 Level-0 table #98: 0 bytes OK
2025/10/16-19:50:49.681475 7f189e7fc6c0 Delete type=0 #96
2025/10/16-19:50:49.691929 7f189e7fc6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)
2025/10/27-20:03:18.716726 7f2a22ffd6c0 Recovering log #101
2025/10/27-20:03:18.728612 7f2a22ffd6c0 Delete type=3 #99
2025/10/27-20:03:18.728755 7f2a22ffd6c0 Delete type=0 #101
2025/10/27-20:06:09.635606 7f2a213ff6c0 Level-0 table #106: started
2025/10/27-20:06:09.635675 7f2a213ff6c0 Level-0 table #106: 0 bytes OK
2025/10/27-20:06:09.644064 7f2a213ff6c0 Delete type=0 #104
2025/10/27-20:06:09.658912 7f2a213ff6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)

View File

@@ -1 +1 @@
MANIFEST-000077
MANIFEST-000085

View File

@@ -1,7 +1,7 @@
2025/10/18-17:56:08.089616 7f7b6ffff6c0 Recovering log #75
2025/10/18-17:56:08.099835 7f7b6ffff6c0 Delete type=3 #73
2025/10/18-17:56:08.099933 7f7b6ffff6c0 Delete type=0 #75
2025/10/18-18:03:15.586602 7f7b6f3ff6c0 Level-0 table #80: started
2025/10/18-18:03:15.586654 7f7b6f3ff6c0 Level-0 table #80: 0 bytes OK
2025/10/18-18:03:15.623769 7f7b6f3ff6c0 Delete type=0 #78
2025/10/18-18:03:15.624032 7f7b6f3ff6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)
2025/10/27-20:06:28.555946 7f2a227fc6c0 Recovering log #83
2025/10/27-20:06:28.567241 7f2a227fc6c0 Delete type=3 #81
2025/10/27-20:06:28.567394 7f2a227fc6c0 Delete type=0 #83
2025/10/27-20:07:11.791873 7f2a213ff6c0 Level-0 table #88: started
2025/10/27-20:07:11.791940 7f2a213ff6c0 Level-0 table #88: 0 bytes OK
2025/10/27-20:07:11.799353 7f2a213ff6c0 Delete type=0 #86
2025/10/27-20:07:11.813499 7f2a213ff6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)

View File

@@ -1,7 +1,7 @@
2025/10/16-19:48:48.588685 7f189f7fe6c0 Recovering log #71
2025/10/16-19:48:48.599841 7f189f7fe6c0 Delete type=3 #69
2025/10/16-19:48:48.599924 7f189f7fe6c0 Delete type=0 #71
2025/10/16-19:50:49.586198 7f189e7fc6c0 Level-0 table #76: started
2025/10/16-19:50:49.586239 7f189e7fc6c0 Level-0 table #76: 0 bytes OK
2025/10/16-19:50:49.598518 7f189e7fc6c0 Delete type=0 #74
2025/10/16-19:50:49.610365 7f189e7fc6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)
2025/10/27-20:03:18.738218 7f2a23fff6c0 Recovering log #79
2025/10/27-20:03:18.749460 7f2a23fff6c0 Delete type=3 #77
2025/10/27-20:03:18.749597 7f2a23fff6c0 Delete type=0 #79
2025/10/27-20:06:09.651196 7f2a213ff6c0 Level-0 table #84: started
2025/10/27-20:06:09.651261 7f2a213ff6c0 Level-0 table #84: 0 bytes OK
2025/10/27-20:06:09.658656 7f2a213ff6c0 Delete type=0 #82
2025/10/27-20:06:09.658955 7f2a213ff6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)

View File

@@ -40,6 +40,10 @@
<select name="modifier" class="roll-skill-modifier">
{{selectOptions choiceModifier selected=modifier localize=true}}
</select>
<label>{{localize "FTLNOMAD.Label.numericModifier"}}</label>
<select name="numericModifierSelect" class="roll-numeric-modifier">
{{selectOptions choiceNumericModifier selected=numericModifierSelect}}
</select>
{{/if}}
{{#if (eq rollType "weapon")}}