Move aiming to attacker
All checks were successful
Release Creation / build (release) Successful in 1m9s

This commit is contained in:
2025-09-05 23:26:11 +02:00
parent c7727076bf
commit 6eeb391d1a
32 changed files with 143 additions and 105 deletions

View File

@@ -92,8 +92,8 @@ export const RANGE_CHOICES = {
export const ATTACKER_AIM_CHOICES = {
"simple": { label: "Simple (+0)", value: "0" },
"careful": { label: "Careful (Red -5)", value: "-4" },
"focused": { label: "Focused (Grey -9)", value: "-9" }
"careful": { label: "Careful (Red +5)", value: "+4" },
"focused": { label: "Focused (Grey +9)", value: "+9" }
}
export const SPELL_LETHARGY_DICE = [

View File

@@ -96,6 +96,10 @@ export default class LethalFantasyRoll extends Roll {
return this.options.badResult
}
get rollData() {
return this.options.rollData
}
/**
* Prompt the user with a dialog to configure and execute a roll.
*
@@ -312,6 +316,8 @@ export default class LethalFantasyRoll extends Roll {
hasChangeDice,
pointBlank,
baseValue: options.rollTarget.value,
attackerAimChoices: SYSTEM.ATTACKER_AIM_CHOICES,
attackerAim: "0",
changeDice: `${dice}`,
fieldRollMode,
choiceModifier,
@@ -386,6 +392,9 @@ export default class LethalFantasyRoll extends Roll {
let bonus = Number(options.rollTarget.value)
fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus
fullModifier += (rollContext.saveSpell) ? options.rollTarget.actorModifiers.saveModifier : 0
if (Number(rollContext.attackerAim) > 0) {
fullModifier += Number(rollContext.attackerAim)
}
if (fullModifier === 0) {
modifierFormula = "0"
@@ -457,6 +466,9 @@ export default class LethalFantasyRoll extends Roll {
actorImage: options.actorImage,
rollMode: rollContext.visibility,
hasTarget: options.hasTarget,
pointBlank,
beyondSkill,
letItFly,
hasGrantedDice,
titleFormula,
targetName,
@@ -569,6 +581,7 @@ export default class LethalFantasyRoll extends Roll {
rollBase.options.titleFormula = titleFormula
rollBase.options.D30result = options.D30result
rollBase.options.badResult = badResult
rollBase.options.rollData = foundry.utils.duplicate(rollData)
/**
* A hook event that fires after the roll has been made.
@@ -1114,6 +1127,7 @@ export default class LethalFantasyRoll extends Roll {
targetArmor: this.targetArmor,
D30result: this.D30result,
badResult: this.badResult,
rollData: this.rollData,
isPrivate: isPrivate
}
cardData.cssClass = cardData.css.join(" ")
@@ -1145,6 +1159,7 @@ export default class LethalFantasyRoll extends Roll {
targetArmor: this.targetArmor,
targetMalus: this.targetMalus,
realDamage: this.realDamage,
rollData: this.rollData,
...messageData,
},
{ rollMode: rollMode },