Initial import with skill sheet worning
This commit is contained in:
parent
2e96b256fb
commit
df8995f8b7
File diff suppressed because it is too large
Load Diff
@ -25,7 +25,6 @@ export default [
|
|||||||
prettier
|
prettier
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
'prettier/prettier': 'error',
|
|
||||||
'array-bracket-spacing': ['warn', 'never'],
|
'array-bracket-spacing': ['warn', 'never'],
|
||||||
'array-callback-return': 'warn',
|
'array-callback-return': 'warn',
|
||||||
'arrow-spacing': 'warn',
|
'arrow-spacing': 'warn',
|
||||||
@ -143,9 +142,7 @@ export default [
|
|||||||
ignoreStrings: true,
|
ignoreStrings: true,
|
||||||
ignoreTemplateLiterals: true,
|
ignoreTemplateLiterals: true,
|
||||||
}],
|
}],
|
||||||
'prettier/prettier': ['error', { printWidth: 180 }],
|
|
||||||
'no-extra-boolean-cast': ['warn', { enforceForLogicalOperands: true }],
|
'no-extra-boolean-cast': ['warn', { enforceForLogicalOperands: true }],
|
||||||
'no-extra-semi': 'warn',
|
|
||||||
'no-multi-spaces': ['warn', { ignoreEOLComments: true }],
|
'no-multi-spaces': ['warn', { ignoreEOLComments: true }],
|
||||||
'no-tabs': 'warn',
|
'no-tabs': 'warn',
|
||||||
'no-throw-literal': 'error',
|
'no-throw-literal': 'error',
|
||||||
@ -159,13 +156,7 @@ export default [
|
|||||||
'prefer-template': 'warn',
|
'prefer-template': 'warn',
|
||||||
'quote-props': ['warn', 'as-needed', { keywords: false }],
|
'quote-props': ['warn', 'as-needed', { keywords: false }],
|
||||||
quotes: ['warn', 'double', { avoidEscape: true, allowTemplateLiterals: false }],
|
quotes: ['warn', 'double', { avoidEscape: true, allowTemplateLiterals: false }],
|
||||||
semi: 'warn',
|
semi: ["error", "never"],
|
||||||
'space-before-blocks': ['warn', 'always'],
|
|
||||||
'space-before-function-paren': ['warn', {
|
|
||||||
anonymous: 'never',
|
|
||||||
named: 'never',
|
|
||||||
asyncArrow: 'always',
|
|
||||||
}],
|
|
||||||
'spaced-comment': 'warn',
|
'spaced-comment': 'warn',
|
||||||
'jsdoc/check-access': 'warn',
|
'jsdoc/check-access': 'warn',
|
||||||
'jsdoc/check-alignment': 'warn',
|
'jsdoc/check-alignment': 'warn',
|
||||||
|
307
lang/en.json
307
lang/en.json
@ -1,313 +1,95 @@
|
|||||||
{
|
{
|
||||||
"TYPES": {
|
"TYPES": {
|
||||||
"Actor": {
|
"Actor": {
|
||||||
"character": "Personnage",
|
"character": "Character",
|
||||||
"opponent": "Adversaire"
|
"opponent": "NPC"
|
||||||
},
|
},
|
||||||
"Item": {
|
"Item": {
|
||||||
"path": "Voie",
|
"skill": "Skill",
|
||||||
"talent": "Talent",
|
"weapon": "Weapon",
|
||||||
"weapon": "Arme",
|
"armor": "Armor",
|
||||||
"armor": "Armure",
|
"spell": "Spell",
|
||||||
"spell": "Sortilège",
|
"gift": "Gift",
|
||||||
"attack": "Attaque"
|
"vulnerability": "Vulnerability",
|
||||||
|
"save": "Save",
|
||||||
|
"equipment": "Equipment"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"LETHALFANTASY": {
|
"LETHALFANTASY": {
|
||||||
"Character": {
|
"Character": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"voies": {
|
"str": {
|
||||||
"majeure": {
|
"label": "Strength"
|
||||||
"nom": {
|
|
||||||
"label": "Voie"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mineure": {
|
|
||||||
"nom": {
|
|
||||||
"label": "Voie Mineure"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"commanditaire": {
|
"dex": {
|
||||||
"label": "Commanditaire"
|
"label": "Dexterity"
|
||||||
},
|
},
|
||||||
"dv": {
|
"int": {
|
||||||
"label": "Dé de Vie"
|
"label": "Intelligence"
|
||||||
},
|
},
|
||||||
"pv": {
|
"wis": {
|
||||||
"value": {
|
"label": "Wisdom"
|
||||||
"label": "Points de Vie",
|
|
||||||
"short": "PV"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"dmax": {
|
"con": {
|
||||||
"valeur": {
|
"label": "Constitution"
|
||||||
"label": "Dégâts max"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"caracteristiques": {
|
"char": {
|
||||||
"rob": {
|
"label": "Charisma"
|
||||||
"valeur": {
|
|
||||||
"label": "Robustesse",
|
|
||||||
"short": "Rob"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dex": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Dextérité",
|
|
||||||
"short": "Dex"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"int": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Intelligence",
|
|
||||||
"short": "Int"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"per": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Perception",
|
|
||||||
"short": "Per"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"vol": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Volonté",
|
|
||||||
"short": "Vol"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"ressources": {
|
"app": {
|
||||||
"san": {
|
"label": "Appearance"
|
||||||
"valeur": {
|
|
||||||
"label": "Santé Mentale"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oeil": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Œil"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"verbe": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Verbe"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bourse": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Bourse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"magie": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Magie"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"Label": {
|
|
||||||
"personnage": "Personnage",
|
|
||||||
"caracteristiques": "Caractéristiques",
|
|
||||||
"ressources": "Ressources",
|
|
||||||
"description": "Description",
|
|
||||||
"langues": "Langues",
|
|
||||||
"notes": "Notes",
|
|
||||||
"details": "Détails",
|
|
||||||
"biography": "Biographie",
|
|
||||||
"biens": "Biens",
|
|
||||||
"talents": "Talents",
|
|
||||||
"attaques": "Attaques"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Opponent": {
|
"Opponent": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"dv": {
|
}
|
||||||
"label": "Dé de Vie"
|
},
|
||||||
},
|
"Skill": {
|
||||||
"pv": {
|
"FIELDS": {
|
||||||
"value": {
|
"description": {
|
||||||
"label": "Points de Vie"
|
"label": "Description"
|
||||||
},
|
|
||||||
"max": {
|
|
||||||
"label": "Points de Vie max"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"armure": {
|
|
||||||
"label": "Armure"
|
|
||||||
},
|
|
||||||
"malus": {
|
|
||||||
"label": "Malus d'adversité"
|
|
||||||
},
|
|
||||||
"actions": {
|
|
||||||
"label": "Actions"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Talent": {
|
"Equipment": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"description": {
|
"description": {
|
||||||
"label": "Description"
|
"label": "Description"
|
||||||
},
|
|
||||||
"appris": {
|
|
||||||
"label": "Appris"
|
|
||||||
},
|
|
||||||
"progression": {
|
|
||||||
"label": "Progression"
|
|
||||||
},
|
|
||||||
"niveau": {
|
|
||||||
"label": "Niveau"
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"details": "(Niveau {niveau})"
|
|
||||||
},
|
},
|
||||||
"Path": {
|
"Gift": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"description": {
|
"description": {
|
||||||
"label": "Description"
|
"label": "Description"
|
||||||
},
|
|
||||||
"biens": {
|
|
||||||
"label": "Biens"
|
|
||||||
},
|
|
||||||
"langues": {
|
|
||||||
"label": "Langues"
|
|
||||||
},
|
|
||||||
"talents": {
|
|
||||||
"label": "Talents"
|
|
||||||
},
|
|
||||||
"voies": {
|
|
||||||
"majeure": {
|
|
||||||
"label": "Voie Majeure"
|
|
||||||
},
|
|
||||||
"mineure": {
|
|
||||||
"label": "Voie Mineure"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dv": {
|
|
||||||
"label": "Dé de Vie"
|
|
||||||
},
|
|
||||||
"dmax": {
|
|
||||||
"label": "Dégâts max"
|
|
||||||
},
|
|
||||||
"caracteristiques": {
|
|
||||||
"rob": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Robustesse",
|
|
||||||
"short": "Rob"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dex": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Dextérité",
|
|
||||||
"short": "Dex"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"int": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Intelligence",
|
|
||||||
"short": "Int"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"per": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Perception",
|
|
||||||
"short": "Per"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"vol": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Volonté",
|
|
||||||
"short": "Vol"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ressources": {
|
|
||||||
"san": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Santé Mentale"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oeil": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Œil"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"verbe": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Verbe"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bourse": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Bourse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"magie": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Magie"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Weapon": {
|
"Weapon": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"categorie": {
|
"category": {
|
||||||
"label": "Catégorie"
|
"label": "Category"
|
||||||
},
|
|
||||||
"degats": {
|
|
||||||
"label": "Dégâts"
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"Category": {
|
|
||||||
"main": "Mains Nues",
|
|
||||||
"improvisee": "Armes Improvisées",
|
|
||||||
"courte": "Armes courtes",
|
|
||||||
"longue": "Armes longues",
|
|
||||||
"lourde": "Armes lourdes"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Armor": {
|
"Armor": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"categorie": {
|
"category": {
|
||||||
"label": "Catégorie"
|
"label": "Category"
|
||||||
},
|
|
||||||
"valeur": {
|
|
||||||
"label": "Valeur"
|
|
||||||
},
|
|
||||||
"malus": {
|
|
||||||
"label": "Malus"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Category": {
|
"Category": {
|
||||||
"sommaire": "Armures sommaires",
|
"sommaire": "Armures sommaires",
|
||||||
"legere": "Armures légères",
|
"legere": "Armures légères",
|
||||||
"guerre": "Armures de guerre"
|
"guerre": "Armures de guerre"
|
||||||
},
|
}
|
||||||
"details": "Valeur : {valeur} - Malus : {malus}"
|
|
||||||
},
|
},
|
||||||
"Spell": {
|
"Spell": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"description": {
|
"description": {
|
||||||
"label": "Description"
|
"label": "Description"
|
||||||
},
|
|
||||||
"preparation": {
|
|
||||||
"label": "Préparation"
|
|
||||||
},
|
|
||||||
"cible": {
|
|
||||||
"label": "Cible"
|
|
||||||
},
|
|
||||||
"portee": {
|
|
||||||
"label": "Portée"
|
|
||||||
},
|
|
||||||
"duree": {
|
|
||||||
"label": "Durée"
|
|
||||||
},
|
|
||||||
"consequenceA": {
|
|
||||||
"label": "Conséquence A"
|
|
||||||
},
|
|
||||||
"consequenceB": {
|
|
||||||
"label": "Conséquence B"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Range": {
|
"Range": {
|
||||||
@ -318,10 +100,17 @@
|
|||||||
"distant": "Distant"
|
"distant": "Distant"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Attack": {
|
"Vulneravility": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"degats": {
|
"description": {
|
||||||
"label": "Dégâts"
|
"label": "Description"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Save": {
|
||||||
|
"FIELDS": {
|
||||||
|
"description": {
|
||||||
|
"label": "Description"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
438
lang/fr.json
438
lang/fr.json
@ -1,438 +0,0 @@
|
|||||||
{
|
|
||||||
"TYPES": {
|
|
||||||
"Actor": {
|
|
||||||
"character": "Personnage",
|
|
||||||
"opponent": "Adversaire"
|
|
||||||
},
|
|
||||||
"Item": {
|
|
||||||
"path": "Voie",
|
|
||||||
"talent": "Talent",
|
|
||||||
"weapon": "Arme",
|
|
||||||
"armor": "Armure",
|
|
||||||
"spell": "Sortilège",
|
|
||||||
"attack": "Attaque"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"LETHALFANTASY": {
|
|
||||||
"Character": {
|
|
||||||
"FIELDS": {
|
|
||||||
"voies": {
|
|
||||||
"majeure": {
|
|
||||||
"nom": {
|
|
||||||
"label": "Voie"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mineure": {
|
|
||||||
"nom": {
|
|
||||||
"label": "Voie Mineure"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"commanditaire": {
|
|
||||||
"label": "Commanditaire"
|
|
||||||
},
|
|
||||||
"dv": {
|
|
||||||
"label": "Dé de Vie"
|
|
||||||
},
|
|
||||||
"pv": {
|
|
||||||
"value": {
|
|
||||||
"label": "Points de Vie",
|
|
||||||
"short": "PV"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dmax": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Dégâts max"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"caracteristiques": {
|
|
||||||
"rob": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Robustesse",
|
|
||||||
"short": "Rob"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dex": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Dextérité",
|
|
||||||
"short": "Dex"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"int": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Intelligence",
|
|
||||||
"short": "Int"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"per": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Perception",
|
|
||||||
"short": "Per"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"vol": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Volonté",
|
|
||||||
"short": "Vol"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ressources": {
|
|
||||||
"san": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Santé Mentale"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oeil": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Œil"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"verbe": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Verbe"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bourse": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Bourse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"magie": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Magie"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Label": {
|
|
||||||
"personnage": "Personnage",
|
|
||||||
"caracteristiques": "Caractéristiques",
|
|
||||||
"ressources": "Ressources",
|
|
||||||
"description": "Description",
|
|
||||||
"langues": "Langues",
|
|
||||||
"notes": "Notes",
|
|
||||||
"details": "Détails",
|
|
||||||
"biography": "Biographie",
|
|
||||||
"biens": "Biens",
|
|
||||||
"talents": "Talents",
|
|
||||||
"attaques": "Attaques"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Opponent": {
|
|
||||||
"FIELDS": {
|
|
||||||
"dv": {
|
|
||||||
"label": "Dé de Vie"
|
|
||||||
},
|
|
||||||
"pv": {
|
|
||||||
"value": {
|
|
||||||
"label": "Points de Vie"
|
|
||||||
},
|
|
||||||
"max": {
|
|
||||||
"label": "Points de Vie max"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"armure": {
|
|
||||||
"label": "Armure"
|
|
||||||
},
|
|
||||||
"malus": {
|
|
||||||
"label": "Malus d'adversité"
|
|
||||||
},
|
|
||||||
"actions": {
|
|
||||||
"label": "Actions"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Talent": {
|
|
||||||
"FIELDS": {
|
|
||||||
"description": {
|
|
||||||
"label": "Description"
|
|
||||||
},
|
|
||||||
"appris": {
|
|
||||||
"label": "Appris"
|
|
||||||
},
|
|
||||||
"progression": {
|
|
||||||
"label": "Progression"
|
|
||||||
},
|
|
||||||
"niveau": {
|
|
||||||
"label": "Niveau"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"details": "(Niveau {niveau})"
|
|
||||||
},
|
|
||||||
"Path": {
|
|
||||||
"FIELDS": {
|
|
||||||
"description": {
|
|
||||||
"label": "Description"
|
|
||||||
},
|
|
||||||
"biens": {
|
|
||||||
"label": "Biens"
|
|
||||||
},
|
|
||||||
"langues": {
|
|
||||||
"label": "Langues"
|
|
||||||
},
|
|
||||||
"talents": {
|
|
||||||
"label": "Talents"
|
|
||||||
},
|
|
||||||
"voies": {
|
|
||||||
"majeure": {
|
|
||||||
"label": "Voie Majeure"
|
|
||||||
},
|
|
||||||
"mineure": {
|
|
||||||
"label": "Voie Mineure"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dv": {
|
|
||||||
"label": "Dé de Vie"
|
|
||||||
},
|
|
||||||
"dmax": {
|
|
||||||
"label": "Dégâts max"
|
|
||||||
},
|
|
||||||
"caracteristiques": {
|
|
||||||
"rob": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Robustesse",
|
|
||||||
"short": "Rob"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dex": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Dextérité",
|
|
||||||
"short": "Dex"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"int": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Intelligence",
|
|
||||||
"short": "Int"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"per": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Perception",
|
|
||||||
"short": "Per"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"vol": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Volonté",
|
|
||||||
"short": "Vol"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ressources": {
|
|
||||||
"san": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Santé Mentale"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oeil": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Œil"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"verbe": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Verbe"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bourse": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Bourse"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"magie": {
|
|
||||||
"valeur": {
|
|
||||||
"label": "Magie"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Weapon": {
|
|
||||||
"FIELDS": {
|
|
||||||
"categorie": {
|
|
||||||
"label": "Catégorie"
|
|
||||||
},
|
|
||||||
"degats": {
|
|
||||||
"label": "Dégâts"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Category": {
|
|
||||||
"main": "Mains Nues",
|
|
||||||
"improvisee": "Armes Improvisées",
|
|
||||||
"courte": "Armes courtes",
|
|
||||||
"longue": "Armes longues",
|
|
||||||
"lourde": "Armes lourdes"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Armor": {
|
|
||||||
"FIELDS": {
|
|
||||||
"categorie": {
|
|
||||||
"label": "Catégorie"
|
|
||||||
},
|
|
||||||
"valeur": {
|
|
||||||
"label": "Valeur"
|
|
||||||
},
|
|
||||||
"malus": {
|
|
||||||
"label": "Malus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Category": {
|
|
||||||
"sommaire": "Armures sommaires",
|
|
||||||
"legere": "Armures légères",
|
|
||||||
"guerre": "Armures de guerre"
|
|
||||||
},
|
|
||||||
"details": "Valeur : {valeur} - Malus : {malus}"
|
|
||||||
},
|
|
||||||
"Spell": {
|
|
||||||
"FIELDS": {
|
|
||||||
"description": {
|
|
||||||
"label": "Description"
|
|
||||||
},
|
|
||||||
"preparation": {
|
|
||||||
"label": "Préparation"
|
|
||||||
},
|
|
||||||
"cible": {
|
|
||||||
"label": "Cible"
|
|
||||||
},
|
|
||||||
"portee": {
|
|
||||||
"label": "Portée"
|
|
||||||
},
|
|
||||||
"duree": {
|
|
||||||
"label": "Durée"
|
|
||||||
},
|
|
||||||
"consequenceA": {
|
|
||||||
"label": "Conséquence A"
|
|
||||||
},
|
|
||||||
"consequenceB": {
|
|
||||||
"label": "Conséquence B"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Range": {
|
|
||||||
"na": "-",
|
|
||||||
"contact": "Contact",
|
|
||||||
"proche": "Proche",
|
|
||||||
"loin": "Loin",
|
|
||||||
"distant": "Distant"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Attack": {
|
|
||||||
"FIELDS": {
|
|
||||||
"degats": {
|
|
||||||
"label": "Dégâts"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Label": {
|
|
||||||
"description": "Description",
|
|
||||||
"biens": "Biens",
|
|
||||||
"langues": "Langues",
|
|
||||||
"profil": "Profil",
|
|
||||||
"details": "Détails",
|
|
||||||
"talents": "Talents",
|
|
||||||
"progressionPossible": "Progression possible",
|
|
||||||
"equipement": "Equipement",
|
|
||||||
"spells" : "Sortilèges",
|
|
||||||
"level": "Niveau",
|
|
||||||
"degats": "Dégâts",
|
|
||||||
"ressource": "Ressource",
|
|
||||||
"sauvegarde": "Sauvegarde",
|
|
||||||
"newArmor": "Nouvelle armure",
|
|
||||||
"newWeapon": "Nouvelle arme",
|
|
||||||
"armor": "Armure",
|
|
||||||
"malus": "Malus",
|
|
||||||
"jet": "Jet de ",
|
|
||||||
"progress": "Progression",
|
|
||||||
"hasProgressed": "A progressé dans la caractéristique",
|
|
||||||
"noProgress": "N'a pas progressé dans la caractéristique",
|
|
||||||
"experience": "Expérience",
|
|
||||||
"experienceDetail": "Expérience {detail}",
|
|
||||||
"maximum": "Maximum"
|
|
||||||
},
|
|
||||||
"Edit": "Editer",
|
|
||||||
"Delete": "Supprimer",
|
|
||||||
"ToggleSheet": "Changer de mode",
|
|
||||||
"Warning": {
|
|
||||||
"dejaDeuxVoies": "Vous avez déjà choisi deux voies",
|
|
||||||
"dejaVoieMajeure": "Vous avez déjà choisi cette voie comme voie majeure",
|
|
||||||
"voieMajeureAjoutee": "Voie majeure ajoutée",
|
|
||||||
"voieMineureAjoutee": "Voie mineure ajoutée",
|
|
||||||
"voieMajeureSupprimee": "Voie majeure supprimée",
|
|
||||||
"voieMineureSupprimee": "Voie mineure supprimée",
|
|
||||||
"plusDeRessource": "Vous n'avez plus de ressource {ressource}"
|
|
||||||
},
|
|
||||||
"Dialog": {
|
|
||||||
"ajoutVoieMajeure": "Ajouter une voie majeure va automatiquement remplacer les caractéristiques, les ressources, les langues et les biens. Continuer ?",
|
|
||||||
"ajoutVoieMajeureTitre": "Ajout d'une voie majeure",
|
|
||||||
"ajoutVoieMineureTitre": "Ajout d'une voie mineure",
|
|
||||||
"suppressionTalents": "Supprimer cette voie va supprimer les talents associés. Continuer ?",
|
|
||||||
"talentDansVoie": "Ce talent est présent dans la voie {path}. Voulez-vous vraiment le supprimer ?",
|
|
||||||
"titleSave": "Jet de sauvegarde",
|
|
||||||
"titleResource": "Jet de ressource",
|
|
||||||
"titleDamage": "Jet de dégâts",
|
|
||||||
"titleAttack": "Jet d'attaque",
|
|
||||||
"titleStandard": "Jet standard"
|
|
||||||
},
|
|
||||||
"Roll": {
|
|
||||||
"save": "Jet de sauvegarde <br> {save}",
|
|
||||||
"resource": "Jet de ressource <br> {resource}",
|
|
||||||
"damage": "Jet de dégâts <br> {item}",
|
|
||||||
"attack": "Jet d'attaque <br> {item}",
|
|
||||||
"roll": "Lancer",
|
|
||||||
"aide": "Aider",
|
|
||||||
"gene": "Gêner",
|
|
||||||
"adversite": "Adversité",
|
|
||||||
"avantagesDesavantages": "Avantages et désavantages",
|
|
||||||
"normal": "Normal",
|
|
||||||
"avantage": "Avec avantage",
|
|
||||||
"desavantage": "Avec désavantage",
|
|
||||||
"doubleAvantage": "Avec double avantage",
|
|
||||||
"doubleDesavantage": "Avec double désavantage",
|
|
||||||
"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": {
|
|
||||||
"learnedTalents": "Les talents appris sont en gras",
|
|
||||||
"saveIntroTextTooltip": "Caractéristique : {value} <br> Aide : {aide} <br> Gêne : {gene} <br> Modificateur : {modificateur}",
|
|
||||||
"addAttack": "Ajouter une attaque",
|
|
||||||
"addEquipment": "Ajouter une arme, Shift + Click pour ajouter une armure",
|
|
||||||
"addSpell": "Ajouter un sortilège"
|
|
||||||
},
|
|
||||||
"Setting": {
|
|
||||||
"displayOpponentMalus": "Afficher le malus d'adversité",
|
|
||||||
"displayOpponentMalusHint": "Affiche le malus d'adversité pour les joueurs.",
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -12,11 +12,12 @@ import * as documents from "./module/documents/_module.mjs"
|
|||||||
import * as applications from "./module/applications/_module.mjs"
|
import * as applications from "./module/applications/_module.mjs"
|
||||||
|
|
||||||
import { handleSocketEvent } from "./module/socket.mjs"
|
import { handleSocketEvent } from "./module/socket.mjs"
|
||||||
import { configureDiceSoNice } from "./module/dice.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"
|
||||||
|
|
||||||
|
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)}}}
|
||||||
|
|
||||||
Hooks.once("init", function () {
|
Hooks.once("init", function () {
|
||||||
console.info("Lethal Fantasy RPG | Initializing System")
|
console.info("Lethal Fantasy RPG | Initializing System")
|
||||||
console.info(SYSTEM.ASCII)
|
console.info(SYSTEM.ASCII)
|
||||||
@ -39,12 +40,13 @@ Hooks.once("init", function () {
|
|||||||
|
|
||||||
CONFIG.Item.documentClass = documents.LethalFantasyItem
|
CONFIG.Item.documentClass = documents.LethalFantasyItem
|
||||||
CONFIG.Item.dataModels = {
|
CONFIG.Item.dataModels = {
|
||||||
path: models.LethalFantasyPath,
|
skill: models.LethalFantasySkill,
|
||||||
talent: models.LethalFantasyTalent,
|
gift: models.LethalFantasyGift,
|
||||||
weapon: models.LethalFantasyWeapon,
|
weapon: models.LethalFantasyWeapon,
|
||||||
armor: models.LethalFantasyArmor,
|
armor: models.LethalFantasyArmor,
|
||||||
spell: models.LethalFantasySpell,
|
spell: models.LethalFantasySpell,
|
||||||
attack: models.LethalFantasyAttack,
|
save: models.LethalFantasySave,
|
||||||
|
vulnerability: models.LethalFantasyVulnerability
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register sheet application classes
|
// Register sheet application classes
|
||||||
@ -53,12 +55,13 @@ Hooks.once("init", function () {
|
|||||||
Actors.registerSheet("lethalFantasy", applications.LethalFantasyOpponentSheet, { types: ["opponent"], makeDefault: true })
|
Actors.registerSheet("lethalFantasy", applications.LethalFantasyOpponentSheet, { types: ["opponent"], makeDefault: true })
|
||||||
|
|
||||||
Items.unregisterSheet("core", ItemSheet)
|
Items.unregisterSheet("core", ItemSheet)
|
||||||
Items.registerSheet("lethalFantasy", applications.LethalFantasyTalentSheet, { types: ["talent"], makeDefault: true })
|
Items.registerSheet("lethalFantasy", applications.LethalFantasySkillSheet, { types: ["skill"], makeDefault: true })
|
||||||
Items.registerSheet("lethalFantasy", applications.LethalFantasyPathSheet, { types: ["path"], makeDefault: true })
|
Items.registerSheet("lethalFantasy", applications.LethalFantasyGiftSheet, { types: ["gift"], makeDefault: true })
|
||||||
|
Items.registerSheet("lethalFantasy", applications.LethalFantasyVulnerabilitySheet, { types: ["vulnerability"], makeDefault: true })
|
||||||
|
Items.registerSheet("lethalFantasy", applications.LethalFantasySaveSheet, { types: ["save"], makeDefault: true })
|
||||||
Items.registerSheet("lethalFantasy", applications.LethalFantasyWeaponSheet, { types: ["weapon"], makeDefault: true })
|
Items.registerSheet("lethalFantasy", applications.LethalFantasyWeaponSheet, { types: ["weapon"], makeDefault: true })
|
||||||
Items.registerSheet("lethalFantasy", applications.LethalFantasySpellSheet, { types: ["spell"], makeDefault: true })
|
Items.registerSheet("lethalFantasy", applications.LethalFantasySpellSheet, { types: ["spell"], makeDefault: true })
|
||||||
Items.registerSheet("lethalFantasy", applications.LethalFantasyArmorSheet, { types: ["armor"], makeDefault: true })
|
Items.registerSheet("lethalFantasy", applications.LethalFantasyArmorSheet, { types: ["armor"], makeDefault: true })
|
||||||
Items.registerSheet("lethalFantasy", applications.LethalFantasyAttackSheet, { types: ["attack"], makeDefault: true })
|
|
||||||
|
|
||||||
// Other Document Configuration
|
// Other Document Configuration
|
||||||
CONFIG.ChatMessage.documentClass = documents.LethalFantasyChatMessage
|
CONFIG.ChatMessage.documentClass = documents.LethalFantasyChatMessage
|
||||||
@ -140,9 +143,7 @@ function preLocalizeConfig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Hooks.once("ready", function () {
|
Hooks.once("ready", function () {
|
||||||
console.info("CTHULHU TENEBRIS | Ready")
|
console.info("LETHAL FANTASY | Ready")
|
||||||
game.system.applicationFortune = new applications.LethalFantasyFortune()
|
|
||||||
game.system.applicationFortune.render(true)
|
|
||||||
game.system.applicationManager = new applications.LethalFantasyManager()
|
game.system.applicationManager = new applications.LethalFantasyManager()
|
||||||
if (game.user.isGM) {
|
if (game.user.isGM) {
|
||||||
game.system.applicationManager.render(true)
|
game.system.applicationManager.render(true)
|
||||||
@ -159,65 +160,14 @@ Hooks.once("ready", function () {
|
|||||||
async function _showUserGuide() {
|
async function _showUserGuide() {
|
||||||
if (game.user.isGM) {
|
if (game.user.isGM) {
|
||||||
const newVer = game.system.version
|
const newVer = game.system.version
|
||||||
const userGuideJournalName = "Guide du système"
|
|
||||||
const userGuideCompendiumLabel = "userguide"
|
|
||||||
|
|
||||||
let currentVer = "0"
|
|
||||||
let oldUserGuide = game.journal.getName(userGuideJournalName)
|
|
||||||
if (oldUserGuide !== undefined && oldUserGuide !== null && oldUserGuide.getFlag("lethalFantasy", "UserGuideVersion") !== undefined) {
|
|
||||||
currentVer = oldUserGuide.getFlag("lethalFantasy", "UserGuideVersion")
|
|
||||||
}
|
|
||||||
if (newVer === currentVer) {
|
|
||||||
// Up to date
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
let newReleasePack = game.packs.find((p) => p.metadata.name === userGuideCompendiumLabel)
|
|
||||||
if (newReleasePack === null || newReleasePack === undefined) {
|
|
||||||
console.info("CTHULHU TENEBRIS | No compendium found for the system guide")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
await newReleasePack.getIndex()
|
|
||||||
|
|
||||||
let newUserGuide = newReleasePack.index.find((j) => j.name === userGuideJournalName)
|
|
||||||
if (newUserGuide === undefined || newUserGuide === null) {
|
|
||||||
console.info("CTHULHU TENEBRIS | No system guide found in the compendium")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't delete until we have new release Pack
|
|
||||||
if (oldUserGuide !== null && oldUserGuide !== undefined) {
|
|
||||||
await oldUserGuide.delete()
|
|
||||||
}
|
|
||||||
|
|
||||||
await game.journal.importFromCompendium(newReleasePack, newUserGuide._id)
|
|
||||||
let newReleaseJournal = game.journal.getName(newUserGuide.name)
|
|
||||||
|
|
||||||
await newReleaseJournal.setFlag("lethalFantasy", "UserGuideVersion", newVer)
|
|
||||||
|
|
||||||
// Show journal
|
|
||||||
await newReleaseJournal.sheet.render(true, { sheetMode: "text" })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
Hooks.on("renderChatMessage", (message, html, data) => {
|
Hooks.on("renderChatMessage", (message, html, data) => {
|
||||||
const typeMessage = data.message.flags.lethalFantasy?.typeMessage
|
const typeMessage = data.message.flags.lethalFantasy?.typeMessage
|
||||||
// Message de fortune
|
|
||||||
if (typeMessage === "fortune") {
|
|
||||||
if (game.user.isGM && !data.message.flags.lethalFantasy?.accepted) {
|
|
||||||
html.find(".button").click((event) => applications.LethalFantasyFortune.acceptRequest(event, html, data))
|
|
||||||
} else {
|
|
||||||
html.find(".button").each((i, btn) => {
|
|
||||||
btn.style.display = "none"
|
|
||||||
})
|
|
||||||
if (game.user.isGM) {
|
|
||||||
html.find(".fortune-accepted").each((i, btn) => (btn.style.display = "flex"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Message de demande de jet de dés
|
// Message de demande de jet de dés
|
||||||
else if (typeMessage === "askRoll") {
|
if (typeMessage === "askRoll") {
|
||||||
// Affichage des boutons de jet de dés uniquement pour les joueurs
|
// Affichage des boutons de jet de dés uniquement pour les joueurs
|
||||||
if (game.user.isGM) {
|
if (game.user.isGM) {
|
||||||
html.find(".ask-roll-dice").each((i, btn) => {
|
html.find(".ask-roll-dice").each((i, btn) => {
|
||||||
@ -238,9 +188,6 @@ Hooks.on("renderChatMessage", (message, html, data) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
Hooks.on("updateSetting", async (setting, update, options, id) => {
|
Hooks.on("updateSetting", async (setting, update, options, id) => {
|
||||||
if (setting.key === "lethalFantasy.fortune") {
|
|
||||||
game.system.applicationFortune.render(true)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Dice-so-nice Ready
|
// Dice-so-nice Ready
|
||||||
@ -256,7 +203,7 @@ Hooks.once("diceSoNiceReady", (dice3d) => {
|
|||||||
*/
|
*/
|
||||||
Hooks.on("hotbarDrop", (bar, data, slot) => {
|
Hooks.on("hotbarDrop", (bar, data, slot) => {
|
||||||
if (["Actor", "Item", "JournalEntry", "roll", "rollDamage", "rollAttack"].includes(data.type)) {
|
if (["Actor", "Item", "JournalEntry", "roll", "rollDamage", "rollAttack"].includes(data.type)) {
|
||||||
Macros.createLethalFantasyMacro(data, slot)
|
Macros.createLethalFantasyMacro(data, slot);
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -267,29 +214,6 @@ Hooks.on("hotbarDrop", (bar, data, slot) => {
|
|||||||
*/
|
*/
|
||||||
function registerWorldCount(registerKey) {
|
function registerWorldCount(registerKey) {
|
||||||
if (game.user.isGM) {
|
if (game.user.isGM) {
|
||||||
let worldKey = game.settings.get(registerKey, "worldKey")
|
ClassCounter.registerUsageCount(game.system.id, {})
|
||||||
if (worldKey === undefined || worldKey === "") {
|
|
||||||
worldKey = foundry.utils.randomID(32)
|
|
||||||
game.settings.set(registerKey, "worldKey", worldKey)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Simple API counter
|
|
||||||
const worldData = {
|
|
||||||
register_key: registerKey,
|
|
||||||
world_key: worldKey,
|
|
||||||
foundry_version: `${game.release.generation}.${game.release.build}`,
|
|
||||||
system_name: game.system.id,
|
|
||||||
system_version: game.system.version,
|
|
||||||
}
|
|
||||||
|
|
||||||
let apiURL = "https://worlds.qawstats.info/worlds-counter"
|
|
||||||
$.ajax({
|
|
||||||
url: apiURL,
|
|
||||||
type: "POST",
|
|
||||||
data: JSON.stringify(worldData),
|
|
||||||
contentType: "application/json; charset=utf-8",
|
|
||||||
dataType: "json",
|
|
||||||
async: false,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
export { default as LethalFantasyCharacterSheet } from "./sheets/character-sheet.mjs"
|
export { default as LethalFantasyCharacterSheet } from "./sheets/character-sheet.mjs";
|
||||||
export { default as LethalFantasyOpponentSheet } from "./sheets/opponent-sheet.mjs"
|
export { default as LethalFantasyOpponentSheet } from "./sheets/opponent-sheet.mjs"
|
||||||
export { default as LethalFantasyPathSheet } from "./sheets/path-sheet.mjs"
|
|
||||||
export { default as LethalFantasyTalentSheet } from "./sheets/talent-sheet.mjs"
|
|
||||||
export { default as LethalFantasyWeaponSheet } from "./sheets/weapon-sheet.mjs"
|
export { default as LethalFantasyWeaponSheet } from "./sheets/weapon-sheet.mjs"
|
||||||
|
export { default as LethalFantasySkillSheet } from "./sheets/skill-sheet.mjs"
|
||||||
|
export { default as LethalFantasyGiftSheet } from "./sheets/gift-sheet.mjs"
|
||||||
|
export { default as LethalFantasyVulnerabilitySheet } from "./sheets/vulnerability-sheet.mjs"
|
||||||
|
export { default as LethalFantasySaveSheet } from "./sheets/save-sheet.mjs"
|
||||||
export { default as LethalFantasyArmorSheet } from "./sheets/armor-sheet.mjs"
|
export { default as LethalFantasyArmorSheet } from "./sheets/armor-sheet.mjs"
|
||||||
export { default as LethalFantasySpellSheet } from "./sheets/spell-sheet.mjs"
|
export { default as LethalFantasySpellSheet } from "./sheets/spell-sheet.mjs"
|
||||||
export { default as LethalFantasyAttackSheet } from "./sheets/attack-sheet.mjs"
|
export { default as LethalFantasyEquipmentSheet } from "./sheets/equipment-sheet.mjs"
|
||||||
export { default as LethalFantasyFortune } from "./fortune.mjs"
|
|
||||||
export { default as LethalFantasyManager } from "./manager.mjs"
|
export { default as LethalFantasyManager } from "./manager.mjs"
|
||||||
|
@ -1,156 +0,0 @@
|
|||||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api
|
|
||||||
import { SYSTEM } from "../config/system.mjs"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An application for configuring the permissions which are available to each User role.
|
|
||||||
* @extends ApplicationV2
|
|
||||||
* @mixes HandlebarsApplication
|
|
||||||
* @alias PermissionConfig
|
|
||||||
*/
|
|
||||||
export default class LethalFantasyFortune extends HandlebarsApplicationMixin(ApplicationV2) {
|
|
||||||
/** @inheritDoc */
|
|
||||||
static DEFAULT_OPTIONS = {
|
|
||||||
id: "tenebris-application-fortune",
|
|
||||||
tag: "form",
|
|
||||||
window: {
|
|
||||||
contentClasses: ["tenebris-fortune"],
|
|
||||||
title: "TENEBRIS.Fortune.title",
|
|
||||||
controls: [],
|
|
||||||
},
|
|
||||||
position: {
|
|
||||||
width: 200,
|
|
||||||
height: 200,
|
|
||||||
top: 80,
|
|
||||||
left: 150,
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
closeOnSubmit: true,
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
fortune: LethalFantasyFortune.#requestFortune,
|
|
||||||
increaseFortune: LethalFantasyFortune.#increaseFortune,
|
|
||||||
decreaseFortune: LethalFantasyFortune.#decreaseFortune,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @override */
|
|
||||||
_getHeaderControls() {
|
|
||||||
const controls = []
|
|
||||||
if (game.user.isGM) {
|
|
||||||
controls.push(
|
|
||||||
{
|
|
||||||
action: "increaseFortune",
|
|
||||||
icon: "fa fa-plus",
|
|
||||||
label: "Augmenter",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
action: "decreaseFortune",
|
|
||||||
icon: "fa fa-minus",
|
|
||||||
label: "Diminuer",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return controls
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @override */
|
|
||||||
static PARTS = {
|
|
||||||
main: {
|
|
||||||
template: "systems/fvtt-lethal-fantasy/templates/fortune.hbs",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
/* Rendering */
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
|
|
||||||
/** @override */
|
|
||||||
async _prepareContext(_options = {}) {
|
|
||||||
return {
|
|
||||||
fortune: game.settings.get("tenebris", "fortune"),
|
|
||||||
userId: game.user.id,
|
|
||||||
isGM: game.user.isGM,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles the request for a fortune.
|
|
||||||
*
|
|
||||||
* @param {Event} event The event that triggered the request.
|
|
||||||
* @param {Object} target The target object for the request.
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
static #requestFortune(event, target) {
|
|
||||||
console.debug("request Fortune, event, target")
|
|
||||||
game.socket.emit(`system.${SYSTEM.id}`, {
|
|
||||||
action: "fortune",
|
|
||||||
data: {
|
|
||||||
userId: game.user.id,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
static async #increaseFortune(event, target) {
|
|
||||||
console.log("increase Fortune", event, target)
|
|
||||||
const currentValue = game.settings.get("tenebris", "fortune")
|
|
||||||
const newValue = currentValue + 1
|
|
||||||
await game.settings.set("tenebris", "fortune", newValue)
|
|
||||||
}
|
|
||||||
|
|
||||||
static async #decreaseFortune(event, target) {
|
|
||||||
console.log("decrease Fortune", event, target)
|
|
||||||
const currentValue = game.settings.get("tenebris", "fortune")
|
|
||||||
if (currentValue > 0) {
|
|
||||||
const newValue = currentValue - 1
|
|
||||||
await game.settings.set("tenebris", "fortune", newValue)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles the fortune spcket event for a given user.
|
|
||||||
*
|
|
||||||
* @param {Object} [options] The options object.
|
|
||||||
* @param {string} [options.userId] The ID of the user.
|
|
||||||
* @returns {Promise<ChatMessage>} - The created chat message.
|
|
||||||
*/
|
|
||||||
static async handleSocketEvent({ userId } = {}) {
|
|
||||||
console.debug(`handleSocketEvent Fortune from ${userId} !`)
|
|
||||||
const origin = game.users.get(userId)
|
|
||||||
const chatData = {
|
|
||||||
name: origin.name,
|
|
||||||
actingCharImg: origin.character?.img,
|
|
||||||
origin: origin,
|
|
||||||
user: game.user,
|
|
||||||
isGM: game.user.isGM,
|
|
||||||
}
|
|
||||||
const content = await renderTemplate("systems/fvtt-lethal-fantasy/templates/chat-fortune.hbs", chatData)
|
|
||||||
const messageData = {
|
|
||||||
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
|
|
||||||
user: origin,
|
|
||||||
speaker: { user: origin },
|
|
||||||
content: content,
|
|
||||||
flags: { tenebris: { typeMessage: "fortune", accepted: false } },
|
|
||||||
}
|
|
||||||
ChatMessage.applyRollMode(messageData, CONST.DICE_ROLL_MODES.PRIVATE)
|
|
||||||
return ChatMessage.implementation.create(messageData)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles the acceptance of a request event in the chat message by the GM
|
|
||||||
*
|
|
||||||
* @param {Event} event The event object that triggered the request.
|
|
||||||
* @param {HTMLElement} html The HTML element associated with the event.
|
|
||||||
* @param {Object} data Additional data related to the event.
|
|
||||||
* @returns {Promise<void>} A promise that resolves when the request has been processed.
|
|
||||||
*/
|
|
||||||
static async acceptRequest(event, html, data) {
|
|
||||||
console.debug("acceptRequest Fortune", event, html, data)
|
|
||||||
const currentValue = game.settings.get("tenebris", "fortune")
|
|
||||||
if (currentValue > 0) {
|
|
||||||
const newValue = currentValue - 1
|
|
||||||
await game.settings.set("tenebris", "fortune", newValue)
|
|
||||||
}
|
|
||||||
let message = game.messages.get(data.message._id)
|
|
||||||
message.update({ "flags.tenebris.accepted": true })
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,11 +9,11 @@ import { SYSTEM } from "../config/system.mjs"
|
|||||||
*/
|
*/
|
||||||
export default class LethalFantasyManager extends HandlebarsApplicationMixin(ApplicationV2) {
|
export default class LethalFantasyManager extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
id: "tenebris-application-manager",
|
id: "lethalfantasy-application-manager",
|
||||||
tag: "form",
|
tag: "form",
|
||||||
window: {
|
window: {
|
||||||
contentClasses: ["tenebris-manager"],
|
contentClasses: ["lethalfantasy-manager"],
|
||||||
title: "TENEBRIS.Manager.title",
|
title: "LETHALFANTASY.Manager.title",
|
||||||
resizable: true,
|
resizable: true,
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
@ -82,22 +82,22 @@ export default class LethalFantasyManager extends HandlebarsApplicationMixin(App
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async askRollForAll(type, value, title = null, avantage = null) {
|
static async askRollForAll(type, value, title = null, avantage = null) {
|
||||||
let label = game.i18n.localize(`TENEBRIS.Manager.${value}`)
|
let label = game.i18n.localize(`LETHALFANTASY.Manager.${value}`)
|
||||||
let text = game.i18n.format("TENEBRIS.Chat.askRollForAll", { value: label })
|
let text = game.i18n.format("LETHALFANTASY.Chat.askRollForAll", { value: label })
|
||||||
|
|
||||||
if (avantage) {
|
if (avantage) {
|
||||||
switch (avantage) {
|
switch (avantage) {
|
||||||
case "++":
|
case "++":
|
||||||
text += ` ${game.i18n.localize("TENEBRIS.Roll.doubleAvantage")}`
|
text += ` ${game.i18n.localize("LETHALFANTASY.Roll.doubleAvantage")}`
|
||||||
break
|
break
|
||||||
case "+":
|
case "+":
|
||||||
text += ` ${game.i18n.localize("TENEBRIS.Roll.avantage")}`
|
text += ` ${game.i18n.localize("LETHALFANTASY.Roll.avantage")}`
|
||||||
break
|
break
|
||||||
case "-":
|
case "-":
|
||||||
text += ` ${game.i18n.localize("TENEBRIS.Roll.desavantage")}`
|
text += ` ${game.i18n.localize("LETHALFANTASY.Roll.desavantage")}`
|
||||||
break
|
break
|
||||||
case "--":
|
case "--":
|
||||||
text += ` ${game.i18n.localize("TENEBRIS.Roll.doubleDesavantage")}`
|
text += ` ${game.i18n.localize("LETHALFANTASY.Roll.doubleDesavantage")}`
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
@ -118,8 +118,8 @@ export default class LethalFantasyManager extends HandlebarsApplicationMixin(App
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async askRollForOne(type, value, recipient, name) {
|
static async askRollForOne(type, value, recipient, name) {
|
||||||
let label = game.i18n.localize(`TENEBRIS.Manager.${value}`)
|
let label = game.i18n.localize(`LETHALFANTASY.Manager.${value}`)
|
||||||
const text = game.i18n.format("TENEBRIS.Chat.askRollForOne", { value: label, name: name })
|
const text = game.i18n.format("LETHALFANTASY.Chat.askRollForOne", { value: label, name: name })
|
||||||
|
|
||||||
game.socket.emit(`system.${SYSTEM.id}`, {
|
game.socket.emit(`system.${SYSTEM.id}`, {
|
||||||
action: "askRoll",
|
action: "askRoll",
|
||||||
|
@ -16,7 +16,7 @@ export default class LethalFantasyActorSheet extends HandlebarsApplicationMixin(
|
|||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
classes: ["tenebris", "actor"],
|
classes: ["lethalfantasy", "actor"],
|
||||||
position: {
|
position: {
|
||||||
width: 1400,
|
width: 1400,
|
||||||
height: "auto",
|
height: "auto",
|
||||||
|
@ -16,7 +16,7 @@ export default class LethalFantasyItemSheet extends HandlebarsApplicationMixin(f
|
|||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
classes: ["tenebris", "item"],
|
classes: ["lethalfantasy", "item"],
|
||||||
position: {
|
position: {
|
||||||
width: 600,
|
width: 600,
|
||||||
height: "auto",
|
height: "auto",
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
import LethalFantasyItemSheet from "./base-item-sheet.mjs"
|
import LethalFantasyItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
export default class LethalFantasyAttackSheet extends LethalFantasyItemSheet {
|
export default class LethalFantasyEquipmentSheet extends LethalFantasyItemSheet {
|
||||||
/** @override */
|
/** @override */
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
classes: ["attack"],
|
classes: ["equipment"],
|
||||||
position: {
|
position: {
|
||||||
width: 600,
|
width: 600,
|
||||||
},
|
},
|
||||||
window: {
|
window: {
|
||||||
contentClasses: ["attack-content"],
|
contentClasses: ["equipment-content"],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static PARTS = {
|
static PARTS = {
|
||||||
main: {
|
main: {
|
||||||
template: "systems/fvtt-lethal-fantasy/templates/attack.hbs",
|
template: "systems/fvtt-lethal-fantasy/templates/equipment.hbs",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -1,21 +1,21 @@
|
|||||||
import LethalFantasyItemSheet from "./base-item-sheet.mjs"
|
import LethalFantasyItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
export default class LethalFantasyTalentSheet extends LethalFantasyItemSheet {
|
export default class LethalFantasyGiftSheet extends LethalFantasyItemSheet {
|
||||||
/** @override */
|
/** @override */
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
classes: ["talent"],
|
classes: ["gift"],
|
||||||
position: {
|
position: {
|
||||||
width: 600,
|
width: 600,
|
||||||
},
|
},
|
||||||
window: {
|
window: {
|
||||||
contentClasses: ["talent-content"],
|
contentClasses: ["gift-content"],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static PARTS = {
|
static PARTS = {
|
||||||
main: {
|
main: {
|
||||||
template: "systems/fvtt-lethal-fantasy/templates/talent.hbs",
|
template: "systems/fvtt-lethal-fantasy/templates/gift.hbs",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,7 +23,6 @@ export default class LethalFantasyTalentSheet extends LethalFantasyItemSheet {
|
|||||||
async _prepareContext() {
|
async _prepareContext() {
|
||||||
const context = await super._prepareContext()
|
const context = await super._prepareContext()
|
||||||
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.improvedDescription, { async: true })
|
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.improvedDescription, { async: true })
|
||||||
context.canProgress = this.document.system.canProgress
|
|
||||||
return context
|
return context
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,141 +0,0 @@
|
|||||||
import LethalFantasyItemSheet from "./base-item-sheet.mjs"
|
|
||||||
|
|
||||||
export default class LethalFantasyPathSheet extends LethalFantasyItemSheet {
|
|
||||||
/** @override */
|
|
||||||
static DEFAULT_OPTIONS = {
|
|
||||||
classes: ["path"],
|
|
||||||
position: {
|
|
||||||
width: 1400,
|
|
||||||
},
|
|
||||||
window: {
|
|
||||||
contentClasses: ["path-content"],
|
|
||||||
},
|
|
||||||
dragDrop: [{ dragSelector: "[data-drag]", dropSelector: null }],
|
|
||||||
actions: {
|
|
||||||
edit: LethalFantasyPathSheet.#onTalentEdit,
|
|
||||||
delete: LethalFantasyPathSheet.#onTalentDelete,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @override */
|
|
||||||
static PARTS = {
|
|
||||||
header: {
|
|
||||||
template: "systems/fvtt-lethal-fantasy/templates/path-header.hbs",
|
|
||||||
},
|
|
||||||
tabs: {
|
|
||||||
template: "templates/generic/tab-navigation.hbs",
|
|
||||||
},
|
|
||||||
main: {
|
|
||||||
template: "systems/fvtt-lethal-fantasy/templates/path-main.hbs",
|
|
||||||
},
|
|
||||||
talents: {
|
|
||||||
template: "systems/fvtt-lethal-fantasy/templates/path-talents.hbs",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @override */
|
|
||||||
tabGroups = {
|
|
||||||
sheet: "main",
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prepare an array of form header tabs.
|
|
||||||
* @returns {Record<string, Partial<ApplicationTab>>}
|
|
||||||
*/
|
|
||||||
#getTabs() {
|
|
||||||
const tabs = {
|
|
||||||
main: { id: "main", group: "sheet", icon: "fa-solid fa-user", label: "TENEBRIS.Label.profil" },
|
|
||||||
talents: { id: "talents", group: "sheet", icon: "fa-solid fa-book", label: "TENEBRIS.Label.talents" },
|
|
||||||
}
|
|
||||||
for (const v of Object.values(tabs)) {
|
|
||||||
v.active = this.tabGroups[v.group] === v.id
|
|
||||||
v.cssClass = v.active ? "active" : ""
|
|
||||||
}
|
|
||||||
return tabs
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @override */
|
|
||||||
async _prepareContext() {
|
|
||||||
const context = await super._prepareContext()
|
|
||||||
context.tabs = this.#getTabs()
|
|
||||||
return context
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @override */
|
|
||||||
async _preparePartContext(partId, context) {
|
|
||||||
const doc = this.document
|
|
||||||
switch (partId) {
|
|
||||||
case "main":
|
|
||||||
context.tab = context.tabs.main
|
|
||||||
context.enrichedBiens = await TextEditor.enrichHTML(this.document.system.biens, { async: true })
|
|
||||||
context.enrichedLangues = await TextEditor.enrichHTML(this.document.system.langues, { async: true })
|
|
||||||
break
|
|
||||||
case "talents":
|
|
||||||
context.tab = context.tabs.talents
|
|
||||||
const talentItems = []
|
|
||||||
for (const talent of this.item.system.talents) {
|
|
||||||
const talentItem = await fromUuid(talent)
|
|
||||||
if (talentItem) talentItems.push(talentItem)
|
|
||||||
}
|
|
||||||
|
|
||||||
context.talents = talentItems
|
|
||||||
context.talents.sort((a, b) => a.name.localeCompare(b.name, game.i18n.lang))
|
|
||||||
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return context
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Callback actions which occur when a dragged element is dropped on a target.
|
|
||||||
* Seul un item de type Talent peut être déposé sur une voie.
|
|
||||||
* @param {DragEvent} event The originating DragEvent
|
|
||||||
* @protected
|
|
||||||
*/
|
|
||||||
async _onDrop(event) {
|
|
||||||
const data = TextEditor.getDragEventData(event)
|
|
||||||
|
|
||||||
switch (data.type) {
|
|
||||||
case "Item":
|
|
||||||
if (this.isPlayMode) return
|
|
||||||
const item = await fromUuid(data.uuid)
|
|
||||||
if (item.type !== "talent") return
|
|
||||||
|
|
||||||
console.debug("dropped item", item)
|
|
||||||
const talents = this.item.toObject().system.talents
|
|
||||||
talents.push(item.uuid)
|
|
||||||
this.item.update({ "system.talents": talents })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// #region Actions
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Edit an existing talent within the path item
|
|
||||||
* Use the uuid to display the talent sheet (from world or compendium)
|
|
||||||
* @param {PointerEvent} event The originating click event
|
|
||||||
* @param {HTMLElement} target the capturing HTML element which defined a [data-action]
|
|
||||||
*/
|
|
||||||
static async #onTalentEdit(event, target) {
|
|
||||||
const itemUuid = target.getAttribute("data-item-uuid")
|
|
||||||
const talent = await fromUuid(itemUuid)
|
|
||||||
talent.sheet.render(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete an existing talent within the path item
|
|
||||||
* Use the uuid to remove it form the array of talents
|
|
||||||
* @param {PointerEvent} event The originating click event
|
|
||||||
* @param {HTMLElement} target the capturing HTML element which defined a [data-action]
|
|
||||||
*/
|
|
||||||
static async #onTalentDelete(event, target) {
|
|
||||||
const itemUuid = target.getAttribute("data-item-uuid")
|
|
||||||
|
|
||||||
const talents = this.item.toObject().system.talents
|
|
||||||
const index = talents.indexOf(itemUuid)
|
|
||||||
talents.splice(index, 1)
|
|
||||||
this.item.update({ "system.talents": talents })
|
|
||||||
}
|
|
||||||
|
|
||||||
// #endregion
|
|
||||||
}
|
|
28
module/applications/sheets/save-sheet.mjs
Normal file
28
module/applications/sheets/save-sheet.mjs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import LethalFantasyItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class LethalFantasyGiftSheet extends LethalFantasyItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
classes: ["save"],
|
||||||
|
position: {
|
||||||
|
width: 600,
|
||||||
|
},
|
||||||
|
window: {
|
||||||
|
contentClasses: ["save-content"],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
main: {
|
||||||
|
template: "systems/fvtt-lethal-fantasy/templates/save.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
async _prepareContext() {
|
||||||
|
const context = await super._prepareContext()
|
||||||
|
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
|
||||||
|
return context
|
||||||
|
}
|
||||||
|
}
|
28
module/applications/sheets/skill-sheet.mjs
Normal file
28
module/applications/sheets/skill-sheet.mjs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import LethalFantasyItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class LethalFantasySkillSheet extends LethalFantasyItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
classes: ["skill"],
|
||||||
|
position: {
|
||||||
|
width: 600,
|
||||||
|
},
|
||||||
|
window: {
|
||||||
|
contentClasses: ["skill-content"],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
main: {
|
||||||
|
template: "systems/fvtt-lethal-fantasy/templates/skill.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
async _prepareContext() {
|
||||||
|
const context = await super._prepareContext()
|
||||||
|
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
|
||||||
|
return context
|
||||||
|
}
|
||||||
|
}
|
28
module/applications/sheets/vulnerability-sheet.mjs
Normal file
28
module/applications/sheets/vulnerability-sheet.mjs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import LethalFantasyItemSheet from "./base-item-sheet.mjs"
|
||||||
|
|
||||||
|
export default class LethalFantasyVulnerabilitySheet extends LethalFantasyItemSheet {
|
||||||
|
/** @override */
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
classes: ["vulnerability"],
|
||||||
|
position: {
|
||||||
|
width: 600,
|
||||||
|
},
|
||||||
|
window: {
|
||||||
|
contentClasses: ["vulnerability-content"],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
main: {
|
||||||
|
template: "systems/fvtt-lethal-fantasy/templates/vulnerability.hbs",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
async _prepareContext() {
|
||||||
|
const context = await super._prepareContext()
|
||||||
|
context.enrichedDescription = await TextEditor.enrichHTML(this.document.system.description, { async: true })
|
||||||
|
return context
|
||||||
|
}
|
||||||
|
}
|
@ -1,50 +1,57 @@
|
|||||||
export const CHARACTERISTICS = Object.freeze({
|
export const CHARACTERISTICS = Object.freeze({
|
||||||
rob: {
|
str: {
|
||||||
id: "rob",
|
id: "str",
|
||||||
label: "LETHALFANTASY.Character.rob.label",
|
label: "LETHALFANTASY.Character.str.label"
|
||||||
abbreviation: "LETHALFANTASY.Character.rob.short",
|
|
||||||
},
|
|
||||||
dex: {
|
|
||||||
id: "dex",
|
|
||||||
label: "LETHALFANTASY.Character.dex.label",
|
|
||||||
abbreviation: "LETHALFANTASY.Character.dex.short",
|
|
||||||
},
|
},
|
||||||
int: {
|
int: {
|
||||||
id: "int",
|
id: "int",
|
||||||
label: "LETHALFANTASY.Character.int.label",
|
label: "LETHALFANTASY.Character.int.label"
|
||||||
abbreviation: "LETHALFANTASY.Character.int.short",
|
|
||||||
},
|
},
|
||||||
per: {
|
wis: {
|
||||||
id: "per",
|
id: "wis",
|
||||||
label: "LETHALFANTASY.Character.per.label",
|
label: "LETHALFANTASY.Character.wis.label"
|
||||||
abbreviation: "LETHALFANTASY.Character.per.short",
|
|
||||||
},
|
},
|
||||||
vol: {
|
dex: {
|
||||||
id: "vol",
|
id: "dex",
|
||||||
label: "LETHALFANTASY.Character.vol.label",
|
label: "LETHALFANTASY.Character.dex.label"
|
||||||
abbreviation: "LETHALFANTASY.Character.vol.short",
|
},
|
||||||
|
con: {
|
||||||
|
id: "con",
|
||||||
|
label: "LETHALFANTASY.Character.con.label"
|
||||||
|
},
|
||||||
|
cha: {
|
||||||
|
id: "cha",
|
||||||
|
label: "LETHALFANTASY.Character.cha.label"
|
||||||
|
},
|
||||||
|
app: {
|
||||||
|
id: "app",
|
||||||
|
label: "LETHALFANTASY.Character.app.label"
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export const RESOURCES = Object.freeze({
|
export const SAVES = Object.freeze({
|
||||||
san: {
|
str: {
|
||||||
id: "san",
|
id: "str",
|
||||||
label: "LETHALFANTASY.Character.san.label",
|
label: "LETHALFANTASY.Character.str.label"
|
||||||
},
|
},
|
||||||
oeil: {
|
agility: {
|
||||||
id: "oeil",
|
id: "agility",
|
||||||
label: "LETHALFANTASY.Character.oeil.label",
|
label: "LETHALFANTASY.Character.agility.label"
|
||||||
},
|
},
|
||||||
verbe: {
|
dying: {
|
||||||
id: "verbe",
|
id: "dying",
|
||||||
label: "LETHALFANTASY.Character.verbe.label",
|
label: "LETHALFANTASY.Character.dying.label"
|
||||||
},
|
},
|
||||||
bourse: {
|
will: {
|
||||||
id: "bourse",
|
id: "will",
|
||||||
label: "LETHALFANTASY.Character.bourse.label",
|
label: "LETHALFANTASY.Character.will.label"
|
||||||
},
|
},
|
||||||
magie: {
|
dodge: {
|
||||||
id: "magie",
|
id: "dodge",
|
||||||
label: "LETHALFANTASY.Character.magie.label",
|
label: "LETHALFANTASY.Character.dodge.label"
|
||||||
},
|
},
|
||||||
|
toughness: {
|
||||||
|
id: "toughness",
|
||||||
|
label: "LETHALFANTASY.Character.toughness.label"
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
22
module/config/skill.mjs
Normal file
22
module/config/skill.mjs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
export const CATEGORY = Object.freeze({
|
||||||
|
layperson: {
|
||||||
|
id: "layperson",
|
||||||
|
label: "LETHALFANTASY.Skill.Category.layperson",
|
||||||
|
},
|
||||||
|
professional: {
|
||||||
|
id: "professional",
|
||||||
|
label: "LETHALFANTASY.Skill.Category.professional",
|
||||||
|
},
|
||||||
|
weapon: {
|
||||||
|
id: "weapon",
|
||||||
|
label: "LETHALFANTASY.Skill.Category.weapon",
|
||||||
|
},
|
||||||
|
armor: {
|
||||||
|
id: "armor",
|
||||||
|
label: "LETHALFANTASY.Skill.Category.armor",
|
||||||
|
},
|
||||||
|
resist: {
|
||||||
|
id: "resist",
|
||||||
|
label: "LETHALFANTASY.Skill.Category.resist",
|
||||||
|
}
|
||||||
|
})
|
@ -2,19 +2,11 @@ import * as CHARACTER from "./character.mjs"
|
|||||||
import * as WEAPON from "./weapon.mjs"
|
import * as WEAPON from "./weapon.mjs"
|
||||||
import * as ARMOR from "./armor.mjs"
|
import * as ARMOR from "./armor.mjs"
|
||||||
import * as SPELL from "./spell.mjs"
|
import * as SPELL from "./spell.mjs"
|
||||||
|
import * as SKILL from "./skill.mjs"
|
||||||
|
|
||||||
export const SYSTEM_ID = "tenebris"
|
export const SYSTEM_ID = "fvtt-lethal-fantasy"
|
||||||
export const DEV_MODE = false
|
export const DEV_MODE = false
|
||||||
|
|
||||||
export const RESOURCE_VALUE = Object.freeze({
|
|
||||||
ZERO: "0",
|
|
||||||
D4: "d4",
|
|
||||||
D6: "d6",
|
|
||||||
D8: "d8",
|
|
||||||
D10: "d10",
|
|
||||||
D12: "d12",
|
|
||||||
})
|
|
||||||
|
|
||||||
export const DICE_VALUE = Object.freeze({
|
export const DICE_VALUE = Object.freeze({
|
||||||
D4: "d4",
|
D4: "d4",
|
||||||
D6: "d6",
|
D6: "d6",
|
||||||
@ -32,55 +24,50 @@ export const ROLL_TYPE = Object.freeze({
|
|||||||
ATTACK: "attack",
|
ATTACK: "attack",
|
||||||
})
|
})
|
||||||
|
|
||||||
export const MINOR_PATH = Object.freeze({
|
export const MONEY = {
|
||||||
epee: {
|
tinbit: {
|
||||||
onze: "rob",
|
id: "tinbit",
|
||||||
neuf: {
|
abbrev: "tb",
|
||||||
main: "per",
|
label: "LETHALFANTASY.Money.Tinbits",
|
||||||
plume: "vol",
|
valuetb: 1
|
||||||
livre: "int",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
main: {
|
copper: {
|
||||||
onze: "dex",
|
id: "copper",
|
||||||
neuf: {
|
abbrev: "cp",
|
||||||
chene: "rob",
|
label: "LETHALFANTASY.Money.Coppers",
|
||||||
plume: "vol",
|
valuetb: 10
|
||||||
livre: "int",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
plume: {
|
silver: {
|
||||||
onze: "int",
|
id: "silver",
|
||||||
neuf: {
|
abbrev: "sp",
|
||||||
chene: "rob",
|
label: "LETHALFANTASY.Money.Silvers",
|
||||||
main: "per",
|
valuetb: 100
|
||||||
epee: "dex",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
chene: {
|
gold: {
|
||||||
onze: "per",
|
id: "gold",
|
||||||
neuf: {
|
abbrev: "gp",
|
||||||
plume: "vol",
|
label: "LETHALFANTASY.Money.Golds",
|
||||||
livre: "int",
|
valuetb: 1000
|
||||||
epee: "dex",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
livre: {
|
platinum: {
|
||||||
onze: "vol",
|
id: "platinum",
|
||||||
neuf: {
|
abbrev: "pp",
|
||||||
chene: "rob",
|
label: "LETHALFANTASY.Money.Platinums",
|
||||||
main: "per",
|
valuetb: 10000
|
||||||
epee: "dex",
|
}
|
||||||
},
|
}
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export const ASCII = `
|
export const ASCII = `
|
||||||
██████ ████████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████████ ███████ ███ ██ ███████ ██████ ██████ ██ ███████
|
······················································································································
|
||||||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██
|
: :
|
||||||
██ ██ ███████ ██ ██ ██ ███████ ██ ██ ██ █████ ██ ██ ██ █████ ██████ ██████ ██ ███████
|
:@@@ @@@@@@@@ @@@@@@@ @@@ @@@ @@@@@@ @@@ @@@@@@@@ @@@@@@ @@@ @@@ @@@@@@@ @@@@@@ @@@@@@ @@@ @@@ :
|
||||||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
:@@! @@! @!! @@! @@@ @@! @@@ @@! @@! @@! @@@ @@!@!@@@ @!! @@! @@@ !@@ @@! !@@ :
|
||||||
██████ ██ ██ ██ ██████ ███████ ██ ██ ██████ ██ ███████ ██ ████ ███████ ██████ ██ ██ ██ ███████ `
|
:@!! @!!!:! @!! @!@!@!@! @!@!@!@! @!! @!!!:! @!@!@!@! @!@@!!@! @!! @!@!@!@! !@@!! !@!@! :
|
||||||
|
:!!: !!: !!: !!: !!! !!: !!! !!: !!: !!: !!! !!: !!! !!: !!: !!! !:! !!: :
|
||||||
|
:: ::.: : : :: :: : : : : : : : : ::.: : : : : : :: : : : : : ::.: : .: :
|
||||||
|
: :
|
||||||
|
······················································································································
|
||||||
|
`
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include all constant definitions within the SYSTEM global export
|
* Include all constant definitions within the SYSTEM global export
|
||||||
@ -90,13 +77,14 @@ export const SYSTEM = {
|
|||||||
id: SYSTEM_ID,
|
id: SYSTEM_ID,
|
||||||
CHARACTERISTICS: CHARACTER.CHARACTERISTICS,
|
CHARACTERISTICS: CHARACTER.CHARACTERISTICS,
|
||||||
RESOURCES: CHARACTER.RESOURCES,
|
RESOURCES: CHARACTER.RESOURCES,
|
||||||
RESOURCE_VALUE,
|
SAVES: CHARACTER.SAVES,
|
||||||
|
SKILL_CATEGORY: SKILL.CATEGORY,
|
||||||
WEAPON_CATEGORY: WEAPON.CATEGORY,
|
WEAPON_CATEGORY: WEAPON.CATEGORY,
|
||||||
WEAPON_DAMAGE: WEAPON.DAMAGE,
|
WEAPON_DAMAGE: WEAPON.DAMAGE,
|
||||||
ARMOR_CATEGORY: ARMOR.CATEGORY,
|
ARMOR_CATEGORY: ARMOR.CATEGORY,
|
||||||
SPELL_RANGE: SPELL.RANGE,
|
SPELL_RANGE: SPELL.RANGE,
|
||||||
|
MONEY,
|
||||||
ASCII,
|
ASCII,
|
||||||
MINOR_PATH,
|
|
||||||
ROLL_TYPE,
|
ROLL_TYPE,
|
||||||
DEV_MODE,
|
DEV_MODE,
|
||||||
}
|
}
|
||||||
|
@ -15,199 +15,6 @@ export default class LethalFantasyActor extends Actor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a path to the character.
|
|
||||||
* First path added is the major path, second path added is the minor path.
|
|
||||||
* Create all talents of the path and add them to the character.
|
|
||||||
* Add the path to the character.
|
|
||||||
*
|
|
||||||
* @param {Object} item The item to add as a path.
|
|
||||||
* @returns {Promise<void>} - A promise that resolves when the path is added.
|
|
||||||
*/
|
|
||||||
async addPath(item) {
|
|
||||||
if (this.type !== "character") return
|
|
||||||
let itemData = item.toObject()
|
|
||||||
if (this.system.hasVoieMajeure && this.system.hasVoieMineure) {
|
|
||||||
ui.notifications.warn(game.i18n.localize("TENEBRIS.Warning.dejaDeuxVoies"))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Voie mineure
|
|
||||||
if (this.system.hasVoieMajeure) {
|
|
||||||
if (this.system.voies.majeure.nom === item.name) {
|
|
||||||
ui.notifications.warn(game.i18n.localize("TENEBRIS.Warning.dejaVoieMajeure"))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Voie de base
|
|
||||||
const isBasePath = itemData.system.key !== "" && this.system.voies.majeure.key !== ""
|
|
||||||
|
|
||||||
let dropNotification
|
|
||||||
let neufModifie
|
|
||||||
let onze
|
|
||||||
let neuf
|
|
||||||
if (isBasePath) {
|
|
||||||
onze = game.system.CONST.MINOR_PATH[itemData.system.key].onze
|
|
||||||
const labelOnze = game.i18n.localize(`TENEBRIS.Character.FIELDS.caracteristiques.${onze}.valeur.label`)
|
|
||||||
dropNotification = `La valeur de ${labelOnze} va être modifiée pour 11`
|
|
||||||
neuf = game.system.CONST.MINOR_PATH[itemData.system.key].neuf[this.system.voies.majeure.key]
|
|
||||||
if (neuf) {
|
|
||||||
neufModifie = true
|
|
||||||
const labelNeuf = game.i18n.localize(`TENEBRIS.Character.FIELDS.caracteristiques.${neuf}.valeur.label`)
|
|
||||||
dropNotification += `<br> La valeur de ${labelNeuf} va être modifiée pour 9`
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
dropNotification = "Vous devez modifier manuellement les caractéristiques selon la voie ajoutée"
|
|
||||||
}
|
|
||||||
|
|
||||||
dropNotification += `<br>Vous pouvez renoncer à des biens de la voie majeure pour ceux de la voie mineure`
|
|
||||||
dropNotification += `<br> Vous pouvez renoncer à des langues de la voie majeure pour celles de la voie mineure`
|
|
||||||
|
|
||||||
const proceed = await foundry.applications.api.DialogV2.confirm({
|
|
||||||
window: { title: game.i18n.localize("TENEBRIS.Dialog.ajoutVoieMineureTitre") },
|
|
||||||
content: dropNotification,
|
|
||||||
rejectClose: false,
|
|
||||||
modal: true,
|
|
||||||
})
|
|
||||||
if (!proceed) return
|
|
||||||
|
|
||||||
let voie
|
|
||||||
|
|
||||||
// Création de la voie
|
|
||||||
voie = await this.createEmbeddedDocuments("Item", [itemData], { renderSheet: false })
|
|
||||||
|
|
||||||
if (isBasePath) {
|
|
||||||
await this.update({
|
|
||||||
"system.voies.mineure.nom": item.name,
|
|
||||||
"system.voies.mineure.id": voie[0].id,
|
|
||||||
"system.voies.mineure.key": item.system.key,
|
|
||||||
[`system.caracteristiques.${onze}.valeur`]: 11,
|
|
||||||
"system.langues": `${this.system.langues} <br>${item.name} : ${item.system.langues}`,
|
|
||||||
"system.biens": `${this.system.biens} <br>${item.name} : ${item.system.biens}`,
|
|
||||||
})
|
|
||||||
if (neufModifie) {
|
|
||||||
await this.update({
|
|
||||||
[`system.caracteristiques.${neuf}.valeur`]: 9,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
await this.update({
|
|
||||||
"system.voies.mineure.nom": item.name,
|
|
||||||
"system.voies.mineure.id": voie[0].id,
|
|
||||||
"system.voies.mineure.key": item.system.key,
|
|
||||||
"system.langues": `${this.system.langues} <br>${item.name} : ${item.system.langues}`,
|
|
||||||
"system.biens": `${this.system.biens} <br>${item.name} : ${item.system.biens}`,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// Création des talents
|
|
||||||
let newTalents = []
|
|
||||||
for (const talent of itemData.system.talents) {
|
|
||||||
const talentItem = await fromUuid(talent)
|
|
||||||
if (talentItem) {
|
|
||||||
const newTalent = await this.createEmbeddedDocuments("Item", [talentItem.toObject()])
|
|
||||||
// Modification de la voie du talent
|
|
||||||
await newTalent[0].update({ "system.path": voie[0].uuid })
|
|
||||||
newTalents.push(newTalent[0].uuid)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Mise à jour de la voie avec les nouveaux talents
|
|
||||||
await voie[0].update({ "system.talents": newTalents })
|
|
||||||
|
|
||||||
return ui.notifications.info(game.i18n.localize("TENEBRIS.Warning.voieMineureAjoutee"))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Voie majeure
|
|
||||||
else {
|
|
||||||
const proceed = await foundry.applications.api.DialogV2.confirm({
|
|
||||||
window: { title: game.i18n.localize("TENEBRIS.Dialog.ajoutVoieMajeureTitre") },
|
|
||||||
content: game.i18n.localize("TENEBRIS.Dialog.ajoutVoieMajeure"),
|
|
||||||
rejectClose: false,
|
|
||||||
modal: true,
|
|
||||||
})
|
|
||||||
if (!proceed) return
|
|
||||||
|
|
||||||
// Création de la voie
|
|
||||||
const voie = await this.createEmbeddedDocuments("Item", [itemData], { renderSheet: false })
|
|
||||||
|
|
||||||
// Création des talents
|
|
||||||
let newTalents = []
|
|
||||||
for (const talent of itemData.system.talents) {
|
|
||||||
const talentItem = await fromUuid(talent)
|
|
||||||
if (talentItem) {
|
|
||||||
const newTalent = await this.createEmbeddedDocuments("Item", [talentItem.toObject()])
|
|
||||||
// Modification de la voie du talent
|
|
||||||
await newTalent[0].update({ "system.path": voie[0].uuid })
|
|
||||||
newTalents.push(newTalent[0].uuid)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Mise à jour de la voie avec les nouveaux talents
|
|
||||||
await voie[0].update({ "system.talents": newTalents })
|
|
||||||
|
|
||||||
await this.update({
|
|
||||||
"system.voies.majeure.id": voie[0].id,
|
|
||||||
"system.voies.majeure.nom": item.name,
|
|
||||||
"system.voies.majeure.key": item.system.key,
|
|
||||||
"system.caracteristiques.rob": item.system.caracteristiques.rob,
|
|
||||||
"system.caracteristiques.dex": item.system.caracteristiques.dex,
|
|
||||||
"system.caracteristiques.int": item.system.caracteristiques.int,
|
|
||||||
"system.caracteristiques.per": item.system.caracteristiques.per,
|
|
||||||
"system.caracteristiques.vol": item.system.caracteristiques.vol,
|
|
||||||
"system.ressources.san": item.system.ressources.san,
|
|
||||||
"system.ressources.oeil": item.system.ressources.oeil,
|
|
||||||
"system.ressources.verbe": item.system.ressources.verbe,
|
|
||||||
"system.ressources.bourse": item.system.ressources.bourse,
|
|
||||||
"system.ressources.magie": item.system.ressources.magie,
|
|
||||||
"system.dv": item.system.dv,
|
|
||||||
"system.dmax.valeur": item.system.dmax,
|
|
||||||
"system.langues": `${item.name} : ${item.system.langues}`,
|
|
||||||
"system.biens": `${item.name} : ${item.system.biens}`,
|
|
||||||
})
|
|
||||||
return ui.notifications.info(game.i18n.localize("TENEBRIS.Warning.voieMajeureAjoutee"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Deletes a specified path and its associated talents.
|
|
||||||
*
|
|
||||||
* @param {Object} path The path object to be deleted.
|
|
||||||
* @param {boolean} isMajor Indicates if the path is a major path, elswise it is a minor path.
|
|
||||||
* @returns {Promise<void>} A promise that resolves when the deletion is complete.
|
|
||||||
* @throws {Error} Throws an error if the type is not "character".
|
|
||||||
*/
|
|
||||||
async deletePath(path, isMajor) {
|
|
||||||
if (this.type !== "character") return
|
|
||||||
|
|
||||||
// Delete all talents linked to the path
|
|
||||||
let toDelete = path.system.talents.map((talent) => foundry.utils.parseUuid(talent).id)
|
|
||||||
toDelete.push(path.id)
|
|
||||||
await this.deleteEmbeddedDocuments("Item", toDelete)
|
|
||||||
|
|
||||||
// Voie majeure
|
|
||||||
if (isMajor) {
|
|
||||||
await this.update({ "system.voies.majeure.nom": "", "system.voies.majeure.id": null, "system.voies.majeure.key": "" })
|
|
||||||
ui.notifications.info(game.i18n.localize("TENEBRIS.Warning.voieMajeureSupprimee"))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Voie mineure
|
|
||||||
else {
|
|
||||||
await this.update({ "system.voies.mineure.nom": "", "system.voies.mineure.id": null, "system.voies.mineure.key": "" })
|
|
||||||
ui.notifications.info(game.i18n.localize("TENEBRIS.Warning.voieMineureSupprimee"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds an attack to the actor if the actor type is "opponent".
|
|
||||||
*
|
|
||||||
* @param {Object} attack The attack object to be added.
|
|
||||||
* @returns {Promise<void>} A promise that resolves when the attack has been added.
|
|
||||||
*/
|
|
||||||
async addAttack(attack) {
|
|
||||||
if (this.type !== "opponent") return
|
|
||||||
|
|
||||||
await this.createEmbeddedDocuments("Item", [attack])
|
|
||||||
}
|
|
||||||
|
|
||||||
async rollResource(resource) {
|
async rollResource(resource) {
|
||||||
if (this.type !== "character") return
|
if (this.type !== "character") return
|
||||||
await this.system.roll(ROLL_TYPE.RESOURCE, resource)
|
await this.system.roll(ROLL_TYPE.RESOURCE, resource)
|
||||||
|
@ -278,7 +278,7 @@ export default class LethalFantasyRoll extends Roll {
|
|||||||
const label = game.i18n.localize("TENEBRIS.Roll.roll")
|
const label = game.i18n.localize("TENEBRIS.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: ["tenebris"],
|
classes: ["lethalfantasy"],
|
||||||
content,
|
content,
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
export { default as LethalFantasyCharacter } from "./character.mjs"
|
export { default as LethalFantasyCharacter } from "./character.mjs"
|
||||||
export { default as LethalFantasyOpponent } from "./opponent.mjs"
|
export { default as LethalFantasyOpponent } from "./opponent.mjs"
|
||||||
export { default as LethalFantasyPath } from "./path.mjs"
|
|
||||||
export { default as LethalFantasyTalent } from "./talent.mjs"
|
|
||||||
export { default as LethalFantasyArmor } from "./armor.mjs"
|
|
||||||
export { default as LethalFantasyWeapon } from "./weapon.mjs"
|
export { default as LethalFantasyWeapon } from "./weapon.mjs"
|
||||||
export { default as LethalFantasySpell } from "./spell.mjs"
|
export { default as LethalFantasySpell } from "./spell.mjs"
|
||||||
export { default as LethalFantasyAttack } from "./attack.mjs"
|
export { default as LethalFantasySkill } from "./skill.mjs"
|
||||||
|
export { default as LethalFantasyArmor } from "./armor.mjs"
|
||||||
|
export { default as LethalFantasyGift } from "./gift.mjs"
|
||||||
|
export { default as LethalFantasyVulnerability } from "./vulnerability.mjs"
|
||||||
|
export { default as LethalFantasySave } from "./save.mjs"
|
||||||
|
@ -1,34 +1,25 @@
|
|||||||
import { SYSTEM } from "../config/system.mjs"
|
import { SYSTEM } from "../config/system.mjs"
|
||||||
import { CATEGORY } from "../config/armor.mjs"
|
|
||||||
|
|
||||||
export default class LethalFantasyArmor extends foundry.abstract.TypeDataModel {
|
export default class LethalFantasyArmor extends foundry.abstract.TypeDataModel {
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
const fields = foundry.data.fields
|
const fields = foundry.data.fields
|
||||||
const requiredInteger = { required: true, nullable: false, integer: true }
|
|
||||||
const schema = {}
|
const schema = {}
|
||||||
|
|
||||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||||
|
schema.category = new fields.StringField({ required: true, initial: "melee", choices: SYSTEM.ARMOR_CATEGORY })
|
||||||
schema.categorie = new fields.StringField({ required: true, initial: "sommaire", choices: SYSTEM.ARMOR_CATEGORY })
|
schema.protection = new fields.StringField({
|
||||||
|
required: true,
|
||||||
schema.valeur = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
initial: ""
|
||||||
|
})
|
||||||
schema.malus = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||||
|
schema.money = new fields.StringField({ required: true, initial: "tinbit", choices: SYSTEM.MONEY })
|
||||||
|
|
||||||
return schema
|
return schema
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static LOCALIZATION_PREFIXES = ["TENEBRIS.Armor"]
|
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Armor"]
|
||||||
|
|
||||||
get armorCategory() {
|
get weaponCategory() {
|
||||||
return game.i18n.localize(CATEGORY[this.categorie].label)
|
return game.i18n.localize(CATEGORY[this.category].label)
|
||||||
}
|
|
||||||
|
|
||||||
get details() {
|
|
||||||
return game.i18n.format("TENEBRIS.Armor.details", {
|
|
||||||
valeur: this.valeur,
|
|
||||||
malus: this.malus,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
export default class LethalFantasy extends foundry.abstract.TypeDataModel {
|
|
||||||
static defineSchema() {
|
|
||||||
const fields = foundry.data.fields
|
|
||||||
const schema = {}
|
|
||||||
|
|
||||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
|
||||||
schema.degats = new fields.StringField({ required: false, nullable: true, blank: true })
|
|
||||||
|
|
||||||
return schema
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @override */
|
|
||||||
static LOCALIZATION_PREFIXES = ["TENEBRIS.Attack"]
|
|
||||||
|
|
||||||
get toolTip() {
|
|
||||||
return this.description || ""
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,108 +9,83 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
const schema = {}
|
const schema = {}
|
||||||
|
|
||||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||||
schema.langues = new fields.HTMLField({ required: true, textSearch: true })
|
|
||||||
schema.notes = new fields.HTMLField({ required: true, textSearch: true })
|
schema.notes = new fields.HTMLField({ required: true, textSearch: true })
|
||||||
schema.biens = new fields.HTMLField({ required: true, textSearch: true })
|
|
||||||
|
|
||||||
// Caractéristiques
|
// Carac
|
||||||
const characteristicField = (label) => {
|
const characteristicField = (label) => {
|
||||||
const schema = {
|
const schema = {
|
||||||
valeur: new fields.NumberField({ ...requiredInteger, initial: 10, min: 0 }),
|
value: new fields.NumberField({ ...requiredInteger, initial: 3, min: 0 }),
|
||||||
progression: new fields.SchemaField({
|
percent: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 100 }),
|
||||||
experience: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
attackMod: new fields.NumberField({ ...requiredInteger, initial: 0 }),
|
||||||
progres: new fields.BooleanField(),
|
defenseMod: new fields.NumberField({ ...requiredInteger, initial: 0 })
|
||||||
}),
|
|
||||||
}
|
}
|
||||||
return new fields.SchemaField(schema, { label })
|
return new fields.SchemaField(schema, { label })
|
||||||
}
|
}
|
||||||
|
|
||||||
schema.caracteristiques = new fields.SchemaField(
|
schema.characteristics = new fields.SchemaField(
|
||||||
Object.values(SYSTEM.CHARACTERISTICS).reduce((obj, characteristic) => {
|
Object.values(SYSTEM.CHARACTERISTICS).reduce((obj, characteristic) => {
|
||||||
obj[characteristic.id] = characteristicField(characteristic.label)
|
obj[characteristic.id] = characteristicField(characteristic.label)
|
||||||
return obj
|
return obj
|
||||||
}, {}),
|
}, {}),
|
||||||
)
|
)
|
||||||
|
|
||||||
// Ressources
|
// Carac
|
||||||
const resourceField = (label) => {
|
const saveField = (label) => {
|
||||||
const schema = {
|
const schema = {
|
||||||
valeur: new fields.StringField({
|
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||||
required: true,
|
|
||||||
nullable: false,
|
|
||||||
initial: SYSTEM.RESOURCE_VALUE.ZERO,
|
|
||||||
choices: Object.fromEntries(Object.entries(SYSTEM.RESOURCE_VALUE).map(([key, value]) => [value, { label: `${value}` }])),
|
|
||||||
blank: true,
|
|
||||||
}),
|
|
||||||
max: new fields.StringField({
|
|
||||||
required: true,
|
|
||||||
nullable: false,
|
|
||||||
initial: SYSTEM.RESOURCE_VALUE.ZERO,
|
|
||||||
choices: Object.fromEntries(Object.entries(SYSTEM.RESOURCE_VALUE).map(([key, value]) => [value, { label: `${value}` }])),
|
|
||||||
blank: true,
|
|
||||||
}),
|
|
||||||
experience: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
|
||||||
}
|
}
|
||||||
return new fields.SchemaField(schema, { label })
|
return new fields.SchemaField(schema, { label })
|
||||||
}
|
}
|
||||||
|
schema.saves = new fields.SchemaField(
|
||||||
schema.ressources = new fields.SchemaField(
|
Object.values(SYSTEM.SAVES).reduce((obj, save) => {
|
||||||
Object.values(SYSTEM.RESOURCES).reduce((obj, resource) => {
|
obj[save.id] = saveField(save.label)
|
||||||
obj[resource.id] = resourceField(resource.label)
|
|
||||||
return obj
|
return obj
|
||||||
}, {}),
|
}, {}),
|
||||||
)
|
)
|
||||||
|
schema.hp = new fields.SchemaField({
|
||||||
schema.commanditaire = new fields.StringField({})
|
|
||||||
|
|
||||||
schema.dv = new fields.StringField({
|
|
||||||
required: true,
|
|
||||||
nullable: false,
|
|
||||||
initial: SYSTEM.RESOURCE_VALUE.ZERO,
|
|
||||||
choices: Object.fromEntries(Object.entries(SYSTEM.RESOURCE_VALUE).map(([key, value]) => [value, { label: `${value}` }])),
|
|
||||||
})
|
|
||||||
|
|
||||||
schema.pv = new fields.SchemaField({
|
|
||||||
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
max: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
max: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
})
|
})
|
||||||
|
|
||||||
schema.dmax = new fields.SchemaField({
|
schema.perception = new fields.SchemaField({
|
||||||
valeur: new fields.StringField({
|
value: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
required: true,
|
bonus: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||||
nullable: false,
|
|
||||||
initial: SYSTEM.RESOURCE_VALUE.ZERO,
|
|
||||||
choices: Object.fromEntries(Object.entries(SYSTEM.RESOURCE_VALUE).map(([key, value]) => [value, { label: `${value}` }])),
|
|
||||||
}),
|
|
||||||
experience: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
|
||||||
})
|
})
|
||||||
|
schema.grit = new fields.SchemaField({
|
||||||
schema.voies = new fields.SchemaField({
|
earned: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
majeure: new fields.SchemaField({
|
current: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||||
id: new fields.DocumentIdField(),
|
})
|
||||||
key: new fields.StringField({ required: true }),
|
schema.luck = new fields.SchemaField({
|
||||||
nom: new fields.StringField({ required: true }),
|
earned: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
}),
|
current: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||||
mineure: new fields.SchemaField({
|
})
|
||||||
id: new fields.DocumentIdField(),
|
schema.movement = new fields.SchemaField({
|
||||||
key: new fields.StringField({ required: true }),
|
walk: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
nom: new fields.StringField({ required: true }),
|
jog: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
}),
|
sprint: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
|
run: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
|
armorAdjust: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
|
})
|
||||||
|
schema.biodata = new fields.SchemaField({
|
||||||
|
class: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||||
|
level: new fields.NumberField({ ...requiredInteger, initial: 1, min: 1 }),
|
||||||
|
mortal: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||||
|
alignment: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||||
|
age: new fields.NumberField({ ...requiredInteger, initial: 15, min: 6 }),
|
||||||
|
height: new fields.NumberField({ ...requiredInteger, initial: 170, min: 50 }),
|
||||||
|
eyes: new fields.StringField({ required: true, nullable: false, initial: "" }),
|
||||||
|
hair: new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||||
|
})
|
||||||
|
schema.developmentPoints = new fields.SchemaField({
|
||||||
|
total: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||||
|
remaining: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
||||||
})
|
})
|
||||||
|
|
||||||
return schema
|
return schema
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static LOCALIZATION_PREFIXES = ["TENEBRIS.Character"]
|
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Character"]
|
||||||
|
|
||||||
get hasVoieMajeure() {
|
|
||||||
return !!this.voies.majeure.id
|
|
||||||
}
|
|
||||||
|
|
||||||
get hasVoieMineure() {
|
|
||||||
return !!this.voies.mineure.id
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rolls a dice for a character.
|
* Rolls a dice for a character.
|
||||||
@ -127,9 +102,6 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
rollValue = this.caracteristiques[rollTarget].valeur
|
rollValue = this.caracteristiques[rollTarget].valeur
|
||||||
opponentTarget = game.user.targets.first()
|
opponentTarget = game.user.targets.first()
|
||||||
break
|
break
|
||||||
case ROLL_TYPE.RESOURCE:
|
|
||||||
rollValue = this.ressources[rollTarget].valeur
|
|
||||||
break
|
|
||||||
case ROLL_TYPE.DAMAGE:
|
case ROLL_TYPE.DAMAGE:
|
||||||
rollValue = this.parent.items.get(rollTarget).system.degats
|
rollValue = this.parent.items.get(rollTarget).system.degats
|
||||||
opponentTarget = game.user.targets.first()
|
opponentTarget = game.user.targets.first()
|
||||||
@ -165,12 +137,6 @@ export default class LethalFantasyCharacter extends foundry.abstract.TypeDataMod
|
|||||||
})
|
})
|
||||||
if (!roll) return null
|
if (!roll) return null
|
||||||
|
|
||||||
// Perte de ressouces
|
|
||||||
if (rollType === ROLL_TYPE.RESOURCE && roll.resultType === "failure") {
|
|
||||||
const value = this.ressources[rollTarget].valeur
|
|
||||||
const newValue = LethalFantasyUtils.findLowerDice(value)
|
|
||||||
await this.parent.update({ [`system.ressources.${rollTarget}.valeur`]: newValue })
|
|
||||||
}
|
|
||||||
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
await roll.toMessage({}, { rollMode: roll.options.rollMode })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
27
module/models/equipment.mjs
Normal file
27
module/models/equipment.mjs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { SYSTEM } from "../config/system.mjs"
|
||||||
|
import { CATEGORY } from "../config/weapon.mjs"
|
||||||
|
export default class LethalFantasyEquipment extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields
|
||||||
|
const schema = {}
|
||||||
|
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||||
|
|
||||||
|
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||||
|
schema.category = new fields.StringField({ required: true, initial: "melee", choices: SYSTEM.WEAPON_CATEGORY })
|
||||||
|
schema.damages = new fields.StringField({
|
||||||
|
required: true,
|
||||||
|
initial: ""
|
||||||
|
})
|
||||||
|
schema.cost = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||||
|
schema.money = new fields.StringField({ required: true, initial: "tinbit", choices: SYSTEM.MONEY })
|
||||||
|
|
||||||
|
return schema
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Equipment"]
|
||||||
|
|
||||||
|
get weaponCategory() {
|
||||||
|
return game.i18n.localize(CATEGORY[this.category].label)
|
||||||
|
}
|
||||||
|
}
|
16
module/models/gift.mjs
Normal file
16
module/models/gift.mjs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
export default class LethalFantasyGift extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields
|
||||||
|
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||||
|
const schema = {}
|
||||||
|
|
||||||
|
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||||
|
schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
|
||||||
|
|
||||||
|
return schema
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Gift"]
|
||||||
|
|
||||||
|
}
|
@ -22,7 +22,7 @@ export default class LethalFantasyOpponent extends foundry.abstract.TypeDataMode
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static LOCALIZATION_PREFIXES = ["TENEBRIS.Opponent"]
|
static LOCALIZATION_PREFIXES = ["LETHALFANTSY.Opponent"]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rolls a dice attack for an opponent.
|
* Rolls a dice attack for an opponent.
|
||||||
|
@ -1,83 +0,0 @@
|
|||||||
import { SYSTEM } from "../config/system.mjs"
|
|
||||||
export default class LethalFantasyPath extends foundry.abstract.TypeDataModel {
|
|
||||||
static defineSchema() {
|
|
||||||
const fields = foundry.data.fields
|
|
||||||
const schema = {}
|
|
||||||
|
|
||||||
schema.key = new fields.StringField({ required: true, nullable: false, initial: "" })
|
|
||||||
|
|
||||||
// Caractéristiques
|
|
||||||
const characteristicField = (label) => {
|
|
||||||
const schema = {
|
|
||||||
valeur: new fields.NumberField({
|
|
||||||
required: true,
|
|
||||||
nullable: false,
|
|
||||||
integer: true,
|
|
||||||
initial: 10,
|
|
||||||
min: 0,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
return new fields.SchemaField(schema, { label })
|
|
||||||
}
|
|
||||||
|
|
||||||
schema.caracteristiques = new fields.SchemaField(
|
|
||||||
Object.values(SYSTEM.CHARACTERISTICS).reduce((obj, characteristic) => {
|
|
||||||
obj[characteristic.id] = characteristicField(characteristic.label)
|
|
||||||
return obj
|
|
||||||
}, {}),
|
|
||||||
)
|
|
||||||
|
|
||||||
// Ressources
|
|
||||||
const resourceField = (label) => {
|
|
||||||
const schema = {
|
|
||||||
valeur: new fields.StringField({
|
|
||||||
required: true,
|
|
||||||
initial: SYSTEM.RESOURCE_VALUE.ZERO,
|
|
||||||
choices: Object.fromEntries(Object.entries(SYSTEM.RESOURCE_VALUE).map(([key, value]) => [value, { label: `${value}` }])),
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
return new fields.SchemaField(schema, { label })
|
|
||||||
}
|
|
||||||
|
|
||||||
schema.ressources = new fields.SchemaField(
|
|
||||||
Object.values(SYSTEM.RESOURCES).reduce((obj, resource) => {
|
|
||||||
obj[resource.id] = resourceField(resource.label)
|
|
||||||
return obj
|
|
||||||
}, {}),
|
|
||||||
)
|
|
||||||
|
|
||||||
schema.dv = new fields.StringField({
|
|
||||||
required: true,
|
|
||||||
initial: SYSTEM.RESOURCE_VALUE.ZERO,
|
|
||||||
choices: Object.fromEntries(Object.entries(SYSTEM.RESOURCE_VALUE).map(([key, value]) => [value, { label: `${value}` }])),
|
|
||||||
})
|
|
||||||
|
|
||||||
schema.dmax = new fields.StringField({
|
|
||||||
required: true,
|
|
||||||
initial: SYSTEM.RESOURCE_VALUE.ZERO,
|
|
||||||
choices: Object.fromEntries(Object.entries(SYSTEM.RESOURCE_VALUE).map(([key, value]) => [value, { label: `${value}` }])),
|
|
||||||
})
|
|
||||||
|
|
||||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
|
||||||
|
|
||||||
schema.biens = new fields.HTMLField({ required: true, textSearch: true })
|
|
||||||
|
|
||||||
schema.langues = new fields.HTMLField({ required: true, textSearch: true })
|
|
||||||
|
|
||||||
schema.talents = new fields.ArrayField(new fields.DocumentUUIDField())
|
|
||||||
|
|
||||||
return schema
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @override */
|
|
||||||
static LOCALIZATION_PREFIXES = ["TENEBRIS.Path"]
|
|
||||||
|
|
||||||
async getAllTalents() {
|
|
||||||
const talents = []
|
|
||||||
this.talents.forEach(async (element) => {
|
|
||||||
const talent = await fromUuid(element)
|
|
||||||
if (talent) talents.push(talent)
|
|
||||||
})
|
|
||||||
return talents
|
|
||||||
}
|
|
||||||
}
|
|
17
module/models/save.mjs
Normal file
17
module/models/save.mjs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
export default class LethalFantasySave extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields
|
||||||
|
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||||
|
const schema = {}
|
||||||
|
|
||||||
|
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||||
|
schema.cost = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||||
|
schema.value = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||||
|
|
||||||
|
return schema
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Save"]
|
||||||
|
|
||||||
|
}
|
24
module/models/skill.mjs
Normal file
24
module/models/skill.mjs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { SYSTEM } from "../config/system.mjs"
|
||||||
|
import { CATEGORY } from "../config/skill.mjs"
|
||||||
|
export default class LethalFantasySkill extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields
|
||||||
|
const schema = {}
|
||||||
|
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||||
|
|
||||||
|
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||||
|
schema.category = new fields.StringField({ required: true, initial: "layperson", choices: SYSTEM.SKILL_CATEGORY })
|
||||||
|
schema.base = new fields.StringField({ required: true, initial: "WIS" })
|
||||||
|
schema.bonus = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||||
|
schema.cost = new fields.NumberField({ ...requiredInteger,required: true, initial: 0, min: 0 })
|
||||||
|
|
||||||
|
return schema
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Skill"]
|
||||||
|
|
||||||
|
get skillCategory() {
|
||||||
|
return game.i18n.localize(CATEGORY[this.category].label)
|
||||||
|
}
|
||||||
|
}
|
@ -11,17 +11,16 @@ export default class LethalFantasySpell extends foundry.abstract.TypeDataModel {
|
|||||||
initial: "",
|
initial: "",
|
||||||
textSearch: true,
|
textSearch: true,
|
||||||
})
|
})
|
||||||
|
schema.level = new fields.NumberField({
|
||||||
schema.preparation = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
...requiredInteger,
|
||||||
schema.cible = new fields.StringField({ required: true })
|
initial: 1,
|
||||||
schema.portee = new fields.StringField({ required: true, initial: "contact", choices: SYSTEM.SPELL_RANGE })
|
min: 1,
|
||||||
schema.duree = new fields.StringField({ required: true })
|
max: 20,
|
||||||
schema.consequenceA = new fields.StringField({ required: true })
|
})
|
||||||
schema.consequenceB = new fields.StringField({ required: true })
|
|
||||||
|
|
||||||
return schema
|
return schema
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static LOCALIZATION_PREFIXES = ["TENEBRIS.Spell"]
|
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Spell"]
|
||||||
}
|
}
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
export default class LethalFantasyTalent extends foundry.abstract.TypeDataModel {
|
|
||||||
static defineSchema() {
|
|
||||||
const fields = foundry.data.fields
|
|
||||||
const requiredInteger = { required: true, nullable: false, integer: true }
|
|
||||||
const schema = {}
|
|
||||||
|
|
||||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
|
||||||
|
|
||||||
schema.appris = new fields.BooleanField()
|
|
||||||
schema.progression = new fields.BooleanField()
|
|
||||||
schema.niveau = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 3 })
|
|
||||||
schema.path = new fields.DocumentUUIDField()
|
|
||||||
|
|
||||||
return schema
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @override */
|
|
||||||
static LOCALIZATION_PREFIXES = ["TENEBRIS.Talent"]
|
|
||||||
|
|
||||||
get canProgress() {
|
|
||||||
return this.progression
|
|
||||||
}
|
|
||||||
|
|
||||||
get isLearned() {
|
|
||||||
return this.appris
|
|
||||||
}
|
|
||||||
|
|
||||||
get improvedDescription() {
|
|
||||||
return this.description.replace(/#niveau\b/g, this.niveau)
|
|
||||||
}
|
|
||||||
|
|
||||||
get details() {
|
|
||||||
if (this.progression)
|
|
||||||
return game.i18n.format("TENEBRIS.Talent.details", {
|
|
||||||
niveau: this.niveau,
|
|
||||||
})
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
async getPathName() {
|
|
||||||
const path = await fromUuid(this.path)
|
|
||||||
return path ? path.name : ""
|
|
||||||
}
|
|
||||||
}
|
|
16
module/models/vulnerability.mjs
Normal file
16
module/models/vulnerability.mjs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
export default class LethalFantasyVulnerability extends foundry.abstract.TypeDataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields
|
||||||
|
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||||
|
const schema = {}
|
||||||
|
|
||||||
|
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||||
|
schema.cost = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||||
|
|
||||||
|
return schema
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Vulnerability"]
|
||||||
|
|
||||||
|
}
|
@ -1,24 +1,27 @@
|
|||||||
import { SYSTEM } from "../config/system.mjs"
|
import { SYSTEM } from "../config/system.mjs"
|
||||||
import { CATEGORY } from "../config/weapon.mjs"
|
import { CATEGORY } from "../config/weapon.mjs"
|
||||||
export default class LethalFantasyWeapon extends foundry.abstract.TypeDataModel {
|
export default class LethalFantasySkill extends foundry.abstract.TypeDataModel {
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
const fields = foundry.data.fields
|
const fields = foundry.data.fields
|
||||||
const schema = {}
|
const schema = {}
|
||||||
|
const requiredInteger = { required: true, nullable: false, integer: true }
|
||||||
|
|
||||||
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
||||||
schema.categorie = new fields.StringField({ required: true, initial: "mains", choices: SYSTEM.WEAPON_CATEGORY })
|
schema.category = new fields.StringField({ required: true, initial: "melee", choices: SYSTEM.WEAPON_CATEGORY })
|
||||||
schema.degats = new fields.StringField({
|
schema.damages = new fields.StringField({
|
||||||
required: true,
|
required: true,
|
||||||
initial: SYSTEM.WEAPON_DAMAGE.UN,
|
initial: ""
|
||||||
choices: Object.fromEntries(Object.entries(SYSTEM.WEAPON_DAMAGE).map(([key, value]) => [value, { label: `${value}` }])),
|
|
||||||
})
|
})
|
||||||
|
schema.cost = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
|
||||||
|
schema.money = new fields.StringField({ required: true, initial: "tinbit", choices: SYSTEM.MONEY })
|
||||||
|
|
||||||
return schema
|
return schema
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
static LOCALIZATION_PREFIXES = ["TENEBRIS.Weapon"]
|
static LOCALIZATION_PREFIXES = ["LETHALFANTASY.Weapon"]
|
||||||
|
|
||||||
get weaponCategory() {
|
get weaponCategory() {
|
||||||
return game.i18n.localize(CATEGORY[this.categorie].label)
|
return game.i18n.localize(CATEGORY[this.category].label)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import LethalFantasyFortune from "./applications/fortune.mjs"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles socket events based on the provided action.
|
* Handles socket events based on the provided action.
|
||||||
|
5961
package-lock.json
generated
Normal file
5961
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,7 @@
|
|||||||
"prettier": "^3.3.3"
|
"prettier": "^3.3.3"
|
||||||
},
|
},
|
||||||
"author": "LeRatierBretonnien",
|
"author": "LeRatierBretonnien",
|
||||||
"license": "UNLICENSED",
|
"license": "MITs",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"gulp": "^5.0.0",
|
"gulp": "^5.0.0",
|
||||||
"gulp-less": "^5.0.0"
|
"gulp-less": "^5.0.0"
|
||||||
@ -23,5 +23,11 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"pushLDBtoYML": "node ./tools/pushLDBtoYML.mjs",
|
"pushLDBtoYML": "node ./tools/pushLDBtoYML.mjs",
|
||||||
"pullYMLtoLDB": "node ./tools/pullYMLtoLDB.mjs"
|
"pullYMLtoLDB": "node ./tools/pullYMLtoLDB.mjs"
|
||||||
|
},
|
||||||
|
"description": "<h2><em>Lethal Fantasy RPG</em> for Foundry Virtual TableTop</h2>",
|
||||||
|
"main": "gulpfile.js",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://www.uberwald.me/gitea/uberwald/fvtt-lethal-fantasy.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
#tenebris-application-fortune {
|
|
||||||
font-family: var(--font-primary);
|
|
||||||
font-size: calc(var(--font-size-standard) * 1.2);
|
|
||||||
color: var(--color-light-1);
|
|
||||||
|
|
||||||
menu {
|
|
||||||
.rollable:hover,
|
|
||||||
.rollable:focus {
|
|
||||||
text-shadow: 0 0 8px var(--color-shadow-primary);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
section {
|
|
||||||
background-image: url("../assets/background-small.webp");
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 100% 100%;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.application-fortune {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
align-items: center;
|
|
||||||
//align-items: center;
|
|
||||||
font-size: calc(var(--font-size-standard) * 3);
|
|
||||||
button {
|
|
||||||
color: var(--color-light-1);
|
|
||||||
font-size: calc(var(--font-size-standard) * 1.2);
|
|
||||||
margin-top: 10px;
|
|
||||||
border: none;
|
|
||||||
background-color: inherit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.application-fortune-gm {
|
|
||||||
//padding-right: 50px;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
.application-fortune-player {
|
|
||||||
//padding-right: 20px;
|
|
||||||
justify-content: space-between
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
#tenebris-application-manager {
|
#lethalfantasy-application-manager {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
font-family: var(--font-primary);
|
font-family: var(--font-primary);
|
||||||
@ -8,7 +8,7 @@
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
|
|
||||||
.tenebris-table {
|
.lethalfantasy-table {
|
||||||
margin: 1rem;
|
margin: 1rem;
|
||||||
background: none;
|
background: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
@import "global.less";
|
@import "global.less";
|
||||||
|
|
||||||
.tenebris {
|
.lethalfantasy {
|
||||||
@import "mixins.less";
|
@import "mixins.less";
|
||||||
@import "character.less";
|
@import "character.less";
|
||||||
@import "opponent.less";
|
@import "opponent.less";
|
||||||
@import "path.less";
|
@import "skill.less";
|
||||||
@import "talent.less";
|
@import "gift.less";
|
||||||
@import "weapon.less";
|
@import "weapon.less";
|
||||||
@import "armor.less";
|
@import "armor.less";
|
||||||
@import "spell.less";
|
@import "spell.less";
|
||||||
@import "attack.less";
|
@import "vulnerability.less";
|
||||||
|
@import "save.less";
|
||||||
@import "chat.less";
|
@import "chat.less";
|
||||||
}
|
}
|
||||||
|
|
||||||
@import "roll.less";
|
@import "roll.less";
|
||||||
@import "application-fortune.less";
|
|
||||||
@import "application-manager.less";
|
@import "application-manager.less";
|
@ -1,4 +1,4 @@
|
|||||||
.path-content {
|
.gifts-content {
|
||||||
.sheet-common();
|
.sheet-common();
|
||||||
.item-sheet-common();
|
.item-sheet-common();
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
--font-size-standard: 0.8125rem;
|
--font-size-standard: 0.8125rem;
|
||||||
--background-image-base: url("../assets/parchment.jpg");
|
--background-image-base: url("../assets/parchment.jpg");
|
||||||
--font-secondary: "Amiri", serif;
|
--font-secondary: "Amiri", serif;
|
||||||
--logo-standard: url("../assets/tenebris-logo.webp");
|
--logo-standard: url("../assets/lethal-fantasy-logo.webp");
|
||||||
}
|
}
|
||||||
|
|
||||||
#logo {
|
#logo {
|
||||||
@ -20,7 +20,7 @@
|
|||||||
left: calc(50% - 96px);
|
left: calc(50% - 96px);
|
||||||
}
|
}
|
||||||
|
|
||||||
i.tenebris {
|
i.lethalfantasy {
|
||||||
width: 36px;
|
width: 36px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
background-image: var(--logo-standard);
|
background-image: var(--logo-standard);
|
||||||
@ -33,7 +33,7 @@ i.tenebris {
|
|||||||
transition: 0.3s;
|
transition: 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.application.dialog.tenebris {
|
.application.dialog.lethalfantasy {
|
||||||
font-family: var(--font-primary);
|
font-family: var(--font-primary);
|
||||||
font-size: calc(var(--font-size-standard) * 1.2);
|
font-size: calc(var(--font-size-standard) * 1.2);
|
||||||
background-image: var(--background-image-base);
|
background-image: var(--background-image-base);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.application.dialog.tenebris {
|
.application.dialog.lethalfantasy {
|
||||||
color: var(--color-dark-1);
|
color: var(--color-dark-1);
|
||||||
|
|
||||||
input,
|
input,
|
||||||
@ -9,7 +9,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tenebris-roll-dialog {
|
.lethalfantasy-roll-dialog {
|
||||||
fieldset {
|
fieldset {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.attack-content {
|
.save-content {
|
||||||
.sheet-common();
|
.sheet-common();
|
||||||
.item-sheet-common();
|
.item-sheet-common();
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
.talent-content {
|
.skill-content {
|
||||||
.sheet-common();
|
.sheet-common();
|
||||||
.item-sheet-common();
|
.item-sheet-common();
|
||||||
|
|
26
styles/vulnerability.less
Normal file
26
styles/vulnerability.less
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
.vulnerability-content {
|
||||||
|
.sheet-common();
|
||||||
|
.item-sheet-common();
|
||||||
|
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
img {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"] {
|
||||||
|
font-size: var(--font-size-14);
|
||||||
|
width: 20px;
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"]:checked {
|
||||||
|
background-color: rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"]:checked::after {
|
||||||
|
color: rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
}
|
17
system.json
17
system.json
@ -18,26 +18,27 @@
|
|||||||
"verified": "12"
|
"verified": "12"
|
||||||
},
|
},
|
||||||
"esmodules": ["lethal-fantasy.mjs"],
|
"esmodules": ["lethal-fantasy.mjs"],
|
||||||
"styles": ["css/lethal-fantasy.css"],
|
"styles": ["css/fvtt-lethal-fantasy.css"],
|
||||||
"languages": [
|
"languages": [
|
||||||
{
|
{
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"name": "Anglais",
|
"name": "Anglais",
|
||||||
"path": "lang/fr.json"
|
"path": "lang/en.json"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"documentTypes": {
|
"documentTypes": {
|
||||||
"Actor": {
|
"Actor": {
|
||||||
"character": { "htmlFields": ["description", "langues", "notes"] },
|
"character": { "htmlFields": ["description", "notes"] },
|
||||||
"opponent": { "htmlFields": ["description"] }
|
"opponent": { "htmlFields": ["description"] }
|
||||||
},
|
},
|
||||||
"Item": {
|
"Item": {
|
||||||
"path": { "htmlFields": ["description", "biens", "langues"] },
|
"skill": { "htmlFields": ["description"] },
|
||||||
"talent": { "htmlFields": ["description"] },
|
"gift": { "htmlFields": ["description"] },
|
||||||
|
"vulnerability": { "htmlFields": ["description"] },
|
||||||
|
"save": { "htmlFields": ["description"] },
|
||||||
"weapon": { "htmlFields": ["description"] },
|
"weapon": { "htmlFields": ["description"] },
|
||||||
"armor": { "htmlFields": ["description"] },
|
"armor": { "htmlFields": ["description"] },
|
||||||
"spell": { "htmlFields": ["description"] },
|
"spell": { "htmlFields": ["description"] }
|
||||||
"attack": { "htmlFields": ["description"] }
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"grid": {
|
"grid": {
|
||||||
@ -48,7 +49,5 @@
|
|||||||
"socket": true,
|
"socket": true,
|
||||||
"background": "systems/fvtt-lethal-fantasy/assets/background.webp",
|
"background": "systems/fvtt-lethal-fantasy/assets/background.webp",
|
||||||
"packs": [
|
"packs": [
|
||||||
{
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
{{formInput fields.name value=source.name}}
|
{{formInput fields.name value=source.name}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{formField systemFields.categorie value=system.categorie localize=true}}
|
{{formField systemFields.category value=system.category localize=true}}
|
||||||
{{formField systemFields.valeur value=system.valeur}}
|
{{formField systemFields.valeur value=system.valeur}}
|
||||||
{{formField systemFields.malus value=system.malus}}
|
{{formField systemFields.malus value=system.malus}}
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
17
templates/gift.hbs
Normal file
17
templates/gift.hbs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<section>
|
||||||
|
<div class="header">
|
||||||
|
<img class="item-img" src="{{item.img}}" data-edit="img" data-action="editImage" data-tooltip="{{item.name}}" />
|
||||||
|
{{formInput fields.name value=source.name}}
|
||||||
|
</div>
|
||||||
|
{{formField systemFields.appris value=system.appris}}
|
||||||
|
{{formField systemFields.progression value=system.progression}}
|
||||||
|
{{#if canProgress}}
|
||||||
|
{{formField systemFields.niveau value=system.niveau }}
|
||||||
|
{{/if}}wwww
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend>{{localize "TENEBRIS.Label.description"}}</legend>
|
||||||
|
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
</section>
|
13
templates/skill.hbs
Normal file
13
templates/skill.hbs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<section>
|
||||||
|
<div class="header">
|
||||||
|
<img class="item-img" src="{{item.img}}" data-edit="img" data-action="editImage" data-tooltip="{{item.name}}" />
|
||||||
|
{{formInput fields.name value=source.name}}
|
||||||
|
</div>
|
||||||
|
{{formField systemFields.bonus value=system.bonus}}
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend>{{localize "LETHALFANTASY.Label.description"}}</legend>
|
||||||
|
{{formInput systemFields.description enriched=enrichedDescription value=system.description name="system.description" toggled=true}}
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
</section>
|
Loading…
x
Reference in New Issue
Block a user