Add skill+weapon rolls
This commit is contained in:
+60
-14
@@ -327,6 +327,12 @@ i.lethalfantasy {
|
||||
max-width: 5rem;
|
||||
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 {
|
||||
flex: 0;
|
||||
padding-left: 5px;
|
||||
@@ -418,15 +424,15 @@ i.lethalfantasy {
|
||||
gap: 10px;
|
||||
}
|
||||
.lethalfantasy .tab.character-skills .skills .skill .item-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.lethalfantasy .tab.character-skills .skills .skill .name {
|
||||
min-width: 12rem;
|
||||
}
|
||||
.lethalfantasy .tab.character-skills .gifts {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 10px;
|
||||
}
|
||||
.lethalfantasy .tab.character-skills .gifts .gift {
|
||||
@@ -435,12 +441,15 @@ i.lethalfantasy {
|
||||
gap: 10px;
|
||||
}
|
||||
.lethalfantasy .tab.character-skills .gifts .gift .item-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.lethalfantasy .tab.character-skills .gifts .gift .name {
|
||||
min-width: 12rem;
|
||||
}
|
||||
.lethalfantasy .tab.character-skills .vulnerabilities {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 10px;
|
||||
}
|
||||
.lethalfantasy .tab.character-skills .vulnerabilities .vulnerability {
|
||||
@@ -449,8 +458,11 @@ i.lethalfantasy {
|
||||
gap: 10px;
|
||||
}
|
||||
.lethalfantasy .tab.character-skills .vulnerabilities .vulnerability .item-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.lethalfantasy .tab.character-skills .vulnerabilities .vulnerability .name {
|
||||
min-width: 12rem;
|
||||
}
|
||||
.lethalfantasy .tab.character-weapons {
|
||||
display: grid;
|
||||
@@ -462,7 +474,7 @@ i.lethalfantasy {
|
||||
}
|
||||
.lethalfantasy .tab.character-weapons .weapons {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 10px;
|
||||
}
|
||||
.lethalfantasy .tab.character-weapons .weapons .weapon {
|
||||
@@ -471,10 +483,17 @@ i.lethalfantasy {
|
||||
gap: 10px;
|
||||
}
|
||||
.lethalfantasy .tab.character-weapons .weapons .weapon .item-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
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 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
@@ -486,10 +505,34 @@ i.lethalfantasy {
|
||||
gap: 10px;
|
||||
}
|
||||
.lethalfantasy .tab.character-weapons .armors .armor .item-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
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 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
@@ -1410,15 +1453,18 @@ i.lethalfantasy {
|
||||
width: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
.main,
|
||||
.dialog-damage,
|
||||
.dialog-resource,
|
||||
.dialog-challenge,
|
||||
.dialog-save {
|
||||
margin-bottom: 0px;
|
||||
padding-bottom: 0px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
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);
|
||||
}
|
||||
.dice-roll {
|
||||
|
||||
+14
-25
@@ -480,7 +480,15 @@
|
||||
"Label": {
|
||||
"titleChallenge": "Challenge",
|
||||
"titleSave": "Save",
|
||||
"titleSkill": "Skill",
|
||||
"skill" : "Skill",
|
||||
"Movement": "Movement",
|
||||
"weapon-attack": "Weapon attack",
|
||||
"weapon-damage": "Weapon damage",
|
||||
"weapon-defense": "Weapon defense",
|
||||
"baseModifier": "Base modifier",
|
||||
"weapon": "Weapon",
|
||||
"skillBonus": "Skill bonus",
|
||||
"movement": {
|
||||
"walk": "Walk",
|
||||
"run": "Run",
|
||||
@@ -543,7 +551,8 @@
|
||||
"luc": "LUC",
|
||||
"app": "APP",
|
||||
"cha": "CHA",
|
||||
"challenge": "Challenge"
|
||||
"challenge": "Challenge",
|
||||
"armors": "Armors"
|
||||
},
|
||||
"Edit": "Edit",
|
||||
"Delete": "Delete",
|
||||
@@ -574,30 +583,10 @@
|
||||
"fortune": "Roue de Fortune",
|
||||
"fortuneHint": "Valeur de la roue de Fortune. Nombre de joueurs + 1 en début de partie."
|
||||
},
|
||||
"Chat": {
|
||||
"askFortune": "{name} veut utiliser un point de Fortune !",
|
||||
"askRollForAll": "Jet de {value}",
|
||||
"askRollForOne": "Jet de {value} pour {name}"
|
||||
},
|
||||
"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"
|
||||
"Notifications": {
|
||||
"rollFromWeapon": "Roll from an equipped weapon",
|
||||
"skillNotFound": "Skill not found",
|
||||
"rollTypeNotFound": "Roll type not found"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
||||
case "skills":
|
||||
context.tab = context.tabs.skills
|
||||
context.skills = doc.itemTypes.skill
|
||||
context.gifts = doc.itemTypes.gifts
|
||||
context.gifts = doc.itemTypes.gift
|
||||
context.vulnerabilities = doc.itemTypes.vulnerability
|
||||
break
|
||||
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.
|
||||
*
|
||||
@@ -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
|
||||
* corresponding value from the document's system and performs the roll.
|
||||
*/
|
||||
|
||||
async _onRoll(event, target) {
|
||||
if (this.isEditMode) return
|
||||
console.log(event, target)
|
||||
const rollType = event.target.dataset.rollType
|
||||
let rollTarget
|
||||
let rollKey = event.target.dataset.rollKey
|
||||
@@ -181,11 +208,59 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
||||
case "save":
|
||||
rollTarget = foundry.utils.duplicate(this.document.system.saves[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
|
||||
case ROLL_TYPE.DAMAGE:
|
||||
rollTarget = elt.dataset.itemId
|
||||
break
|
||||
default:
|
||||
ui.notifications.error(game.i18n.localize("LETHALFANTASY.Notifications.rollTypeNotFound") + String(rollType))
|
||||
break
|
||||
}
|
||||
await this.document.system.roll(rollType, rollTarget)
|
||||
|
||||
@@ -6,8 +6,8 @@ export const TABLES = {
|
||||
"str": [
|
||||
{
|
||||
"value": 1,
|
||||
"damage_modifier": -7,
|
||||
"attack_modifier": -4,
|
||||
"damage": -7,
|
||||
"attack": -4,
|
||||
"challenge": -9,
|
||||
"aether_points": -20,
|
||||
"hp": -3,
|
||||
@@ -17,8 +17,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 2,
|
||||
"damage_modifier": -6,
|
||||
"attack_modifier": -4,
|
||||
"damage": -6,
|
||||
"attack": -4,
|
||||
"challenge": -8,
|
||||
"aether_points": -20,
|
||||
"hp": -2,
|
||||
@@ -28,8 +28,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 3,
|
||||
"damage_modifier": -5,
|
||||
"attack_modifier": -3,
|
||||
"damage": -5,
|
||||
"attack": -3,
|
||||
"challenge": -7,
|
||||
"aether_points": -20,
|
||||
"hp": -1,
|
||||
@@ -39,8 +39,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 4,
|
||||
"damage_modifier": -4,
|
||||
"attack_modifier": -3,
|
||||
"damage": -4,
|
||||
"attack": -3,
|
||||
"challenge": -6,
|
||||
"aether_points": -20,
|
||||
"hp": -1,
|
||||
@@ -50,8 +50,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 5,
|
||||
"damage_modifier": -3,
|
||||
"attack_modifier": -2,
|
||||
"damage": -3,
|
||||
"attack": -2,
|
||||
"challenge": -5,
|
||||
"aether_points": -20,
|
||||
"hp": 0,
|
||||
@@ -61,8 +61,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 6,
|
||||
"damage_modifier": -2,
|
||||
"attack_modifier": -1,
|
||||
"damage": -2,
|
||||
"attack": -1,
|
||||
"challenge": -4,
|
||||
"aether_points": -10,
|
||||
"hp": 0,
|
||||
@@ -72,8 +72,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 7,
|
||||
"damage_modifier": -2,
|
||||
"attack_modifier": 0,
|
||||
"damage": -2,
|
||||
"attack": 0,
|
||||
"challenge": -3,
|
||||
"aether_points": -10,
|
||||
"hp": 0,
|
||||
@@ -83,8 +83,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 8,
|
||||
"damage_modifier": -1,
|
||||
"attack_modifier": 0,
|
||||
"damage": -1,
|
||||
"attack": 0,
|
||||
"challenge": -2,
|
||||
"aether_points": 0,
|
||||
"hp": 0,
|
||||
@@ -94,8 +94,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 9,
|
||||
"damage_modifier": -1,
|
||||
"attack_modifier": 0,
|
||||
"damage": -1,
|
||||
"attack": 0,
|
||||
"challenge": -1,
|
||||
"aether_points": 0,
|
||||
"hp": 0,
|
||||
@@ -105,8 +105,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 10,
|
||||
"damage_modifier": 0,
|
||||
"attack_modifier": 0,
|
||||
"damage": 0,
|
||||
"attack": 0,
|
||||
"challenge": 0,
|
||||
"aether_points": 0,
|
||||
"hp": 0,
|
||||
@@ -116,8 +116,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 11,
|
||||
"damage_modifier": 0,
|
||||
"attack_modifier": 0,
|
||||
"damage": 0,
|
||||
"attack": 0,
|
||||
"challenge": 0,
|
||||
"aether_points": 0,
|
||||
"hp": 0,
|
||||
@@ -127,8 +127,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 12,
|
||||
"damage_modifier": 1,
|
||||
"attack_modifier": 0,
|
||||
"damage": 1,
|
||||
"attack": 0,
|
||||
"challenge": 1,
|
||||
"aether_points": 0,
|
||||
"hp": 0,
|
||||
@@ -138,8 +138,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 13,
|
||||
"damage_modifier": 1,
|
||||
"attack_modifier": 0,
|
||||
"damage": 1,
|
||||
"attack": 0,
|
||||
"challenge": 2,
|
||||
"aether_points": 0,
|
||||
"hp": 0,
|
||||
@@ -149,8 +149,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 14,
|
||||
"damage_modifier": 2,
|
||||
"attack_modifier": 1,
|
||||
"damage": 2,
|
||||
"attack": 1,
|
||||
"challenge": 3,
|
||||
"aether_points": 0,
|
||||
"hp": 1,
|
||||
@@ -160,8 +160,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 15,
|
||||
"damage_modifier": 3,
|
||||
"attack_modifier": 1,
|
||||
"damage": 3,
|
||||
"attack": 1,
|
||||
"challenge": 4,
|
||||
"aether_points": 0,
|
||||
"hp": 2,
|
||||
@@ -171,8 +171,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 16,
|
||||
"damage_modifier": 4,
|
||||
"attack_modifier": 2,
|
||||
"damage": 4,
|
||||
"attack": 2,
|
||||
"challenge": 5,
|
||||
"aether_points": 0,
|
||||
"hp": 3,
|
||||
@@ -182,8 +182,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 17,
|
||||
"damage_modifier": 5,
|
||||
"attack_modifier": 2,
|
||||
"damage": 5,
|
||||
"attack": 2,
|
||||
"challenge": 6,
|
||||
"aether_points": 10,
|
||||
"hp": 4,
|
||||
@@ -193,8 +193,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 18,
|
||||
"damage_modifier": 6,
|
||||
"attack_modifier": 3,
|
||||
"damage": 6,
|
||||
"attack": 3,
|
||||
"challenge": 7,
|
||||
"aether_points": 20,
|
||||
"hp": 5,
|
||||
@@ -204,8 +204,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 19,
|
||||
"damage_modifier": 7,
|
||||
"attack_modifier": 3,
|
||||
"damage": 7,
|
||||
"attack": 3,
|
||||
"challenge": 8,
|
||||
"aether_points": 20,
|
||||
"hp": 6,
|
||||
@@ -215,8 +215,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 20,
|
||||
"damage_modifier": 8,
|
||||
"attack_modifier": 4,
|
||||
"damage": 8,
|
||||
"attack": 4,
|
||||
"challenge": 9,
|
||||
"aether_points": 30,
|
||||
"hp": 7,
|
||||
@@ -226,8 +226,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 21,
|
||||
"damage_modifier": 9,
|
||||
"attack_modifier": 4,
|
||||
"damage": 9,
|
||||
"attack": 4,
|
||||
"challenge": 10,
|
||||
"aether_points": 30,
|
||||
"hp": 8,
|
||||
@@ -237,8 +237,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 22,
|
||||
"damage_modifier": 10,
|
||||
"attack_modifier": 5,
|
||||
"damage": 10,
|
||||
"attack": 5,
|
||||
"challenge": 11,
|
||||
"aether_points": 40,
|
||||
"hp": 9,
|
||||
@@ -248,8 +248,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 23,
|
||||
"damage_modifier": 12,
|
||||
"attack_modifier": 5,
|
||||
"damage": 12,
|
||||
"attack": 5,
|
||||
"challenge": 12,
|
||||
"aether_points": 40,
|
||||
"hp": 10,
|
||||
@@ -259,8 +259,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 24,
|
||||
"damage_modifier": 14,
|
||||
"attack_modifier": 5,
|
||||
"damage": 14,
|
||||
"attack": 5,
|
||||
"challenge": 13,
|
||||
"aether_points": 50,
|
||||
"hp": 11,
|
||||
@@ -270,8 +270,8 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 25,
|
||||
"damage_modifier": 16,
|
||||
"attack_modifier": 6,
|
||||
"damage": 16,
|
||||
"attack": 6,
|
||||
"challenge": 14,
|
||||
"aether_points": 60,
|
||||
"hp": 12,
|
||||
@@ -736,7 +736,6 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 6,
|
||||
|
||||
"hp ": 6,
|
||||
"aether_points": -20,
|
||||
"pain_save": 3,
|
||||
@@ -746,7 +745,6 @@ export const TABLES = {
|
||||
},
|
||||
{
|
||||
"value": 7,
|
||||
|
||||
"hp ": 7,
|
||||
"aether_points": -15,
|
||||
"pain_save": 3,
|
||||
@@ -939,175 +937,175 @@ export const TABLES = {
|
||||
"value": 1,
|
||||
"grit": -5,
|
||||
"turning_casting": -4,
|
||||
"development_points ": 0,
|
||||
"development_points": 0,
|
||||
"divine_miracle_bonus": 0
|
||||
},
|
||||
{
|
||||
"value": 2,
|
||||
"grit": -4,
|
||||
"turning_casting": -4,
|
||||
"development_points ": 0,
|
||||
"development_points": 0,
|
||||
"divine_miracle_bonus": 0
|
||||
},
|
||||
{
|
||||
"value": 3,
|
||||
"grit": -4,
|
||||
"turning_casting": -3,
|
||||
"development_points ": 0,
|
||||
"development_points": 0,
|
||||
"divine_miracle_bonus": 0
|
||||
},
|
||||
{
|
||||
"value": 4,
|
||||
"grit": -3,
|
||||
"turning_casting": 3,
|
||||
"development_points ": 0,
|
||||
"development_points": 0,
|
||||
"divine_miracle_bonus": 0
|
||||
},
|
||||
{
|
||||
"value": 5,
|
||||
"grit": -3,
|
||||
"turning_casting": -2,
|
||||
"development_points ": 0,
|
||||
"development_points": 0,
|
||||
"divine_miracle_bonus": 0
|
||||
},
|
||||
{
|
||||
"value": 6,
|
||||
"grit": -2,
|
||||
"turning_casting": -2,
|
||||
"development_points ": 0,
|
||||
"development_points": 0,
|
||||
"divine_miracle_bonus": 0
|
||||
},
|
||||
{
|
||||
"value": 7,
|
||||
"grit": -2,
|
||||
"turning_casting": -1,
|
||||
"development_points ": 0,
|
||||
"development_points": 0,
|
||||
"divine_miracle_bonus": 0
|
||||
},
|
||||
{
|
||||
"value": 8,
|
||||
"grit": -1,
|
||||
"turning_casting": -1,
|
||||
"development_points ": 0,
|
||||
"development_points": 0,
|
||||
"divine_miracle_bonus": 0
|
||||
},
|
||||
{
|
||||
"value": 9,
|
||||
"grit": -1,
|
||||
"turning_casting": 0,
|
||||
"development_points ": 0,
|
||||
"development_points": 0,
|
||||
"divine_miracle_bonus": 0
|
||||
},
|
||||
{
|
||||
"value": 10,
|
||||
"grit": 0,
|
||||
"turning_casting": 0,
|
||||
"development_points ": 0,
|
||||
"development_points": 0,
|
||||
"divine_miracle_bonus": 0
|
||||
},
|
||||
{
|
||||
"value": 11,
|
||||
"grit": 0,
|
||||
"turning_casting": 0,
|
||||
"development_points ": 0,
|
||||
"development_points": 0,
|
||||
"divine_miracle_bonus": 0
|
||||
},
|
||||
{
|
||||
"value": 12,
|
||||
"grit": 0,
|
||||
"turning_casting": 1,
|
||||
"development_points ": 1,
|
||||
"development_points": 1,
|
||||
"divine_miracle_bonus": 1
|
||||
},
|
||||
{
|
||||
"value": 13,
|
||||
"grit": 1,
|
||||
"turning_casting": 1,
|
||||
"development_points ": 2,
|
||||
"development_points": 2,
|
||||
"divine_miracle_bonus": 1
|
||||
},
|
||||
{
|
||||
"value": 14,
|
||||
"grit": 2,
|
||||
"turning_casting": 2,
|
||||
"development_points ": 4,
|
||||
"development_points": 4,
|
||||
"divine_miracle_bonus": 2
|
||||
},
|
||||
{
|
||||
"value": 15,
|
||||
"grit": 4,
|
||||
"turning_casting": 2,
|
||||
"development_points ": 6,
|
||||
"development_points": 6,
|
||||
"divine_miracle_bonus": 2
|
||||
},
|
||||
{
|
||||
"value": 16,
|
||||
"grit": 6,
|
||||
"turning_casting": 3,
|
||||
"development_points ": 7,
|
||||
"development_points": 7,
|
||||
"divine_miracle_bonus": 3
|
||||
},
|
||||
{
|
||||
"value": 17,
|
||||
"grit": 8,
|
||||
"turning_casting": 3,
|
||||
"development_points ": 8,
|
||||
"development_points": 8,
|
||||
"divine_miracle_bonus": 3
|
||||
},
|
||||
{
|
||||
"value": 18,
|
||||
"grit": 10,
|
||||
"turning_casting": 4,
|
||||
"development_points ": 9,
|
||||
"development_points": 9,
|
||||
"divine_miracle_bonus": 4
|
||||
},
|
||||
{
|
||||
"value": 19,
|
||||
"grit": 11,
|
||||
"turning_casting": 5,
|
||||
"development_points ": 10,
|
||||
"development_points": 10,
|
||||
"divine_miracle_bonus": 5
|
||||
},
|
||||
{
|
||||
"value": 20,
|
||||
"grit": 12,
|
||||
"turning_casting": 6,
|
||||
"development_points ": 11,
|
||||
"development_points": 11,
|
||||
"divine_miracle_bonus": 5
|
||||
},
|
||||
{
|
||||
"value": 21,
|
||||
"grit": 13,
|
||||
"turning_casting": 7,
|
||||
"development_points ": 12,
|
||||
"development_points": 12,
|
||||
"divine_miracle_bonus": 5
|
||||
},
|
||||
{
|
||||
"value": 22,
|
||||
"grit": 14,
|
||||
"turning_casting": 7,
|
||||
"development_points ": 13,
|
||||
"development_points": 13,
|
||||
"divine_miracle_bonus": 6
|
||||
},
|
||||
{
|
||||
"value": 23,
|
||||
"grit": 15,
|
||||
"turning_casting": 8,
|
||||
"development_points ": 14,
|
||||
"development_points": 14,
|
||||
"divine_miracle_bonus": 6
|
||||
},
|
||||
{
|
||||
"value": 24,
|
||||
"grit": 16,
|
||||
"turning_casting": 8,
|
||||
"development_points ": 15,
|
||||
"development_points": 15,
|
||||
"divine_miracle_bonus": 6
|
||||
},
|
||||
{
|
||||
"value": 25,
|
||||
"grit": 18,
|
||||
"turning_casting": 9,
|
||||
"development_points ": 16,
|
||||
"development_points": 16,
|
||||
"divine_miracle_bonus": 7
|
||||
}
|
||||
],
|
||||
@@ -1218,250 +1216,250 @@ export const TABLES = {
|
||||
"value": 1,
|
||||
"defense": -5,
|
||||
"init_cap": "-",
|
||||
"development_points ": 0,
|
||||
"attack ": -5,
|
||||
"development_points": 0,
|
||||
"attack": -5,
|
||||
"willpower_save": -5,
|
||||
"divine_miracle_bonus ": 0,
|
||||
"divine_miracle_bonus": 0,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 2,
|
||||
"defense": -4,
|
||||
"init_cap": "-",
|
||||
"development_points ": 0,
|
||||
"attack ": -4,
|
||||
"development_points": 0,
|
||||
"attack": -4,
|
||||
"willpower_save": -4,
|
||||
"divine_miracle_bonus ": 0,
|
||||
"divine_miracle_bonus": 0,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 3,
|
||||
"defense": -3,
|
||||
"init_cap": "-",
|
||||
"development_points ": 0,
|
||||
"attack ": -3,
|
||||
"development_points": 0,
|
||||
"attack": -3,
|
||||
"willpower_save": -3,
|
||||
"divine_miracle_bonus ": 0,
|
||||
"divine_miracle_bonus": 0,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 4,
|
||||
"defense": -3,
|
||||
"init_cap": "-",
|
||||
"development_points ": 0,
|
||||
"attack ": -2,
|
||||
"development_points": 0,
|
||||
"attack": -2,
|
||||
"willpower_save": -3,
|
||||
"divine_miracle_bonus ": 0,
|
||||
"divine_miracle_bonus": 0,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 5,
|
||||
"defense": -2,
|
||||
"init_cap": "-",
|
||||
"development_points ": 0,
|
||||
"attack ": 1,
|
||||
"development_points": 0,
|
||||
"attack": 1,
|
||||
"willpower_save": -2,
|
||||
"divine_miracle_bonus ": 0,
|
||||
"divine_miracle_bonus": 0,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 6,
|
||||
"defense": -2,
|
||||
"init_cap": "-",
|
||||
"development_points ": 0,
|
||||
"attack ": 0,
|
||||
"development_points": 0,
|
||||
"attack": 0,
|
||||
"willpower_save": -2,
|
||||
"divine_miracle_bonus ": 0,
|
||||
"divine_miracle_bonus": 0,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 7,
|
||||
"defense": -1,
|
||||
"init_cap": "-",
|
||||
"development_points ": 0,
|
||||
"attack ": 0,
|
||||
"development_points": 0,
|
||||
"attack": 0,
|
||||
"willpower_save": -1,
|
||||
"divine_miracle_bonus ": 0,
|
||||
"divine_miracle_bonus": 0,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 8,
|
||||
"defense": -1,
|
||||
"init_cap": "-",
|
||||
"development_points ": 0,
|
||||
"attack ": 0,
|
||||
"development_points": 0,
|
||||
"attack": 0,
|
||||
"willpower_save": -1,
|
||||
"divine_miracle_bonus ": 0,
|
||||
"divine_miracle_bonus": 0,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 9,
|
||||
"defense": -1,
|
||||
"init_cap": "-",
|
||||
"development_points ": 0,
|
||||
"attack ": 0,
|
||||
"development_points": 0,
|
||||
"attack": 0,
|
||||
"willpower_save": 0,
|
||||
"divine_miracle_bonus ": 0,
|
||||
"divine_miracle_bonus": 0,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 10,
|
||||
"defense": 0,
|
||||
"init_cap": 18,
|
||||
"development_points ": 0,
|
||||
"attack ": 0,
|
||||
"development_points": 0,
|
||||
"attack": 0,
|
||||
"willpower_save": 0,
|
||||
"divine_miracle_bonus ": 0,
|
||||
"divine_miracle_bonus": 0,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 11,
|
||||
"defense": 0,
|
||||
"init_cap": 16,
|
||||
"development_points ": 1,
|
||||
"attack ": 0,
|
||||
"development_points": 1,
|
||||
"attack": 0,
|
||||
"willpower_save": 0,
|
||||
"divine_miracle_bonus ": 0,
|
||||
"divine_miracle_bonus": 0,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 12,
|
||||
"defense": 1,
|
||||
"init_cap": 14,
|
||||
"development_points ": 2,
|
||||
"attack ": 0,
|
||||
"development_points": 2,
|
||||
"attack": 0,
|
||||
"willpower_save": 0,
|
||||
"divine_miracle_bonus ": 1,
|
||||
"divine_miracle_bonus": 1,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 13,
|
||||
"defense": 1,
|
||||
"init_cap": 12,
|
||||
"development_points ": 3,
|
||||
"attack ": 0,
|
||||
"development_points": 3,
|
||||
"attack": 0,
|
||||
"willpower_save": 1,
|
||||
"divine_miracle_bonus ": 1,
|
||||
"divine_miracle_bonus": 1,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 14,
|
||||
"defense": 1,
|
||||
"init_cap": 10,
|
||||
"development_points ": 4,
|
||||
"attack ": 1,
|
||||
"development_points": 4,
|
||||
"attack": 1,
|
||||
"willpower_save": 2,
|
||||
"divine_miracle_bonus ": 2,
|
||||
"divine_miracle_bonus": 2,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 15,
|
||||
"defense": 2,
|
||||
"init_cap": 8,
|
||||
"development_points ": 5,
|
||||
"attack ": 1,
|
||||
"development_points": 5,
|
||||
"attack": 1,
|
||||
"willpower_save": 3,
|
||||
"divine_miracle_bonus ": 2,
|
||||
"divine_miracle_bonus": 2,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 16,
|
||||
"defense": 2,
|
||||
"init_cap": 7,
|
||||
"development_points ": 7,
|
||||
"attack ": 1,
|
||||
"development_points": 7,
|
||||
"attack": 1,
|
||||
"willpower_save": 4,
|
||||
"divine_miracle_bonus ": 2,
|
||||
"divine_miracle_bonus": 2,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 17,
|
||||
"defense": 2,
|
||||
"init_cap": 6,
|
||||
"development_points ": 9,
|
||||
"attack ": 1,
|
||||
"development_points": 9,
|
||||
"attack": 1,
|
||||
"willpower_save": 5,
|
||||
"divine_miracle_bonus ": 3,
|
||||
"divine_miracle_bonus": 3,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 18,
|
||||
"defense": 3,
|
||||
"init_cap": 5,
|
||||
"development_points ": 11,
|
||||
"attack ": 2,
|
||||
"development_points": 11,
|
||||
"attack": 2,
|
||||
"willpower_save": 6,
|
||||
"divine_miracle_bonus ": 4,
|
||||
"divine_miracle_bonus": 4,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 19,
|
||||
"defense": 3,
|
||||
"init_cap": 4,
|
||||
"development_points ": 13,
|
||||
"attack ": 2,
|
||||
"development_points": 13,
|
||||
"attack": 2,
|
||||
"willpower_save": 7,
|
||||
"divine_miracle_bonus ": 5,
|
||||
"divine_miracle_bonus": 5,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 20,
|
||||
"defense": 3,
|
||||
"init_cap": 4,
|
||||
"development_points ": 15,
|
||||
"attack ": 2,
|
||||
"development_points": 15,
|
||||
"attack": 2,
|
||||
"willpower_save": 8,
|
||||
"divine_miracle_bonus ": 6,
|
||||
"divine_miracle_bonus": 6,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 21,
|
||||
"defense": 4,
|
||||
"init_cap": 3,
|
||||
"development_points ": 18,
|
||||
"attack ": 2,
|
||||
"development_points": 18,
|
||||
"attack": 2,
|
||||
"willpower_save": 9,
|
||||
"divine_miracle_bonus ": 7,
|
||||
"divine_miracle_bonus": 7,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 22,
|
||||
"defense": 4,
|
||||
"init_cap": 3,
|
||||
"development_points ": 21,
|
||||
"attack ": 2,
|
||||
"development_points": 21,
|
||||
"attack": 2,
|
||||
"willpower_save": 10,
|
||||
"divine_miracle_bonus ": 8,
|
||||
"divine_miracle_bonus": 8,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 23,
|
||||
"defense": 4,
|
||||
"init_cap": 2,
|
||||
"development_points ": 24,
|
||||
"attack ": 3,
|
||||
"development_points": 24,
|
||||
"attack": 3,
|
||||
"willpower_save": 11,
|
||||
"divine_miracle_bonus ": 9,
|
||||
"divine_miracle_bonus": 9,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 24,
|
||||
"defense": 4,
|
||||
"init_cap": 2,
|
||||
"development_points ": 27,
|
||||
"attack ": 3,
|
||||
"development_points": 27,
|
||||
"attack": 3,
|
||||
"willpower_save": 12,
|
||||
"divine_miracle_bonus ": 10,
|
||||
"divine_miracle_bonus": 10,
|
||||
"": ""
|
||||
},
|
||||
{
|
||||
"value": 25,
|
||||
"defense": 5,
|
||||
"init_cap": 1,
|
||||
"development_points ": 30,
|
||||
"attack ": 4,
|
||||
"development_points": 30,
|
||||
"attack": 4,
|
||||
"willpower_save": 13,
|
||||
"divine_miracle_bonus ": 12,
|
||||
"divine_miracle_bonus": 12,
|
||||
"": ""
|
||||
}
|
||||
]
|
||||
|
||||
@@ -59,6 +59,10 @@ export const DICE_VALUES = {
|
||||
"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 = {
|
||||
"d3": "D3",
|
||||
"d4": "D4",
|
||||
@@ -145,6 +149,10 @@ export const SYSTEM = {
|
||||
WEAPON_CLASS: WEAPON.WEAPON_CLASS,
|
||||
COMBAT_PROGRESSION_DICE: DICE_VALUES,
|
||||
SHIELD_DEFENSE_DICE: DEFENSE_DICE_VALUES,
|
||||
WEAPON_CATEGORIES: WEAPON.WEAPON_CATEGORIES,
|
||||
CHARACTERISTIC_ATTACK,
|
||||
CHARACTERISTIC_DEFENSE,
|
||||
CHARACTERISTIC_DAMAGE,
|
||||
MONEY,
|
||||
ASCII,
|
||||
ROLL_TYPE,
|
||||
|
||||
@@ -17,4 +17,19 @@ export const WEAPON_CLASS = {
|
||||
"thrown": "LETHALFANTASY.Weapon.WeaponClass.thrown",
|
||||
"polearm": "LETHALFANTASY.Weapon.WeaponClass.polearm",
|
||||
"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"]
|
||||
}
|
||||
|
||||
|
||||
+89
-48
@@ -11,11 +11,15 @@ export default class LethalFantasyRoll extends Roll {
|
||||
get type() {
|
||||
return this.options.type
|
||||
}
|
||||
|
||||
|
||||
get titleFormula() {
|
||||
return this.options.titleFormula
|
||||
}
|
||||
|
||||
|
||||
get rollName() {
|
||||
return this.options.rollName
|
||||
}
|
||||
|
||||
get target() {
|
||||
return this.options.target
|
||||
}
|
||||
@@ -83,7 +87,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
get rollTotal() {
|
||||
return this.options.rollTotal
|
||||
}
|
||||
|
||||
|
||||
get diceResults() {
|
||||
return this.options.diceResults
|
||||
}
|
||||
@@ -160,15 +164,44 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let hasModifier = true
|
||||
let hasChangeDice = false
|
||||
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
|
||||
maxValue = Number(options.rollTarget.value.match(/\d+/)[0])
|
||||
hasModifier = false
|
||||
hasChangeDice = true
|
||||
hasChangeDice = true
|
||||
} else {
|
||||
dice = "1D20"
|
||||
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)]))
|
||||
@@ -188,6 +221,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let dialogContext = {
|
||||
rollType: options.rollType,
|
||||
rollTarget: options.rollTarget,
|
||||
rollName: options.rollName,
|
||||
rollModes,
|
||||
hasModifier,
|
||||
hasChangeDice,
|
||||
@@ -202,6 +236,7 @@ export default class LethalFantasyRoll extends Roll {
|
||||
modifier,
|
||||
targetName
|
||||
}
|
||||
console.log("dialogContext", dialogContext)
|
||||
const content = await renderTemplate("systems/fvtt-lethal-fantasy/templates/roll-dialog.hbs", dialogContext)
|
||||
|
||||
const title = LethalFantasyRoll.createTitle(options.rollType, options.rollTarget)
|
||||
@@ -231,31 +266,38 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let fullModifier = 0
|
||||
let titleFormula = ""
|
||||
dice = rollContext.changeDice || dice
|
||||
if (options.rollType === "challenge" || options.rollType === "save") {
|
||||
if (hasModifier) {
|
||||
let bonus = Number(options.rollTarget.value)
|
||||
fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus
|
||||
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 {
|
||||
if (hasModifier) {
|
||||
let bonus = Number(options.rollTarget.value)
|
||||
fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus
|
||||
if (fullModifier === 0) {
|
||||
modifierFormula = "0"
|
||||
fullModifier = 0
|
||||
baseFormula = `${dice}`
|
||||
titleFormula = `${dice}E`
|
||||
} else {
|
||||
let modAbs = Math.abs(fullModifier)
|
||||
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
|
||||
|
||||
const rollData = {
|
||||
type: options.rollType,
|
||||
rollType: options.rollType,
|
||||
target: options.rollTarget,
|
||||
rollName: options.rollName,
|
||||
actorId: options.actorId,
|
||||
actorName: options.actorName,
|
||||
actorImage: options.actorImage,
|
||||
@@ -284,28 +326,22 @@ export default class LethalFantasyRoll extends Roll {
|
||||
let rollTotal = -1
|
||||
let diceResults = []
|
||||
let resultType
|
||||
if (options.rollType === "challenge" || options.rollType === "save") {
|
||||
let diceResult = rollBase.dice[0].results[0].result
|
||||
diceResults.push({ dice: `${dice}`, value: diceResult})
|
||||
let diceSum = diceResult
|
||||
while (diceResult === maxValue) {
|
||||
let r = await new Roll(baseFormula).evaluate()
|
||||
diceResult = r.dice[0].results[0].result
|
||||
diceResults.push( {dice: `${dice}-1`, value: diceResult-1})
|
||||
diceSum += (diceResult - 1)
|
||||
}
|
||||
if (fullModifier !== 0) {
|
||||
diceResults.push({ dice: `${rollModifier.formula}`, value: rollModifier.total })
|
||||
if ( fullModifier < 0) {
|
||||
rollTotal = Math.max(diceSum - rollModifier.total, 0)
|
||||
} else {
|
||||
rollTotal = diceSum + rollModifier.total
|
||||
}
|
||||
let diceResult = rollBase.dice[0].results[0].result
|
||||
diceResults.push({ dice: `${dice}`, value: diceResult })
|
||||
let diceSum = diceResult
|
||||
while (diceResult === maxValue) {
|
||||
let r = await new Roll(baseFormula).evaluate()
|
||||
diceResult = r.dice[0].results[0].result
|
||||
diceResults.push({ dice: `${dice}-1`, value: diceResult - 1 })
|
||||
diceSum += (diceResult - 1)
|
||||
}
|
||||
if (fullModifier !== 0) {
|
||||
diceResults.push({ dice: `${rollModifier.formula}`, value: rollModifier.total })
|
||||
if (fullModifier < 0) {
|
||||
rollTotal = Math.max(diceSum - rollModifier.total, 0)
|
||||
} else {
|
||||
rollTotal = diceSum
|
||||
}
|
||||
} else if (options.rollType === ROLL_TYPE.RESOURCE) {
|
||||
//resultType = roll.total === 1 || roll.total === 2 ? "failure" : "success"
|
||||
rollTotal = diceSum + rollModifier.total
|
||||
}
|
||||
}
|
||||
|
||||
rollBase.options.resultType = resultType
|
||||
@@ -343,12 +379,16 @@ export default class LethalFantasyRoll extends Roll {
|
||||
return `${game.i18n.localize("LETHALFANTASY.Label.titleChallenge")}`
|
||||
case "save":
|
||||
return `${game.i18n.localize("LETHALFANTASY.Label.titleSave")}`
|
||||
case ROLL_TYPE.DAMAGE:
|
||||
return `${game.i18n.localize("LETHALFANTASY.Dialog.titleDamage")} : ${target}`
|
||||
case ROLL_TYPE.ATTACK:
|
||||
return `${game.i18n.localize("LETHALFANTASY.Dialog.titleAttack")} : ${target}`
|
||||
case "skill":
|
||||
return `${game.i18n.localize("LETHALFANTASY.Label.titleSkill")}`
|
||||
case "weapon-attack":
|
||||
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:
|
||||
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,
|
||||
formula: this.formula,
|
||||
titleFormula: this.titleFormula,
|
||||
rollName: this.rollName,
|
||||
rollType: this.type,
|
||||
rollTarget: this.rollTarget,
|
||||
total: this.rollTotal,
|
||||
|
||||
@@ -95,11 +95,16 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
||||
schema.developmentPoints = new fields.SchemaField({
|
||||
total: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
remaining: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||
})
|
||||
})
|
||||
schema.spellMiraclePoints = new fields.SchemaField({
|
||||
total: 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 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)
|
||||
this.challenges.str.value = strDef.challenge
|
||||
|
||||
|
||||
let dexDef = SYSTEM.CHARACTERISTICS_TABLES.dex.find(s => s.value === this.characteristics.dex.value)
|
||||
this.challenges.agility.value = dexDef.challenge
|
||||
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.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.
|
||||
* @param {("save"|"resource|damage")} rollType The type of the roll.
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
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.
+56
-13
@@ -212,6 +212,12 @@
|
||||
min-width: 5rem;
|
||||
max-width: 5rem;
|
||||
margin-left: 0.7rem;
|
||||
}
|
||||
.name-pain {
|
||||
flex: 0;
|
||||
min-width: 3rem;
|
||||
max-width: 3rem;
|
||||
margin-left: 0.7rem;
|
||||
}
|
||||
.form-group {
|
||||
flex: 0;
|
||||
@@ -317,8 +323,8 @@
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
.item-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.name {
|
||||
min-width: 12rem;
|
||||
@@ -327,29 +333,35 @@
|
||||
}
|
||||
.gifts {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 10px;
|
||||
.gift {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
.item-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.name {
|
||||
min-width: 12rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
.vulnerabilities {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 10px;
|
||||
.vulnerability {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
.item-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.name {
|
||||
min-width: 12rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -366,17 +378,24 @@
|
||||
|
||||
.weapons {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 10px;
|
||||
.weapon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
.item-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin: 5px 0 0 0;
|
||||
}
|
||||
.name {
|
||||
min-width: 12rem;
|
||||
}
|
||||
.attack-icons a {
|
||||
margin-left: 8px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.armors {
|
||||
@@ -388,11 +407,35 @@
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
.item-img {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -28,15 +28,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
.main,
|
||||
.dialog-damage,
|
||||
.dialog-resource,
|
||||
.dialog-challenge,
|
||||
.dialog-save {
|
||||
margin-bottom: 0px;
|
||||
padding-bottom: 0px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<section class="character-main character-main-{{ifThen isPlayMode 'play' 'edit'}}">
|
||||
{{!log "character-main" this}}
|
||||
{{log "character-main" this}}
|
||||
|
||||
<fieldset>
|
||||
<legend>{{localize "LETHALFANTASY.Label.pc"}}</legend>
|
||||
@@ -21,9 +21,6 @@
|
||||
<span class="name">{{localize "LETHALFANTASY.Label.perception"}}</span>
|
||||
{{formInput systemFields.perception.fields.value value=system.perception.value disabled=isPlayMode
|
||||
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 class="flexrow character-hp">
|
||||
<span class="name">{{localize "LETHALFANTASY.Label.grit"}}</span>
|
||||
@@ -61,8 +58,7 @@
|
||||
class="lf-roll-small fa-solid fa-dice-d20"></i>
|
||||
{{localize "LETHALFANTASY.Label.saves.will"}}
|
||||
</a></span>
|
||||
{{formField systemFields.saves.fields.will.fields.value value=system.saves.will.value
|
||||
disabled=isPlayMode}}
|
||||
{{formField systemFields.saves.fields.will.fields.value value=system.saves.will.value disabled=true}}
|
||||
<span class="name">
|
||||
<a class="rollable" data-roll-type="save" data-roll-key="dodge"><i
|
||||
class="lf-roll-small fa-solid fa-dice-d20"></i>
|
||||
@@ -70,7 +66,7 @@
|
||||
</a>
|
||||
</span>
|
||||
{{formField systemFields.saves.fields.dodge.fields.value value=system.saves.dodge.value
|
||||
disabled=isPlayMode}}
|
||||
disabled=true}}
|
||||
<span class="name">
|
||||
<a class="rollable" data-roll-type="save" data-roll-key="toughness"><i
|
||||
class="lf-roll-small fa-solid fa-dice-d20"></i>
|
||||
@@ -78,7 +74,7 @@
|
||||
</a>
|
||||
</span>
|
||||
{{formField systemFields.saves.fields.toughness.fields.value value=system.saves.toughness.value
|
||||
disabled=isPlayMode}}
|
||||
disabled=true}}
|
||||
</div>
|
||||
<div class="character-save">
|
||||
<span class="name">
|
||||
@@ -88,7 +84,7 @@
|
||||
</a>
|
||||
</span>
|
||||
{{formField systemFields.saves.fields.contagion.fields.value value=system.saves.contagion.value
|
||||
disabled=isPlayMode }}
|
||||
disabled=true}}
|
||||
|
||||
<span class="name">
|
||||
<a class="rollable" data-roll-type="save" data-roll-key="poison"><i
|
||||
@@ -97,13 +93,21 @@
|
||||
</a>
|
||||
</span>
|
||||
{{formField systemFields.saves.fields.poison.fields.value value=system.saves.poison.value
|
||||
disabled=isPlayMode }}
|
||||
disabled=true }}
|
||||
|
||||
<span class="name">
|
||||
<a class="rollable" data-roll-type="save" data-roll-key="pain"><i
|
||||
<span class="name-pain">
|
||||
<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>
|
||||
{{localize "LETHALFANTASY.Label.saves.pain"}}</span>
|
||||
{{formField systemFields.saves.fields.pain.fields.value value=system.saves.pain.value disabled=isPlayMode}}
|
||||
{{localize "LETHALFANTASY.Label.saves.pain"}}
|
||||
</a>
|
||||
</span>
|
||||
{{formField systemFields.saves.fields.pain.fields.value value=system.saves.pain.value disabled=true}}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -116,19 +120,19 @@
|
||||
class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
|
||||
"LETHALFANTASY.Label.challenges.strength"}}</a></span>
|
||||
{{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
|
||||
class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
|
||||
"LETHALFANTASY.Label.challenges.agility"}}</a></span>
|
||||
{{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
|
||||
class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
|
||||
"LETHALFANTASY.Label.challenges.dying"}}</a></span>
|
||||
{{formField systemFields.challenges.fields.dying.fields.value value=system.challenges.dying.value
|
||||
disabled=isPlayMode }}
|
||||
disabled=true }}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -141,10 +145,10 @@
|
||||
{{formField systemFields.movement.fields.walk value=system.movement.walk disabled=isPlayMode}}
|
||||
<span class="name">{{localize "LETHALFANTASY.Label.movement.jog"}}</span>
|
||||
{{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>
|
||||
{{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>
|
||||
</fieldset>
|
||||
@@ -220,14 +224,4 @@
|
||||
</div>
|
||||
</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>
|
||||
@@ -7,8 +7,11 @@
|
||||
{{#each skills as |item|}}
|
||||
<div class="skill " data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
|
||||
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
|
||||
<div class="name" >
|
||||
{{item.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}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="score">
|
||||
+{{item.system.skillTotal}}
|
||||
@@ -49,7 +52,7 @@
|
||||
<legend data-tooltip="{{localize " LETHALFANTASY.Tooltip.vulnerabilities"}}" data-tooltip-direction="UP">{{localize
|
||||
"LETHALFANTASY.Label.vulnerabilities"}}</legend>
|
||||
<div class="vulnerabilities">
|
||||
{{#each gifts as |item|}}
|
||||
{{#each vulnerabilities as |item|}}
|
||||
<div class="vulnerability " 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.description}}}<br><br>{{item.path}}" data-tooltip-direction="UP">
|
||||
|
||||
@@ -1,20 +1,34 @@
|
||||
<section class="tab character-{{tab.id}} {{tab.cssClass}}" data-tab="{{tab.id}}" data-group="{{tab.group}}">
|
||||
|
||||
<fieldset>
|
||||
<legend>{{localize "LETHALFANTASY.Label.equipment"}}{{#if isEditMode}}<a class="action" data-tooltip="{{localize "
|
||||
LETHALFANTASY.Tooltip.addEquipment"}}" data-tooltip-direction="UP"><i class="fas fa-plus"
|
||||
data-action="createEquipment"></i></a>{{/if}}</legend>
|
||||
<legend>{{localize "LETHALFANTASY.Label.weapons"}}</legend>
|
||||
|
||||
<div class="weapons">
|
||||
{{#each weapons as |item|}}
|
||||
{{!log 'weapon' this}}
|
||||
<div class="weapon" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-drag="true"
|
||||
data-drag-type="damage">
|
||||
{{#if (ne item.img "icons/svg/item-bag.svg")}}
|
||||
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
|
||||
{{/if}}
|
||||
<div class="name" data-tooltip="{{{item.system.description}}}">
|
||||
{{item.name}}
|
||||
<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>
|
||||
@@ -24,10 +38,12 @@
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>{{localize "LETHALFANTASY.Label.armors"}}</legend>
|
||||
<div class="armors">
|
||||
{{#each armors as |item|}}
|
||||
{{!log 'armor' this}}
|
||||
<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}}}">
|
||||
@@ -44,5 +60,25 @@
|
||||
</div>
|
||||
</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>
|
||||
@@ -5,13 +5,19 @@
|
||||
<img src="{{actingCharImg}}" data-tooltip="{{actingCharName}}" />
|
||||
</div>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
{{#each diceResults as |result|}}
|
||||
<span>{{result.dice}} : {{result.value}}</span>
|
||||
{{/each}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{{#if isSave}}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
{{log "roll-dialog" this}}
|
||||
<div class="lethalfantasy-roll-dialog">
|
||||
|
||||
<fieldSet>
|
||||
{{#if (eq rollType "challenge")}}
|
||||
<legend>{{localize "LETHALFANTASY.Label.challenge"}}</legend>
|
||||
{{else}}
|
||||
<legend>{{localize "LETHALFANTASY.Label.save"}}</legend>
|
||||
{{/if}}
|
||||
<fieldSet class="">
|
||||
<legend>{{localize (concat "LETHALFANTASY.Label." rollType)}}</legend>
|
||||
{{#if hasModifier}}
|
||||
<div class="dialog-save">{{upperCase rollTarget.rollKey}} : {{baseFormula}} + {{baseValue}}</div>
|
||||
<div class="dialog-save">{{upperCase rollName}} : {{baseFormula}} + {{baseValue}}</div>
|
||||
{{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}}
|
||||
</fieldSet>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user