Add skill+weapon rolls

This commit is contained in:
LeRatierBretonnien 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,

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

@ -18,3 +18,18 @@ export const WEAPON_CLASS = {
"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

@ -16,6 +16,10 @@ export default class LethalFantasyRoll extends Roll {
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
} }
@ -160,6 +164,7 @@ 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") {
options.rollName = options.rollTarget.rollKey
if (options.rollTarget.rollKey === "dying") { 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])
@ -169,6 +174,34 @@ export default class LethalFantasyRoll extends Roll {
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,7 +266,6 @@ 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
@ -249,13 +283,21 @@ export default class LethalFantasyRoll extends Roll {
baseFormula = `${dice}` baseFormula = `${dice}`
titleFormula = `${dice}E` 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,7 +326,6 @@ 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
@ -301,11 +342,6 @@ export default class LethalFantasyRoll extends Roll {
} else { } else {
rollTotal = diceSum + rollModifier.total rollTotal = diceSum + rollModifier.total
} }
} else {
rollTotal = diceSum
}
} 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

@ -100,6 +100,11 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
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 = {
@ -147,6 +152,25 @@ 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
}
} }
/** /**

BIN
packs/lf-equipment/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/MANIFEST-000046 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-equipment/MANIFEST-000070 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
packs/lf-gifts/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/MANIFEST-000042 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-gifts/MANIFEST-000066 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
packs/lf-skills/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/MANIFEST-000046 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-skills/MANIFEST-000070 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
packs/lf-vulnerabilities/CURRENT (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/LOG (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/LOG.old (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/MANIFEST-000042 (Stored with Git LFS)

Binary file not shown.

BIN
packs/lf-vulnerabilities/MANIFEST-000066 (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -213,6 +213,12 @@
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;
padding-left: 5px; padding-left: 5px;
@ -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

@ -8,7 +8,10 @@
<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">
<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}} {{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,17 +1,51 @@
<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">
{{item.name}}
</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">
<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>
<fieldset>
<legend>{{localize "LETHALFANTASY.Label.armors"}}</legend>
<div class="armors">
{{#each armors as |item|}}
<div class="armor" 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}}}"> <div class="name" data-tooltip="{{{item.system.description}}}">
{{item.name}} {{item.name}}
</div> </div>
@ -24,11 +58,13 @@
</div> </div>
{{/each}} {{/each}}
</div> </div>
</fieldset>
<div class="armors"> <fieldset>
{{#each armors as |item|}} <legend>{{localize "LETHALFANTASY.Label.equipment"}}</legend>
{{!log 'armor' this}} <div class="equipments">
<div class="armor" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}"> {{#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}}" /> <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}}}">
{{item.name}} {{item.name}}

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>