Add skill+weapon rolls

This commit is contained in:
2025-01-03 23:57:54 +01:00
parent 48adc5ab49
commit c7cc39886d
39 changed files with 616 additions and 333 deletions

View File

@@ -327,6 +327,12 @@ i.lethalfantasy {
max-width: 5rem; max-width: 5rem;
margin-left: 0.7rem; margin-left: 0.7rem;
} }
.lethalfantasy .character-main .character-saves .character-save .name-pain {
flex: 0;
min-width: 3rem;
max-width: 3rem;
margin-left: 0.7rem;
}
.lethalfantasy .character-main .character-saves .character-save .form-group { .lethalfantasy .character-main .character-saves .character-save .form-group {
flex: 0; flex: 0;
padding-left: 5px; padding-left: 5px;
@@ -418,15 +424,15 @@ i.lethalfantasy {
gap: 10px; gap: 10px;
} }
.lethalfantasy .tab.character-skills .skills .skill .item-img { .lethalfantasy .tab.character-skills .skills .skill .item-img {
width: 50px; width: 32px;
height: 50px; height: 32px;
} }
.lethalfantasy .tab.character-skills .skills .skill .name { .lethalfantasy .tab.character-skills .skills .skill .name {
min-width: 12rem; min-width: 12rem;
} }
.lethalfantasy .tab.character-skills .gifts { .lethalfantasy .tab.character-skills .gifts {
display: grid; display: grid;
grid-template-columns: repeat(5, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 10px; gap: 10px;
} }
.lethalfantasy .tab.character-skills .gifts .gift { .lethalfantasy .tab.character-skills .gifts .gift {
@@ -435,12 +441,15 @@ i.lethalfantasy {
gap: 10px; gap: 10px;
} }
.lethalfantasy .tab.character-skills .gifts .gift .item-img { .lethalfantasy .tab.character-skills .gifts .gift .item-img {
width: 50px; width: 32px;
height: 50px; height: 32px;
}
.lethalfantasy .tab.character-skills .gifts .gift .name {
min-width: 12rem;
} }
.lethalfantasy .tab.character-skills .vulnerabilities { .lethalfantasy .tab.character-skills .vulnerabilities {
display: grid; display: grid;
grid-template-columns: repeat(5, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 10px; gap: 10px;
} }
.lethalfantasy .tab.character-skills .vulnerabilities .vulnerability { .lethalfantasy .tab.character-skills .vulnerabilities .vulnerability {
@@ -449,8 +458,11 @@ i.lethalfantasy {
gap: 10px; gap: 10px;
} }
.lethalfantasy .tab.character-skills .vulnerabilities .vulnerability .item-img { .lethalfantasy .tab.character-skills .vulnerabilities .vulnerability .item-img {
width: 50px; width: 32px;
height: 50px; height: 32px;
}
.lethalfantasy .tab.character-skills .vulnerabilities .vulnerability .name {
min-width: 12rem;
} }
.lethalfantasy .tab.character-weapons { .lethalfantasy .tab.character-weapons {
display: grid; display: grid;
@@ -462,7 +474,7 @@ i.lethalfantasy {
} }
.lethalfantasy .tab.character-weapons .weapons { .lethalfantasy .tab.character-weapons .weapons {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(2, 1fr);
gap: 10px; gap: 10px;
} }
.lethalfantasy .tab.character-weapons .weapons .weapon { .lethalfantasy .tab.character-weapons .weapons .weapon {
@@ -471,10 +483,17 @@ i.lethalfantasy {
gap: 10px; gap: 10px;
} }
.lethalfantasy .tab.character-weapons .weapons .weapon .item-img { .lethalfantasy .tab.character-weapons .weapons .weapon .item-img {
width: 50px; width: 32px;
height: 50px; height: 32px;
margin: 5px 0 0 0; margin: 5px 0 0 0;
} }
.lethalfantasy .tab.character-weapons .weapons .weapon .name {
min-width: 12rem;
}
.lethalfantasy .tab.character-weapons .weapons .weapon .attack-icons a {
margin-left: 8px;
margin-right: 8px;
}
.lethalfantasy .tab.character-weapons .armors { .lethalfantasy .tab.character-weapons .armors {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
@@ -486,10 +505,34 @@ i.lethalfantasy {
gap: 10px; gap: 10px;
} }
.lethalfantasy .tab.character-weapons .armors .armor .item-img { .lethalfantasy .tab.character-weapons .armors .armor .item-img {
width: 50px; width: 32px;
height: 50px; height: 32px;
margin: 5px 0 0 0; margin: 5px 0 0 0;
} }
.lethalfantasy .tab.character-weapons .armors .name {
min-width: 12rem;
}
.lethalfantasy .tab.character-weapons .equipments {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
.lethalfantasy .tab.character-weapons .equipments .equipment {
display: flex;
align-items: center;
gap: 10px;
}
.lethalfantasy .tab.character-weapons .equipments .equipment .item-img {
width: 32px;
height: 32px;
margin: 5px 0 0 0;
}
.lethalfantasy .tab.character-weapons .equipments .equipment .name {
min-width: 12rem;
}
.lethalfantasy .tab.character-weapons .equipments .name {
min-width: 12rem;
}
.lethalfantasy .tab.character-spells { .lethalfantasy .tab.character-spells {
display: grid; display: grid;
grid-template-columns: 1fr; grid-template-columns: 1fr;
@@ -1410,15 +1453,18 @@ i.lethalfantasy {
width: 60px; width: 60px;
text-align: center; text-align: center;
} }
.main,
.dialog-damage, .dialog-damage,
.dialog-resource, .dialog-resource,
.dialog-challenge, .dialog-challenge,
.dialog-save { .dialog-save {
margin-bottom: 0px;
padding-bottom: 0px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-family: var(--font-secondary); font-family: var(--font-secondary);
font-size: calc(var(--font-size-standard) * 1.2); font-size: calc(var(--font-size-standard) * 1);
color: var(--color-dark-1); color: var(--color-dark-1);
} }
.dice-roll { .dice-roll {

View File

@@ -480,7 +480,15 @@
"Label": { "Label": {
"titleChallenge": "Challenge", "titleChallenge": "Challenge",
"titleSave": "Save", "titleSave": "Save",
"titleSkill": "Skill",
"skill" : "Skill",
"Movement": "Movement", "Movement": "Movement",
"weapon-attack": "Weapon attack",
"weapon-damage": "Weapon damage",
"weapon-defense": "Weapon defense",
"baseModifier": "Base modifier",
"weapon": "Weapon",
"skillBonus": "Skill bonus",
"movement": { "movement": {
"walk": "Walk", "walk": "Walk",
"run": "Run", "run": "Run",
@@ -543,7 +551,8 @@
"luc": "LUC", "luc": "LUC",
"app": "APP", "app": "APP",
"cha": "CHA", "cha": "CHA",
"challenge": "Challenge" "challenge": "Challenge",
"armors": "Armors"
}, },
"Edit": "Edit", "Edit": "Edit",
"Delete": "Delete", "Delete": "Delete",
@@ -574,30 +583,10 @@
"fortune": "Roue de Fortune", "fortune": "Roue de Fortune",
"fortuneHint": "Valeur de la roue de Fortune. Nombre de joueurs + 1 en début de partie." "fortuneHint": "Valeur de la roue de Fortune. Nombre de joueurs + 1 en début de partie."
}, },
"Chat": { "Notifications": {
"askFortune": "{name} veut utiliser un point de Fortune !", "rollFromWeapon": "Roll from an equipped weapon",
"askRollForAll": "Jet de {value}", "skillNotFound": "Skill not found",
"askRollForOne": "Jet de {value} pour {name}" "rollTypeNotFound": "Roll type not found"
},
"Fortune": {
"title": "Roue de Fortune"
},
"Manager": {
"title": "Gestionnaire de Personnages",
"player": "Utilisateur",
"character": "Personnage",
"rob": "Robustesse",
"dex": "Dextérité",
"int": "Intelligence",
"per": "Perception",
"vol": "Volonté",
"pv": "Points de Vie",
"san": "Santé Mentale",
"oeil": "Œil",
"verbe": "Verbe",
"bourse": "Bourse",
"magie": "Magie",
"roll": "Faire le jet"
} }
} }
} }

View File

@@ -90,7 +90,7 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
case "skills": case "skills":
context.tab = context.tabs.skills context.tab = context.tabs.skills
context.skills = doc.itemTypes.skill context.skills = doc.itemTypes.skill
context.gifts = doc.itemTypes.gifts context.gifts = doc.itemTypes.gift
context.vulnerabilities = doc.itemTypes.vulnerability context.vulnerabilities = doc.itemTypes.vulnerability
break break
case "spells": case "spells":
@@ -153,6 +153,33 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
} }
} }
getBestWeaponClassSkill(skills, rollType, multiplier = 1.0) {
let maxValue = 0
let goodSkill = skills[0]
for (let s of skills) {
if (rollType === "weapon-attack") {
if (s.system.weaponBonus.attack > maxValue) {
maxValue = Number(s.system.weaponBonus.attack)
goodSkill = s
}
}
if (rollType === "weapon-defense") {
if (s.system.weaponBonus.defense > maxValue) {
maxValue = Number(s.system.weaponBonus.defense)
goodSkill = s
}
}
if (rollType === "weapon-damage") {
if (s.system.weaponBonus.damage > maxValue) {
maxValue = Number(s.system.weaponBonus.damage)
goodSkill = s
}
}
}
goodSkill.weaponSkillModifier = maxValue * multiplier
return goodSkill
}
/** /**
* Handles the roll action triggered by user interaction. * Handles the roll action triggered by user interaction.
* *
@@ -167,9 +194,9 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
* (save, resource, or damage) based on the target element's data attributes. It retrieves the * (save, resource, or damage) based on the target element's data attributes. It retrieves the
* corresponding value from the document's system and performs the roll. * corresponding value from the document's system and performs the roll.
*/ */
async _onRoll(event, target) { async _onRoll(event, target) {
if (this.isEditMode) return if (this.isEditMode) return
console.log(event, target)
const rollType = event.target.dataset.rollType const rollType = event.target.dataset.rollType
let rollTarget let rollTarget
let rollKey = event.target.dataset.rollKey let rollKey = event.target.dataset.rollKey
@@ -181,11 +208,59 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
case "save": case "save":
rollTarget = foundry.utils.duplicate(this.document.system.saves[rollKey]) rollTarget = foundry.utils.duplicate(this.document.system.saves[rollKey])
rollTarget.rollKey = rollKey rollTarget.rollKey = rollKey
rollTarget.rollDice = event.target.dataset?.rollDice
break
case "skill":
rollTarget = this.actor.items.find((i) => i.type === "skill" && i.id === rollKey)
rollTarget.rollKey = rollKey
if (rollTarget.system.category === "weapon") {
ui.notifications.warn(game.i18n.localize("LETHALFANTASY.Notifications.rollFromWeapon"))
return
}
break
case "weapon-attack":
case "weapon-defense":
case "weapon-damage":
let weapon = this.actor.items.find((i) => i.type === "weapon" && i.id === rollKey)
let skill
let skills = this.actor.items.filter((i) => i.type === "skill" && i.name.toLowerCase() === weapon.name.toLowerCase())
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 1.0)
} else {
skills = this.actor.items.filter((i) => i.type === "skill" && i.name.toLowerCase().replace(" skill", "") === weapon.name.toLowerCase())
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 1.0)
} else {
skills = this.actor.items.filter((i) => i.type === "skill" && i.system.weaponClass === weapon.system.weaponClass)
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 0.5)
} else {
skills = this.actor.items.filter((i) => i.type === "skill" && i.system.weaponClass.includes(SYSTEM.WEAPON_CATEGORIES[weapon.system.weaponClass]))
if (skills.length > 0) {
skill = this.getBestWeaponClassSkill(skills, rollType, 0.25)
} else {
ui.notifications.warn(game.i18n.localize("LETHALFANTASY.Notifications.skillNotFound"))
return
}
}
}
}
if (!weapon || !skill) {
console.error("Weapon or skill not found", weapon, skill)
ui.notifications.warn(game.i18n.localize("LETHALFANTASY.Notifications.skillNotFound"))
return
}
rollTarget = skill
rollTarget.weapon = weapon
rollTarget.weaponSkillModifier = skill.weaponSkillModifier
rollTarget.rollKey = rollKey
rollTarget.combat = foundry.utils.duplicate(this.actor.system.combat)
break break
case ROLL_TYPE.DAMAGE: case ROLL_TYPE.DAMAGE:
rollTarget = elt.dataset.itemId rollTarget = elt.dataset.itemId
break break
default: default:
ui.notifications.error(game.i18n.localize("LETHALFANTASY.Notifications.rollTypeNotFound") + String(rollType))
break break
} }
await this.document.system.roll(rollType, rollTarget) await this.document.system.roll(rollType, rollTarget)

View File

@@ -6,8 +6,8 @@ export const TABLES = {
"str": [ "str": [
{ {
"value": 1, "value": 1,
"damage_modifier": -7, "damage": -7,
"attack_modifier": -4, "attack": -4,
"challenge": -9, "challenge": -9,
"aether_points": -20, "aether_points": -20,
"hp": -3, "hp": -3,
@@ -17,8 +17,8 @@ export const TABLES = {
}, },
{ {
"value": 2, "value": 2,
"damage_modifier": -6, "damage": -6,
"attack_modifier": -4, "attack": -4,
"challenge": -8, "challenge": -8,
"aether_points": -20, "aether_points": -20,
"hp": -2, "hp": -2,
@@ -28,8 +28,8 @@ export const TABLES = {
}, },
{ {
"value": 3, "value": 3,
"damage_modifier": -5, "damage": -5,
"attack_modifier": -3, "attack": -3,
"challenge": -7, "challenge": -7,
"aether_points": -20, "aether_points": -20,
"hp": -1, "hp": -1,
@@ -39,8 +39,8 @@ export const TABLES = {
}, },
{ {
"value": 4, "value": 4,
"damage_modifier": -4, "damage": -4,
"attack_modifier": -3, "attack": -3,
"challenge": -6, "challenge": -6,
"aether_points": -20, "aether_points": -20,
"hp": -1, "hp": -1,
@@ -50,8 +50,8 @@ export const TABLES = {
}, },
{ {
"value": 5, "value": 5,
"damage_modifier": -3, "damage": -3,
"attack_modifier": -2, "attack": -2,
"challenge": -5, "challenge": -5,
"aether_points": -20, "aether_points": -20,
"hp": 0, "hp": 0,
@@ -61,8 +61,8 @@ export const TABLES = {
}, },
{ {
"value": 6, "value": 6,
"damage_modifier": -2, "damage": -2,
"attack_modifier": -1, "attack": -1,
"challenge": -4, "challenge": -4,
"aether_points": -10, "aether_points": -10,
"hp": 0, "hp": 0,
@@ -72,8 +72,8 @@ export const TABLES = {
}, },
{ {
"value": 7, "value": 7,
"damage_modifier": -2, "damage": -2,
"attack_modifier": 0, "attack": 0,
"challenge": -3, "challenge": -3,
"aether_points": -10, "aether_points": -10,
"hp": 0, "hp": 0,
@@ -83,8 +83,8 @@ export const TABLES = {
}, },
{ {
"value": 8, "value": 8,
"damage_modifier": -1, "damage": -1,
"attack_modifier": 0, "attack": 0,
"challenge": -2, "challenge": -2,
"aether_points": 0, "aether_points": 0,
"hp": 0, "hp": 0,
@@ -94,8 +94,8 @@ export const TABLES = {
}, },
{ {
"value": 9, "value": 9,
"damage_modifier": -1, "damage": -1,
"attack_modifier": 0, "attack": 0,
"challenge": -1, "challenge": -1,
"aether_points": 0, "aether_points": 0,
"hp": 0, "hp": 0,
@@ -105,8 +105,8 @@ export const TABLES = {
}, },
{ {
"value": 10, "value": 10,
"damage_modifier": 0, "damage": 0,
"attack_modifier": 0, "attack": 0,
"challenge": 0, "challenge": 0,
"aether_points": 0, "aether_points": 0,
"hp": 0, "hp": 0,
@@ -116,8 +116,8 @@ export const TABLES = {
}, },
{ {
"value": 11, "value": 11,
"damage_modifier": 0, "damage": 0,
"attack_modifier": 0, "attack": 0,
"challenge": 0, "challenge": 0,
"aether_points": 0, "aether_points": 0,
"hp": 0, "hp": 0,
@@ -127,8 +127,8 @@ export const TABLES = {
}, },
{ {
"value": 12, "value": 12,
"damage_modifier": 1, "damage": 1,
"attack_modifier": 0, "attack": 0,
"challenge": 1, "challenge": 1,
"aether_points": 0, "aether_points": 0,
"hp": 0, "hp": 0,
@@ -138,8 +138,8 @@ export const TABLES = {
}, },
{ {
"value": 13, "value": 13,
"damage_modifier": 1, "damage": 1,
"attack_modifier": 0, "attack": 0,
"challenge": 2, "challenge": 2,
"aether_points": 0, "aether_points": 0,
"hp": 0, "hp": 0,
@@ -149,8 +149,8 @@ export const TABLES = {
}, },
{ {
"value": 14, "value": 14,
"damage_modifier": 2, "damage": 2,
"attack_modifier": 1, "attack": 1,
"challenge": 3, "challenge": 3,
"aether_points": 0, "aether_points": 0,
"hp": 1, "hp": 1,
@@ -160,8 +160,8 @@ export const TABLES = {
}, },
{ {
"value": 15, "value": 15,
"damage_modifier": 3, "damage": 3,
"attack_modifier": 1, "attack": 1,
"challenge": 4, "challenge": 4,
"aether_points": 0, "aether_points": 0,
"hp": 2, "hp": 2,
@@ -171,8 +171,8 @@ export const TABLES = {
}, },
{ {
"value": 16, "value": 16,
"damage_modifier": 4, "damage": 4,
"attack_modifier": 2, "attack": 2,
"challenge": 5, "challenge": 5,
"aether_points": 0, "aether_points": 0,
"hp": 3, "hp": 3,
@@ -182,8 +182,8 @@ export const TABLES = {
}, },
{ {
"value": 17, "value": 17,
"damage_modifier": 5, "damage": 5,
"attack_modifier": 2, "attack": 2,
"challenge": 6, "challenge": 6,
"aether_points": 10, "aether_points": 10,
"hp": 4, "hp": 4,
@@ -193,8 +193,8 @@ export const TABLES = {
}, },
{ {
"value": 18, "value": 18,
"damage_modifier": 6, "damage": 6,
"attack_modifier": 3, "attack": 3,
"challenge": 7, "challenge": 7,
"aether_points": 20, "aether_points": 20,
"hp": 5, "hp": 5,
@@ -204,8 +204,8 @@ export const TABLES = {
}, },
{ {
"value": 19, "value": 19,
"damage_modifier": 7, "damage": 7,
"attack_modifier": 3, "attack": 3,
"challenge": 8, "challenge": 8,
"aether_points": 20, "aether_points": 20,
"hp": 6, "hp": 6,
@@ -215,8 +215,8 @@ export const TABLES = {
}, },
{ {
"value": 20, "value": 20,
"damage_modifier": 8, "damage": 8,
"attack_modifier": 4, "attack": 4,
"challenge": 9, "challenge": 9,
"aether_points": 30, "aether_points": 30,
"hp": 7, "hp": 7,
@@ -226,8 +226,8 @@ export const TABLES = {
}, },
{ {
"value": 21, "value": 21,
"damage_modifier": 9, "damage": 9,
"attack_modifier": 4, "attack": 4,
"challenge": 10, "challenge": 10,
"aether_points": 30, "aether_points": 30,
"hp": 8, "hp": 8,
@@ -237,8 +237,8 @@ export const TABLES = {
}, },
{ {
"value": 22, "value": 22,
"damage_modifier": 10, "damage": 10,
"attack_modifier": 5, "attack": 5,
"challenge": 11, "challenge": 11,
"aether_points": 40, "aether_points": 40,
"hp": 9, "hp": 9,
@@ -248,8 +248,8 @@ export const TABLES = {
}, },
{ {
"value": 23, "value": 23,
"damage_modifier": 12, "damage": 12,
"attack_modifier": 5, "attack": 5,
"challenge": 12, "challenge": 12,
"aether_points": 40, "aether_points": 40,
"hp": 10, "hp": 10,
@@ -259,8 +259,8 @@ export const TABLES = {
}, },
{ {
"value": 24, "value": 24,
"damage_modifier": 14, "damage": 14,
"attack_modifier": 5, "attack": 5,
"challenge": 13, "challenge": 13,
"aether_points": 50, "aether_points": 50,
"hp": 11, "hp": 11,
@@ -270,8 +270,8 @@ export const TABLES = {
}, },
{ {
"value": 25, "value": 25,
"damage_modifier": 16, "damage": 16,
"attack_modifier": 6, "attack": 6,
"challenge": 14, "challenge": 14,
"aether_points": 60, "aether_points": 60,
"hp": 12, "hp": 12,
@@ -736,7 +736,6 @@ export const TABLES = {
}, },
{ {
"value": 6, "value": 6,
"hp ": 6, "hp ": 6,
"aether_points": -20, "aether_points": -20,
"pain_save": 3, "pain_save": 3,
@@ -746,7 +745,6 @@ export const TABLES = {
}, },
{ {
"value": 7, "value": 7,
"hp ": 7, "hp ": 7,
"aether_points": -15, "aether_points": -15,
"pain_save": 3, "pain_save": 3,
@@ -939,175 +937,175 @@ export const TABLES = {
"value": 1, "value": 1,
"grit": -5, "grit": -5,
"turning_casting": -4, "turning_casting": -4,
"development_points ": 0, "development_points": 0,
"divine_miracle_bonus": 0 "divine_miracle_bonus": 0
}, },
{ {
"value": 2, "value": 2,
"grit": -4, "grit": -4,
"turning_casting": -4, "turning_casting": -4,
"development_points ": 0, "development_points": 0,
"divine_miracle_bonus": 0 "divine_miracle_bonus": 0
}, },
{ {
"value": 3, "value": 3,
"grit": -4, "grit": -4,
"turning_casting": -3, "turning_casting": -3,
"development_points ": 0, "development_points": 0,
"divine_miracle_bonus": 0 "divine_miracle_bonus": 0
}, },
{ {
"value": 4, "value": 4,
"grit": -3, "grit": -3,
"turning_casting": 3, "turning_casting": 3,
"development_points ": 0, "development_points": 0,
"divine_miracle_bonus": 0 "divine_miracle_bonus": 0
}, },
{ {
"value": 5, "value": 5,
"grit": -3, "grit": -3,
"turning_casting": -2, "turning_casting": -2,
"development_points ": 0, "development_points": 0,
"divine_miracle_bonus": 0 "divine_miracle_bonus": 0
}, },
{ {
"value": 6, "value": 6,
"grit": -2, "grit": -2,
"turning_casting": -2, "turning_casting": -2,
"development_points ": 0, "development_points": 0,
"divine_miracle_bonus": 0 "divine_miracle_bonus": 0
}, },
{ {
"value": 7, "value": 7,
"grit": -2, "grit": -2,
"turning_casting": -1, "turning_casting": -1,
"development_points ": 0, "development_points": 0,
"divine_miracle_bonus": 0 "divine_miracle_bonus": 0
}, },
{ {
"value": 8, "value": 8,
"grit": -1, "grit": -1,
"turning_casting": -1, "turning_casting": -1,
"development_points ": 0, "development_points": 0,
"divine_miracle_bonus": 0 "divine_miracle_bonus": 0
}, },
{ {
"value": 9, "value": 9,
"grit": -1, "grit": -1,
"turning_casting": 0, "turning_casting": 0,
"development_points ": 0, "development_points": 0,
"divine_miracle_bonus": 0 "divine_miracle_bonus": 0
}, },
{ {
"value": 10, "value": 10,
"grit": 0, "grit": 0,
"turning_casting": 0, "turning_casting": 0,
"development_points ": 0, "development_points": 0,
"divine_miracle_bonus": 0 "divine_miracle_bonus": 0
}, },
{ {
"value": 11, "value": 11,
"grit": 0, "grit": 0,
"turning_casting": 0, "turning_casting": 0,
"development_points ": 0, "development_points": 0,
"divine_miracle_bonus": 0 "divine_miracle_bonus": 0
}, },
{ {
"value": 12, "value": 12,
"grit": 0, "grit": 0,
"turning_casting": 1, "turning_casting": 1,
"development_points ": 1, "development_points": 1,
"divine_miracle_bonus": 1 "divine_miracle_bonus": 1
}, },
{ {
"value": 13, "value": 13,
"grit": 1, "grit": 1,
"turning_casting": 1, "turning_casting": 1,
"development_points ": 2, "development_points": 2,
"divine_miracle_bonus": 1 "divine_miracle_bonus": 1
}, },
{ {
"value": 14, "value": 14,
"grit": 2, "grit": 2,
"turning_casting": 2, "turning_casting": 2,
"development_points ": 4, "development_points": 4,
"divine_miracle_bonus": 2 "divine_miracle_bonus": 2
}, },
{ {
"value": 15, "value": 15,
"grit": 4, "grit": 4,
"turning_casting": 2, "turning_casting": 2,
"development_points ": 6, "development_points": 6,
"divine_miracle_bonus": 2 "divine_miracle_bonus": 2
}, },
{ {
"value": 16, "value": 16,
"grit": 6, "grit": 6,
"turning_casting": 3, "turning_casting": 3,
"development_points ": 7, "development_points": 7,
"divine_miracle_bonus": 3 "divine_miracle_bonus": 3
}, },
{ {
"value": 17, "value": 17,
"grit": 8, "grit": 8,
"turning_casting": 3, "turning_casting": 3,
"development_points ": 8, "development_points": 8,
"divine_miracle_bonus": 3 "divine_miracle_bonus": 3
}, },
{ {
"value": 18, "value": 18,
"grit": 10, "grit": 10,
"turning_casting": 4, "turning_casting": 4,
"development_points ": 9, "development_points": 9,
"divine_miracle_bonus": 4 "divine_miracle_bonus": 4
}, },
{ {
"value": 19, "value": 19,
"grit": 11, "grit": 11,
"turning_casting": 5, "turning_casting": 5,
"development_points ": 10, "development_points": 10,
"divine_miracle_bonus": 5 "divine_miracle_bonus": 5
}, },
{ {
"value": 20, "value": 20,
"grit": 12, "grit": 12,
"turning_casting": 6, "turning_casting": 6,
"development_points ": 11, "development_points": 11,
"divine_miracle_bonus": 5 "divine_miracle_bonus": 5
}, },
{ {
"value": 21, "value": 21,
"grit": 13, "grit": 13,
"turning_casting": 7, "turning_casting": 7,
"development_points ": 12, "development_points": 12,
"divine_miracle_bonus": 5 "divine_miracle_bonus": 5
}, },
{ {
"value": 22, "value": 22,
"grit": 14, "grit": 14,
"turning_casting": 7, "turning_casting": 7,
"development_points ": 13, "development_points": 13,
"divine_miracle_bonus": 6 "divine_miracle_bonus": 6
}, },
{ {
"value": 23, "value": 23,
"grit": 15, "grit": 15,
"turning_casting": 8, "turning_casting": 8,
"development_points ": 14, "development_points": 14,
"divine_miracle_bonus": 6 "divine_miracle_bonus": 6
}, },
{ {
"value": 24, "value": 24,
"grit": 16, "grit": 16,
"turning_casting": 8, "turning_casting": 8,
"development_points ": 15, "development_points": 15,
"divine_miracle_bonus": 6 "divine_miracle_bonus": 6
}, },
{ {
"value": 25, "value": 25,
"grit": 18, "grit": 18,
"turning_casting": 9, "turning_casting": 9,
"development_points ": 16, "development_points": 16,
"divine_miracle_bonus": 7 "divine_miracle_bonus": 7
} }
], ],
@@ -1218,250 +1216,250 @@ export const TABLES = {
"value": 1, "value": 1,
"defense": -5, "defense": -5,
"init_cap": "-", "init_cap": "-",
"development_points ": 0, "development_points": 0,
"attack ": -5, "attack": -5,
"willpower_save": -5, "willpower_save": -5,
"divine_miracle_bonus ": 0, "divine_miracle_bonus": 0,
"": "" "": ""
}, },
{ {
"value": 2, "value": 2,
"defense": -4, "defense": -4,
"init_cap": "-", "init_cap": "-",
"development_points ": 0, "development_points": 0,
"attack ": -4, "attack": -4,
"willpower_save": -4, "willpower_save": -4,
"divine_miracle_bonus ": 0, "divine_miracle_bonus": 0,
"": "" "": ""
}, },
{ {
"value": 3, "value": 3,
"defense": -3, "defense": -3,
"init_cap": "-", "init_cap": "-",
"development_points ": 0, "development_points": 0,
"attack ": -3, "attack": -3,
"willpower_save": -3, "willpower_save": -3,
"divine_miracle_bonus ": 0, "divine_miracle_bonus": 0,
"": "" "": ""
}, },
{ {
"value": 4, "value": 4,
"defense": -3, "defense": -3,
"init_cap": "-", "init_cap": "-",
"development_points ": 0, "development_points": 0,
"attack ": -2, "attack": -2,
"willpower_save": -3, "willpower_save": -3,
"divine_miracle_bonus ": 0, "divine_miracle_bonus": 0,
"": "" "": ""
}, },
{ {
"value": 5, "value": 5,
"defense": -2, "defense": -2,
"init_cap": "-", "init_cap": "-",
"development_points ": 0, "development_points": 0,
"attack ": 1, "attack": 1,
"willpower_save": -2, "willpower_save": -2,
"divine_miracle_bonus ": 0, "divine_miracle_bonus": 0,
"": "" "": ""
}, },
{ {
"value": 6, "value": 6,
"defense": -2, "defense": -2,
"init_cap": "-", "init_cap": "-",
"development_points ": 0, "development_points": 0,
"attack ": 0, "attack": 0,
"willpower_save": -2, "willpower_save": -2,
"divine_miracle_bonus ": 0, "divine_miracle_bonus": 0,
"": "" "": ""
}, },
{ {
"value": 7, "value": 7,
"defense": -1, "defense": -1,
"init_cap": "-", "init_cap": "-",
"development_points ": 0, "development_points": 0,
"attack ": 0, "attack": 0,
"willpower_save": -1, "willpower_save": -1,
"divine_miracle_bonus ": 0, "divine_miracle_bonus": 0,
"": "" "": ""
}, },
{ {
"value": 8, "value": 8,
"defense": -1, "defense": -1,
"init_cap": "-", "init_cap": "-",
"development_points ": 0, "development_points": 0,
"attack ": 0, "attack": 0,
"willpower_save": -1, "willpower_save": -1,
"divine_miracle_bonus ": 0, "divine_miracle_bonus": 0,
"": "" "": ""
}, },
{ {
"value": 9, "value": 9,
"defense": -1, "defense": -1,
"init_cap": "-", "init_cap": "-",
"development_points ": 0, "development_points": 0,
"attack ": 0, "attack": 0,
"willpower_save": 0, "willpower_save": 0,
"divine_miracle_bonus ": 0, "divine_miracle_bonus": 0,
"": "" "": ""
}, },
{ {
"value": 10, "value": 10,
"defense": 0, "defense": 0,
"init_cap": 18, "init_cap": 18,
"development_points ": 0, "development_points": 0,
"attack ": 0, "attack": 0,
"willpower_save": 0, "willpower_save": 0,
"divine_miracle_bonus ": 0, "divine_miracle_bonus": 0,
"": "" "": ""
}, },
{ {
"value": 11, "value": 11,
"defense": 0, "defense": 0,
"init_cap": 16, "init_cap": 16,
"development_points ": 1, "development_points": 1,
"attack ": 0, "attack": 0,
"willpower_save": 0, "willpower_save": 0,
"divine_miracle_bonus ": 0, "divine_miracle_bonus": 0,
"": "" "": ""
}, },
{ {
"value": 12, "value": 12,
"defense": 1, "defense": 1,
"init_cap": 14, "init_cap": 14,
"development_points ": 2, "development_points": 2,
"attack ": 0, "attack": 0,
"willpower_save": 0, "willpower_save": 0,
"divine_miracle_bonus ": 1, "divine_miracle_bonus": 1,
"": "" "": ""
}, },
{ {
"value": 13, "value": 13,
"defense": 1, "defense": 1,
"init_cap": 12, "init_cap": 12,
"development_points ": 3, "development_points": 3,
"attack ": 0, "attack": 0,
"willpower_save": 1, "willpower_save": 1,
"divine_miracle_bonus ": 1, "divine_miracle_bonus": 1,
"": "" "": ""
}, },
{ {
"value": 14, "value": 14,
"defense": 1, "defense": 1,
"init_cap": 10, "init_cap": 10,
"development_points ": 4, "development_points": 4,
"attack ": 1, "attack": 1,
"willpower_save": 2, "willpower_save": 2,
"divine_miracle_bonus ": 2, "divine_miracle_bonus": 2,
"": "" "": ""
}, },
{ {
"value": 15, "value": 15,
"defense": 2, "defense": 2,
"init_cap": 8, "init_cap": 8,
"development_points ": 5, "development_points": 5,
"attack ": 1, "attack": 1,
"willpower_save": 3, "willpower_save": 3,
"divine_miracle_bonus ": 2, "divine_miracle_bonus": 2,
"": "" "": ""
}, },
{ {
"value": 16, "value": 16,
"defense": 2, "defense": 2,
"init_cap": 7, "init_cap": 7,
"development_points ": 7, "development_points": 7,
"attack ": 1, "attack": 1,
"willpower_save": 4, "willpower_save": 4,
"divine_miracle_bonus ": 2, "divine_miracle_bonus": 2,
"": "" "": ""
}, },
{ {
"value": 17, "value": 17,
"defense": 2, "defense": 2,
"init_cap": 6, "init_cap": 6,
"development_points ": 9, "development_points": 9,
"attack ": 1, "attack": 1,
"willpower_save": 5, "willpower_save": 5,
"divine_miracle_bonus ": 3, "divine_miracle_bonus": 3,
"": "" "": ""
}, },
{ {
"value": 18, "value": 18,
"defense": 3, "defense": 3,
"init_cap": 5, "init_cap": 5,
"development_points ": 11, "development_points": 11,
"attack ": 2, "attack": 2,
"willpower_save": 6, "willpower_save": 6,
"divine_miracle_bonus ": 4, "divine_miracle_bonus": 4,
"": "" "": ""
}, },
{ {
"value": 19, "value": 19,
"defense": 3, "defense": 3,
"init_cap": 4, "init_cap": 4,
"development_points ": 13, "development_points": 13,
"attack ": 2, "attack": 2,
"willpower_save": 7, "willpower_save": 7,
"divine_miracle_bonus ": 5, "divine_miracle_bonus": 5,
"": "" "": ""
}, },
{ {
"value": 20, "value": 20,
"defense": 3, "defense": 3,
"init_cap": 4, "init_cap": 4,
"development_points ": 15, "development_points": 15,
"attack ": 2, "attack": 2,
"willpower_save": 8, "willpower_save": 8,
"divine_miracle_bonus ": 6, "divine_miracle_bonus": 6,
"": "" "": ""
}, },
{ {
"value": 21, "value": 21,
"defense": 4, "defense": 4,
"init_cap": 3, "init_cap": 3,
"development_points ": 18, "development_points": 18,
"attack ": 2, "attack": 2,
"willpower_save": 9, "willpower_save": 9,
"divine_miracle_bonus ": 7, "divine_miracle_bonus": 7,
"": "" "": ""
}, },
{ {
"value": 22, "value": 22,
"defense": 4, "defense": 4,
"init_cap": 3, "init_cap": 3,
"development_points ": 21, "development_points": 21,
"attack ": 2, "attack": 2,
"willpower_save": 10, "willpower_save": 10,
"divine_miracle_bonus ": 8, "divine_miracle_bonus": 8,
"": "" "": ""
}, },
{ {
"value": 23, "value": 23,
"defense": 4, "defense": 4,
"init_cap": 2, "init_cap": 2,
"development_points ": 24, "development_points": 24,
"attack ": 3, "attack": 3,
"willpower_save": 11, "willpower_save": 11,
"divine_miracle_bonus ": 9, "divine_miracle_bonus": 9,
"": "" "": ""
}, },
{ {
"value": 24, "value": 24,
"defense": 4, "defense": 4,
"init_cap": 2, "init_cap": 2,
"development_points ": 27, "development_points": 27,
"attack ": 3, "attack": 3,
"willpower_save": 12, "willpower_save": 12,
"divine_miracle_bonus ": 10, "divine_miracle_bonus": 10,
"": "" "": ""
}, },
{ {
"value": 25, "value": 25,
"defense": 5, "defense": 5,
"init_cap": 1, "init_cap": 1,
"development_points ": 30, "development_points": 30,
"attack ": 4, "attack": 4,
"willpower_save": 13, "willpower_save": 13,
"divine_miracle_bonus ": 12, "divine_miracle_bonus": 12,
"": "" "": ""
} }
] ]

View File

@@ -59,6 +59,10 @@ export const DICE_VALUES = {
"d20": "D20" "d20": "D20"
} }
export const CHARACTERISTIC_ATTACK = [ "str", "int", "wis", "dex"]
export const CHARACTERISTIC_DEFENSE = [ "int", "wis", "dex" ]
export const CHARACTERISTIC_DAMAGE = [ "str" ]
export const DEFENSE_DICE_VALUES = { export const DEFENSE_DICE_VALUES = {
"d3": "D3", "d3": "D3",
"d4": "D4", "d4": "D4",
@@ -145,6 +149,10 @@ export const SYSTEM = {
WEAPON_CLASS: WEAPON.WEAPON_CLASS, WEAPON_CLASS: WEAPON.WEAPON_CLASS,
COMBAT_PROGRESSION_DICE: DICE_VALUES, COMBAT_PROGRESSION_DICE: DICE_VALUES,
SHIELD_DEFENSE_DICE: DEFENSE_DICE_VALUES, SHIELD_DEFENSE_DICE: DEFENSE_DICE_VALUES,
WEAPON_CATEGORIES: WEAPON.WEAPON_CATEGORIES,
CHARACTERISTIC_ATTACK,
CHARACTERISTIC_DEFENSE,
CHARACTERISTIC_DAMAGE,
MONEY, MONEY,
ASCII, ASCII,
ROLL_TYPE, ROLL_TYPE,

View File

@@ -17,4 +17,19 @@ export const WEAPON_CLASS = {
"thrown": "LETHALFANTASY.Weapon.WeaponClass.thrown", "thrown": "LETHALFANTASY.Weapon.WeaponClass.thrown",
"polearm": "LETHALFANTASY.Weapon.WeaponClass.polearm", "polearm": "LETHALFANTASY.Weapon.WeaponClass.polearm",
"unarmed" : "LETHALFANTASY.Weapon.WeaponClass.unarmed" "unarmed" : "LETHALFANTASY.Weapon.WeaponClass.unarmed"
} }
export const WEAPON_CATEGORIES = {
"longblade": ["mediumblade", "shortblade"],
"shortblade": ["mediumblade", "longblade"],
"mediumblade": ["shortblade", "longblade"],
"axe": ["hammer", "mace", "flail", "bow", "sling", "thrown", "polearm"],
"hammer": ["axe", "mace", "flail", "bow", "sling", "thrown", "polearm"],
"mace": ["axe", "hammer", "flail", "bow", "sling", "thrown", "polearm"],
"flail": ["axe", "hammer", "mace", "bow", "sling", "thrown", "polearm"],
"bow": ["axe", "hammer", "mace", "flail", "sling", "thrown", "polearm"],
"sling": ["axe", "hammer", "mace", "flail", "bow", "thrown", "polearm"],
"thrown": ["axe", "hammer", "mace", "flail", "bow", "sling", "polearm"],
"polearm": ["axe", "hammer", "mace", "flail", "bow", "sling", "thrown"]
}

View File

@@ -11,11 +11,15 @@ export default class LethalFantasyRoll extends Roll {
get type() { get type() {
return this.options.type return this.options.type
} }
get titleFormula() { get titleFormula() {
return this.options.titleFormula return this.options.titleFormula
} }
get rollName() {
return this.options.rollName
}
get target() { get target() {
return this.options.target return this.options.target
} }
@@ -83,7 +87,7 @@ export default class LethalFantasyRoll extends Roll {
get rollTotal() { get rollTotal() {
return this.options.rollTotal return this.options.rollTotal
} }
get diceResults() { get diceResults() {
return this.options.diceResults return this.options.diceResults
} }
@@ -160,15 +164,44 @@ export default class LethalFantasyRoll extends Roll {
let hasModifier = true let hasModifier = true
let hasChangeDice = false let hasChangeDice = false
if (options.rollType === "challenge" || options.rollType === "save") { if (options.rollType === "challenge" || options.rollType === "save") {
if ( options.rollTarget.rollKey === "dying") { options.rollName = options.rollTarget.rollKey
if (options.rollTarget.rollKey === "dying") {
dice = options.rollTarget.value dice = options.rollTarget.value
maxValue = Number(options.rollTarget.value.match(/\d+/)[0]) maxValue = Number(options.rollTarget.value.match(/\d+/)[0])
hasModifier = false hasModifier = false
hasChangeDice = true hasChangeDice = true
} else { } else {
dice = "1D20" dice = "1D20"
maxValue = 20 maxValue = 20
} }
} else if (options.rollType === "skill") {
options.rollName = options.rollTarget.name
dice = "1D100"
baseFormula = "D100"
maxValue = 100
hasModifier = true
hasChangeDice = false
options.rollTarget.value = options.rollTarget.system.skillTotal
} else if (options.rollType === "weapon-attack" || options.rollType === "weapon-defense") {
options.rollName = options.rollTarget.name
dice = "1D20"
baseFormula = "D20"
maxValue = 20
hasModifier = true
hasChangeDice = false
if (options.rollType === "weapon-attack") {
options.rollTarget.value = options.rollTarget.combat.attackModifier + options.rollTarget.weaponSkillModifier
options.rollTarget.charModifier = options.rollTarget.combat.attackModifier
} else {
options.rollTarget.value = options.rollTarget.combat.defenseModifier + options.rollTarget.weaponSkillModifier
options.rollTarget.charModifier = options.rollTarget.combat.defenseModifier
}
}
if (options.rollType === "save" && options.rollTarget.rollKey === "pain") {
dice = options.rollTarget.rollDice
baseFormula = options.rollTarget.rollDice
hasModifier = false
} }
const rollModes = Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)])) const rollModes = Object.fromEntries(Object.entries(CONFIG.Dice.rollModes).map(([key, value]) => [key, game.i18n.localize(value)]))
@@ -188,6 +221,7 @@ export default class LethalFantasyRoll extends Roll {
let dialogContext = { let dialogContext = {
rollType: options.rollType, rollType: options.rollType,
rollTarget: options.rollTarget, rollTarget: options.rollTarget,
rollName: options.rollName,
rollModes, rollModes,
hasModifier, hasModifier,
hasChangeDice, hasChangeDice,
@@ -202,6 +236,7 @@ export default class LethalFantasyRoll extends Roll {
modifier, modifier,
targetName targetName
} }
console.log("dialogContext", dialogContext)
const content = await renderTemplate("systems/fvtt-lethal-fantasy/templates/roll-dialog.hbs", dialogContext) const content = await renderTemplate("systems/fvtt-lethal-fantasy/templates/roll-dialog.hbs", dialogContext)
const title = LethalFantasyRoll.createTitle(options.rollType, options.rollTarget) const title = LethalFantasyRoll.createTitle(options.rollType, options.rollTarget)
@@ -231,31 +266,38 @@ export default class LethalFantasyRoll extends Roll {
let fullModifier = 0 let fullModifier = 0
let titleFormula = "" let titleFormula = ""
dice = rollContext.changeDice || dice dice = rollContext.changeDice || dice
if (options.rollType === "challenge" || options.rollType === "save") { if (hasModifier) {
if (hasModifier) { let bonus = Number(options.rollTarget.value)
let bonus = Number(options.rollTarget.value) fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus
fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus if (fullModifier === 0) {
if (fullModifier === 0) {
modifierFormula = "0"
} else {
let modAbs = Math.abs(fullModifier)
modifierFormula = `d${modAbs + 1} - 1`
}
let sign = fullModifier < 0 ? "-" : "+"
titleFormula = `${dice}E ${sign} ${modifierFormula}`
} else {
modifierFormula = "0" modifierFormula = "0"
fullModifier = 0 } else {
baseFormula = `${dice}` let modAbs = Math.abs(fullModifier)
titleFormula = `${dice}E` modifierFormula = `d${modAbs + 1} - 1`
} }
let sign = fullModifier < 0 ? "-" : "+"
titleFormula = `${dice}E ${sign} ${modifierFormula}`
} else {
modifierFormula = "0"
fullModifier = 0
baseFormula = `${dice}`
titleFormula = `${dice}E`
} }
if (options.rollType === "save" && options.rollTarget.rollKey === "pain") {
baseFormula = options.rollTarget.rollDice
titleFormula = `${dice}`
modifierFormula = "0"
fullModifier = 0
}
maxValue = Number(baseFormula.match(/\d+$/)[0]) // Update the max value agains maxValue = Number(baseFormula.match(/\d+$/)[0]) // Update the max value agains
const rollData = { const rollData = {
type: options.rollType, type: options.rollType,
rollType: options.rollType, rollType: options.rollType,
target: options.rollTarget, target: options.rollTarget,
rollName: options.rollName,
actorId: options.actorId, actorId: options.actorId,
actorName: options.actorName, actorName: options.actorName,
actorImage: options.actorImage, actorImage: options.actorImage,
@@ -284,28 +326,22 @@ export default class LethalFantasyRoll extends Roll {
let rollTotal = -1 let rollTotal = -1
let diceResults = [] let diceResults = []
let resultType let resultType
if (options.rollType === "challenge" || options.rollType === "save") { let diceResult = rollBase.dice[0].results[0].result
let diceResult = rollBase.dice[0].results[0].result diceResults.push({ dice: `${dice}`, value: diceResult })
diceResults.push({ dice: `${dice}`, value: diceResult}) let diceSum = diceResult
let diceSum = diceResult while (diceResult === maxValue) {
while (diceResult === maxValue) { let r = await new Roll(baseFormula).evaluate()
let r = await new Roll(baseFormula).evaluate() diceResult = r.dice[0].results[0].result
diceResult = r.dice[0].results[0].result diceResults.push({ dice: `${dice}-1`, value: diceResult - 1 })
diceResults.push( {dice: `${dice}-1`, value: diceResult-1}) diceSum += (diceResult - 1)
diceSum += (diceResult - 1) }
} if (fullModifier !== 0) {
if (fullModifier !== 0) { diceResults.push({ dice: `${rollModifier.formula}`, value: rollModifier.total })
diceResults.push({ dice: `${rollModifier.formula}`, value: rollModifier.total }) if (fullModifier < 0) {
if ( fullModifier < 0) { rollTotal = Math.max(diceSum - rollModifier.total, 0)
rollTotal = Math.max(diceSum - rollModifier.total, 0)
} else {
rollTotal = diceSum + rollModifier.total
}
} else { } else {
rollTotal = diceSum rollTotal = diceSum + rollModifier.total
} }
} else if (options.rollType === ROLL_TYPE.RESOURCE) {
//resultType = roll.total === 1 || roll.total === 2 ? "failure" : "success"
} }
rollBase.options.resultType = resultType rollBase.options.resultType = resultType
@@ -343,12 +379,16 @@ export default class LethalFantasyRoll extends Roll {
return `${game.i18n.localize("LETHALFANTASY.Label.titleChallenge")}` return `${game.i18n.localize("LETHALFANTASY.Label.titleChallenge")}`
case "save": case "save":
return `${game.i18n.localize("LETHALFANTASY.Label.titleSave")}` return `${game.i18n.localize("LETHALFANTASY.Label.titleSave")}`
case ROLL_TYPE.DAMAGE: case "skill":
return `${game.i18n.localize("LETHALFANTASY.Dialog.titleDamage")} : ${target}` return `${game.i18n.localize("LETHALFANTASY.Label.titleSkill")}`
case ROLL_TYPE.ATTACK: case "weapon-attack":
return `${game.i18n.localize("LETHALFANTASY.Dialog.titleAttack")} : ${target}` return `${game.i18n.localize("LETHALFANTASY.Label.weapon-attack")}`
case "weapon-defense":
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-defense")}`
case "weapon-damage":
return `${game.i18n.localize("LETHALFANTASY.Label.weapon-damage")}`
default: default:
return game.i18n.localize("LETHALFANTASY.Dialog.titleStandard") return game.i18n.localize("LETHALFANTASY.Label.titleStandard")
} }
} }
@@ -393,6 +433,7 @@ export default class LethalFantasyRoll extends Roll {
isGM: game.user.isGM, isGM: game.user.isGM,
formula: this.formula, formula: this.formula,
titleFormula: this.titleFormula, titleFormula: this.titleFormula,
rollName: this.rollName,
rollType: this.type, rollType: this.type,
rollTarget: this.rollTarget, rollTarget: this.rollTarget,
total: this.rollTotal, total: this.rollTotal,

View File

@@ -95,11 +95,16 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
schema.developmentPoints = new fields.SchemaField({ schema.developmentPoints = new fields.SchemaField({
total: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }), total: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
remaining: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }) remaining: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
}) })
schema.spellMiraclePoints = new fields.SchemaField({ schema.spellMiraclePoints = new fields.SchemaField({
total: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }), total: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
used: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }) used: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
}) })
schema.combat = new fields.SchemaField({
attackModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
defenseModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
damageModifier: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
})
const moneyField = (label) => { const moneyField = (label) => {
const schema = { const schema = {
@@ -132,7 +137,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
let strDef = SYSTEM.CHARACTERISTICS_TABLES.str.find(s => s.value === this.characteristics.str.value) let strDef = SYSTEM.CHARACTERISTICS_TABLES.str.find(s => s.value === this.characteristics.str.value)
this.challenges.str.value = strDef.challenge this.challenges.str.value = strDef.challenge
let dexDef = SYSTEM.CHARACTERISTICS_TABLES.dex.find(s => s.value === this.characteristics.dex.value) let dexDef = SYSTEM.CHARACTERISTICS_TABLES.dex.find(s => s.value === this.characteristics.dex.value)
this.challenges.agility.value = dexDef.challenge this.challenges.agility.value = dexDef.challenge
this.saves.dodge.value = dexDef.dodge this.saves.dodge.value = dexDef.dodge
@@ -147,8 +152,27 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
this.saves.contagion.value = this.characteristics.con.value this.saves.contagion.value = this.characteristics.con.value
this.saves.poison.value = this.characteristics.con.value this.saves.poison.value = this.characteristics.con.value
this.combat.attackModifier = 0
for (let chaKey of SYSTEM.CHARACTERISTIC_ATTACK) {
let chaDef = SYSTEM.CHARACTERISTICS_TABLES[chaKey].find(s => s.value === this.characteristics[chaKey].value)
this.combat.attackModifier += chaDef.attack
}
this.combat.defenseModifier = 0
for (let chaKey of SYSTEM.CHARACTERISTIC_DEFENSE) {
let chaDef = SYSTEM.CHARACTERISTICS_TABLES[chaKey].find(s => s.value === this.characteristics[chaKey].value)
this.combat.defenseModifier += chaDef.defense
}
this.combat.damageModifier = 0
for (let chaKey of SYSTEM.CHARACTERISTIC_DAMAGE) {
let chaDef = SYSTEM.CHARACTERISTICS_TABLES[chaKey].find(s => s.value === this.characteristics[chaKey].value)
this.combat.damageModifier += chaDef.damage
}
} }
/** /**
* Rolls a dice for a character. * Rolls a dice for a character.
* @param {("save"|"resource|damage")} rollType The type of the roll. * @param {("save"|"resource|damage")} rollType The type of the roll.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
packs/lf-gifts/MANIFEST-000066 LFS Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
packs/lf-skills/MANIFEST-000070 LFS Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -212,6 +212,12 @@
min-width: 5rem; min-width: 5rem;
max-width: 5rem; max-width: 5rem;
margin-left: 0.7rem; margin-left: 0.7rem;
}
.name-pain {
flex: 0;
min-width: 3rem;
max-width: 3rem;
margin-left: 0.7rem;
} }
.form-group { .form-group {
flex: 0; flex: 0;
@@ -317,8 +323,8 @@
align-items: center; align-items: center;
gap: 10px; gap: 10px;
.item-img { .item-img {
width: 50px; width: 32px;
height: 50px; height: 32px;
} }
.name { .name {
min-width: 12rem; min-width: 12rem;
@@ -327,29 +333,35 @@
} }
.gifts { .gifts {
display: grid; display: grid;
grid-template-columns: repeat(5, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 10px; gap: 10px;
.gift { .gift {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; gap: 10px;
.item-img { .item-img {
width: 50px; width: 32px;
height: 50px; height: 32px;
}
.name {
min-width: 12rem;
} }
} }
} }
.vulnerabilities { .vulnerabilities {
display: grid; display: grid;
grid-template-columns: repeat(5, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 10px; gap: 10px;
.vulnerability { .vulnerability {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; gap: 10px;
.item-img { .item-img {
width: 50px; width: 32px;
height: 50px; height: 32px;
}
.name {
min-width: 12rem;
} }
} }
} }
@@ -366,17 +378,24 @@
.weapons { .weapons {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(2, 1fr);
gap: 10px; gap: 10px;
.weapon { .weapon {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; gap: 10px;
.item-img { .item-img {
width: 50px; width: 32px;
height: 50px; height: 32px;
margin: 5px 0 0 0; margin: 5px 0 0 0;
} }
.name {
min-width: 12rem;
}
.attack-icons a {
margin-left: 8px;
margin-right: 8px;
}
} }
} }
.armors { .armors {
@@ -388,11 +407,35 @@
align-items: center; align-items: center;
gap: 10px; gap: 10px;
.item-img { .item-img {
width: 50px; width: 32px;
height: 50px; height: 32px;
margin: 5px 0 0 0; margin: 5px 0 0 0;
} }
} }
.name {
min-width: 12rem;
}
}
.equipments {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
.equipment{
display: flex;
align-items: center;
gap: 10px;
.item-img {
width: 32px;
height: 32px;
margin: 5px 0 0 0;
}
.name {
min-width: 12rem;
}
}
.name {
min-width: 12rem;
}
} }
} }

View File

@@ -28,15 +28,18 @@
} }
} }
.main,
.dialog-damage, .dialog-damage,
.dialog-resource, .dialog-resource,
.dialog-challenge, .dialog-challenge,
.dialog-save { .dialog-save {
margin-bottom: 0px;
padding-bottom: 0px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-family: var(--font-secondary); font-family: var(--font-secondary);
font-size: calc(var(--font-size-standard) * 1.2); font-size: calc(var(--font-size-standard) * 1.0);
color: var(--color-dark-1); color: var(--color-dark-1);
} }

View File

@@ -1,5 +1,5 @@
<section class="character-main character-main-{{ifThen isPlayMode 'play' 'edit'}}"> <section class="character-main character-main-{{ifThen isPlayMode 'play' 'edit'}}">
{{!log "character-main" this}} {{log "character-main" this}}
<fieldset> <fieldset>
<legend>{{localize "LETHALFANTASY.Label.pc"}}</legend> <legend>{{localize "LETHALFANTASY.Label.pc"}}</legend>
@@ -21,9 +21,6 @@
<span class="name">{{localize "LETHALFANTASY.Label.perception"}}</span> <span class="name">{{localize "LETHALFANTASY.Label.perception"}}</span>
{{formInput systemFields.perception.fields.value value=system.perception.value disabled=isPlayMode {{formInput systemFields.perception.fields.value value=system.perception.value disabled=isPlayMode
classes="character-hp"}} classes="character-hp"}}
<span class="name">{{localize "LETHALFANTASY.Label.bonus"}}</span>
{{formInput systemFields.perception.fields.bonus value=system.perception.bonus disabled=isPlayMode
classes="character-hp"}}
</div> </div>
<div class="flexrow character-hp"> <div class="flexrow character-hp">
<span class="name">{{localize "LETHALFANTASY.Label.grit"}}</span> <span class="name">{{localize "LETHALFANTASY.Label.grit"}}</span>
@@ -61,8 +58,7 @@
class="lf-roll-small fa-solid fa-dice-d20"></i> class="lf-roll-small fa-solid fa-dice-d20"></i>
{{localize "LETHALFANTASY.Label.saves.will"}} {{localize "LETHALFANTASY.Label.saves.will"}}
</a></span> </a></span>
{{formField systemFields.saves.fields.will.fields.value value=system.saves.will.value {{formField systemFields.saves.fields.will.fields.value value=system.saves.will.value disabled=true}}
disabled=isPlayMode}}
<span class="name"> <span class="name">
<a class="rollable" data-roll-type="save" data-roll-key="dodge"><i <a class="rollable" data-roll-type="save" data-roll-key="dodge"><i
class="lf-roll-small fa-solid fa-dice-d20"></i> class="lf-roll-small fa-solid fa-dice-d20"></i>
@@ -70,7 +66,7 @@
</a> </a>
</span> </span>
{{formField systemFields.saves.fields.dodge.fields.value value=system.saves.dodge.value {{formField systemFields.saves.fields.dodge.fields.value value=system.saves.dodge.value
disabled=isPlayMode}} disabled=true}}
<span class="name"> <span class="name">
<a class="rollable" data-roll-type="save" data-roll-key="toughness"><i <a class="rollable" data-roll-type="save" data-roll-key="toughness"><i
class="lf-roll-small fa-solid fa-dice-d20"></i> class="lf-roll-small fa-solid fa-dice-d20"></i>
@@ -78,7 +74,7 @@
</a> </a>
</span> </span>
{{formField systemFields.saves.fields.toughness.fields.value value=system.saves.toughness.value {{formField systemFields.saves.fields.toughness.fields.value value=system.saves.toughness.value
disabled=isPlayMode}} disabled=true}}
</div> </div>
<div class="character-save"> <div class="character-save">
<span class="name"> <span class="name">
@@ -88,7 +84,7 @@
</a> </a>
</span> </span>
{{formField systemFields.saves.fields.contagion.fields.value value=system.saves.contagion.value {{formField systemFields.saves.fields.contagion.fields.value value=system.saves.contagion.value
disabled=isPlayMode }} disabled=true}}
<span class="name"> <span class="name">
<a class="rollable" data-roll-type="save" data-roll-key="poison"><i <a class="rollable" data-roll-type="save" data-roll-key="poison"><i
@@ -97,13 +93,21 @@
</a> </a>
</span> </span>
{{formField systemFields.saves.fields.poison.fields.value value=system.saves.poison.value {{formField systemFields.saves.fields.poison.fields.value value=system.saves.poison.value
disabled=isPlayMode }} disabled=true }}
<span class="name"> <span class="name-pain">
<a class="rollable" data-roll-type="save" data-roll-key="pain"><i <a class="rollable" data-roll-type="save" data-roll-key="pain" data-roll-dice="D12"><i
class="lf-roll-small fa-solid fa-dice-d12"></i>
{{localize "LETHALFANTASY.Label.saves.pain"}}
</a>
</span>
<span class="name-pain">
<a class="rollable" data-roll-type="save" data-roll-key="pain" data-roll-dice="D20"><i
class="lf-roll-small fa-solid fa-dice-d20"></i> class="lf-roll-small fa-solid fa-dice-d20"></i>
{{localize "LETHALFANTASY.Label.saves.pain"}}</span> {{localize "LETHALFANTASY.Label.saves.pain"}}
{{formField systemFields.saves.fields.pain.fields.value value=system.saves.pain.value disabled=isPlayMode}} </a>
</span>
{{formField systemFields.saves.fields.pain.fields.value value=system.saves.pain.value disabled=true}}
</div> </div>
</div> </div>
</fieldset> </fieldset>
@@ -116,19 +120,19 @@
class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
"LETHALFANTASY.Label.challenges.strength"}}</a></span> "LETHALFANTASY.Label.challenges.strength"}}</a></span>
{{formField systemFields.challenges.fields.str.fields.value value=system.challenges.str.value {{formField systemFields.challenges.fields.str.fields.value value=system.challenges.str.value
disabled=isPlayMode disabled=true
}} }}
<span class="name"><a class="rollable" data-roll-type="challenge" data-roll-key="agility"><i <span class="name"><a class="rollable" data-roll-type="challenge" data-roll-key="agility"><i
class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
"LETHALFANTASY.Label.challenges.agility"}}</a></span> "LETHALFANTASY.Label.challenges.agility"}}</a></span>
{{formField systemFields.challenges.fields.agility.fields.value value=system.challenges.agility.value {{formField systemFields.challenges.fields.agility.fields.value value=system.challenges.agility.value
disabled=isPlayMode disabled=true
}} }}
<span class="name"><a class="rollable" data-roll-type="challenge" data-roll-key="dying"><i <span class="name"><a class="rollable" data-roll-type="challenge" data-roll-key="dying"><i
class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
"LETHALFANTASY.Label.challenges.dying"}}</a></span> "LETHALFANTASY.Label.challenges.dying"}}</a></span>
{{formField systemFields.challenges.fields.dying.fields.value value=system.challenges.dying.value {{formField systemFields.challenges.fields.dying.fields.value value=system.challenges.dying.value
disabled=isPlayMode }} disabled=true }}
</div> </div>
</div> </div>
</fieldset> </fieldset>
@@ -141,10 +145,10 @@
{{formField systemFields.movement.fields.walk value=system.movement.walk disabled=isPlayMode}} {{formField systemFields.movement.fields.walk value=system.movement.walk disabled=isPlayMode}}
<span class="name">{{localize "LETHALFANTASY.Label.movement.jog"}}</span> <span class="name">{{localize "LETHALFANTASY.Label.movement.jog"}}</span>
{{formField systemFields.movement.fields.jog value=system.challenges.movement.jog disabled=isPlayMode}} {{formField systemFields.movement.fields.jog value=system.challenges.movement.jog disabled=isPlayMode}}
<span class="name">{{localize "LETHALFANTASY.Label.movement.sprint"}}</span>
{{formField systemFields.movement.fields.sprint value=system.movement.sprint disabled=isPlayMode}}
<span class="name">{{localize "LETHALFANTASY.Label.movement.run"}}</span> <span class="name">{{localize "LETHALFANTASY.Label.movement.run"}}</span>
{{formField systemFields.movement.fields.run value=system.movement.run disabled=isPlayMode}} {{formField systemFields.movement.fields.run value=system.movement.run disabled=isPlayMode}}
<span class="name">{{localize "LETHALFANTASY.Label.movement.sprint"}}</span>
{{formField systemFields.movement.fields.sprint value=system.movement.sprint disabled=isPlayMode}}
</div> </div>
</div> </div>
</fieldset> </fieldset>
@@ -220,14 +224,4 @@
</div> </div>
</fieldset> </fieldset>
<fieldset class="character-resources character-resources-{{ifThen isPlayMode 'play' 'edit'}}">
<legend>{{localize "LETHALFANTASY.Label.resources"}}</legend>
<div class="character-resource" data-drag="true" data-drag-type="resource">
</div>
<div class="character-resource" data-drag="true" data-drag-type="resource">
</div>
<div class="character-resource" data-drag="true" data-drag-type="resource">
</div>
</fieldset>
</section> </section>

View File

@@ -7,8 +7,11 @@
{{#each skills as |item|}} {{#each skills as |item|}}
<div class="skill " data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}"> <div class="skill " data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" /> <img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
<div class="name" > <div class="name">
{{item.name}} <a class="rollable" data-roll-type="skill" data-roll-key="{{item.id}}">
<i class="lf-roll-small fa-duotone fa-solid fa-dice-d10"></i>
{{item.name}}
</a>
</div> </div>
<div class="score"> <div class="score">
+{{item.system.skillTotal}} +{{item.system.skillTotal}}
@@ -49,7 +52,7 @@
<legend data-tooltip="{{localize " LETHALFANTASY.Tooltip.vulnerabilities"}}" data-tooltip-direction="UP">{{localize <legend data-tooltip="{{localize " LETHALFANTASY.Tooltip.vulnerabilities"}}" data-tooltip-direction="UP">{{localize
"LETHALFANTASY.Label.vulnerabilities"}}</legend> "LETHALFANTASY.Label.vulnerabilities"}}</legend>
<div class="vulnerabilities"> <div class="vulnerabilities">
{{#each gifts as |item|}} {{#each vulnerabilities as |item|}}
<div class="vulnerability " data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}"> <div class="vulnerability " data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" /> <img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
<div class="name" data-tooltip="{{{item.description}}}<br><br>{{item.path}}" data-tooltip-direction="UP"> <div class="name" data-tooltip="{{{item.description}}}<br><br>{{item.path}}" data-tooltip-direction="UP">

View File

@@ -1,20 +1,34 @@
<section class="tab character-{{tab.id}} {{tab.cssClass}}" data-tab="{{tab.id}}" data-group="{{tab.group}}"> <section class="tab character-{{tab.id}} {{tab.cssClass}}" data-tab="{{tab.id}}" data-group="{{tab.group}}">
<fieldset> <fieldset>
<legend>{{localize "LETHALFANTASY.Label.equipment"}}{{#if isEditMode}}<a class="action" data-tooltip="{{localize " <legend>{{localize "LETHALFANTASY.Label.weapons"}}</legend>
LETHALFANTASY.Tooltip.addEquipment"}}" data-tooltip-direction="UP"><i class="fas fa-plus"
data-action="createEquipment"></i></a>{{/if}}</legend>
<div class="weapons"> <div class="weapons">
{{#each weapons as |item|}} {{#each weapons as |item|}}
{{!log 'weapon' this}}
<div class="weapon" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-drag="true" <div class="weapon" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-drag="true"
data-drag-type="damage"> data-drag-type="damage">
{{#if (ne item.img "icons/svg/item-bag.svg")}} {{#if (ne item.img "icons/svg/item-bag.svg")}}
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" /> <img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
{{/if}} {{/if}}
<div class="name" data-tooltip="{{{item.system.description}}}"> <div class="name">
{{item.name}} {{item.name}}
</div> </div>
<div class="attack-icons">
<a class="rollable" data-roll-type="weapon-attack" data-roll-key="{{item.id}}" data-tooltip="Roll Attack">
<i class="lf-roll-small fa-solid fa-swords" data-roll-type="weapon-attack" data-roll-key="{{item.id}}"></i>
</a>
<a class="rollable" data-roll-type="weapon-defense" data-roll-key="{{item.id}}" data-tooltip="Roll Defense">
<i class="fa-solid fa-shield-halved" data-roll-type="weapon-defense" data-roll-key="{{item.id}}"></i>
</a>
<a class="rollable" data-roll-type="weapon-damage" data-roll-key="{{item.id}}" data-tooltip="Roll Damage">
<i class="fa-regular fa-face-head-bandage" data-roll-type="weapon-damage" data-roll-key="{{item.id}}"></i>
</a>
</div>
<div class="controls"> <div class="controls">
<a data-tooltip="{{localize 'LETHALFANTASY.Edit'}}" data-action="edit" data-item-id="{{item.id}}" <a data-tooltip="{{localize 'LETHALFANTASY.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a> data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
@@ -24,10 +38,12 @@
</div> </div>
{{/each}} {{/each}}
</div> </div>
</fieldset>
<fieldset>
<legend>{{localize "LETHALFANTASY.Label.armors"}}</legend>
<div class="armors"> <div class="armors">
{{#each armors as |item|}} {{#each armors as |item|}}
{{!log 'armor' this}}
<div class="armor" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}"> <div class="armor" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" /> <img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
<div class="name" data-tooltip="{{{item.system.description}}}"> <div class="name" data-tooltip="{{{item.system.description}}}">
@@ -44,5 +60,25 @@
</div> </div>
</fieldset> </fieldset>
<fieldset>
<legend>{{localize "LETHALFANTASY.Label.equipment"}}</legend>
<div class="equipments">
{{#each equipments as |item|}}
<div class="equipment" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
<div class="name" data-tooltip="{{{item.system.description}}}">
{{item.name}}
</div>
<div class="controls">
<a data-tooltip="{{localize 'LETHALFANTASY.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
<a data-tooltip="{{localize 'LETHALFANTASY.Delete'}}" data-action="delete" data-item-id="{{item.id}}"
data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>
</div>
</div>
{{/each}}
</div>
</fieldset>
</section> </section>

View File

@@ -5,13 +5,19 @@
<img src="{{actingCharImg}}" data-tooltip="{{actingCharName}}" /> <img src="{{actingCharImg}}" data-tooltip="{{actingCharName}}" />
</div> </div>
<div class="intro-right"> <div class="intro-right">
<span>{{upperFirst rollType}} : {{upperCase rollTarget.rollKey}}</span> <span>{{upperFirst rollName}} : {{upperCase rollTarget.rollKey}}</span>
{{#if rollTarget.weapon}}
<span>{{rollTarget.weapon.name}}</span>
{{/if}}
<span>Formula : {{titleFormula}}</span> <span>Formula : {{titleFormula}}</span>
{{#each diceResults as |result|}} {{#each diceResults as |result|}}
<span>{{result.dice}} : {{result.value}}</span> <span>{{result.dice}} : {{result.value}}</span>
{{/each}} {{/each}}
</div> </div>
</div> </div>
{{#if isSave}} {{#if isSave}}

View File

@@ -1,16 +1,18 @@
{{log "roll-dialog" this}} {{log "roll-dialog" this}}
<div class="lethalfantasy-roll-dialog"> <div class="lethalfantasy-roll-dialog">
<fieldSet> <fieldSet class="">
{{#if (eq rollType "challenge")}} <legend>{{localize (concat "LETHALFANTASY.Label." rollType)}}</legend>
<legend>{{localize "LETHALFANTASY.Label.challenge"}}</legend>
{{else}}
<legend>{{localize "LETHALFANTASY.Label.save"}}</legend>
{{/if}}
{{#if hasModifier}} {{#if hasModifier}}
<div class="dialog-save">{{upperCase rollTarget.rollKey}} : {{baseFormula}} + {{baseValue}}</div> <div class="dialog-save">{{upperCase rollName}} : {{baseFormula}} + {{baseValue}}</div>
{{else}} {{else}}
<div class="dialog-save">{{upperCase rollTarget.rollKey}} : {{baseFormula}}</div> <div class="dialog-save">{{upperCase rollName}} : {{baseFormula}}</div>
{{/if}}
{{#if rollTarget.weapon}}
<div class="dialog-save">{{localize "LETHALFANTASY.Label.baseModifier"}} : {{rollTarget.charModifier}}</div>
<div class="dialog-save">{{localize "LETHALFANTASY.Label.weapon"}} : {{rollTarget.weapon.name}}</div>
<div class="dialog-save">{{localize "LETHALFANTASY.Label.skill"}} : {{rollTarget.name}}</div>
<div class="dialog-save">{{localize "LETHALFANTASY.Label.skillBonus"}} : {{rollTarget.weaponSkillModifier}}</div>
{{/if}} {{/if}}
</fieldSet> </fieldSet>