57 Commits

Author SHA1 Message Date
uberwald d1fbe611ef Fix fiche creature
Release Creation / build (release) Successful in 9m14s
2026-06-07 23:52:50 +02:00
uberwald 5a30ffb00f Fix fiche creature 2026-06-07 23:52:10 +02:00
uberwald 3aefdeb42e Fix fiche creature 2026-06-07 23:51:44 +02:00
uberwald 939247e731 Fix fiche creature 2026-06-07 23:51:31 +02:00
uberwald 6dea5ba479 ALl features OK, excetp creatures sub-type, WIP3 2026-06-07 23:29:02 +02:00
uberwald 494ec3ea84 Feat: Add sous-type field to Creature sheets (Créature, Démon, Automata)
- Add soustype field to CreatureDataModel
- Add optionsSousTypeCreature to config with localization support
- Add sous-type select dropdown to creature-sheet.hbs header
- Add translation keys to fr.json

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 21:42:59 +02:00
uberwald cb4b255b35 Fix: Remove remaining static method from inside init() function
The getItemValueSC static method was still incorrectly placed inside the
init() method, causing 'Unexpected strict mode reserved word' error at line 103.
This moves it to the class level with calculateItemValueSC.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 21:36:14 +02:00
uberwald 116ac66a8a Fix: Move static methods outside of init() function to class level
The static methods calculateItemValueSC and getItemValueSC were incorrectly
placed inside the init() method, causing a SyntaxError in strict mode.
This moves them to the class level where they belong.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 21:16:52 +02:00
uberwald b4a4737d5b Docs: Update CORRECTIONS.md with new refactoring details and fixes
- Document code duplication elimination in item models
- Document currency conversion logic centralization
- Document new Handlebars helpers (localizeAllegiance, joinPredilections)
- Fix monetary conversion rates in documentation (1 PO = 100 SC, 1 PA = 10 SC)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 20:54:02 +02:00
uberwald 4c33607b2b Refactor: Eliminate code duplication for currency conversion and item pricing
- Add static calculateItemValueSC() and getItemValueSC() helpers to MournbladeCYD2Utility
  to centralize currency conversion logic (1 PO = 100 SC, 1 PA = 10 SC)
- Refactor computeRichesse() and computeValeurEquipement() in Actor to use shared helpers
- Add localizeAllegiance Handlebars helper to display allegiance values localized
  (tous->Tous, chaos->Chaos, loi->Loi, betes->Bêtes, elementaires->Élémentaires)
- Add joinPredilections helper to fix comma display after single Predilection
- Create BaseItemWithPriceDataModel base class for items with pricing fields
  (prixpo, prixca, prixsc, rarete, quantite, equipped)
- Update arme, equipement, protection, monnaie models to extend base class
- Update actor-sheet and creature-sheet templates to use new helpers
- Update partial-item-prix.hbs to display total item value in SC
- Add item-base-sheet.hbs template for future item sheet inheritance

Fixes:
- Allegiance values now display properly localized in Dons & Pactes tabs
- Predilections no longer show trailing comma with single entry
- Equipment value totals now update correctly when items are added/modified
- Currency conversion logic centralized and consistent across the system

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 20:52:46 +02:00
uberwald 0d4bd37f30 Fix: Correction de computeRichesse() pour prendre en compte PO et PA
- computeRichesse() ne prenait en compte que prixsc, maintenant il calcule aussi prixca et prixpo
- Conversion : prixca * 10 + prixpo * 100 (selon le lore)
- Cohérent avec computeValeurEquipement()

Fichier modifié : mournblade-cyd2-actor.js

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 20:16:37 +02:00
uberwald 0aefe8bea8 Docs: Mise à jour tableau état avec correction conversion monétaire
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 19:19:48 +02:00
uberwald 083b02ff96 Docs: Documentation de la correction des taux de conversion monétaire
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 19:16:45 +02:00
uberwald 59fa8c72ff Fix: Correction des taux de conversion monétaire selon le lore Mournblade
- Ancienne conversion : 1 PO = 400 SC, 1 PA = 20 SC (incorrect)
- Nouvelle conversion : 1 PO = 100 SC, 1 PA = 10 SC (selon le lore)

Selon le lore des Jeunes Royaumes :
- 1 Sou d'Argent (SA) = 10 Pièces de Bronze (PB)
- 1 Pièce d'Or (PO) = 10 Sous d'Argent = 100 Pièces de Bronze

Correspondance dans le code :
- SC = Pièces de Bronze (PB)
- PA/CA = Sous d'Argent (SA)
- PO = Pièces d'Or (PO)

Fichiers modifiés :
- mournblade-cyd2-utility.js : Helper calculateItemValueSC et computeMonnaieDetails
- mournblade-cyd2-actor.js : computeValeurEquipement()

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 19:12:17 +02:00
uberwald 4f675cb5c1 Docs: Correction du tableau état des fonctionnalités
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 18:59:04 +02:00
uberwald d1c7c74085 Docs: Documentation de l'activation des totaux d'argent et équipement
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 18:53:27 +02:00
uberwald c5628586f4 Fix: Activation du calcul automatique des totaux d'argent et d'équipement
- Ajout des appels à computeRichesse() et computeValeurEquipement() dans _prepareContext()
- Ces méthodes existent déjà dans l'acteur mais n'étaient pas appelées dans la feuille
- Maintenant, les totaux PO, PA, SC sont calculés automatiquement à partir des items

Fichier modifié : mournblade-cyd2-personnage-sheet.mjs

Répond à la question : 'Où le total restant de ces trois types de pièces apparaît-il ?'
Réponse : Les totaux sont maintenant calculés et affichés dans l'onglet Équipement

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 18:50:36 +02:00
uberwald 13c0d801c3 Docs: Mise à jour tableau état des fonctionnalités
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 18:31:44 +02:00
uberwald fc24b94784 Docs: Documentation de la correction orthographique scéance→séance
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 18:28:22 +02:00
uberwald 29e9230422 Fix: Correction orthographique 'scéance' → 'séance' dans optionsUseTalent
- Correction de la faute d'orthographe dans l'option d'utilisation des Talents
- Avant : 'Une fois par scéance'
- Après : 'Une fois par séance'

Fichier modifié : mournblade-cyd2-config.js (ligne 214)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 18:27:58 +02:00
uberwald fc1be1513a Docs: Documentation de la correction des valeurs d'Allégeance
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 15:32:36 +02:00
uberwald 5c66c29d24 Fix: Correction de l'affichage des valeurs d'Allégeance
- Modification des options d'allégeance pour afficher des valeurs plus courtes et propres
- 'tous' → 'Tous' (déjà correct via MNBL.all)
- 'chaos' → 'Chaos' (déjà correct via MNBL.chaos)
- 'loi' → 'Loi' (déjà correct via MNBL.law)
- 'betes' → 'Bêtes' (nouvelle clé MNBL.betes)
- 'elementaires' → 'Élémentaires' (nouvelle clé MNBL.elementaires)

Fichiers modifiés:
- lang/fr.json : Ajout des clés MNBL.betes et MNBL.elementaires
- mournblade-cyd2-config.js : Mise à jour des allegeanceOptions pour utiliser les nouvelles clés

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 15:30:27 +02:00
uberwald b34857325d Docs: Documentation de la correction des virgules après Prédilections
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 15:27:59 +02:00
uberwald 51a4df73ab Fix: Correction de l'affichage des virgules après les Prédilections
- Suppression de la virgule finale lorsqu'il n'y a qu'une seule Prédilection affichée
- Utilisation du helper subtract pour vérifier si c'est la dernière prédilection dans la liste
- Correction appliquée à la fois sur actor-sheet.hbs et creature-sheet.hbs

Avant : 'Prédilection1,' (virgule inutile)
Après : 'Prédilection1' (pas de virgule) ou 'Prédilection1, Prédilection2' (virgule seulement entre les éléments)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 15:27:25 +02:00
uberwald c0bc37e32a Docs: Mise à jour de la documentation des corrections
- Ajout des nouvelles corrections pour le popup, le coût en Pouvoir, et l'amélioration des Profils
- Mise à jour de l'état des fonctionnalités demandées

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 14:54:49 +02:00
uberwald 92ea0164a2 Fix: Corrections diverses pour Mournblade CYD 2.0
- Modification du popup de bienvenue : simplification de la mention des droits (jeu Titam)
- Ajout du champ 'Coût en Pouvoir des invocations' dans l'onglet Sorcellerie pour suivre le coût des invocations en cours
- Amélioration de l'onglet Détails des Profils : remplacement des sections de texte simples par des sheet-box pour un meilleur rendu visuel
- Ajout de la clé i18n 'coutPouvoirInvocations' dans lang/fr.json
- Ajout du champ coutPouvoirInvocations dans le schéma de données Personnage

Corrections basées sur les demandes : popup, onglet Sorcellerie, onglet Détails Profils

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 14:52:50 +02:00
uberwald 0425ccf723 feat: Ajout carte Combat sur fiche de personnage
- Ajout d'une carte Combat (case bleue) dans l'en-tête de la fiche
  de personnage, similaire à celle des créatures
- Affiche en temps réel :
  * Initiative (calculée : Adresse + bonus)
  * Défense (calculée : base + bonus + protection - adversité)
  * Protection (calculée à partir des armures/boucliers équipés)
- Ajout des clés i18n pour les libellés abrégés :
  * MNBL.initShort: Init.
  * MNBL.defShort: Déf.
  * MNBL.protShort: Prot.

Ces valeurs sont déjà calculées par getCombatValues() et
protectionTotal dans le contexte de la feuille.

Permet aux joueurs de voir d'un coup d'œil leurs
caractéristiques de combat actuelles.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 14:39:14 +02:00
uberwald 37ff6ebf1d feat: Ajout section Invocations en cours dans l'onglet Sorcellerie
- Ajout du champ system.sorcellerie.invocationsencours (HTMLField)
- Ajout de la clé i18n SORCELLERIE.invocationsencours
- Ajout de la section dans le template avec éditeur riche
- Permet de noter les invocations actives avec leur coût en Pouvoir

L'éditeur riche permet de:
- Glisser-déposer des liens vers des objets du compendium
- Formater le texte (gras, italique, listes)
- Noter le coût temporaire en Pouvoir pour chaque invocation

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 14:34:08 +02:00
uberwald 1c73faeb00 feat: Ajout onglet Sorcellerie sur la fiche de personnage
- Ajout d'un nouvel onglet 'Sorcellerie' dans la navigation
- Déplacement de la section Runes de 'Dons & Pactes' vers 'Sorcellerie'
- Ajout de 3 nouvelles sections avec éditeurs riches :
  * Créatures invoquées
  * Démons liés
  * Enchantements / Automata
- Ajout des champs système pour stocker ces informations (HTMLField)
- Ajout des clés i18n sous le namespace SORCELLERIE

Structure de l'onglet Sorcellerie :
1. Runes (liste d'items, comme auparavant)
2. Créatures invoquées (éditeur riche)
3. Démons liés (éditeur riche)
4. Enchantements / Automata (éditeur riche)

Cela permet aux sorciers d'avoir plus d'espace pour noter leurs
nombreuses runes, invocations, etc. et d'y glisser-déposer des liens
vers des objets du compendium.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 14:14:30 +02:00
uberwald 0c42b6ab34 feat: Amélioration de l'onglet Détails des Profils
- Conversion des champs Compétences, Talents (Initié/Aguerri/Maître)
  et Prérequis (Aguerri/Maître) en HTMLField pour permettre
  l'utilisation de l'éditeur riche
- Remplacement des textarea à fond marron par des éditeurs blancs
  (comme pour les Sacrifices des Dons)
- Permet maintenant de glisser-déposer des liens vers des objets
  du compendium (Compétences, Talents, etc.)
- Structure cohérente avec le template des Dons

Modèles modifiés:
- modules/models/profil.mjs: conversion StringField → HTMLField
- templates/item-profil-sheet.hbs: remplacement textarea → éditeur

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 14:07:01 +02:00
uberwald d6e7b62c31 Docs: Mise à jour du pop-up de bienvenue
- Suppression du lien vers titam-france.fr
- Ajout du lien vers lahiette.com pour les règles PAO 0.9
- Conservation de la mention Titam dans la section Droits

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 14:03:36 +02:00
uberwald a3f304c77b Fix: Correction des clés i18n et affichage de l'onglet Effets
- Correction du namespace i18n: MOURNBLADECYD2.EFFECT → EFFECT
- Suppression de la condition {{#if item.effects.length}} dans tous les templates d'items
- Ajout de la clé EFFECT.noItemEffects pour les items sans effets
- Remplacement des textes en dur par des clés i18n dans les partials
- Mise à jour de toutes les références dans le code JavaScript

Cela corrige:
1. Les clés i18n manquantes (namespace incohérent)
2. L'onglet Effets des items qui était vide quand l'item n'avait pas d'effets

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 09:47:22 +02:00
uberwald 1b81b0a3ac Corrections§upgrade diverses 2026-06-07 09:43:37 +02:00
uberwald 3ff2b8e9bb Docs: Add MNBL i18n and effects tab fixes to documentation
- Documented missing MNBL.details and MNBL.description keys
- Documented effects tab visibility fix
- Updated file list and impact section

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:53:53 +02:00
uberwald 38525c3257 Fix: Add missing MNBL i18n keys and show effects tab always
- Added MNBL.details and MNBL.description to lang/fr.json
- Removed conditional display of effects tab in partial-item-nav.hbs
- Effects tab now always visible in item sheets
- Added MNBL i18n keys verification to test script

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:53:31 +02:00
uberwald f035bcfae2 Docs: Add i18n EFFECT keys fix to documentation
- Documented the missing i18n localization keys
- Updated file list and impact section

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:51:32 +02:00
uberwald a8bf356d20 Fix: Add missing i18n EFFECT keys to lang/fr.json
Added missing localization keys for ActiveEffect management:
- createError: Erreur lors de la création de l'effet
- deleteError: Erreur lors de la suppression de l'effet
- applyError: Erreur lors de l'application de l'effet
- applyItemError: Erreur lors de l'application de l'effet sur l'item
- selectActor: Sélectionnez un acteur pour appliquer l'effet
- toggleError: Erreur lors de l'activation/désactivation de l'effet

Added test verification for EFFECT i18n keys

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:51:12 +02:00
uberwald cd70b70088 Docs: Add subtract helper fix to documentation
- Documented the missing subtract helper issue
- Updated file list and impact section

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:49:15 +02:00
uberwald 14763cc5b3 Fix: Add missing Handlebars subtract helper
- Added subtract helper: parseInt(a) - parseInt(b)
- Helper is used in partial-active-effects.hbs and partial-item-effects.hbs
- Registered in MournbladeCYD2Utility.init() alongside other helpers
- Added test verification for subtract helper registration

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:48:55 +02:00
uberwald 0258c2e8b7 Docs: Update with duration.type to duration.units fix
- Documented the ActiveEffectDuration property deprecation fix
- Updated file list and impact section

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:42:05 +02:00
uberwald 9b3d34c5d7 Fix: Replace deprecated duration.type with duration.units (Foundry v14+)
- ActiveEffectDuration#type was renamed to #units in Foundry VTT v14
- Updated partial-active-effects.hbs to use duration.units
- Updated partial-item-effects.hbs to use duration.units
- Added test verification for duration.type usage
- Support for duration.type will be removed in v16

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:41:46 +02:00
uberwald 335238df3d Docs: Update CORRECTIONS.md with effect.webp icon fix
- Documented the effect.webp missing icon issue
- Updated file list with all corrected files
- Updated impact section

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:36:40 +02:00
uberwald a1519e7a60 Fix: Replace missing effect.webp icon with existing capacite.webp
- effect.webp icon was missing, causing infinite 404 errors
- Replaced all references with capacite.webp which exists
- Fixed in base-actor-sheet.mjs, base-item-sheet.mjs, mournblade-cyd2-effects.js
- Fixed in partial-active-effects.hbs and partial-item-effects.hbs templates
- Updated test script to check for effect.webp references

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:36:12 +02:00
uberwald e55b5cbe15 Test: Add check for deprecated ActiveEffectDialog API usage
- Added verification for deprecated ActiveEffectDialog.create() calls
- Updated test script to check all critical fixes

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:34:06 +02:00
uberwald f28719fc6f Fix: Replace deprecated ActiveEffectDialog.create() with createEmbeddedDocuments
- ActiveEffectDialog.create() was removed in Foundry VTT v14
- Replaced with direct document.createEmbeddedDocuments() call
- After creation, opens the effect sheet for editing
- Fixed in both base-actor-sheet.mjs and base-item-sheet.mjs

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:33:44 +02:00
uberwald d0423b2017 Fix: Add missing Handlebars partials to preload function
- Added partial-active-effects.hbs and partial-item-effects.hbs to preloadHandlebarsTemplates()
- These partials were used in sheets but not preloaded, causing render errors
- Fixed lang/fr.json formatting (added closing brace and newline)
- Added test script to validate template loading
- Added CORRECTIONS.md documentation

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:26:07 +02:00
uberwald 156672d853 ActiveEffects: Add complete ActiveEffects management system
- New: modules/mournblade-cyd2-effects.js with utility methods for creating, applying, and managing effects
- New: templates/partial-active-effects.hbs for displaying actor effects
- New: templates/partial-item-effects.hbs for displaying item effects
- Update: modules/mournblade-cyd2-config.js with effect configuration (types, attribute keys, categories)
- Update: templates/actor-sheet.hbs and creature-sheet.hbs with Effects tab
- Update: templates/partial-item-nav.hbs with conditional Effects tab
- Update: templates/item-talent-sheet.hbs with Effects tab content
- Update: base-actor-sheet.mjs with effect action handlers (create, edit, delete, toggle)
- Update: base-item-sheet.mjs with effect action handlers and context
- Update: modules/mournblade-cyd2-main.js to import and expose MournbladeCYD2Effects
- Update: lang/fr.json with effect-related translations

Features:
- Support for creating permanent and temporary effects
- Support for attribute modifications (ADR, PUI, CLA, PRE, TRE, etc.)
- Support for health, soul, combat, and adversity modifications
- Support for status effects
- Support for runes (pronounced and traced) effects
- Toggle to enable/disable effects
- Duration tracking (rounds, turns, seconds, combat, scene)
- Display of all active modifications summary

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-06 22:51:31 +02:00
uberwald 5ab03920d6 Corrections diverses pour CYD2.0
- Fix: Remplacement de 'Points d'Âme' par 'Points de Pouvoir' dans les messages de chat
- Fix: Ajout de la case Âme avec Seuil de Pouvoir dans les fiches de créature
- Fix: Ajout du champ Seuil de Pouvoir éditable dans les fiches de créature
- Fix: Initiative, Défense et Protection maintenant éditables dans les fiches de créature
- Fix: Ajout du champ Bonus/Malus aux templates de Traits chaotiques et d'espèce
- Fix: Le champ coût en Pouvoir des Runes accepte maintenant du texte (StringField)
- Fix: Rafraîchissement des fiches après drop d'items pour afficher les Traits
- Fix: Ajout des nouveaux types d'items (Trait Démoniaque, Pouvoir Élémentaire, Capacité d'Automata)
- New: Ajout des modèles et templates pour les nouveaux types d'items
- New: Intégration complète des nouveaux types dans les fichiers de configuration

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-06 22:08:53 +02:00
uberwald 9dd6fbd2e7 Fix: Affichage des Traits et corrections diverses
- Fix: Ajout des sections Traits Chaotiques et Traits d'Espèce dans les fiches de créature
  - Ajout de context.traitsChaotiques et context.traitsEspeces dans la feuille de créature
  - Ajout des sections dans le template creature-sheet.hbs avec boutons d'ajout
- Fix: Bouton Ajouter Automatisation fonctionnel dans les Talents
  - Ajout des actions addAutomation et deleteAutomation dans base-item-sheet.mjs
  - Ajout des méthodes #onAddAutomation et #onDeleteAutomation
  - Ajout des attributs data-action sur les boutons du template partial-automation.hbs
  - Ajout des attributs name sur les champs d'automatisation
- Ajout du champ Don lié dans les Tendances
  - Ajout de donlie dans le modèle tendance.mjs
  - Ajout du champ Don lié dans le template item-tendance-sheet.hbs
- Ajout de la catégorie Balance dans les options d'allégeance
  - Ajout dans mournblade-cyd2-config.js
  - Ajout de la traduction dans lang/fr.json
- Correction du libellé Coût en Âme → Coût en points de pouvoir
- Correction du bug de l'éditeur Sacrifices dans les Dons
  - Ajout de owner et editable dans le contexte
  - Renommage de Sacrifices en Sacrifices et Tendances liées
- Ajout de la case Âme avec Seuil de Pouvoir dans les fiches de créature
- Rendre Initiative, Défense et Protection éditables dans les fiches de créature
  - Ajout des champs inittotal, defensetotal, protectiontotal dans creature.mjs
  - Modification du contexte pour prioriser les valeurs manuelles
  - Remplacement des spans par des inputs dans le template

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-06 20:30:04 +02:00
uberwald 76ed974352 Fix: Correction du libellé Coût en Âme et ajout de la catégorie Balance
- Correction du libellé 'Coût en Âme' en 'Coût en points de pouvoir' pour les runes
- Fix: Ajout des gestionnaires d'événements pour les automatisations des Talents
  - Ajout des actions addAutomation et deleteAutomation dans base-item-sheet.mjs
  - Ajout des attributs data-action sur les boutons du template partial-automation.hbs
  - Ajout des attributs name sur les champs d'automatisation pour la sauvegarde
- Ajout de la catégorie 'Balance' dans les options d'allégeance pour Dons et Tendances

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-06 18:32:10 +02:00
uberwald c65a55225d Corrections diverses pour CYD2.0
Release Creation / build (release) Successful in 8m48s
2026-05-24 16:49:39 +02:00
uberwald adc104b757 Corrections diverses pour CYD2.03 2026-05-24 16:49:25 +02:00
uberwald 2e14c70a02 Feat: Add 'Coût en Pouvoir' field to Rune items
Ajoute un champ numérique 'coutAme' (entier, défaut=0) pour les runes :
- DataModel: Ajout du champ dans modules/models/rune.mjs
- Template fiche: Ajout du champ 'Coût en Pouvoir' dans templates/item-rune-sheet.hbs
- Template post: Ajout de l'affichage dans templates/post-item.hbs

Ce champ permet de spécifier le coût en Pouvoir pour chaque rune,
et s'affiche à la fois dans la fiche et dans le chat.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-24 16:44:45 +02:00
uberwald 2d5b844796 Fix: Add predilections and description to competence post-item template
Améliore l'affichage des compétences dans le chat en ajoutant :
- La liste des prédilections avec leurs propriétés (nom, description, maîtrisée, acquise, utilisée)
- La description est déjà affichée (déjà présente dans le template)

Cela permet aux joueurs de voir toutes les informations importantes
lorsqu'une compétence est postée dans le chat.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-24 16:25:46 +02:00
uberwald c62131ac97 Fix: Add missing data-action attributes to competence sheet predilection buttons
Corrige le bouton 'Ajouter une prédilection' qui ne fonctionnait pas
à cause de l'absence de l'attribut data-action requis par AppV2.

Modifications:
- Ajout de data-action="addPredilection" au bouton d'ajout
- Ajout de data-action="deletePredilection" au bouton de suppression
- Ajout des attributs name= aux champs de prédilection pour la sauvegarde automatique

Cela corrige le problème: le bouton 'Ajouter une prédilection' ne répondait pas
lorsqu'on cliquait dessus dans la fiche de compétence.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-24 16:20:32 +02:00
uberwald cc92f5a418 Fix: Complete correction of image paths and item types in all compendium packs
Corrige TOUS les problèmes de chemins d'images et de types d'items :

1. Chemins d'images incorrects (3 variantes) :
   - systems/fvtt-mournblade/assets/icons/ → systems/fvtt-mournblade-cyd-2-0/assets/icons/
   - systems/fvtt-mournblade-cyd2/assets/icons/ → systems/fvtt-mournblade-cyd-2-0/assets/icons/

2. Type d'item invalide :
   - 4 boucliers (Écu d'acier, Pavois, Bouclier d'Infanterie, Targe)
     avaient le type 'bouclier' → corrigé en 'protection'

Packs corrigés : armes, protections, equipement, dons, runes, tendances,
 traits-chaotiques, historiques, profils, talents, skills, skills-creatures, pnj-creatures

Total: 1136+ items corrigés

Cela corrige l'erreur: 'Cannot convert undefined or null to object'
lors de l'ouverture des items dans les compendiums.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-24 16:11:21 +02:00
uberwald b877262283 Minor fixes from v14 feedback
Release Creation / build (release) Successful in 8m22s
2026-05-23 23:07:10 +02:00
885 changed files with 4205 additions and 349413 deletions
+1 -1
View File
@@ -2,4 +2,4 @@ node_modules/
styles/mournblade-cyd2.css.map
package-lock.json
.github/
.github/
.history/
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Hawkmoon (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Hawkmoon (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Hawkmoon (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Hawkmoon, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Hawkmoon (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Hawkmoon (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Hawkmoon, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade avec le (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Hawkmoon (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Hawkmoon (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Hawkmoon, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade avec le règles CY (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Hawkmoon (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Hawkmoon (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Hawkmoon, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade avec le règles CYD 2.. (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Hawkmoon (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Hawkmoon (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Hawkmoon, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade avec le règles CYD 2.0 (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Hawkmoon (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Hawkmoon (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Hawkmoon, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade avec le règles CYD 2.0 (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for M (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Hawkmoon (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Hawkmoon, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade avec le règles CYD 2.0 (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Mournblade (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Hawkmoon (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Hawkmoon, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade avec le règles CYD 2.0 (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Mournblade CYD 2.0 (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Hawkmoon (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Hawkmoon, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade avec le règles CYD 2.0 (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Mournblade CYD 2.0 (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Mournblade (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Hawkmoon, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade avec le règles CYD 2.0 (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Mournblade CYD 2.0 (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Mournblade (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Mournblade, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade avec le règles CYD 2.0 (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Mournblade CYD 2.0 (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Mournblade (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Mournblade, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developpement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-29
View File
@@ -1,29 +0,0 @@
# Système Foundry pour Mournblade avec le règles CYD 2.0 (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Mournblade CYD 2.0 (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Mournblade (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Mournblade, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developpement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer
-38
View File
@@ -1,38 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"cellule": "Cellule",
"creature": "Créature"
},
"Item": {
"artefact": "Artefact",
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"contact": "Contact",
"mutation": "Mutation",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"HAWKMOON": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-38
View File
@@ -1,38 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"cellule": "Cellule",
"creature": "Créature"
},
"Item": {
"artefact": "Artefact",
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"contact": "Contact",
"mutation": "Mutation",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"HAWKMOON": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-38
View File
@@ -1,38 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"cellule": "Cellule",
"creature": "Créature"
},
"Item": {
"artefact": "Artefact",
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"contact": "Contact",
"mutation": "Mutation",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"MOURNBLADE": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-38
View File
@@ -1,38 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"cellule": "Cellule",
"creature": "Créature"
},
"Item": {
"artefact": "Artefact",
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"contact": "Contact",
"mutation": "Mutation",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"MOURNBLADE": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-37
View File
@@ -1,37 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"creature": "Créature"
},
"Item": {
"artefact": "Artefact",
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"contact": "Contact",
"mutation": "Mutation",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"MOURNBLADE": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-37
View File
@@ -1,37 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"creature": "Créature"
},
"Item": {
"artefact": "Artefact",
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"contact": "Contact",
"mutation": "Mutation",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"MOURNBLADE": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-36
View File
@@ -1,36 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"creature": "Créature"
},
"Item": {
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"contact": "Contact",
"mutation": "Mutation",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"MOURNBLADE": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-36
View File
@@ -1,36 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"creature": "Créature"
},
"Item": {
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"contact": "Contact",
"mutation": "Mutation",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"MOURNBLADE": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-35
View File
@@ -1,35 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"creature": "Créature"
},
"Item": {
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"contact": "Contact",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"MOURNBLADE": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-35
View File
@@ -1,35 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"creature": "Créature"
},
"Item": {
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"contact": "Contact",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"MOURNBLADE": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-34
View File
@@ -1,34 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"creature": "Créature"
},
"Item": {
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"MOURNBLADE": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-32
View File
@@ -1,32 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"creature": "Créature"
},
"Item": {
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"MOURNBLADE": {
"ui": {
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
-32
View File
@@ -1,32 +0,0 @@
{
"TYPES": {
"Actor": {
"personnage": "Personnage",
"creature": "Créature"
},
"Item": {
"arme": "Arme",
"talent": "Talent",
"historique": "Historique",
"profil": "Profil",
"competence": "Compétence",
"protection": "Protection",
"monnaie": "Monnaie",
"equipement": "Equipement",
"ressource": "Ressource",
"don": "Don",
"pacte": "Pacte",
"rune": "Rune",
"runeeffect": "Effet de Rune",
"tendance": "Tendance",
"traitchaotique": "Trait Chaotique",
"traitespece": "Trait d'Espèce"
}
},
"MOURNBLADE": {
"ui": {
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}
@@ -1,116 +0,0 @@
/**
* Macro pour remplacer les chemins d'images dans les compendiums
* Remplace "fvtt-hawkmoon-cyd" par "fvtt-mournblade-cyd2" dans tous les champs 'img'
*/
(async () => {
// Confirmation avant de procéder
let confirm = await Dialog.confirm({
title: "Remplacement des chemins d'images",
content: `<p>Cette macro va :</p>
<ul>
<li>Déverrouiller tous les compendiums</li>
<li>Remplacer "fvtt-hawkmoon-cyd" par "fvtt-mournblade-cyd2" dans tous les champs 'img'</li>
<li>Reverrouiller les compendiums</li>
</ul>
<p><strong>Voulez-vous continuer ?</strong></p>`,
defaultYes: false
});
if (!confirm) {
ui.notifications.info("Opération annulée");
return;
}
ui.notifications.info("Début du traitement des compendiums...");
let totalUpdated = 0;
let compendiumsProcessed = 0;
// Parcourir tous les compendiums
for (let pack of game.packs) {
// Filtrer uniquement les compendiums du système mournblade
if (!pack.metadata.packageName.includes("mournblade")) continue;
console.log(`Traitement du compendium: ${pack.metadata.label}`);
compendiumsProcessed++;
try {
// Unlock le compendium
await pack.configure({ locked: false });
// Récupérer tous les documents du compendium
let documents = await pack.getDocuments();
let updatedInPack = 0;
for (let doc of documents) {
let needsUpdate = false;
let updateData = {};
// Vérifier le champ img principal
if (doc.img && doc.img.includes("fvtt-hawkmoon-cyd")) {
updateData.img = doc.img.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd2");
needsUpdate = true;
}
// Pour les acteurs, vérifier aussi prototypeToken.texture.src
if (doc.documentName === "Actor" && doc.prototypeToken?.texture?.src) {
if (doc.prototypeToken.texture.src.includes("fvtt-hawkmoon-cyd")) {
updateData["prototypeToken.texture.src"] = doc.prototypeToken.texture.src.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd2");
needsUpdate = true;
}
}
// Pour les items contenus dans les acteurs
if (doc.documentName === "Actor" && doc.items) {
for (let item of doc.items) {
if (item.img && item.img.includes("fvtt-hawkmoon-cyd")) {
// Note: Les items embarqués nécessitent une approche différente
needsUpdate = true;
}
}
}
// Pour les scènes, vérifier background.src et les tokens
if (doc.documentName === "Scene") {
if (doc.background?.src && doc.background.src.includes("fvtt-hawkmoon-cyd")) {
updateData["background.src"] = doc.background.src.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd2");
needsUpdate = true;
}
}
// Effectuer la mise à jour si nécessaire
if (needsUpdate) {
await doc.update(updateData);
updatedInPack++;
console.log(` - Mise à jour: ${doc.name}`);
}
}
// Lock le compendium
await pack.configure({ locked: true });
if (updatedInPack > 0) {
ui.notifications.info(`${pack.metadata.label}: ${updatedInPack} document(s) mis à jour`);
totalUpdated += updatedInPack;
}
} catch (error) {
console.error(`Erreur lors du traitement de ${pack.metadata.label}:`, error);
ui.notifications.error(`Erreur sur ${pack.metadata.label}: ${error.message}`);
// Tenter de reverrouiller en cas d'erreur
try {
await pack.configure({ locked: true });
} catch (lockError) {
console.error(`Impossible de reverrouiller ${pack.metadata.label}:`, lockError);
}
}
}
ui.notifications.info(`Traitement terminé ! ${totalUpdated} document(s) mis à jour dans ${compendiumsProcessed} compendium(s).`);
console.log(`=== Résumé ===`);
console.log(`Compendiums traités: ${compendiumsProcessed}`);
console.log(`Total de documents mis à jour: ${totalUpdated}`);
})();
@@ -1,116 +0,0 @@
/**
* Macro pour remplacer les chemins d'images dans les compendiums
* Remplace "fvtt-hawkmoon-cyd" par "fvtt-mournblade-cyd2" dans tous les champs 'img'
*/
(async () => {
// Confirmation avant de procéder
let confirm = await Dialog.confirm({
title: "Remplacement des chemins d'images",
content: `<p>Cette macro va :</p>
<ul>
<li>Déverrouiller tous les compendiums</li>
<li>Remplacer "fvtt-hawkmoon-cyd" par "fvtt-mournblade-cyd2" dans tous les champs 'img'</li>
<li>Reverrouiller les compendiums</li>
</ul>
<p><strong>Voulez-vous continuer ?</strong></p>`,
defaultYes: false
});
if (!confirm) {
ui.notifications.info("Opération annulée");
return;
}
ui.notifications.info("Début du traitement des compendiums...");
let totalUpdated = 0;
let compendiumsProcessed = 0;
// Parcourir tous les compendiums
for (let pack of game.packs) {
// Filtrer uniquement les compendiums du système mournblade
if (!pack.metadata.packageName.includes("mournblade")) continue;
console.log(`Traitement du compendium: ${pack.metadata.label}`);
compendiumsProcessed++;
try {
// Unlock le compendium
await pack.configure({ locked: false });
// Récupérer tous les documents du compendium
let documents = await pack.getDocuments();
let updatedInPack = 0;
for (let doc of documents) {
let needsUpdate = false;
let updateData = {};
// Vérifier le champ img principal
if (doc.img && doc.img.includes("fvtt-hawkmoon-cyd")) {
updateData.img = doc.img.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd2");
needsUpdate = true;
}
// Pour les acteurs, vérifier aussi prototypeToken.texture.src
if (doc.documentName === "Actor" && doc.prototypeToken?.texture?.src) {
if (doc.prototypeToken.texture.src.includes("fvtt-hawkmoon-cyd")) {
updateData["prototypeToken.texture.src"] = doc.prototypeToken.texture.src.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd2");
needsUpdate = true;
}
}
// Pour les items contenus dans les acteurs
if (doc.documentName === "Actor" && doc.items) {
for (let item of doc.items) {
if (item.img && item.img.includes("fvtt-hawkmoon-cyd")) {
// Note: Les items embarqués nécessitent une approche différente
needsUpdate = true;
}
}
}
// Pour les scènes, vérifier background.src et les tokens
if (doc.documentName === "Scene") {
if (doc.background?.src && doc.background.src.includes("fvtt-hawkmoon-cyd")) {
updateData["background.src"] = doc.background.src.replace(/fvtt-hawkmoon-cyd/g, "fvtt-mournblade-cyd2");
needsUpdate = true;
}
}
// Effectuer la mise à jour si nécessaire
if (needsUpdate) {
await doc.update(updateData);
updatedInPack++;
console.log(` - Mise à jour: ${doc.name}`);
}
}
// Lock le compendium
await pack.configure({ locked: true });
if (updatedInPack > 0) {
ui.notifications.info(`${pack.metadata.label}: ${updatedInPack} document(s) mis à jour`);
totalUpdated += updatedInPack;
}
} catch (error) {
console.error(`Erreur lors du traitement de ${pack.metadata.label}:`, error);
ui.notifications.error(`Erreur sur ${pack.metadata.label}: ${error.message}`);
// Tenter de reverrouiller en cas d'erreur
try {
await pack.configure({ locked: true });
} catch (lockError) {
console.error(`Impossible de reverrouiller ${pack.metadata.label}:`, lockError);
}
}
}
ui.notifications.info(`Traitement terminé ! ${totalUpdated} document(s) mis à jour dans ${compendiumsProcessed} compendium(s).`);
console.log(`=== Résumé ===`);
console.log(`Compendiums traités: ${compendiumsProcessed}`);
console.log(`Total de documents mis à jour: ${totalUpdated}`);
})();
@@ -1,222 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
talentsCell: this.getCelluleTalents(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type =="talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, {async: true}),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, {async: true}),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
getCelluleTalents( ) {
let talents = []
for(let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find( it => it.id == this.actor.id)
if (found) {
talents = talents.concat( cellule.getTalents() )
}
}
}
return talents
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get( itemId )
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity( li.data("item-id"), value );
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem( li.data("item-id") );
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse( data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if ( autoresult.isValid ) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn( autoresult.warningMessage)
}
}
}
@@ -1,222 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
talentsCell: this.getCelluleTalents(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
getCelluleTalents() {
let talents = []
for (let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find(it => it.id == this.actor.id)
if (found) {
talents = talents.concat(cellule.getTalents())
}
}
}
return talents
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,224 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
talentsCell: this.getCelluleTalents(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
getCelluleTalents() {
let talents = []
for (let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find(it => it.id == this.actor.id)
if (found) {
talents = talents.concat(cellule.getTalents())
}
}
}
return talents
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,224 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
talentsCell: this.getCelluleTalents(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
getCelluleTalents() {
let talents = []
for (let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find(it => it.id == this.actor.id)
if (found) {
talents = talents.concat(cellule.getTalents())
}
}
}
return talents
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,226 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
talentsCell: this.getCelluleTalents(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
getCelluleTalents() {
let talents = []
for (let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find(it => it.id == this.actor.id)
if (found) {
talents = talents.concat(cellule.getTalents())
}
}
}
return talents
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,226 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
talentsCell: this.getCelluleTalents(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
getCelluleTalents() {
let talents = []
for (let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find(it => it.id == this.actor.id)
if (found) {
talents = talents.concat(cellule.getTalents())
}
}
}
return talents
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,227 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
talentsCell: this.getCelluleTalents(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameMax: this.actor.getAmeMax(),
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
getCelluleTalents() {
let talents = []
for (let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find(it => it.id == this.actor.id)
if (found) {
talents = talents.concat(cellule.getTalents())
}
}
}
return talents
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,227 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
talentsCell: this.getCelluleTalents(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameMax: this.actor.getAmeMax(),
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
getCelluleTalents() {
let talents = []
for (let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find(it => it.id == this.actor.id)
if (found) {
talents = talents.concat(cellule.getTalents())
}
}
}
return talents
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,228 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
talentsCell: this.getCelluleTalents(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameMax: this.actor.getAmeMax(),
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()),
ameMaxList: MournbladeCYD2Utility.getAmeMaxList(this.actor.system.ame.nbame),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
getCelluleTalents() {
let talents = []
for (let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find(it => it.id == this.actor.id)
if (found) {
talents = talents.concat(cellule.getTalents())
}
}
}
return talents
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,228 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
talentsCell: this.getCelluleTalents(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameMax: this.actor.getAmeMax(),
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()),
ameMaxList: MournbladeCYD2Utility.getAmeMaxList(this.actor.system.ame.nbame),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
getCelluleTalents() {
let talents = []
for (let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find(it => it.id == this.actor.id)
if (found) {
talents = talents.concat(cellule.getTalents())
}
}
}
return talents
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,227 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameMax: this.actor.getAmeMax(),
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()),
ameMaxList: MournbladeCYD2Utility.getAmeMaxList(this.actor.system.ame.nbame),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
getCelluleTalents() {
let talents = []
for (let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find(it => it.id == this.actor.id)
if (found) {
talents = talents.concat(cellule.getTalents())
}
}
}
return talents
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,213 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameMax: this.actor.getAmeMax(),
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()),
ameMaxList: MournbladeCYD2Utility.getAmeMaxList(this.actor.system.ame.nbame),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,213 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
artefacts: foundry.utils.duplicate(this.actor.getArtefacts()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameMax: this.actor.getAmeMax(),
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()),
ameMaxList: MournbladeCYD2Utility.getAmeMaxList(this.actor.system.ame.nbame),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,212 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameMax: this.actor.getAmeMax(),
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()),
ameMaxList: MournbladeCYD2Utility.getAmeMaxList(this.actor.system.ame.nbame),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,212 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
mutations: foundry.utils.duplicate(this.actor.getMutations() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameMax: this.actor.getAmeMax(),
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()),
ameMaxList: MournbladeCYD2Utility.getAmeMaxList(this.actor.system.ame.nbame),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,211 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameMax: this.actor.getAmeMax(),
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()),
ameMaxList: MournbladeCYD2Utility.getAmeMaxList(this.actor.system.ame.nbame),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,211 +0,0 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
/* -------------------------------------------- */
export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "actor"],
template: "systems/fvtt-mournblade-cyd2/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: foundry.utils.duplicate(this.actor.getWeapons()),
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
protections: foundry.utils.duplicate(this.actor.getArmors()),
historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []),
talents: foundry.utils.duplicate(this.actor.getTalents() || []),
dons: foundry.utils.duplicate(this.actor.getDons() || []),
pactes: foundry.utils.duplicate(this.actor.getPactes() || []),
tendances: foundry.utils.duplicate(this.actor.getTendances() || []),
runes: foundry.utils.duplicate(this.actor.getRunes() || []),
traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []),
traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
profils: foundry.utils.duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
richesse: this.actor.computeRichesse(),
coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used),
valeurEquipement: this.actor.computeValeurEquipement(),
nbCombativite: this.actor.system.sante.nbcombativite,
combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite),
nbAme: this.actor.system.ame.nbame,
ameMax: this.actor.getAmeMax(),
ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()),
ameMaxList: MournbladeCYD2Utility.getAmeMaxList(this.actor.system.ame.nbame),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }),
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get(itemId)
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
MournbladeCYD2Utility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity(li.data("item-id"), value);
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("adr", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-assommer').click((event) => {
this.actor.rollAssommer()
})
html.find('.roll-coup-bas').click((event) => {
this.actor.rollCoupBas()
})
html.find('.roll-immobiliser').click((event) => {
this.actor.rollImmobiliser()
})
html.find('.roll-repousser').click((event) => {
this.actor.rollRepousser()
})
html.find('.roll-desengager').click((event) => {
this.actor.rollDesengager()
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem(li.data("item-id"));
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await MournbladeCYD2Utility.searchItem(item)
}
let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor)
if (autoresult.isValid) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn(autoresult.warningMessage)
}
}
}
@@ -1,916 +0,0 @@
/* -------------------------------------------- */
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2RollDialog } from "./applications/mournblade-cyd2-roll-dialog.mjs";
/* -------------------------------------------- */
const __degatsBonus = [-2, -2, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10]
const __vitesseBonus = [-2, -2, -1, -1, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8]
/* -------------------------------------------- */
/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
* @extends {Actor}
*/
export class MournbladeCYD2Actor extends Actor {
/* -------------------------------------------- */
/**
* Override the create() function to provide additional SoS functionality.
*
* This overrided create() function adds initial items
* Namely: Basic skills, money,
*
* @param {Object} data Barebones actor data which this function adds onto.
* @param {Object} options (Unused) Additional options which customize the creation workflow.
*
*/
static async create(data, options) {
// Case of compendium global import
if (data instanceof Array) {
return super.create(data, options);
}
// If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic
if (data.items) {
let actor = super.create(data, options);
return actor;
}
if (data.type == 'personnage') {
console.log("Loading skills for personnage")
const skills = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd-2-0.skills")
data.items = skills.map(i => i.toObject())
}
if (data.type == 'creature') {
const skills = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd-2-0.skills-creatures")
data.items = skills.map(i => i.toObject())
data.items.push({ name: "Arme naturelle 1", type: 'arme', img: "systems/fvtt-mournblade-cyd-2-0/assets/icons/melee.webp", system: { typearme: "contact", bonusmaniementoff: 0, seuildefense: 0, degats: "0" } })
data.items.push({ name: "Arme naturelle 2", type: 'arme', img: "systems/fvtt-mournblade-cyd-2-0/assets/icons/melee.webp", system: { typearme: "contact", bonusmaniementoff: 0, seuildefense: 0, degats: "0" } })
}
return super.create(data, options);
}
/* -------------------------------------------- */
getBonusDefenseFromTalents() {
let talents = this.items.filter(item => item.type == "talent" && item.system.isautomated)
let bonus = 0
for (let talent of talents) {
for (let auto of talent.system.automations) {
if (auto.eventtype == "bonus-permanent" && auto.bonusname == "bonus-defensif") {
bonus += Number(auto.bonus || 0)
}
}
}
return bonus
}
/* -------------------------------------------- */
prepareArme(arme) {
arme = foundry.utils.duplicate(arme)
let combat = this.getCombatValues()
if (arme.system.typearme == "contact" || arme.system.typearme == "contactjet") {
let bonusDefense = this.getBonusDefenseFromTalents()
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée"))
arme.system.attrKey = "pui"
arme.system.totalDegats = arme.system.degats + "+" + combat.bonusDegatsTotal
arme.system.totalOffensif = this.system.attributs.pui.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff + (this.system.combat.monte ? 3 : 0)
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.seuildefense + bonusDefense + (this.system.combat.monte ? 3 : 0)
console.log("Arme", arme.system.totalDefensif, combat, arme.system.competence.system.niveau, arme.system.seuildefense, bonusDefense)
arme.system.isdefense = true
arme.system.isMelee = true
arme.system.isDistance = false
}
if (arme.system.typearme == "jet" || arme.system.typearme == "tir") {
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "armes à distance"))
arme.system.attrKey = "adr"
arme.system.totalOffensif = this.system.attributs.adr.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff
arme.system.totalDegats = arme.system.degats
arme.system.isMelee = false
arme.system.isDistance = true
if (arme.system.isdefense) {
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.seuildefense
}
}
return arme
}
/* -------------------------------------------- */
getItemSorted(types) {
let items = this.items.filter(item => types.includes(item.type)) || []
MournbladeCYD2Utility.sortArrayObjectsByName(items)
return items
}
getWeapons() {
let armes = []
for (let arme of this.items) {
if (arme.type == "arme") {
armes.push(this.prepareArme(arme))
}
}
MournbladeCYD2Utility.sortArrayObjectsByName(armes)
return armes
}
getMonnaies() {
return this.getItemSorted(["monnaie"])
}
getEquipments() {
return this.getItemSorted(["equipement"])
}
getArmors() {
return this.getItemSorted(["protection"])
}
getHistoriques() {
return this.getItemSorted(["historique"])
}
getProfils() {
return this.getItemSorted(["profil"])
}
getTalents() {
return this.getItemSorted(["talent"])
}
getRessources() {
return this.getItemSorted(["ressource"])
}
getDons() {
return this.getItemSorted(["don"])
}
getPactes() {
return this.getItemSorted(["pacte"])
}
getTendances() {
return this.getItemSorted(["tendance"])
}
getRunes() {
return this.getItemSorted(["rune"])
}
getRuneEffects() {
return this.getItemSorted(["runeeffect"])
}
getProfil() {
return this.getProfils()[0] ?? null
}
getTraitsChaotiques() {
return this.getItemSorted(["traitchaotique"])
}
getTraitsEspeces() {
return this.getItemSorted(["traitespece"])
}
/* -------------------------------------------- */
getAspect() {
return (this.system.balance.loi > this.system.balance.chaos) ? this.system.balance.loi : this.system.balance.chaos
}
getMarge() {
return Math.abs(this.system.balance.loi - this.system.balance.chaos)
}
getAlignement() {
return (this.system.balance.loi > this.system.balance.chaos) ? "loyal" : "chaotique"
}
/* -------------------------------------------- */
getSkills() {
let comp = []
for (let item of this.items) {
item = foundry.utils.duplicate(item)
if (item.type == "competence") {
item.system.attribut1total = item.system.niveau + (this.system.attributs[item.system.attribut1]?.value || 0)
item.system.attribut2total = item.system.niveau + (this.system.attributs[item.system.attribut2]?.value || 0)
item.system.attribut3total = item.system.niveau + (this.system.attributs[item.system.attribut3]?.value || 0)
if (item.system.niveau == 0) {
item.system.attribut1total -= 3
item.system.attribut2total -= 3
item.system.attribut3total -= 3
}
item.system.attribut1label = this.system.attributs[item.system.attribut1]?.label || ""
item.system.attribut2label = this.system.attributs[item.system.attribut2]?.label || ""
item.system.attribut3label = this.system.attributs[item.system.attribut3]?.label || ""
comp.push(item)
}
}
MournbladeCYD2Utility.sortArrayObjectsByName(comp)
return comp
}
/* ----------------------- --------------------- */
addMember(actorId) {
let members = foundry.utils.duplicate(this.system.members)
members.push({ id: actorId })
this.update({ 'system.members': members })
}
async removeMember(actorId) {
let members = this.system.members.filter(it => it.id != actorId)
this.update({ 'system.members': members })
}
/* -------------------------------------------- */
getDefenseBase() {
return Math.max(this.system.attributs.tre.value, this.system.attributs.adr.value)
}
/* -------------------------------------------- */
getVitesseBase() {
return 5 + __vitesseBonus[this.system.attributs.adr.value]
}
/* -------------------------------------------- */
getProtection() {
let equipProtection = 0
for (let armor of this.items) {
if (armor.type == "protection" && armor.system.equipped) {
equipProtection += Number(armor.system.protection)
}
}
if (equipProtection < 4) {
return 4 + equipProtection // Cas des boucliers + sans armure
}
return equipProtection // Uniquement la protection des armures + boucliers
}
getProtectionTotal() {
return this.getProtection()
}
/* -------------------------------------------- */
getCombatValues() {
let combat = {
initBase: this.system.attributs.adr.value,
initTotal: this.system.attributs.adr.value + this.system.combat.initbonus,
bonusDegats: this.getBonusDegats(),
bonusDegatsTotal: this.getBonusDegats() + this.system.combat.bonusdegats,
vitesseBase: this.getVitesseBase(),
vitesseTotal: this.getVitesseBase() + this.system.combat.vitessebonus,
defenseBase: this.getDefenseBase(),
protection: this.getProtection(),
defenseTotal: this.getDefenseBase() + this.system.combat.defensebonus + this.getProtection() - this.getTotalAdversite() + (this.system.combat.defensetotale ? 3 : 0)
}
return combat
}
/* -------------------------------------------- */
async prepareData() {
super.prepareData();
}
/* -------------------------------------------- */
prepareDerivedData() {
if (this.type == 'personnage') {
let talentBonus = this.getVigueurBonus()
let vigueur = Math.floor((this.system.attributs.pui.value + this.system.attributs.tre.value) / 2) + talentBonus + this.system.sante.vigueurmodifier
if (vigueur != this.system.sante.vigueur) {
this.update({ 'system.sante.vigueur': vigueur })
}
let seuilPouvoirBonus = this.getSeuilPouvoirBonus()
let seuilPouvoir = Math.floor((this.system.attributs.tre.value + this.system.attributs.cla.value) / 2) + seuilPouvoirBonus + this.system.ame.seuilpouvoirmodifier
if (seuilPouvoir != this.system.ame.seuilpouvoir) {
this.update({ 'system.ame.seuilpouvoir': seuilPouvoir })
}
}
super.prepareDerivedData()
}
/* -------------------------------------------- */
_preUpdate(changed, options, user) {
if (changed?.system?.sante?.etat !== undefined && changed.system.sante.etat != this.system.sante.etat) {
const oldEtat = this.system.sante.etat
setTimeout(() => {
this.processCombativite(changed.system.sante, oldEtat)
}, 800)
}
if (changed?.system?.ame?.etat !== undefined && changed.system.ame.etat != this.system.ame.etat) {
// L'état d'Âme ne peut pas être inférieur au minimum (max dans le système)
let minAme = this.system.ame.max !== undefined ? this.system.ame.max : 0
if (changed.system.ame.etat < minAme) {
changed.system.ame.etat = minAme
}
// L'état d'Âme ne peut pas dépasser nbame (Brisé)
if (changed.system.ame.etat > this.system.ame.nbame) {
changed.system.ame.etat = this.system.ame.nbame
}
const oldEtat = this.system.ame.etat
setTimeout(() => {
this.processAme(changed.system.ame, oldEtat)
}, 800)
}
// Si le max d'Âme change, ajuster l'état actuel si nécessaire
if (changed?.system?.ame?.max !== undefined && changed.system.ame.max != this.system.ame.max) {
if (this.system.ame.etat < changed.system.ame.max) {
changed.system.ame.etat = changed.system.ame.max
}
}
super._preUpdate(changed, options, user);
}
/* -------------------------------------------- */
_onUpdate(data, options, user) {
super._onUpdate(data, options, user);
}
/* -------------------------------------------- */
getItemById(id) {
let item = this.items.find(item => item.id == id);
if (item) {
item = foundry.utils.duplicate(item)
}
return item;
}
/* -------------------------------------------- */
async equipItem(itemId) {
let item = this.items.find(item => item.id == itemId)
if (item && item.system) {
let update = { _id: item.id, "system.equipped": !item.system.equipped }
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
editItemField(itemId, itemType, itemField, dataType, value) {
let item = this.items.find(item => item.id == itemId)
if (item) {
console.log("Item ", item, itemField, dataType, value)
if (dataType.toLowerCase() == "number") {
value = Number(value)
} else {
value = String(value)
}
let update = { _id: item.id, [`system.${itemField}`]: value };
this.updateEmbeddedDocuments("Item", [update])
}
}
/* -------------------------------------------- */
checkAttribut(attribut, minLevel) {
let attr = this.system.attributs.find(at => at.labelnorm == attribut.toLowerCase())
if (attr && attr.value >= minLevel) {
return { isValid: true, attr: foundry.utils.duplicate(attr) }
}
return { isValid: false }
}
/* -------------------------------------------- */
checkAttributOrCompetenceLevel(compName, minLevel) {
let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase() && i.system.niveau >= minLevel)
if (comp) {
return { isValid: true, item: foundry.utils.duplicate(comp) }
} else {
for (let attrKey in this.system.attributs) {
if (this.system.attributs[attrKey].label.toLowerCase() == compName.toLowerCase() && this.system.attributs[attrKey].value >= minLevel) {
return { isValid: true, item: foundry.utils.duplicate(this.system.attributs[attrKey]) }
}
}
}
return { isValid: false, warningMessage: `Prérequis insuffisant : la compétence/attribut ${compName} doit être de niveau ${minLevel} au minimum` }
}
/* -------------------------------------------- */
addCompetenceBonus(compName, bonus, baCost) {
let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase())
if (comp) {
comp = foundry.utils.duplicate(comp)
comp.system.bonus = bonus
comp.system.baCost = baCost
return { isValid: true, item: comp }
}
return { isValid: false, warningMessage: `Compétence ${compName} non trouvée` }
}
/* -------------------------------------------- */
checkIfCompetence(compName) {
let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase())
if (comp) {
return { isValid: true, item: comp }
}
return { isValid: false }
}
/* -------------------------------------------- */
getVigueur() {
return this.system.sante.vigueur
}
/* -------------------------------------------- */
getVigueurBonus() {
let talents = this.items.filter(item => item.type == "talent" && item.system.isautomated)
let bonus = 0
for (let talent of talents) {
for (let auto of talent.system.automations) {
if (auto.eventtype == "bonus-permanent" && auto.bonusname == "vigueur") {
bonus += Number(auto.bonus || 0)
}
}
}
return bonus
}
/* -------------------------------------------- */
getSeuilPouvoir() {
return this.system.ame.seuilpouvoir
}
/* -------------------------------------------- */
getSeuilPouvoirBonus() {
let talents = this.items.filter(item => item.type == "talent" && item.system.isautomated)
let bonus = 0
for (let talent of talents) {
for (let auto of talent.system.automations) {
if (auto.eventtype == "bonus-permanent" && auto.bonusname == "seuilpouvoir") {
bonus += Number(auto.bonus || 0)
}
}
}
return bonus
}
/* -------------------------------------------- */
getAmeMax() {
// Utiliser une vérification stricte car 0 (Serein) est une valeur valide
return this.system.ame.max !== undefined ? this.system.ame.max : this.system.ame.nbame
}
/* -------------------------------------------- */
getBonneAventure() {
return this.system.bonneaventure.actuelle
}
/* -------------------------------------------- */
checkBonneAventure(cost) {
return (this.system.bonneaventure.actuelle >= cost)
}
/* -------------------------------------------- */
changeBonneAventure(value) {
let newBA = this.system.bonneaventure.actuelle
newBA += value
this.update({ 'system.bonneaventure.actuelle': newBA })
}
/* -------------------------------------------- */
getEclat() {
return this.system.eclat.value
}
/* -------------------------------------------- */
changeEclat(value) {
let newE = this.system.eclat.value
newE += value
this.update({ 'system.eclat.value': newE })
}
/* -------------------------------------------- */
compareName(a, b) {
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
}
/* -------------------------------------------- */
getAttribute(attrKey) {
return this.system.attributes[attrKey]
}
/* -------------------------------------------- */
getBonusDegats() {
return 0;
}
/* -------------------------------------------- */
changeEtatCombativite(value) {
if (value === "vaincu") {
value = 200
}
let sante = foundry.utils.duplicate(this.system.sante)
sante.etat += Number(value)
sante.etat = Math.max(sante.etat, 0)
sante.etat = Math.min(sante.etat, this.system.sante.nbcombativite)
this.update({ 'system.sante': sante })
if (sante.etat == this.system.sante.nbcombativite) {
ChatMessage.create({ content: `<strong>${this.name} est vaincu !</strong>` })
}
// Duplicated ! this.processCombativite(sante)
}
/* -------------------------------------------- */
changeEtatAme(value) {
if (value === "brise") {
value = 200
}
let ame = foundry.utils.duplicate(this.system.ame)
ame.etat += Number(value)
// L'état ne peut pas être inférieur au minimum (max dans le système)
let minAme = this.system.ame.max !== undefined ? this.system.ame.max : 0
ame.etat = Math.max(ame.etat, minAme)
// L'état ne peut pas dépasser nbame (Brisé)
ame.etat = Math.min(ame.etat, this.system.ame.nbame)
this.update({ 'system.ame': ame })
if (ame.etat >= this.system.ame.nbame) {
ChatMessage.create({ content: `<strong>${this.name} est brisé !</strong>` })
}
}
/* -------------------------------------------- */
processCombativite(sante, oldEtat = undefined) {
sante = sante || foundry.utils.duplicate(this.system.sante)
const affaibli = this.system.sante.nbcombativite - 2
const tresAffaibli = this.system.sante.nbcombativite - 1
// oldEtat permet de détecter les sauts qui franchissent Affaibli ou Très Affaibli
// sans y atterrir exactement (ex: 0 → 5 doit déclencher les deux seuils)
const prev = oldEtat !== undefined ? oldEtat : sante.etat
const curr = sante.etat
const passedAffaibli = curr >= affaibli && prev < affaibli
const passedTresAffaibli = curr >= tresAffaibli && prev < tresAffaibli
if (passedAffaibli) {
if (this.items.find(item => item.type == "talent" && item.name.toLowerCase() == "encaissement")) {
ChatMessage.create({ content: `<strong>${this.name} ne subit pas les 2 adversités rouge (Affaibli) grâce à Encaissement. Pensez à les ajouter à la fin de la scène !</strong>` })
} else {
ChatMessage.create({ content: `<strong>${this.name} est Affaibli et subit 2 adversités rouge !</strong>` })
this.incDecAdversite("rouge", 2)
}
}
if (passedTresAffaibli) {
if (this.items.find(item => item.type == "talent" && item.name.toLowerCase().includes("vaillant"))) {
ChatMessage.create({ content: `<strong>${this.name} ne subit pas les 2 adversités rouge (Très Affaibli) grâce à Vaillant. Pensez à les ajouter à la fin de la scène !</strong>` })
} else {
ChatMessage.create({ content: `<strong>${this.name} est Très Affaibli et subit 2 adversités rouge supplémentaires !</strong>` })
this.incDecAdversite("rouge", 2)
}
}
}
/* -------------------------------------------- */
processAme(ame, oldEtat = undefined) {
ame = ame || foundry.utils.duplicate(this.system.ame)
const traumatiseValue = this.system.ame.nbame - 2
const tresTraumatiseValue = this.system.ame.nbame - 1
const briseValue = this.system.ame.nbame
const prev = oldEtat !== undefined ? oldEtat : ame.etat
const curr = ame.etat
// Déclencher pour chaque seuil franchi ou atteint, même en cas de saut
if (curr >= traumatiseValue && prev < traumatiseValue) {
ChatMessage.create({ content: `<strong>${this.name} est Traumatisé et subit 1 adversité bleue et 1 adversité noire !</strong>` })
this.incDecAdversite("bleue", 1)
this.incDecAdversite("noire", 1)
}
if (curr >= tresTraumatiseValue && prev < tresTraumatiseValue) {
ChatMessage.create({ content: `<strong>${this.name} est Très Traumatisé et subit 1 adversité bleue et 1 adversité noire !</strong>` })
this.incDecAdversite("bleue", 1)
this.incDecAdversite("noire", 1)
}
if (curr >= briseValue && prev < briseValue) {
ChatMessage.create({ content: `<strong>${this.name} est Brisé et subit 1 adversité noire !</strong>` })
this.incDecAdversite("noire", 1)
}
}
/* -------------------------------------------- */
async equipGear(equipmentId) {
let item = this.items.find(item => item.id == equipmentId);
if (item?.system?.data) {
let update = { _id: item.id, "system.equipped": !item.system.equipped };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
getSubActors() {
let subActors = [];
for (let id of this.system.subactors) {
subActors.push(foundry.utils.duplicate(game.actors.get(id)));
}
return subActors;
}
/* -------------------------------------------- */
async addSubActor(subActorId) {
let subActors = foundry.utils.duplicate(this.system.subactors);
subActors.push(subActorId);
await this.update({ 'system.subactors': subActors });
}
/* -------------------------------------------- */
async delSubActor(subActorId) {
let newArray = [];
for (let id of this.system.subactors) {
if (id != subActorId) {
newArray.push(id);
}
}
await this.update({ 'system.subactors': newArray });
}
/* -------------------------------------------- */
getTotalAdversite() {
return this.system.adversite.bleue + this.system.adversite.rouge + this.system.adversite.noire
}
/* -------------------------------------------- */
async incDecAdversite(adv, incDec = 0) {
let adversite = foundry.utils.duplicate(this.system.adversite)
adversite[adv] += Number(incDec)
adversite[adv] = Math.max(adversite[adv], 0)
adversite[adv] = Math.min(adversite[adv], 20)
this.update({ 'system.adversite': adversite })
}
/* -------------------------------------------- */
async incDecQuantity(objetId, incDec = 0) {
let objetQ = this.items.get(objetId)
if (objetQ) {
let newQ = objetQ.system.quantite + incDec
newQ = Math.max(newQ, 0)
await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantite': newQ }]); // pdates one EmbeddedEntity
}
}
/* -------------------------------------------- */
computeRichesse() {
let valueSC = 0
for (let monnaie of this.items) {
if (monnaie.type == "monnaie") {
valueSC += Number(monnaie.system.prixsc) * Number(monnaie.system.quantite)
}
}
return MournbladeCYD2Utility.computeMonnaieDetails(valueSC)
}
/* -------------------------------------------- */
computeValeurEquipement() {
let valueSC = 0
for (let equip of this.items) {
if (equip.type == "equipement" || equip.type == "arme" || equip.type == "protection") {
valueSC += Number(equip.system.prixsc) * Number(equip.system.quantite ?? 1)
valueSC += (Number(equip.system.prixca) * Number(equip.system.quantite ?? 1)) * 20
valueSC += (Number(equip.system.prixpo) * Number(equip.system.quantite ?? 1)) * 400
}
}
return MournbladeCYD2Utility.computeMonnaieDetails(valueSC)
}
/* -------------------------------------------- */
getCompetence(compId) {
return this.items.get(compId)
}
/* -------------------------------------------- */
async setPredilectionUsed(compId, predIdx) {
let comp = this.items.get(compId)
let pred = foundry.utils.duplicate(comp.system.predilections)
pred[predIdx].used = true
await this.updateEmbeddedDocuments('Item', [{ _id: compId, 'system.predilections': pred }])
}
/* -------------------------------------------- */
getInitiativeScore() {
let init = this.getFlag("world", "last-initiative")
return init || -1
}
/* -------------------------------------------- */
getBestAttackValue() {
let attackList = this.items.filter(item => (item.type == "arme" || item.type == "talent") && item.system.equipped)
let maxOff = 0
let bestArme
for (let arme of attackList) {
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
if (arme.system.totalOffensif > maxOff) {
maxOff = arme.system.totalOffensif
bestArme = foundry.utils.duplicate(arme)
}
}
return bestArme
}
/* -------------------------------------------- */
getBestDefenseValue() {
let defenseList = this.items.filter(item => (item.type == "arme") && item.system.equipped)
let maxDef = 0
let bestArme
for (let arme of defenseList) {
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
if (arme.system.totalDefensif > maxDef) {
maxDef = arme.system.totalDefensif
bestArme = foundry.utils.duplicate(arme)
}
}
return bestArme
}
/* -------------------------------------------- */
searchRelevantTalents(competence) {
let talents = []
for (let talent of this.items) {
if (talent.type == "talent" && talent.system.isautomated && talent.system.automations.length > 0) {
for (let auto of talent.system.automations) {
if (auto.eventtype === "prepare-roll") {
if (auto.competence.toLowerCase() == competence.name.toLowerCase()) {
talent = foundry.utils.duplicate(talent)
talent.system.bonus = auto.bonus
talent.system.baCost = auto.baCost
talents.push(talent)
}
}
}
}
}
return talents
}
/* -------------------------------------------- */
buildListeAdversites() {
return []
}
/* -------------------------------------------- */
getCommonRollData(attrKey = undefined, compId = undefined, compName = undefined) {
let rollData = MournbladeCYD2Utility.getBasicRollData()
rollData.alias = this.name
rollData.actorImg = this.img
rollData.actorId = this.id
rollData.tokenId = this.token?.id
rollData.img = this.img
rollData.attributs = MournbladeCYD2Utility.getAttributs()
rollData.maitriseId = "none"
rollData.nbEclat = this.system.eclat.value
rollData.nbBA = this.system.bonneaventure.actuelle
rollData.nbAdversites = this.getTotalAdversite()
rollData.talents = []
rollData.attrKey2 = "none"
rollData.coupDevastateur = this.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup dévastateur" && !it.system.used)
rollData.hasAmbidextre = this.items.find(it => it.type == "talent" && it.name.toLowerCase() == "ambidextre")
rollData.hasFeinte = this.system.bonneaventure.actuelle > 0 && this.items.find(it => it.type == "talent" && it.name.toLowerCase() == "feinte")
rollData.isMonte = this.system.combat.monte
rollData.config = game.system.mournbladecyd2.config
if (attrKey) {
rollData.attrKey = attrKey
if (attrKey != "tochoose") {
rollData.actionImg = "systems/fvtt-mournblade-cyd-2-0/assets/icons/" + this.system.attributs[attrKey].labelnorm + ".webp"
rollData.attr = foundry.utils.duplicate(this.system.attributs[attrKey])
}
}
if (compId) {
rollData.competence = foundry.utils.duplicate(this.items.get(compId) || {})
let maitrises = [{ key: "none", label: "Aucune" }]
rollData.competence.system.predilections.forEach(function (item) {
if (item.maitrise) {
maitrises.push({ key: item.id, label: item.name });
}
})
rollData.maitrises = maitrises // rollData.competence.system.predilections.filter(p => p.maitrise)
rollData.actionImg = rollData.competence?.img
rollData.talents = this.searchRelevantTalents(rollData.competence)
}
if (compName) {
rollData.competence = foundry.utils.duplicate(this.items.find(item => item.name.toLowerCase() == compName.toLowerCase()) || {})
rollData.actionImg = rollData.competence?.img
}
return rollData
}
/* -------------------------------------------- */
async rollAttribut(attrKey, isInit = false) {
let rollData = this.getCommonRollData(attrKey)
rollData.multiplier = (isInit) ? 1 : 2
rollData.isInit = isInit
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollCompetence(attrKey, compId) {
let rollData = this.getCommonRollData(attrKey, compId)
rollData.multiplier = 1 // Attr multiplier, always 1 in competence mode
console.log("RollDatra", rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollArmeOffensif(armeId) {
let arme = this.items.get(armeId)
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
let rollData = this.getCommonRollData(arme.system.attrKey, arme.system.competence._id)
rollData.arme = arme
MournbladeCYD2Utility.updateWithTarget(rollData)
console.log("ARME!", rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollAssommer() {
let rollData = this.getCommonRollData("pui", undefined, "Filouterie")
rollData.assomer = true
rollData.conditionsCommunes = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollCoupBas() {
let rollData = this.getCommonRollData("pui", undefined, "Mêlée")
rollData.coupBas = true
rollData.conditionsCommunes = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollImmobiliser() {
let rollData = this.getCommonRollData("pui", undefined, "Mêlée")
rollData.immobiliser = true
rollData.conditionsCommunes = true
rollData.cibleconsciente = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollRepousser() {
let rollData = this.getCommonRollData("pui", undefined, "Mêlée")
rollData.repousser = true
rollData.conditionsCommunes = true
rollData.cibleconsciente = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollDesengager() {
let rollData = this.getCommonRollData("adr", undefined, "Mouvements")
rollData.desengager = true
rollData.conditionsCommunes = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollArmeDegats(armeId, targetVigueur = undefined, rollDataInput = undefined) {
let arme = this.items.get(armeId)
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
console.log("DEGATS", arme, targetVigueur, rollDataInput)
let roll
let bonus = 0
let bonus2 = 0
if (rollDataInput?.applyCoupDevastateur) {
bonus2 = Math.floor(this.system.attributs.pui.value / 2)
let talent = this.items.find(item => item.type == "talent" && item.name.toLowerCase() == "coup dévastateur")
this.updateEmbeddedDocuments('Item', [{ _id: talent.id, 'system.used': true }])
}
if (rollDataInput?.isHeroique) {
if (rollDataInput?.attaqueCharge) {
bonus = 5
}
if (rollDataInput?.chargeCavalerie) {
bonus = 6
}
roll = await new Roll("2d10rr10+" + arme.system.totalDegats + "+" + bonus + "+" + bonus2).roll()
} else {
if (rollDataInput?.attaqueCharge) {
bonus = 3
}
if (rollDataInput?.chargeCavalerie) {
bonus = 4
}
roll = await new Roll("1d10+" + arme.system.totalDegats + "+" + bonus + "+" + bonus2).roll()
}
await MournbladeCYD2Utility.showDiceSoNice(roll, game.settings.get("core", "rollMode"));
// CYD 2.0: états SUPPLÉMENTAIRES au-delà du -1 automatique à la réussite.
// Math.floor(total/SV) = 0 (<SV), 1 (≥SV), 2 (≥2×SV) → totaux finaux : 1, 2, 3
let nbEtatPerdus = 0
if (targetVigueur) {
nbEtatPerdus = Math.floor(roll.total / targetVigueur)
}
//console.log(roll)
let rollData = {
arme: arme,
finalResult: roll.total,
formula: roll.formula,
alias: this.name,
actorImg: this.img,
actorId: this.id,
defenderTokenId: rollDataInput?.defenderTokenId,
actionImg: arme.img,
targetVigueur: targetVigueur,
nbEtatPerdus: nbEtatPerdus
}
MournbladeCYD2Utility.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-mournblade-cyd-2-0/templates/chat-degats-result.hbs`, rollData)
})
if (rollDataInput?.defenderTokenId && nbEtatPerdus) {
MournbladeCYD2Utility.applyCombativite(rollDataInput, nbEtatPerdus)
}
}
}
@@ -1,916 +0,0 @@
/* -------------------------------------------- */
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2RollDialog } from "./applications/mournblade-cyd2-roll-dialog.mjs";
/* -------------------------------------------- */
const __degatsBonus = [-2, -2, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10]
const __vitesseBonus = [-2, -2, -1, -1, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8]
/* -------------------------------------------- */
/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
* @extends {Actor}
*/
export class MournbladeCYD2Actor extends Actor {
/* -------------------------------------------- */
/**
* Override the create() function to provide additional SoS functionality.
*
* This overrided create() function adds initial items
* Namely: Basic skills, money,
*
* @param {Object} data Barebones actor data which this function adds onto.
* @param {Object} options (Unused) Additional options which customize the creation workflow.
*
*/
static async create(data, options) {
// Case of compendium global import
if (data instanceof Array) {
return super.create(data, options);
}
// If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic
if (data.items) {
let actor = super.create(data, options);
return actor;
}
if (data.type == 'personnage') {
console.log("Loading skills for personnage")
const skills = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd-2-0.skills")
data.items = skills.map(i => i.toObject())
}
if (data.type == 'creature') {
const skills = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd-2-0.skills-creatures")
data.items = skills.map(i => i.toObject())
data.items.push({ name: "Arme naturelle 1", type: 'arme', img: "systems/fvtt-mournblade-cyd-2-0/assets/icons/melee.webp", system: { typearme: "contact", bonusmaniementoff: 0, seuildefense: 0, degats: "0" } })
data.items.push({ name: "Arme naturelle 2", type: 'arme', img: "systems/fvtt-mournblade-cyd-2-0/assets/icons/melee.webp", system: { typearme: "contact", bonusmaniementoff: 0, seuildefense: 0, degats: "0" } })
}
return super.create(data, options);
}
/* -------------------------------------------- */
getBonusDefenseFromTalents() {
let talents = this.items.filter(item => item.type == "talent" && item.system.isautomated)
let bonus = 0
for (let talent of talents) {
for (let auto of talent.system.automations) {
if (auto.eventtype == "bonus-permanent" && auto.bonusname == "bonus-defensif") {
bonus += Number(auto.bonus || 0)
}
}
}
return bonus
}
/* -------------------------------------------- */
prepareArme(arme) {
arme = foundry.utils.duplicate(arme)
let combat = this.getCombatValues()
if (arme.system.typearme == "contact" || arme.system.typearme == "contactjet") {
let bonusDefense = this.getBonusDefenseFromTalents()
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée"))
arme.system.attrKey = "pui"
arme.system.totalDegats = arme.system.degats + "+" + combat.bonusDegatsTotal
arme.system.totalOffensif = this.system.attributs.pui.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff + (this.system.combat.monte ? 3 : 0)
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.seuildefense + bonusDefense + (this.system.combat.monte ? 3 : 0)
console.log("Arme", arme.system.totalDefensif, combat, arme.system.competence.system.niveau, arme.system.seuildefense, bonusDefense)
arme.system.isdefense = true
arme.system.isMelee = true
arme.system.isDistance = false
}
if (arme.system.typearme == "jet" || arme.system.typearme == "tir") {
arme.system.competence = foundry.utils.duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "armes à distance"))
arme.system.attrKey = "adr"
arme.system.totalOffensif = this.system.attributs.adr.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff
arme.system.totalDegats = arme.system.degats
arme.system.isMelee = false
arme.system.isDistance = true
if (arme.system.isdefense) {
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.seuildefense
}
}
return arme
}
/* -------------------------------------------- */
getItemSorted(types) {
let items = this.items.filter(item => types.includes(item.type)) || []
MournbladeCYD2Utility.sortArrayObjectsByName(items)
return items
}
getWeapons() {
let armes = []
for (let arme of this.items) {
if (arme.type == "arme") {
armes.push(this.prepareArme(arme))
}
}
MournbladeCYD2Utility.sortArrayObjectsByName(armes)
return armes
}
getMonnaies() {
return this.getItemSorted(["monnaie"])
}
getEquipments() {
return this.getItemSorted(["equipement"])
}
getArmors() {
return this.getItemSorted(["protection"])
}
getHistoriques() {
return this.getItemSorted(["historique"])
}
getProfils() {
return this.getItemSorted(["profil"])
}
getTalents() {
return this.getItemSorted(["talent"])
}
getRessources() {
return this.getItemSorted(["ressource"])
}
getDons() {
return this.getItemSorted(["don"])
}
getPactes() {
return this.getItemSorted(["pacte"])
}
getTendances() {
return this.getItemSorted(["tendance"])
}
getRunes() {
return this.getItemSorted(["rune"])
}
getRuneEffects() {
return this.getItemSorted(["runeeffect"])
}
getProfil() {
return this.getProfils()[0] ?? null
}
getTraitsChaotiques() {
return this.getItemSorted(["traitchaotique"])
}
getTraitsEspeces() {
return this.getItemSorted(["traitespece"])
}
/* -------------------------------------------- */
getAspect() {
return (this.system.balance.loi > this.system.balance.chaos) ? this.system.balance.loi : this.system.balance.chaos
}
getMarge() {
return Math.abs(this.system.balance.loi - this.system.balance.chaos)
}
getAlignement() {
return (this.system.balance.loi > this.system.balance.chaos) ? "loyal" : "chaotique"
}
/* -------------------------------------------- */
getSkills() {
let comp = []
for (let item of this.items) {
item = foundry.utils.duplicate(item)
if (item.type == "competence") {
item.system.attribut1total = item.system.niveau + (this.system.attributs[item.system.attribut1]?.value || 0)
item.system.attribut2total = item.system.niveau + (this.system.attributs[item.system.attribut2]?.value || 0)
item.system.attribut3total = item.system.niveau + (this.system.attributs[item.system.attribut3]?.value || 0)
if (item.system.niveau == 0) {
item.system.attribut1total -= 3
item.system.attribut2total -= 3
item.system.attribut3total -= 3
}
item.system.attribut1label = this.system.attributs[item.system.attribut1]?.label || ""
item.system.attribut2label = this.system.attributs[item.system.attribut2]?.label || ""
item.system.attribut3label = this.system.attributs[item.system.attribut3]?.label || ""
comp.push(item)
}
}
MournbladeCYD2Utility.sortArrayObjectsByName(comp)
return comp
}
/* ----------------------- --------------------- */
addMember(actorId) {
let members = foundry.utils.duplicate(this.system.members)
members.push({ id: actorId })
this.update({ 'system.members': members })
}
async removeMember(actorId) {
let members = this.system.members.filter(it => it.id != actorId)
this.update({ 'system.members': members })
}
/* -------------------------------------------- */
getDefenseBase() {
return Math.max(this.system.attributs.tre.value, this.system.attributs.adr.value)
}
/* -------------------------------------------- */
getVitesseBase() {
return 5 + __vitesseBonus[this.system.attributs.adr.value]
}
/* -------------------------------------------- */
getProtection() {
let equipProtection = 0
for (let armor of this.items) {
if (armor.type == "protection" && armor.system.equipped) {
equipProtection += Number(armor.system.protection)
}
}
if (equipProtection < 4) {
return 4 + equipProtection // Cas des boucliers + sans armure
}
return equipProtection // Uniquement la protection des armures + boucliers
}
getProtectionTotal() {
return this.getProtection()
}
/* -------------------------------------------- */
getCombatValues() {
let combat = {
initBase: this.system.attributs.adr.value,
initTotal: this.system.attributs.adr.value + this.system.combat.initbonus,
bonusDegats: this.getBonusDegats(),
bonusDegatsTotal: this.getBonusDegats() + this.system.combat.bonusdegats,
vitesseBase: this.getVitesseBase(),
vitesseTotal: this.getVitesseBase() + this.system.combat.vitessebonus,
defenseBase: this.getDefenseBase(),
protection: this.getProtection(),
defenseTotal: this.getDefenseBase() + this.system.combat.defensebonus + this.getProtection() - this.getTotalAdversite() + (this.system.combat.defensetotale ? 3 : 0)
}
return combat
}
/* -------------------------------------------- */
async prepareData() {
super.prepareData();
}
/* -------------------------------------------- */
prepareDerivedData() {
if (this.type == 'personnage') {
let talentBonus = this.getVigueurBonus()
let vigueur = Math.floor((this.system.attributs.pui.value + this.system.attributs.tre.value) / 2) + talentBonus + this.system.sante.vigueurmodifier
if (vigueur != this.system.sante.vigueur) {
this.update({ 'system.sante.vigueur': vigueur })
}
let seuilPouvoirBonus = this.getSeuilPouvoirBonus()
let seuilPouvoir = Math.floor((this.system.attributs.tre.value + this.system.attributs.cla.value) / 2) + seuilPouvoirBonus + this.system.ame.seuilpouvoirmodifier
if (seuilPouvoir != this.system.ame.seuilpouvoir) {
this.update({ 'system.ame.seuilpouvoir': seuilPouvoir })
}
}
super.prepareDerivedData()
}
/* -------------------------------------------- */
_preUpdate(changed, options, user) {
if (changed?.system?.sante?.etat !== undefined && changed.system.sante.etat != this.system.sante.etat) {
const oldEtat = this.system.sante.etat
setTimeout(() => {
this.processCombativite(changed.system.sante, oldEtat)
}, 800)
}
if (changed?.system?.ame?.etat !== undefined && changed.system.ame.etat != this.system.ame.etat) {
// L'état d'Âme ne peut pas être inférieur au minimum (max dans le système)
let minAme = this.system.ame.max !== undefined ? this.system.ame.max : 0
if (changed.system.ame.etat < minAme) {
changed.system.ame.etat = minAme
}
// L'état d'Âme ne peut pas dépasser nbame (Brisé)
if (changed.system.ame.etat > this.system.ame.nbame) {
changed.system.ame.etat = this.system.ame.nbame
}
const oldEtat = this.system.ame.etat
setTimeout(() => {
this.processAme(changed.system.ame, oldEtat)
}, 800)
}
// Si le max d'Âme change, ajuster l'état actuel si nécessaire
if (changed?.system?.ame?.max !== undefined && changed.system.ame.max != this.system.ame.max) {
if (this.system.ame.etat < changed.system.ame.max) {
changed.system.ame.etat = changed.system.ame.max
}
}
super._preUpdate(changed, options, user);
}
/* -------------------------------------------- */
_onUpdate(data, options, user) {
super._onUpdate(data, options, user);
}
/* -------------------------------------------- */
getItemById(id) {
let item = this.items.find(item => item.id == id);
if (item) {
item = foundry.utils.duplicate(item)
}
return item;
}
/* -------------------------------------------- */
async equipItem(itemId) {
let item = this.items.find(item => item.id == itemId)
if (item && item.system) {
let update = { _id: item.id, "system.equipped": !item.system.equipped }
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
editItemField(itemId, itemType, itemField, dataType, value) {
let item = this.items.find(item => item.id == itemId)
if (item) {
console.log("Item ", item, itemField, dataType, value)
if (dataType.toLowerCase() == "number") {
value = Number(value)
} else {
value = String(value)
}
let update = { _id: item.id, [`system.${itemField}`]: value };
this.updateEmbeddedDocuments("Item", [update])
}
}
/* -------------------------------------------- */
checkAttribut(attribut, minLevel) {
let attr = this.system.attributs.find(at => at.labelnorm == attribut.toLowerCase())
if (attr && attr.value >= minLevel) {
return { isValid: true, attr: foundry.utils.duplicate(attr) }
}
return { isValid: false }
}
/* -------------------------------------------- */
checkAttributOrCompetenceLevel(compName, minLevel) {
let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase() && i.system.niveau >= minLevel)
if (comp) {
return { isValid: true, item: foundry.utils.duplicate(comp) }
} else {
for (let attrKey in this.system.attributs) {
if (this.system.attributs[attrKey].label.toLowerCase() == compName.toLowerCase() && this.system.attributs[attrKey].value >= minLevel) {
return { isValid: true, item: foundry.utils.duplicate(this.system.attributs[attrKey]) }
}
}
}
return { isValid: false, warningMessage: `Prérequis insuffisant : la compétence/attribut ${compName} doit être de niveau ${minLevel} au minimum` }
}
/* -------------------------------------------- */
addCompetenceBonus(compName, bonus, baCost) {
let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase())
if (comp) {
comp = foundry.utils.duplicate(comp)
comp.system.bonus = bonus
comp.system.baCost = baCost
return { isValid: true, item: comp }
}
return { isValid: false, warningMessage: `Compétence ${compName} non trouvée` }
}
/* -------------------------------------------- */
checkIfCompetence(compName) {
let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase())
if (comp) {
return { isValid: true, item: comp }
}
return { isValid: false }
}
/* -------------------------------------------- */
getVigueur() {
return this.system.sante.vigueur
}
/* -------------------------------------------- */
getVigueurBonus() {
let talents = this.items.filter(item => item.type == "talent" && item.system.isautomated)
let bonus = 0
for (let talent of talents) {
for (let auto of talent.system.automations) {
if (auto.eventtype == "bonus-permanent" && auto.bonusname == "vigueur") {
bonus += Number(auto.bonus || 0)
}
}
}
return bonus
}
/* -------------------------------------------- */
getSeuilPouvoir() {
return this.system.ame.seuilpouvoir
}
/* -------------------------------------------- */
getSeuilPouvoirBonus() {
let talents = this.items.filter(item => item.type == "talent" && item.system.isautomated)
let bonus = 0
for (let talent of talents) {
for (let auto of talent.system.automations) {
if (auto.eventtype == "bonus-permanent" && auto.bonusname == "seuilpouvoir") {
bonus += Number(auto.bonus || 0)
}
}
}
return bonus
}
/* -------------------------------------------- */
getAmeMax() {
// Utiliser une vérification stricte car 0 (Serein) est une valeur valide
return this.system.ame.max !== undefined ? this.system.ame.max : this.system.ame.nbame
}
/* -------------------------------------------- */
getBonneAventure() {
return this.system.bonneaventure.actuelle
}
/* -------------------------------------------- */
checkBonneAventure(cost) {
return (this.system.bonneaventure.actuelle >= cost)
}
/* -------------------------------------------- */
changeBonneAventure(value) {
let newBA = this.system.bonneaventure.actuelle
newBA += value
this.update({ 'system.bonneaventure.actuelle': newBA })
}
/* -------------------------------------------- */
getEclat() {
return this.system.eclat.value
}
/* -------------------------------------------- */
changeEclat(value) {
let newE = this.system.eclat.value
newE += value
this.update({ 'system.eclat.value': newE })
}
/* -------------------------------------------- */
compareName(a, b) {
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
}
/* -------------------------------------------- */
getAttribute(attrKey) {
return this.system.attributes[attrKey]
}
/* -------------------------------------------- */
getBonusDegats() {
return 0;
}
/* -------------------------------------------- */
changeEtatCombativite(value) {
if (value === "vaincu") {
value = 200
}
let sante = foundry.utils.duplicate(this.system.sante)
sante.etat += Number(value)
sante.etat = Math.max(sante.etat, 0)
sante.etat = Math.min(sante.etat, this.system.sante.nbcombativite)
this.update({ 'system.sante': sante })
if (sante.etat == this.system.sante.nbcombativite) {
ChatMessage.create({ content: `<strong>${this.name} est vaincu !</strong>` })
}
// Duplicated ! this.processCombativite(sante)
}
/* -------------------------------------------- */
changeEtatAme(value) {
if (value === "brise") {
value = 200
}
let ame = foundry.utils.duplicate(this.system.ame)
ame.etat += Number(value)
// L'état ne peut pas être inférieur au minimum (max dans le système)
let minAme = this.system.ame.max !== undefined ? this.system.ame.max : 0
ame.etat = Math.max(ame.etat, minAme)
// L'état ne peut pas dépasser nbame (Brisé)
ame.etat = Math.min(ame.etat, this.system.ame.nbame)
this.update({ 'system.ame': ame })
if (ame.etat >= this.system.ame.nbame) {
ChatMessage.create({ content: `<strong>${this.name} est brisé !</strong>` })
}
}
/* -------------------------------------------- */
processCombativite(sante, oldEtat = undefined) {
sante = sante || foundry.utils.duplicate(this.system.sante)
const affaibli = this.system.sante.nbcombativite - 2
const tresAffaibli = this.system.sante.nbcombativite - 1
// oldEtat permet de détecter les sauts qui franchissent Affaibli ou Très Affaibli
// sans y atterrir exactement (ex: 0 → 5 doit déclencher les deux seuils)
const prev = oldEtat !== undefined ? oldEtat : sante.etat
const curr = sante.etat
const passedAffaibli = curr >= affaibli && prev < affaibli
const passedTresAffaibli = curr >= tresAffaibli && prev < tresAffaibli
if (passedAffaibli) {
if (this.items.find(item => item.type == "talent" && item.name.toLowerCase() == "encaissement")) {
ChatMessage.create({ content: `<strong>${this.name} ne subit pas les 2 adversités rouge (Affaibli) grâce à Encaissement. Pensez à les ajouter à la fin de la scène !</strong>` })
} else {
ChatMessage.create({ content: `<strong>${this.name} est Affaibli et subit 2 adversités rouge !</strong>` })
this.incDecAdversite("rouge", 2)
}
}
if (passedTresAffaibli) {
if (this.items.find(item => item.type == "talent" && item.name.toLowerCase().includes("vaillant"))) {
ChatMessage.create({ content: `<strong>${this.name} ne subit pas les 2 adversités rouge (Très Affaibli) grâce à Vaillant. Pensez à les ajouter à la fin de la scène !</strong>` })
} else {
ChatMessage.create({ content: `<strong>${this.name} est Très Affaibli et subit 2 adversités rouge supplémentaires !</strong>` })
this.incDecAdversite("rouge", 2)
}
}
}
/* -------------------------------------------- */
processAme(ame, oldEtat = undefined) {
ame = ame || foundry.utils.duplicate(this.system.ame)
const traumatiseValue = this.system.ame.nbame - 2
const tresTraumatiseValue = this.system.ame.nbame - 1
const briseValue = this.system.ame.nbame
const prev = oldEtat !== undefined ? oldEtat : ame.etat
const curr = ame.etat
// Déclencher pour chaque seuil franchi ou atteint, même en cas de saut
if (curr >= traumatiseValue && prev < traumatiseValue) {
ChatMessage.create({ content: `<strong>${this.name} est Traumatisé et subit 1 adversité bleue et 1 adversité noire !</strong>` })
this.incDecAdversite("bleue", 1)
this.incDecAdversite("noire", 1)
}
if (curr >= tresTraumatiseValue && prev < tresTraumatiseValue) {
ChatMessage.create({ content: `<strong>${this.name} est Très Traumatisé et subit 1 adversité bleue et 1 adversité noire !</strong>` })
this.incDecAdversite("bleue", 1)
this.incDecAdversite("noire", 1)
}
if (curr >= briseValue && prev < briseValue) {
ChatMessage.create({ content: `<strong>${this.name} est Brisé et subit 1 adversité noire !</strong>` })
this.incDecAdversite("noire", 1)
}
}
/* -------------------------------------------- */
async equipGear(equipmentId) {
let item = this.items.find(item => item.id == equipmentId);
if (item?.system?.data) {
let update = { _id: item.id, "system.equipped": !item.system.equipped };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
getSubActors() {
let subActors = [];
for (let id of this.system.subactors) {
subActors.push(foundry.utils.duplicate(game.actors.get(id)));
}
return subActors;
}
/* -------------------------------------------- */
async addSubActor(subActorId) {
let subActors = foundry.utils.duplicate(this.system.subactors);
subActors.push(subActorId);
await this.update({ 'system.subactors': subActors });
}
/* -------------------------------------------- */
async delSubActor(subActorId) {
let newArray = [];
for (let id of this.system.subactors) {
if (id != subActorId) {
newArray.push(id);
}
}
await this.update({ 'system.subactors': newArray });
}
/* -------------------------------------------- */
getTotalAdversite() {
return this.system.adversite.bleue + this.system.adversite.rouge + this.system.adversite.noire
}
/* -------------------------------------------- */
async incDecAdversite(adv, incDec = 0) {
let adversite = foundry.utils.duplicate(this.system.adversite)
adversite[adv] += Number(incDec)
adversite[adv] = Math.max(adversite[adv], 0)
adversite[adv] = Math.min(adversite[adv], 20)
this.update({ 'system.adversite': adversite })
}
/* -------------------------------------------- */
async incDecQuantity(objetId, incDec = 0) {
let objetQ = this.items.get(objetId)
if (objetQ) {
let newQ = objetQ.system.quantite + incDec
newQ = Math.max(newQ, 0)
await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantite': newQ }]); // pdates one EmbeddedEntity
}
}
/* -------------------------------------------- */
computeRichesse() {
let valueSC = 0
for (let monnaie of this.items) {
if (monnaie.type == "monnaie") {
valueSC += Number(monnaie.system.prixsc) * Number(monnaie.system.quantite)
}
}
return MournbladeCYD2Utility.computeMonnaieDetails(valueSC)
}
/* -------------------------------------------- */
computeValeurEquipement() {
let valueSC = 0
for (let equip of this.items) {
if (equip.type == "equipement" || equip.type == "arme" || equip.type == "protection") {
valueSC += Number(equip.system.prixsc) * Number(equip.system.quantite ?? 1)
valueSC += (Number(equip.system.prixca) * Number(equip.system.quantite ?? 1)) * 20
valueSC += (Number(equip.system.prixpo) * Number(equip.system.quantite ?? 1)) * 400
}
}
return MournbladeCYD2Utility.computeMonnaieDetails(valueSC)
}
/* -------------------------------------------- */
getCompetence(compId) {
return this.items.get(compId)
}
/* -------------------------------------------- */
async setPredilectionUsed(compId, predIdx) {
let comp = this.items.get(compId)
let pred = foundry.utils.duplicate(comp.system.predilections)
pred[predIdx].used = true
await this.updateEmbeddedDocuments('Item', [{ _id: compId, 'system.predilections': pred }])
}
/* -------------------------------------------- */
getInitiativeScore() {
let init = this.getFlag("world", "last-initiative")
return init || -1
}
/* -------------------------------------------- */
getBestAttackValue() {
let attackList = this.items.filter(item => (item.type == "arme" || item.type == "talent") && item.system.equipped)
let maxOff = 0
let bestArme
for (let arme of attackList) {
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
if (arme.system.totalOffensif > maxOff) {
maxOff = arme.system.totalOffensif
bestArme = foundry.utils.duplicate(arme)
}
}
return bestArme
}
/* -------------------------------------------- */
getBestDefenseValue() {
let defenseList = this.items.filter(item => (item.type == "arme") && item.system.equipped)
let maxDef = 0
let bestArme
for (let arme of defenseList) {
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
if (arme.system.totalDefensif > maxDef) {
maxDef = arme.system.totalDefensif
bestArme = foundry.utils.duplicate(arme)
}
}
return bestArme
}
/* -------------------------------------------- */
searchRelevantTalents(competence) {
let talents = []
for (let talent of this.items) {
if (talent.type == "talent" && talent.system.isautomated && talent.system.automations.length > 0) {
for (let auto of talent.system.automations) {
if (auto.eventtype === "prepare-roll") {
if (auto.competence.toLowerCase() == competence.name.toLowerCase()) {
talent = foundry.utils.duplicate(talent)
talent.system.bonus = auto.bonus
talent.system.baCost = auto.baCost
talents.push(talent)
}
}
}
}
}
return talents
}
/* -------------------------------------------- */
buildListeAdversites() {
return []
}
/* -------------------------------------------- */
getCommonRollData(attrKey = undefined, compId = undefined, compName = undefined) {
let rollData = MournbladeCYD2Utility.getBasicRollData()
rollData.alias = this.name
rollData.actorImg = this.img
rollData.actorId = this.id
rollData.tokenId = this.token?.id
rollData.img = this.img
rollData.attributs = MournbladeCYD2Utility.getAttributs()
rollData.maitriseId = "none"
rollData.nbEclat = this.system.eclat.value
rollData.nbBA = this.system.bonneaventure.actuelle
rollData.nbAdversites = this.getTotalAdversite()
rollData.talents = []
rollData.attrKey2 = "none"
rollData.coupDevastateur = this.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup dévastateur" && !it.system.used)
rollData.hasAmbidextre = this.items.find(it => it.type == "talent" && it.name.toLowerCase() == "ambidextre")
rollData.hasFeinte = this.system.bonneaventure.actuelle > 0 && this.items.find(it => it.type == "talent" && it.name.toLowerCase() == "feinte")
rollData.isMonte = this.system.combat.monte
rollData.config = game.system.mournbladecyd2.config
if (attrKey) {
rollData.attrKey = attrKey
if (attrKey != "tochoose") {
rollData.actionImg = "systems/fvtt-mournblade-cyd-2-0/assets/icons/" + this.system.attributs[attrKey].labelnorm + ".webp"
rollData.attr = foundry.utils.duplicate(this.system.attributs[attrKey])
}
}
if (compId) {
rollData.competence = foundry.utils.duplicate(this.items.get(compId) || {})
let maitrises = [{ key: "none", label: "Aucune" }]
rollData.competence.system.predilections.forEach(function (item) {
if (item.maitrise) {
maitrises.push({ key: item.id, label: item.name });
}
})
rollData.maitrises = maitrises // rollData.competence.system.predilections.filter(p => p.maitrise)
rollData.actionImg = rollData.competence?.img
rollData.talents = this.searchRelevantTalents(rollData.competence)
}
if (compName) {
rollData.competence = foundry.utils.duplicate(this.items.find(item => item.name.toLowerCase() == compName.toLowerCase()) || {})
rollData.actionImg = rollData.competence?.img
}
return rollData
}
/* -------------------------------------------- */
async rollAttribut(attrKey, isInit = false) {
let rollData = this.getCommonRollData(attrKey)
rollData.multiplier = (isInit) ? 1 : 2
rollData.isInit = isInit
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollCompetence(attrKey, compId) {
let rollData = this.getCommonRollData(attrKey, compId)
rollData.multiplier = 1 // Attr multiplier, always 1 in competence mode
console.log("RollDatra", rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollArmeOffensif(armeId) {
let arme = this.items.get(armeId)
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
let rollData = this.getCommonRollData(arme.system.attrKey, arme.system.competence._id)
rollData.arme = arme
MournbladeCYD2Utility.updateWithTarget(rollData)
console.log("ARME!", rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollAssommer() {
let rollData = this.getCommonRollData("pui", undefined, "Filouterie")
rollData.assomer = true
rollData.conditionsCommunes = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollCoupBas() {
let rollData = this.getCommonRollData("pui", undefined, "Mêlée")
rollData.coupBas = true
rollData.conditionsCommunes = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollImmobiliser() {
let rollData = this.getCommonRollData("pui", undefined, "Mêlée")
rollData.immobiliser = true
rollData.conditionsCommunes = true
rollData.cibleconsciente = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollRepousser() {
let rollData = this.getCommonRollData("pui", undefined, "Mêlée")
rollData.repousser = true
rollData.conditionsCommunes = true
rollData.cibleconsciente = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollDesengager() {
let rollData = this.getCommonRollData("adr", undefined, "Mouvements")
rollData.desengager = true
rollData.conditionsCommunes = true
MournbladeCYD2Utility.updateWithTarget(rollData)
let rollDialog = await MournbladeCYD2RollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollArmeDegats(armeId, targetVigueur = undefined, rollDataInput = undefined) {
let arme = this.items.get(armeId)
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
console.log("DEGATS", arme, targetVigueur, rollDataInput)
let roll
let bonus = 0
let bonus2 = 0
if (rollDataInput?.applyCoupDevastateur) {
bonus2 = Math.floor(this.system.attributs.pui.value / 2)
let talent = this.items.find(item => item.type == "talent" && item.name.toLowerCase() == "coup dévastateur")
this.updateEmbeddedDocuments('Item', [{ _id: talent.id, 'system.used': true }])
}
if (rollDataInput?.isHeroique) {
if (rollDataInput?.attaqueCharge) {
bonus = 5
}
if (rollDataInput?.chargeCavalerie) {
bonus = 6
}
roll = await new Roll("2d10rr10+" + arme.system.totalDegats + "+" + bonus + "+" + bonus2).roll()
} else {
if (rollDataInput?.attaqueCharge) {
bonus = 3
}
if (rollDataInput?.chargeCavalerie) {
bonus = 4
}
roll = await new Roll("1d10+" + arme.system.totalDegats + "+" + bonus + "+" + bonus2).roll()
}
await MournbladeCYD2Utility.showDiceSoNice(roll, game.settings.get("core", "rollMode"));
// CYD 2.0: états SUPPLÉMENTAIRES au-delà du -1 automatique à la réussite.
// Math.floor(total/SV) = 0 (<SV), 1 (≥SV), 2 (≥2×SV) → totaux finaux : 1, 2, 3
let nbEtatPerdus = 0
if (targetVigueur) {
nbEtatPerdus = Math.floor(roll.total / targetVigueur)
}
//console.log(roll)
let rollData = {
arme: arme,
finalResult: roll.total,
formula: roll.formula,
alias: this.name,
actorImg: this.img,
actorId: this.id,
defenderTokenId: rollDataInput?.defenderTokenId,
actionImg: arme.img,
targetVigueur: targetVigueur,
nbEtatPerdus: nbEtatPerdus
}
MournbladeCYD2Utility.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-mournblade-cyd-2-0/templates/chat-degats-result.hbs`, rollData)
})
if (rollDataInput?.defenderTokenId && nbEtatPerdus) {
MournbladeCYD2Utility.applyCombativite(rollDataInput, nbEtatPerdus)
}
}
}
@@ -1,144 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{key: "contact", label: "Arme de contact"},
{key: "contactjet", label: "Arme de contact et de Jet"},
{key: "jet", label: "Arme de Jet"},
{key: "tir", label: "Arme de Tir"}
],
optionsArtefactBranche: [
{key: "alchimie", label: "Alchimie"},
{key: "biologie", label: "Biologie"},
{key: "electricite", label: "Electricité"},
{key: "mecanique", label: "Mécanique"},
{key: "scienceesprit", label: "Science de l'Esprit"}
],
optionsArtefactBranche2: [
{key: "none", label: "Aucune"},
{key: "alchimie", label: "Alchimie"},
{key: "biologie", label: "Biologie"},
{key: "electricite", label: "Electricité"},
{key: "mecanique", label: "Mécanique"},
{key: "scienceesprit", label: "Science de l'Esprit"}
],
optionsTypeContact: [
{key: "contact", label: "Contact"},
{key: "allie", label: "Allié"}
],
optionsTypeMutation: [
{key: "tares_communes", label: "Tares et Malformations communes"},
{key: "evolutions_communes", label: "Evolutions communes"},
{key: "tares_rares", label: "Tares et Malformations rares"},
{key: "evolutions_rares", label: "Evolutions rares"},
{key: "tares_majeures", label: "Tares et Maformations majeures"},
{key: "evolutions_majeures", label: "Evolutions majeures"},
{key: "tares_except", label: "Tares et Malformations exceptionnelles"},
{key: "evolutions_except", label: "Evolutions exceptionnelles"}
],
optionsTypeTalent: [
{key: "personnage", label: "Personnage"},
{key: "cellule", label: "Cellule"},
{key: "traitespece", label: "Trait d'espèce"}
],
optionsUseTalent: [
{key: "permanent", label: "Permanent"},
{key: "sceance", label: "Une fois par scéance"},
{key: "scenario", label: "Une fois par scénario"},
{key: "jour", label: "Une fois par jour"},
{key: "unique", label: "Unique"}
],
optionsAutomationEvent: [
{key: "on-drop", label: "Drop sur l'acteur"},
{key: "prepare-roll", label: "Préparation d'un jet"},
{key: "bonus-permanent", label: "Bonus permanent"}
],
optionsBonusPermanent: [
{key: "vigueur", label: "Vigueur"},
{key: "seuilpouvoir", label: "Seuil de Pouvoir"},
{key: "bonus-defensif", label: "Bonus au Seuil de Défense"}
]
}
@@ -1,144 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsArtefactBranche: [
{ key: "alchimie", label: "Alchimie" },
{ key: "biologie", label: "Biologie" },
{ key: "electricite", label: "Electricité" },
{ key: "mecanique", label: "Mécanique" },
{ key: "scienceesprit", label: "Science de l'Esprit" }
],
optionsArtefactBranche2: [
{ key: "none", label: "Aucune" },
{ key: "alchimie", label: "Alchimie" },
{ key: "biologie", label: "Biologie" },
{ key: "electricite", label: "Electricité" },
{ key: "mecanique", label: "Mécanique" },
{ key: "scienceesprit", label: "Science de l'Esprit" }
],
optionsTypeContact: [
{ key: "contact", label: "Contact" },
{ key: "allie", label: "Allié" }
],
optionsTypeMutation: [
{ key: "tares_communes", label: "Tares et Malformations communes" },
{ key: "evolutions_communes", label: "Evolutions communes" },
{ key: "tares_rares", label: "Tares et Malformations rares" },
{ key: "evolutions_rares", label: "Evolutions rares" },
{ key: "tares_majeures", label: "Tares et Maformations majeures" },
{ key: "evolutions_majeures", label: "Evolutions majeures" },
{ key: "tares_except", label: "Tares et Malformations exceptionnelles" },
{ key: "evolutions_except", label: "Evolutions exceptionnelles" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "cellule", label: "Cellule" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,143 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsArtefactBranche: [
{ key: "alchimie", label: "Alchimie" },
{ key: "biologie", label: "Biologie" },
{ key: "electricite", label: "Electricité" },
{ key: "mecanique", label: "Mécanique" },
{ key: "scienceesprit", label: "Science de l'Esprit" }
],
optionsArtefactBranche2: [
{ key: "none", label: "Aucune" },
{ key: "alchimie", label: "Alchimie" },
{ key: "biologie", label: "Biologie" },
{ key: "electricite", label: "Electricité" },
{ key: "mecanique", label: "Mécanique" },
{ key: "scienceesprit", label: "Science de l'Esprit" }
],
optionsTypeContact: [
{ key: "contact", label: "Contact" },
{ key: "allie", label: "Allié" }
],
optionsTypeMutation: [
{ key: "tares_communes", label: "Tares et Malformations communes" },
{ key: "evolutions_communes", label: "Evolutions communes" },
{ key: "tares_rares", label: "Tares et Malformations rares" },
{ key: "evolutions_rares", label: "Evolutions rares" },
{ key: "tares_majeures", label: "Tares et Maformations majeures" },
{ key: "evolutions_majeures", label: "Evolutions majeures" },
{ key: "tares_except", label: "Tares et Malformations exceptionnelles" },
{ key: "evolutions_except", label: "Evolutions exceptionnelles" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,143 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsArtefactBranche: [
{ key: "alchimie", label: "Alchimie" },
{ key: "biologie", label: "Biologie" },
{ key: "electricite", label: "Electricité" },
{ key: "mecanique", label: "Mécanique" },
{ key: "scienceesprit", label: "Science de l'Esprit" }
],
optionsArtefactBranche2: [
{ key: "none", label: "Aucune" },
{ key: "alchimie", label: "Alchimie" },
{ key: "biologie", label: "Biologie" },
{ key: "electricite", label: "Electricité" },
{ key: "mecanique", label: "Mécanique" },
{ key: "scienceesprit", label: "Science de l'Esprit" }
],
optionsTypeContact: [
{ key: "contact", label: "Contact" },
{ key: "allie", label: "Allié" }
],
optionsTypeMutation: [
{ key: "tares_communes", label: "Tares et Malformations communes" },
{ key: "evolutions_communes", label: "Evolutions communes" },
{ key: "tares_rares", label: "Tares et Malformations rares" },
{ key: "evolutions_rares", label: "Evolutions rares" },
{ key: "tares_majeures", label: "Tares et Maformations majeures" },
{ key: "evolutions_majeures", label: "Evolutions majeures" },
{ key: "tares_except", label: "Tares et Malformations exceptionnelles" },
{ key: "evolutions_except", label: "Evolutions exceptionnelles" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,128 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeContact: [
{ key: "contact", label: "Contact" },
{ key: "allie", label: "Allié" }
],
optionsTypeMutation: [
{ key: "tares_communes", label: "Tares et Malformations communes" },
{ key: "evolutions_communes", label: "Evolutions communes" },
{ key: "tares_rares", label: "Tares et Malformations rares" },
{ key: "evolutions_rares", label: "Evolutions rares" },
{ key: "tares_majeures", label: "Tares et Maformations majeures" },
{ key: "evolutions_majeures", label: "Evolutions majeures" },
{ key: "tares_except", label: "Tares et Malformations exceptionnelles" },
{ key: "evolutions_except", label: "Evolutions exceptionnelles" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,128 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeContact: [
{ key: "contact", label: "Contact" },
{ key: "allie", label: "Allié" }
],
optionsTypeMutation: [
{ key: "tares_communes", label: "Tares et Malformations communes" },
{ key: "evolutions_communes", label: "Evolutions communes" },
{ key: "tares_rares", label: "Tares et Malformations rares" },
{ key: "evolutions_rares", label: "Evolutions rares" },
{ key: "tares_majeures", label: "Tares et Maformations majeures" },
{ key: "evolutions_majeures", label: "Evolutions majeures" },
{ key: "tares_except", label: "Tares et Malformations exceptionnelles" },
{ key: "evolutions_except", label: "Evolutions exceptionnelles" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,118 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeContact: [
{ key: "contact", label: "Contact" },
{ key: "allie", label: "Allié" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,118 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeContact: [
{ key: "contact", label: "Contact" },
{ key: "allie", label: "Allié" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,114 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,114 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,121 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
allegeanceOptions: {
tous: game.i18n.localize("MNBL.all"),
chaos: game.i18n.localize("MNBL.chaos"),
loi: game.i18n.localize("MNBL.law"),
betes: game.i18n.localize("MNBL.beastslords"),
elementaires: game.i18n.localize("MNBL.elementslords")
}
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,121 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
allegeanceOptions: {
tous: game.i18n.localize("MNBL.all"),
chaos: game.i18n.localize("MNBL.chaos"),
loi: game.i18n.localize("MNBL.law"),
betes: game.i18n.localize("MNBL.beastslords"),
elementaires: game.i18n.localize("MNBL.elementslords")
},
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,129 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
allegeanceOptions: {
tous: game.i18n.localize("MNBL.all"),
chaos: game.i18n.localize("MNBL.chaos"),
loi: game.i18n.localize("MNBL.law"),
betes: game.i18n.localize("MNBL.beastslords"),
elementaires: game.i18n.localize("MNBL.elementslords")
},
lancementRuneOptions: {
prononcer: game.i18n.localize("MNBL.pronouncerune"),
inscrire: game.i18n.localize("MNBL.tracerune")
},
effetRuneOptions: {
prononcee: game.i18n.localize("MNBL.pronounced"),
inscrite: game.i18n.localize("MNBL.traced")
},
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,129 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
allegeanceOptions: {
tous: game.i18n.localize("MNBL.all"),
chaos: game.i18n.localize("MNBL.chaos"),
loi: game.i18n.localize("MNBL.law"),
betes: game.i18n.localize("MNBL.beastslords"),
elementaires: game.i18n.localize("MNBL.elementslords")
},
lancementRuneOptions: {
prononcer: game.i18n.localize("MNBL.pronouncerune"),
inscrire: game.i18n.localize("MNBL.tracerune")
},
effetRuneOptions: {
prononcee: game.i18n.localize("MNBL.pronounced"),
inscrite: game.i18n.localize("MNBL.traced")
},
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,129 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
allegeanceOptions: {
tous: game.i18n.localize("MNBL.all"),
chaos: game.i18n.localize("MNBL.chaos"),
loi: game.i18n.localize("MNBL.law"),
betes: game.i18n.localize("MNBL.beastslords"),
elementaires: game.i18n.localize("MNBL.elementslords")
},
lancementRuneOptions: {
prononcer: game.i18n.localize("MNBL.pronouncerune"),
inscrire: game.i18n.localize("MNBL.tracerune")
},
effetRuneOptions: {
prononcee: game.i18n.localize("MNBL.pronounced"),
inscrite: game.i18n.localize("MNBL.traced")
},
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,129 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
allegeanceOptions: {
tous: ,
chaos: game.i18n.localize("MNBL.chaos"),
loi: game.i18n.localize("MNBL.law"),
betes: game.i18n.localize("MNBL.beastslords"),
elementaires: game.i18n.localize("MNBL.elementslords")
},
lancementRuneOptions: {
prononcer: game.i18n.localize("MNBL.pronouncerune"),
inscrire: game.i18n.localize("MNBL.tracerune")
},
effetRuneOptions: {
prononcee: game.i18n.localize("MNBL.pronounced"),
inscrite: game.i18n.localize("MNBL.traced")
},
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,129 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
allegeanceOptions: {
tous: '',
chaos: game.i18n.localize("MNBL.chaos"),
loi: game.i18n.localize("MNBL.law"),
betes: game.i18n.localize("MNBL.beastslords"),
elementaires: game.i18n.localize("MNBL.elementslords")
},
lancementRuneOptions: {
prononcer: game.i18n.localize("MNBL.pronouncerune"),
inscrire: game.i18n.localize("MNBL.tracerune")
},
effetRuneOptions: {
prononcee: game.i18n.localize("MNBL.pronounced"),
inscrite: game.i18n.localize("MNBL.traced")
},
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,129 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
allegeanceOptions: {
tous: 'Tous',
chaos: game.i18n.localize("MNBL.chaos"),
loi: game.i18n.localize("MNBL.law"),
betes: game.i18n.localize("MNBL.beastslords"),
elementaires: game.i18n.localize("MNBL.elementslords")
},
lancementRuneOptions: {
prononcer: game.i18n.localize("MNBL.pronouncerune"),
inscrire: game.i18n.localize("MNBL.tracerune")
},
effetRuneOptions: {
prononcee: game.i18n.localize("MNBL.pronounced"),
inscrite: game.i18n.localize("MNBL.traced")
},
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,129 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
allegeanceOptions: {
tous: 'Tous',
chaos: 'Chaos',
loi: 'Loi',
betes: 'Seigneurs des Bêtes',
elementaires: 'Seigneurs des Eléments'
},
lancementRuneOptions: {
prononcer: game.i18n.localize("MNBL.pronouncerune"),
inscrire: game.i18n.localize("MNBL.tracerune")
},
effetRuneOptions: {
prononcee: game.i18n.localize("MNBL.pronounced"),
inscrite: game.i18n.localize("MNBL.traced")
},
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,129 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
allegeanceOptions: {
tous: 'Tous',
chaos: 'Chaos',
loi: 'Loi',
betes: 'Seigneurs des Bêtes',
elementaires: 'Seigneurs des Eléments'
},
lancementRuneOptions: {
prononcer: 'Prononcer',
inscrire: 'Tracer'
},
effetRuneOptions: {
prononcee: game.i18n.localize("MNBL.pronounced"),
inscrite: game.i18n.localize("MNBL.traced")
},
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,129 +0,0 @@
export const MOURNBLADECYD2_CONFIG = {
allegeanceOptions: {
tous: 'Tous',
chaos: 'Chaos',
loi: 'Loi',
betes: 'Seigneurs des Bêtes',
elementaires: 'Seigneurs des Eléments'
},
lancementRuneOptions: {
prononcer: 'Prononcer',
inscrire: 'Tracer'
},
effetRuneOptions: {
prononcee: 'Prononcée',
inscrite: 'Inscrite'
},
optionsDifficulte: [
{ key: "0", label: "Aucune/Inconnue" },
{ key: "5", label: "Facile (5)" },
{ key: "6", label: "(6)" },
{ key: "7", label: "(7)" },
{ key: "8", label: "(8)" },
{ key: "9", label: "(9)" },
{ key: "10", label: "Moyenne (10)" },
{ key: "11", label: "(11)" },
{ key: "12", label: "(12)" },
{ key: "13", label: "(13)" },
{ key: "14", label: "(14)" },
{ key: "15", label: "Ardue (15)" },
{ key: "16", label: "(16)" },
{ key: "17", label: "(17)" },
{ key: "18", label: "(18)" },
{ key: "19", label: "(19)" },
{ key: "20", label: "Hasardeuse (20)" },
{ key: "21", label: "(21)" },
{ key: "22", label: "(22)" },
{ key: "23", label: "(23)" },
{ key: "24", label: "(24)" },
{ key: "25", label: "Insensée (25)" },
{ key: "26", label: "(26)" },
{ key: "27", label: "(27)" },
{ key: "28", label: "(28)" },
{ key: "29", label: "(29)" },
{ key: "30", label: "Pure Folie (30)" }
],
optionsDistanceTir: [
{ key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" },
{ key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" },
{ key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" }
],
optionsBonusMalus: [
{ key: "-10", label: "-10" },
{ key: "-9", label: "-9" },
{ key: "-8", label: "-8" },
{ key: "-7", label: "-7" },
{ key: "-6", label: "-6" },
{ key: "-5", label: "-5" },
{ key: "-4", label: "-4" },
{ key: "-3", label: "-3" },
{ key: "-2", label: "-2" },
{ key: "-1", label: "-1" },
{ key: "0", label: "0" },
{ key: "1", label: "+1" },
{ key: "2", label: "+2" },
{ key: "3", label: "+3" },
{ key: "4", label: "+4" },
{ key: "5", label: "+5" },
{ key: "6", label: "+6" },
{ key: "7", label: "+7" },
{ key: "8", label: "+8" },
{ key: "9", label: "+9" },
{ key: "10", label: "+10" }
],
optionsTailleCible: [
{ key: "normal", label: "Normal (SD+0)" },
{ key: "main", label: "Main (SD+10)" },
{ key: "enfant", label: "Enfant (SD+3)" },
{ key: "maison", label: "Maison (SD-10)" }
],
optionsCouvert: [
{ key: "aucun", label: "Aucun" },
{ key: "leger", label: "Léger (SD+5)" },
{ key: "complet", label: "Quasi complet (SD+10)" }
],
optionsTireurDeplacement: [
{ key: "immobile", label: "Immobile (SD+0)" },
{ key: "lent", label: "Lent (SD+3)" },
{ key: "rapide", label: "Rapide (SD+5)" }
],
optionsSoutiens: [
{ key: "0", label: "Aucun" },
{ key: "1", label: "Un soutien (+3)" },
{ key: "2", label: "Deux soutiens (+4)" },
{ key: "3", label: "Trois soutiens (+5)" }
],
optionsStatutResistant: [
{ key: "commun", label: "Commun" },
{ key: "clandestin", label: "Clandestin" },
{ key: "insurge", label: "Insurgé" }
],
optionsTypeArme: [
{ key: "contact", label: "Arme de contact" },
{ key: "contactjet", label: "Arme de contact et de Jet" },
{ key: "jet", label: "Arme de Jet" },
{ key: "tir", label: "Arme de Tir" }
],
optionsTypeTalent: [
{ key: "personnage", label: "Personnage" },
{ key: "traitespece", label: "Trait d'espèce" }
],
optionsUseTalent: [
{ key: "permanent", label: "Permanent" },
{ key: "sceance", label: "Une fois par scéance" },
{ key: "scenario", label: "Une fois par scénario" },
{ key: "jour", label: "Une fois par jour" },
{ key: "unique", label: "Unique" }
],
optionsAutomationEvent: [
{ key: "on-drop", label: "Drop sur l'acteur" },
{ key: "prepare-roll", label: "Préparation d'un jet" },
{ key: "bonus-permanent", label: "Bonus permanent" }
],
optionsBonusPermanent: [
{ key: "vigueur", label: "Vigueur" },
{ key: "seuilpouvoir", label: "Seuil de Pouvoir" },
{ key: "bonus-defensif", label: "Bonus au Seuil de Défense" }
]
}
@@ -1,228 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2ItemSheet extends foundry.appv1.sheets.ItemSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "item"],
template: "systems/fvtt-mournblade-cyd2/templates/item-sheet.html",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
// Add "Post to chat" button
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
buttons.unshift(
{
class: "post",
icon: "fas fa-comment",
onclick: ev => { }
})
return buttons
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
if (this.item.type.includes('weapon')) {
position.width = 640;
}
return position;
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: this.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
attributs: MournbladeCYD2Utility.getAttributs(),
system: objectData.system,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
mr: (this.object.type == 'specialisation'),
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
if ( objectData.type == "don") {
formData.sacrifice = await TextEditor.enrichHTML(this.object.system.sacrifice, {async: true})
}
//this.options.editable = !(this.object.origin == "embeddedItem");
console.log("ITEM DATA", formData, this);
return formData;
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({
class: "post",
icon: "fas fa-comment",
onclick: ev => this.postItem()
});
return buttons
}
/* -------------------------------------------- */
postItem() {
let chatData = foundry.utils.duplicate(MournbladeCYD2Utility.data(this.item));
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
// Don't post any image for the item (which would leave a large gap) if the default image is used
if (chatData.img.includes("/blank.png")) {
chatData.img = null;
}
// JSON object for easy creation
chatData.jsondata = JSON.stringify(
{
compendium: "postedItem",
payload: chatData,
});
renderTemplate('systems/fvtt-mournblade-cyd2/templates/post-item.html', chatData).then(html => {
let chatOptions = MournbladeCYD2Utility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
const item = this.object.options.actor.getOwnedItem(li.data("item-id"))
item.sheet.render(true);
});
html.find('.delete-subitem').click(ev => {
this.deleteSubitem(ev);
})
html.find('.edit-predilection').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].name = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.edit-predilection-description').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].description = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-acquise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].acquise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-maitrise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].maitrise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-used').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].used = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-predilection').click(ev => {
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred.push( { name: "Nouvelle prédilection", id: randomID(16), used: false })
this.object.update( { 'system.predilections': pred })
})
html.find('.delete-prediction').click(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred.splice(index,1)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-automation').click(ev => {
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.push( { eventtype: "on-drop", name: "Automatisation 1", bonusname: "vigueur", bonus: 0, competence: "", minLevel: 0, baCost: 0, id: randomID(16) })
this.object.update( { 'system.automations': autom })
})
html.find('.delete-automation').click(ev => {
const li = $(ev.currentTarget).parents(".automation-item")
let index = li.data("automation-index")
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.splice(index,1)
this.object.update( { 'system.automations': autom })
})
html.find('.automation-edit-field').change(ev => {
let index = $(ev.currentTarget).data("automation-index")
let field = $(ev.currentTarget).data("automation-field")
let auto = foundry.utils.duplicate(this.object.system.automations)
auto[index][field] = ev.currentTarget.value
auto[index].id = auto[index].id || randomID(16)
this.object.update( { 'system.automations': auto })
})
// Update Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
let itemType = li.data("item-type");
});
}
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/fvtt-mournblade-cyd2/templates/item-${type}-sheet.html`;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
return this.object.update(formData);
}
}
@@ -1,228 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2ItemSheet extends foundry.appv1.sheets.ItemSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "item"],
template: "systems/fvtt-mournblade-cyd2/templates/item-sheet.html",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
// Add "Post to chat" button
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
buttons.unshift(
{
class: "post",
icon: "fas fa-comment",
onclick: ev => { }
})
return buttons
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
if (this.item.type.includes('weapon')) {
position.width = 640;
}
return position;
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: this.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
attributs: MournbladeCYD2Utility.getAttributs(),
system: objectData.system,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
description: await .window - app.enrichHTML(this.object.system.description, {async: true}),
mr: (this.object.type == 'specialisation'),
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
if ( objectData.type == "don") {
formData.sacrifice = await TextEditor.enrichHTML(this.object.system.sacrifice, {async: true})
}
//this.options.editable = !(this.object.origin == "embeddedItem");
console.log("ITEM DATA", formData, this);
return formData;
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({
class: "post",
icon: "fas fa-comment",
onclick: ev => this.postItem()
});
return buttons
}
/* -------------------------------------------- */
postItem() {
let chatData = foundry.utils.duplicate(MournbladeCYD2Utility.data(this.item));
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
// Don't post any image for the item (which would leave a large gap) if the default image is used
if (chatData.img.includes("/blank.png")) {
chatData.img = null;
}
// JSON object for easy creation
chatData.jsondata = JSON.stringify(
{
compendium: "postedItem",
payload: chatData,
});
renderTemplate('systems/fvtt-mournblade-cyd2/templates/post-item.html', chatData).then(html => {
let chatOptions = MournbladeCYD2Utility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
const item = this.object.options.actor.getOwnedItem(li.data("item-id"))
item.sheet.render(true);
});
html.find('.delete-subitem').click(ev => {
this.deleteSubitem(ev);
})
html.find('.edit-predilection').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].name = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.edit-predilection-description').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].description = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-acquise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].acquise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-maitrise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].maitrise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-used').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].used = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-predilection').click(ev => {
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred.push( { name: "Nouvelle prédilection", id: randomID(16), used: false })
this.object.update( { 'system.predilections': pred })
})
html.find('.delete-prediction').click(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred.splice(index,1)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-automation').click(ev => {
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.push( { eventtype: "on-drop", name: "Automatisation 1", bonusname: "vigueur", bonus: 0, competence: "", minLevel: 0, baCost: 0, id: randomID(16) })
this.object.update( { 'system.automations': autom })
})
html.find('.delete-automation').click(ev => {
const li = $(ev.currentTarget).parents(".automation-item")
let index = li.data("automation-index")
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.splice(index,1)
this.object.update( { 'system.automations': autom })
})
html.find('.automation-edit-field').change(ev => {
let index = $(ev.currentTarget).data("automation-index")
let field = $(ev.currentTarget).data("automation-field")
let auto = foundry.utils.duplicate(this.object.system.automations)
auto[index][field] = ev.currentTarget.value
auto[index].id = auto[index].id || randomID(16)
this.object.update( { 'system.automations': auto })
})
// Update Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
let itemType = li.data("item-type");
});
}
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/fvtt-mournblade-cyd2/templates/item-${type}-sheet.html`;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
return this.object.update(formData);
}
}
@@ -1,228 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2ItemSheet extends foundry.appv1.sheets.ItemSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "item"],
template: "systems/fvtt-mournblade-cyd2/templates/item-sheet.html",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
// Add "Post to chat" button
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
buttons.unshift(
{
class: "post",
icon: "fas fa-comment",
onclick: ev => { }
})
return buttons
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
if (this.item.type.includes('weapon')) {
position.width = 640;
}
return position;
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: this.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
attributs: MournbladeCYD2Utility.getAttributs(),
system: objectData.system,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
mr: (this.object.type == 'specialisation'),
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
if ( objectData.type == "don") {
formData.sacrifice = await TextEditor.enrichHTML(this.object.system.sacrifice, {async: true})
}
//this.options.editable = !(this.object.origin == "embeddedItem");
console.log("ITEM DATA", formData, this);
return formData;
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({
class: "post",
icon: "fas fa-comment",
onclick: ev => this.postItem()
});
return buttons
}
/* -------------------------------------------- */
postItem() {
let chatData = foundry.utils.duplicate(MournbladeCYD2Utility.data(this.item));
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
// Don't post any image for the item (which would leave a large gap) if the default image is used
if (chatData.img.includes("/blank.png")) {
chatData.img = null;
}
// JSON object for easy creation
chatData.jsondata = JSON.stringify(
{
compendium: "postedItem",
payload: chatData,
});
renderTemplate('systems/fvtt-mournblade-cyd2/templates/post-item.html', chatData).then(html => {
let chatOptions = MournbladeCYD2Utility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
const item = this.object.options.actor.getOwnedItem(li.data("item-id"))
item.sheet.render(true);
});
html.find('.delete-subitem').click(ev => {
this.deleteSubitem(ev);
})
html.find('.edit-predilection').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].name = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.edit-predilection-description').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].description = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-acquise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].acquise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-maitrise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].maitrise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-used').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].used = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-predilection').click(ev => {
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred.push( { name: "Nouvelle prédilection", id: randomID(16), used: false })
this.object.update( { 'system.predilections': pred })
})
html.find('.delete-prediction').click(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred.splice(index,1)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-automation').click(ev => {
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.push( { eventtype: "on-drop", name: "Automatisation 1", bonusname: "vigueur", bonus: 0, competence: "", minLevel: 0, baCost: 0, id: randomID(16) })
this.object.update( { 'system.automations': autom })
})
html.find('.delete-automation').click(ev => {
const li = $(ev.currentTarget).parents(".automation-item")
let index = li.data("automation-index")
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.splice(index,1)
this.object.update( { 'system.automations': autom })
})
html.find('.automation-edit-field').change(ev => {
let index = $(ev.currentTarget).data("automation-index")
let field = $(ev.currentTarget).data("automation-field")
let auto = foundry.utils.duplicate(this.object.system.automations)
auto[index][field] = ev.currentTarget.value
auto[index].id = auto[index].id || randomID(16)
this.object.update( { 'system.automations': auto })
})
// Update Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
let itemType = li.data("item-type");
});
}
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/fvtt-mournblade-cyd2/templates/item-${type}-sheet.html`;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
return this.object.update(formData);
}
}
@@ -1,228 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2ItemSheet extends foundry.appv1.sheets.ItemSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "item"],
template: "systems/fvtt-mournblade-cyd2/templates/item-sheet.html",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
// Add "Post to chat" button
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
buttons.unshift(
{
class: "post",
icon: "fas fa-comment",
onclick: ev => { }
})
return buttons
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
if (this.item.type.includes('weapon')) {
position.width = 640;
}
return position;
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: this.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
attributs: MournbladeCYD2Utility.getAttributs(),
system: objectData.system,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.description, {async: true}),
mr: (this.object.type == 'specialisation'),
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
if ( objectData.type == "don") {
formData.sacrifice = await TextEditor.enrichHTML(this.object.system.sacrifice, {async: true})
}
//this.options.editable = !(this.object.origin == "embeddedItem");
console.log("ITEM DATA", formData, this);
return formData;
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({
class: "post",
icon: "fas fa-comment",
onclick: ev => this.postItem()
});
return buttons
}
/* -------------------------------------------- */
postItem() {
let chatData = foundry.utils.duplicate(MournbladeCYD2Utility.data(this.item));
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
// Don't post any image for the item (which would leave a large gap) if the default image is used
if (chatData.img.includes("/blank.png")) {
chatData.img = null;
}
// JSON object for easy creation
chatData.jsondata = JSON.stringify(
{
compendium: "postedItem",
payload: chatData,
});
renderTemplate('systems/fvtt-mournblade-cyd2/templates/post-item.html', chatData).then(html => {
let chatOptions = MournbladeCYD2Utility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
const item = this.object.options.actor.getOwnedItem(li.data("item-id"))
item.sheet.render(true);
});
html.find('.delete-subitem').click(ev => {
this.deleteSubitem(ev);
})
html.find('.edit-predilection').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].name = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.edit-predilection-description').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].description = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-acquise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].acquise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-maitrise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].maitrise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-used').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].used = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-predilection').click(ev => {
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred.push( { name: "Nouvelle prédilection", id: randomID(16), used: false })
this.object.update( { 'system.predilections': pred })
})
html.find('.delete-prediction').click(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred.splice(index,1)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-automation').click(ev => {
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.push( { eventtype: "on-drop", name: "Automatisation 1", bonusname: "vigueur", bonus: 0, competence: "", minLevel: 0, baCost: 0, id: randomID(16) })
this.object.update( { 'system.automations': autom })
})
html.find('.delete-automation').click(ev => {
const li = $(ev.currentTarget).parents(".automation-item")
let index = li.data("automation-index")
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.splice(index,1)
this.object.update( { 'system.automations': autom })
})
html.find('.automation-edit-field').change(ev => {
let index = $(ev.currentTarget).data("automation-index")
let field = $(ev.currentTarget).data("automation-field")
let auto = foundry.utils.duplicate(this.object.system.automations)
auto[index][field] = ev.currentTarget.value
auto[index].id = auto[index].id || randomID(16)
this.object.update( { 'system.automations': auto })
})
// Update Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
let itemType = li.data("item-type");
});
}
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/fvtt-mournblade-cyd2/templates/item-${type}-sheet.html`;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
return this.object.update(formData);
}
}
@@ -1,228 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2ItemSheet extends foundry.appv1.sheets.ItemSheet {
/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["fvtt-mournblade-cyd2", "sheet", "item"],
template: "systems/fvtt-mournblade-cyd2/templates/item-sheet.html",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
// Add "Post to chat" button
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
buttons.unshift(
{
class: "post",
icon: "fas fa-comment",
onclick: ev => { }
})
return buttons
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
if (this.item.type.includes('weapon')) {
position.width = 640;
}
return position;
}
/* -------------------------------------------- */
async getData() {
const objectData = foundry.utils.duplicate(this.object)
let formData = {
title: this.title,
id: this.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
attributs: MournbladeCYD2Utility.getAttributs(),
system: objectData.system,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.description, {async: true}),
mr: (this.object.type == 'specialisation'),
isGM: game.user.isGM,
config: game.system.mournbladecyd2.config
}
if ( objectData.type == "don") {
formData.sacrifice = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.sacrifice, {async: true})
}
//this.options.editable = !(this.object.origin == "embeddedItem");
console.log("ITEM DATA", formData, this);
return formData;
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({
class: "post",
icon: "fas fa-comment",
onclick: ev => this.postItem()
});
return buttons
}
/* -------------------------------------------- */
postItem() {
let chatData = foundry.utils.duplicate(MournbladeCYD2Utility.data(this.item));
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
// Don't post any image for the item (which would leave a large gap) if the default image is used
if (chatData.img.includes("/blank.png")) {
chatData.img = null;
}
// JSON object for easy creation
chatData.jsondata = JSON.stringify(
{
compendium: "postedItem",
payload: chatData,
});
renderTemplate('systems/fvtt-mournblade-cyd2/templates/post-item.html', chatData).then(html => {
let chatOptions = MournbladeCYD2Utility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
const item = this.object.options.actor.getOwnedItem(li.data("item-id"))
item.sheet.render(true);
});
html.find('.delete-subitem').click(ev => {
this.deleteSubitem(ev);
})
html.find('.edit-predilection').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].name = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.edit-predilection-description').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].description = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-acquise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].acquise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-maitrise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].maitrise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-used').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred[index].used = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-predilection').click(ev => {
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred.push( { name: "Nouvelle prédilection", id: randomID(16), used: false })
this.object.update( { 'system.predilections': pred })
})
html.find('.delete-prediction').click(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = foundry.utils.duplicate(this.object.system.predilections)
pred.splice(index,1)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-automation').click(ev => {
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.push( { eventtype: "on-drop", name: "Automatisation 1", bonusname: "vigueur", bonus: 0, competence: "", minLevel: 0, baCost: 0, id: randomID(16) })
this.object.update( { 'system.automations': autom })
})
html.find('.delete-automation').click(ev => {
const li = $(ev.currentTarget).parents(".automation-item")
let index = li.data("automation-index")
let autom = foundry.utils.duplicate(this.object.system.automations)
autom.splice(index,1)
this.object.update( { 'system.automations': autom })
})
html.find('.automation-edit-field').change(ev => {
let index = $(ev.currentTarget).data("automation-index")
let field = $(ev.currentTarget).data("automation-field")
let auto = foundry.utils.duplicate(this.object.system.automations)
auto[index][field] = ev.currentTarget.value
auto[index].id = auto[index].id || randomID(16)
this.object.update( { 'system.automations': auto })
})
// Update Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
let itemType = li.data("item-type");
});
}
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/fvtt-mournblade-cyd2/templates/item-${type}-sheet.html`;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
return this.object.update(formData);
}
}
@@ -1,31 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
contact: "systems/fvtt-mournblade-cyd2/assets/icons/contacts.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
mutation: "systems/fvtt-mournblade-cyd2/assets/icons/mutation.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,31 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
contact: "systems/fvtt-mournblade-cyd2/assets/icons/contacts.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
mutation: "systems/fvtt-mournblade-cyd2/assets/icons/mutation.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,30 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
contact: "systems/fvtt-mournblade-cyd2/assets/icons/contacts.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,30 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
contact: "systems/fvtt-mournblade-cyd2/assets/icons/contacts.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,29 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,29 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,30 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
"trai"
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,30 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
"trait-chaotique": "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,34 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
"trait-chaotique": "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
"trait-espece": "systems/fvtt-mournblade-cyd2/assets/icons/trait-espece.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp"
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,34 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
"trait-chaotique": "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
"trait-espece": "systems/fvtt-mournblade-cyd2/assets/icons/trait-espece.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp"
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,30 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
"trait-chaotique": "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,34 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
"trait-chaotique": "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
"trait-espece": "systems/fvtt-mournblade-cyd2/assets/icons/trait-espece.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp"
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,34 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
"traitchaotique": "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
"trait-espece": "systems/fvtt-mournblade-cyd2/assets/icons/trait-espece.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp"
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,34 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
"traitchaotique": "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
"trai-espece": "systems/fvtt-mournblade-cyd2/assets/icons/trait-espece.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp"
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,33 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
"traitchaotique": "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp"
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,33 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
traitchaotique": "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp"
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,33 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
traitchaotique: "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp"
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,34 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
traitchaotique: "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,34 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
traitchaotique: "systems/fvtt-mournblade-cyd2/assets/icons/trait-chaotique.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp",
tendance: "systems/fvtt-mournblade-cyd2/assets/icons/tendance.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,34 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
traitchaotique: "systems/fvtt-mournblade-cyd2/assets/icons/traitchaotique.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp",
tendance: "systems/fvtt-mournblade-cyd2/assets/icons/tendance.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,35 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
traitchaotique: "systems/fvtt-mournblade-cyd2/assets/icons/traitchaotique.webp",
traitespece: "systems/fvtt-mournblade-cyd2/assets/icons/traitespece.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp",
tendance: "systems/fvtt-mournblade-cyd2/assets/icons/tendance.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,35 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
traitchaotique: "systems/fvtt-mournblade-cyd2/assets/icons/traitchaotique.webp",
traitespece: "systems/fvtt-mournblade-cyd2/assets/icons/v.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp",
tendance: "systems/fvtt-mournblade-cyd2/assets/icons/tendance.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,35 +0,0 @@
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-mournblade-cyd2/assets/icons/competence.webp",
arme: "systems/fvtt-mournblade-cyd2/assets/icons/melee.webp",
equipement: "systems/fvtt-mournblade-cyd2/assets/icons/equipement.webp",
monnaie: "systems/fvtt-mournblade-cyd2/assets/icons/monnaie.webp",
predilection: "systems/fvtt-mournblade-cyd2/assets/icons/predilection.webp",
protection: "systems/fvtt-mournblade-cyd2/assets/icons/protection.webp",
talent: "systems/fvtt-mournblade-cyd2/assets/icons/talent.webp",
historique: "systems/fvtt-mournblade-cyd2/assets/icons/historique.webp",
profil: "systems/fvtt-mournblade-cyd2/assets/icons/profil.webp",
ressource: "systems/fvtt-mournblade-cyd2/assets/icons/ressources.webp",
traitchaotique: "systems/fvtt-mournblade-cyd2/assets/icons/traitchaotique.webp",
traitespece: "systems/fvtt-mournblade-cyd2/assets/icons/traitespece.webp",
don: "systems/fvtt-mournblade-cyd2/assets/icons/don.webp",
pacte: "systems/fvtt-mournblade-cyd2/assets/icons/pacte.webp",
rune: "systems/fvtt-mournblade-cyd2/assets/icons/rune.webp",
tendance: "systems/fvtt-mournblade-cyd2/assets/icons/tendance.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MournbladeCYD2Item extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}
@@ -1,140 +0,0 @@
/**
* MournbladeCYD2 system
* Author: Uberwald
* Software License: Prop
*/
/* -------------------------------------------- */
/* -------------------------------------------- */
// Import Modules
import { MournbladeCYD2Actor } from "./mournblade-cyd2-actor.js";
import { MournbladeCYD2ItemSheet } from "./mournblade-cyd2-item-sheet.js";
import { MournbladeCYD2ActorSheet } from "./mournblade-cyd2-actor-sheet.js";
import { MournbladeCYD2CreatureSheet } from "./mournblade-cyd2-creature-sheet.js";
import { MournbladeCYD2CelluleSheet } from "./mournblade-cyd2-cellule-sheet.js";
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Combat } from "./mournblade-cyd2-combat.js";
import { MournbladeCYD2Item } from "./mournblade-cyd2-item.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
import { MournbladeCYD2TokenHud } from "./mournblade-cyd2-hud.js";
import { MOURNBLADECYD2_CONFIG } from "./mournblade-cyd2-config.js";
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
/************************************************************************************/
Hooks.once("init", async function () {
console.log(`Initializing MournbladeCYD2 RPG`);
/* -------------------------------------------- */
// preload handlebars templates
MournbladeCYD2Utility.preloadHandlebarsTemplates()
/* -------------------------------------------- */
// Set an initiative formula for the system
CONFIG.Combat.initiative = {
formula: "1d10",
decimals: 1
};
/* -------------------------------------------- */
game.socket.on("system.fvtt-mournblade-cyd2", data => {
MournbladeCYD2Utility.onSocketMesssage(data)
});
/* -------------------------------------------- */
// Define custom Entity classes
CONFIG.Combat.documentClass = MournbladeCYD2Combat
CONFIG.Actor.documentClass = MournbladeCYD2Actor
CONFIG.Item.documentClass = MournbladeCYD2Item
game.system.mournbladecyd2 = {
MournbladeCYD2Utility,
MournbladeCYD2Automation,
config : MOURNBLADECYD2_CONFIG
}
/* -------------------------------------------- */
// Regster sheet application classes
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet);
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2ActorSheet, { types: ["personnage"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2CreatureSheet, { types: ["creature"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2CelluleSheet, { types: ["cellule"], makeDefault: true });
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet);
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2ItemSheet, { makeDefault: true })
MournbladeCYD2Utility.init()
MournbladeCYD2Automation.init()
MournbladeCYD2TokenHud.init()
});
/* -------------------------------------------- */
function welcomeMessage() {
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: `<div id="welcome-message-MournbladeCYD2"><span class="rdd-roll-part">
<strong>Bienvenue dans MournbladeCYD2 et le troisième Millénaire !</strong>
<p>Les livres de Mournblade sont nécessaires pour jouer : https://www.titam-france.fr</p>
<p>Mournblade est un jeu de rôle publié par Titam France/Sombres projets, tous les droits leur appartiennent.</p>
<p>Système développé par LeRatierBretonnien, support sur le <a href="https://discord.gg/pPSDNJk">Discord FR de Foundry</a>.</p>
` });
}
/* -------------------------------------------- */
async function importDefaultScene() {
let exists = game.scenes.find(j => j.name == "Accueil");
if (!exists) {
const scenes = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd2.scenes")
let newDocuments = scenes.filter(i => i.name == "Accueil");
if (newDocuments) {
await game.scenes.documentClass.create(newDocuments);
game.scenes.find(i => i.name == "Accueil").activate();
}
}
}
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.once("ready", function () {
MournbladeCYD2Utility.ready()
// User warning
if (!game.user.isGM && game.user.character == undefined) {
ui.notifications.info("Attention ! Aucun personnage n'est relié au joueur !");
ChatMessage.create({
content: "<b>ATTENTION</b> Le joueur " + game.user.name + " n'est relié à aucun personnage !",
user: game.user._id
});
}
import("https://www.uberwald.me/fvtt_appcount/count-class-ready.js").then(moduleCounter=>{
console.log("ClassCounter loaded", moduleCounter)
moduleCounter.ClassCounter.registerUsageCount()
}).catch(err=>
console.log("No stats available, giving up.")
)
importDefaultScene()
welcomeMessage()
});
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.on("chatMessage", (html, content, msg) => {
if (content[0] == '/') {
let regExp = /(\S+)/g;
let commands = content.match(regExp);
if (game.system.mournblade.commands.processChatCommand(commands, content, msg)) {
return false;
}
}
return true;
});
@@ -1,140 +0,0 @@
/**
* MournbladeCYD2 system
* Author: Uberwald
* Software License: Prop
*/
/* -------------------------------------------- */
/* -------------------------------------------- */
// Import Modules
import { MournbladeCYD2Actor } from "./mournblade-cyd2-actor.js";
import { MournbladeCYD2ItemSheet } from "./mournblade-cyd2-item-sheet.js";
import { MournbladeCYD2ActorSheet } from "./mournblade-cyd2-actor-sheet.js";
import { MournbladeCYD2CreatureSheet } from "./mournblade-cyd2-creature-sheet.js";
import { MournbladeCYD2CelluleSheet } from "./mournblade-cyd2-cellule-sheet.js";
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Combat } from "./mournblade-cyd2-combat.js";
import { MournbladeCYD2Item } from "./mournblade-cyd2-item.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
import { MournbladeCYD2TokenHud } from "./mournblade-cyd2-hud.js";
import { MOURNBLADECYD2_CONFIG } from "./mournblade-cyd2-config.js";
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
/************************************************************************************/
Hooks.once("init", async function () {
console.log(`Initializing MournbladeCYD2 RPG`);
/* -------------------------------------------- */
// preload handlebars templates
MournbladeCYD2Utility.preloadHandlebarsTemplates()
/* -------------------------------------------- */
// Set an initiative formula for the system
CONFIG.Combat.initiative = {
formula: "1d10",
decimals: 1
};
/* -------------------------------------------- */
game.socket.on("system.fvtt-mournblade-cyd2", data => {
MournbladeCYD2Utility.onSocketMesssage(data)
});
/* -------------------------------------------- */
// Define custom Entity classes
CONFIG.Combat.documentClass = MournbladeCYD2Combat
CONFIG.Actor.documentClass = MournbladeCYD2Actor
CONFIG.Item.documentClass = MournbladeCYD2Item
game.system.mournbladecyd2 = {
MournbladeCYD2Utility,
MournbladeCYD2Automation,
config: MOURNBLADECYD2_CONFIG
}
/* -------------------------------------------- */
// Regster sheet application classes
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet);
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2ActorSheet, { types: ["personnage"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2CreatureSheet, { types: ["creature"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2CelluleSheet, { types: ["cellule"], makeDefault: true });
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet);
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2ItemSheet, { makeDefault: true })
MournbladeCYD2Utility.init()
MournbladeCYD2Automation.init()
MournbladeCYD2TokenHud.init()
});
/* -------------------------------------------- */
function welcomeMessage() {
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: `<div id="welcome-message-MournbladeCYD2"><span class="rdd-roll-part">
<strong>Bienvenue dans MournbladeCYD2 et le troisième Millénaire !</strong>
<p>Les livres de Mournblade sont nécessaires pour jouer : https://www.titam-france.fr</p>
<p>Mournblade est un jeu de rôle publié par Titam France/Sombres projets, tous les droits leur appartiennent.</p>
<p>Système développé par LeRatierBretonnien, support sur le <a href="https://discord.gg/pPSDNJk">Discord FR de Foundry</a>.</p>
` });
}
/* -------------------------------------------- */
async function importDefaultScene() {
let exists = game.scenes.find(j => j.name == "Accueil");
if (!exists) {
const scenes = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd2.scenes")
let newDocuments = scenes.filter(i => i.name == "Accueil");
if (newDocuments) {
await game.scenes.documentClass.create(newDocuments);
game.scenes.find(i => i.name == "Accueil").activate();
}
}
}
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.once("ready", function () {
MournbladeCYD2Utility.ready()
// User warning
if (!game.user.isGM && game.user.character == undefined) {
ui.notifications.info("Attention ! Aucun personnage n'est relié au joueur !");
ChatMessage.create({
content: "<b>ATTENTION</b> Le joueur " + game.user.name + " n'est relié à aucun personnage !",
user: game.user._id
});
}
import("https://www.uberwald.me/fvtt_appcount/count-class-ready.js").then(moduleCounter => {
console.log("ClassCounter loaded", moduleCounter)
moduleCounter.ClassCounter.registerUsageCount()
}).catch(err =>
console.log("No stats available, giving up.")
)
importDefaultScene()
welcomeMessage()
});
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.on("chatMessage", (html, content, msg) => {
if (content[0] == '/') {
let regExp = /(\S+)/g;
let commands = content.match(regExp);
if (game.system.mournblade.commands.processChatCommand(commands, content, msg)) {
return false;
}
}
return true;
});
@@ -1,139 +0,0 @@
/**
* MournbladeCYD2 system
* Author: Uberwald
* Software License: Prop
*/
/* -------------------------------------------- */
/* -------------------------------------------- */
// Import Modules
import { MournbladeCYD2Actor } from "./mournblade-cyd2-actor.js";
import { MournbladeCYD2ItemSheet } from "./mournblade-cyd2-item-sheet.js";
import { MournbladeCYD2ActorSheet } from "./mournblade-cyd2-actor-sheet.js";
import { MournbladeCYD2CreatureSheet } from "./mournblade-cyd2-creature-sheet.js";
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
import { MournbladeCYD2Combat } from "./mournblade-cyd2-combat.js";
import { MournbladeCYD2Item } from "./mournblade-cyd2-item.js";
import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js";
import { MournbladeCYD2TokenHud } from "./mournblade-cyd2-hud.js";
import { MOURNBLADECYD2_CONFIG } from "./mournblade-cyd2-config.js";
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
/************************************************************************************/
Hooks.once("init", async function () {
console.log(`Initializing MournbladeCYD2 RPG`);
/* -------------------------------------------- */
// preload handlebars templates
MournbladeCYD2Utility.preloadHandlebarsTemplates()
/* -------------------------------------------- */
// Set an initiative formula for the system
CONFIG.Combat.initiative = {
formula: "1d10",
decimals: 1
};
/* -------------------------------------------- */
game.socket.on("system.fvtt-mournblade-cyd2", data => {
MournbladeCYD2Utility.onSocketMesssage(data)
});
/* -------------------------------------------- */
// Define custom Entity classes
CONFIG.Combat.documentClass = MournbladeCYD2Combat
CONFIG.Actor.documentClass = MournbladeCYD2Actor
CONFIG.Item.documentClass = MournbladeCYD2Item
game.system.mournbladecyd2 = {
MournbladeCYD2Utility,
MournbladeCYD2Automation,
config: MOURNBLADECYD2_CONFIG
}
/* -------------------------------------------- */
// Regster sheet application classes
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet);
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2ActorSheet, { types: ["personnage"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2CreatureSheet, { types: ["creature"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2CelluleSheet, { types: ["cellule"], makeDefault: true });
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet);
foundry.documents.collections.Items.registerSheet("fvtt-mournblade-cyd2", MournbladeCYD2ItemSheet, { makeDefault: true })
MournbladeCYD2Utility.init()
MournbladeCYD2Automation.init()
MournbladeCYD2TokenHud.init()
});
/* -------------------------------------------- */
function welcomeMessage() {
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: `<div id="welcome-message-MournbladeCYD2"><span class="rdd-roll-part">
<strong>Bienvenue dans MournbladeCYD2 et le troisième Millénaire !</strong>
<p>Les livres de Mournblade sont nécessaires pour jouer : https://www.titam-france.fr</p>
<p>Mournblade est un jeu de rôle publié par Titam France/Sombres projets, tous les droits leur appartiennent.</p>
<p>Système développé par LeRatierBretonnien, support sur le <a href="https://discord.gg/pPSDNJk">Discord FR de Foundry</a>.</p>
` });
}
/* -------------------------------------------- */
async function importDefaultScene() {
let exists = game.scenes.find(j => j.name == "Accueil");
if (!exists) {
const scenes = await MournbladeCYD2Utility.loadCompendium("fvtt-mournblade-cyd2.scenes")
let newDocuments = scenes.filter(i => i.name == "Accueil");
if (newDocuments) {
await game.scenes.documentClass.create(newDocuments);
game.scenes.find(i => i.name == "Accueil").activate();
}
}
}
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.once("ready", function () {
MournbladeCYD2Utility.ready()
// User warning
if (!game.user.isGM && game.user.character == undefined) {
ui.notifications.info("Attention ! Aucun personnage n'est relié au joueur !");
ChatMessage.create({
content: "<b>ATTENTION</b> Le joueur " + game.user.name + " n'est relié à aucun personnage !",
user: game.user._id
});
}
import("https://www.uberwald.me/fvtt_appcount/count-class-ready.js").then(moduleCounter => {
console.log("ClassCounter loaded", moduleCounter)
moduleCounter.ClassCounter.registerUsageCount()
}).catch(err =>
console.log("No stats available, giving up.")
)
importDefaultScene()
welcomeMessage()
});
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.on("chatMessage", (html, content, msg) => {
if (content[0] == '/') {
let regExp = /(\S+)/g;
let commands = content.match(regExp);
if (game.system.mournblade.commands.processChatCommand(commands, content, msg)) {
return false;
}
}
return true;
});

Some files were not shown because too many files have changed in this diff Show More