22 Commits

Author SHA1 Message Date
d120da6718 Ready for release
All checks were successful
Release Creation / build (release) Successful in 11m34s
2026-04-04 19:08:22 +02:00
ef609136e2 Ready for release
Some checks failed
Release Creation / build (release) Failing after 11m26s
2026-04-04 18:50:36 +02:00
d9e770a250 Ready for release 2026-04-04 18:50:33 +02:00
7c500f3ef4 Ready for release 2026-04-04 18:46:55 +02:00
56b58565d1 Derniers fix de sécurité et assimilé 2026-04-04 09:40:30 +02:00
1fb80f6abe Rework fiches, jets de dés et CSS 2026-04-03 16:22:51 +02:00
e001ec0dc9 fix: améliore lisibilité des short-label dans les headers de listes
Change la couleur des labels de colonnes (Allégeance, Haut Parler, Difficulté...)
de l'or #c0a870 vers un crème clair #ddd0b8, plus lisible sur le fond sombre
des rangées items-title-bg.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-03 09:44:42 +02:00
b255a628fe Fix creature sheet: complete TECHNIQUE tab + copper theme
- Fix tabGroups 'stats'→'principal' (tab content was invisible)
- Add 'creature' CSS class to distinguish from personnage sheet
- New header layout: stat cards (Ressources, Vigueur, Combat)
- Rewrite creature template with full TECHNIQUE tab content:
  * Attributes with icons and level dropdowns (0-35)
  * Vitesse input
  * Santé section (Vigueur seuil)
  * Actions de combat (Initiative, Monté/Déf. totale, Assommer,
    Coup bas, Immobiliser, Repousser, Désengager)
  * Adversités section (reuses personnage CSS classes)
- Copper/orange CSS theme for .creature class overrides
- Add .stat-derived-value CSS for non-editable derived stats

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-03 09:35:12 +02:00
f0969c9eb4 Aesthetic overhaul: all 6 PJ sheet tabs styled with Mournblade theme
- Section boxes, item lists with alternating rows and hover effects
- Dark header rows (CentaurMT font, uppercase, gold text)
- 28x28px item icons with brown border
- Roll buttons: warm dark gradient with hover glow
- Chat/action buttons: blue gradient
- Predilection text: small italic muted gold
- Defense values in blue, gold argent banners
- Bio grid fields styled, description section header with accent
- Rich text editor area styled

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-03 09:15:29 +02:00
e67ecd9238 Add adversité total malus display
Show 'MALUS JETS -X' below adversité cards. Highlights in red when non-zero.
Value = bleue + rouge + noire (same as nbAdversites used in roll formula).
Tooltip explains it's subtracted from all rolls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-03 08:15:30 +02:00
21c3c5b88b Homogenize header: VIGUEUR threshold as subtitle like AME
Move vigueur value from standalone big number to inline subtitle (X)
in the card title, matching AME's (Seuil X) pattern.
Remove stat-big-value block from VIGUEUR card.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-03 08:09:08 +02:00
0ce42d0fe3 Redesign adversité section: 3 colored cards layout
Replace vertical list with horizontal card layout matching header style:
- BLEUE (blue), ROUGE (red), NOIRE (dark) cards with top-colored borders
- Gem image 52px with drop-shadow + hover scale
- Large numeric counter (Signika font)
- Colored -/+ buttons (red minus, green plus)
- Modifier fields compact row below cards
- Section title with amber letterhead style

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-03 08:04:45 +02:00
28cab15b37 Fix select text clipping in header stat cards
Use height:auto + padding:1px instead of fixed 20px height so browser
renders select text without vertical clipping.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-03 07:57:12 +02:00
c28414dd22 Refactor header: card-based layout with colored stat cards
- Replace flat ul/li header with .header-banner + .header-stat-cards
- 5 colored stat cards: LOI (amber), CHAOS (red), BONNE AVENTURE (green),
  VIGUEUR (maroon), ÂME (navy)
- Profile image: 90px with golden border + hover glow
- Character name: large serif font (CentaurMT) with transparent bg
- Fix overflow: visible on .stat-card to prevent select dropdown clipping
- Fix label colors: dark (#1a1008) instead of white for readability
- VIGUEUR big value: Signika/sans-serif font (avoids CentaurMT 1/I confusion)
- Consistent font sizes and alignment across all stat fields

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-03 07:53:44 +02:00
9754bbc3a8 Update CSS/Look & feel 2026-04-03 00:39:39 +02:00
23b105a47e Prepare for v14 2026-04-02 22:22:42 +02:00
faf452f797 Prepare for v14 2026-04-02 22:22:26 +02:00
9fd13b2615 DAtaModels + Appv2 migration : OK 2026-04-02 22:14:30 +02:00
7a2a3df391 DAtaModels + Appv2 migration : OK 2026-04-02 21:39:33 +02:00
a11b3495a5 DAtaModels + Appv2 migration : OK 2026-04-02 21:34:33 +02:00
a37ad2cc82 DAtaModels + Appv2 migration : OK 2026-04-02 21:33:56 +02:00
4def580296 Fix wrong sheets 2025-10-26 14:46:58 +01:00
833 changed files with 359601 additions and 968 deletions

View File

@@ -0,0 +1,66 @@
name: Release Creation
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "💡 The ${{ gitea.repository }} repository will be cloned to the runner."
- uses: RouxAntoine/checkout@v3.5.4
# get part of the tag after the `v`
- name: Extract tag version number
id: get_version
uses: battila7/get-version-action@v2
# Substitute the Manifest and Download URLs in the system.json
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: "system.json"
env:
version: ${{steps.get_version.outputs.version-without-v}}
url: https://www.uberwald.me/gitea/${{gitea.repository}}
manifest: https://www.uberwald.me/gitea/public/fvtt-mournblade-cyd-2-0/releases/download/latest/system.json
download: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/fvtt-mournblade-cyd-2-0.zip
# Build CSS from LESS sources before packaging
- name: Install Node.js dependencies and build styles
run: |
apt update -y
apt install -y nodejs npm zip
npm install
npm run build
# Create a zip file with all files required by the system
- run: zip -r ./fvtt-mournblade-cyd-2-0.zip system.json README.md LICENCE.txt assets/ lang/ modules/ packs/ styles/ templates/
- name: Setup Go
uses: https://github.com/actions/setup-go@v4
with:
go-version: ">=1.20.1"
- name: Upload release assets
id: use-go-action
uses: https://gitea.com/actions/release-action@main
with:
files: |-
./fvtt-mournblade-cyd-2-0.zip
system.json
api_key: "${{secrets.ALLOW_PUSH_RELEASE}}"
# - name: Publish to Foundry server
# uses: https://github.com/djlechuck/foundryvtt-publish-package-action@v1
# with:
# token: ${{ secrets.FOUNDRYVTT_RELEASE_TOKEN }}
# id: 'fvtt-mournblade-cyd-2-0'
# version: ${{github.event.release.tag_name}}
# manifest: 'https://www.uberwald.me/gitea/public/fvtt-mournblade-cyd-2-0/releases/download/latest/system.json'
# notes: 'https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/fvtt-mournblade-cyd-2-0.zip'
# compatibility-minimum: '14'
# compatibility-verified: '14'

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
node_modules/
styles/mournblade-cyd2.css.map
package-lock.json
.github/
.github/

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,29 @@
# 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

View File

@@ -0,0 +1,38 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,38 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,38 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,38 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,37 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,37 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,36 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,36 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,35 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,35 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,34 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,32 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,32 @@
{
"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"
}
}
}

View File

@@ -0,0 +1,116 @@
/**
* 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}`);
})();

View File

@@ -0,0 +1,116 @@
/**
* 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}`);
})();

View File

@@ -0,0 +1,222 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,222 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,224 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,224 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,226 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,226 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,227 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,227 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,228 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,228 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,227 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,213 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,213 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,212 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,212 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,211 @@
/**
* 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)
}
}
}

View File

@@ -0,0 +1,916 @@
/* -------------------------------------------- */
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)
}
}
}

View File

@@ -0,0 +1,916 @@
/* -------------------------------------------- */
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)
}
}
}

View File

@@ -0,0 +1,144 @@
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"}
]
}

View File

@@ -0,0 +1,144 @@
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" }
]
}

View File

@@ -0,0 +1,143 @@
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" }
]
}

View File

@@ -0,0 +1,143 @@
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" }
]
}

View File

@@ -0,0 +1,128 @@
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" }
]
}

View File

@@ -0,0 +1,128 @@
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" }
]
}

View File

@@ -0,0 +1,118 @@
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" }
]
}

View File

@@ -0,0 +1,118 @@
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" }
]
}

View File

@@ -0,0 +1,114 @@
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" }
]
}

View File

@@ -0,0 +1,114 @@
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" }
]
}

View File

@@ -0,0 +1,121 @@
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" }
]
}

View File

@@ -0,0 +1,121 @@
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" }
]
}

View File

@@ -0,0 +1,129 @@
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" }
]
}

View File

@@ -0,0 +1,129 @@
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" }
]
}

View File

@@ -0,0 +1,129 @@
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" }
]
}

View File

@@ -0,0 +1,129 @@
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" }
]
}

View File

@@ -0,0 +1,129 @@
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" }
]
}

View File

@@ -0,0 +1,129 @@
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" }
]
}

View File

@@ -0,0 +1,129 @@
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" }
]
}

View File

@@ -0,0 +1,129 @@
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" }
]
}

View File

@@ -0,0 +1,129 @@
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" }
]
}

View File

@@ -0,0 +1,228 @@
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);
}
}

View File

@@ -0,0 +1,228 @@
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);
}
}

View File

@@ -0,0 +1,228 @@
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);
}
}

View File

@@ -0,0 +1,228 @@
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);
}
}

View File

@@ -0,0 +1,31 @@
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);
}
}

View File

@@ -0,0 +1,31 @@
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);
}
}

View File

@@ -0,0 +1,30 @@
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);
}
}

View File

@@ -0,0 +1,30 @@
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);
}
}

View File

@@ -0,0 +1,29 @@
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);
}
}

View File

@@ -0,0 +1,29 @@
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);
}
}

View File

@@ -0,0 +1,30 @@
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);
}
}

View File

@@ -0,0 +1,30 @@
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);
}
}

View File

@@ -0,0 +1,34 @@
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);
}
}

View File

@@ -0,0 +1,34 @@
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);
}
}

View File

@@ -0,0 +1,30 @@
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);
}
}

View File

@@ -0,0 +1,34 @@
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);
}
}

View File

@@ -0,0 +1,34 @@
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);
}
}

View File

@@ -0,0 +1,34 @@
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);
}
}

View File

@@ -0,0 +1,33 @@
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);
}
}

View File

@@ -0,0 +1,33 @@
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);
}
}

View File

@@ -0,0 +1,33 @@
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);
}
}

View File

@@ -0,0 +1,34 @@
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);
}
}

View File

@@ -0,0 +1,34 @@
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);
}
}

View File

@@ -0,0 +1,34 @@
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);
}
}

View File

@@ -0,0 +1,35 @@
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);
}
}

View File

@@ -0,0 +1,35 @@
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);
}
}

View File

@@ -0,0 +1,35 @@
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);
}
}

View File

@@ -0,0 +1,140 @@
/**
* 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;
});

View File

@@ -0,0 +1,140 @@
/**
* 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;
});

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