Compare commits
22 Commits
fvtt-mourn
...
14.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| d120da6718 | |||
| ef609136e2 | |||
| d9e770a250 | |||
| 7c500f3ef4 | |||
| 56b58565d1 | |||
| 1fb80f6abe | |||
| e001ec0dc9 | |||
| b255a628fe | |||
| f0969c9eb4 | |||
| e67ecd9238 | |||
| 21c3c5b88b | |||
| 0ce42d0fe3 | |||
| 28cab15b37 | |||
| c28414dd22 | |||
| 9754bbc3a8 | |||
| 23b105a47e | |||
| faf452f797 | |||
| 9fd13b2615 | |||
| 7a2a3df391 | |||
| a11b3495a5 | |||
| a37ad2cc82 | |||
| 4def580296 |
66
.gitea/workflows/release.yaml
Normal file
66
.gitea/workflows/release.yaml
Normal 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
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
node_modules/
|
||||||
|
styles/mournblade-cyd2.css.map
|
||||||
|
package-lock.json
|
||||||
|
.github/
|
||||||
|
.github/
|
||||||
29
.history/README_20251025234409.md
Normal file
29
.history/README_20251025234409.md
Normal 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
|
||||||
29
.history/README_20251026002959.md
Normal file
29
.history/README_20251026002959.md
Normal 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
|
||||||
29
.history/README_20251026003003.md
Normal file
29
.history/README_20251026003003.md
Normal 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
|
||||||
29
.history/README_20251026003006.md
Normal file
29
.history/README_20251026003006.md
Normal 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
|
||||||
29
.history/README_20251026003011.md
Normal file
29
.history/README_20251026003011.md
Normal 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
|
||||||
29
.history/README_20251026003013.md
Normal file
29
.history/README_20251026003013.md
Normal 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
|
||||||
29
.history/README_20251026003038.md
Normal file
29
.history/README_20251026003038.md
Normal 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
|
||||||
29
.history/README_20251026003041.md
Normal file
29
.history/README_20251026003041.md
Normal 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
|
||||||
29
.history/README_20251026003045.md
Normal file
29
.history/README_20251026003045.md
Normal 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
|
||||||
29
.history/README_20251026003051.md
Normal file
29
.history/README_20251026003051.md
Normal 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
|
||||||
29
.history/README_20251026003057.md
Normal file
29
.history/README_20251026003057.md
Normal 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
|
||||||
29
.history/README_20251026003102.md
Normal file
29
.history/README_20251026003102.md
Normal 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
|
||||||
29
.history/README_20251026003110.md
Normal file
29
.history/README_20251026003110.md
Normal 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
|
||||||
38
.history/lang/fr_20251026000859.json
Normal file
38
.history/lang/fr_20251026000859.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
38
.history/lang/fr_20251026001011.json
Normal file
38
.history/lang/fr_20251026001011.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
38
.history/lang/fr_20251026004844.json
Normal file
38
.history/lang/fr_20251026004844.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
38
.history/lang/fr_20251026004905.json
Normal file
38
.history/lang/fr_20251026004905.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
37
.history/lang/fr_20251026095913.json
Normal file
37
.history/lang/fr_20251026095913.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
37
.history/lang/fr_20251026100139.json
Normal file
37
.history/lang/fr_20251026100139.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
.history/lang/fr_20251026132312.json
Normal file
36
.history/lang/fr_20251026132312.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
.history/lang/fr_20251026132458.json
Normal file
36
.history/lang/fr_20251026132458.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
35
.history/lang/fr_20251026132800.json
Normal file
35
.history/lang/fr_20251026132800.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
35
.history/lang/fr_20251026132940.json
Normal file
35
.history/lang/fr_20251026132940.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
34
.history/lang/fr_20251026133304.json
Normal file
34
.history/lang/fr_20251026133304.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
.history/lang/fr_20251026133310.json
Normal file
32
.history/lang/fr_20251026133310.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
.history/lang/fr_20251026133355.json
Normal file
32
.history/lang/fr_20251026133355.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
116
.history/macro-replace-images_20251026112045.js
Normal file
116
.history/macro-replace-images_20251026112045.js
Normal 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}`);
|
||||||
|
|
||||||
|
})();
|
||||||
116
.history/macro-replace-images_20251026112109.js
Normal file
116
.history/macro-replace-images_20251026112109.js
Normal 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}`);
|
||||||
|
|
||||||
|
})();
|
||||||
222
.history/modules/mournblade-cyd2-actor-sheet_20251026001316.js
Normal file
222
.history/modules/mournblade-cyd2-actor-sheet_20251026001316.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
222
.history/modules/mournblade-cyd2-actor-sheet_20251026001548.js
Normal file
222
.history/modules/mournblade-cyd2-actor-sheet_20251026001548.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
224
.history/modules/mournblade-cyd2-actor-sheet_20251026002630.js
Normal file
224
.history/modules/mournblade-cyd2-actor-sheet_20251026002630.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
224
.history/modules/mournblade-cyd2-actor-sheet_20251026002719.js
Normal file
224
.history/modules/mournblade-cyd2-actor-sheet_20251026002719.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
226
.history/modules/mournblade-cyd2-actor-sheet_20251026082045.js
Normal file
226
.history/modules/mournblade-cyd2-actor-sheet_20251026082045.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
226
.history/modules/mournblade-cyd2-actor-sheet_20251026082310.js
Normal file
226
.history/modules/mournblade-cyd2-actor-sheet_20251026082310.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
227
.history/modules/mournblade-cyd2-actor-sheet_20251026082630.js
Normal file
227
.history/modules/mournblade-cyd2-actor-sheet_20251026082630.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
227
.history/modules/mournblade-cyd2-actor-sheet_20251026082724.js
Normal file
227
.history/modules/mournblade-cyd2-actor-sheet_20251026082724.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
228
.history/modules/mournblade-cyd2-actor-sheet_20251026083617.js
Normal file
228
.history/modules/mournblade-cyd2-actor-sheet_20251026083617.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
228
.history/modules/mournblade-cyd2-actor-sheet_20251026083658.js
Normal file
228
.history/modules/mournblade-cyd2-actor-sheet_20251026083658.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
227
.history/modules/mournblade-cyd2-actor-sheet_20251026095818.js
Normal file
227
.history/modules/mournblade-cyd2-actor-sheet_20251026095818.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
213
.history/modules/mournblade-cyd2-actor-sheet_20251026095829.js
Normal file
213
.history/modules/mournblade-cyd2-actor-sheet_20251026095829.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
213
.history/modules/mournblade-cyd2-actor-sheet_20251026100139.js
Normal file
213
.history/modules/mournblade-cyd2-actor-sheet_20251026100139.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
212
.history/modules/mournblade-cyd2-actor-sheet_20251026132141.js
Normal file
212
.history/modules/mournblade-cyd2-actor-sheet_20251026132141.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
212
.history/modules/mournblade-cyd2-actor-sheet_20251026132457.js
Normal file
212
.history/modules/mournblade-cyd2-actor-sheet_20251026132457.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
211
.history/modules/mournblade-cyd2-actor-sheet_20251026132939.js
Normal file
211
.history/modules/mournblade-cyd2-actor-sheet_20251026132939.js
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
916
.history/modules/mournblade-cyd2-actor_20260402224326.js
Normal file
916
.history/modules/mournblade-cyd2-actor_20260402224326.js
Normal 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
916
.history/modules/mournblade-cyd2-actor_20260402224333.js
Normal file
916
.history/modules/mournblade-cyd2-actor_20260402224333.js
Normal 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
144
.history/modules/mournblade-cyd2-config_20251026082216.js
Normal file
144
.history/modules/mournblade-cyd2-config_20251026082216.js
Normal 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"}
|
||||||
|
]
|
||||||
|
}
|
||||||
144
.history/modules/mournblade-cyd2-config_20251026082310.js
Normal file
144
.history/modules/mournblade-cyd2-config_20251026082310.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
143
.history/modules/mournblade-cyd2-config_20251026095844.js
Normal file
143
.history/modules/mournblade-cyd2-config_20251026095844.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
143
.history/modules/mournblade-cyd2-config_20251026100139.js
Normal file
143
.history/modules/mournblade-cyd2-config_20251026100139.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
128
.history/modules/mournblade-cyd2-config_20251026132250.js
Normal file
128
.history/modules/mournblade-cyd2-config_20251026132250.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
128
.history/modules/mournblade-cyd2-config_20251026132458.js
Normal file
128
.history/modules/mournblade-cyd2-config_20251026132458.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
118
.history/modules/mournblade-cyd2-config_20251026132740.js
Normal file
118
.history/modules/mournblade-cyd2-config_20251026132740.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
118
.history/modules/mournblade-cyd2-config_20251026132940.js
Normal file
118
.history/modules/mournblade-cyd2-config_20251026132940.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
114
.history/modules/mournblade-cyd2-config_20251026133248.js
Normal file
114
.history/modules/mournblade-cyd2-config_20251026133248.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
114
.history/modules/mournblade-cyd2-config_20251026133355.js
Normal file
114
.history/modules/mournblade-cyd2-config_20251026133355.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
121
.history/modules/mournblade-cyd2-config_20251026142014.js
Normal file
121
.history/modules/mournblade-cyd2-config_20251026142014.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
121
.history/modules/mournblade-cyd2-config_20251026142018.js
Normal file
121
.history/modules/mournblade-cyd2-config_20251026142018.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
129
.history/modules/mournblade-cyd2-config_20251026142026.js
Normal file
129
.history/modules/mournblade-cyd2-config_20251026142026.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
129
.history/modules/mournblade-cyd2-config_20251026142035.js
Normal file
129
.history/modules/mournblade-cyd2-config_20251026142035.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
129
.history/modules/mournblade-cyd2-config_20251026142102.js
Normal file
129
.history/modules/mournblade-cyd2-config_20251026142102.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
129
.history/modules/mournblade-cyd2-config_20251026142109.js
Normal file
129
.history/modules/mournblade-cyd2-config_20251026142109.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
129
.history/modules/mournblade-cyd2-config_20251026142110.js
Normal file
129
.history/modules/mournblade-cyd2-config_20251026142110.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
129
.history/modules/mournblade-cyd2-config_20251026142113.js
Normal file
129
.history/modules/mournblade-cyd2-config_20251026142113.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
129
.history/modules/mournblade-cyd2-config_20251026142115.js
Normal file
129
.history/modules/mournblade-cyd2-config_20251026142115.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
129
.history/modules/mournblade-cyd2-config_20251026142117.js
Normal file
129
.history/modules/mournblade-cyd2-config_20251026142117.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
129
.history/modules/mournblade-cyd2-config_20251026142118.js
Normal file
129
.history/modules/mournblade-cyd2-config_20251026142118.js
Normal 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" }
|
||||||
|
]
|
||||||
|
}
|
||||||
228
.history/modules/mournblade-cyd2-item-sheet_20251025235545.js
Normal file
228
.history/modules/mournblade-cyd2-item-sheet_20251025235545.js
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
228
.history/modules/mournblade-cyd2-item-sheet_20251026131931.js
Normal file
228
.history/modules/mournblade-cyd2-item-sheet_20251026131931.js
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
228
.history/modules/mournblade-cyd2-item-sheet_20251026131933.js
Normal file
228
.history/modules/mournblade-cyd2-item-sheet_20251026131933.js
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
228
.history/modules/mournblade-cyd2-item-sheet_20251026131940.js
Normal file
228
.history/modules/mournblade-cyd2-item-sheet_20251026131940.js
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
31
.history/modules/mournblade-cyd2-item_20251026132229.js
Normal file
31
.history/modules/mournblade-cyd2-item_20251026132229.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
31
.history/modules/mournblade-cyd2-item_20251026132458.js
Normal file
31
.history/modules/mournblade-cyd2-item_20251026132458.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
30
.history/modules/mournblade-cyd2-item_20251026132726.js
Normal file
30
.history/modules/mournblade-cyd2-item_20251026132726.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
30
.history/modules/mournblade-cyd2-item_20251026132940.js
Normal file
30
.history/modules/mournblade-cyd2-item_20251026132940.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
29
.history/modules/mournblade-cyd2-item_20251026133240.js
Normal file
29
.history/modules/mournblade-cyd2-item_20251026133240.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
29
.history/modules/mournblade-cyd2-item_20251026133244.js
Normal file
29
.history/modules/mournblade-cyd2-item_20251026133244.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
30
.history/modules/mournblade-cyd2-item_20251026133401.js
Normal file
30
.history/modules/mournblade-cyd2-item_20251026133401.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
30
.history/modules/mournblade-cyd2-item_20251026133402.js
Normal file
30
.history/modules/mournblade-cyd2-item_20251026133402.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
34
.history/modules/mournblade-cyd2-item_20251026133404.js
Normal file
34
.history/modules/mournblade-cyd2-item_20251026133404.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
34
.history/modules/mournblade-cyd2-item_20251026133405.js
Normal file
34
.history/modules/mournblade-cyd2-item_20251026133405.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
30
.history/modules/mournblade-cyd2-item_20251026133408.js
Normal file
30
.history/modules/mournblade-cyd2-item_20251026133408.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
34
.history/modules/mournblade-cyd2-item_20251026133409.js
Normal file
34
.history/modules/mournblade-cyd2-item_20251026133409.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
34
.history/modules/mournblade-cyd2-item_20251026133412.js
Normal file
34
.history/modules/mournblade-cyd2-item_20251026133412.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
34
.history/modules/mournblade-cyd2-item_20251026133413.js
Normal file
34
.history/modules/mournblade-cyd2-item_20251026133413.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
33
.history/modules/mournblade-cyd2-item_20251026133414.js
Normal file
33
.history/modules/mournblade-cyd2-item_20251026133414.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
33
.history/modules/mournblade-cyd2-item_20251026133417.js
Normal file
33
.history/modules/mournblade-cyd2-item_20251026133417.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
33
.history/modules/mournblade-cyd2-item_20251026133418.js
Normal file
33
.history/modules/mournblade-cyd2-item_20251026133418.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
34
.history/modules/mournblade-cyd2-item_20251026133421.js
Normal file
34
.history/modules/mournblade-cyd2-item_20251026133421.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
34
.history/modules/mournblade-cyd2-item_20251026133424.js
Normal file
34
.history/modules/mournblade-cyd2-item_20251026133424.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
34
.history/modules/mournblade-cyd2-item_20251026133450.js
Normal file
34
.history/modules/mournblade-cyd2-item_20251026133450.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
35
.history/modules/mournblade-cyd2-item_20251026133455.js
Normal file
35
.history/modules/mournblade-cyd2-item_20251026133455.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
35
.history/modules/mournblade-cyd2-item_20251026133613.js
Normal file
35
.history/modules/mournblade-cyd2-item_20251026133613.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
35
.history/modules/mournblade-cyd2-item_20251026133616.js
Normal file
35
.history/modules/mournblade-cyd2-item_20251026133616.js
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
140
.history/modules/mournblade-cyd2-main_20251025235708.js
Normal file
140
.history/modules/mournblade-cyd2-main_20251025235708.js
Normal 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;
|
||||||
|
});
|
||||||
140
.history/modules/mournblade-cyd2-main_20251025235732.js
Normal file
140
.history/modules/mournblade-cyd2-main_20251025235732.js
Normal 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
Reference in New Issue
Block a user