Basic actor sheet
This commit is contained in:
+20
-29
@@ -1,6 +1,14 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: "TimesNewRoman";
|
||||||
|
src: url("../assets/fonts/times-new-roman-regular.ttf") format("truetype");
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: "BaskervilleBold";
|
||||||
|
src: url("../fonts/baskerville-bold.ttf") format("truetype");
|
||||||
|
}
|
||||||
:root {
|
:root {
|
||||||
--font-primary: "TimesNewRoman", serif;
|
--font-primary: "TimesNewRoman", serif;
|
||||||
--font-size-standard: 1rem;
|
--font-size-standard: 0.9rem;
|
||||||
--background-image-base: url("../assets/ui/lethal_fantasy_background.webp");
|
--background-image-base: url("../assets/ui/lethal_fantasy_background.webp");
|
||||||
--font-secondary: "BaskervilleBold", serif;
|
--font-secondary: "BaskervilleBold", serif;
|
||||||
--logo-standard: url("../assets/ui/lf_logo_small_02.webp");
|
--logo-standard: url("../assets/ui/lf_logo_small_02.webp");
|
||||||
@@ -395,12 +403,12 @@ i.lethalfantasy {
|
|||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
.lethalfantasy .tab.character-skills legend a {
|
.lethalfantasy .tab.character-skills legend a {
|
||||||
font-size: calc(var(--font-size-standard) * 1.4);
|
font-size: calc(var(--font-size-standard) * 1);
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
.lethalfantasy .tab.character-skills .skills {
|
.lethalfantasy .tab.character-skills .skills {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(5, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
.lethalfantasy .tab.character-skills .skills .skill {
|
.lethalfantasy .tab.character-skills .skills .skill {
|
||||||
@@ -412,6 +420,9 @@ i.lethalfantasy {
|
|||||||
width: 50px;
|
width: 50px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
}
|
}
|
||||||
|
.lethalfantasy .tab.character-skills .skills .skill .name {
|
||||||
|
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(5, 1fr);
|
||||||
@@ -1386,47 +1397,27 @@ i.lethalfantasy {
|
|||||||
.lethalfantasy-roll-dialog fieldset {
|
.lethalfantasy-roll-dialog fieldset {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
input[name="selectAvantages"] {
|
.dialog-modifier {
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
.dialog-aide-gene {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.dialog-aide-gene select {
|
.dialog-modifier select {
|
||||||
border: none;
|
border: none;
|
||||||
background-color: rgba(0, 0, 0, 0.1);
|
background-color: rgba(0, 0, 0, 0.1);
|
||||||
color: var(--color-dark-2);
|
color: var(--color-dark-2);
|
||||||
width: 60px;
|
width: 60px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.dialog-modificateur {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.dialog-modificateur select {
|
|
||||||
border: none;
|
|
||||||
background-color: rgba(0, 0, 0, 0.1);
|
|
||||||
color: var(--color-dark-2);
|
|
||||||
width: 60px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.dialog-avantages #selectAvantages {
|
|
||||||
background-color: inherit;
|
|
||||||
text-align: center;
|
|
||||||
font-family: var(--font-secondary);
|
|
||||||
font-size: calc(var(--font-size-standard) * 1.2);
|
|
||||||
}
|
|
||||||
.dialog-damage,
|
.dialog-damage,
|
||||||
.dialog-resource,
|
.dialog-resource,
|
||||||
|
.dialog-challenge,
|
||||||
.dialog-save {
|
.dialog-save {
|
||||||
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) * 2);
|
font-size: calc(var(--font-size-standard) * 1.2);
|
||||||
color: var(--color-dark-1);
|
color: var(--color-dark-1);
|
||||||
}
|
}
|
||||||
.dice-roll {
|
.dice-roll {
|
||||||
@@ -1461,7 +1452,7 @@ input[name="selectAvantages"] {
|
|||||||
}
|
}
|
||||||
.dice-roll .intro-chat .intro-right .introText {
|
.dice-roll .intro-chat .intro-right .introText {
|
||||||
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);
|
||||||
width: 210px;
|
width: 210px;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
@@ -1470,7 +1461,7 @@ input[name="selectAvantages"] {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: calc(var(--font-size-standard) * 1.2);
|
font-size: calc(var(--font-size-standard) * 1);
|
||||||
text-shadow: 0 0 10px var(--color-shadow-primary);
|
text-shadow: 0 0 10px var(--color-shadow-primary);
|
||||||
}
|
}
|
||||||
#lethalfantasy-application-manager {
|
#lethalfantasy-application-manager {
|
||||||
|
|||||||
@@ -29,4 +29,5 @@ exports.default = gulp.series(
|
|||||||
watchUpdates
|
watchUpdates
|
||||||
);
|
);
|
||||||
exports.css = css;
|
exports.css = css;
|
||||||
|
exports.watchUpdates = watchUpdates;
|
||||||
|
|
||||||
|
|||||||
+8
-17
@@ -540,7 +540,8 @@
|
|||||||
"dex": "DEX",
|
"dex": "DEX",
|
||||||
"luc": "LUC",
|
"luc": "LUC",
|
||||||
"app": "APP",
|
"app": "APP",
|
||||||
"cha": "CHA"
|
"cha": "CHA",
|
||||||
|
"challenge": "Challenge"
|
||||||
},
|
},
|
||||||
"Edit": "Edit",
|
"Edit": "Edit",
|
||||||
"Delete": "Delete",
|
"Delete": "Delete",
|
||||||
@@ -548,25 +549,15 @@
|
|||||||
"Warning": {
|
"Warning": {
|
||||||
},
|
},
|
||||||
"Roll": {
|
"Roll": {
|
||||||
"save": "Jet de sauvegarde <br> {save}",
|
"save": "Save roll {save}",
|
||||||
"resource": "Jet de ressource <br> {resource}",
|
|
||||||
"damage": "Jet de dégâts <br> {item}",
|
"damage": "Jet de dégâts <br> {item}",
|
||||||
"attack": "Jet d'attaque <br> {item}",
|
"attack": "Jet d'attaque <br> {item}",
|
||||||
"roll": "Lancer",
|
"roll": "Roll",
|
||||||
"aide": "Aider",
|
|
||||||
"gene": "Gêner",
|
|
||||||
"adversite": "Adversité",
|
|
||||||
"avantagesDesavantages": "Avantages et désavantages",
|
|
||||||
"normal": "Normal",
|
"normal": "Normal",
|
||||||
"avantage": "Avec avantage",
|
"success": "Success",
|
||||||
"desavantage": "Avec désavantage",
|
"failure": "Failure",
|
||||||
"doubleAvantage": "Avec double avantage",
|
"modifier": "Modifier",
|
||||||
"doubleDesavantage": "Avec double désavantage",
|
"visibility": "Visibility"
|
||||||
"visibilite": "Visibilité du lancer",
|
|
||||||
"success": "Réussite",
|
|
||||||
"failure": "Echec",
|
|
||||||
"resourceLost": "Ressource perdue",
|
|
||||||
"displayArmor": "{targetName} a une armure de {targetArmor}. <br>Dégâts réels : {realDamage}"
|
|
||||||
},
|
},
|
||||||
"Tooltip": {
|
"Tooltip": {
|
||||||
"skill": "Skills list",
|
"skill": "Skills list",
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { handleSocketEvent } from "./module/socket.mjs"
|
|||||||
import { Macros } from "./module/macros.mjs"
|
import { Macros } from "./module/macros.mjs"
|
||||||
import { initControlButtons } from "./module/control-buttons.mjs"
|
import { initControlButtons } from "./module/control-buttons.mjs"
|
||||||
import { setupTextEnrichers } from "./module/enrichers.mjs"
|
import { setupTextEnrichers } from "./module/enrichers.mjs"
|
||||||
|
import { default as LethalFantasyUtils } from "./module/utils.mjs"
|
||||||
|
|
||||||
export class ClassCounter{static printHello(){console.log("Hello")}static sendJsonPostRequest(e,s){const t={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)};return fetch(e,t).then((e=>{if(!e.ok)throw new Error("La requête a échoué avec le statut "+e.status);return e.json()})).catch((e=>{throw console.error("Erreur envoi de la requête:",e),e}))}static registerUsageCount(e=game.system.id,s={}){if(game.user.isGM){game.settings.register(e,"world-key",{name:"Unique world key",scope:"world",config:!1,default:"",type:String});let t=game.settings.get(e,"world-key");null!=t&&""!=t&&"NONE"!=t&&"none"!=t.toLowerCase()||(t=foundry.utils.randomID(32),game.settings.set(e,"world-key",t));let a={name:e,system:game.system.id,worldKey:t,version:game.system.version,language:game.settings.get("core","language"),remoteAddr:game.data.addresses.remote,nbInstalledModules:game.modules.size,nbActiveModules:game.modules.filter((e=>e.active)).length,nbPacks:game.world.packs.size,nbUsers:game.users.size,nbScenes:game.scenes.size,nbActors:game.actors.size,nbPlaylist:game.playlists.size,nbTables:game.tables.size,nbCards:game.cards.size,optionsData:s,foundryVersion:`${game.release.generation}.${game.release.build}`};this.sendJsonPostRequest("https://www.uberwald.me/fvtt_appcount/count_post.php",a)}}}
|
export class ClassCounter{static printHello(){console.log("Hello")}static sendJsonPostRequest(e,s){const t={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)};return fetch(e,t).then((e=>{if(!e.ok)throw new Error("La requête a échoué avec le statut "+e.status);return e.json()})).catch((e=>{throw console.error("Erreur envoi de la requête:",e),e}))}static registerUsageCount(e=game.system.id,s={}){if(game.user.isGM){game.settings.register(e,"world-key",{name:"Unique world key",scope:"world",config:!1,default:"",type:String});let t=game.settings.get(e,"world-key");null!=t&&""!=t&&"NONE"!=t&&"none"!=t.toLowerCase()||(t=foundry.utils.randomID(32),game.settings.set(e,"world-key",t));let a={name:e,system:game.system.id,worldKey:t,version:game.system.version,language:game.settings.get("core","language"),remoteAddr:game.data.addresses.remote,nbInstalledModules:game.modules.size,nbActiveModules:game.modules.filter((e=>e.active)).length,nbPacks:game.world.packs.size,nbUsers:game.users.size,nbScenes:game.scenes.size,nbActors:game.actors.size,nbPlaylist:game.playlists.size,nbTables:game.tables.size,nbCards:game.cards.size,optionsData:s,foundryVersion:`${game.release.generation}.${game.release.build}`};this.sendJsonPostRequest("https://www.uberwald.me/fvtt_appcount/count_post.php",a)}}}
|
||||||
|
|
||||||
@@ -88,6 +89,7 @@ Hooks.once("init", function () {
|
|||||||
initControlButtons()
|
initControlButtons()
|
||||||
|
|
||||||
setupTextEnrichers()
|
setupTextEnrichers()
|
||||||
|
LethalFantasyUtils.registerHandlebarsHelpers()
|
||||||
|
|
||||||
// Gestion des jets de dés depuis les journaux
|
// Gestion des jets de dés depuis les journaux
|
||||||
document.addEventListener("click", (event) => {
|
document.addEventListener("click", (event) => {
|
||||||
|
|||||||
@@ -169,17 +169,14 @@ export default class LethalFantasyCharacterSheet extends LethalFantasyActorSheet
|
|||||||
*/
|
*/
|
||||||
async _onRoll(event, target) {
|
async _onRoll(event, target) {
|
||||||
if (this.isEditMode) return
|
if (this.isEditMode) return
|
||||||
// Jet de sauvegarde
|
console.log(event, target)
|
||||||
let elt = event.currentTarget.querySelector("input")
|
const rollType = event.target.dataset.rollType
|
||||||
// Jet de ressource
|
|
||||||
if (!elt) elt = event.currentTarget.querySelector("select")
|
|
||||||
// Jet de dégâts
|
|
||||||
if (!elt) elt = event.currentTarget
|
|
||||||
const rollType = elt.dataset.rollType
|
|
||||||
let rollTarget
|
let rollTarget
|
||||||
switch (rollType) {
|
switch (rollType) {
|
||||||
case ROLL_TYPE.SAVE:
|
case "challenge":
|
||||||
rollTarget = elt.dataset.rollTarget
|
let rollKey = event.target.dataset.rollKey
|
||||||
|
rollTarget = foundry.utils.duplicate(this.document.system.challenges[rollKey])
|
||||||
|
rollTarget.rollKey = rollKey
|
||||||
break
|
break
|
||||||
case ROLL_TYPE.RESOURCE:
|
case ROLL_TYPE.RESOURCE:
|
||||||
rollTarget = elt.dataset.rollTarget
|
rollTarget = elt.dataset.rollTarget
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ export const TABLES = {
|
|||||||
"push_drag": 76
|
"push_drag": 76
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"wis": [
|
"int": [
|
||||||
{
|
{
|
||||||
"value": 1,
|
"value": 1,
|
||||||
"attack": -5,
|
"attack": -5,
|
||||||
@@ -507,10 +507,186 @@ export const TABLES = {
|
|||||||
"arkane_casting_mod": 9
|
"arkane_casting_mod": 9
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"dex": [
|
||||||
|
{
|
||||||
|
"value": 1,
|
||||||
|
"defense": -5,
|
||||||
|
"attack": -5,
|
||||||
|
"challenge": -9,
|
||||||
|
"dodge": -4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 2,
|
||||||
|
"defense": -4,
|
||||||
|
"attack": -4,
|
||||||
|
"challenge": -8,
|
||||||
|
"dodge": -4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 3,
|
||||||
|
"defense": -3,
|
||||||
|
"attack": -3,
|
||||||
|
"challenge": -7,
|
||||||
|
"dodge": -3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 4,
|
||||||
|
"defense": -3,
|
||||||
|
"attack": -2,
|
||||||
|
"challenge": -6,
|
||||||
|
"dodge": -3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 5,
|
||||||
|
"defense": -2,
|
||||||
|
"attack": -2,
|
||||||
|
"challenge": -5,
|
||||||
|
"dodge": -2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 6,
|
||||||
|
"defense": -2,
|
||||||
|
"attack": -2,
|
||||||
|
"challenge": -4,
|
||||||
|
"dodge": -2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 7,
|
||||||
|
"defense": -1,
|
||||||
|
"attack": -1,
|
||||||
|
"challenge": -3,
|
||||||
|
"dodge": -2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 8,
|
||||||
|
"defense": -1,
|
||||||
|
"attack": -1,
|
||||||
|
"challenge": -2,
|
||||||
|
"dodge": -1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 9,
|
||||||
|
"defense": -1,
|
||||||
|
"attack": -1,
|
||||||
|
"challenge": -1,
|
||||||
|
"dodge": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 10,
|
||||||
|
"defense": 0,
|
||||||
|
"attack": 0,
|
||||||
|
"challenge": 0,
|
||||||
|
"dodge": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 11,
|
||||||
|
"defense": 0,
|
||||||
|
"attack": 0,
|
||||||
|
"challenge": 0,
|
||||||
|
"dodge": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 12,
|
||||||
|
"defense": 1,
|
||||||
|
"attack": 1,
|
||||||
|
"challenge": 1,
|
||||||
|
"dodge": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 13,
|
||||||
|
"defense": 1,
|
||||||
|
"attack": 1,
|
||||||
|
"challenge": 2,
|
||||||
|
"dodge": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 14,
|
||||||
|
"defense": 1,
|
||||||
|
"attack": 1,
|
||||||
|
"challenge": 3,
|
||||||
|
"dodge": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 15,
|
||||||
|
"defense": 2,
|
||||||
|
"attack": 2,
|
||||||
|
"challenge": 4,
|
||||||
|
"dodge": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 16,
|
||||||
|
"defense": 2,
|
||||||
|
"attack": 2,
|
||||||
|
"challenge": 5,
|
||||||
|
"dodge": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 17,
|
||||||
|
"defense": 2,
|
||||||
|
"attack": 2,
|
||||||
|
"challenge": 6,
|
||||||
|
"dodge": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 18,
|
||||||
|
"defense": 3,
|
||||||
|
"attack": 3,
|
||||||
|
"challenge": 7,
|
||||||
|
"dodge": 6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 19,
|
||||||
|
"defense": 3,
|
||||||
|
"attack": 3,
|
||||||
|
"challenge": 8,
|
||||||
|
"dodge": 7
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 20,
|
||||||
|
"defense": 3,
|
||||||
|
"attack": 3,
|
||||||
|
"challenge": 9,
|
||||||
|
"dodge": 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 21,
|
||||||
|
"defense": 4,
|
||||||
|
"attack": 4,
|
||||||
|
"challenge": 10,
|
||||||
|
"dodge": 9
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 22,
|
||||||
|
"defense": 4,
|
||||||
|
"attack": 4,
|
||||||
|
"challenge": 11,
|
||||||
|
"dodge": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 23,
|
||||||
|
"defense": 4,
|
||||||
|
"attack": 4,
|
||||||
|
"challenge": 12,
|
||||||
|
"dodge": 11
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 24,
|
||||||
|
"defense": 4,
|
||||||
|
"attack": 5,
|
||||||
|
"challenge": 13,
|
||||||
|
"dodge": 12
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": 25,
|
||||||
|
"defense": 5,
|
||||||
|
"attack": 5,
|
||||||
|
"challenge": 14,
|
||||||
|
"dodge": 13
|
||||||
|
}
|
||||||
|
],
|
||||||
"con": [
|
"con": [
|
||||||
{
|
{
|
||||||
"value": 1,
|
"value": 1,
|
||||||
|
|
||||||
"hp ": 1,
|
"hp ": 1,
|
||||||
"aether_points": -50,
|
"aether_points": -50,
|
||||||
"pain_save": 1,
|
"pain_save": 1,
|
||||||
|
|||||||
@@ -1,5 +1,31 @@
|
|||||||
import { ROLL_TYPE } from "../config/system.mjs"
|
import { ROLL_TYPE } from "../config/system.mjs"
|
||||||
|
import LethalFantasyUtils from "../utils.mjs"
|
||||||
export default class LethalFantasyActor extends Actor {
|
export default class LethalFantasyActor extends Actor {
|
||||||
|
|
||||||
|
static async create(data, options) {
|
||||||
|
|
||||||
|
// Case of compendium global import
|
||||||
|
if (data instanceof Array) {
|
||||||
|
return super.create(data, options);
|
||||||
|
}
|
||||||
|
// If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic
|
||||||
|
if (data.items) {
|
||||||
|
let actor = super.create(data, options);
|
||||||
|
return actor;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.type === 'character') {
|
||||||
|
const skills = await LethalFantasyUtils.loadCompendium("fvtt-lethal-fantasy.lf-skills")
|
||||||
|
data.items = data.items || []
|
||||||
|
for (let skill of skills) {
|
||||||
|
if (skill.system.category === "layperson" || skill.system.category === "professional") {
|
||||||
|
data.items.push(skill.toObject())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.create(data, options);
|
||||||
|
}
|
||||||
async _preCreate(data, options, user) {
|
async _preCreate(data, options, user) {
|
||||||
await super._preCreate(data, options, user)
|
await super._preCreate(data, options, user)
|
||||||
|
|
||||||
|
|||||||
+127
-251
@@ -12,6 +12,10 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
return this.options.type
|
return this.options.type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isChallenge() {
|
||||||
|
return this.type === "challenge"
|
||||||
|
}
|
||||||
|
|
||||||
get isSave() {
|
get isSave() {
|
||||||
return this.type === ROLL_TYPE.SAVE
|
return this.type === ROLL_TYPE.SAVE
|
||||||
}
|
}
|
||||||
@@ -56,20 +60,8 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
return this.options.introTextTooltip
|
return this.options.introTextTooltip
|
||||||
}
|
}
|
||||||
|
|
||||||
get aide() {
|
get modifier() {
|
||||||
return this.options.aide
|
return this.options.modifier
|
||||||
}
|
|
||||||
|
|
||||||
get gene() {
|
|
||||||
return this.options.gene
|
|
||||||
}
|
|
||||||
|
|
||||||
get modificateur() {
|
|
||||||
return this.options.modificateur
|
|
||||||
}
|
|
||||||
|
|
||||||
get avantages() {
|
|
||||||
return this.options.avantages
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get resultType() {
|
get resultType() {
|
||||||
@@ -100,8 +92,16 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
return this.options.realDamage
|
return this.options.realDamage
|
||||||
}
|
}
|
||||||
|
|
||||||
get rollAdvantage() {
|
get rollTotal() {
|
||||||
return this.options.rollAdvantage
|
return this.options.rollTotal
|
||||||
|
}
|
||||||
|
|
||||||
|
get diceResults() {
|
||||||
|
return this.options.diceResults
|
||||||
|
}
|
||||||
|
|
||||||
|
get rollTarget() {
|
||||||
|
return this.options.rollTarget
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,21 +114,21 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
|
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case ROLL_TYPE.SAVE:
|
case ROLL_TYPE.SAVE:
|
||||||
const saveLabel = game.i18n.localize(`TENEBRIS.Character.FIELDS.caracteristiques.${this.target}.valeur.label`)
|
const saveLabel = game.i18n.localize(`LETHALFANTASY.Character.FIELDS.caracteristiques.${this.target}.valeur.label`)
|
||||||
text = game.i18n.format("TENEBRIS.Roll.save", { save: saveLabel })
|
text = game.i18n.format("LETHALFANTASY.Roll.save", { save: saveLabel })
|
||||||
text = text.concat("<br>").concat(`Seuil : ${this.treshold}`)
|
text = text.concat("<br>").concat(`Seuil : ${this.treshold}`)
|
||||||
break
|
break
|
||||||
case ROLL_TYPE.RESOURCE:
|
case ROLL_TYPE.RESOURCE:
|
||||||
const resourceLabel = game.i18n.localize(`TENEBRIS.Character.FIELDS.ressources.${this.target}.valeur.label`)
|
const resourceLabel = game.i18n.localize(`LETHALFANTASY.Character.FIELDS.ressources.${this.target}.valeur.label`)
|
||||||
text = game.i18n.format("TENEBRIS.Roll.resource", { resource: resourceLabel })
|
text = game.i18n.format("LETHALFANTASY.Roll.resource", { resource: resourceLabel })
|
||||||
break
|
break
|
||||||
case ROLL_TYPE.DAMAGE:
|
case ROLL_TYPE.DAMAGE:
|
||||||
const damageLabel = this.target
|
const damageLabel = this.target
|
||||||
text = game.i18n.format("TENEBRIS.Roll.damage", { item: damageLabel })
|
text = game.i18n.format("LETHALFANTASY.Roll.damage", { item: damageLabel })
|
||||||
break
|
break
|
||||||
case ROLL_TYPE.ATTACK:
|
case ROLL_TYPE.ATTACK:
|
||||||
const attackLabel = this.target
|
const attackLabel = this.target
|
||||||
text = game.i18n.format("TENEBRIS.Roll.attack", { item: attackLabel })
|
text = game.i18n.format("LETHALFANTASY.Roll.attack", { item: attackLabel })
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
return text
|
return text
|
||||||
@@ -140,7 +140,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
* @returns {string} A formatted string containing the value, help, hindrance, and modifier.
|
* @returns {string} A formatted string containing the value, help, hindrance, and modifier.
|
||||||
*/
|
*/
|
||||||
_createIntroTextTooltip() {
|
_createIntroTextTooltip() {
|
||||||
let tooltip = game.i18n.format("TENEBRIS.Tooltip.saveIntroTextTooltip", { value: this.value, aide: this.aide, gene: this.gene, modificateur: this.modificateur })
|
let tooltip = game.i18n.format("LETHALFANTASY.Tooltip.saveIntroTextTooltip", { value: this.value, aide: this.aide, gene: this.gene, modificateur: this.modificateur })
|
||||||
if (this.hasTarget) {
|
if (this.hasTarget) {
|
||||||
tooltip = tooltip.concat(`<br>Cible : ${this.targetName}`)
|
tooltip = tooltip.concat(`<br>Cible : ${this.targetName}`)
|
||||||
}
|
}
|
||||||
@@ -165,14 +165,17 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
* @returns {Promise<Object|null>} The roll result or null if the dialog was cancelled.
|
* @returns {Promise<Object|null>} The roll result or null if the dialog was cancelled.
|
||||||
*/
|
*/
|
||||||
static async prompt(options = {}) {
|
static async prompt(options = {}) {
|
||||||
let formula = options.rollValue
|
let dice = "1d20"
|
||||||
|
let maxValue = 20
|
||||||
// Formula for a resource roll
|
let formula = "1d20"
|
||||||
if (options.rollType === ROLL_TYPE.RESOURCE) {
|
if (options.rollType === "challenge") {
|
||||||
let ressource = game.i18n.localize(`TENEBRIS.Character.FIELDS.ressources.${options.rollTarget}.valeur.label`)
|
if ( options.rollTarget.rollKey === "dying") {
|
||||||
if (formula === "0" || formula === "") {
|
dice = options.rollTarget.value
|
||||||
ui.notifications.warn(game.i18n.format("TENEBRIS.Warning.plusDeRessource", { ressource: ressource }))
|
maxValue = Number(options.rollTarget.value.match(/\d+/)[0])
|
||||||
return null
|
formula = `${dice}`
|
||||||
|
} else {
|
||||||
|
dice = "1d20"
|
||||||
|
maxValue = 20
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,99 +186,64 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
default: "public",
|
default: "public",
|
||||||
})
|
})
|
||||||
|
|
||||||
const choiceAide = foundry.utils.mergeObject({ 0: "0" }, options.rollValue <= 10 ? { 1: "1" } : { 1: "1", 2: "2" })
|
const choiceModifier = {
|
||||||
const choiceGene = {
|
|
||||||
0: "0",
|
|
||||||
"-1": "-1",
|
|
||||||
"-2": "-2",
|
|
||||||
"-3": "-3",
|
|
||||||
"-4": "-4",
|
|
||||||
"-5": "-5",
|
|
||||||
"-6": "-6",
|
|
||||||
"-7": "-7",
|
|
||||||
"-8": "-8",
|
|
||||||
"-9": "-9",
|
"-9": "-9",
|
||||||
"-10": "-10",
|
|
||||||
}
|
|
||||||
const choiceAvantage = { normal: "Normal", avantage: "Avantage", desavantage: "Désavantage", doubleAvantage: "Double avantage", doubleDesavantage: "Double désavantage" }
|
|
||||||
const choiceModificateur = {
|
|
||||||
0: "0",
|
|
||||||
"-1": "-1",
|
|
||||||
"-2": "-2",
|
|
||||||
"-3": "-3",
|
|
||||||
"-4": "-4",
|
|
||||||
"-5": "-5",
|
|
||||||
"-6": "-6",
|
|
||||||
"-7": "-7",
|
|
||||||
"-8": "-8",
|
"-8": "-8",
|
||||||
"-9": "-9",
|
"-7": "-7",
|
||||||
"-10": "-10",
|
"-6": "-6",
|
||||||
|
"-5": "-5",
|
||||||
|
"-4": "-4",
|
||||||
|
"-3": "-3",
|
||||||
|
"-2": "-2",
|
||||||
|
"-1": "-1",
|
||||||
|
"+0": "0",
|
||||||
|
"+1": "+1",
|
||||||
|
"+2": "+2",
|
||||||
|
"+3": "+3",
|
||||||
|
"+4": "+4",
|
||||||
|
"+5": "+5",
|
||||||
|
"+6": "+6",
|
||||||
|
"+7": "+7",
|
||||||
|
"+8": "+8",
|
||||||
|
"+9": "+9",
|
||||||
|
"+10": "+10",
|
||||||
|
"+11": "+11",
|
||||||
|
"+12": "+12",
|
||||||
|
"+13": "+13",
|
||||||
|
"+14": "+14",
|
||||||
|
"+15": "+15",
|
||||||
|
"+16": "+16",
|
||||||
|
"+17": "+17",
|
||||||
|
"+18": "+18",
|
||||||
|
"+19": "+19",
|
||||||
|
"+20": "+20",
|
||||||
|
"+21": "+21",
|
||||||
|
"+22": "+22",
|
||||||
|
"+23": "+23",
|
||||||
|
"+24": "+24",
|
||||||
|
"+25": "+25"
|
||||||
}
|
}
|
||||||
|
|
||||||
let damageDice
|
let modifier = "+0"
|
||||||
let damageDiceMax
|
|
||||||
let damageDiceFinal
|
|
||||||
let damageDiceLowered
|
|
||||||
|
|
||||||
// Damage roll : check the roll is not above the maximum damage
|
|
||||||
if (options.rollType === ROLL_TYPE.DAMAGE) {
|
|
||||||
damageDice = options.rollValue
|
|
||||||
damageDiceMax = game.actors.get(options.actorId).system.dmax.valeur
|
|
||||||
damageDiceFinal = LethalFantasyUtils.maxDamage(damageDice, damageDiceMax)
|
|
||||||
damageDiceLowered = damageDiceFinal !== damageDice
|
|
||||||
// Récupération du nom de l'objet si c'est un jet depuis la fiche de l'acteur
|
|
||||||
// Si c'est via une macro le nom est connu
|
|
||||||
options.rollTarget = game.actors.get(options.actorId).items.get(options.rollTarget).name
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.rollType === ROLL_TYPE.ATTACK) {
|
|
||||||
damageDice = options.rollValue
|
|
||||||
}
|
|
||||||
|
|
||||||
let malus = "0"
|
|
||||||
let targetMalus = "0"
|
|
||||||
let targetName
|
let targetName
|
||||||
let targetArmor
|
|
||||||
const displayOpponentMalus = game.settings.get("tenebris", "displayOpponentMalus")
|
|
||||||
|
|
||||||
if (options.rollType === ROLL_TYPE.SAVE && options.hasTarget && options.target.document.actor.type === "opponent") {
|
|
||||||
targetName = options.target.document.actor.name
|
|
||||||
if (displayOpponentMalus) malus = options.target.document.actor.system.malus.toString()
|
|
||||||
else targetMalus = options.target.document.actor.system.malus.toString()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.rollType === ROLL_TYPE.DAMAGE && options.hasTarget && options.target.document.actor.type === "opponent") {
|
|
||||||
targetName = options.target.document.actor.name
|
|
||||||
targetArmor = options.target.document.actor.system.armure.toString()
|
|
||||||
}
|
|
||||||
|
|
||||||
let dialogContext = {
|
let dialogContext = {
|
||||||
isSave: options.rollType === ROLL_TYPE.SAVE,
|
isSave: options.rollType === "save",
|
||||||
isResource: options.rollType === ROLL_TYPE.RESOURCE,
|
isChallenge: options.rollType === "challenge",
|
||||||
isDamage: options.rollType === ROLL_TYPE.DAMAGE,
|
rollTarget: options.rollTarget,
|
||||||
isAttack: options.rollType === ROLL_TYPE.ATTACK,
|
|
||||||
rollModes,
|
rollModes,
|
||||||
fieldRollMode,
|
fieldRollMode,
|
||||||
choiceAide,
|
choiceModifier,
|
||||||
choiceGene,
|
|
||||||
choiceAvantage,
|
|
||||||
choiceModificateur,
|
|
||||||
damageDice,
|
|
||||||
damageDiceMax,
|
|
||||||
damageDiceFinal,
|
|
||||||
damageDiceLowered,
|
|
||||||
formula,
|
formula,
|
||||||
|
dice,
|
||||||
hasTarget: options.hasTarget,
|
hasTarget: options.hasTarget,
|
||||||
malus,
|
modifier,
|
||||||
targetName,
|
targetName
|
||||||
targetArmor,
|
|
||||||
rollAdvantage: this._convertAvantages(options.rollAdvantage),
|
|
||||||
rangeAdvantage: this._convertRollAdvantageToRange(options.rollAdvantage),
|
|
||||||
}
|
}
|
||||||
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)
|
||||||
const label = game.i18n.localize("TENEBRIS.Roll.roll")
|
const label = game.i18n.localize("LETHALFANTASY.Roll.roll")
|
||||||
const rollContext = await foundry.applications.api.DialogV2.wait({
|
const rollContext = await foundry.applications.api.DialogV2.wait({
|
||||||
window: { title: title },
|
window: { title: title },
|
||||||
classes: ["lethalfantasy"],
|
classes: ["lethalfantasy"],
|
||||||
@@ -288,142 +256,94 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
if (input.name) obj[input.name] = input.value
|
if (input.name) obj[input.name] = input.value
|
||||||
return obj
|
return obj
|
||||||
}, {})
|
}, {})
|
||||||
// Avantages
|
|
||||||
switch (output.avantages) {
|
|
||||||
case "1":
|
|
||||||
output.avantages = "doubleDesavantage"
|
|
||||||
break
|
|
||||||
case "2":
|
|
||||||
output.avantages = "desavantage"
|
|
||||||
break
|
|
||||||
case "3":
|
|
||||||
output.avantages = "normal"
|
|
||||||
break
|
|
||||||
case "4":
|
|
||||||
output.avantages = "avantage"
|
|
||||||
break
|
|
||||||
case "5":
|
|
||||||
output.avantages = "doubleAvantage"
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return output
|
return output
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
rejectClose: false, // Click on Close button will not launch an error
|
rejectClose: false // Click on Close button will not launch an error
|
||||||
render: (event, dialog) => {
|
|
||||||
const rangeInput = dialog.querySelector('input[name="avantages"]')
|
|
||||||
if (rangeInput) {
|
|
||||||
rangeInput.addEventListener("change", (event) => {
|
|
||||||
event.preventDefault()
|
|
||||||
event.stopPropagation()
|
|
||||||
const readOnly = dialog.querySelector('input[name="selectAvantages"]')
|
|
||||||
readOnly.value = this._convertAvantages(event.target.value)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// If the user cancels the dialog, exit
|
// If the user cancels the dialog, exit
|
||||||
if (rollContext === null) return
|
if (rollContext === null) return
|
||||||
|
|
||||||
let treshold
|
let treshold
|
||||||
|
let fullModifier = 0
|
||||||
if (options.rollType === ROLL_TYPE.SAVE) {
|
if (options.rollType === "challenge") {
|
||||||
const aide = rollContext.aide === "" ? 0 : parseInt(rollContext.aide, 10)
|
let bonus = (options.rollTarget.rollKey === "dying") ? 0 : options.rollTarget.bonus
|
||||||
const gene = rollContext.gene === "" ? 0 : parseInt(rollContext.gene, 10)
|
fullModifier = rollContext.modifier === "" ? 0 : parseInt(rollContext.modifier, 10) + bonus
|
||||||
const modificateur = rollContext.modificateur === "" ? 0 : parseInt(rollContext.modificateur, 10)
|
if (fullModifier < 0) {
|
||||||
|
let modAbs = Math.abs(fullModifier)
|
||||||
if (options.rollType === ROLL_TYPE.SAVE) {
|
formula = `${dice} - (d${modAbs + 1} - 1)`
|
||||||
let dice = "1d20"
|
} else if (fullModifier > 0) {
|
||||||
switch (rollContext.avantages) {
|
formula = `${dice} + (d${fullModifier + 1} - 1)`
|
||||||
case "avantage":
|
} else {
|
||||||
dice = "2d20kl"
|
formula = `${dice} + 1d0`
|
||||||
break
|
|
||||||
case "desavantage":
|
|
||||||
dice = "2d20kh"
|
|
||||||
break
|
|
||||||
case "doubleAvantage":
|
|
||||||
dice = "3d20kl"
|
|
||||||
break
|
|
||||||
case "doubleDesavantage":
|
|
||||||
dice = "3d20kh"
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
formula = `${dice}`
|
|
||||||
}
|
|
||||||
|
|
||||||
treshold = options.rollValue + aide + gene + modificateur
|
|
||||||
}
|
|
||||||
|
|
||||||
// Formula for a damage roll
|
|
||||||
if (options.rollType === ROLL_TYPE.DAMAGE) {
|
|
||||||
formula = damageDiceFinal
|
|
||||||
}
|
|
||||||
|
|
||||||
// Formula for an attack roll
|
|
||||||
if (options.rollType === ROLL_TYPE.ATTACK) {
|
|
||||||
formula = damageDice
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const rollData = {
|
const rollData = {
|
||||||
type: options.rollType,
|
type: options.rollType,
|
||||||
target: options.rollTarget,
|
target: options.rollTarget,
|
||||||
value: options.rollValue,
|
|
||||||
treshold: treshold,
|
|
||||||
actorId: options.actorId,
|
actorId: options.actorId,
|
||||||
actorName: options.actorName,
|
actorName: options.actorName,
|
||||||
actorImage: options.actorImage,
|
actorImage: options.actorImage,
|
||||||
rollMode: rollContext.visibility,
|
rollMode: rollContext.visibility,
|
||||||
hasTarget: options.hasTarget,
|
hasTarget: options.hasTarget,
|
||||||
targetName,
|
targetName,
|
||||||
targetArmor,
|
|
||||||
targetMalus,
|
|
||||||
...rollContext,
|
...rollContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A hook event that fires before the roll is made.
|
* A hook event that fires before the roll is made.
|
||||||
* @function tenebris.preRoll
|
* @function
|
||||||
* @memberof hookEvents
|
* @memberof hookEvents
|
||||||
* @param {Object} options Options for the roll.
|
* @param {Object} options Options for the roll.
|
||||||
* @param {Object} rollData All data related to the roll.
|
* @param {Object} rollData All data related to the roll.
|
||||||
* @returns {boolean} Explicitly return `false` to prevent roll to be made.
|
* @returns {boolean} Explicitly return `false` to prevent roll to be made.
|
||||||
*/
|
*/
|
||||||
if (Hooks.call("tenebris.preRoll", options, rollData) === false) return
|
if (Hooks.call("fvtt-lethal-fantasy.preRoll", options, rollData) === false) return
|
||||||
|
|
||||||
const roll = new this(formula, options.data, rollData)
|
const roll = new this(formula, options.data, rollData)
|
||||||
|
|
||||||
await roll.evaluate()
|
await roll.evaluate()
|
||||||
|
|
||||||
|
let rollTotal = -1
|
||||||
|
let diceResults = []
|
||||||
let resultType
|
let resultType
|
||||||
if (options.rollType === ROLL_TYPE.SAVE) {
|
if (options.rollType === "challenge") {
|
||||||
resultType = roll.total <= treshold ? "success" : "failure"
|
let d20result = roll.dice[0].results[0].result
|
||||||
} else if (options.rollType === ROLL_TYPE.RESOURCE) {
|
diceResults.push({ dice: `${dice}`, value: d20result})
|
||||||
resultType = roll.total === 1 || roll.total === 2 ? "failure" : "success"
|
let d20sum = d20result
|
||||||
|
while (d20result === maxValue) {
|
||||||
|
let r = await new Roll(`${dice}`).evaluate()
|
||||||
|
d20result = r.dice[0].results[0].result
|
||||||
|
diceResults.push( {dice: `${dice}-1`, value: d20result-1})
|
||||||
|
d20sum += (d20result - 1)
|
||||||
}
|
}
|
||||||
|
let minus1 = (fullModifier === 0) ? 0 : 1
|
||||||
|
diceResults.push({ dice: `${roll.dice[1].formula}-${minus1}`, value: roll.dice[1].results[0].result - minus1 })
|
||||||
|
rollTotal = Math.max(d20sum + roll.dice[1].results[0].result - minus1, 0)
|
||||||
|
|
||||||
let realDamage
|
} else if (options.rollType === ROLL_TYPE.RESOURCE) {
|
||||||
if (options.rollType === ROLL_TYPE.DAMAGE) {
|
//resultType = roll.total === 1 || roll.total === 2 ? "failure" : "success"
|
||||||
realDamage = Math.max(0, roll.total - parseInt(targetArmor, 10))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
roll.options.resultType = resultType
|
roll.options.resultType = resultType
|
||||||
roll.options.treshold = treshold
|
|
||||||
roll.options.introText = roll._createIntroText()
|
roll.options.introText = roll._createIntroText()
|
||||||
roll.options.introTextTooltip = roll._createIntroTextTooltip()
|
roll.options.introTextTooltip = roll._createIntroTextTooltip()
|
||||||
roll.options.realDamage = realDamage
|
roll.options.rollTotal = rollTotal
|
||||||
|
roll.options.diceResults = diceResults
|
||||||
|
roll.options.rollTarget = options.rollTarget
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A hook event that fires after the roll has been made.
|
* A hook event that fires after the roll has been made.
|
||||||
* @function tenebris.Roll
|
* @function
|
||||||
* @memberof hookEvents
|
* @memberof hookEvents
|
||||||
* @param {Object} options Options for the roll.
|
* @param {Object} options Options for the roll.
|
||||||
* @param {Object} rollData All data related to the roll.
|
* @param {Object} rollData All data related to the roll.
|
||||||
@param {LethalFantasyRoll} roll The resulting roll.
|
@param {LethalFantasyRoll} roll The resulting roll.
|
||||||
* @returns {boolean} Explicitly return `false` to prevent roll to be made.
|
* @returns {boolean} Explicitly return `false` to prevent roll to be made.
|
||||||
*/
|
*/
|
||||||
if (Hooks.call("tenebris.Roll", options, rollData, roll) === false) return
|
if (Hooks.call("fvtt-lethal-fantasy.Roll", options, rollData, roll) === false) return
|
||||||
|
|
||||||
return roll
|
return roll
|
||||||
}
|
}
|
||||||
@@ -437,16 +357,16 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
*/
|
*/
|
||||||
static createTitle(type, target) {
|
static createTitle(type, target) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ROLL_TYPE.SAVE:
|
case "challenge":
|
||||||
return `${game.i18n.localize("TENEBRIS.Dialog.titleSave")} : ${game.i18n.localize(`TENEBRIS.Manager.${target}`)}`
|
return `${game.i18n.localize("LETHALFANTASY.Dialog.titleSave")} : ${game.i18n.localize(`LETHALFANTASY.Manager.${target}`)}`
|
||||||
case ROLL_TYPE.RESOURCE:
|
case ROLL_TYPE.RESOURCE:
|
||||||
return `${game.i18n.localize("TENEBRIS.Dialog.titleResource")} : ${game.i18n.localize(`TENEBRIS.Manager.${target}`)}`
|
return `${game.i18n.localize("LETHALFANTASY.Dialog.titleResource")} : ${game.i18n.localize(`LETHALFANTASY.Manager.${target}`)}`
|
||||||
case ROLL_TYPE.DAMAGE:
|
case ROLL_TYPE.DAMAGE:
|
||||||
return `${game.i18n.localize("TENEBRIS.Dialog.titleDamage")} : ${target}`
|
return `${game.i18n.localize("LETHALFANTASY.Dialog.titleDamage")} : ${target}`
|
||||||
case ROLL_TYPE.ATTACK:
|
case ROLL_TYPE.ATTACK:
|
||||||
return `${game.i18n.localize("TENEBRIS.Dialog.titleAttack")} : ${target}`
|
return `${game.i18n.localize("LETHALFANTASY.Dialog.titleAttack")} : ${target}`
|
||||||
default:
|
default:
|
||||||
return game.i18n.localize("TENEBRIS.Dialog.titleStandard")
|
return game.i18n.localize("LETHALFANTASY.Dialog.titleStandard")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -468,10 +388,8 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
* @property {string} formula - The formula used for the roll.
|
* @property {string} formula - The formula used for the roll.
|
||||||
* @property {number} total - The total result of the roll.
|
* @property {number} total - The total result of the roll.
|
||||||
* @property {boolean} isSave - Indicates if the roll is a saving throw.
|
* @property {boolean} isSave - Indicates if the roll is a saving throw.
|
||||||
* @property {boolean} isResource - Indicates if the roll is related to a resource.
|
|
||||||
* @property {boolean} isDamage - Indicates if the roll is for damage.
|
* @property {boolean} isDamage - Indicates if the roll is for damage.
|
||||||
* @property {boolean} isFailure - Indicates if the roll is a failure.
|
* @property {boolean} isFailure - Indicates if the roll is a failure.
|
||||||
* @property {Array} avantages - Advantages associated with the roll.
|
|
||||||
* @property {string} actorId - The ID of the actor performing the roll.
|
* @property {string} actorId - The ID of the actor performing the roll.
|
||||||
* @property {string} actingCharName - The name of the character performing the roll.
|
* @property {string} actingCharName - The name of the character performing the roll.
|
||||||
* @property {string} actingCharImg - The image of the character performing the roll.
|
* @property {string} actingCharImg - The image of the character performing the roll.
|
||||||
@@ -481,7 +399,6 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
* @property {boolean} hasTarget - Indicates if the roll has a target.
|
* @property {boolean} hasTarget - Indicates if the roll has a target.
|
||||||
* @property {string} targetName - The name of the target.
|
* @property {string} targetName - The name of the target.
|
||||||
* @property {number} targetArmor - The armor value of the target.
|
* @property {number} targetArmor - The armor value of the target.
|
||||||
* @property {number} realDamage - The real damage dealt.
|
|
||||||
* @property {boolean} isPrivate - Indicates if the chat card is private.
|
* @property {boolean} isPrivate - Indicates if the chat card is private.
|
||||||
* @property {string} cssClass - The combined CSS classes as a single string.
|
* @property {string} cssClass - The combined CSS classes as a single string.
|
||||||
* @property {string} tooltip - The tooltip text for the chat card.
|
* @property {string} tooltip - The tooltip text for the chat card.
|
||||||
@@ -493,13 +410,14 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
diceTotal: this.dice.reduce((t, d) => t + d.total, 0),
|
diceTotal: this.dice.reduce((t, d) => t + d.total, 0),
|
||||||
isGM: game.user.isGM,
|
isGM: game.user.isGM,
|
||||||
formula: this.formula,
|
formula: this.formula,
|
||||||
total: this.total,
|
rollType: this.type,
|
||||||
|
rollTarget: this.rollTarget,
|
||||||
|
total: this.rollTotal,
|
||||||
isSave: this.isSave,
|
isSave: this.isSave,
|
||||||
isResource: this.isResource,
|
isChallenge: this.isChallenge,
|
||||||
isDamage: this.isDamage,
|
|
||||||
isFailure: this.isFailure,
|
isFailure: this.isFailure,
|
||||||
avantages: this.avantages,
|
|
||||||
actorId: this.actorId,
|
actorId: this.actorId,
|
||||||
|
diceResults: this.diceResults,
|
||||||
actingCharName: this.actorName,
|
actingCharName: this.actorName,
|
||||||
actingCharImg: this.actorImage,
|
actingCharImg: this.actorImage,
|
||||||
introText: this.introText,
|
introText: this.introText,
|
||||||
@@ -508,8 +426,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
hasTarget: this.hasTarget,
|
hasTarget: this.hasTarget,
|
||||||
targetName: this.targetName,
|
targetName: this.targetName,
|
||||||
targetArmor: this.targetArmor,
|
targetArmor: this.targetArmor,
|
||||||
realDamage: this.realDamage,
|
isPrivate: isPrivate
|
||||||
isPrivate: isPrivate,
|
|
||||||
}
|
}
|
||||||
cardData.cssClass = cardData.css.join(" ")
|
cardData.cssClass = cardData.css.join(" ")
|
||||||
cardData.tooltip = isPrivate ? "" : await this.getTooltip()
|
cardData.tooltip = isPrivate ? "" : await this.getTooltip()
|
||||||
@@ -529,11 +446,11 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
super.toMessage(
|
super.toMessage(
|
||||||
{
|
{
|
||||||
isSave: this.isSave,
|
isSave: this.isSave,
|
||||||
isResource: this.isResource,
|
isChallenge: this.isChallenge,
|
||||||
isDamage: this.isDamage,
|
|
||||||
isFailure: this.resultType === "failure",
|
isFailure: this.resultType === "failure",
|
||||||
avantages: this.avantages,
|
|
||||||
introText: this.introText,
|
introText: this.introText,
|
||||||
|
rollType: this.type,
|
||||||
|
rollTarget: this.rollTarget,
|
||||||
introTextTooltip: this.introTextTooltip,
|
introTextTooltip: this.introTextTooltip,
|
||||||
actingCharName: this.actorName,
|
actingCharName: this.actorName,
|
||||||
actingCharImg: this.actorImage,
|
actingCharImg: this.actorImage,
|
||||||
@@ -548,45 +465,4 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used in the avantages select and with the rollAdvantage parameter: convert the selected value to the corresponding string
|
|
||||||
static _convertAvantages(value) {
|
|
||||||
switch (value) {
|
|
||||||
case "1":
|
|
||||||
return game.i18n.localize("TENEBRIS.Roll.doubleDesavantage")
|
|
||||||
case "2":
|
|
||||||
return game.i18n.localize("TENEBRIS.Roll.desavantage")
|
|
||||||
case "3":
|
|
||||||
return game.i18n.localize("TENEBRIS.Roll.normal")
|
|
||||||
case "4":
|
|
||||||
return game.i18n.localize("TENEBRIS.Roll.avantage")
|
|
||||||
case "5":
|
|
||||||
return game.i18n.localize("TENEBRIS.Roll.doubleAvantage")
|
|
||||||
case "--":
|
|
||||||
return game.i18n.localize("TENEBRIS.Roll.doubleDesavantage")
|
|
||||||
case "-":
|
|
||||||
return game.i18n.localize("TENEBRIS.Roll.desavantage")
|
|
||||||
case "=":
|
|
||||||
return game.i18n.localize("TENEBRIS.Roll.normal")
|
|
||||||
case "+":
|
|
||||||
return game.i18n.localize("TENEBRIS.Roll.avantage")
|
|
||||||
case "++":
|
|
||||||
return game.i18n.localize("TENEBRIS.Roll.doubleAvantage")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Used in the rollAdvantage parameter: convert the selected value to the corresponding range value
|
|
||||||
static _convertRollAdvantageToRange(value) {
|
|
||||||
switch (value) {
|
|
||||||
case "--":
|
|
||||||
return 1
|
|
||||||
case "-":
|
|
||||||
return 2
|
|
||||||
case "=":
|
|
||||||
return 3
|
|
||||||
case "+":
|
|
||||||
return 4
|
|
||||||
case "++":
|
|
||||||
return 5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-34
@@ -46,7 +46,7 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
// Challenges
|
// Challenges
|
||||||
const challengeField = (label) => {
|
const challengeField = (label) => {
|
||||||
const schema = {
|
const schema = {
|
||||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
value: new fields.StringField({ initial: "0", required: true, nullable: false }),
|
||||||
}
|
}
|
||||||
return new fields.SchemaField(schema, { label })
|
return new fields.SchemaField(schema, { label })
|
||||||
}
|
}
|
||||||
@@ -129,6 +129,24 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.grit.starting = Math.round(grit / 6)
|
this.grit.starting = Math.round(grit / 6)
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
let wisDef = SYSTEM.CHARACTERISTICS_TABLES.wis.find(s => s.value === this.characteristics.wis.value)
|
||||||
|
this.saves.will.value = wisDef.willpower_save
|
||||||
|
|
||||||
|
let conDef = SYSTEM.CHARACTERISTICS_TABLES.con.find(s => s.value === this.characteristics.con.value)
|
||||||
|
this.saves.pain.value = conDef.pain_save
|
||||||
|
this.saves.toughness.value = conDef.toughness_save
|
||||||
|
this.challenges.dying.value = conDef.stabilization_dice
|
||||||
|
|
||||||
|
this.saves.contagion.value = this.characteristics.con.value
|
||||||
|
this.saves.poison.value = this.characteristics.con.value
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -138,46 +156,16 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
* @param {"="|"+"|"++"|"-"|"--"} rollAdvantage If there is an avantage (+), a disadvantage (-), a double advantage (++), a double disadvantage (--) or a normal roll (=).
|
* @param {"="|"+"|"++"|"-"|"--"} rollAdvantage If there is an avantage (+), a disadvantage (-), a double advantage (++), a double disadvantage (--) or a normal roll (=).
|
||||||
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
|
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
|
||||||
*/
|
*/
|
||||||
async roll(rollType, rollTarget, rollAdvantage = "=") {
|
async roll(rollType, rollTarget) {
|
||||||
let rollValue
|
const hasTarget = false
|
||||||
let opponentTarget
|
|
||||||
switch (rollType) {
|
|
||||||
case ROLL_TYPE.SAVE:
|
|
||||||
rollValue = this.caracteristiques[rollTarget].valeur
|
|
||||||
opponentTarget = game.user.targets.first()
|
|
||||||
break
|
|
||||||
case ROLL_TYPE.DAMAGE:
|
|
||||||
rollValue = this.parent.items.get(rollTarget).system.degats
|
|
||||||
opponentTarget = game.user.targets.first()
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
// Handle other cases or do nothing
|
|
||||||
break
|
|
||||||
}
|
|
||||||
await this._roll(rollType, rollTarget, rollValue, opponentTarget, rollAdvantage)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Rolls a dice for a character.
|
|
||||||
* @param {("save"|"resource|damage")} rollType The type of the roll.
|
|
||||||
* @param {number} rollTarget The target value for the roll. Which caracteristic or resource. If the roll is a damage roll, this is the id of the item.
|
|
||||||
* @param {number} rollValue The value of the roll. If the roll is a damage roll, this is the dice to roll.
|
|
||||||
* @param {Token} opponentTarget The target of the roll : used for save rolls to get the oppponent's malus.
|
|
||||||
* @param {"="|"+"|"++"|"-"|"--"} rollAdvantage If there is an avantage (+), a disadvantage (-), a double advantage (++), a double disadvantage (--) or a normal roll (=).
|
|
||||||
* @returns {Promise<null>} - A promise that resolves to null if the roll is cancelled.
|
|
||||||
*/
|
|
||||||
async _roll(rollType, rollTarget, rollValue, opponentTarget = undefined, rollAdvantage = "=") {
|
|
||||||
const hasTarget = opponentTarget !== undefined
|
|
||||||
let roll = await LethalFantasyRoll.prompt({
|
let roll = await LethalFantasyRoll.prompt({
|
||||||
rollType,
|
rollType,
|
||||||
rollTarget,
|
rollTarget,
|
||||||
rollValue,
|
|
||||||
actorId: this.parent.id,
|
actorId: this.parent.id,
|
||||||
actorName: this.parent.name,
|
actorName: this.parent.name,
|
||||||
actorImage: this.parent.img,
|
actorImage: this.parent.img,
|
||||||
hasTarget,
|
hasTarget,
|
||||||
target: opponentTarget,
|
target: false
|
||||||
rollAdvantage,
|
|
||||||
})
|
})
|
||||||
if (!roll) return null
|
if (!roll) return null
|
||||||
|
|
||||||
|
|||||||
+21
-6
@@ -60,34 +60,49 @@ export default class LethalFantasySkill extends foundry.abstract.TypeDataModel {
|
|||||||
return `${this.base} + ${String(this.bonus)}`;
|
return `${this.base} + ${String(this.bonus)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.base === "N/A" || this.base === "None") {
|
||||||
|
return this.bonus
|
||||||
|
}
|
||||||
|
|
||||||
// Split the base value per stat : WIS,DEX,STR,INT,CHA (example)
|
// Split the base value per stat : WIS,DEX,STR,INT,CHA (example)
|
||||||
const base = this.base;
|
let base = this.base;
|
||||||
let baseSplit = base.split(",");
|
// Fix errors in the base value
|
||||||
|
base.replace("CHARISMA", "CHA");
|
||||||
|
|
||||||
|
if (base.match(/OR/)) {
|
||||||
|
let baseSplit = base.split("OR");
|
||||||
let baseSplitLength = baseSplit.length;
|
let baseSplitLength = baseSplit.length;
|
||||||
if (baseSplitLength > 0) {
|
if (baseSplitLength > 0) {
|
||||||
// Select the max stat value from the parent actor
|
// Select the max stat value from the parent actor
|
||||||
let maxStat = 0;
|
let maxStat = 0;
|
||||||
for (let i = 0; i < baseSplitLength; i++) {
|
for (let i = 0; i < baseSplitLength; i++) {
|
||||||
const stat = baseSplit[i];
|
const stat = baseSplit[i].trim();
|
||||||
const statValue = actor.system.characteristics[stat.toLowerCase()]?.value || 0;
|
const statValue = actor.system.characteristics[stat.toLowerCase()]?.value || 0;
|
||||||
if (statValue > maxStat) {
|
if (statValue > maxStat) {
|
||||||
maxStat = statValue;
|
maxStat = statValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return maxStat + this.bonus
|
return maxStat + this.bonus
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (base.match(/\+/)) {
|
||||||
// Split with + calculate the total
|
// Split with + calculate the total
|
||||||
baseSplit = base.split("+");
|
let baseSplit = base.split("+");
|
||||||
baseSplitLength = baseSplit.length;
|
let baseSplitLength = baseSplit.length;
|
||||||
if (baseSplitLength > 0) {
|
if (baseSplitLength > 0) {
|
||||||
let total = 0;
|
let total = 0;
|
||||||
for (let i = 0; i < baseSplitLength; i++) {
|
for (let i = 0; i < baseSplitLength; i++) {
|
||||||
const stat = baseSplit[i];
|
const stat = baseSplit[i].trim();
|
||||||
const statValue = actor.system.characteristics[stat.toLowerCase()]?.value || 0;
|
const statValue = actor.system.characteristics[stat.toLowerCase()]?.value || 0;
|
||||||
total += statValue;
|
total += statValue;
|
||||||
}
|
}
|
||||||
return total + this.bonus
|
return total + this.bonus
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Single stat
|
||||||
|
const statValue = actor.system.characteristics[base.trim().toLowerCase()]?.value || 0;
|
||||||
|
return statValue + this.bonus
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return `${this.base} + ${String(this.bonus)}`;
|
return `${this.base} + ${String(this.bonus)}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,4 +55,5 @@ export default class LethalFantasySkill extends foundry.abstract.TypeDataModel {
|
|||||||
get weaponCategory() {
|
get weaponCategory() {
|
||||||
return game.i18n.localize(CATEGORY[this.weaponType].label)
|
return game.i18n.localize(CATEGORY[this.weaponType].label)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+167
-7
@@ -1,13 +1,173 @@
|
|||||||
|
|
||||||
export default class LethalFantasyUtils {
|
export default class LethalFantasyUtils {
|
||||||
// Return the maximum damage limited by the maximum damage of the character
|
|
||||||
static maxDamage(damage, damageMax) {
|
/* -------------------------------------------- */
|
||||||
// Otherwise, return damage (as it is less than or equal to damageMax)
|
static async loadCompendiumData(compendium) {
|
||||||
return 0
|
const pack = game.packs.get(compendium)
|
||||||
|
return await pack?.getDocuments() ?? []
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used when a ressource is lost to find the next lower dice
|
/* -------------------------------------------- */
|
||||||
static findLowerDice(dice) {
|
static async loadCompendium(compendium, filter = item => true) {
|
||||||
return 0
|
let compendiumData = await LethalFantasyUtils.loadCompendiumData(compendium)
|
||||||
|
return compendiumData.filter(filter)
|
||||||
|
}
|
||||||
|
|
||||||
|
static registerHandlebarsHelpers() {
|
||||||
|
|
||||||
|
Handlebars.registerHelper('isNull', function (val) {
|
||||||
|
return val == null;
|
||||||
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('exists', function (val) {
|
||||||
|
return val != null && val !== undefined;
|
||||||
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('isEmpty', function (list) {
|
||||||
|
if (list) return list.length === 0;
|
||||||
|
else return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('notEmpty', function (list) {
|
||||||
|
return list.length > 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('isNegativeOrNull', function (val) {
|
||||||
|
return val <= 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('isNegative', function (val) {
|
||||||
|
return val < 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('isPositive', function (val) {
|
||||||
|
return val > 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('equals', function (val1, val2) {
|
||||||
|
return val1 === val2;
|
||||||
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('neq', function (val1, val2) {
|
||||||
|
return val1 !== val2;
|
||||||
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('gt', function (val1, val2) {
|
||||||
|
return val1 > val2;
|
||||||
|
})
|
||||||
|
|
||||||
|
Handlebars.registerHelper('lt', function (val1, val2) {
|
||||||
|
return val1 < val2;
|
||||||
|
})
|
||||||
|
|
||||||
|
Handlebars.registerHelper('gte', function (val1, val2) {
|
||||||
|
return val1 >= val2;
|
||||||
|
})
|
||||||
|
|
||||||
|
Handlebars.registerHelper('lte', function (val1, val2) {
|
||||||
|
return val1 <= val2;
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('and', function (val1, val2) {
|
||||||
|
return val1 && val2;
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('or', function (val1, val2) {
|
||||||
|
return val1 || val2;
|
||||||
|
})
|
||||||
|
|
||||||
|
Handlebars.registerHelper('or3', function (val1, val2, val3) {
|
||||||
|
return val1 || val2 || val3;
|
||||||
|
})
|
||||||
|
|
||||||
|
Handlebars.registerHelper('for', function (from, to, incr, block) {
|
||||||
|
let accum = '';
|
||||||
|
for (let i = from; i < to; i += incr)
|
||||||
|
accum += block.fn(i);
|
||||||
|
return accum;
|
||||||
|
})
|
||||||
|
|
||||||
|
Handlebars.registerHelper('not', function (cond) {
|
||||||
|
return !cond;
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('count', function (list) {
|
||||||
|
return list.length;
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('countKeys', function (obj) {
|
||||||
|
return Object.keys(obj).length;
|
||||||
|
})
|
||||||
|
|
||||||
|
Handlebars.registerHelper('isEnabled', function (configKey) {
|
||||||
|
return game.settings.get("bol", configKey);
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('split', function (str, separator, keep) {
|
||||||
|
return str.split(separator)[keep];
|
||||||
|
})
|
||||||
|
|
||||||
|
// If you need to add Handlebars helpers, here are a few useful examples:
|
||||||
|
Handlebars.registerHelper('concat', function () {
|
||||||
|
let outStr = '';
|
||||||
|
for (let arg in arguments) {
|
||||||
|
if (typeof arguments[arg] != 'object') {
|
||||||
|
outStr += arguments[arg];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return outStr;
|
||||||
|
})
|
||||||
|
|
||||||
|
Handlebars.registerHelper('add', function (a, b) {
|
||||||
|
return parseInt(a) + parseInt(b);
|
||||||
|
});
|
||||||
|
Handlebars.registerHelper('mul', function (a, b) {
|
||||||
|
return parseInt(a) * parseInt(b);
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('sub', function (a, b) {
|
||||||
|
return parseInt(a) - parseInt(b);
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('abbrev2', function (a) {
|
||||||
|
return a.substring(0, 2);
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('abbrev3', function (a) {
|
||||||
|
return a.substring(0, 3);
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('valueAtIndex', function (arr, idx) {
|
||||||
|
return arr[idx];
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('includesKey', function (items, type, key) {
|
||||||
|
return items.filter(i => i.type === type).map(i => i.system.key).includes(key);
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('includes', function (array, val) {
|
||||||
|
return array.includes(val);
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('eval', function (expr) {
|
||||||
|
return eval(expr);
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('isOwnerOrGM', function (actor) {
|
||||||
|
console.log("Testing actor", actor.isOwner, game.userId)
|
||||||
|
return actor.isOwner || game.isGM;
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('upperCase', function (text) {
|
||||||
|
if (typeof text !== 'string') return text
|
||||||
|
return text.toUpperCase()
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('upperFirst', function (text) {
|
||||||
|
if (typeof text !== 'string') return text
|
||||||
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('upperFirstOnly', function (text) {
|
||||||
|
if (typeof text !== 'string') return text
|
||||||
|
return text.charAt(0).toUpperCase()
|
||||||
|
})
|
||||||
|
Handlebars.registerHelper('isCreature', function (key) {
|
||||||
|
return key === "creature" || key === "daemon";
|
||||||
|
})
|
||||||
|
|
||||||
|
// Handle v12 removal of this helper
|
||||||
|
Handlebars.registerHelper('select', function (selected, options) {
|
||||||
|
const escapedValue = RegExp.escape(Handlebars.escapeExpression(selected));
|
||||||
|
const rgx = new RegExp(' value=[\"\']' + escapedValue + '[\"\']');
|
||||||
|
const html = options.fn(this);
|
||||||
|
return html.replace(rgx, "$& selected");
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
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.
BIN
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.
@@ -303,13 +303,13 @@
|
|||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
legend {
|
legend {
|
||||||
a {
|
a {
|
||||||
font-size: calc(var(--font-size-standard) * 1.4);
|
font-size: calc(var(--font-size-standard) * 1.0);
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.skills {
|
.skills {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(5, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
.skill {
|
.skill {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -319,6 +319,9 @@
|
|||||||
width: 50px;
|
width: 50px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
}
|
}
|
||||||
|
.name {
|
||||||
|
min-width: 12rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.gifts {
|
.gifts {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
@import "fonts.less";
|
||||||
@import "global.less";
|
@import "global.less";
|
||||||
|
|
||||||
.lethalfantasy {
|
.lethalfantasy {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
:root {
|
:root {
|
||||||
--font-primary: "TimesNewRoman", serif;
|
--font-primary: "TimesNewRoman", serif;
|
||||||
--font-size-standard: 1.0rem;
|
--font-size-standard: 0.9rem;
|
||||||
--background-image-base: url("../assets/ui/lethal_fantasy_background.webp");
|
--background-image-base: url("../assets/ui/lethal_fantasy_background.webp");
|
||||||
--font-secondary: "BaskervilleBold", serif;
|
--font-secondary: "BaskervilleBold", serif;
|
||||||
--logo-standard: url("../assets/ui/lf_logo_small_02.webp");
|
--logo-standard: url("../assets/ui/lf_logo_small_02.webp");
|
||||||
|
|||||||
+5
-30
@@ -15,11 +15,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input[name="selectAvantages"] {
|
.dialog-modifier {
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog-aide-gene {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -32,36 +28,15 @@ input[name="selectAvantages"] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-modificateur {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
select {
|
|
||||||
border: none;
|
|
||||||
background-color: rgba(0, 0, 0, 0.1);
|
|
||||||
color: var(--color-dark-2);
|
|
||||||
width: 60px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog-avantages {
|
|
||||||
#selectAvantages {
|
|
||||||
background-color: inherit;
|
|
||||||
text-align: center;
|
|
||||||
font-family: var(--font-secondary);
|
|
||||||
font-size: calc(var(--font-size-standard) * 1.2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog-damage,
|
.dialog-damage,
|
||||||
.dialog-resource,
|
.dialog-resource,
|
||||||
|
.dialog-challenge,
|
||||||
.dialog-save {
|
.dialog-save {
|
||||||
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) * 2);
|
font-size: calc(var(--font-size-standard) * 1.2);
|
||||||
color: var(--color-dark-1);
|
color: var(--color-dark-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +70,7 @@ input[name="selectAvantages"] {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.introText {
|
.introText {
|
||||||
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);
|
||||||
width: 210px;
|
width: 210px;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
@@ -106,7 +81,7 @@ input[name="selectAvantages"] {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: calc(var(--font-size-standard) * 1.2);
|
font-size: calc(var(--font-size-standard) * 1.0);
|
||||||
text-shadow: 0 0 10px var(--color-shadow-primary);
|
text-shadow: 0 0 10px var(--color-shadow-primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-1
@@ -6,7 +6,7 @@
|
|||||||
"download": "#{DOWNLOAD}#",
|
"download": "#{DOWNLOAD}#",
|
||||||
"url": "#{URL}#",
|
"url": "#{URL}#",
|
||||||
"license": "LICENSE",
|
"license": "LICENSE",
|
||||||
"version": "12.0.8",
|
"version": "12.0.9",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Uberwald",
|
"name": "Uberwald",
|
||||||
@@ -66,6 +66,22 @@
|
|||||||
"system": "fvtt-lethal-fantasy",
|
"system": "fvtt-lethal-fantasy",
|
||||||
"path": "packs/lf-equipment",
|
"path": "packs/lf-equipment",
|
||||||
"type": "Item"
|
"type": "Item"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "lf-gifts",
|
||||||
|
"banner": "",
|
||||||
|
"label": "Gifts",
|
||||||
|
"system": "fvtt-lethal-fantasy",
|
||||||
|
"path": "packs/lf-gifts",
|
||||||
|
"type": "Item"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "lf-vulnerabilities",
|
||||||
|
"banner": "",
|
||||||
|
"label": "Vulnerabilities",
|
||||||
|
"system": "fvtt-lethal-fantasy",
|
||||||
|
"path": "packs/lf-vulnerabilities",
|
||||||
|
"type": "Item"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"flags": {
|
"flags": {
|
||||||
|
|||||||
@@ -79,15 +79,15 @@
|
|||||||
<legend>{{localize "LETHALFANTASY.Label.Challenges"}}</legend>
|
<legend>{{localize "LETHALFANTASY.Label.Challenges"}}</legend>
|
||||||
<div class="character-challenges">
|
<div class="character-challenges">
|
||||||
<div class="character-challenge">
|
<div class="character-challenge">
|
||||||
<span class="name">{{localize "LETHALFANTASY.Label.challenges.strength"}}</span>
|
<span class="name"><a class="rollable" data-roll-type="challenge" data-roll-key="str"><i 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
|
{{formField systemFields.challenges.fields.str.fields.value value=system.challenges.str.value disabled=isPlayMode
|
||||||
classes="rollable" data-challenge-id="str" }}
|
}}
|
||||||
<span class="name">{{localize "LETHALFANTASY.Label.challenges.agility"}}</span>
|
<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
|
{{formField systemFields.challenges.fields.agility.fields.value value=system.challenges.agility.value disabled=isPlayMode
|
||||||
classes="rollable" data-challenge-id="agility" }}
|
}}
|
||||||
<span class="name">{{localize "LETHALFANTASY.Label.challenges.dying"}}</span>
|
<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
|
{{formField systemFields.challenges.fields.dying.fields.value value=system.challenges.dying.value
|
||||||
disabled=isPlayMode classes="rollable" data-challenge-id="dying" }}
|
disabled=isPlayMode }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@@ -114,68 +114,68 @@
|
|||||||
|
|
||||||
<fieldset class="character-characteristics character-characteristics-{{ifThen isPlayMode 'play' 'edit'}}">
|
<fieldset class="character-characteristics character-characteristics-{{ifThen isPlayMode 'play' 'edit'}}">
|
||||||
<legend>{{localize "LETHALFANTASY.Label.characteristics"}}</legend>
|
<legend>{{localize "LETHALFANTASY.Label.characteristics"}}</legend>
|
||||||
<div class="character-characteristic" data-drag="true">
|
<div class="character-characteristic" >
|
||||||
{{localize "LETHALFANTASY.Label.str"}}
|
{{localize "LETHALFANTASY.Label.str"}}
|
||||||
{{formField systemFields.characteristics.fields.str.fields.value value=system.characteristics.str.value
|
{{formField systemFields.characteristics.fields.str.fields.value value=system.characteristics.str.value
|
||||||
disabled=isPlayMode classes="rollable" data-char-id="str" }}
|
disabled=isPlayMode classes="rollable" data-char-id="str" }}
|
||||||
{{formField systemFields.characteristics.fields.str.fields.percent value=system.characteristics.str.percent
|
{{formField systemFields.characteristics.fields.str.fields.percent value=system.characteristics.str.percent
|
||||||
disabled=isPlayMode }}
|
disabled=isPlayMode type="number"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="character-characteristic" data-drag="true">
|
<div class="character-characteristic" >
|
||||||
{{localize "LETHALFANTASY.Label.int"}}
|
{{localize "LETHALFANTASY.Label.int"}}
|
||||||
{{formField systemFields.characteristics.fields.int.fields.value value=system.characteristics.int.value
|
{{formField systemFields.characteristics.fields.int.fields.value value=system.characteristics.int.value
|
||||||
disabled=isPlayMode classes="rollable" data-char-id="int" }}
|
disabled=isPlayMode classes="rollable" data-char-id="int" }}
|
||||||
|
|
||||||
{{formField systemFields.characteristics.fields.int.fields.percent value=system.characteristics.int.percent
|
{{formField systemFields.characteristics.fields.int.fields.percent value=system.characteristics.int.percent
|
||||||
disabled=isPlayMode }}
|
disabled=isPlayMode type="number" }}
|
||||||
</div>
|
</div>
|
||||||
<div class="character-characteristic" data-drag="true">
|
<div class="character-characteristic" >
|
||||||
{{localize "LETHALFANTASY.Label.wis"}}
|
{{localize "LETHALFANTASY.Label.wis"}}
|
||||||
{{formField systemFields.characteristics.fields.wis.fields.value value=system.characteristics.wis.value
|
{{formField systemFields.characteristics.fields.wis.fields.value value=system.characteristics.wis.value
|
||||||
disabled=isPlayMode classes="rollable" data-char-id="wis" }}
|
disabled=isPlayMode classes="rollable" data-char-id="wis" }}
|
||||||
|
|
||||||
{{formField systemFields.characteristics.fields.wis.fields.percent value=system.characteristics.wis.percent
|
{{formField systemFields.characteristics.fields.wis.fields.percent value=system.characteristics.wis.percent
|
||||||
disabled=isPlayMode }}
|
disabled=isPlayMode type="number"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="character-characteristic" data-drag="true">
|
<div class="character-characteristic" >
|
||||||
{{localize "LETHALFANTASY.Label.dex"}}
|
{{localize "LETHALFANTASY.Label.dex"}}
|
||||||
{{formField systemFields.characteristics.fields.dex.fields.value value=system.characteristics.dex.value
|
{{formField systemFields.characteristics.fields.dex.fields.value value=system.characteristics.dex.value
|
||||||
disabled=isPlayMode classes="rollable" data-char-id="wis" }}
|
disabled=isPlayMode classes="rollable" data-char-id="wis" }}
|
||||||
|
|
||||||
{{formField systemFields.characteristics.fields.dex.fields.percent value=system.characteristics.dex.percent
|
{{formField systemFields.characteristics.fields.dex.fields.percent value=system.characteristics.dex.percent
|
||||||
disabled=isPlayMode }}
|
disabled=isPlayMode type="number" }}
|
||||||
</div>
|
</div>
|
||||||
<div class="character-characteristic" data-drag="true">
|
<div class="character-characteristic" >
|
||||||
{{localize "LETHALFANTASY.Label.con"}}
|
{{localize "LETHALFANTASY.Label.con"}}
|
||||||
{{formField systemFields.characteristics.fields.con.fields.value value=system.characteristics.con.value
|
{{formField systemFields.characteristics.fields.con.fields.value value=system.characteristics.con.value
|
||||||
disabled=isPlayMode classes="rollable" data-char-id="con" }}
|
disabled=isPlayMode classes="rollable" data-char-id="con" }}
|
||||||
|
|
||||||
{{formField systemFields.characteristics.fields.con.fields.percent value=system.characteristics.con.percent
|
{{formField systemFields.characteristics.fields.con.fields.percent value=system.characteristics.con.percent
|
||||||
disabled=isPlayMode }}
|
disabled=isPlayMode type="number"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="character-characteristic" data-drag="true">
|
<div class="character-characteristic" >
|
||||||
{{localize "LETHALFANTASY.Label.cha"}}
|
{{localize "LETHALFANTASY.Label.cha"}}
|
||||||
{{formField systemFields.characteristics.fields.cha.fields.value value=system.characteristics.cha.value
|
{{formField systemFields.characteristics.fields.cha.fields.value value=system.characteristics.cha.value
|
||||||
disabled=isPlayMode classes="rollable" data-char-id="cha" }}
|
disabled=isPlayMode classes="rollable" data-char-id="cha" }}
|
||||||
|
|
||||||
{{formField systemFields.characteristics.fields.cha.fields.percent value=system.characteristics.cha.percent
|
{{formField systemFields.characteristics.fields.cha.fields.percent value=system.characteristics.cha.percent
|
||||||
disabled=isPlayMode }}
|
disabled=isPlayMode type="number"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="character-characteristic" data-drag="true">
|
<div class="character-characteristic" >
|
||||||
{{localize "LETHALFANTASY.Label.luc"}}
|
{{localize "LETHALFANTASY.Label.luc"}}
|
||||||
{{formField systemFields.characteristics.fields.luc.fields.value value=system.characteristics.luc.value
|
{{formField systemFields.characteristics.fields.luc.fields.value value=system.characteristics.luc.value
|
||||||
disabled=isPlayMode classes="rollable" data-char-id="luc" }}
|
disabled=isPlayMode classes="rollable" data-char-id="luc" }}
|
||||||
|
|
||||||
{{formField systemFields.characteristics.fields.luc.fields.percent value=system.characteristics.luc.percent
|
{{formField systemFields.characteristics.fields.luc.fields.percent value=system.characteristics.luc.percent
|
||||||
disabled=isPlayMode }}
|
disabled=isPlayMode type="number"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="character-characteristic" data-drag="true">
|
<div class="character-characteristic" >
|
||||||
{{localize "LETHALFANTASY.Label.app"}}
|
{{localize "LETHALFANTASY.Label.app"}}
|
||||||
{{formField systemFields.characteristics.fields.app.fields.value value=system.characteristics.app.value
|
{{formField systemFields.characteristics.fields.app.fields.value value=system.characteristics.app.value
|
||||||
disabled=isPlayMode classes="rollable" data-char-id="app" }}
|
disabled=isPlayMode classes="rollable" data-char-id="app" }}
|
||||||
|
|
||||||
{{formField systemFields.characteristics.fields.app.fields.percent value=system.characteristics.app.percent
|
{{formField systemFields.characteristics.fields.app.fields.percent value=system.characteristics.app.percent
|
||||||
disabled=isPlayMode }}
|
disabled=isPlayMode type="number"}}
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,11 @@
|
|||||||
{{#each skills as |item|}}
|
{{#each skills as |item|}}
|
||||||
<div class="skill " data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
|
<div class="skill " data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
|
||||||
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
|
<img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
|
||||||
<div class="name" data-tooltip="{{{item.description}}}<br><br>{{item.path}}" data-tooltip-direction="UP">
|
<div class="name" >
|
||||||
{{item.name}} +{{item.system.skillTotal}}
|
{{item.name}}
|
||||||
|
</div>
|
||||||
|
<div class="score">
|
||||||
|
+{{item.system.skillTotal}}
|
||||||
</div>
|
</div>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<a data-tooltip="{{localize 'LETHALFANTASY.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
|
<a data-tooltip="{{localize 'LETHALFANTASY.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
|
||||||
|
|||||||
+11
-18
@@ -1,47 +1,40 @@
|
|||||||
{{!log 'chat-message' this}}
|
{{!log 'chat-message' this}}
|
||||||
<div class="{{cssClass}}">
|
<div class="{{cssClass}}">
|
||||||
<div class="intro-chat">
|
<div class="intro-chat">
|
||||||
{{#if (ne actingCharImg "icons/svg/mystery-man.svg")}}
|
|
||||||
<div class="intro-img">
|
<div class="intro-img">
|
||||||
<img src="{{actingCharImg}}" data-tooltip="{{actingCharName}}" />
|
<img src="{{actingCharImg}}" data-tooltip="{{actingCharName}}" />
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
|
||||||
<div></div>
|
|
||||||
{{/if}}
|
|
||||||
<div class="intro-right">
|
<div class="intro-right">
|
||||||
<p class="introText" {{#if isSave}}data-tooltip="{{introTextTooltip}}"{{/if}}>{{{introText}}}
|
<span>{{upperFirst rollType}} : {{upperCase rollTarget.rollKey}}</span>
|
||||||
{{#if isSave}}
|
{{#each diceResults as |result|}}
|
||||||
<br>
|
<span>{{result.dice}} : {{result.value}}</span>
|
||||||
{{#if (eq avantages "avantage")}} {{localize "TENEBRIS.Roll.avantage"}}{{/if}}
|
{{/each}}
|
||||||
{{#if (eq avantages "desavantage")}} {{localize "TENEBRIS.Roll.desavantage"}}{{/if}}
|
|
||||||
{{#if (eq avantages "doubleAvantage")}} {{localize "TENEBRIS.Roll.doubleAvantage"}}{{/if}}
|
|
||||||
{{#if (eq avantages "doubleDesavantage")}} {{localize "TENEBRIS.Roll.doubleDesavantage"}}{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{#if isSave}}
|
{{#if isSave}}
|
||||||
<div class="result">
|
<div class="result">
|
||||||
{{#if (eq resultType "success")}}
|
{{#if (eq resultType "success")}}
|
||||||
{{#if isPrivate}}?{{else}}{{localize "TENEBRIS.Roll.success"}}{{/if}}
|
{{#if isPrivate}}?{{else}}{{localize "LETHALFANTASY.Roll.success"}}{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if isPrivate}}?{{else}}{{localize "TENEBRIS.Roll.failure"}}{{/if}}
|
{{#if isPrivate}}?{{else}}{{localize "LETHALFANTASY.Roll.failure"}}{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if isResource}}
|
{{#if isResource}}
|
||||||
<div class="result">
|
<div class="result">
|
||||||
{{#if (eq resultType "success")}}
|
{{#if (eq resultType "success")}}
|
||||||
{{#if isPrivate}}?{{else}}{{localize "TENEBRIS.Roll.success"}}{{/if}}
|
{{#if isPrivate}}?{{else}}{{localize "LETHALFANTASY.Roll.success"}}{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if isPrivate}}?{{else}}{{localize "TENEBRIS.Roll.failure"}}{{#if isFailure}} ({{localize "TENEBRIS.Roll.resourceLost"}}){{/if}}{{/if}}
|
{{#if isPrivate}}?{{else}}{{localize "LETHALFANTASY.Roll.failure"}}{{#if isFailure}} ({{localize "LETHALFANTASY.Roll.resourceLost"}}){{/if}}{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if isDamage}}
|
{{#if isDamage}}
|
||||||
<div>
|
<div>
|
||||||
{{#if (and isGM hasTarget)}}
|
{{#if (and isGM hasTarget)}}
|
||||||
{{{localize "TENEBRIS.Roll.displayArmor" targetName=targetName targetArmor=targetArmor realDamage=realDamage}}}
|
{{{localize "LETHALFANTASY.Roll.displayArmor" targetName=targetName targetArmor=targetArmor realDamage=realDamage}}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
+11
-49
@@ -1,59 +1,21 @@
|
|||||||
{{log "roll-dialog" this}}
|
{{log "roll-dialog" this}}
|
||||||
<div class="tenebris-roll-dialog">
|
<div class="lethalfantasy-roll-dialog">
|
||||||
{{#if isSave}}
|
|
||||||
|
{{#if isChallenge}}
|
||||||
<fieldSet>
|
<fieldSet>
|
||||||
<legend>{{localize "TENEBRIS.Label.sauvegarde"}}</legend>
|
<legend>{{localize "LETHALFANTASY.Label.challenge"}}</legend>
|
||||||
<div class="dialog-save">{{formula}}</div>
|
{{log this}}
|
||||||
|
<div class="dialog-save">{{upperCase rollTarget.rollKey}} : {{formula}}</div>
|
||||||
</fieldSet>
|
</fieldSet>
|
||||||
<fieldSet class="dialog-avantages">
|
<fieldSet class="dialog-modifier">
|
||||||
<legend>{{localize "TENEBRIS.Roll.avantagesDesavantages"}}</legend>
|
<legend>{{localize "LETHALFANTASY.Roll.modifier"}}</legend>
|
||||||
<input
|
<select name="modifier" data-tooltip-direction="UP">
|
||||||
type="range"
|
{{selectOptions choiceModifier selected=modifier}}
|
||||||
name="avantages"
|
|
||||||
min="1"
|
|
||||||
max="5"
|
|
||||||
value="{{rangeAdvantage}}"
|
|
||||||
data-tooltip="Double désavantage - Désavantage - Normal - Avantage - Double avantage"
|
|
||||||
data-tooltip-direction="UP"
|
|
||||||
data-tooltip-class="tooltip-avantages"
|
|
||||||
/>
|
|
||||||
<input id="selectAvantages" name="selectAvantages" readonly value="{{rollAdvantage}}">
|
|
||||||
</fieldSet>
|
|
||||||
<div class="dialog-aide-gene">
|
|
||||||
<fieldSet>
|
|
||||||
<legend>{{localize "TENEBRIS.Roll.aide"}}</legend>
|
|
||||||
<select name="aide">
|
|
||||||
{{selectOptions choiceAide}}
|
|
||||||
</select>
|
|
||||||
</fieldSet>
|
|
||||||
<fieldSet>
|
|
||||||
<legend>{{localize "TENEBRIS.Roll.gene"}}</legend>
|
|
||||||
<select name="gene">
|
|
||||||
{{selectOptions choiceGene}}
|
|
||||||
</select>
|
|
||||||
</fieldSet>
|
|
||||||
</div>
|
|
||||||
<fieldSet class="dialog-modificateur">
|
|
||||||
<legend>{{localize "TENEBRIS.Roll.adversite"}}</legend>
|
|
||||||
<select name="modificateur" {{#if hasTarget}}data-tooltip="Cible : {{targetName}}" data-tooltip-direction="UP"{{/if}}>
|
|
||||||
{{selectOptions choiceModificateur selected=malus}}
|
|
||||||
</select>
|
</select>
|
||||||
</fieldSet>
|
</fieldSet>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (or isDamage isAttack)}}
|
|
||||||
<fieldSet>
|
<fieldSet>
|
||||||
<legend>{{localize "TENEBRIS.Label.degats"}}</legend>
|
<legend>{{localize "LETHALFANTASY.Roll.visibility"}}</legend>
|
||||||
<div class="dialog-damage">{{damageDice}} {{#if damageDiceLowered}}limités par les dégâts max à {{damageDiceFinal}} {{/if}}</div>
|
|
||||||
</fieldSet>
|
|
||||||
{{/if}}
|
|
||||||
{{#if isResource}}
|
|
||||||
<fieldSet>
|
|
||||||
<legend>{{localize "TENEBRIS.Label.ressource"}}</legend>
|
|
||||||
<div class="dialog-resource">{{formula}}</div>
|
|
||||||
</fieldSet>
|
|
||||||
{{/if}}
|
|
||||||
<fieldSet>
|
|
||||||
<legend>{{localize "TENEBRIS.Roll.visibilite"}}</legend>
|
|
||||||
<select name="visibility">
|
<select name="visibility">
|
||||||
{{selectOptions rollModes selected=visibility}}
|
{{selectOptions rollModes selected=visibility}}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user