Compare commits

...

427 Commits
master ... v1.4

Author SHA1 Message Date
b548d95203 /exp uniquement sur personnage et messages XP uniquement pour MJ 2021-06-28 16:50:52 +02:00
b02ac1e7e1 Merge branch 'v1.4-fixes' into 'v1.4'
Fix: draconic optionnel pour Rêve de dragon

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!284
2021-06-26 07:20:54 +00:00
d0764eb1c5 Fix: draconic optionnel pour Rêve de dragon 2021-06-26 00:58:14 +02:00
4fd822eeee Fix startup calendar 2021-06-25 17:19:34 +02:00
ac9a35cd63 Merge branch 'v1.4-fix-refresh-calendar' into 'v1.4'
Fix: re-tirage de dés sur reload

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!282
2021-06-25 13:36:50 +00:00
100e0b62ab Fix: re-tirage de dés sur reload
- ajout d'une option pour explicitement masquer les dés
- si showDice=false dans rdd-calendar, masquer les dés
- sauvegarde de la nouvelle liste plutôt que l'ancienne
2021-06-25 14:40:25 +02:00
92f1cbd7c3 Fix: raison non utilisée 2021-06-25 14:17:58 +02:00
a17715430a Fix startup calendar 2021-06-25 13:24:43 +02:00
b0a14c5e8c Merge branch 'v1.4-fix' into 'v1.4'
Fix typos pdf-text

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!280
2021-06-25 09:21:03 +00:00
3f8ab65ba5 Fix typos pdf-text
La copie depuis le pdf a transformé:
"fi" en $
"ff" en !
2021-06-23 11:07:18 +02:00
284689b7a8 Fix: quantité prise manquante dans message 2021-06-23 11:07:18 +02:00
3cfc15ebd3 Merge branch 'v1.4-xplog' into 'v1.4'
Fix: experiencelog manquant sur signe draconique

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!279
2021-06-21 06:02:04 +00:00
61165107f0 Fix: experiencelog manquant sur signe draconique 2021-06-21 00:01:59 +02:00
3fd49f4909 Merge branch 'v1.4-fixes' into 'v1.4'
V1.4 fixes

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!278
2021-06-15 05:55:22 +00:00
93f8cfa452 Version 1.4.33 2021-06-14 23:47:40 +02:00
b19bc68d22 Fix: Bouton prendre/acheter selon prix 2021-06-14 23:47:13 +02:00
c36b32e5e8 Fix: suppression du message si qty=0 2021-06-14 23:47:13 +02:00
fa060a06a1 fix: ne pas afficher qu'on reçoit 0 deniers 2021-06-14 23:47:13 +02:00
7253b35084 Merge branch 'v1.4-fixes' into 'v1.4'
V1.4 fixes

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!277
2021-06-13 20:34:42 +00:00
72dedcca58 Version 1.4.32 2021-06-13 21:57:30 +02:00
094632734f Fix: Jets d'astrologies invisibles pour joueur 2021-06-13 21:56:01 +02:00
43e069cc9b Fix: Maladresse non-armée pour l'esquive 2021-06-13 21:29:32 +02:00
645c902e06 Merge branch 'v1.4-stress' into 'v1.4'
Fix: message quand /stress sans valeur

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!276
2021-06-11 19:15:14 +00:00
8608d153f6 Fix: warn si /stress sans valeur
Sans quoi ça supprime la valeur de stress de tous les joueurs
2021-06-11 01:41:28 +02:00
7c2d18428d Fix sur deplacement objets entre acteurs 2021-06-09 22:47:13 +02:00
07694158e7 Merge branch 'v1.4-fix-move-conteneur' into 'v1.4'
Fix: déplacement de conteneurs entre acteurs

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!275
2021-06-09 20:28:37 +00:00
aaeaedbf40 Fix: déplacement de conteneurs entre acteurs 2021-06-09 22:23:41 +02:00
b6678823d0 Fix calendrier et potions enchantees 2021-06-09 16:38:52 +02:00
a9056031a6 Merge branch 'v1.4' of https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon into v1.4 2021-06-09 07:29:39 +02:00
144abe1ddf Fix calendrier 2021-06-09 07:29:36 +02:00
a8be0c505d Merge branch 'v1.4-fix-calendrier' into 'v1.4'
Fix: Les dates des potions

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!274
2021-06-09 05:29:10 +00:00
9b28342c46 Fix: Les dates des potions
restaure le fonctionnement des heures des potions
2021-06-09 00:05:41 +02:00
395092558f Merge branch 'v1.4-fix-calendrier' into 'v1.4'
Fix: calcul de date au delà de 12 mois

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!273
2021-06-08 19:43:55 +00:00
986b007633 Fix: /astro chateau dormant 2021-06-08 15:52:39 +02:00
9b60583537 Fix: position du calendrier par défaut
calendrier positionné indépendamment par user
default setting pour la position initiale
2021-06-08 15:52:39 +02:00
20ae4a9a97 Fix: calcul de date au delà de 12 mois
Gestion de mois 12 (par modulo)
Ajout de l'année
incrémenter le jour se fait sur l'index (et calcul des infos de
calendrier)

+ sécurité pour les calendriers existants
2021-06-08 15:52:39 +02:00
d3e612104d Merge branch 'v1.4-fix-achat-vente' into 'v1.4'
Fix: sur les achat rejetés

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!270
2021-06-08 05:55:12 +00:00
c8a5526a5f Fix: Item acheté à token générique
Les tokens non liés à l'acteur peuvent maintenant vendre de l'équipement
L'équipement n'est pas enlevé de la fiche synthétique du token,
l'argent n'est pas ajouté non plus.
2021-06-08 00:37:35 +02:00
8d94cbb056 Fix: achat multiples rejetés
Il manquait le jsondata et les propriétés lors du remplacement
du message de vente dans le tchat
2021-06-08 00:32:51 +02:00
af4c9c138c Correction sur creation oeuvre 2021-06-07 23:18:33 +02:00
0a92be0942 COrrection XP competence/sort/carac et chiffres astro 2021-06-07 22:52:42 +02:00
dc09e58b08 Fixe calendrier again 2021-06-05 23:26:03 +02:00
71ce90aa4e Fix heure naissance et attaque sur véhicules 2021-06-05 21:36:04 +02:00
e92f4130f2 Fix heure naissance et attaque sur véhicules 2021-06-05 21:35:43 +02:00
575b8a0a30 Ajout await à l'init 2021-06-05 20:53:43 +02:00
2336289f5a Various fixes 2021-06-05 18:31:42 +02:00
5373f15e92 Minor fixes 2021-06-05 12:16:56 +02:00
6c893ee526 Minor fixes 2021-06-05 12:10:48 +02:00
99f67565cc Minor fixes 2021-06-05 12:09:27 +02:00
50a72ff4ea Merge branch 'v1.4-fixes' into 'v1.4'
Support /astro avec noms partiels ou numériques

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!267
2021-06-05 10:08:51 +00:00
19d8202439 Fix: position token de rencontre dérobées 2021-06-05 02:21:28 +02:00
c7a417fc69 Fix: trier les monnaies par valeur 2021-06-05 02:05:51 +02:00
9a7b01a985 Fix: suppression conquête automatique 2021-06-05 01:53:30 +02:00
7ba3b44c87 Fix: écrasement quantité achats multiples
Quand plusieurs joueurs ouvraient la fenêtre d'achat en même temps, on
utilisait pour chaque acheteur la quantité d'origine, la quantité
disponible n'était diminuée que par le dernier acheteur.

En reprenant les infos disponibles dans le tchat, on peut appliquer la
diminution (le delta) à la quantité courante, et supporter plusieurs
acheteurs
2021-06-05 01:14:29 +02:00
e0666b074e typo tarot draconique 2021-06-05 00:55:39 +02:00
3a0186a15f Fix: boissons exotiques&de mauvais goût
La qualité et l'exotisme sont maintenant appliqués aux boissons
2021-06-04 20:29:50 +02:00
0524540f5a fix: valider le champs des dialogs
Forcer la validation des champs saisis avant de fermer les dialogs et
d'appeler le callback pour avoir la dernière valuer saisie par
l'utilisateur
2021-06-04 20:29:50 +02:00
b5c8bb85fd Fix nbBrins par défaut pour potion 2021-06-04 20:29:50 +02:00
080a8b51b3 Support /astro avec noms partiels ou numériques
=> fix /astro Château Dromant
=> support /astro chat
=> support /astro 12
2021-06-04 20:29:50 +02:00
3a8a8fa5fb Merge branch 'v1.4-fix-sort-reve' into 'v1.4'
Fix: forcer Rêve pour lancer un sort

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!266
2021-06-04 05:55:15 +00:00
cf01d26bfe Fix: forcer Rêve pour lancer un sort
Au cas où la carac par défaut pour le draconic n'est pas rêve
2021-06-04 01:46:03 +02:00
403d94a57f Merge branch 'v1.4-fix-humanoides' into 'v1.4'
Fix Chèvre-pieds et autres

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!265
2021-06-03 06:53:35 +00:00
4371937110 Message expliquant les différences 2021-06-02 23:41:25 +02:00
ebb6b34cce Fix: Compatibility Dice-so-nice 2021-06-02 23:01:32 +02:00
a059d69acd Fix Chèvre-pieds et autres 2021-06-02 22:29:36 +02:00
d3be1d52b4 Compatible avec les versions 0.8 à venir 2021-06-02 22:28:43 +02:00
a5581e7443 Fix: await manquant 2021-06-02 22:28:43 +02:00
2cf9d0f37c Les monnaies sont désormais gérées comme de l'equipement 2021-06-02 17:41:03 +02:00
6508a529e5 Fix monnaie deletion 2021-06-02 17:39:16 +02:00
2cd607e199 Sync avec DsN fix 2021-06-02 17:08:54 +02:00
60a7b551af Merge branch 'v1.4-race' into 'v1.4'
Ajout Race et fix Dice-so-nice

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!264
2021-06-02 15:08:13 +00:00
b0da6ca8ea Les monnaies sont désormais gérées comme de l'equipement 2021-06-02 17:00:17 +02:00
93b8f15df0 Fix: ne pas utiliser DsN sans canvas
dice3d n'est pas dispo si on n'a pas de canvas dans dice-so-nice 3.4.0
Du coup, plantage et aucun jet dans le système RdD pour un joueur
qui n'a pas de scène.

Accessoirement, dice-so-nice 3.4.0 plante à l'init, mais ça on n'y peut
rien (Issue raised)
2021-06-02 16:40:25 +02:00
15c07674bc Ajout de la race #200 2021-06-02 16:40:25 +02:00
67a674e7b4 Ajout des objets monnaies pour les créatures et les véhicules 2021-06-02 16:04:35 +02:00
10ade1789b Merge branch 'v1.4-focus' into 'v1.4'
Fix: gestion du focus

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!263
2021-06-01 20:53:20 +00:00
6d1a1cef67 Re-synchro d'affichage lors du tirage des nombres astro 2021-06-01 22:19:37 +02:00
4b26fd575a Re-synchro d'affichage lors du tirage des nombres astro 2021-06-01 21:58:40 +02:00
560d674a15 Blocage astro #198, Synchro horloge #197, gérer pièces #196 2021-06-01 21:05:28 +02:00
d45f95f1a5 Blocage astro #198, Synchro horloge #197, gérer pièces #196 2021-06-01 20:54:27 +02:00
1a2173e8c1 Fix: gestion du focus
Foundry attend que les champs input aient un name unique
C'est ce champ qui est utilisé pour gérer le focus lors du
changement d'une valeur (dans les compétences, etc)
2021-06-01 20:02:26 +02:00
39eda96f61 Await ActiveEffect - TEST 2021-06-01 17:18:06 +02:00
53bc21eade Sync version 2021-06-01 17:07:27 +02:00
ed89ef264f Revision messages de chat 2021-06-01 08:12:01 +02:00
19c725a6f7 Revision messages de chat 2021-06-01 08:08:03 +02:00
f04ef45fe1 Merge branch 'v1.4-fix-combat' into 'v1.4'
Fix: regression combat

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!261
2021-06-01 04:34:33 +00:00
4821046c2f Increment version 1.4.14 2021-06-01 00:12:28 +02:00
5e68a67583 remove unused import 2021-06-01 00:11:32 +02:00
e13750ea68 removeChatMessageId support undefined
Simplifie le code de l'appelant

préparation pour enchantement de potions
2021-06-01 00:11:32 +02:00
cc2277c9b7 Fix typo 2021-06-01 00:11:32 +02:00
43274ca6b7 Fix regression sur tour suivant 2021-06-01 00:11:32 +02:00
d2b612c11c Fix: regression combat
Notifier tous les postes clients des données de passe d'arme
2021-06-01 00:11:32 +02:00
f807d3cd52 Fix: flag Thanatos même en cas d'échec de sort 2021-06-01 00:11:31 +02:00
dd2ce39545 Increment version 2021-05-29 23:36:25 +02:00
8e7835c44d Merge branch 'v1.4-fix' into 'v1.4'
Fix: commandes /rdd

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!260
2021-05-29 21:35:36 +00:00
8807ba01dc Fix: commandes /rdd
La sélection de difficultés est de nouveau disponible dans la table de
résolution

Les jets 'numériques' /rdd 12 0 sont de nouveau pris en compte
2021-05-29 22:40:39 +02:00
09fe695777 Fix: un conteneur peut contenir un id manquant
Parfois, un conteneur peut contenir l'id d'un objet qui a été
supprimé (potion bue? objets groupés?)

Dans ce cas, la feuille ne s'ouvrait plus correctement.

Une méthode de cleanup permet d'éliminer ces ids incorrects.
2021-05-28 18:30:28 +02:00
1f77c6227b Merge branch 'v1.4-fix' into 'v1.4'
Fix: ajout de souffle sur refoulement

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!259
2021-05-28 08:53:40 +00:00
b500997277 Fix: ajout de souffle sur refoulement 2021-05-28 10:40:02 +02:00
c6f51e6e9a Fix présentation de l'aide des commandes 2021-05-28 10:30:01 +02:00
a0bbeea99b Meilleur affichage pour rencontre/pas rencontre et type de TMR affichés sur TMR cachées 2021-05-28 10:25:34 +02:00
c18fa00a3b Affichage niveau min necessaire #188 2021-05-28 09:43:15 +02:00
8cbad3b383 Affichage niveau min necessaire #188 2021-05-28 09:38:19 +02:00
e2139f41b0 Affichage niveau min necessaire #188 2021-05-28 09:37:22 +02:00
f22622710a Affichage niveau min necessaire #188 2021-05-28 09:12:18 +02:00
be1ad028a7 Fix TMR up/down 2021-05-28 08:28:14 +02:00
e0aa4ed896 Fix TMR up/down 2021-05-28 07:54:34 +02:00
c6b571b788 Fix TMR up/down 2021-05-28 07:54:25 +02:00
879ae14b11 Merge branch 'v1.4-xp-up' into 'v1.4'
Ajout bouton augmenter niveau

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!258
2021-05-28 05:16:21 +00:00
41bb5ca919 Ajout bouton augmenter niveau 2021-05-28 00:55:29 +02:00
63d5281a0c Merge branch 'v1.4-fix-enc' into 'v1.4'
Fix calcul encTotal

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!257
2021-05-27 22:09:11 +00:00
95bcc2e77c Fix calcul encTotal
Autant le calculer depuis les objets eux-mêmes
2021-05-27 23:37:55 +02:00
46642d31a9 Merge branch 'v1.4-xp' into 'v1.4'
Fix: expérience de nouveau appliquée

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!255
2021-05-27 20:34:03 +00:00
0791fc75fa distinction changement d'xp vs gain d'xp 2021-05-27 21:30:42 +02:00
458e7ddb9f Amélioration rendu XP log 2021-05-27 21:13:51 +02:00
2ebd70827b Fix: static DiceTerm.getResultLabel
La méthode n'est plus statique
2021-05-27 19:44:04 +02:00
80629d4a07 Fix: expérience de nouveau appliquée
+ amélioration du rendu
2021-05-27 19:44:04 +02:00
86558c52fa Increase version 2021-05-27 07:39:59 +02:00
3793563a2c Merge branch 'v1.4-fix-socket-loop' into 'v1.4'
Fix: boucle infinie de messages

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!254
2021-05-27 05:37:57 +00:00
d874720973 Fix achat par un joueur 2021-05-27 01:47:34 +02:00
6a85073dbb fix: suppression message par MJ
Ne pas passer par un socket pour le user qui va traiter le message
2021-05-27 01:47:18 +02:00
bd7f3a9b3d clean log socket message
log des messages sockets dans le hook (car plusieurs handlers)
2021-05-27 01:18:21 +02:00
effb50e778 Permettre des conditions sur une tâche 2021-05-27 01:13:42 +02:00
8ffecc45ca typo - espace manquant 2021-05-27 01:10:05 +02:00
5aa0f62b83 Correction des ajustements astrologiques
ne pas avoir d'async pour déterminer l'ajustement astrologique.

Si on n'a pas de chiffre astral du jour (ie: n'arrivera pas, on calcule
à l'init), on utilise 0 et on lance le calcul async pour la prochaine
fois..
2021-05-27 01:08:17 +02:00
22f12b8f06 fix inventaire
pas de notion d'équiper pour les conteneurs, affichés en dernier
2021-05-27 00:29:33 +02:00
8eaa12e2c6 Boutons de configuration du calendrier en blanc 2021-05-27 00:22:05 +02:00
06cf01b269 icône main pour équiper 2021-05-27 00:21:43 +02:00
1d10c0bd3f mineur: plus besoin de joueur pour la defense 2021-05-27 00:20:40 +02:00
c77d5e3c93 Fix: boucle infinie de messages
en cas d'appel de ChatUtility.onRemoveMessages par un joueur,
on entre en boucle infinie de messages envoyés sur les sockets
2021-05-27 00:19:31 +02:00
d610a92003 Fix: la clé pour un type utilise des minuscules 2021-05-26 19:04:41 +02:00
02a17ab712 Fix TMR 2021-05-26 16:29:18 +02:00
0e3e6eb6eb Fix TMR 2021-05-26 16:28:57 +02:00
b08b330e65 Fix conteneurs + encombrement 2021-05-25 23:49:11 +02:00
cf75fb82d0 Merge branch 'v1.4-fix' into 'v1.4'
fix déplacement hors conteneurs

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!253
2021-05-25 21:46:52 +00:00
1624f9292c Fix: déplacements conteneurs 2021-05-25 23:42:43 +02:00
164adb41f6 Fix: affichage objets magiques 2021-05-25 23:42:43 +02:00
ebe877400a Merge branch 'v1.4-choic-type-item' into 'v1.4'
Améliorer le choix du type d'objet à créer #143

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!252
2021-05-25 05:39:40 +00:00
e4f668a357 Suppression références wfrp4e 2021-05-25 00:53:16 +02:00
286eaafe4e Améliorer le choix du type d'objet à créer #143
Utilisation du fichier de langue
Utilisation de la même référence pour les compendiums
Fix sur les compendium, le type n'apparaissait pas toujours
2021-05-25 00:53:15 +02:00
8e53759170 cleanup: non utilisé 2021-05-25 00:52:18 +02:00
22bdf60e93 Merge branch 'Caracs-alignment' into 'v1.4'
Align in Caracteristics for Characters

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!251
2021-05-24 19:13:47 +00:00
ef7585fcb9 Align in Caracteristics for Characters 2021-05-24 17:32:18 +02:00
96fc42e537 Fix sur double montée en TMRé 2021-05-24 09:39:42 +02:00
8e9ae00898 Sync 2021-05-22 15:03:40 +02:00
a22c435ca5 Merge branch 'v1.4-fix-193' into 'v1.4'
#193: utiliser isElectedUser pour les défenses

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!250
2021-05-22 06:39:26 +00:00
d201a91d41 #193: utiliser isElectedUser pour les défenses
Misc.isElectedUser renvoit true pour un seul MJ connecté,
ou le joueur connecté s'il n'y a pas de MJ.

Ca veut dire que sans MJ, les messages de combat ne marcheront
peut-être pas, mais pour tous les autres cas, ça marchera correctement,
vu que ce sera toujours un MJ qui postera le message de défense au
joueur (connecté ou pas) et au MJ
2021-05-22 02:19:22 +02:00
8947681e95 Merge branch 'v1.4' of https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon into v1.4 2021-05-22 00:03:54 +02:00
ffbe251fac Sync with 1.4 2021-05-22 00:03:22 +02:00
801b69edcd Merge branch 'set-default-grid-to-meter' into 'v1.4'
Sets default grid unit to 1 meter

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!248
2021-05-21 21:04:22 +00:00
798743724a Sets default grid unit to 1 meter 2021-05-21 22:02:48 +02:00
0136cc1bd4 Add XP log message 2021-05-21 07:36:59 +02:00
a77c285ee4 Fix competences/controles 2021-05-21 00:37:28 +02:00
24a7aad9e5 Merge branch 'character-sheet-style' into 'v1.4'
Character sheet style - Align and sort skills

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!247
2021-05-20 22:16:55 +00:00
270c082032 Merge branch 'v1.4-fix-achat' into 'v1.4'
fix achat quelle que soit l'origine de l'objet

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!246
2021-05-20 21:13:05 +00:00
fd964690e0 Achat fonctionne quel que soit l'Item 2021-05-20 21:53:54 +02:00
bb8b56f534 Limiter les lancers de dés de nombre astraux 2021-05-20 21:36:20 +02:00
a448f68190 Align skills and hide controls 2021-05-20 19:21:45 +02:00
c41a7c9250 Sort skills 2021-05-20 19:20:38 +02:00
958ab1e6df Enforce skill upgradable color 2021-05-20 19:20:38 +02:00
c3d8f53c1b Align skills and caracs 2021-05-20 19:20:35 +02:00
04b67f2188 Merge branch 'v1.4-fix' into 'v1.4'
Plusieurs fixes

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!245
2021-05-20 16:00:43 +00:00
8c6857693f fix: pas de tri en cas de groupement
ne pas appeler super.drop
2021-05-20 02:52:20 +02:00
862ad1faec achat quantite illimitée 2021-05-20 02:52:20 +02:00
053b949414 autoformat 2021-05-20 02:52:20 +02:00
8756dde4e6 fix: ajout du context au constructeur 2021-05-20 02:52:20 +02:00
e35fafddf4 #191 - Ajout de la commande stress 2021-05-19 23:30:57 +02:00
84e4581b34 xp sur alcoolisme 2021-05-19 23:23:50 +02:00
04d631e2b4 #191 - Ajout de la commande stress 2021-05-19 23:22:07 +02:00
61d5e22768 Voir l'archétype draconique
Montrer l'archétype permet de voir les compétences draconiques
pour les personnages qui ne sont pas haut-rêvants
2021-05-19 23:07:05 +02:00
c68d3e47f3 fix: blessure inactive grisée
régression due au passage par fas & retour
2021-05-19 23:06:47 +02:00
69869fb810 Fix: affichage des dés sur éthylisme 2021-05-19 23:05:56 +02:00
36b3cbcae7 Fix: calendrier astrologique
Pb de détermination des chiffres astrologiques désormais async
2021-05-19 23:04:34 +02:00
3621a4e09d #191 - Ajout de la commande stress 2021-05-19 22:44:14 +02:00
7022c2134e Merge branch 'v1.4-cleanup-images' into 'v1.4'
Restore les icones custom

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!244
2021-05-19 19:11:54 +00:00
2316865914 Merge branch 'fix-fatigue' into 'v1.4'
Fix Affichage Fatigue

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!243
2021-05-19 18:25:42 +00:00
15874de96b Restore les icones custom 2021-05-19 19:44:35 +02:00
259f3a0a72 Fix Affichage Fatigue 2021-05-19 19:15:13 +02:00
5b243fe95b Merge branch 'v1.4-cleanup-images' into 'v1.4'
Utiliser icones Fontawesome et fichiers webp

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!242
2021-05-19 05:37:29 +00:00
5efb21dac5 Remove unused svg 2021-05-19 01:31:36 +02:00
d8d27430ed Utiliser icones Fontawesome
Plutôt que les images custom
2021-05-19 01:31:36 +02:00
e0962506ed Utiliser les images webp 2021-05-19 01:31:36 +02:00
853e7f4334 Fix: deprecated in 0.8 2021-05-19 01:21:07 +02:00
d9618c6bbf Merge branch 'v1.4-signes-alcooliques' into 'v1.4'
Consommation d'alcool, signes draconiques, petits fixes

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!241
2021-05-18 18:03:20 +00:00
88d4c917fc La consommation d'alcool
est bonne pour depuis l'équipement

+ bug du à changement de vieValue -> vie
2021-05-18 19:53:56 +02:00
a48f76e8eb Corrections signes draconiques 2021-05-18 19:53:56 +02:00
8fb69b0bc5 Images par défaut à la création d'Items 2021-05-18 19:53:56 +02:00
67daa12e66 Materiel de base et autres 2021-05-18 19:53:56 +02:00
d91ab6e478 Fix: pas de messages de défense
Dans certains cas, il n'y avait plus de message pour que le personnage
attaqué se défense
2021-05-18 00:57:49 +02:00
6247172372 Image du matériel de base 2021-05-18 00:44:19 +02:00
a6ee1b613d Fix: équipement de créature 2021-05-18 00:42:31 +02:00
4715a75d0b Merge branch 'v1.4-signes-draconiques' into 'v1.4'
Gestion des signes draconiques

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!239
2021-05-16 20:42:40 +00:00
9ae72e09f5 Plus de syllabes dans les noms 2021-05-16 22:03:52 +02:00
f87efee2fe Foundry: Roll#evaluate sera async 2021-05-16 22:03:52 +02:00
d1ac4b3d59 Signes draconiques aléatoires 2021-05-16 22:03:52 +02:00
5a452aa17c Commandes pour les signes draconiques 2021-05-16 22:03:52 +02:00
ef08dbeb97 Lecture des signes draconiques 2021-05-16 22:03:52 +02:00
a0f1c36dc6 Ajout de signes draconiques 2021-05-16 22:03:52 +02:00
2c7b37db04 Change scrolling for item sheet
=> content to the sheet body only
2021-05-16 22:03:52 +02:00
73099454b7 Méditation -1 dès echec particulier
CF règles page 215

> En cas d’échec total ou particulier, un malus définitif de -1 est
> désormais appliqué au jet de méditation de cette méthode
2021-05-16 22:03:52 +02:00
f20a8055c6 Minor reformat avant signes draconiques 2021-05-16 22:03:52 +02:00
7b78732b13 Merge branch 'fix-beautyfier' into 'v1.4'
Fix scrolling removal to affect RDD sheets only

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!236
2021-05-12 04:45:32 +00:00
8a38a10d16 Fix scrolling removal to affect RDD sheets only 2021-05-11 21:18:07 +02:00
82729a9855 Merge branch 'feature-some-beautyfier' into 'v1.4'
Add some polish beautify to the character sheet.

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!234
2021-05-09 17:09:50 +00:00
f20487c294 Merge branch 'refactor-scrolling-in-sheets-body' into 'v1.4'
Change the scrolling from the whole sheet content to the sheet body only

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!233
2021-05-09 17:09:03 +00:00
4f05a5e9ca Let the skill icon image be part of the clickable <a> to call skill roll 2021-05-09 19:00:43 +02:00
2338447b56 Add padding to some action texts 2021-05-09 18:59:22 +02:00
b7b34218c3 Change the scrolling from the whole sheet content to the sheet body only 2021-05-09 18:16:01 +02:00
2d777f7ea2 Merge branch 'v1.4' of https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon into v1.4 2021-05-09 16:51:08 +02:00
06cbabb229 Merge branch 'marafal1/foundryvtt-reve-de-dragon-feature-ethylisme-refactor' into v1.4 2021-05-09 16:50:36 +02:00
5f314497d4 Merge branch 'v1.4-fatigue' into 'v1.4'
Option pour ne pas utiliser la fatigue

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!232
2021-05-09 14:49:10 +00:00
51a3c4d04a fatigue optionnelle #113 2021-05-08 20:11:07 +02:00
11131e3b52 Supprimer doublon pélerinage 2021-05-08 18:43:04 +02:00
3625031117 Merge branch 'v1.4' into 'feature-ethylisme-refactor'
# Conflicts:
#   module/actor.js
2021-05-08 12:10:58 +00:00
950ffa3453 Refactor Ethylisme in multiple steps 2021-05-08 13:56:03 +02:00
bf9df5d68e Merge branch 'v1.4' of https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon into v1.4 2021-05-08 07:48:33 +02:00
84ba8b0fa1 Merge branch 'v1.4-commerce' into 'v1.4'
#184 Améliorations du commerce

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!230
2021-05-08 05:41:03 +00:00
27d83cf516 Correction vente
- pas de vente à soi même
- conserver le vendeur lors de la diminution de la quantité
disponible
2021-05-08 03:52:19 +02:00
c4cb3bf60d Ecole de commerce 2021-05-08 02:42:48 +02:00
65a4e1ec69 Fix jet récupération
le +7 n'est pas justifié, sinon on ne fait que des rêves
de dragon
2021-05-08 00:29:59 +02:00
b78d9dd31a Merge branch 'v1.4' of https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon into v1.4 2021-05-07 07:31:08 +02:00
28abc35a21 Merge branch 'v1.4-equipement' into 'v1.4'
Petites corrections

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!228
2021-05-07 05:30:58 +00:00
56c82d935a Fix sortie de conteneur 2021-05-07 02:09:16 +02:00
6eb79c3ec7 suppression param inutile 2021-05-07 02:09:16 +02:00
e41a936def Fix quantité split item 2021-05-07 02:09:16 +02:00
6b96f73b7a Ignorer les différences de coût pour regrouper 2021-05-07 02:09:16 +02:00
474a6a7ed8 Masquer attributs magiques si non-magique 2021-05-07 02:09:16 +02:00
b531e97fd1 Cacher le cout de l'équipement des PJs 2021-05-07 02:09:16 +02:00
67631a46df Fix error changement categorie 2021-05-07 02:09:16 +02:00
c6c098b635 Boire un verre ne rend plus sonné 2021-05-07 02:09:16 +02:00
4fa3f55a06 Fix label for 2021-05-07 02:09:15 +02:00
60e11aa234 Fix typos 2021-05-07 02:09:15 +02:00
2bf718c2f7 Merge branch 'v1.4' of https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon into v1.4 2021-05-07 00:01:09 +02:00
f80a8a8bb2 Minor fixes 2021-05-07 00:01:07 +02:00
b064ce22f0 Merge branch 'feature-add-materiel' into 'v1.4'
Add materiel de base for character creation

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!227
2021-05-06 22:00:24 +00:00
c46e92e8f5 Add materiel de base for character creation 2021-05-06 00:42:01 +02:00
cc103b88ac Merge branch 'v1.4-fix' into 'v1.4'
Amélioration Haut-rêve

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!226
2021-05-04 21:17:06 +00:00
74fc9a7af3 Fix HUD lists on 0.8.2 2021-05-04 21:24:30 +02:00
d1802e7496 Lire un livre depuis l'équipement 2021-05-04 21:24:30 +02:00
8f9346b31c autoformat 2021-05-04 21:24:29 +02:00
42407eaa15 Amélioration Haut-rêve
- affichage liste des sorts
- sorts en réserve avec label de case et dépense de rêve
- Demi-rêve affiché avec le nom de la case (ou le type)
2021-05-04 21:24:29 +02:00
6c783a7139 rename partial tpl actor-sheet 2021-05-04 21:24:29 +02:00
8958377fdb suppression code commentaire 2021-05-04 21:24:29 +02:00
a74ab041f9 Utilisation templates partial 2021-05-04 21:24:29 +02:00
a10311de04 Merge branch 'v1.4-tmr' into 'v1.4'
ajout webp et couleurs

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!225
2021-05-03 18:23:28 +00:00
145ef7a0ba ajout webp et couleurs 2021-05-03 20:02:10 +02:00
e98d99638e Merge branch 'v1.4' of https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon into v1.4 2021-05-02 21:09:01 +02:00
93b4d2ce7e Make TMR great again.... 2021-05-02 21:08:50 +02:00
09256ad9a3 Merge branch 'fix-calendar-082' into 'v1.4'
Fix calendar 082

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!224
2021-05-01 21:51:40 +00:00
66e4f6ad02 Merge branch 'v1.4-des' into 'v1.4'
Fix dé dragon sans bords pour tous

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!222
2021-05-01 21:50:31 +00:00
ef885710d9 Merge branch 'v1.4' into 'v1.4'
Update gitignore

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!221
2021-05-01 21:49:58 +00:00
6d7d55e12b Fix 0.8.2 actors 2021-05-01 19:12:55 +02:00
3c6d286713 Fix Calendar for Foundry 0.8.2 2021-05-01 17:33:01 +02:00
a326e43ff6 Utiliser des polices pour les dés
Afin de ne pas avoir de soucis de couleurs
2021-05-01 16:55:59 +02:00
06a79cba76 Dé des heures
inutile, donc indispensable

 /roll 1dh
2021-05-01 16:55:37 +02:00
80b10cbbaa Fix dé dragon sans bords pour tous
Pas uniquement pour le système rdd
2021-05-01 16:55:30 +02:00
94136b8879 Jolis dés draconiques 2021-05-01 16:55:21 +02:00
caeff1e82a Update gitignore 2021-05-01 16:45:53 +02:00
8e565e3ca6 Aide tchat dans un dialogue 2021-05-01 12:57:01 +02:00
c7ba56b90b Merge branch 'feature-ethylisme-to-template' into 'v1.4'
Update "Jet d'éthylisme" to use a handlebars template

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!220
2021-04-30 21:10:09 +00:00
65815348f4 Merge remote-tracking branch 'origin/feature-ethylisme-to-template' into feature-ethylisme-to-template 2021-04-29 20:41:22 +02:00
d774e72565 Update "Jet d'ethylisme" to use a handlebars template 2021-04-29 20:40:52 +02:00
0c57a243f7 Update "Jet d'ethylisme" to use a handlebars template 2021-04-28 23:25:48 +02:00
4e4e75279d Merge branch 'v1.4-blessures' into 'v1.4'
Amélioration des blessures #173

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!217
2021-04-28 07:42:01 +00:00
4ecc8826f6 Gestion TMR caché, WIP #135 2021-04-28 00:48:39 +02:00
305e5e9d04 Amélioration des blessures #173 2021-04-28 00:31:24 +02:00
d486fa7aff Merge branch 'v1.4-blessures' into 'v1.4'
Amélioration présentation blessures #173

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!214
2021-04-27 07:34:22 +00:00
cd95e68854 typofix 2021-04-27 00:35:03 +02:00
c93459b81e Amélioration, rappel-des-regles 2021-04-27 00:32:32 +02:00
0152607a69 Amélioration présentation blessures #173 2021-04-27 00:30:46 +02:00
f2a2b2acda Fix: recul sur encaissement créature #187 2021-04-26 22:15:41 +02:00
33ed7bfe2c #185 - Reinit nombres astraux 2021-04-25 10:08:40 +02:00
d42de6c316 Merge branch 'v1.4-dialog' into 'v1.4'
Rework dialogues

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!212
2021-04-24 06:52:28 +00:00
3be9be92ec Rework lancer de sort 2021-04-24 00:52:02 +02:00
25c8c38722 Reformat carac/comp 2021-04-24 00:52:02 +02:00
79485e828a Rework dialog Rêve de Dragon 2021-04-24 00:52:02 +02:00
fd42634b19 Sommeil pour le double-rêve 2021-04-24 00:52:02 +02:00
208dfef83f Fix cuisine/recettecuisine
Utiliser le nom de la compétence ou le nom de l'objet
2021-04-24 00:52:02 +02:00
3fe8e834c8 Fix dé draconique 0.8 2021-04-24 00:52:02 +02:00
fb490f8ac8 description complete sur mouseover 2021-04-24 00:52:02 +02:00
3646fd2033 Merge branch 'v1.4-dialog' into 'v1.4'
Présentation des fenêtre de dialogue

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!211
2021-04-21 21:20:48 +00:00
b663560b53 Rework cuisine 2021-04-21 22:04:24 +02:00
70b3feede8 Rework oeuvre 2021-04-21 22:04:24 +02:00
c50c417d5b rework musique 2021-04-21 22:04:24 +02:00
8dea766540 Rework méditation 2021-04-21 22:04:24 +02:00
cc2254112f tooltip pour titres 2021-04-21 22:04:24 +02:00
4b7817c9d8 remove hbs log 2021-04-21 22:04:24 +02:00
710a768bb6 Rework jet éthylisme 2021-04-21 22:04:24 +02:00
31c5be26a3 Rework maitrise tmr 2021-04-21 22:04:24 +02:00
496a411fcc Reformat 2021-04-21 22:04:24 +02:00
226319b067 Merge branch 'v1.4-dialogs' into 'v1.4'
V1.4 dialogs

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!210
2021-04-21 09:18:48 +00:00
a20037698b Rework chant danse jeu 2021-04-21 00:59:45 +02:00
d376ba1c26 Ajout partial-select-carac 2021-04-21 00:59:45 +02:00
8393700ac8 Rework jet caractéristique 2021-04-21 00:59:44 +02:00
550f45d14c Rework dialog Alchimie 2021-04-21 00:59:44 +02:00
3c793296a6 Merge branch 'v1.4-dialog-competence' into 'v1.4'
V1.4 dialog competence

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!209
2021-04-20 15:54:41 +00:00
0e9bc372bf Rework dialog-competence 2021-04-20 00:53:34 +02:00
f0af45d106 Fix expérience sur /rdd 2021-04-20 00:53:34 +02:00
f0b042626f Fix: niveau de compétence dans dialog roll 2021-04-20 00:53:34 +02:00
77f0a93eb6 Fix ajustements visible 2021-04-20 00:53:34 +02:00
a9d49d793c Fix encTotal dans dialogues 2021-04-20 00:53:34 +02:00
b7c913ac50 Merge branch 'v1.4-fix' into 'v1.4'
Fix: après dérobade, impossible ouvrir fiche

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!207
2021-04-18 06:38:44 +00:00
9e36804244 Fix: après dérobade, impossible ouvrir fiche 2021-04-17 21:05:47 +02:00
a7e9fc6ae4 Merge branch 'v1.4-tokens' into 'v1.4'
Ajout de tokens de créatures

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!205
2021-04-17 07:17:48 +00:00
66cd0a90ed Ajout de tokens de créatures 2021-04-17 00:05:36 +02:00
afe8e5067a Merge branch 'v1.4-fix' into 'v1.4'
Empêcher doublons sur tête/souffle #175

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!204
2021-04-16 21:39:57 +00:00
f05a166d5b Empêcher doublons sur tête/souffle #175
Lors de l'ajout de la tête présents des cités, le présent de chaque
cité était ajouté par tous les joueurs connectés qui traitaient le hook
2021-04-16 23:25:37 +02:00
6fc8906d67 Fix initiative 0.8.x 2021-04-16 22:18:57 +02:00
a7b228afe3 Merge branch 'v1.4-cuisine' into 'v1.4'
Séparation qualité/exotisme, ajout de nourriture #168

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!202
2021-04-16 07:15:10 +00:00
ecba3b32e7 Fix compendium voyageurs
- nom de token Coureur des Rues
- don de haut rêve pour le Cuisinier Haut-Rêvant
- tokens maintenant neutres

# Conflicts:
#	packs/voyageurs.db
2021-04-16 00:35:34 +02:00
f349c57a32 Ajout de nourritures et boissons 2021-04-16 00:35:34 +02:00
693e3eb6d0 Separation qualite exotisme 2021-04-16 00:35:34 +02:00
fde5096c59 Merge branch 'v1.4-commerce' into 'v1.4'
Payer donne l'argent à qui de droit

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!200
2021-04-15 06:16:42 +00:00
e0ce7d1e33 Suppression des messages pour les objets payés 2021-04-15 01:14:24 +02:00
94bc70a2c9 Payer un autre personnage 2021-04-15 00:25:40 +02:00
c2f5229ca6 Permettre de déléguer un appel au MJ
permettre de poster un message au MJ pour que du code soit exécuté par
le MJ.

Ceci permet par exemple à un joueur de payer un objet posté par un autre
joueur, et que l'argent soit transféré à l'autre joueur
2021-04-15 00:13:50 +02:00
413893bc67 Garder trace du vendeur 2021-04-14 22:40:12 +02:00
a282575422 On peut donner gratuitement
en utilisant payer à un prix de 0
2021-04-14 22:29:20 +02:00
b37de0a420 Payer pour l'actor d'un token
Comme ça le MJ peut acheter lui aussi
2021-04-14 22:28:49 +02:00
44e212cd12 Fix drop conteneurs 2021-04-14 21:51:29 +02:00
93865f2c4b Merge branch 'v1.4-regrouper' into 'v1.4'
Regrouper des équipements #169

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!199
2021-04-13 20:56:29 +00:00
91f532409b Regrouper des équipements #169 2021-04-13 22:44:17 +02:00
b4eb66bef5 Fix: déplacement de conteneur 2021-04-13 22:43:26 +02:00
3152d87078 Déplacement Drop dans Actor 2021-04-13 22:43:26 +02:00
1cab660a2f Menues corrections 2021-04-13 22:36:03 +02:00
6e29f497eb Merge branch 'v1.4-split' into 'v1.4'
Séparer les piles d'éléments #169

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!198
2021-04-13 07:36:06 +00:00
84ea567045 Séparer les piles d'éléments #169 2021-04-13 01:12:45 +02:00
d21cd86ccd Ajout image dans dialog Consommer 2021-04-13 01:10:48 +02:00
870ca61d7d Merge branch 'v1.4-consommer' into 'v1.4'
Continuer la nourriture

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!197
2021-04-12 06:03:35 +00:00
99c58233ef Pas de dialogue pour boire une potion 2021-04-12 01:03:37 +02:00
b1f0d54837 Boire une potion de soin 2021-04-12 00:16:23 +02:00
a39e2a3256 Rename herbeData (creer potion d'herbe) 2021-04-11 23:03:55 +02:00
893f2aa835 Minor cleanup ActiveEffect 2021-04-11 23:03:03 +02:00
b27ff16857 Utiliser class plutôt que id 2021-04-11 23:02:12 +02:00
a13b9f9c56 Fix encombrement herbes 2021-04-11 23:01:57 +02:00
df45c4bbbb Simplification inventaire 2021-04-11 23:01:35 +02:00
3d8453dc2d Consommer nourriture, suite #168 2021-04-11 23:01:10 +02:00
6b31e81c72 Possibilité de poster de la nourriture
+ utilisation de l'Item de l'actor plutôt qu'une copie
+ extraction fonction pour diminuer la quantité d'un item
2021-04-11 18:47:00 +02:00
7dc1724ab7 Auto format 2021-04-11 18:43:32 +02:00
07b68020b2 #181 Gestion potions (fabrication) 2021-04-11 12:07:43 +02:00
daa2421ba4 #181 Gestion potions (fabrication) 2021-04-10 21:08:55 +02:00
1b3c5f524d #181 Gestion potions (fabrication) 2021-04-10 21:07:53 +02:00
1cea9753a9 #171 - Gestion potions / consommation 2021-04-09 18:13:34 +02:00
cc24471926 #171 - Gestion potions / consommation 2021-04-09 17:30:32 +02:00
31d2c01ebb #171 - Gestion des potions de repos 2021-04-09 15:23:48 +02:00
38b58cd4b0 Merge branch 'v1.4-fix-182' into 'v1.4'
Fix xp des compétences tronc #182

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!194
2021-04-09 06:05:29 +00:00
1f4523930c class pour sélection par nom de champ 2021-04-09 01:08:30 +02:00
0ae77f6889 Fix xp des compétences tronc #182
La méthode splice retourne les éléments supprimées, et non pas
le tableau après suppression
2021-04-09 01:08:16 +02:00
f25ae66de1 Merge branch 'v1.4-cuisine' into 'v1.4'
Créer des plats cuisinés

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!193
2021-04-08 19:17:42 +00:00
8bbf40a84b Créer des plats cuisinés
Lors de l'exécution d'une recette de cuisine, permettre l'ajout d'un
plat à l'équipement
2021-04-08 20:39:32 +02:00
dcdfa357c1 Fix équipement des véhicules 2021-04-08 20:39:32 +02:00
3e5e745067 Les monnaies ont de la valeur et enc
Résout un pb de NaN sur enc total
2021-04-08 20:39:32 +02:00
8a7d8a6930 Sync 2021-04-07 22:46:57 +02:00
62261d1748 Merge branch 'v1.4-nourriture' into 'v1.4'
Nourriture et boissons #168

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!192
2021-04-07 18:04:29 +00:00
35004547dd dialogs ne sont pas pour un sort 2021-04-06 23:45:55 +02:00
4efa321693 Consommer nourriture et boisson WIP 2021-04-06 23:44:57 +02:00
8770b29a5e Ajout Item nourritureboisson 2021-04-06 23:43:53 +02:00
e8626f3566 Option pour état général hors éthylisme
Préparation pour les abus de nourriture et boissons
2021-04-06 23:39:27 +02:00
674582d6e8 Fixes sur calculs enc et prix
Ajout de la classe de base RdDItem qui se charge du calcul pour un Item

Formatage de la zone d'équipement pour avoir de la place pour le Nom

Simplification des calculs de totaux
2021-04-06 23:36:35 +02:00
4792e36922 Compatible v0.8.x 2021-04-06 23:24:26 +02:00
dc48f08203 #171 - Gestion potion de soins (WIP) 2021-04-04 23:07:13 +02:00
9cc73e971d #171 - Gestion potion de soins (WIP) 2021-04-04 22:47:33 +02:00
f7c1ed0749 #171 - Gestion potion de soins (WIP) 2021-04-04 22:34:59 +02:00
18f1d314b7 #171 - Gestion potion de soins (WIP) 2021-04-04 18:42:09 +02:00
a5561b7b88 #171 - Gestion potion de soins (WIP) 2021-04-04 18:37:16 +02:00
e4f432c781 #171 - Gestion potion de soins 2021-04-04 09:37:35 +02:00
f8171fecc3 Message explicite HR 2021-04-04 09:03:06 +02:00
795e80d575 Message explicite HR 2021-04-04 08:58:57 +02:00
4538472fc0 Merge branch 'v1.4-report-master' into 'v1.4'
Demi-surprise: Réussite normale => échec #181

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!191
2021-04-04 06:50:26 +00:00
6955d4597b Remove log 2021-04-04 00:39:22 +02:00
8089e0c83e Fix armes 1/2 mains dans la liste d'armes 2021-04-04 00:39:22 +02:00
4730cc9e8d Demi-surprise: Réussite normale => échec #181
En demi-surprise, les résultats "réussite normaux" sont
maintenant présenté comme des réussite insuffisantes

# Conflicts:
#	module/rdd-resolution-table.js
2021-04-04 00:39:22 +02:00
36695e2d10 Erreur si draconic sans être haut-rêvant 2021-04-04 00:39:22 +02:00
8f4675d717 Fix: message pour non haut-rêvant 2021-04-04 00:39:21 +02:00
31bff0861f Fix sur commande astro 2021-04-03 23:01:47 +02:00
56cf4243a8 #179 - Fix reve-actuel 2021-04-03 08:31:01 +02:00
97d53d3f31 Merge branch 'v1.4' of https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon into v1.4 2021-04-03 08:19:30 +02:00
65348b0710 #180 - Fix 2021-04-03 08:19:19 +02:00
70add73ad7 Merge branch 'v1.4-hautreve' into 'v1.4'
Draconic pour les haut-rêvants - HUD

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!187
2021-04-03 06:16:30 +00:00
f82d110ce3 Correction message échec total 2021-04-03 03:11:52 +02:00
2586fe7e27 Draconic que pour les Haut rêvant #174 2021-04-03 03:09:51 +02:00
8f58e12c05 Merge branch 'v1.4-hautreve' into 'v1.4'
#174: Limiter le draconic aux Haut rêvant

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!186
2021-04-02 06:44:58 +00:00
e014541d2a Fix icones 2021-04-01 23:11:13 +02:00
f26daf4981 Les haut-rêvants ont le don de haut rêve 2021-04-01 23:11:13 +02:00
3b2ea7d82f #174: Limiter le draconic aux Haut rêvant 2021-04-01 23:11:13 +02:00
0bae3e82a8 clean malusArmure/enc/prix 2021-04-01 23:11:13 +02:00
852cf51dc1 Merge branch 'v1.4-fix' into 'v1.4'
Fix ajout list/filterItemsData

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!183
2021-04-01 05:41:50 +00:00
74ee2e93cc Fix Chanter la chanson 2021-04-01 00:45:56 +02:00
f7279bef7c Fix changement jour 2021-04-01 00:45:56 +02:00
47484e6a85 Fix: ne pas utiliser combatant._id dans HUD 2021-04-01 00:45:56 +02:00
6429eda2d6 Fix détermination nombre astral
fixé, déplacé dans les savoirs
2021-04-01 00:45:44 +02:00
8a95ad6471 Fix ajout list/filterItemsData
Méthodes pour lister par type/filtrer les Item.data
et retourner les Item.data
2021-04-01 00:45:44 +02:00
3d866e343b Simplification calcul de difficulté alchimie 2021-03-31 22:51:32 +02:00
3691775da0 Fix alchimie 2021-03-31 22:50:58 +02:00
62e0153d0d Fix reférence de recette de cuisine 2021-03-31 21:37:22 +02:00
e1f0d199c1 Merge branch 'v1.4-fix' into 'v1.4'
Fix sur tests

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!181
2021-03-31 06:41:06 +00:00
81d68e5ba3 Fix jet créatures 2021-03-31 01:27:51 +02:00
036456e5df Fix token HUD
Utilisation de Misc.data pour:
- combattants
- armes
- competences d'armes
2021-03-31 01:27:51 +02:00
e0eb04d829 Création d'oeuvres 2021-03-31 01:27:51 +02:00
5383bd228d Fix récupération chance 2021-03-31 01:27:51 +02:00
ee34fad8b1 Fix encaissement
- Amélioration du message d'encaissement (suppressions d'espaces en
excédent)
- Encaissement "cauchemar" réservé aux entités et inversement
2021-03-31 01:27:51 +02:00
5e654bdfa4 Fix protection armure 2021-03-31 01:27:51 +02:00
2efb942bea Fix typo getEmbeddedDocument 2021-03-31 01:27:51 +02:00
576088c2bb Fix moral (cas ajustement 0)
Lors de Chateau Dormant, si le moral ne change pas, on utilise
le retour de moralIncDec pour avoir la valeur courante du moral
2021-03-31 01:27:51 +02:00
3f14d2b833 Merge branch 'v1.4-fix-items' into 'v1.4'
Methode getItemOfType, Misc.data pour Items, remplacement de OwnedItems, fix casetmrs, et plus

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!180
2021-03-30 04:38:14 +00:00
86fb6111db Encore des fix OwnedItem / item.data 2021-03-30 00:02:51 +02:00
ba41886522 Fix tooltip périple 2021-03-29 23:59:27 +02:00
0cd4c7c158 Avancement OwnedItems et Items
- remplacer xxxOwnedItems par xxxEmbeddedDocuments
- corrections des accès aux items vs itemData
- corrections cases spéciales TMR et effets draconiques
- correction monnaies/payer
2021-03-29 23:41:08 +02:00
7f75361a08 Corrections de hooks 2021-03-29 20:11:32 +02:00
68cd086a2f Corrections StatusEffect
changement du hook, et des méthodes pour les ajouter
2021-03-29 20:11:07 +02:00
049b46e3cc Fix ActiveEffect demi-rêve
L'ActiveEffect demi-rêve n'était plus supprimé
2021-03-29 19:44:21 +02:00
3735377a20 Utiliser EmbeddedDocuments
les méthodes Entity son deprecated/à ne plus utiliser
2021-03-29 19:43:23 +02:00
31204cbf51 Utilisation Misc.data 2021-03-29 19:42:00 +02:00
592f54af61 Fix: bouton filtrer competences
Le niveau de base était incorrect
2021-03-29 14:41:25 +02:00
d743578f3f Methode getItemOfType, Misc.data pour Item
- Passer par Misc.data/Misc.templateData pour les Item
- Méthode getObjet pour obtenir un objet par id
- Simplification du code sur les conteneurs

On peut sortir un objet d'un conteneur

# Conflicts:
#	module/actor.js
2021-03-29 13:24:56 +02:00
36df301144 Various fixes for TMR, WIP 2021-03-28 22:37:04 +02:00
f043c3b504 Fix : monnaie, endurance, encombrement 2021-03-28 09:43:26 +02:00
3df76c589f Fix : monnaie, endurance, encombrement 2021-03-28 09:41:14 +02:00
67bb14795c Fix /payer 2021-03-27 14:57:25 +01:00
5de4dd016f Fix conteneur/objet 2021-03-25 19:03:28 +01:00
5b53d4c2c9 Debug sorts, WIP 2021-03-25 18:33:10 +01:00
be04157fb0 Item ingredient livre potion munition rencontre queue ombre souffle tete competencecreature tarot monnaie nombrestral 2021-03-25 18:04:57 +01:00
ceb73b9944 Item arme, armure, competences, sorts, herbes -> OK 2021-03-25 17:51:03 +01:00
1616931476 Edition des items, WIP 2021-03-25 09:28:36 +01:00
fd6c3ac7c6 Merge branch 'v1.4-adapt-acteur' into 'v1.4'
Adaptation Feuilles Acteurs

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!176
2021-03-25 06:30:26 +00:00
43cf091345 Adaptation Feuilles Acteurs 2021-03-25 03:21:43 +01:00
5fb8d22a7a Jets de masse
Quelques exemples:

- `/rdd dexterite bricolage -2`
- `/rdd vue survie en sous-sol -2`
- `/rdd vue désert 0`
- `/rdd vue vigi -3`
- `/rdd vol vigi 0` : Volonté Vigilance
- `/rdd chance-actuelle 0`
- `/rdd reve-actuel -8`

Attention:
- `/rdd vue vig 0`

 => Navigation et Vigilance correspondent, c'est Navigation qui est
pris (premier dans l'ordre alphabétique), avec un message.
2021-03-25 00:31:40 +01:00
292 changed files with 8301 additions and 26352 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
.vscode/settings.json
.idea
todo.txt
todo.md
/.vscode

View File

@ -1,43 +0,0 @@
[editor]
line_wrapping=false
line_break_column=72
auto_continue_multiline=true
[file_prefs]
final_new_line=true
ensure_convert_new_lines=false
strip_trailing_spaces=false
replace_tabs=false
[indentation]
indent_width=2
indent_type=0
indent_hard_tab_width=8
detect_indent=false
detect_indent_width=false
indent_mode=2
[project]
name=RdD
base_path=/home/morr/work/foundryvtt/foundryvtt-reve-de-dragon
description=
file_patterns=
[long line marker]
long_line_behaviour=1
long_line_column=72
[files]
current_page=8
FILE_NAME_0=9759;JSON;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplate.json;0;2
FILE_NAME_1=8120;CSS;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fstyles%2Fsimple.css;0;2
FILE_NAME_2=19778;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Ftmr-utility.js;0;2
FILE_NAME_3=21106;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor.js;0;2
FILE_NAME_4=6228;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Factor-sheet.js;0;2
FILE_NAME_5=20083;HTML;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Ftemplates%2Factor-sheet.html;0;2
FILE_NAME_6=1312;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-tmr-dialog.js;0;2
FILE_NAME_7=1767;Javascript;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fmodule%2Frdd-roll-dialog.js;0;2
FILE_NAME_8=266;None;0;EUTF-8;0;1;0;%2Fhome%2Fmorr%2Fwork%2Ffoundryvtt%2Ffoundryvtt-reve-de-dragon%2Fpacks%2Fqueues-de-dragon.db;0;2
[VTE]
last_dir=/home/sigmar

61
dev-notes.md Normal file
View File

@ -0,0 +1,61 @@
# Actor notes
> The Actor#getData default implementation gives you the following for use in sheet rendering:
```
actor -> the Actor instance
data -> a cloned copy of Actor#data
items -> a cloned copy of Actor#data#items
effects -> a cloned copy of Actor#data#effects
```
> if all you need is a safe copy of `Actor#data`, you'll be much better off by simply defining your own function and avoiding all the wasted work that the parent class does which will slow down your sheet
```js
getData(options) {
return {
data: foundry.utils.deepClone(this.object.data)
}
}
```
who knows, maybe you don't even need to copy your actor data, skip the copy and it's even faster:
```js
getData(options) {
return {
data: this.object.data
}
}
```
Atropos19/02/2021
There are two recommended ways to create owned items in 0.8.0:
```js
await Item.create(itemData, {parent: actor});
await actor.createEmbeddedDocuments("Item", itemDataArray);
```
You can update an embedded item in one of two ways:
```js
//Method 1:
const item = actor.items.get(itemId);
item.update(data);
//Method 2:
actor.updateEmbeddedDocuments("Item", [{_id: itemId, ...}]);
```
I noticed adding an ActiveEffect to an actor in code using
```js
this.createEmbeddedDocuments('ActiveEffect', [effet], options);
this.applyActiveEffects();
```
Atropos — Aujourdhui à 14:42
Two notes on this:
1. You don't actually need to call this.applyActiveEffects() because this will happen automatically whenever an effect is created/updated/deleted
2. If you want to suppress the automatic display of the sheet for the newly created document, you can pass options.renderSheet = false as part of your options object

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
icons/creatures/dong_t.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
icons/heures/de-heures.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
icons/heures/hd01.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
icons/heures/hd02.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
icons/heures/hd03.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
icons/heures/hd04.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
icons/heures/hd05.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
icons/heures/hd06.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
icons/heures/hd07.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
icons/heures/hd08.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
icons/heures/hd09.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
icons/heures/hd10.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
icons/heures/hd11.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
icons/heures/hd12.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 23 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.8 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 29 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.3 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 22 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.9 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 10 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 387 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 382 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 372 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 368 KiB

View File

@ -1,130 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="512"
height="512"
viewBox="0 0 512 512"
xml:space="preserve"
sodipodi:docname="gift.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"><metadata
id="metadata51"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
id="defs49" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="3840"
inkscape:window-height="2066"
id="namedview47"
showgrid="false"
inkscape:zoom="2.415894"
inkscape:cx="64"
inkscape:cy="163.34211"
inkscape:window-x="-11"
inkscape:window-y="-11"
inkscape:window-maximized="1"
inkscape:current-layer="g14"
inkscape:document-rotation="0" />
<g
id="g14"
transform="matrix(5.7,0,0,5.7,1.6591,1.6521435)">
<g
id="g24-9"
transform="matrix(0.1754386,0,0,0.1754386,3.2674006,3.2686582)"
style="fill:#ffffff;stroke:none"><path
d="m 81.245,212.419 c -9.902,13.127 -19.256,25.526 -8.273,47.079 4.957,9.729 18.132,11.771 28.311,11.771 20.904,0 45.125,-8.057 63.033,-19.182 -2.994,-3.719 -6.111,-8.237 -6.111,-13.949 0,-6.576 4.131,-11.571 7.451,-15.585 1.601,-1.936 3.415,-4.129 3.882,-5.569 0.523,-1.607 0.357,-4.439 0.197,-7.178 -0.299,-5.108 -0.67,-11.466 3.069,-16.605 2.653,-3.644 6.503,-5.517 10.286,-6.759 -3.608,-8.125 -8.398,-16.488 -14.204,-24.48 -14.902,-20.512 -32.983,-33.767 -46.06,-33.767 -2.845,0 -5.39,0.592 -7.78,1.81 -21.868,11.143 -21.404,26.636 -20.912,43.039 0.22,7.359 0.429,14.31 -1.603,20.561 -2.198,6.767 -6.612,12.619 -11.286,18.814 z"
id="path2"
style="fill:#ffffff;stroke:none" /><path
d="m 464.076,203.816 c -7.567,-14.789 -26.952,-17.893 -41.88,-17.893 -9.41,0 -19.295,1.161 -29.221,3.252 1.645,2.602 3.775,5.369 5.992,8.235 10.528,13.614 24.948,32.259 9.778,62.032 -5.735,11.255 -17.472,17.797 -34.132,19.144 4.004,3.046 7.514,6.264 10.369,9.608 7.716,9.035 10.98,18.948 9.44,28.668 -5.153,32.537 -27.667,39.408 -44.107,44.425 -2.622,0.8 -5.172,1.586 -7.547,2.43 17.125,17.508 34.971,27.756 49.438,27.756 4.384,0 8.483,-0.96 12.185,-2.855 32.102,-16.428 31.354,-39.981 30.631,-62.76 -0.318,-10.034 -0.619,-19.512 2.054,-27.791 2.912,-9.018 8.93,-17.024 15.301,-25.501 14.344,-19.083 27.892,-37.108 11.699,-68.75 z"
id="path4"
style="fill:#ffffff;stroke:none" /><path
d="m 270.444,394.702 c 2.878,0.456 5.642,0.687 8.214,0.687 18.176,0 25.863,-11.274 34.001,-23.211 4.148,-6.084 8.066,-11.83 13.384,-15.693 5.755,-4.182 12.766,-6.321 20.188,-8.587 15.727,-4.8 30.581,-9.333 34.364,-33.225 0.893,-5.63 -1.213,-11.479 -6.258,-17.386 -8.141,-9.532 -23.127,-18.049 -39.956,-23.652 -1.862,-0.538 -3.721,-1.116 -5.575,-1.729 -9.632,-2.772 -19.668,-4.561 -29.237,-5.027 0.292,5.036 0.549,11.19 -3.092,16.193 -3.771,5.18 -9.963,6.789 -14.938,8.081 -2.629,0.683 -5.348,1.389 -6.67,2.351 -1.28,0.933 -2.769,3.273 -4.207,5.537 -2.776,4.368 -6.232,9.804 -12.397,11.806 -1.511,0.491 -3.127,0.739 -4.804,0.739 -1.835,0 -3.626,-0.305 -5.359,-0.754 -3.383,17.09 -3.525,36.966 0.635,54.293 2.436,10.148 8.497,27.485 21.707,29.577 z"
id="path6"
style="fill:#ffffff;stroke:none" /><path
d="m 126.439,366.003 c -16.52,-4.826 -39.144,-11.435 -44.37,-44.438 -1.539,-9.719 1.725,-19.632 9.44,-28.667 2.257,-2.643 4.924,-5.206 7.915,-7.669 -19.207,-0.406 -32.657,-7.071 -38.927,-19.376 -14.955,-29.353 -0.779,-48.145 9.572,-61.866 1.457,-1.931 2.882,-3.822 4.177,-5.669 -8.438,-1.537 -16.798,-2.384 -24.81,-2.384 -15.076,0 -34.636,3.13 -42.2,18.042 -16.315,32.161 -1.866,50.776 12.108,68.778 6.156,7.931 11.971,15.422 14.674,23.692 2.944,9.006 2.782,19.021 2.61,29.623 -0.386,23.87 -0.751,46.416 30.949,62.497 3.678,1.866 7.743,2.811 12.085,2.811 15.828,0 35.7,-12.34 54.219,-33.068 -2.312,-0.8 -4.839,-1.546 -7.442,-2.306 z"
id="path8"
style="fill:#ffffff;stroke:none" /><path
d="m 276.172,62.189 c 12.786,0 24.223,5.22 34.962,15.96 9.115,9.115 11.603,22.92 7.36,39.616 9.602,-6.462 19.178,-9.98 27.922,-9.98 5.036,0 9.792,1.123 14.137,3.337 29.352,14.955 28.93,38.491 28.62,55.676 -0.036,2.032 -0.067,4.02 -0.056,5.943 13.727,-6.889 25.322,-15.114 32.853,-23.947 7.611,-8.928 10.762,-17.875 9.364,-26.592 C 425.63,86.594 402.997,80.027 381.11,73.676 371.468,70.879 362.361,68.236 355.314,63.135 347.636,57.578 341.881,49.38 335.789,40.701 324.269,24.291 312.358,7.323 285.965,7.323 c -3.748,0 -7.768,0.339 -11.947,1.009 -20.054,3.212 -28.987,28.625 -32.527,43.488 -1.487,6.242 -2.569,12.945 -3.271,19.898 3.292,-0.724 7.018,-2.048 10.899,-3.439 7.965,-2.855 16.995,-6.09 27.053,-6.09 z"
id="path10"
style="fill:#ffffff;stroke:none" /><path
d="m 80.254,180.726 c 0.028,-2.296 -0.039,-4.745 -0.114,-7.261 -0.516,-17.203 -1.222,-40.762 28.551,-55.932 4.345,-2.214 9.101,-3.336 14.136,-3.336 8.349,0 17.457,3.203 26.621,9.117 -6.331,-19.186 -4.373,-35.058 5.734,-45.165 10.691,-10.692 22.104,-15.89 34.887,-15.89 9.877,0 18.926,3.121 26.909,5.875 1.419,0.49 2.817,0.97 4.191,1.424 -0.685,-4.98 -1.561,-9.809 -2.666,-14.377 -3.594,-14.851 -12.618,-40.235 -32.683,-43.376 -4.124,-0.646 -8.094,-0.973 -11.801,-0.973 -26.95,0 -38.601,17.153 -49.868,33.742 -5.641,8.306 -10.969,16.151 -17.999,21.277 -7.655,5.583 -17.23,8.524 -27.367,11.638 -22.821,7.009 -44.376,13.629 -49.874,48.746 -1.361,8.696 1.798,17.605 9.392,26.48 9.129,10.667 24.272,20.436 41.951,28.011 z"
id="path12"
style="fill:#ffffff;stroke:none" /><path
d="m 328.161,374.443 c -1.295,1.753 -2.6,3.664 -3.935,5.621 -8.438,12.375 -19.993,29.324 -45.568,29.324 -3.304,0 -6.804,-0.289 -10.403,-0.859 -12.671,-2.006 -22.761,-11.63 -29.146,-27.494 -6.21,18.666 -16.992,30 -30.871,32.198 -3.581,0.567 -7.063,0.854 -10.349,0.854 -25.198,0 -36.474,-16.121 -45.533,-29.075 -1.561,-2.232 -3.085,-4.399 -4.611,-6.387 -2.519,4.654 -4.752,9.299 -6.633,13.862 -5.821,14.126 -13.439,39.965 0.946,54.3 11.86,11.818 23.598,17.323 36.938,17.323 11.172,0 21.87,-3.855 32.217,-7.584 9.445,-3.404 18.367,-6.619 27.066,-6.634 9.527,0 18.977,3.24 28.98,6.671 10.371,3.556 21.096,7.234 32.052,7.234 h 0.005 c 13.408,-0.002 25.147,-5.516 36.943,-17.354 14.313,-14.363 6.645,-40.121 0.8,-54.197 -2.432,-5.852 -5.439,-11.836 -8.898,-17.803 z"
id="path14"
style="fill:#ffffff;stroke:none" /><path
d="m 190.069,76.259 c -9.005,0 -16.944,3.746 -24.987,11.789 -9.459,9.458 -4.171,27.047 -0.177,36.69 7.686,18.555 21.693,36.525 36.309,48.605 2.38,-3.296 5.398,-6.483 9.806,-7.914 1.511,-0.491 3.127,-0.739 4.805,-0.739 4.22,0 8.227,1.567 11.763,2.949 2.6,1.016 5.287,2.067 7.057,2.067 1.77,0 4.457,-1.051 7.057,-2.067 3.535,-1.382 7.543,-2.948 11.762,-2.948 1.678,0 3.294,0.249 4.805,0.739 3.715,1.206 6.442,3.662 8.633,6.377 13.957,-12.04 27.143,-29.278 34.512,-47.07 3.994,-9.643 9.282,-27.231 -0.176,-36.69 -8.092,-8.091 -16.055,-11.859 -25.063,-11.859 -7.626,0 -15.102,2.679 -22.331,5.27 -6.931,2.484 -13.477,4.83 -20.049,4.83 -7.115,0 -14.044,-2.39 -21.379,-4.92 -7.286,-2.512 -14.816,-5.109 -22.347,-5.109 z"
id="path16"
style="fill:#ffffff;stroke:none" /><path
d="m 396.271,253.086 c 11.144,-21.87 1.661,-34.13 -8.379,-47.111 -4.504,-5.824 -8.758,-11.324 -10.789,-17.574 -2.199,-6.768 -2.067,-14.096 -1.928,-21.855 0.296,-16.44 0.575,-31.969 -20.978,-42.951 -2.392,-1.218 -4.936,-1.811 -7.781,-1.811 -13.076,0 -31.153,13.253 -46.055,33.763 -7.177,9.878 -12.801,20.322 -16.549,30.183 4.48,1.242 9.45,3.059 12.663,7.474 3.74,5.139 3.368,11.496 3.069,16.604 -0.16,2.739 -0.326,5.571 0.196,7.178 0.467,1.44 2.281,3.633 3.882,5.568 3.319,4.014 7.45,9.008 7.45,15.583 0,3.601 -1.241,6.724 -2.907,9.475 6.998,4.038 14.811,7.587 22.921,10.41 3.011,0.836 5.989,1.759 8.917,2.766 9.424,2.568 18.994,4.068 27.956,4.068 10.181,0.001 23.356,-2.041 28.312,-11.77 z"
id="path18"
style="fill:#ffffff;stroke:none" /><path
d="m 95.897,319.376 c 3.839,24.242 18.717,28.588 34.468,33.189 7.066,2.064 13.742,4.015 19.059,7.877 5.757,4.182 9.957,10.189 14.404,16.547 8.308,11.878 16.155,23.098 34.061,23.098 2.555,0 5.299,-0.229 8.159,-0.683 13.211,-2.092 19.271,-19.429 21.708,-29.577 4.71,-19.62 3.901,-42.504 -0.881,-60.914 -3.359,1.307 -7.109,2.672 -11.051,2.672 -1.678,0 -3.294,-0.249 -4.805,-0.739 -6.165,-2.001 -9.621,-7.438 -12.398,-11.805 -1.439,-2.264 -2.928,-4.605 -4.208,-5.538 -1.322,-0.962 -4.041,-1.668 -6.67,-2.351 -4.976,-1.292 -11.168,-2.9 -14.938,-8.08 -2.434,-3.342 -3.123,-7.199 -3.229,-10.893 -26.569,3.035 -54.982,15.244 -67.422,29.811 -5.043,5.908 -7.149,11.757 -6.257,17.386 z"
id="path20"
style="fill:#ffffff;stroke:none" /><path
d="m 246.796,295.599 c 2.499,0.978 5.084,1.988 6.664,1.988 0.204,0 0.37,-0.019 0.48,-0.055 1.376,-0.447 3.416,-3.657 4.906,-6.001 2.04,-3.21 4.354,-6.849 7.784,-9.346 3.469,-2.525 7.677,-3.618 11.388,-4.583 2.666,-0.692 6.317,-1.641 7.139,-2.768 0.79,-1.086 0.571,-4.821 0.411,-7.548 -0.225,-3.845 -0.48,-8.204 0.856,-12.32 1.292,-3.98 4.011,-7.267 6.41,-10.168 1.889,-2.283 4.238,-5.124 4.238,-6.661 0,-1.536 -2.351,-4.378 -4.238,-6.661 -2.399,-2.9 -5.118,-6.188 -6.41,-10.168 -1.336,-4.115 -1.081,-8.474 -0.856,-12.319 0.16,-2.728 0.379,-6.462 -0.412,-7.549 -0.82,-1.127 -4.471,-2.075 -7.137,-2.768 -3.712,-0.964 -7.918,-2.057 -11.388,-4.583 -3.432,-2.497 -5.745,-6.136 -7.786,-9.347 -1.489,-2.344 -3.529,-5.553 -4.904,-5.999 -0.11,-0.036 -0.276,-0.055 -0.48,-0.055 -1.58,0 -4.165,1.01 -6.665,1.988 -3.63,1.419 -7.745,3.027 -12.153,3.027 -4.408,0 -8.523,-1.609 -12.154,-3.028 -2.5,-0.978 -5.085,-1.988 -6.665,-1.988 -0.204,0 -0.371,0.019 -0.482,0.055 -1.375,0.446 -3.415,3.656 -4.904,5.999 -2.041,3.211 -4.355,6.85 -7.787,9.348 -3.47,2.525 -7.677,3.617 -11.389,4.581 -2.666,0.692 -6.317,1.64 -7.139,2.768 -0.79,1.086 -0.572,4.822 -0.413,7.549 0.225,3.845 0.48,8.203 -0.856,12.319 -1.293,3.98 -4.012,7.267 -6.41,10.167 -1.889,2.284 -4.239,5.126 -4.239,6.662 0,1.537 2.351,4.378 4.239,6.662 2.398,2.9 5.117,6.187 6.41,10.167 1.336,4.115 1.081,8.473 0.856,12.318 -0.159,2.728 -0.377,6.463 0.414,7.55 0.821,1.128 4.472,2.076 7.138,2.768 3.712,0.964 7.918,2.056 11.389,4.581 3.432,2.497 5.745,6.136 7.786,9.347 1.489,2.344 3.53,5.554 4.905,6.001 0.111,0.036 0.277,0.055 0.482,0.055 1.58,0 4.165,-1.011 6.666,-1.988 3.63,-1.419 7.745,-3.028 12.153,-3.028 4.408,0 8.523,1.612 12.153,3.031 z"
id="path22"
style="fill:#ffffff;stroke:none" /></g></g>
<g
id="g16">
</g>
<g
id="g18">
</g>
<g
id="g20">
</g>
<g
id="g22">
</g>
<g
id="g24">
</g>
<g
id="g26">
</g>
<g
id="g28">
</g>
<g
id="g30">
</g>
<g
id="g32">
</g>
<g
id="g34">
</g>
<g
id="g36">
</g>
<g
id="g38">
</g>
<g
id="g40">
</g>
<g
id="g42">
</g>
<g
id="g44">
</g>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

BIN
icons/tmr/gift.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -1,197 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="512"
height="512"
viewBox="0 0 135.46666 135.46667"
version="1.1"
id="svg878"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
sodipodi:docname="pelerin.svg">
<defs
id="defs872">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1730">
<g
inkscape:label="Clip"
id="use1732"
style="fill:#d38d5f;stroke:#502d16">
<g
id="g1541"
transform="matrix(0.28980934,0,0,0.21909426,120.56466,-12.741092)"
style="display:inline;fill:#d38d5f;stroke:#502d16;stroke-width:2.16856">
<path
sodipodi:nodetypes="cccccc"
id="path1535"
d="m -174.5565,130.97253 h 15.40856 v 508.4827 l -7.70428,24 -7.70428,-24 z"
style="fill:#d38d5f;stroke:#502d16;stroke-width:2.16856" />
<path
transform="matrix(1.001146,0,0,0.893038,2.193524,15.82179)"
style="fill:#d38d5f;stroke:#502d16;stroke-width:2.29344"
d="m -145.09735,123.91028 c 0,13.11269 -10.64218,17.6523 -23.75487,17.6523 -13.11269,0 -23.75487,-4.53961 -23.75487,-17.6523 0,-13.11269 10.64218,-23.75487 23.75487,-23.75487 13.11269,0 23.75487,10.64218 23.75487,23.75487 z"
id="path1537"
sodipodi:nodetypes="csssc" />
<path
style="fill:#d38d5f;stroke:#502d16;stroke-width:2.16856"
d="m -146.94948,221.199 c 0,8.50553 -8.91642,12.68366 -19.90273,12.68366 -10.98631,0 -19.90273,-4.17813 -19.90273,-12.68366 0,-8.50553 8.91642,-9.95873 19.90273,-9.95873 10.98631,0 19.90273,1.4532 19.90273,9.95873 z"
id="path1539"
sodipodi:nodetypes="csssc" />
</g>
<g
style="display:inline;fill:#d38d5f;stroke:#502d16"
id="g1559"
transform="matrix(0.20847315,-0.03662954,0.03662954,0.20847315,-0.34176516,-0.20270665)">
<g
inkscape:label="Fond écu"
id="g1543"
style="fill:#d38d5f;stroke:#502d16" />
<g
style="opacity:1;fill:#d38d5f;stroke:#502d16"
inkscape:label="Meubles"
id="g1553">
<g
id="g1551"
transform="matrix(0.714908,0,0,0.756557,137.7704,128.4719)"
style="display:inline;fill:#d38d5f;fill-opacity:1;stroke:#502d16;stroke-width:2.71947;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
<path
sodipodi:nodetypes="ccccc"
id="path1545"
d="m 160.08787,143.23938 39.92645,57.31251 39.53535,-57.31251 h -40.3837 z"
style="fill:#d38d5f;fill-opacity:1;fill-rule:evenodd;stroke:#502d16;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccccccccccccccccccc"
id="path1547"
d="m 193.20453,145.31745 c -24.41443,20.15923 -49.98749,37.33861 -73.2768,58.5917 -6.37089,11.43876 -4.50952,20.09512 9.2768,25.68955 14.75917,-16.92275 18.76874,-17.90421 41.38418,-46.03566 -22.42258,29.55858 -41.45116,42.84434 -41.29043,46.09816 5.38114,19.66042 0.98803,22.70493 25.28125,31.0625 2.90109,-14.41044 25.62687,-63.19056 32.51802,-70.81345 -6.73696,8.18151 -29.75646,56.59527 -32.58052,71.37595 18.94602,17.92 18.75832,19.45149 44.6875,14.03125 l 0.375,-80.91001 0.375,80.91001 c 21.42445,5.42024 29.31401,4.7897 44.65625,-14.03125 -3.59166,-13.24549 -25.62533,-59.96461 -31.64832,-69.57405 4.75359,7.7904 26.43091,52.99484 31.61707,69.01155 18.88754,-8.35757 21.70202,-8.69924 25.28125,-31.0625 -1.0235,-6.998 -18.88266,-18.38043 -42.22262,-45.81545 23.11839,25.66768 42.65103,40.10972 42.31637,45.75295 15.18653,-6.16263 15.88219,-19.26899 8.92398,-28.52504 -25.17844,-18.14393 -47.18822,-37.47898 -72.36824,-56.58981 0,0 -4.64225,-4.09784 -6.93074,-3.0414 z"
style="fill:#d38d5f;fill-opacity:1;fill-rule:evenodd;stroke:#502d16;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
id="path1549"
d="m 168.24779,168.92114 c 23.13397,11.51861 44.28729,9.17267 64.46537,0"
style="fill:#d38d5f;fill-opacity:1;fill-rule:evenodd;stroke:#502d16;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
<g
inkscape:label="Reflet final"
id="g1555"
style="fill:#d38d5f;stroke:#502d16" />
<g
inkscape:label="Contour final"
id="g1557"
style="fill:#d38d5f;stroke:#502d16" />
</g>
</g>
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="400"
inkscape:cy="560"
inkscape:document-units="mm"
inkscape:current-layer="svg878"
inkscape:document-rotation="0"
showgrid="false"
units="px"
inkscape:window-width="2073"
inkscape:window-height="997"
inkscape:window-x="114"
inkscape:window-y="114"
inkscape:window-maximized="0" />
<metadata
id="metadata875">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="g1510"
style="fill:#784421;stroke:#ffffff;image-rendering:auto"
transform="translate(-1.0583648,-3.7366014)">
<g
inkscape:label="Clip"
id="g1726"
style="fill:#784421;stroke:#ffffff">
<g
id="g3257"
transform="matrix(0.28980934,0,0,0.21909426,120.56466,-12.741092)"
style="display:inline;fill:#784421;stroke:#ffffff;stroke-width:2.16856">
<path
sodipodi:nodetypes="cccccc"
id="rect3250"
d="m -174.5565,130.97253 h 15.40856 v 508.4827 l -7.70428,24 -7.70428,-24 z"
style="fill:#784421;stroke:#ffffff;stroke-width:2.16856" />
<path
transform="matrix(1.001146,0,0,0.893038,2.193524,15.82179)"
style="fill:#784421;stroke:#ffffff;stroke-width:2.29344"
d="m -145.09735,123.91028 c 0,13.11269 -10.64218,17.6523 -23.75487,17.6523 -13.11269,0 -23.75487,-4.53961 -23.75487,-17.6523 0,-13.11269 10.64218,-23.75487 23.75487,-23.75487 13.11269,0 23.75487,10.64218 23.75487,23.75487 z"
id="path3252"
sodipodi:nodetypes="csssc" />
<path
style="fill:#784421;stroke:#ffffff;stroke-width:2.16856"
d="m -146.94948,221.199 c 0,8.50553 -8.91642,12.68366 -19.90273,12.68366 -10.98631,0 -19.90273,-4.17813 -19.90273,-12.68366 0,-8.50553 8.91642,-9.95873 19.90273,-9.95873 10.98631,0 19.90273,1.4532 19.90273,9.95873 z"
id="path3254"
sodipodi:nodetypes="csssc" />
</g>
<g
style="display:inline;fill:#784421;stroke:#ffffff"
id="g2066"
transform="matrix(0.20847315,-0.03662954,0.03662954,0.20847315,-0.34176516,-0.20270665)">
<g
inkscape:label="Fond écu"
id="g2068"
style="fill:#784421;stroke:#ffffff" />
<g
style="opacity:1;fill:#784421;stroke:#ffffff"
inkscape:label="Meubles"
id="g2070">
<g
id="g4219"
transform="matrix(0.714908,0,0,0.756557,137.7704,128.4719)"
style="display:inline;fill:#784421;fill-opacity:1;stroke:#ffffff;stroke-width:2.71947;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
<path
sodipodi:nodetypes="ccccc"
id="path4221"
d="m 160.08787,143.23938 39.92645,57.31251 39.53535,-57.31251 h -40.3837 z"
style="fill:#784421;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccccccccccccccccccc"
id="path4223"
d="m 193.20453,145.31745 c -24.41443,20.15923 -49.98749,37.33861 -73.2768,58.5917 -6.37089,11.43876 -4.50952,20.09512 9.2768,25.68955 14.75917,-16.92275 18.76874,-17.90421 41.38418,-46.03566 -22.42258,29.55858 -41.45116,42.84434 -41.29043,46.09816 5.38114,19.66042 0.98803,22.70493 25.28125,31.0625 2.90109,-14.41044 25.62687,-63.19056 32.51802,-70.81345 -6.73696,8.18151 -29.75646,56.59527 -32.58052,71.37595 18.94602,17.92 18.75832,19.45149 44.6875,14.03125 l 0.375,-80.91001 0.375,80.91001 c 21.42445,5.42024 29.31401,4.7897 44.65625,-14.03125 -3.59166,-13.24549 -25.62533,-59.96461 -31.64832,-69.57405 4.75359,7.7904 26.43091,52.99484 31.61707,69.01155 18.88754,-8.35757 21.70202,-8.69924 25.28125,-31.0625 -1.0235,-6.998 -18.88266,-18.38043 -42.22262,-45.81545 23.11839,25.66768 42.65103,40.10972 42.31637,45.75295 15.18653,-6.16263 15.88219,-19.26899 8.92398,-28.52504 -25.17844,-18.14393 -47.18822,-37.47898 -72.36824,-56.58981 0,0 -4.64225,-4.09784 -6.93074,-3.0414 z"
style="fill:#784421;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
id="path4225"
d="m 168.24779,168.92114 c 23.13397,11.51861 44.28729,9.17267 64.46537,0"
style="fill:#784421;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
<g
inkscape:label="Reflet final"
id="g2076"
style="fill:#784421;stroke:#ffffff" />
<g
inkscape:label="Contour final"
id="g2078"
style="fill:#784421;stroke:#ffffff" />
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 10 KiB

BIN
icons/tmr/pelerin.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -1,58 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 511.999 511.999" style="enable-background:new 0 0 511.999 511.999;" xml:space="preserve">
<path style="fill:#CCAC68;" d="M145.179,371.239H95.282c-35.205,0-63.745,28.539-63.745,63.745l0,0
c0,35.205,28.539,63.745,63.745,63.745H266.31v-93.993L145.179,371.239z"/>
<path style="fill:#E6C275;" d="M356.848,140.762L154.642,13.272H90.44l0,0c-60.783,0-99.78,64.617-71.453,118.395l138.469,262.878
h-0.022c25.403,47.058-8.675,104.182-62.152,104.182h336.415c53.477,0,87.555-57.123,62.152-104.182L356.848,140.762z"/>
<path style="fill:#FFD782;" d="M90.44,13.272c35.205,0,63.745,28.54,63.745,63.745l0,0c0,35.205-28.54,63.745-63.745,63.745h266.408
c35.205,0,63.745-28.54,63.745-63.745l0,0c0-35.205-28.54-63.745-63.745-63.745C356.848,13.272,90.44,13.272,90.44,13.272z"/>
<path d="M342.963,489.153c0,0-195.544,0-195.559,0c1.764,0,6.043-5.742,7.172-6.989c17.747-19.618,25.167-48.132,18.443-73.982
c-2.737-10.522-8.091-19.987-13.121-29.534L27.455,127.206C15.728,104.945,16.489,78.792,29.49,57.25
c13.001-21.543,35.785-34.403,60.947-34.403c29.869,0,54.17,24.3,54.17,54.17s-24.3,54.17-54.17,54.17
c-5.289,0-9.575,4.286-9.575,9.576c0,5.289,4.286,9.575,9.575,9.575h260.695l31.745,58.803c2.512,4.655,8.318,6.387,12.973,3.877
c4.655-2.512,6.389-8.321,3.877-12.973l-27.694-51.301c33.163-7.016,58.129-36.507,58.129-71.729c0-40.429-32.892-73.32-73.32-73.32
H240.78c-5.289,0-9.575,4.286-9.575,9.575s4.286,9.575,9.575,9.575h116.063c29.869,0,54.17,24.3,54.17,54.17
c0,29.866-24.293,54.164-54.17,54.17H139.796c0.919-0.839,1.818-1.7,2.694-2.584c13.491-13.615,21.266-32.414,21.266-51.587
c0-20.045-8.544-39.648-23.128-53.374c-0.28-0.263-0.546-0.537-0.83-0.797h56.304c5.289,0,9.575-4.286,9.575-9.575
s-4.286-9.575-9.575-9.575c0,0-105.664,0-105.665,0c-31.931,0-60.842,16.32-77.341,43.658
c-16.498,27.337-17.463,60.524-2.581,88.774l118.798,225.535H95.277c-40.428,0-73.32,32.891-73.32,73.32s32.892,73.32,73.32,73.32
c0.027,0,0.052-0.001,0.078-0.001h247.609c5.289,0,9.575-4.286,9.575-9.575S348.252,489.153,342.963,489.153z M41.107,434.984
c0-29.869,24.3-54.17,54.17-54.17h44.118c3.82,7.251,8.046,14.427,11.417,21.9c3.922,8.533,5.779,17.635,5.584,26.694
c-0.706,32.866-28.393,59.744-61.136,59.744C65.399,489.146,41.107,464.848,41.107,434.984z"/>
<path d="M502.27,389.999l-78.422-145.272c-2.514-4.655-8.322-6.389-12.973-3.877c-4.655,2.512-6.389,8.321-3.877,12.973
l78.423,145.272c10.312,19.103,9.829,41.639-1.293,60.283c-11.123,18.645-30.724,29.776-52.434,29.776h-44.048
c-5.289,0-9.575,4.286-9.575,9.575s4.286,9.575,9.575,9.575h44.048c28.52,0,54.269-14.622,68.88-39.114
C515.184,444.697,515.818,415.093,502.27,389.999z"/>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.0 KiB

BIN
icons/tmr/scroll.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 496 496" style="enable-background:new 0 0 496 496;" xml:space="preserve">
<path style="fill:#5B402E;" d="M0,232v167.2C0,460.8,52,456,113.6,456h268c61.6,0,113.6,4.8,113.6-56.8V232H0z"/>
<path style="fill:#493322;" d="M112,456h270.4c61.6,0,113.6,4.8,113.6-56.8V232"/>
<path style="fill:#5B402E;" d="M496,192v-40c0-61.6-52-112-113.6-112H113.6C52,40,0,90.4,0,152v40H496z"/>
<path style="fill:#493322;" d="M0,152v40h496v-40c0-61.6-52-112-113.6-112"/>
<rect y="232" style="fill:#F2B111;" width="496" height="64"/>
<polyline style="fill:#E88813;" points="0,296 496,296 496,232 "/>
<rect y="152" style="fill:#F2B111;" width="496" height="40"/>
<g>
<polyline style="fill:#E88813;" points="0,192 496,192 496,152 "/>
<rect x="104" y="32" style="fill:#E88813;" width="56" height="152"/>
<rect x="336" y="32" style="fill:#E88813;" width="56" height="152"/>
<rect x="104" y="288" style="fill:#E88813;" width="56" height="176"/>
<rect x="336" y="288" style="fill:#E88813;" width="56" height="176"/>
</g>
<g>
<circle style="fill:#493322;" cx="184" cy="264.8" r="8.8"/>
<circle style="fill:#493322;" cx="226.4" cy="264.8" r="8.8"/>
<circle style="fill:#493322;" cx="269.6" cy="264.8" r="8.8"/>
<circle style="fill:#493322;" cx="312" cy="264.8" r="8.8"/>
<circle style="fill:#493322;" cx="33.6" cy="264.8" r="8.8"/>
<circle style="fill:#493322;" cx="75.2" cy="264.8" r="8.8"/>
<circle style="fill:#493322;" cx="420" cy="264.8" r="8.8"/>
<circle style="fill:#493322;" cx="462.4" cy="264.8" r="8.8"/>
</g>
<path style="fill:#F2B111;" d="M276,346.4c0-15.2-12.8-28-28-28s-28,12.8-28,28c0,10.4,5.6,20,13.6,25.6l-8,52h44.8l-8-52
C270.4,367.2,276,356.8,276,346.4z"/>
<path style="fill:#E88813;" d="M270.4,424l-8-52c8-4.8,13.6-15.2,13.6-25.6c0-15.2-12.8-28-28-28s-28,12.8-28,28"/>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 23 KiB

BIN
icons/tmr/wave.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

44
lang/fr.json Normal file
View File

@ -0,0 +1,44 @@
{
"ACTOR": {
"TypePersonnage": "Personnage",
"TypeCreature": "Créature",
"TypeEntite": "Entité de cauchemar",
"TypeVehicule": "Véhicule"
},
"ITEM": {
"TypeObjet": "Objet",
"TypeCompetence": "Compétence",
"TypeCompetencecreature": "Compétence de créature",
"TypeMaladie": "Maladie",
"TypePoison": "Poison",
"TypeNombreastral": "Nombre astral",
"TypeTarot": "Carte de tarot",
"TypeCasetmr": "TMR spéciale",
"TypeRencontrestmr": "Rencontre TMR",
"TypeMunition": "Munition",
"TypeMonnaie": "Monnaie",
"TypeHerbe": "Herbe ou plante",
"TypeIngredient": "Ingrédient",
"TypeLivre": "Livre",
"TypePotion": "Potion",
"TypeArme": "Arme",
"TypeArmure": "Armure",
"TypeConteneur": "Conteneur",
"TypeNourritureboisson": "Nourriture & boisson",
"TypeChant": "Chant",
"TypeDanse": "Danse",
"TypeMusique": "Musique",
"TypeOeuvre": "Oeuvre",
"TypeTache": "Tâche",
"TypeJeu": "Jeu",
"TypeRecettealchimique": "Recette alchimique",
"TypeRecettecuisine": "Recette de cuisine",
"TypeSort": "Sort",
"TypeMeditation": "Méditation",
"TypeSignedraconique": "Signe draconique",
"TypeQueue": "Queue de Dragon",
"TypeOmbre": "Ombre de Thanatos",
"TypeSouffle": "Souffle de Dragon",
"TypeTete": "Tête de Dragon"
}
}

View File

@ -35,12 +35,10 @@ export class RdDActorCreatureSheet extends RdDActorSheet {
encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
}
formData.calc.surEncombrementMessage = (formData.data.compteurs.surenc.value < 0) ? "Sur-Encombrement!" : "";
formData.options.isGM = game.user.isGM;
formData.data.competencecreature = formData.itemsByType["competencecreature"];
RdDUtility.filterItemsPerTypeForSheet(formData);
RdDUtility.buildArbreDeConteneur(this, formData);
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
console.log("Creature : ", this.objetVersConteneur, formData);
@ -72,17 +70,6 @@ export class RdDActorCreatureSheet extends RdDActorSheet {
});
}
/* -------------------------------------------- */
/** @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;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {

View File

@ -5,6 +5,7 @@
import { HtmlUtility } from "./html-utility.js";
import { Misc } from "./misc.js";
import { RdDUtility } from "./rdd-utility.js";
/* -------------------------------------------- */
export class RdDActorEntiteSheet extends ActorSheet {
@ -31,14 +32,27 @@ export class RdDActorEntiteSheet extends ActorSheet {
/* -------------------------------------------- */
async getData() {
let formData = super.getData();
const objectData = Misc.data(this.object);
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
// actor: this.object,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: foundry.utils.deepClone(Misc.templateData(this.object)),
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
// items: items,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i.data))),
};
formData.itemsByType = Misc.classify(formData.items);
formData.options.isGM = game.user.isGM;
formData.data.carac.taille.isTaille = true; // To avoid button link;
formData.data.competencecreature = formData.itemsByType["competencecreature"];
RdDUtility.filterItemsPerTypeForSheet(formData);
return formData;
@ -57,14 +71,14 @@ export class RdDActorEntiteSheet extends ActorSheet {
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
const item = this.actor.getOwnedItem(li.data("itemId"));
const item = this.actor.getEmbeddedDocument('Item', li.data("itemId"));
item.sheet.render(true);
});
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.deleteOwnedItem(li.data("itemId"));
this.actor.deleteEmbeddedDocuments('Item', [li.data("itemId")]);
li.slideUp(200, () => this.render(false));
});
@ -103,7 +117,7 @@ export class RdDActorEntiteSheet extends ActorSheet {
this.render(true);
});
html.find('#encaisser-direct').click(ev => {
html.find('.encaisser-direct').click(ev => {
this.actor.encaisser();
});
@ -118,10 +132,12 @@ export class RdDActorEntiteSheet extends ActorSheet {
/* -------------------------------------------- */
/** @override */
setPosition(options={}) {
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetHeader = this.element.find(".sheet-header");
const sheetTabs = this.element.find(".sheet-tabs");
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight;
sheetBody.css("height", bodyHeight);
return position;
}

View File

@ -11,6 +11,9 @@ import { RdDBonus } from "./rdd-bonus.js";
import { Misc } from "./misc.js";
import { RdDCombatManager } from "./rdd-combat.js";
import { RdDCarac } from "./rdd-carac.js";
import { RdDItem } from "./item.js";
import { DialogSplitItem } from "./dialog-split-item.js";
import { ReglesOptionelles } from "./regles-optionelles.js";
/* -------------------------------------------- */
export class RdDActorSheet extends ActorSheet {
@ -27,60 +30,55 @@ export class RdDActorSheet extends ActorSheet {
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editCaracComp: false,
showCompNiveauBase: false,
montrerArchetype: false
montrerArchetype: false,
hideControls: true
});
}
/* -------------------------------------------- */
async getData() {
let formData = super.getData();
// -------------- version 0.7.9
// let formData = {
// cssClass: this.entity.owner ? "editable" : "locked",
// editable: this.isEditable,
// entity: duplicate(this.entity.data),
// limited: this.entity.limited,
// options: this.options,
// owner: this.entity.owner,
// title: this.title
// }
// // Entity data
// formData.actor = formData.entity;
// formData.data = formData.entity.data;
const objectData = Misc.data(this.object);
//this.actor.checkMonnaiePresence(this.actor.data.items); // Always check
// // Owned items
// formData.items = formData.actor.items;
// formData.items.sort((a, b) => (a.sort || 0) - (b.sort || 0));
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",
data: foundry.utils.deepClone(Misc.templateData(this.object)),
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i.data))),
};
formData.itemsByType = Misc.classify(formData.items);
RdDUtility.filterItemsPerTypeForSheet(formData);
formData.options.isGM = game.user.isGM;
// la taille est la taille: on ne peut pas l'utiliser pour un jet
formData.data.carac.taille.isTaille = true;
if (formData.type == 'creature') return formData; // Shortcut
if (this.actor.data.type == 'creature') return formData; // Shortcut
formData.competenceByCategory = Misc.classify(formData.competences, it => it.data.categorie);
formData.competenceByCategory = Misc.classify(formData.data.competences, it => it.data.categorie);
formData.calc = {
comptageArchetype: RdDItemCompetence.computeResumeArchetype(formData.data.competences),
competenceXPTotal: RdDItemCompetence.computeTotalXP(formData.data.competences),
comptageArchetype: RdDItemCompetence.computeResumeArchetype(formData.competences),
competenceXPTotal: RdDItemCompetence.computeTotalXP(formData.competences),
caracTotal: RdDCarac.computeTotal(formData.data.carac, formData.data.beaute),
// Mise à jour de l'encombrement total et du prix de l'équipement
encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
prixTotalEquipement: await this.actor.computePrixTotalEquipement(),
prixTotalEquipement: this.actor.computePrixTotalEquipement(),
surprise: RdDBonus.find(this.actor.getSurprise(false)).descr,
fatigue: {
malus: RdDUtility.calculMalusFatigue(formData.data.sante.fatigue.value, formData.data.sante.endurance.max),
html: "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(formData.data.sante.fatigue.value, formData.data.sante.endurance.max).html() + "</table>"
},
fatigue: RdDUtility.calculFatigueHtml(formData.data.sante.fatigue.value, formData.data.sante.endurance.max),
resumeBlessures: this.actor.computeResumeBlessure(formData.data.blessures),
};
formData.calc.surEncombrementMessage = (formData.data.compteurs.surenc.value < 0) ? "Sur-Encombrement!" : "";
formData.data.competences.forEach(item => {
formData.competences.forEach(item => {
item.visible = !this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item);
RdDItemCompetence.levelUp(item);
});
@ -91,41 +89,38 @@ export class RdDActorSheet extends ActorSheet {
// toujours avoir une liste d'armes (pour mettre esquive et corps à corps)
formData.data.combat = duplicate(formData.itemsByType.arme ?? []);
RdDItemArme.computeNiveauArmes(formData.data.combat, formData.data.competences);
RdDItemArme.ajoutCorpsACorps(formData.data.combat, formData.data.competences, formData.data.carac );
formData.esquive = RdDItemCompetence.getEsquive(formData.data.competences);
formData.data.combat = RdDCombatManager.finalizeArmeList(formData.data.combat, formData.itemsByType.competence, formData.data.carac);
formData.combat = duplicate(formData.armes ?? []);
RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.data.carac);
formData.esquive = RdDItemCompetence.getEsquive(formData.competences);
formData.combat = RdDCombatManager.finalizeArmeList(formData.combat, formData.competences, formData.data.carac);
this.armesList = formData.data.combat;
// Mise à jour de l'encombrement total et du prix de l'équipement
this.armesList = formData.combat;
// Common data
formData.data.competenceByCategory = formData.competenceByCategory;
formData.data.isGM = game.user.isGM;
formData.ajustementsConditions = CONFIG.RDD.ajustementsConditions;
formData.difficultesLibres = CONFIG.RDD.difficultesLibres;
// low is normal, this the base used to compute the grid.
formData.data.fatigue = {
malus: RdDUtility.calculMalusFatigue(formData.data.sante.fatigue.value, formData.data.sante.endurance.max),
html: "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(formData.data.sante.fatigue.value, formData.data.sante.endurance.max).html() + "</table>"
}
formData.hautreve = {
isDemiReve: this.actor.listeEffets( it => it.label == "Demi-rêve").length > 0,
sortsReserve: formData.data.reve.reserve.list,
rencontres: duplicate(formData.data.reve.rencontre.list),
casesTmr: formData.itemsByType.casetmr
casesTmr: formData.itemsByType.casetmr,
cacheTMR: this.actor.isTMRCache()
}
RdDUtility.buildArbreDeConteneur(this, formData);
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
formData.subacteurs = {
vehicules: this.actor.listeVehicules(),
montures: this.actor.listeMontures(),
suivants: this.actor.listeSuivants()
}
if (this.actor.getBestDraconic().data.niveau > -11 && !this.actor.isHautRevant()) {
ui.notifications.error(`${this.actor.name} a des compétences draconiques, mais pas le don de Haut-Rêve!
<br>Ajoutez-lui la tête "Don de Haut-Rêve" pour lui permettre d'utiliser ses compétences et d'accéder aux terres médianes du rêve`);
}
return formData;
}
@ -134,197 +129,196 @@ export class RdDActorSheet extends ActorSheet {
}
/* -------------------------------------------- */
async _onDrop(event) {
let toSuper = await RdDUtility.processItemDropEvent(this, event);
if (toSuper) {
super._onDrop(event);
async _onDropActor(event, dragData) {
console.log("DRAG", this.actor.id, dragData);
this.actor.addSubacteur(dragData.id || dragData.data._id);
super._onDropActor(event, dragData);
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
const callSuper = await this.actor.processDropItem(event, dragData, this.objetVersConteneur);
if (callSuper) {
await super._onDropItem(event, dragData)
}
}
/* -------------------------------------------- */
async createItem(name, type) {
await this.actor.createEmbeddedDocuments('Item', [{ name: name, type: type }], { renderSheet: true });
}
/* -------------------------------------------- */
async createEmptyTache() {
await this.actor.createOwnedItem({ name: 'Nouvelle tache', type: 'tache' }, { renderSheet: true });
await this.createItem('Nouvelle tache', 'tache');
}
/* -------------------------------------------- */
async creerObjet() {
let itemType = $("#creer-equipement").val();
await this.actor.createOwnedItem({ name: 'Nouveau ' + itemType, type: itemType }, { renderSheet: true });
}
/* -------------------------------------------- */
async selectObjetType() {
let itemType = ["objet", "arme", "armure", "conteneur", "herbe", "ingredient", "livre", "potion", "munition", "monnaie"];
let options = '<span class="competence-label">Selectionnez le type d\'équipement</span><select id="creer-equipement">';
for (let typeName of itemType) {
options += '<option value="' + typeName + '">' + typeName + '</option>'
}
options += '</select>';
let d = new Dialog({
title: "Créer un équipement",
content: options,
buttons: {
one: {
icon: '<i class="fas fa-check"></i>',
label: "Créer l'objet",
callback: () => this.creerObjet()
}
}
});
d.render(true);
}
/* -------------------------------------------- */
/** @override */
/* -------------------------------------------- */ /** @override */
activateListeners(html) {
super.activateListeners(html);
HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM);
html.find('#show-hide-competences').click((event) => {
this.options.showCompNiveauBase = !this.options.showCompNiveauBase;
this.render(true);
});
HtmlUtility._showControlWhen($(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue"));
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
const item = this.actor.getOwnedItem(li.data("item-id"));
html.find('.item-split').click(async event => {
const li = $(event.currentTarget).parents(".item");
const item = this.actor.items.get(li.data("item-id"));
this.splitItem(item);
});
html.find('.item-edit').click(async event => {
const li = $(event.currentTarget).parents(".item");
const item = this.actor.items.get(li.data("item-id"));
item.sheet.render(true);
});
// Update Inventory Item
html.find('.rencontre-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
html.find('.display-label a').click(async event => {
let myID = event.currentTarget.attributes['data-item-id'].value;
const item = this.actor.getEmbeddedDocument('Item', myID);
item.sheet.render(true);
});
html.find('.rencontre-delete').click(async event => {
const li = $(event.currentTarget).parents(".item");
const rencontreKey = li.data("item-id");
this.actor.deleteTMRRencontre(rencontreKey);
});
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
html.find('.item-delete').click(async event => {
const li = $(event.currentTarget).parents(".item");
RdDUtility.confirmerSuppression(this, li);
});
html.find('.subacteur-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
html.find('.item-vendre').click(async event => {
const li = $(event.currentTarget).parents(".item");
const itemId = li.data("item-id");
const item = this.actor.getObjet(itemId);
item?.proposerVente();
});
html.find('.item-action').click(async event => {
const li = $(event.currentTarget).parents(".item");
const itemId = li.data("item-id");
const item = this.actor.getObjet(itemId);
this.actor.actionItem(item);
});
html.find('.subacteur-delete').click(async event => {
const li = $(event.currentTarget).parents(".item");
RdDUtility.confirmerSuppressionSubacteur(this, li);
});
html.find('#encaisser-direct').click(ev => {
html.find('.encaisser-direct').click(async event => {
this.actor.encaisser();
});
html.find('.remise-a-neuf').click(ev => {
html.find('.remise-a-neuf').click(async event => {
if (game.user.isGM) {
this.actor.remiseANeuf();
ev.preventDefault();
}
});
html.find('#creer-tache').click(ev => {
html.find('.creer-tache').click(async event => {
this.createEmptyTache();
});
html.find('#creer-un-objet').click(ev => {
this.selectObjetType();
html.find('.creer-un-objet').click(async event => {
RdDUtility.selectObjetType( this );
});
html.find('#nettoyer-conteneurs').click(ev => {
html.find('.creer-une-oeuvre').click(async event => {
RdDUtility.selectTypeOeuvre(this);
});
html.find('#nettoyer-conteneurs').click(async event => {
this.actor.nettoyerConteneurs();
});
// Blessure control
html.find('.blessure-control').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let btype = li.data("blessure-type");
let index = li.data('blessure-index');
let active = $(ev.currentTarget).data('blessure-active');
html.find('.blessure-control').click(async event => {
const tr = $(event.currentTarget).parents(".item");
let btype = tr.data("blessure-type");
let index = tr.data('blessure-index');
let active = $(event.currentTarget).data('blessure-active');
//console.log(btype, index, active);
this.actor.manageBlessureFromSheet(btype, index, active).then(this.render(true));
await this.actor.manageBlessureFromSheet(btype, index, active);
});
// Blessure data
html.find('.blessures-soins').change(ev => {
const li = $(ev.currentTarget).parents(".item");
let btype = li.data('blessure-type');
let index = li.data('blessure-index');
let psoins = li.find('input[name=premiers_soins]').val();
let pcomplets = li.find('input[name=soins_complets]').val();
let jours = li.find('input[name=jours]').val();
let loc = li.find('input[name=localisation]').val();
html.find('.blessures-soins').change(async event => {
const tr = $(event.currentTarget).parents(".item");
let btype = tr.data('blessure-type');
let index = tr.data('blessure-index');
let psoins = tr.find('.blessure-premiers_soins').val();
let pcomplets = tr.find('.blessure-soins_complets').val();
let jours = tr.find('.blessure-jours').val();
let loc = tr.find('.blessure-localisation').val();
//console.log(btype, index, psoins, pcomplets, jours, loc);
this.actor.setDataBlessureFromSheet(btype, index, psoins, pcomplets, jours, loc).then(this.render(true));
await this.actor.setDataBlessureFromSheet(btype, index, psoins, pcomplets, jours, loc);
});
// Equip Inventory Item
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
html.find('.item-equip').click(async event => {
const li = $(event.currentTarget).parents(".item");
this.actor.equiperObjet(li.data("item-id"));
this.render(true);
});
// Roll Carac
html.find('.carac-label a').click((event) => {
html.find('.carac-label a').click(async event => {
let caracName = event.currentTarget.attributes.name.value;
this.actor.rollCarac(caracName.toLowerCase());
});
html.find('.chance-actuelle').click((event) => {
html.find('.chance-actuelle').click(async event => {
this.actor.rollCarac('chance-actuelle');
});
html.find('.chance-appel').click((event) => {
html.find('.chance-appel').click(async event => {
this.actor.rollAppelChance();
});
html.find('#jet-astrologie').click((event) => {
html.find('#jet-astrologie').click(async event => {
this.actor.astrologieNombresAstraux();
});
// Roll Skill
html.find('.competence-label a').click((event) => {
let compName = event.currentTarget.text;
html.find('a.competence-label').click(async event => {
let compName = event.currentTarget.name;
this.actor.rollCompetence(compName);
});
html.find('.tache-label a').click((event) => {
html.find('.tache-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let tacheId = li.data('item-id');
this.actor.rollTache(tacheId);
});
html.find('.meditation-label a').click((event) => {
html.find('.meditation-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let meditationId = li.data('item-id');
this.actor.rollMeditation(meditationId);
});
html.find('.chant-label a').click((event) => {
html.find('.chant-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let chantId = li.data('item-id');
this.actor.rollChant(chantId);
});
html.find('.danse-label a').click((event) => {
html.find('.danse-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let danseId = li.data('item-id');
this.actor.rollDanse(danseId);
});
html.find('.musique-label a').click((event) => {
html.find('.musique-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let musiqueId = li.data('item-id');
this.actor.rollMusique(musiqueId);
});
html.find('.oeuvre-label a').click((event) => {
html.find('.oeuvre-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let oeuvreId = li.data('item-id');
this.actor.rollOeuvre(oeuvreId);
});
html.find('.jeu-label a').click((event) => {
html.find('.jeu-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let jeuId = li.data('item-id');
this.actor.rollJeu(jeuId);
});
html.find('.recettecuisine-label a').click((event) => {
html.find('.recettecuisine-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let recetteId = li.data('item-id');
this.actor.rollRecetteCuisine(recetteId);
});
html.find('.subacteur-label a').click((event) => {
html.find('.subacteur-label a').click(async event => {
const li = $(event.currentTarget).parents(".item");
let actorId = li.data('actor-id');
let actor = game.actors.get(actorId);
@ -332,20 +326,28 @@ export class RdDActorSheet extends ActorSheet {
actor.sheet.render(true);
}
});
// Boutons spéciaux MJs
html.find('.forcer-tmr-aleatoire').click(async event => {
this.actor.cacheTMRetMessage();
});
html.find('.afficher-tmr').click(async event => {
this.actor.afficheTMRetMessage();
});
// Points de reve actuel
html.find('.ptreve-actuel a').click((event) => {
html.find('.ptreve-actuel a').click(async event => {
this.actor.rollCarac('reve-actuel');
});
// Roll Weapon1
html.find('.arme-label a').click((event) => {
html.find('.arme-label a').click(async event => {
let armeName = event.currentTarget.text;
let competenceName = event.currentTarget.attributes['data-competence-name'].value;
this.actor.rollArme(competenceName, armeName);
});
// Initiative pour l'arme
html.find('.arme-initiative a').click((event) => {
html.find('.arme-initiative a').click(async event => {
let combatant = game.combat.data.combatants.find(c => c.actor.data._id == this.actor.data._id);
if (combatant) {
let armeName = event.currentTarget.attributes['data-arme-name'].value;
@ -356,201 +358,178 @@ export class RdDActorSheet extends ActorSheet {
}
});
// Display TMR, visuualisation
html.find('#visu-tmr').click((event) => {
html.find('.visu-tmr').click(async event => {
this.actor.displayTMR("visu");
});
// Display TMR, normal
html.find('#monte-tmr').click((event) => {
html.find('.monte-tmr').click(async event => {
this.actor.displayTMR("normal");
});
// Display TMR, fast
html.find('#monte-tmr-rapide').click((event) => {
html.find('.monte-tmr-rapide').click(async event => {
this.actor.displayTMR("rapide");
});
html.find('#dormir-une-heure').click((event) => {
html.find('.dormir-une-heure').click(async event => {
this.actor.dormir(1);
});
html.find('#dormir-chateau-dormant').click((event) => {
html.find('.dormir-chateau-dormant').click(async event => {
this.actor.dormirChateauDormant();
});
html.find('#enlever-tous-effets').click((event) => {
html.find('.enlever-tous-effets').click(async event => {
this.actor.enleverTousLesEffets();
});
// Display info about queue
html.find('.queuesouffle-label a').click((event) => {
let myID = event.currentTarget.attributes['data-item-id'].value;
const item = this.actor.getOwnedItem(myID);
item.sheet.render(true);
});
// Info sort
html.find('.sort-label a').click((event) => {
let myID = event.currentTarget.attributes['data-id'].value;
const item = this.actor.getOwnedItem(myID);
item.sheet.render(true);
});
// Info sort
html.find('.case-label a').click((event) => {
let myID = event.currentTarget.attributes['data-id'].value;
const item = this.actor.getOwnedItem(myID);
item.sheet.render(true);
});
// Display info about queue
html.find('.conteneur-name a').click((event) => {
html.find('.conteneur-name a').click(async event => {
let myID = event.currentTarget.attributes['data-item-id'].value;
RdDUtility.toggleAfficheContenu(myID);
this.render(true);
});
html.find('.carac-xp-augmenter').click(async event => {
let caracName = event.currentTarget.name.replace("augmenter.", "");
this.actor.updateCaracXPAuto(caracName);
});
html.find('.competence-xp-augmenter').click(async event => {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCompetenceXPAuto(compName);
});
if (this.options.editCaracComp) {
// On carac change
html.find('.carac-value').change((event) => {
html.find('.carac-value').change(async event => {
let caracName = event.currentTarget.name.replace(".value", "").replace("data.carac.", "");
//console.log("Value changed :", event, caracName);
this.actor.updateCarac(caracName, parseInt(event.target.value));
});
html.find('.carac-xp').change((event) => {
html.find('.carac-xp').change(async event => {
let caracName = event.currentTarget.name.replace(".xp", "").replace("data.carac.", "");
//console.log("Value changed :", event, caracName);
this.actor.updateCaracXP(caracName, parseInt(event.target.value));
});
// On competence change
html.find('.competence-value').change((event) => {
html.find('.competence-value').change(async event => {
let compName = event.currentTarget.attributes.compname.value;
//console.log("Competence changed :", compName);
this.actor.updateCompetence(compName, parseInt(event.target.value));
});
// On competence xp change
html.find('.competence-xp').change((event) => {
html.find('.competence-xp').change(async event => {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCompetenceXP(compName, parseInt(event.target.value));
});
// On competence xp change
html.find('.competence-xp-sort').change((event) => {
html.find('.competence-xp-sort').change(async event => {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCompetenceXPSort(compName, parseInt(event.target.value));
});
// On competence archetype change
html.find('.competence-archetype').change((event) => {
html.find('.competence-archetype').change(async event => {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCompetenceArchetype(compName, parseInt(event.target.value));
});
}
// Gestion du bouton lock/unlock
html.find('.lock-unlock-sheet').click((event) => {
html.find('#show-hide-competences').click(async event => {
this.options.showCompNiveauBase = !this.options.showCompNiveauBase;
this.render(true);
});
html.find('.lock-unlock-sheet').click(async event => {
this.options.editCaracComp = !this.options.editCaracComp;
this.render(true);
});
html.find('#show-hide-archetype').click((event) => {
html.find('#show-hide-archetype').click(async event => {
this.options.montrerArchetype = !this.options.montrerArchetype;
this.render(true);
});
html.find('.lock-unlock-controls').click(async event => {
this.options.hideControls = !this.options.hideControls;
this.render(true);
});
// On pts de reve change
html.find('.pointsreve-value').change((event) => {
html.find('.pointsreve-value').change(async event => {
let reveValue = event.currentTarget.value;
this.actor.update({ "data.reve.reve.value": reveValue });
});
// On seuil de reve change
html.find('.seuil-reve-value').change((event) => {
html.find('.seuil-reve-value').change(async event => {
console.log("seuil-reve-value", event.currentTarget)
this.actor.setPointsDeSeuil(event.currentTarget.value);
});
html.find('#attribut-protection-edit').change((event) => {
html.find('#attribut-protection-edit').change(async event => {
this.actor.updateAttributeValue(event.currentTarget.attributes.name.value, parseInt(event.target.value));
});
// On stress change
html.find('.compteur-edit').change((event) => {
html.find('.compteur-edit').change(async event => {
let fieldName = event.currentTarget.attributes.name.value;
this.actor.updateCompteurValue(fieldName, parseInt(event.target.value));
});
html.find('#ethylisme').change((event) => {
html.find('#ethylisme').change(async event => {
this.actor.setEthylisme(parseInt(event.target.value));
});
html.find('.stress-test').click((event) => {
html.find('.stress-test').click(async event => {
this.actor.transformerStress();
this.render(true);
});
html.find('.moral-malheureux').click((event) => {
html.find('.moral-malheureux').click(async event => {
this.actor.jetDeMoral('malheureuse');
this.render(true);
});
html.find('.moral-neutre').click((event) => {
html.find('.moral-neutre').click(async event => {
this.actor.jetDeMoral('neutre');
this.render(true);
});
html.find('.moral-heureux').click((event) => {
html.find('.moral-heureux').click(async event => {
this.actor.jetDeMoral('heureuse');
this.render(true);
});
html.find('#ethylisme-test').click((event) => {
this.actor.ethylismeTest();
this.render(true);
html.find('#ethylisme-test').click(async event => {
this.actor.jetEthylisme();
});
html.find('#jet-vie').click((event) => {
html.find('#jet-vie').click(async event => {
this.actor.jetVie();
this.render(true);
});
html.find('#jet-endurance').click((event) => {
html.find('#jet-endurance').click(async event => {
this.actor.jetEndurance();
this.render(true);
});
html.find('.monnaie-plus').click((event) => {
html.find('.monnaie-plus').click(async event => {
const li = $(event.currentTarget).parents(".item");
this.actor.monnaieIncDec(li.data("item-id"), 1);
this.render(true);
});
html.find('.monnaie-moins').click((event) => {
html.find('.monnaie-moins').click(async event => {
const li = $(event.currentTarget).parents(".item");
this.actor.monnaieIncDec(li.data("item-id"), -1);
this.render(true);
});
html.find('#vie-plus').click((event) => {
html.find('#vie-plus').click(async event => {
this.actor.santeIncDec("vie", 1);
this.render(true);
});
html.find('#vie-moins').click((event) => {
html.find('#vie-moins').click(async event => {
this.actor.santeIncDec("vie", -1);
this.render(true);
});
html.find('#endurance-plus').click((event) => {
html.find('#endurance-plus').click(async event => {
this.actor.santeIncDec("endurance", 1);
this.render(true);
});
html.find('#endurance-moins').click((event) => {
html.find('#endurance-moins').click(async event => {
this.actor.santeIncDec("endurance", -1);
this.render(true);
});
html.find('.data-sante-sonne').click((event) => {
html.find('.data-sante-sonne').click(async event => {
this.actor.setSonne(event.currentTarget.checked);
this.render(true);
});
html.find('#ptreve-actuel-plus').click((event) => {
html.find('#ptreve-actuel-plus').click(async event => {
this.actor.reveActuelIncDec(1);
this.render(true);
});
html.find('#ptreve-actuel-moins').click((event) => {
html.find('#ptreve-actuel-moins').click(async event => {
this.actor.reveActuelIncDec(-1);
this.render(true);
});
html.find('#fatigue-plus').click((event) => {
html.find('#fatigue-plus').click(async event => {
this.actor.santeIncDec("fatigue", 1);
this.render(true);
});
html.find('#fatigue-moins').click((event) => {
html.find('#fatigue-moins').click(async event => {
this.actor.santeIncDec("fatigue", -1);
this.render(true);
});
}
@ -559,8 +538,10 @@ export class RdDActorSheet extends ActorSheet {
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetHeader = this.element.find(".sheet-header");
const sheetTabs = this.element.find(".sheet-tabs");
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight;
sheetBody.css("height", bodyHeight);
return position;
}
@ -572,4 +553,19 @@ export class RdDActorSheet extends ActorSheet {
// Update the Actor
return this.object.update(formData);
}
async splitItem(item) {
const dialog = await DialogSplitItem.create(item, (item, split) => this._onSplitItem(item, split));
dialog.render(true);
}
async _onSplitItem(item, split) {
if (split >= 1 && split < Misc.data(item).data.quantite) {
await item.diminuerQuantite(split);
const itemData = duplicate( Misc.data(item));
itemData.data.quantite = split;
await this.actor.createEmbeddedDocuments('Item', [itemData])
}
}
}

View File

@ -34,12 +34,26 @@ export class RdDActorVehiculeSheet extends ActorSheet {
/* -------------------------------------------- */
async getData() {
let formData = super.getData();
formData.itemsByType = Misc.classify(formData.items);
const objectData = Misc.data(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",
data: foundry.utils.deepClone(Misc.templateData(this.object)),
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i.data))),
};
RdDUtility.filterItemsPerTypeForSheet(formData);
RdDUtility.buildArbreDeConteneur(this, formData);
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
formData.options.isGM = game.user.isGM;
@ -54,10 +68,24 @@ export class RdDActorVehiculeSheet extends ActorSheet {
}
/* -------------------------------------------- */
async _onDrop(event) {
let toSuper = await RdDUtility.processItemDropEvent(this, event);
if ( toSuper) {
super._onDrop(event);
async _onDropItem(event, dragData) {
const callSuper = await this.actor.processDropItem(event, dragData, this.objetVersConteneur);
if (callSuper) {
await super._onDropItem(event, dragData)
}
}
/* -------------------------------------------- */
async createItem(name, type) {
await this.actor.createEmbeddedDocuments('Item', [{ name: name, type: type }], { renderSheet: true });
}
/* -------------------------------------------- */
async monnaieIncDec(id, value) {
let monnaie = this.getMonnaie(id);
if (monnaie) {
const quantite = Math.max(0, Misc.templateData(monnaie).quantite + value);
await this.updateEmbeddedDocuments('Item', [{ _id: monnaie.id, 'data.quantite': quantite }]);
}
}
@ -74,7 +102,7 @@ export class RdDActorVehiculeSheet extends ActorSheet {
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
const item = this.actor.getOwnedItem(li.data("itemId"));
const item = this.actor.getEmbeddedDocument('Item', li.data("itemId"));
item.sheet.render(true);
});
// Delete Inventory Item
@ -83,6 +111,22 @@ export class RdDActorVehiculeSheet extends ActorSheet {
RdDUtility.confirmerSuppression(this, li);
});
html.find('.creer-un-objet').click(async event => {
RdDUtility.selectObjetType( this );
});
html.find('#nettoyer-conteneurs').click(async event => {
this.actor.nettoyerConteneurs();
});
html.find('.monnaie-plus').click(async event => {
const li = $(event.currentTarget).parents(".item");
this.actor.monnaieIncDec(li.data("item-id"), 1);
});
html.find('.monnaie-moins').click(async event => {
const li = $(event.currentTarget).parents(".item");
this.actor.monnaieIncDec(li.data("item-id"), -1);
});
// Display info about queue
html.find('.conteneur-name a').click((event) => {
let myID = event.currentTarget.attributes['data-item-id'].value;
@ -94,10 +138,12 @@ export class RdDActorVehiculeSheet extends ActorSheet {
/* -------------------------------------------- */
/** @override */
setPosition(options={}) {
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetHeader = this.element.find(".sheet-header");
const sheetTabs = this.element.find(".sheet-tabs");
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight;
sheetBody.css("height", bodyHeight);
return position;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
import { Misc } from "./misc.js";
/**
* Class providing helper methods to get the list of users, and
@ -7,31 +8,40 @@ export class ChatUtility {
/* -------------------------------------------- */
static onSocketMessage(sockmsg) {
switch (sockmsg.msg) {
case "msg_delete_chat_message": return ChatUtility.onRemoveMessages(sockmsg.part, sockmsg.gmId);
case "msg_delete_chat_message": return ChatUtility.onRemoveMessages(sockmsg.data);
}
}
/* -------------------------------------------- */
static onRemoveMessages(part, gmId) {
if (game.user._id == gmId) {
const toDelete = game.messages.filter(it => it.data.content.includes(part));
toDelete.forEach(it => it.delete());
static onRemoveMessages(data) {
if (Misc.isElectedUser()) {
if (data.part) {
const toDelete = game.messages.filter(it => it.data.content.includes(data.part));
toDelete.forEach(it => it.delete());
}
if (data.messageId) {
game.messages.get(data.messageId)?.delete();
}
}
}
/* -------------------------------------------- */
static removeChatMessageContaining(part) {
const gmId = game.user.isGM ? game.user._id : game.users.entities.find(u => u.isGM && u.active)?.id;
if (!gmId || game.user.isGM) {
ChatUtility.onRemoveMessages(part, game.user._id);
static removeMessages(data) {
if (Misc.isElectedUser()){
ChatUtility.onRemoveMessages(data);
}
else {
game.socket.emit("system.foundryvtt-reve-de-dragon", {
msg: "msg_delete_chat_message", data: {
part:part,
gmId: gmId,
}});
game.socket.emit("system.foundryvtt-reve-de-dragon", { msg: "msg_delete_chat_message", data: data });
}
}
/* -------------------------------------------- */
static removeChatMessageContaining(part) {
ChatUtility.removeMessages({ part: part });
}
static removeChatMessageId(messageId) {
if (messageId){
ChatUtility.removeMessages({ messageId: messageId });
}
}
@ -47,7 +57,7 @@ export class ChatUtility {
if (!game.user.isGM) {
ChatUtility.blindMessageToGM(chatOptions);
chatOptions.whisper = [game.user._id];
chatOptions.whisper = [game.user.id];
chatOptions.content = "Message envoyé en aveugle au Gardien";
}
else {
@ -65,7 +75,7 @@ export class ChatUtility {
/* -------------------------------------------- */
static prepareChatMessage(rollMode, name) {
return {
user: game.user._id,
user: game.user.id,
whisper: ChatUtility.getWhisperRecipients(rollMode, name)
}
}
@ -75,7 +85,7 @@ export class ChatUtility {
switch (rollMode) {
case "blindroll": return ChatUtility.getUsers(user => user.isGM);
case "gmroll": return ChatUtility.getWhisperRecipientsAndGMs(name);
case "selfroll": return [game.user._id];
case "selfroll": return [game.user.id];
}
return undefined;
}
@ -104,9 +114,9 @@ export class ChatUtility {
static handleGMChatMessage(data) {
console.log("blindMessageToGM", data);
if (game.user.isGM) { // message privé pour GM only
data.user = game.user._id;
data.user = game.user.id;
ChatMessage.create(data);
}
}
}

1
module/constants.js Normal file
View File

@ -0,0 +1 @@
export const SYSTEM_RDD = "foundryvtt-reve-de-dragon";

View File

@ -1,27 +0,0 @@
import { RdDDice } from "./rdd-dice.js";
export class DeDraconique extends Roll{
static async ddr(rollMode=undefined) {
let ddr = new DeDraconique().evaluate();
await RdDDice.show(ddr, rollMode);
return ddr;
}
constructor(){
super("1d8x8 - 0")
}
evaluate() {
super.evaluate();
const rerolls = Math.ceil(this.total / 8);
this.terms[this.terms.length - 1] = rerolls;
this.results[this.results.length - 1] = rerolls;
this._total -= rerolls;
return this;
}
async render(chatOptions) {
return super.render(chatOptions)
}
}

View File

@ -0,0 +1,119 @@
import { ChatUtility } from "./chat-utility.js";
import { HtmlUtility } from "./html-utility.js";
import { RdDItemSigneDraconique } from "./item-signedraconique.js";
import { Misc } from "./misc.js";
import { RdDRollTables } from "./rdd-rolltables.js";
import { TMRType, TMRUtility } from "./tmr-utility.js";
export class DialogCreateSigneDraconique extends Dialog {
static async createSigneForActors() {
const signe = await RdDItemSigneDraconique.randomSigneDraconique({ephemere: true});
let dialogData = {
signe: signe,
tmrs: TMRUtility.listSelectedTMR(signe.data.typesTMR ?? []),
actors: game.actors.filter(actor => actor.isHautRevant()).map(actor => {
let actorData = duplicate(Misc.data(actor));
actorData.selected = actor.hasPlayerOwner;
return actorData;
})
};
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-create-signedraconique.html", dialogData);
new DialogCreateSigneDraconique(dialogData, html)
.render(true);
}
constructor(dialogData, html, callback) {
let options = { classes: ["DialogCreateSigneDraconiqueActorsActors"], width: 500, height: 650, 'z-index': 99999 };
let conf = {
title: "Créer un signe",
content: html,
default: "Ajouter aux haut-rêvants",
buttons: {
"Ajouter aux haut-rêvants": { label: "Ajouter aux haut-rêvants", callback: it => { this._onCreerSigneActeurs(); } }
}
};
super(conf, options);
this.dialogData = dialogData;
}
async _onCreerSigneActeurs() {
await $("[name='signe.data.ephemere']").change();
await $(".signe-xp-sort").change();
this.validerSigne();
this.dialogData.actors.filter(it => it.selected).map(it => game.actors.get(it._id))
.forEach(actor => this._createSigneForActor(actor, this.dialogData.signe));
}
async _createSigneForActor(actor, signe) {
actor.createEmbeddedDocuments("Item", [signe]);
ChatMessage.create({
whisper: ChatUtility.getWhisperRecipientsAndGMs(Misc.data(actor).name),
content: await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-actor.html", {
signe: signe,
alias: Misc.data(actor).name
})
});
}
validerSigne() {
this.dialogData.signe.name = $("[name='signe.name']").val();
this.dialogData.signe.data.valeur.norm = $("[name='signe.data.valeur.norm']").val();
this.dialogData.signe.data.valeur.sign = $("[name='signe.data.valeur.sign']").val();
this.dialogData.signe.data.valeur.part = $("[name='signe.data.valeur.part']").val();
this.dialogData.signe.data.difficulte = $("[name='signe.data.difficulte']").val();
this.dialogData.signe.data.ephemere = $("[name='signe.data.ephemere']").prop("checked");
this.dialogData.signe.data.duree = $("[name='signe.data.duree']").val();
this.dialogData.signe.data.typesTMR = $(".select-tmr").val();
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
this.setEphemere(this.dialogData.signe.data.ephemere);
html.find(".signe-aleatoire").click(event => this.setSigneAleatoire());
html.find("[name='signe.data.ephemere']").change((event) => this.setEphemere(event.currentTarget.checked));
html.find(".select-actor").change((event) => this.onSelectActor(event));
html.find(".signe-xp-sort").change((event) => this.onValeurXpSort(event));
}
async setSigneAleatoire() {
const newSigne = await RdDItemSigneDraconique.randomSigneDraconique({ephemere: true});
$("[name='signe.name']").val(newSigne.name);
$("[name='signe.data.valeur.norm']").val(newSigne.data.valeur.norm);
$("[name='signe.data.valeur.sign']").val(newSigne.data.valeur.sign);
$("[name='signe.data.valeur.part']").val(newSigne.data.valeur.part);
$("[name='signe.data.difficulte']").val(newSigne.data.difficulte);
$("[name='signe.data.duree']").val(newSigne.data.duree);
$("[name='signe.data.ephemere']").prop("checked", newSigne.data.ephemere);
$(".select-tmr").val(newSigne.data.typesTMR);
this.setEphemere(newSigne.data.ephemere);
}
async setEphemere(ephemere) {
this.dialogData.signe.data.ephemere = ephemere;
HtmlUtility._showControlWhen($(".signe-data-duree"), ephemere);
}
async onSelectActor(event) {
event.preventDefault();
const options = event.currentTarget.options;
for (var i = 0; i < options.length; i++) { // looping over the options
const actorId = options[i].attributes["data-actor-id"].value;
const actor = this.dialogData.actors.find(it => it._id == actorId);
if (actor) {
actor.selected = options[i].selected;
}
};
}
onValeurXpSort(event) {
const codeReussite = event.currentTarget.attributes['data-typereussite']?.value ?? 0;
const xp = Number(event.currentTarget.value);
const oldValeur = this.dialogData.signe.data.valeur;
this.dialogData.signe.data.valeur = RdDItemSigneDraconique.calculValeursXpSort(codeReussite, xp, oldValeur);
}
}

View File

@ -0,0 +1,71 @@
import { Grammar } from "./grammar.js";
import { Misc } from "./misc.js";
import { RdDUtility } from "./rdd-utility.js";
export class DialogFabriquerPotion extends Dialog {
/* -------------------------------------------- */
static async create(actor, item, dialogConfig) {
let potionData = DialogFabriquerPotion.prepareData(actor, item);
let conf = {
title: `Fabriquer une potion de ${potionData.data.categorie}`,
content: await renderTemplate(dialogConfig.html, potionData),
default: potionData.buttonName,
};
let options = { classes: ["dialogfabriquerpotion"], width: 600, height: 160, 'z-index': 99999 };
mergeObject(options, dialogConfig.options ?? {}, { overwrite: true })
const dialog = new DialogFabriquerPotion(actor, potionData, conf, options);
dialog.render(true);
return dialog;
}
/* -------------------------------------------- */
static prepareData(actor, item) {
let potionData = duplicate(Misc.data(item));
potionData.nbBrinsSelect = RdDUtility.buildListOptions(1, potionData.data.quantite);
potionData.nbBrins = Math.min(potionData.data.quantite, DialogFabriquerPotion.getNombreBrinOptimal(potionData));
potionData.buttonName = "Fabriquer";
return potionData;
}
/* -------------------------------------------- */
constructor(actor, potionData, conf, options) {
conf.buttons = {
[potionData.buttonName]: {
label: potionData.buttonName, callback: it => this.onFabriquer(it)
}
};
super(conf, options);
this.actor = actor;
this.potionData = potionData;
}
static getNombreBrinOptimal(herbeData) {
switch (herbeData.data.categorie ?? '') {
case "Soin": return 12 - herbeData.data.niveau;
case "Repos": return 7 - herbeData.data.niveau;
}
return 1;
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
html.find("#nbBrins").change(event => {
this.potionData.nbBrins = Misc.toInt(event.currentTarget.value);
});
}
/* -------------------------------------------- */
async onFabriquer(it) {
await $("#nbBrins").change();
this.actor.fabriquerPotion(this.potionData);
this.close();
}
}

View File

@ -0,0 +1,95 @@
import { Misc } from "./misc.js";
import { RdDUtility } from "./rdd-utility.js";
export class DialogItemAchat extends Dialog {
static async onButtonAcheter(event) {
const buttonAcheter = event.currentTarget;
if (!buttonAcheter.attributes['data-jsondata']?.value) {
ui.notifications.warn("Impossible d'acheter: informations sur l'objet manquantes")
return;
}
const chatMessageIdVente = RdDUtility.findChatMessageId(buttonAcheter);
const vendeurId = buttonAcheter.attributes['data-vendeurId']?.value;
const vendeur = vendeurId ? game.actors.get(vendeurId) : undefined;
const acheteur = RdDUtility.getSelectedActor();
if (!acheteur && !vendeur) {
ui.notifications.info("Pas d'acheteur ni de vendeur, aucun changement");
return;
}
let venteData = DialogItemAchat.prepareVenteData(buttonAcheter, vendeurId, vendeur, acheteur);
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-achat.html`, venteData);
const dialog = new DialogItemAchat(html, vendeur, acheteur, venteData, chatMessageIdVente);
dialog.render(true);
}
constructor(html, vendeur, acheteur, venteData, chatMessageIdVente) {
let options = { classes: ["dialogachat"], width: 400, height: 300, 'z-index': 99999 };
const actionAchat = venteData.prixLot > 0 ? "Acheter" : "Prendre";
let conf = {
title: actionAchat,
content: html,
default: actionAchat,
buttons: {
[actionAchat]: { label: actionAchat, callback: it => { this.onAchat(); } },
"decliner": { label: "Décliner", callback: it => { } }
}
};
super(conf, options);
this.vendeur = vendeur;
this.acheteur = acheteur;
this.chatMessageIdVente = chatMessageIdVente;
this.venteData = venteData;
}
static prepareVenteData(buttonAcheter, vendeurId, vendeur, acheteur) {
const jsondata = buttonAcheter.attributes['data-jsondata']?.value;
const prixLot = buttonAcheter.attributes['data-prixLot']?.value ?? 0;
let venteData = {
item: JSON.parse(jsondata),
vendeurId: vendeurId,
vendeur: Misc.data(vendeur),
acheteur: Misc.data(acheteur),
tailleLot: parseInt(buttonAcheter.attributes['data-tailleLot']?.value ?? 1),
quantiteIllimite: buttonAcheter.attributes['data-quantiteIllimite']?.value == 'true',
quantiteNbLots: parseInt(buttonAcheter.attributes['data-quantiteNbLots']?.value),
nombreLots: 1,
prixLot: prixLot,
prixTotal: prixLot,
isVente: prixLot > 0
};
return venteData;
}
async onAchat() {
await $(".nombreLots").change();
(this.vendeur ?? this.acheteur).achatVente({
vendeurId: this.vendeur?.id,
acheteurId: this.acheteur?.id,
nombreLots: this.venteData.nombreLots,
prixTotal: this.venteData.prixTotal,
chatMessageIdVente: this.chatMessageIdVente
});
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
html.find(".nombreLots").change(event => this.setNombreLots(Number(event.currentTarget.value)));
}
setNombreLots(nombreLots) {
this.venteData.nombreLots = nombreLots;
this.venteData.prixTotal = (nombreLots * this.venteData.prixLot).toFixed(2);
$(".prixTotal").text(this.venteData.prixTotal);
}
}

View File

@ -0,0 +1,90 @@
import { Misc } from "./misc.js";
export class DialogConsommer extends Dialog {
static async create(actor, item, template = undefined, options = {}) {
const consommerData = DialogConsommer.prepareData(actor, item, options);
const html = await renderTemplate(template ?? `systems/foundryvtt-reve-de-dragon/templates/dialog-item-consommer.html`, consommerData);
return new DialogConsommer(actor, item, consommerData, html, options)
}
constructor(actor, item, consommerData, html, options = {}) {
mergeObject(options, { classes: ["dialogconsommer"], width: 350, height: 450, 'z-index': 99999 }, { overwrite: false })
let conf = {
title: consommerData.title,
content: html,
default: consommerData.buttonName,
buttons: {
[consommerData.buttonName]: {
label: consommerData.buttonName, callback: it => this.onConsommer(it)
}
}
};
super(conf, options);
this.actor = actor;
this.item = item;
this.consommerData = consommerData;
}
async onConsommer(event) {
await $(".se-forcer").change();
await $(".consommer-doses").change();
this.actor.consommer(this.item, this.consommerData.choix);
}
/* -------------------------------------------- */
static prepareData(actor, item, options) {
const itemData = duplicate(Misc.data(item));
let consommerData = {
item: itemData,
cuisine: Misc.data(actor.getCompetence('cuisine')),
choix: {
doses: options.doses ?? 1,
seForcer: options.seForcer ?? false,
}
}
switch (itemData.type) {
case 'nourritureboisson':
consommerData.title = itemData.data.boisson ? `${itemData.name}: boire une dose` : `${itemData.name}: manger une portion`;
consommerData.buttonName = itemData.data.boisson ? "Boire" : "Manger";
break;
case 'potion':
consommerData.title = `${itemData.name}: boire la potion`;
consommerData.buttonName = "Boire";
break;
}
DialogConsommer.calculDoses(consommerData, consommerData.choix.doses)
return consommerData;
}
static calculDoses(consommerData) {
const doses = consommerData.choix.doses;
consommerData.totalSust = Misc.keepDecimals(doses * (consommerData.item.data.sust ?? 0), 2);
consommerData.totalDesaltere = consommerData.item.data.boisson
? Misc.keepDecimals(doses * (consommerData.item.data.desaltere ?? 0), 2)
: 0;
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
html.find(".se-forcer").change(event => this.setSeForcer(event));
html.find(".consommer-doses").change(event => this.selectDoses(event));
}
setSeForcer(event) {
this.consommerData.choix.seForcer = event.currentTarget.checked;
}
selectDoses(event) {
this.consommerData.choix.doses = Number(event.currentTarget.value);
DialogConsommer.calculDoses(this.consommerData);
$(".total-sust").text(this.consommerData.totalSust);
$(".total-desaltere").text(this.consommerData.totalDesaltere);
}
}

View File

@ -0,0 +1,94 @@
import { HtmlUtility } from "./html-utility.js";
import { Misc } from "./misc.js";
export class DialogItemVente extends Dialog {
static async create(item, callback) {
const itemData = Misc.data(item);
const venteData = {
item: itemData,
alias: item.actor?.name ?? game.user.name,
vendeurId: item.actor?.id,
prixOrigine: itemData.data.cout,
prixUnitaire: itemData.data.cout,
prixLot: itemData.data.cout,
tailleLot: 1,
quantiteNbLots: itemData.data.quantite,
quantiteMaxLots: itemData.data.quantite,
quantiteMax: itemData.data.quantite,
quantiteIllimite: !item.isOwned,
isOwned: item.isOwned,
};
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-vente.html`, venteData);
return new DialogItemVente(venteData, html, callback);
}
constructor(venteData, html, callback) {
let options = { classes: ["dialogvente"], width: 400, height: 300, 'z-index': 99999 };
let conf = {
title: "Proposer",
content: html,
default: "proposer",
buttons: { "proposer": { label: "Proposer", callback: it => { this.onProposer(it); } } }
};
super(conf, options);
this.callback = callback;
this.venteData = venteData;
}
async onProposer(it) {
await $(".tailleLot").change();
await $(".quantiteNbLots").change();
await $(".quantiteIllimite").change();
await $(".prixLot").change();
this.callback(this.venteData);
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
HtmlUtility._showControlWhen($(".quantiteNbLots"), !this.venteData.quantiteIllimite)
html.find(".tailleLot").change(event => this.setTailleLot(Number(event.currentTarget.value)));
html.find(".quantiteNbLots").change(event => this.setNbLots(Number(event.currentTarget.value)));
html.find(".quantiteIllimite").change(event => this.setQuantiteIllimite(event.currentTarget.checked));
html.find(".prixLot").change(event => this.setPrixLot(Number(event.currentTarget.value)));
}
setPrixLot(prixLot) {
this.venteData.prixLot = prixLot;
}
setTailleLot(tailleLot) {
// recalculer le prix du lot
if (tailleLot != this.venteData.tailleLot) {
this.venteData.prixLot = (tailleLot * this.venteData.prixOrigine).toFixed(2);
$(".prixLot").val(this.venteData.prixLot);
}
this.venteData.tailleLot = tailleLot;
if (this.venteData.isOwned) {
// recalculer le nombre de lots max
this.venteData.quantiteMaxLots = Math.floor(this.venteData.quantiteMax / tailleLot);
this.venteData.quantiteNbLots = Math.min(this.venteData.quantiteMaxLots, this.venteData.quantiteNbLots);
$(".quantiteNbLots").val(this.venteData.quantiteNbLots);
$(".quantiteNbLots").attr("max", this.venteData.quantiteMaxLots)
}
}
setNbLots(nbLots) {
if (this.venteData.isOwned) {
nbLots = Math.max(0, Math.min(nbLots, this.venteData.quantiteMaxLots));
}
this.venteData.quantiteNbLots = nbLots;
$(".quantiteNbLots").val(this.venteData.quantiteNbLots);
}
setQuantiteIllimite(checked) {
this.venteData.quantiteIllimite = checked;
$(".label-quantiteIllimite").text(this.venteData.quantiteIllimite ? "Illimités" : "disponibles");
HtmlUtility._showControlWhen($(".quantiteNbLots"), !this.venteData.quantiteIllimite)
}
}

View File

@ -0,0 +1,52 @@
import { Misc } from "./misc.js";
export class DialogSplitItem extends Dialog {
static async create(item, callback) {
const itemData = Misc.data(item);
const splitData = {
item: itemData,
choix: { quantite: 1, max: itemData.data.quantite - 1 }
};
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-split.html`, splitData);
return new DialogSplitItem(item, splitData, html, callback)
}
constructor(item, splitData, html, callback) {
let options = { classes: ["dialogsplit"], width: 300, height: 160, 'z-index': 99999 };
let conf = {
title: "Séparer en deux",
content: html,
default: "separer",
buttons: {
"separer": {
label: "Séparer", callback: it => {
this.onSplit();
}
}
}
};
super(conf, options);
this.callback = callback;
this.item = item;
this.splitData = splitData;
}
async onSplit(){
await $(".choix-quantite").change();
this.callback(this.item, this.splitData.choix.quantite);
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
html.find(".choix-quantite").change(event => {
this.splitData.choix.quantite = Number(event.currentTarget.value);
});
}
}

View File

@ -24,6 +24,11 @@ export class Grammar {
return words?.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "") ?? words;
}
/* -------------------------------------------- */
static toLowerCaseNoAccentNoSpace(words) {
return words?.toLowerCase().normalize("NFD").replace(/[ \u0300-\u036f]/g, "") ?? words;
}
/* -------------------------------------------- */
static articleDetermine(genre) {
switch (Grammar.toLowerCaseNoAccent(genre)) {

View File

@ -3,7 +3,7 @@ import { RdDUtility } from "./rdd-utility.js";
/* -------------------------------------------- */
// Activate chat listeners defined
Hooks.on('renderChatLog', (log, html, data) => {
RdDUtility.chatListeners(html);
});
// Hooks.on('renderChatLog', (log, html, data) => {
// RdDUtility.chatListeners(html);
// });

View File

@ -112,7 +112,7 @@ export class RdDItemArme extends Item {
if (defCategory == 'boucliers') {
return false;
}
// Parer avec une hache ou une arme dhast exige toujours une signi$cative
// Parer avec une hache ou une arme dhast exige toujours une significative
if (defCategory.match(/(hast|haches)/)) {
return true;
}

View File

@ -1,8 +1,11 @@
import { Grammar } from "./grammar.js";
import { Misc } from "./misc.js";
const competenceTroncs = [["Esquive", "Dague", "Corps à corps"],
["Epée à 1 main", "Epée à 2 mains", "Hache à 1 main", "Hache à 2 mains", "Lance", "Masse à 1 main", "Masse à 2 mains"]];
const competence_xp_par_niveau = [5, 5, 5, 10, 10, 10, 10, 15, 15, 15, 15, 20, 20, 20, 20, 30, 30, 40, 40, 60, 60, 100, 100, 100, 100, 100, 100, 100, 100, 100];
const competence_niveau_max = competence_xp_par_niveau.length - 10;
const xp_par_niveau = [5, 5, 5, 10, 10, 10, 10, 15, 15, 15, 15, 20, 20, 20, 20, 30, 30, 40, 40, 60, 60, 100, 100, 100, 100, 100, 100, 100, 100, 100];
const niveau_max = xp_par_niveau.length - 10;
/* -------------------------------------------- */
const limitesArchetypes = [
{ "niveau": 0, "nombreMax": 100, "nombre": 0 },
@ -21,14 +24,14 @@ const limitesArchetypes = [
/* -------------------------------------------- */
const categorieCompetences = {
"generale": { level: "-4", label: "Générales" },
"particuliere": { level: "-8", label: "Particulières" },
"specialisee": { level: "-11", label: "Spécialisées" },
"connaissance": { level: "-11", label: "Connaissances" },
"draconic": { level: "-11", label: "Draconics" },
"melee": { level: "-6", label: "Mêlée" },
"tir": { level: "-8", label: "Tir" },
"lancer": { level: "-8", label: "Lancer" }
"generale": { base: -4, label: "Générales" },
"particuliere": { base: -8, label: "Particulières" },
"specialisee": { base: -11, label: "Spécialisées" },
"connaissance": { base: -11, label: "Connaissances" },
"draconic": { base: -11, label: "Draconics" },
"melee": { base: -6, label: "Mêlée" },
"tir": { base: -8, label: "Tir" },
"lancer": { base: -8, label: "Lancer" }
}
const compendiumCompetences = {
@ -41,9 +44,9 @@ const compendiumCompetences = {
function _buildCumulXP() {
let cumulXP = { "-11": 0 };
let cumul = 0;
for (let i = 0; i <= competence_xp_par_niveau.length; i++) {
for (let i = 0; i <= xp_par_niveau.length; i++) {
let level = i - 10;
cumul += competence_xp_par_niveau[i];
cumul += xp_par_niveau[i];
cumulXP[level] = cumul;
}
return cumulXP;
@ -53,29 +56,48 @@ const competence_xp_cumul = _buildCumulXP();
export class RdDItemCompetence extends Item {
/* -------------------------------------------- */
static actorCompendium(actorType) {
return compendiumCompetences[actorType];
}
/* -------------------------------------------- */
static getCategorieCompetences() {
return categorieCompetences;
}
/* -------------------------------------------- */
static getNiveauBase(category) {
return categorieCompetences[category].level;
return categorieCompetences[category].base;
}
/* -------------------------------------------- */
static getLabelCategorie(category) {
return categorieCompetences[category].label;
}
/* -------------------------------------------- */
static getCategorie(competence) {
return Misc.data(competence)?.data.categorie;
}
static isDraconic(competence) {
return Misc.data(competence).data.categorie == 'draconic';
}
/* -------------------------------------------- */
static getVoieDraconic(competences, voie) {
voie = Grammar.toLowerCaseNoAccent(voie);
return competences.find(it => RdDItemCompetence.isDraconic(it) && Grammar.toLowerCaseNoAccent(Misc.data(it).name).includes(voie));
}
/* -------------------------------------------- */
static getEsquive(competences) {
return { name: 'Esquive', niveau: RdDItemCompetence.findCompetence(competences, 'Esquive')?.data.niveau ?? -6 };
}
/* -------------------------------------------- */
static isCompetenceArme(competence) {
switch (competence.data.categorie) {
switch (Misc.templateData(competence).categorie) {
case 'melee':
return competence.name != 'Esquive';
return Misc.data(competence).name != 'Esquive';
case 'tir':
case 'lancer':
return true;
@ -85,15 +107,15 @@ export class RdDItemCompetence extends Item {
/* -------------------------------------------- */
static isArmeUneMain(competence) {
return competence?.name.toLowerCase().includes("1 main");
return Misc.data(competence)?.name.toLowerCase().includes("1 main");
}
static isArme2Main(competence) {
return competence?.name.toLowerCase().includes("2 main");
return Misc.data(competence)?.name.toLowerCase().includes("2 main");
}
/* -------------------------------------------- */
static isMalusEncombrementTotal(competence) {
return competence?.name.toLowerCase().match(/(natation|acrobatie)/);
return Misc.data(competence)?.name.toLowerCase().match(/(natation|acrobatie)/);
}
/* -------------------------------------------- */
@ -110,17 +132,18 @@ export class RdDItemCompetence extends Item {
/* -------------------------------------------- */
static computeTotalXP(competences) {
const total = competences.map(c => RdDItemCompetence.computeXP(c))
.reduce((a, b) => a + b, 0);
.reduce(Misc.sum(), 0);
const economieTronc = RdDItemCompetence.computeEconomieXPTronc(competences);
return total - economieTronc;
}
/* -------------------------------------------- */
static computeXP(competence) {
const factor = competence.name.includes('Thanatos') ? 2 : 1; // Thanatos compte double !
const xpNiveau = RdDItemCompetence.computeDeltaXP(competence.data.base, competence.data.niveau ?? competence.data.base);
const xp = competence.data.xp ?? 0;
const xpSort = competence.data.xp_sort ?? 0;
const itemData = Misc.data(competence);
const factor = itemData.name.includes('Thanatos') ? 2 : 1; // Thanatos compte double !
const xpNiveau = RdDItemCompetence.computeDeltaXP(itemData.data.base, itemData.data.niveau ?? itemData.data.base);
const xp = itemData.data.xp ?? 0;
const xpSort = itemData.data.xp_sort ?? 0;
return factor * (xpNiveau + xp) + xpSort;
}
@ -128,12 +151,12 @@ export class RdDItemCompetence extends Item {
static computeEconomieXPTronc(competences) {
return competenceTroncs.map(
list => list.map(name => RdDItemCompetence.findCompetence(competences, name))
// calcul du coût xp jusqu'au niveau 0 maximum
.map(it => RdDItemCompetence.computeDeltaXP(it?.data.base ?? -11, Math.min(it?.data.niveau ?? -11, 0)))
.sort((a, b) => b - a) // tri descendant
.splice(0, 1) // ignorer le coût xp le plus élevé
.reduce((a, b) => a + b, 0)
).reduce((a, b) => a + b, 0);
// calcul du coût xp jusqu'au niveau 0 maximum
.map(it => RdDItemCompetence.computeDeltaXP(it?.data.base ?? -11, Math.min(it?.data.niveau ?? -11, 0)))
.sort(Misc.ascending())
.splice(0, list.length-1) // prendre toutes les valeurs sauf l'une des plus élevées
.reduce(Misc.sum(), 0)
).reduce(Misc.sum(), 0);
}
/* -------------------------------------------- */
@ -146,10 +169,11 @@ export class RdDItemCompetence extends Item {
/* -------------------------------------------- */
static computeCompetenceXPCost(competence) {
let xp = RdDItemCompetence.getDeltaXp(competence.data.base, competence.data.niveau ?? competence.data.base);
xp += competence.data.xp ?? 0;
if (competence.name.includes('Thanatos')) xp *= 2; /// Thanatos compte double !
xp += competence.data.xp_sort ?? 0;
const compData = Misc.data(competence);
let xp = RdDItemCompetence.getDeltaXp(compData.data.base, compData.data.niveau ?? compData.data.base);
xp += compData.data.xp ?? 0;
if (compData.name.includes('Thanatos')) xp *= 2; /// Thanatos compte double !
xp += compData.data.xp_sort ?? 0;
return xp;
}
@ -158,20 +182,22 @@ export class RdDItemCompetence extends Item {
let economie = 0;
for (let troncList of competenceTroncs) {
let list = troncList.map(name => RdDItemCompetence.findCompetence(competences, name))
.sort((c1, c2) => c2.data.niveau - c1.data.niveau); // tri du plus haut au plus bas
.sort(Misc.descending(c => Misc.templateData(c).niveau)); // tri du plus haut au plus bas
list.splice(0, 1); // ignorer la plus élevée
list.forEach(c => {
economie += RdDItemCompetence.getDeltaXp(c.data.base, Math.min(c.data.niveau, 0));
list.map(c => Misc.templateData(c)).forEach(tplData => {
economie += RdDItemCompetence.getDeltaXp(tplData.base, Math.min(tplData.niveau, 0));
});
}
return economie;
}
/* -------------------------------------------- */
static levelUp(itemData) {
itemData.data.xpNext = RdDItemCompetence.getCompetenceNextXp(itemData.data.niveau);
itemData.data.isLevelUp = itemData.data.xp >= itemData.data.xpNext;
}
/* -------------------------------------------- */
static isVisible(itemData) {
return Number(itemData.data.niveau) != RdDItemCompetence.getNiveauBase(itemData.data.categorie);
}
@ -183,8 +209,20 @@ export class RdDItemCompetence extends Item {
/* -------------------------------------------- */
static findCompetence(list, name) {
name = name.toLowerCase();
return list.find(it => it.name.toLowerCase() == name && (it.type == "competence" || it.type == "competencecreature"))
name = Grammar.toLowerCaseNoAccent(name);
const competences = list.filter(it => Grammar.toLowerCaseNoAccent(it.name).includes(name) && (it.type == "competence" || it.type == "competencecreature"));
if (competences.length == 0) {
return undefined;
}
let competence = competences.find(it => Grammar.toLowerCaseNoAccent(it.name) == name);
if (!competence) {
competence = competences[0];
if (competences.length > 1) {
const names = competences.map(it => it.name).reduce((a, b) => `${a}<br>${b}`);
ui.notifications.info(`Plusieurs compétences possibles:<br>${names}<br>La première sera choisie: ${competence.name}`);
}
}
return competence;
}
/* -------------------------------------------- */
@ -195,7 +233,7 @@ export class RdDItemCompetence extends Item {
/* -------------------------------------------- */
static getCompetenceXp(niveau) {
RdDItemCompetence._valideNiveau(niveau);
return niveau < -10 ? 0 : competence_xp_par_niveau[niveau + 10];
return niveau < -10 ? 0 : xp_par_niveau[niveau + 10];
}
/* -------------------------------------------- */
@ -207,19 +245,19 @@ export class RdDItemCompetence extends Item {
/* -------------------------------------------- */
static _valideNiveau(niveau) {
if (niveau < -11 || niveau > competence_niveau_max) {
console.warn(`Niveau ${niveau} en dehors des niveaux de compétences: [-11, ${competence_niveau_max} ]`);
if (niveau < -11 || niveau > niveau_max) {
console.warn(`Niveau ${niveau} en dehors des niveaux de compétences: [-11, ${niveau_max} ]`);
}
}
/* -------------------------------------------- */
static computeResumeArchetype(competences) {
const archetype = RdDItemCompetence.getLimitesArchetypes();
competences.forEach(it => {
let niveau = Math.max(0, it.data.niveau_archetype);
archetype[niveau] = archetype[niveau] ?? { "niveau": niveau, "nombreMax": 0, "nombre": 0 };
archetype[niveau].nombre = (archetype[niveau]?.nombre ?? 0) + 1;
});
competences.map(it => Math.max(0, Misc.templateData(it).niveau_archetype))
.forEach(niveau => {
archetype[niveau] = archetype[niveau] ?? { "niveau": niveau, "nombreMax": 0, "nombre": 0 };
archetype[niveau].nombre = (archetype[niveau]?.nombre ?? 0) + 1;
});
return archetype;
}

View File

@ -5,8 +5,8 @@ export class RdDItemCompetenceCreature extends Item {
/* -------------------------------------------- */
static setRollDataCreature(rollData) {
rollData.competence = Misc.data(rollData.competence);
rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.data.carac_value } };
rollData.competence = duplicate(rollData.competence);
rollData.competence.data.defaut_carac = "carac_creature";
rollData.competence.data.categorie = "creature";
rollData.selectedCarac = rollData.carac.carac_creature;
@ -26,6 +26,7 @@ export class RdDItemCompetenceCreature extends Item {
competence: itemData.name,
resistance: 100,
equipe: true,
dommagesReels: arme.data.dommages,
penetration: 0,
force: 0,
rapide: true

View File

@ -1,22 +1,23 @@
import { Misc } from "./misc.js";
const monnaiesData = [
{
_id: randomID(16), name: "Etain (1 denier)", type: 'monnaie',
name: "Etain (1 denier)", type: 'monnaie',
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp",
data: { quantite: 0, valeur_deniers: 1, encombrement: 0.001, description: "" }
},
{
_id: randomID(16), name: "Bronze (10 deniers)", type: 'monnaie',
name: "Bronze (10 deniers)", type: 'monnaie',
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_bronze_epees.webp",
data: { quantite: 0, valeur_deniers: 10, encombrement: 0.002, description: "" }
},
{
_id: randomID(16), name: "Argent (1 sol)", type: 'monnaie',
name: "Argent (1 sol)", type: 'monnaie',
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_argent_sol.webp",
data: { quantite: 0, valeur_deniers: 100, encombrement: 0.003, description: "" }
},
{
_id: randomID(16), name: "Or (10 sols)", type: 'monnaie',
name: "Or (10 sols)", type: 'monnaie',
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_or_sol.webp",
data: { quantite: 0, valeur_deniers: 1000, encombrement: 0.004, description: "" }
}
@ -24,17 +25,37 @@ const monnaiesData = [
export class Monnaie {
static isSystemMonnaie(item) {
let present = monnaiesData.find(monnaie => monnaie.data.valeur_deniers == Misc.data(item)?.data?.valeur_deniers);
return present;
}
static monnaiesData() {
return monnaiesData;
}
static filtrerMonnaies(items) {
return items.filter(it => it.type == 'monnaie');
return items.filter(it => Misc.data(it).type == 'monnaie');
}
static monnaiesManquantes(items) {
const valeurs = Monnaie.filtrerMonnaies(items)
.map(it => it.data.valeur_deniers)
return duplicate(monnaiesData.filter(monnaie => !valeurs.find(v => v != monnaie.data.valeur_deniers)));
.map(it => Misc.templateData(it).valeur_deniers);
const manquantes = monnaiesData.filter(monnaie => !valeurs.find(v => v != Misc.templateData(monnaie).valeur_deniers));
//const manquantes = monnaiesData.filter(monnaie => !valeurs.find(v => v != Misc.templateData(monnaie).valeur_deniers) );
//console.log("Valeurs : ", valeurs, manquantes);
return []; //manquantes;
}
static deValeur(monnaie, v) {
return v != monnaie.data.valeur_deniers;
}
static arrondiDeniers(sols) {
return sols.toFixed(2);
}
static triValeurDenier() {
return Misc.ascending(item => Misc.data(item).data.valeur_deniers);
}
}

View File

@ -1,315 +0,0 @@
import { Misc } from "./misc.js";
import { RdDUtility } from "./rdd-utility.js";
/* -------------------------------------------- */
export class RdDItem extends Item {
/* -------------------------------------------- */
async postItem() {
console.log(this);
const properties = this[`_${this.data.type}ChatData`]();
const itemData = Misc.data(this);
let chatData = duplicate(itemData);
chatData["properties"] = properties
//Check if the posted item should have availability/pay buttons
chatData.hasPrice = "cout" in chatData.data;
chatData.data.cout_deniers = 0;
let dialogResult = [-1, -1]; // dialogResult[0] = quantité, dialogResult[1] = prix
if (chatData.hasPrice )
{
let sols = chatData.data.cout;
chatData.data.cout_deniers = Math.floor(sols * 100);
dialogResult = await new Promise( (resolve, reject) => {new Dialog({
content :
`<p>Modifier la quantité?</p>
<div class="form-group">
<label> Quantité</label>
<input name="quantity" type="text" value="1"/>
</div>
<p>Modifier la prix?</p>
<div class="form-group">
<label> Prix en Sols</label>
<input name="price" type="text" value="${chatData.data.cout}"/>
</div>
`,
title : "Quantité & Prix",
buttons : {
post : {
label : "Soumettre",
callback: (dlg) => {
resolve( [ dlg.find('[name="quantity"]').val(), dlg.find('[name="price"]').val() ] )
}
},
}
}).render(true)
})
}
if (dialogResult[0] > 0)
{
if (this.isOwned)
{
if (itemData.data.quantite == 0)
dialogResult[0] = -1
else if (itemData.data.quantite < dialogResult[0])
{
dialogResult[0] = itemData.data.quantite;
ui.notifications.notify(`Impossible de poster plus que ce que vous avez. La quantité à été réduite à ${dialogResult[0]}.`)
this.update({"data.quantite" : 0})
}
else {
ui.notifications.notify(`Quantité réduite par ${dialogResult[0]}.`)
this.update({"data.quantite" : itemData.data.quantite - dialogResult[0]})
}
}
}
if ( chatData.hasPrice ) {
if (dialogResult[0] > 0)
chatData.postQuantity = Number(dialogResult[0]);
if (dialogResult[1] > 0) {
chatData.postPrice = dialogResult[1];
chatData.data.cout_deniers = Math.floor(dialogResult[1] * 100); // Mise à jour cout en deniers
}
chatData.finalPrice = Number(chatData.postPrice) * Number(chatData.postQuantity);
chatData.data.cout_deniers_total = chatData.data.cout_deniers * Number(chatData.postQuantity);
chatData.data.quantite = chatData.postQuantity;
console.log("POST : ", chatData.finalPrice, chatData.data.cout_deniers_total, chatData.postQuantity);
}
// 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: itemData,
});
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-item.html', chatData).then(html => {
let chatOptions = RdDUtility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */
_objetChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Encombrement</b>: ${rddData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_armeChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Compétence</b>: ${rddData.competence}`,
`<b>Dommages</b>: ${rddData.dommages}`,
`<b>Force minimum</b>: ${rddData.force}`,
`<b>Resistance</b>: ${rddData.resistance}`,
`<b>Encombrement</b>: ${rddData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_conteneurChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Capacité</b>: ${rddData.capacite} Enc.`,
`<b>Encombrement</b>: ${rddData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_munitionChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Encombrement</b>: ${rddData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_armureChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Protection</b>: ${rddData.protection}`,
`<b>Détérioration</b>: ${rddData.deterioration}`,
`<b>Malus armure</b>: ${rddData.malus}`,
`<b>Encombrement</b>: ${rddData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_competenceChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Catégorie</b>: ${rddData.categorie}`,
`<b>Niveau</b>: ${rddData.niveau}`,
`<b>Caractéristique par défaut</b>: ${rddData.carac_defaut}`,
`<b>XP</b>: ${rddData.xp}`
]
return properties;
}
/* -------------------------------------------- */
_competencecreatureChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Catégorie</b>: ${rddData.categorie}`,
`<b>Niveau</b>: ${rddData.niveau}`,
`<b>Caractéristique</b>: ${rddData.carac_value}`,
`<b>XP</b>: ${rddData.xp}`
]
return properties;
}
/* -------------------------------------------- */
_sortChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Draconic</b>: ${rddData.draconic}`,
`<b>Difficulté</b>: ${rddData.difficulte}`,
`<b>Case TMR</b>: ${rddData.caseTMR}`,
`<b>Points de Rêve</b>: ${rddData.ptreve}`
]
return properties;
}
/* -------------------------------------------- */
_herbeChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Milieu</b>: ${rddData.milieu}`,
`<b>Rareté</b>: ${rddData.rarete}`,
`<b>Catégorie</b>: ${rddData.categorie}`,
]
return properties;
}
/* -------------------------------------------- */
_ingredientChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Milieu</b>: ${rddData.milieu}`,
`<b>Rareté</b>: ${rddData.rarete}`,
`<b>Catégorie</b>: ${rddData.categorie}`,
]
return properties;
}
/* -------------------------------------------- */
_tacheChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Caractéristique</b>: ${rddData.carac}`,
`<b>Compétence</b>: ${rddData.competence}`,
`<b>Périodicité</b>: ${rddData.periodicite}`,
`<b>Fatigue</b>: ${rddData.fatigue}`,
`<b>Difficulté</b>: ${rddData.difficulte}`,
`<b>Points de Tâche</b>: ${rddData.points_de_tache}`,
`<b>Points de Tâche atteints</b>: ${rddData.points_de_tache_courant}`
]
return properties;
}
/* -------------------------------------------- */
_livreChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Compétence</b>: ${rddData.competence}`,
`<b>Auteur</b>: ${rddData.auteur}`,
`<b>Difficulté</b>: ${rddData.difficulte}`,
`<b>Points de Tâche</b>: ${rddData.points_de_tache}`,
`<b>Encombrement</b>: ${rddData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_potionChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Rareté</b>: ${rddData.rarete}`,
`<b>Catégorie</b>: ${rddData.categorie}`,
`<b>Encombrement</b>: ${rddData.encombrement}`,
]
return properties;
}
/* -------------------------------------------- */
_queueChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Refoulement</b>: ${rddData.refoulement}`
]
return properties;
}
/* -------------------------------------------- */
_ombreChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Refoulement</b>: ${rddData.refoulement}`
]
return properties;
}
/* -------------------------------------------- */
_souffleChatData() {
const rddData = Misc.data(this).data;
let properties = [];
return properties;
}
/* -------------------------------------------- */
_teteChatData() {
const rddData = Misc.data(this).data;
let properties = [];
return properties;
}
/* -------------------------------------------- */
_tarotChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Concept</b>: ${rddData.concept}`,
`<b>Aspect</b>: ${rddData.aspect}`,
]
return properties;
}
/* -------------------------------------------- */
_nombreastralChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Valeur</b>: ${rddData.value}`,
`<b>Jour</b>: ${rddData.jourlabel}`,
]
return properties;
}
/* -------------------------------------------- */
_monnaieChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Valeur en Deniers</b>: ${rddData.valeur_deniers}`,
`<b>Encombrement</b>: ${rddData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_meditationChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Thème</b>: ${rddData.theme}`,
`<b>Compétence</b>: ${rddData.competence}`,
`<b>Support</b>: ${rddData.support}`,
`<b>Heure</b>: ${rddData.heure}`,
`<b>Purification</b>: ${rddData.purification}`,
`<b>Vêture</b>: ${rddData.veture}`,
`<b>Comportement</b>: ${rddData.comportement}`,
`<b>Case TMR</b>: ${rddData.tmr}`
]
return properties;
}
/* -------------------------------------------- */
_casetmrChatData() {
const rddData = Misc.data(this).data;
let properties = [
`<b>Coordonnée</b>: ${rddData.coord}`,
`<b>Spécificité</b>: ${rddData.specific}`
]
return properties;
}
}

View File

@ -1,9 +1,11 @@
import { RdDItemSort } from "./item-sort.js";
import { RdDUtility } from "./rdd-utility.js";
import { RdDItem } from "./item-rdd.js";
import { RdDAlchimie } from "./rdd-alchimie.js";
import { RdDItemCompetence } from "./item-competence.js";
import { RdDHerbes } from "./rdd-herbes.js";
import { Misc } from "./misc.js";
import { HtmlUtility } from "./html-utility.js";
import { ReglesOptionelles } from "./regles-optionelles.js";
/**
* Extend the basic ItemSheet with some very simple modifications
@ -12,85 +14,139 @@ import { Misc } from "./misc.js";
export class RdDItemSheet extends ItemSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["foundryvtt-reve-de-dragon", "sheet", "item"],
template: "systems/foundryvtt-reve-de-dragon/templates/item-sheet.html",
width: 550,
height: 550
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["foundryvtt-reve-de-dragon", "sheet", "item"],
template: "systems/foundryvtt-reve-de-dragon/templates/item-sheet.html",
width: 550,
height: 550
//tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
});
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
const videSiConteneur = this.object.isConteneur() ? this.object.isVide() : true;
// 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(
{
if ("cout" in Misc.templateData(this.object) && videSiConteneur) {
buttons.unshift({
class: "post",
icon: "fas fa-comments-dollar",
onclick: ev => this.item.proposerVente()
});
}
else {
buttons.unshift({
class: "post",
icon: "fas fa-comment",
onclick: ev => new RdDItem(Misc.data(this.item)).postItem()
})
onclick: ev => this.item.postItem()
});
}
return buttons
}
/* -------------------------------------------- */
/** @override */
setPosition(options={}) {
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetHeader = this.element.find(".sheet-header");
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
const bodyHeight = position.height - sheetHeader[0].clientHeight;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async getData() {
let formData = super.getData();
formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences();
if ( formData.item.type == 'tache' || formData.item.type == 'livre' || formData.item.type == 'meditation' || formData.item.type == 'oeuvre') {
formData.caracList = duplicate(game.system.model.Actor.personnage.carac);
formData.competences = await RdDUtility.loadCompendiumNames( 'foundryvtt-reve-de-dragon.competences' );
const objectData = Misc.data(this.object);
let formData = {
title: objectData.name,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
data: objectData.data,
isGM: game.user.isGM,
owner: this.document.isOwner,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
isSoins: false
}
if (formData.item.type == 'arme') {
formData.competences = await RdDUtility.loadCompendium( 'foundryvtt-reve-de-dragon.competences', it => RdDItemCompetence.isCompetenceArme(it));
}
if ( formData.item.type == 'recettealchimique' ) {
RdDAlchimie.processManipulation(formData.item, this.actor && this.actor._id );
}
if ( this.actor ) {
if (this.actor) {
formData.isOwned = true;
formData.actorId = this.actor._id;
formData.actorId = this.actor.id;
}
formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences();
if (formData.type == 'tache' || formData.type == 'livre' || formData.type == 'meditation' || formData.type == 'oeuvre') {
formData.caracList = duplicate(game.system.model.Actor.personnage.carac);
formData.competences = await RdDUtility.loadCompendium('foundryvtt-reve-de-dragon.competences');
}
if (formData.type == 'arme') {
formData.competences = await RdDUtility.loadCompendium('foundryvtt-reve-de-dragon.competences', it => RdDItemCompetence.isCompetenceArme(it));
console.log(formData.competences);
}
if (formData.type == 'recettealchimique') {
RdDAlchimie.processManipulation(objectData, this.actor && this.actor.id);
}
if (formData.type == 'potion') {
if (this.dateUpdated) {
formData.data.prdate = this.dateUpdated;
this.dateUpdated = undefined;
}
RdDHerbes.updatePotionData(formData);
}
if (formData.isOwned && formData.type == 'herbe' && (formData.data.categorie == 'Soin' || formData.data.categorie == 'Repos')) {
formData.isIngredientPotionBase = true;
}
formData.bonusCaseList = RdDItemSort.getBonusCaseList(formData, true);
formData.isGM = game.user.isGM; // Pour verrouiller certaines éditions
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
activateListeners(html) {
super.activateListeners(html);
HtmlUtility._showControlWhen($(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') || game.user.isGM || !this.object.isOwned);
HtmlUtility._showControlWhen($(".item-magique"), this.object.isMagique());
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Select competence categorie
html.find("#categorie").on("click", this._onClickSelectCategorie.bind(this) );
html.find(".categorie").change(event => this._onSelectCategorie(event));
html.find('#sheet-competence-xp').change((event) => {
if ( this.object.data.type == 'competence') {
RdDUtility.checkThanatosXP( this.object.data.name );
html.find('.sheet-competence-xp').change((event) => {
if (this.object.data.type == 'competence') {
RdDUtility.checkThanatosXP(this.object.data.name);
}
} );
});
html.find('#creer-tache-livre').click((event) => {
html.find('.enchanteDate').change((event) => {
let jour = Number($('#jourMois').val());
let mois = $('#nomMois').val();
this.dateUpdated = game.system.rdd.calendrier.getIndexFromDate(jour, mois);
});
html.find('.creer-tache-livre').click((event) => {
let actorId = event.currentTarget.attributes['data-actor-id'].value;
let actor = game.actors.get( actorId );
actor.creerTacheDepuisLivre( this.item );
let actor = game.actors.get(actorId);
actor.creerTacheDepuisLivre(this.item);
});
html.find('.consommer-potion').click((event) => {
let actorId = event.currentTarget.attributes['data-actor-id'].value;
let actor = game.actors.get(actorId);
actor.consommerPotion(this.item);
});
html.find('.creer-potion-base').click((event) => {
let actorId = event.currentTarget.attributes['data-actor-id'].value;
let actor = game.actors.get(actorId);
actor.dialogFabriquerPotion(this.item);
});
html.find('.alchimie-tache a').click((event) => {
@ -98,39 +154,42 @@ export class RdDItemSheet extends ItemSheet {
let recetteId = event.currentTarget.attributes['data-recette-id'].value;
let tacheName = event.currentTarget.attributes['data-alchimie-tache'].value;
let tacheData = event.currentTarget.attributes['data-alchimie-data'].value;
let actor = game.actors.get( actorId );
if ( actor ) {
let actor = game.actors.get(actorId);
if (actor) {
actor.effectuerTacheAlchimie(recetteId, tacheName, tacheData);
} else {
ui.notifications.info("Impossible trouver un actur pour réaliser cette tache Alchimique.");
}
});
}
/* -------------------------------------------- */
async _onClickSelectCategorie(event) {
event.preventDefault();
let level = RdDItemCompetence.getNiveauBase(event.currentTarget.value);
this.object.data.data.base = level;
$("#base").val( level );
}
/* -------------------------------------------- */
get template()
{
let type = this.item.type;
async _onSelectCategorie(event) {
event.preventDefault();
if (this.object.isCompetence()){
let level = RdDItemCompetence.getNiveauBase(event.currentTarget.value);
Misc.templateData(this.object).base = level;
$("#base").val(level);
}
}
/* -------------------------------------------- */
get template() {
//console.log(this);
let type = this.object.data.type;
return `systems/foundryvtt-reve-de-dragon/templates/item-${type}-sheet.html`;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
_updateObject(event, formData) { // Deprecated en v0.8 à clarifier
//console.log("UPDATE !", formData);
// Données de bonus de cases ?
formData = RdDItemSort.buildBonusCaseStringFromFormData( formData );
formData = RdDItemSort.buildBonusCaseStringFromFormData(formData);
return this.object.update(formData);
}
}

View File

@ -0,0 +1,95 @@
import { RdDItemSigneDraconique } from "./item-signedraconique.js";
import { Misc } from "./misc.js";
import { TMRType, TMRUtility } from "./tmr-utility.js";
/**
* Item sheet pour signes draconiques
* @extends {ItemSheet}
*/
export class RdDSigneDraconiqueItemSheet extends ItemSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["foundryvtt-reve-de-dragon", "sheet", "item"],
template: "systems/foundryvtt-reve-de-dragon/templates/item-signedraconique-sheet.html",
width: 550,
height: 550
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({ class: "post", icon: "fas fa-comment", onclick: ev => this.item.postItem() });
return buttons;
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetHeader = this.element.find(".sheet-header");
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - sheetHeader[0].clientHeight;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async getData() {
const formData = duplicate(Misc.data(this.object));
mergeObject(formData, {
title: formData.name,
isGM: game.user.isGM,
owner: this.document.isOwner,
isOwned: this.actor ? true : false,
actorId: this.actor?.id,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
});
formData.tmrs = TMRUtility.listSelectedTMR(formData.data.typesTMR ?? []);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
if (!this.options.editable) return;
html.find(".signe-aleatoire").click(event => this.setSigneAleatoire());
html.find(".select-tmr").change((event) => this.onSelectTmr(event));
html.find(".signe-xp-sort").change((event) => this.onValeurXpSort(event.currentTarget.attributes['data-typereussite']?.value, Number(event.currentTarget.value)));
}
async setSigneAleatoire() {
const newSigne = await RdDItemSigneDraconique.randomSigneDraconique();
this.object.update(newSigne);
}
async onSelectTmr(event) {
event.preventDefault();
const selectedTMR = $(".select-tmr").val();
this.object.update({ 'data.typesTMR': selectedTMR });
}
async onValeurXpSort(event) {
const codeReussite = event.currentTarget.attributes['data-typereussite']?.value ?? 0;
const xp = Number(event.currentTarget.value);
const oldValeur = Misc.templateData(this.object).valeur;
const newValeur = RdDItemSigneDraconique.calculValeursXpSort(codeReussite, xp, oldValeur);
await this.object.update({ 'data.valeur': newValeur });
}
/* -------------------------------------------- */
get template() {
return `systems/foundryvtt-reve-de-dragon/templates/item-signedraconique-sheet.html`;
}
get title() {
return `Signe draconique: ${this.object.name}`;
}
}

View File

@ -0,0 +1,103 @@
import { defaultItemImg } from "./item.js";
import { Misc } from "./misc.js";
import { RdDDice } from "./rdd-dice.js";
import { RdDRollTables } from "./rdd-rolltables.js";
import { TMRType, TMRUtility } from "./tmr-utility.js";
const tableSignesIndicatifs = [
{ rarete: "Très facile", difficulte: 0, xp: 6, nbCases: 14 },
{ rarete: "Facile", difficulte: -2, xp: 10, nbCases: 10 },
{ rarete: "Moyen", difficulte: -3, xp: 15, nbCases: 7 },
{ rarete: "Difficile", difficulte: -5, xp: 20, nbCases: 4 },
{ rarete: "Ardu", difficulte: -8, xp: 30, nbCases: 1 }
]
export class RdDItemSigneDraconique {
static prepareSigneDraconiqueMeditation(meditation, rolled) {
if (rolled.isSuccess != undefined) {
meditation = Misc.data(meditation);
return {
name: "de la " + meditation.name,
type: "signedraconique",
img: meditation.img,
data: {
typesTMR: [TMRUtility.typeTmrName(meditation.data.tmr)],
difficulte: RdDItemSigneDraconique.getDiffSigneMeditation(rolled.code),
ephemere: true,
duree: "1 round",
valeur: { "norm": 3, "sign": 5, "part": 10 }
}
};
}
return undefined;
}
static getDiffSigneMeditation(code) {
switch (code) {
case "norm": return -7;
case "sign": return -3;
case "part": return 0;
}
return undefined;
}
static getXpSortSigneDraconique(code, signe) {
return Misc.data(signe).data.valeur[code] ?? 0;
}
static calculValeursXpSort(qualite, valeur, avant) {
switch (qualite) {
case "norm":
return {
norm: valeur,
sign: Math.max(valeur, avant.sign),
part: Math.max(valeur, avant.part)
}
case "sign":
return {
norm: Math.min(valeur, avant.norm),
sign: valeur,
part: Math.max(valeur, avant.part)
}
case "part":
return {
norm: Math.min(valeur, avant.norm),
sign: Math.min(valeur, avant.sign),
part: valeur
}
}
}
static async randomSigneDraconique(options = { ephemere: undefined }) {
let modele = await RdDDice.rollOneOf(tableSignesIndicatifs);
return {
name: await RdDItemSigneDraconique.randomSigneDescription(),
type: "signedraconique",
img: defaultItemImg.signedraconique,
data: {
typesTMR: await RdDItemSigneDraconique.randomTmrs(modele.nbCases),
ephemere: options?.ephemere == undefined ? RdDDice.rollTotal("1d2") == 2 : options.ephemere,
duree: "1 round",
difficulte: modele.difficulte,
valeur: { norm: modele.xp, sign: modele.xp, part: Math.floor(modele.xp * 1.5) },
}
};
}
static async randomTmrs(nbTmr = undefined) {
let tmrs = Object.values(TMRType)
.map(value => TMRUtility.typeTmrName(value.name));
let keep = nbTmr ?? (await RdDDice.rollTotal("1d" + TMRType.length) + 1);
for (let i = tmrs.length; i > keep; i--) {
tmrs.splice(await RdDDice.rollTotal("1d" + i), 1);
}
return tmrs;
}
static async randomSigneDescription() {
return await RdDRollTables.drawTextFromRollTable("Signes draconiques", false);
}
}

View File

@ -51,10 +51,10 @@ export class RdDItemSort extends Item {
* Retourne une liste de bonus/case pour un item-sheet
* @param {} item
*/
static getBonusCaseList( data, newCase = false ) {
static getBonusCaseList( item, newCase = false ) {
// Gestion spéciale case bonus
if ( data.item.type == 'sort') {
return this.buildBonusCaseList(data.data.bonuscase, newCase );
if ( item.type == 'sort') {
return this.buildBonusCaseList(item.data.bonuscase, newCase );
}
return undefined;
}
@ -106,7 +106,7 @@ export class RdDItemSort extends Item {
// Sauvegarde/update
let bonuscase = StringList.toString();
//console.log("Bonus cae :", bonuscase);
actor.updateEmbeddedEntity("OwnedItem", { _id: sort._id, 'data.bonuscase': bonuscase } );
actor.updateEmbeddedDocuments('Item', [{ _id: sort._id, 'data.bonuscase': bonuscase }] );
}
/* -------------------------------------------- */

562
module/item.js Normal file
View File

@ -0,0 +1,562 @@
import { DialogItemVente } from "./dialog-item-vente.js";
import { Grammar } from "./grammar.js";
import { Misc } from "./misc.js";
import { RdDUtility } from "./rdd-utility.js";
const typesObjetsEquipement = ["objet", "arme", "armure", "conteneur", "herbe", "ingredient", "livre", "potion", "munition", "nourritureboisson", "monnaie"];
const typesObjetsOeuvres = ["oeuvre", "recettecuisine", "musique", "chant", "danse", "jeu"];
const encBrin = 0.00005;// un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
export const defaultItemImg = {
competence: "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp",
compcreature: "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp",
arme: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_gnome.webp",
armure: "systems/foundryvtt-reve-de-dragon/icons/armes_armures/armure_plaques.webp",
conteneur: "systems/foundryvtt-reve-de-dragon/icons/objets/sac_a_dos.webp",
sort: "systems/foundryvtt-reve-de-dragon/icons/competence_oniros.webp",
herbe: "systems/foundryvtt-reve-de-dragon/icons/botanique/Endorlotte.png",
ingredient: "systems/foundryvtt-reve-de-dragon/icons/objets/sable_poudre.webp",
livre: "systems/foundryvtt-reve-de-dragon/icons/objets/livre.webp",
potion: "systems/foundryvtt-reve-de-dragon/icons/objets/liqueur_de_bagdol.webp",
queue: "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp",
ombre: "systems/foundryvtt-reve-de-dragon/icons/queue_dragon.webp",
souffle: "systems/foundryvtt-reve-de-dragon/icons/souffle_dragon.webp",
tete: "systems/foundryvtt-reve-de-dragon/icons/tete_dragon.webp",
meditation: "systems/foundryvtt-reve-de-dragon/icons/meditations_ecrits/meditation_alchimie.webp",
recettealchimique: "systems/foundryvtt-reve-de-dragon/icons/competence_alchimie.webp",
chant: "systems/foundryvtt-reve-de-dragon/icons/arts/chant_0.webp",
danse: "systems/foundryvtt-reve-de-dragon/icons/arts/danse_0.webp",
jeu: "systems/foundryvtt-reve-de-dragon/icons/arts/jeux_petasse.webp",
recettecuisine: "systems/foundryvtt-reve-de-dragon/icons/arts/recette_cuisine_1.webp",
musique: "systems/foundryvtt-reve-de-dragon/icons/arts/chant_0.webp",
maladie: "systems/foundryvtt-reve-de-dragon/icons/maladies_venins/maladie.webp",
poison: "systems/foundryvtt-reve-de-dragon/icons/maladies_venins/venin.webp",
oeuvre: "systems/foundryvtt-reve-de-dragon/icons/competence_comedie.webp",
nourritureboisson: "systems/foundryvtt-reve-de-dragon/icons/objets/provision_crue.webp",
signedraconique: "systems/foundryvtt-reve-de-dragon/icons/tmr/signe_draconique.webp",
}
/* -------------------------------------------- */
export class RdDItem extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
static getTypeObjetsEquipement() {
return typesObjetsEquipement;
}
static getTypesOeuvres() {
return typesObjetsOeuvres;
}
isCompetence() {
return Misc.data(this).type == 'competence';
}
isConteneur() {
return Misc.data(this).type == 'conteneur';
}
isVide() {
return this.isConteneur() && (Misc.templateData(this).contenu ?? []).length == 0;
}
isAlcool() {
const itemData = Misc.data(this);
return itemData.type == 'nourritureboisson' && itemData.data.boisson && itemData.data.alcoolise;
}
isPotion() {
return Misc.data(this).type == 'potion';
}
isEquipement() {
return RdDItem.getTypeObjetsEquipement().includes(Misc.data(this).type);
}
isCristalAlchimique() {
const itemData = Misc.data(this);
return itemData.type == 'objet' && Grammar.toLowerCaseNoAccent(itemData.name) == 'cristal alchimique' && itemData.data.quantite > 0;
}
isMagique() {
return Misc.templateData(this).magique;
}
getEncTotal() {
const itemData = Misc.data(this);
return Number(itemData.data.encombrement ?? 0) * Number(itemData.data.quantite ?? 1);
}
getEnc() {
const itemData = Misc.data(this);
switch (itemData.type) {
case 'herbe':
return encBrin;
}
return itemData.data.encombrement ?? 0;
}
prepareDerivedData() {
super.prepareDerivedData();
if (this.isEquipement(this)) {
this._calculsEquipement();
}
if (this.isPotion()) {
this.prepareDataPotion()
}
const itemData = Misc.data(this);
itemData.data.actionPrincipale = this.getActionPrincipale({ warnIfNot: false });
}
prepareDataPotion() {
const tplData = Misc.templateData(this);
const categorie = Grammar.toLowerCaseNoAccent(tplData.categorie);
tplData.magique = categorie.includes('enchante');
if (tplData.magique) {
if (categorie.includes('soin') || categorie.includes('repos')) {
tplData.puissance = tplData.herbebonus * tplData.pr;
}
}
}
_calculsEquipement() {
const tplData = Misc.templateData(this);
const quantite = this.isConteneur() ? 1 : (tplData.quantite ?? 0);
const enc = this.getEnc();
if (enc != undefined) {
tplData.encTotal = Math.max(enc, 0) * quantite;
}
if (tplData.cout != undefined) {
tplData.prixTotal = Math.max(tplData.cout, 0) * quantite;
}
}
getActionPrincipale(options = { warnIfNot: true }) {
const itemData = Misc.data(this);
if ((itemData.data.quantite ?? 0) <= 0) {
if (options.warnIfNot) {
ui.notifications.warn(`Vous n'avez plus de ${itemData.name}.`);
}
return undefined;
}
switch (itemData.type) {
case 'nourritureboisson': return itemData.data.boisson ? 'Boire' : 'Manger';
case 'potion': return 'Boire';
case 'livre': return 'Lire';
}
if (options.warnIfNot) {
ui.notifications.warn(`Impossible d'utilise un ${itemData.name}, aucune action associée définie.`);
}
return undefined;
}
async diminuerQuantite(nombre, options = { diminuerQuantite: true, supprimerSiZero: false }) {
if (options.diminuerQuantite == false) return;
await this.quantiteIncDec(-nombre, options);
}
async quantiteIncDec(nombre, options = { diminuerQuantite: true, supprimerSiZero: false }) {
const itemData = Misc.data(this);
const quantite = Number(itemData.data.quantite ?? -1);
if (quantite >= 0) {
const reste = Math.max(quantite + Number(nombre), 0);
if (reste == 0) {
if (options.supprimerSiZero) {
ui.notifications.notify(`${itemData.name} supprimé de votre équipement`);
await this.delete();
}
else {
ui.notifications.notify(`Il ne vous reste plus de ${itemData.name}, vous pouvez le supprimer de votre équipement, ou trouver un moyen de vous en procurer.`);
await this.update({ "data.quantite": 0 });
}
}
else {
await this.update({ "data.quantite": reste });
}
}
}
/* -------------------------------------------- */
// détermine si deux équipements sont similaires: de même type, et avec les même champs hormis la quantité
isEquipementSimilaire(other) {
const itemData = Misc.data(this);
const otherData = Misc.data(other);
const tplData = Misc.templateData(this);
const otherTplData = Misc.templateData(other);
if (!this.isEquipement()) return false;
if (itemData.type != otherData.type) return false;
if (itemData.name != otherData.name) return false;
if (tplData.quantite == undefined) return false;
const differences = Object.entries(tplData).filter(([key, value]) => !['quantite', 'encTotal', 'prixTotal', 'cout'].includes(key))
.filter(([key, value]) => value != otherTplData[key]);
if (differences.length > 0) {
let message = `Impossible de regrouper les ${itemData.type} ${itemData.name}: `;
for (const [key, value] of differences){
message += `<br>${key}: ${value} vs ${otherTplData[key]}`;
}
ui.notifications.info(message)
return false;
}
return true;
}
async proposerVente() {
console.log(this);
const dialog = await DialogItemVente.create(this, (vente) => this._onProposerVente(vente))
dialog.render(true);
}
async _onProposerVente(venteData) {
venteData["properties"] = this.getProprietes();
if (venteData.isOwned) {
if (venteData.quantiteNbLots * venteData.tailleLot > venteData.quantiteMax) {
ui.notifications.warn(`Vous avez ${venteData.quantiteMax} ${venteData.item.name}, ce n'est pas suffisant pour vendre ${venteData.quantiteNbLots} de ${venteData.tailleLot}`)
return;
}
}
venteData.jsondata = JSON.stringify(venteData.item);
console.log(venteData);
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', venteData);
ChatMessage.create(RdDUtility.chatDataSetup(html));
}
getProprietes() {
return this[`_${Misc.data(this).type}ChatData`]();
}
/* -------------------------------------------- */
async postItem() {
console.log(this);
let chatData = duplicate(Misc.data(this));
const properties = this.getProprietes();
chatData["properties"] = properties
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
//Check if the posted item should have availability/pay buttons
chatData.hasPrice = "cout" in chatData.data;
chatData.data.cout_deniers = 0;
let dialogResult = [-1, -1]; // dialogResult[0] = quantité, dialogResult[1] = prix
if (chatData.hasPrice) {
chatData.data.cout_deniers = Math.floor(chatData.data.cout * 100);
dialogResult = await new Promise((resolve, reject) => {
new Dialog({
content:
`<p>Modifier la quantité?</p>
<div class="form-group">
<label> Quantité</label>
<input name="quantity" type="text" value="1"/>
</div>
<p>Modifier la prix?</p>
<div class="form-group">
<label>Prix en Sols</label>
<input name="price" type="text" value="${chatData.data.cout}"/>
</div>
`,
title: "Quantité & Prix",
buttons: {
post: {
label: "Soumettre",
callback: (dlg) => {
resolve([Number(dlg.find('[name="quantity"]').val()), Number(dlg.find('[name="price"]').val())])
}
},
}
}).render(true)
})
}
let quantiteEnvoi = this.isOwned ? Math.min(dialogResult[0], chatData.data.quantite) : dialogResult[0];
const prixTotal = dialogResult[1];
if (quantiteEnvoi > 0) {
if (this.isOwned) {
if (chatData.data.quantite == 0) {
quantiteEnvoi = -1
}
else if (quantiteEnvoi > chatData.data.quantite) {
quantiteEnvoi = chatData.data.quantite;
ui.notifications.notify(`Impossible de poster plus que ce que vous avez. La quantité à été réduite à ${quantiteEnvoi}.`)
}
if (quantiteEnvoi > 0) {
this.diminuerQuantite(quantiteEnvoi);
}
}
}
if (chatData.hasPrice) {
if (quantiteEnvoi > 0)
chatData.postQuantity = Number(quantiteEnvoi);
if (prixTotal >= 0) {
chatData.postPrice = prixTotal;
chatData.data.cout_deniers = Math.floor(prixTotal * 100); // Mise à jour cout en deniers
}
chatData.finalPrice = Number(chatData.postPrice) * Number(chatData.postQuantity);
chatData.data.cout_deniers_total = chatData.data.cout_deniers * Number(chatData.postQuantity);
chatData.data.quantite = chatData.postQuantity;
console.log("POST : ", chatData.finalPrice, chatData.data.cout_deniers_total, chatData.postQuantity);
}
// 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/foundryvtt-reve-de-dragon/templates/post-item.html', chatData).then(html => {
let chatOptions = RdDUtility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
static propertyIfDefined(name, val, condition = (it) => true) {
return condition ? [`<b>${name}</b>: ${val}`] : [];
}
/* -------------------------------------------- */
_objetChatData() {
const tplData = Misc.templateData(this);
let properties = [].concat(
RdDItem.propertyIfDefined('Résistance', tplData.resistance, tplData.resistance),
RdDItem.propertyIfDefined('Qualité', tplData.qualite, tplData.qualite),
RdDItem.propertyIfDefined('Encombrement', tplData.encombrement),
);
return properties;
}
/* -------------------------------------------- */
_nourritureboissonChatData() {
const tplData = Misc.templateData(this);
let properties = [].concat(
RdDItem.propertyIfDefined('Sustentation', tplData.sust, tplData.sust > 0),
RdDItem.propertyIfDefined('Désaltère', tplData.desaltere, tplData.boisson),
RdDItem.propertyIfDefined('Force alcool', tplData.force, tplData.boisson && tplData.alcoolise),
RdDItem.propertyIfDefined('Exotisme', tplData.exotisme, tplData.exotisme < 0),
RdDItem.propertyIfDefined('Qualité', tplData.qualite, tplData.qualite),
RdDItem.propertyIfDefined('Encombrement', tplData.encombrement),
);
return properties;
}
/* -------------------------------------------- */
_armeChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Compétence</b>: ${tplData.competence}`,
`<b>Dommages</b>: ${tplData.dommages}`,
`<b>Force minimum</b>: ${tplData.force}`,
`<b>Resistance</b>: ${tplData.resistance}`,
`<b>Encombrement</b>: ${tplData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_conteneurChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Capacité</b>: ${tplData.capacite} Enc.`,
`<b>Encombrement</b>: ${tplData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_munitionChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Encombrement</b>: ${tplData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_armureChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Protection</b>: ${tplData.protection}`,
`<b>Détérioration</b>: ${tplData.deterioration}`,
`<b>Malus armure</b>: ${tplData.malus}`,
`<b>Encombrement</b>: ${tplData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_competenceChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Catégorie</b>: ${tplData.categorie}`,
`<b>Niveau</b>: ${tplData.niveau}`,
`<b>Caractéristique par défaut</b>: ${tplData.carac_defaut}`,
`<b>XP</b>: ${tplData.xp}`
]
return properties;
}
/* -------------------------------------------- */
_competencecreatureChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Catégorie</b>: ${tplData.categorie}`,
`<b>Niveau</b>: ${tplData.niveau}`,
`<b>Caractéristique</b>: ${tplData.carac_value}`,
`<b>XP</b>: ${tplData.xp}`
]
return properties;
}
/* -------------------------------------------- */
_sortChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Draconic</b>: ${tplData.draconic}`,
`<b>Difficulté</b>: ${tplData.difficulte}`,
`<b>Case TMR</b>: ${tplData.caseTMR}`,
`<b>Points de Rêve</b>: ${tplData.ptreve}`
]
return properties;
}
/* -------------------------------------------- */
_herbeChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Milieu</b>: ${tplData.milieu}`,
`<b>Rareté</b>: ${tplData.rarete}`,
`<b>Catégorie</b>: ${tplData.categorie}`,
]
return properties;
}
/* -------------------------------------------- */
_ingredientChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Milieu</b>: ${tplData.milieu}`,
`<b>Rareté</b>: ${tplData.rarete}`,
`<b>Catégorie</b>: ${tplData.categorie}`,
]
return properties;
}
/* -------------------------------------------- */
_tacheChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Caractéristique</b>: ${tplData.carac}`,
`<b>Compétence</b>: ${tplData.competence}`,
`<b>Périodicité</b>: ${tplData.periodicite}`,
`<b>Fatigue</b>: ${tplData.fatigue}`,
`<b>Difficulté</b>: ${tplData.difficulte}`,
`<b>Points de Tâche</b>: ${tplData.points_de_tache}`,
`<b>Points de Tâche atteints</b>: ${tplData.points_de_tache_courant}`
]
return properties;
}
/* -------------------------------------------- */
_livreChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Compétence</b>: ${tplData.competence}`,
`<b>Auteur</b>: ${tplData.auteur}`,
`<b>Difficulté</b>: ${tplData.difficulte}`,
`<b>Points de Tâche</b>: ${tplData.points_de_tache}`,
`<b>Encombrement</b>: ${tplData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_potionChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Rareté</b>: ${tplData.rarete}`,
`<b>Catégorie</b>: ${tplData.categorie}`,
`<b>Encombrement</b>: ${tplData.encombrement}`,
]
return properties;
}
/* -------------------------------------------- */
_queueChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Refoulement</b>: ${tplData.refoulement}`
]
return properties;
}
/* -------------------------------------------- */
_ombreChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Refoulement</b>: ${tplData.refoulement}`
]
return properties;
}
/* -------------------------------------------- */
_souffleChatData() {
const tplData = Misc.templateData(this);
let properties = [];
return properties;
}
/* -------------------------------------------- */
_teteChatData() {
const tplData = Misc.templateData(this);
let properties = [];
return properties;
}
/* -------------------------------------------- */
_tarotChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Concept</b>: ${tplData.concept}`,
`<b>Aspect</b>: ${tplData.aspect}`,
]
return properties;
}
/* -------------------------------------------- */
_nombreastralChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Valeur</b>: ${tplData.value}`,
`<b>Jour</b>: ${tplData.jourlabel}`,
]
return properties;
}
/* -------------------------------------------- */
_monnaieChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Valeur en Deniers</b>: ${tplData.valeur_deniers}`,
`<b>Encombrement</b>: ${tplData.encombrement}`
]
return properties;
}
/* -------------------------------------------- */
_meditationChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Thème</b>: ${tplData.theme}`,
`<b>Compétence</b>: ${tplData.competence}`,
`<b>Support</b>: ${tplData.support}`,
`<b>Heure</b>: ${tplData.heure}`,
`<b>Purification</b>: ${tplData.purification}`,
`<b>Vêture</b>: ${tplData.veture}`,
`<b>Comportement</b>: ${tplData.comportement}`,
`<b>Case TMR</b>: ${tplData.tmr}`
]
return properties;
}
/* -------------------------------------------- */
_casetmrChatData() {
const tplData = Misc.templateData(this);
let properties = [
`<b>Coordonnée</b>: ${tplData.coord}`,
`<b>Spécificité</b>: ${tplData.specific}`
]
return properties;
}
}

View File

@ -1,3 +1,4 @@
import { RdDDice } from "./rdd-dice.js";
/**
* This class is intended as a placeholder for utility methods unrelated
@ -18,6 +19,24 @@ export class Misc {
return isPositiveNumber ? "+" + number : number
}
static sum() {
return (a, b) => a + b;
}
static ascending(orderFunction = x => x) {
return (a, b) => Misc.sortingBy(orderFunction(a), orderFunction(b));
}
static descending(orderFunction = x => x) {
return (a, b) => Misc.sortingBy(orderFunction(b), orderFunction(a));
}
static sortingBy(a, b) {
if (a > b) return 1;
if (a < b) return -1;
return 0;
}
/**
* Converts the value to an integer, or to 0 if undefined/null/not representing integer
* @param {*} value value to convert to an integer using parseInt
@ -30,6 +49,12 @@ export class Misc {
return isNaN(parsed) ? 0 : parsed;
}
static keepDecimals(num, decimals) {
if (decimals <= 0 || decimals > 6) return num;
const decimal = Math.pow(10, parseInt(decimals));
return Math.round(num * decimal) / decimal;
}
static getFractionHtml(diviseur) {
if (!diviseur || diviseur <= 1) return undefined;
switch (diviseur || 1) {
@ -39,9 +64,9 @@ export class Misc {
}
}
static classify(items, classifier = it => it.type, transform = it => it) {
static classify(items, classifier = it => it.type) {
let itemsBy = {};
Misc.classifyInto(itemsBy, items, classifier, transform);
Misc.classifyInto(itemsBy, items, classifier);
return itemsBy;
}
@ -56,7 +81,7 @@ export class Misc {
return itemsBy;
}
static classifyInto(itemsBy, items, classifier = it => it.type, transform = it => it) {
static classifyInto(itemsBy, items, classifier = it => it.type) {
for (const item of items) {
const classification = classifier(item);
let list = itemsBy[classification];
@ -64,31 +89,16 @@ export class Misc {
list = [];
itemsBy[classification] = list;
}
list.push(transform(item));
list.push(item);
}
}
static rollOneOf(array) {
return array[new Roll("1d" + array.length).evaluate().total - 1];
}
static distinct(array) {
return [...new Set(array)];
}
static actorData(actor) {
return Misc.data(actor);
}
static itemData(item) {
return Misc.data(item);
}
static data(it) {
if (it instanceof Item) {
return it.data;
}
if (it instanceof Actor) {
if (it instanceof Actor || it instanceof Item || it instanceof Combatant) {
return it.data;
}
return it;
@ -97,4 +107,24 @@ export class Misc {
static templateData(it) {
return Misc.data(it)?.data ?? {}
}
static getEntityTypeLabel(entity) {
const documentName = entity?.documentName;
const type = entity?.data.type;
if (documentName === 'Actor' || documentName === 'Item') {
const label = CONFIG[documentName]?.typeLabels?.[type] ?? type;
return game.i18n.has(label) ? game.i18n.localize(label) : t;
}
return type;
}
static connectedGMOrUser(ownerId = undefined) {
if (ownerId && game.user.id == ownerId) {
return ownerId;
}
return (game.user.isGM ? game.user.id : game.users.entities.find(u => u.isGM && u.active)?.id) ?? game.user.id;
}
static isElectedUser() {
return game.user.id == Misc.connectedGMOrUser();
}
}

View File

@ -1,4 +1,5 @@
import { Misc } from "./misc.js"
import { RdDDice } from "./rdd-dice.js";
const poesieHautReve = [
{
@ -50,7 +51,7 @@ const poesieHautReve = [
},
{
reference: 'Denis Gerfaud',
extrait: `Ainsi se cuccèdent les Jours et les Ages.
extrait: `Ainsi se succèdent les Jours et les Ages.
<br>Les jours des Dragons sont les Ages des Hommes.`
},
{
@ -64,8 +65,8 @@ const poesieHautReve = [
]
export class Poetique {
static getExtrait(){
return Misc.rollOneOf(poesieHautReve);
static async getExtrait(){
return await RdDDice.rollOneOf(poesieHautReve);
}
}

View File

@ -1,68 +1,65 @@
/* -------------------------------------------- */
import { Misc } from "./misc.js";
const matchOperations = new RegExp(/@(\w*){([\w\-]+)}/ig);
const matchOperationTerms = new RegExp(/@(\w*){([\w\-]+)}/i);
/* -------------------------------------------- */
export class RdDAlchimie {
/* -------------------------------------------- */
static processManipulation( recette, actorId = undefined ) {
static processManipulation(recetteData, actorId = undefined) {
//console.log("CALLED", recette, recette.isOwned, actorId );
let manip = duplicate(recette.data.manipulation);
let reg1 = new RegExp(/@(\w*){([\w\-]+)}/ig);
let matchArray = manip.match( reg1 );
if ( matchArray ) {
for( let matchStr of matchArray) {
let reg2 = new RegExp(/@(\w*){([\w\-]+)}/i);
let result = matchStr.match(reg2);
let manip = recetteData.data.manipulation;
let matchArray = manip.match(matchOperations);
if (matchArray) {
for (let matchStr of matchArray) {
let result = matchStr.match(matchOperationTerms);
//console.log("RESULT ", result);
if ( result[1] && result[2]) {
let commande = Misc.upperFirst( result[1] );
let replacement = this[`_alchimie${commande}`](recette, result[2], actorId);
manip = manip.replace( result[0], replacement);
if (result[1] && result[2]) {
let commande = Misc.upperFirst(result[1]);
let replacement = this[`_alchimie${commande}`](recetteData, result[2], actorId);
manip = manip.replace(result[0], replacement);
}
}
}
recette.data.manipulation_update = manip;
recetteData.data.manipulation_update = manip;
}
/* -------------------------------------------- */
static _alchimieCouleur( recette, couleurs, actorId ) {
let replacement
if ( actorId ) {
replacement = `<span class="alchimie-tache"><a data-recette-id="${recette._id}" data-actor-id="${actorId}" data-alchimie-tache="couleur" data-alchimie-data="${couleurs}">couleur ${couleurs}</a></span>`;
static _alchimieCouleur(recette, couleurs, actorId) {
if (actorId) {
return `<span class="alchimie-tache"><a data-recette-id="${recette._id}" data-actor-id="${actorId}" data-alchimie-tache="couleur" data-alchimie-data="${couleurs}">couleur ${couleurs}</a></span>`;
} else {
replacement = `<span class="alchimie-tache">couleur ${couleurs} </span>`;
return `<span class="alchimie-tache">couleur ${couleurs} </span>`;
}
return replacement;
}
/* -------------------------------------------- */
static _alchimieConsistance( recette, consistances, actorId ) {
let replacement
if ( actorId ) {
replacement = `<span class="alchimie-tache"><a data-recette-id="${recette._id}" data-actor-id="${actorId}" data-alchimie-tache="consistance" data-alchimie-data="${consistances}">consistance ${consistances}</a></span>`;
static _alchimieConsistance(recette, consistances, actorId) {
if (actorId) {
return `<span class="alchimie-tache"><a data-recette-id="${recette._id}" data-actor-id="${actorId}" data-alchimie-tache="consistance" data-alchimie-data="${consistances}">consistance ${consistances}</a></span>`;
} else {
replacement = `<span class="alchimie-tache">consistance ${consistances} </span>`;
return `<span class="alchimie-tache">consistance ${consistances} </span>`;
}
return replacement;
}
/* -------------------------------------------- */
static getDifficulte( aspects ) {
let aspectsArray = aspects.split('-');
let diff = 0;
let nbDifferent = 0;
let aspectsHash = {}
for (let colconst of aspectsArray) {
if ( aspectsHash[colconst] ){ // Deja present, augmente difficulté de 1
diff -= 1;
} else {
nbDifferent++;
aspectsHash[colconst] = colconst; // Keep track
}
static getDifficulte(aspects) {
let elements = aspects.split('-');
let composantes = elements.length;
let distincts = Object.keys(Misc.classifyFirst(elements, it => it)).length;
if (distincts == 1) {
composantes--;
}
diff = diff - ((nbDifferent>1) ? nbDifferent : 0); // Ca doit marcher ....
return Math.min(0, diff); // Pour être sur
return Math.min(0, -composantes);
}
static getCaracTache(tache) {
switch (tache) {
case "consistance": return 'dexterite';
case "couleur": return 'vue';
}
return 'intellect';
}
}

View File

@ -3,12 +3,13 @@
* Extend the base Dialog entity by defining a custom window to perform roll.
* @extends {Dialog}
*/
export class RdDAstrologieEditeur extends Dialog {
export class RdDAstrologieEditeur extends Dialog {
/* -------------------------------------------- */
constructor(html, calendrier, calendrierData) {
let myButtons = {
resetButton: { label: "Re-tirer les nombres astraux", callback: html => this.resetNombreAstraux() },
saveButton: { label: "Fermer", callback: html => this.fillData() }
};
@ -21,7 +22,15 @@ export class RdDAstrologieEditeur extends Dialog {
this.updateData( calendrierData );
}
/* -------------------------------------------- */
/* -------------------------------------------- */
async resetNombreAstraux() {
game.system.rdd.calendrier.resetNombreAstral();
await game.system.rdd.calendrier.rebuildListeNombreAstral();
game.system.rdd.calendrier.showAstrologieEditor();
}
/* -------------------------------------------- */
fillData( ) {
}

View File

@ -8,50 +8,51 @@ import { Misc } from "./misc.js";
*/
export class RdDAstrologieJoueur extends Dialog {
/* -------------------------------------------- */
static async create(actor, dialogConfig) {
let data = { nombres: this.organizeNombres( actor),
dates: game.system.rdd.calendrier.getJoursSuivants( 10 ),
etat: actor.getEtatGeneral(),
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
astrologie: RdDItemCompetence.findCompetence( actor.data.items, 'Astrologie')
}
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', data);
let options = { classes: ["rdddialog"], width: 600, height: 500, 'z-index': 99999 };
if (dialogConfig.options) {
mergeObject(options, dialogConfig.options, { overwrite: true });
}
return new RdDAstrologieJoueur(html, actor, data);
}
/* -------------------------------------------- */
constructor(html, actor, data ) {
static async create(actor, dialogConfig) {
let data = {
nombres: this.organizeNombres(actor),
dates: game.system.rdd.calendrier.getJoursSuivants(10),
etat: actor.getEtatGeneral(),
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
astrologie: RdDItemCompetence.findCompetence(actor.data.items, 'Astrologie')
}
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', data);
let options = { classes: ["rdddialog"], width: 600, height: 500, 'z-index': 99999 };
if (dialogConfig.options) {
mergeObject(options, dialogConfig.options, { overwrite: true });
}
return new RdDAstrologieJoueur(html, actor, data);
}
/* -------------------------------------------- */
constructor(html, actor, data) {
let myButtons = {
saveButton: { label: "Fermer", callback: html => this.quitDialog() }
};
saveButton: { label: "Fermer", callback: html => this.quitDialog() }
};
// Get all n
// Common conf
let dialogConf = { content: html, title: "Nombres Astraux", buttons: myButtons, default: "saveButton" };
let dialogOptions = { classes: ["rdddialog"], width: 600, height: 300, 'z-index': 99999 } ;
let dialogOptions = { classes: ["rdddialog"], width: 600, height: 300, 'z-index': 99999 };
super(dialogConf, dialogOptions);
this.actor = actor;
this.dataNombreAstral = duplicate(data);
}
/* -------------------------------------------- */
static organizeNombres(actor) {
let itemNombres = actor.data.items.filter( (item) => item.type == 'nombreastral');
let itemNombres = actor.listItemsData('nombreastral');
let itemFiltered = {};
for ( let item of itemNombres) {
if ( itemFiltered[item.data.jourindex] ) {
for (let item of itemNombres) {
if (itemFiltered[item.data.jourindex]) {
itemFiltered[item.data.jourindex].listValues.push(item.data.value);
} else {
itemFiltered[item.data.jourindex] = {
listValues: [ item.data.value ],
listValues: [item.data.value],
jourlabel: item.data.jourlabel
}
}
@ -60,21 +61,22 @@ export class RdDAstrologieJoueur extends Dialog {
}
/* -------------------------------------------- */
requestJetAstrologie( ) {
let data = { id: this.actor.data._id,
carac_vue: Misc.data(this.actor).data.carac['vue'].value,
etat: this.dataNombreAstral.etat,
astrologie: this.dataNombreAstral.astrologie,
conditions: $("#diffConditions").val(),
date: $("#joursAstrologie").val()
}
if ( game.user.isGM) {
game.system.rdd.calendrier.requestNombreAstral( data );
requestJetAstrologie() {
let data = {
id: this.actor.data._id,
carac_vue: Misc.data(this.actor).data.carac['vue'].value,
etat: this.dataNombreAstral.etat,
astrologie: this.dataNombreAstral.astrologie,
conditions: $("#diffConditions").val(),
date: $("#joursAstrologie").val()
}
if (game.user.isGM) {
game.system.rdd.calendrier.requestNombreAstral(data);
} else {
game.socket.emit("system.foundryvtt-reve-de-dragon", {
msg: "msg_request_nombre_astral",
data: data
} );
data: data
});
}
this.close();
}
@ -87,7 +89,7 @@ export class RdDAstrologieJoueur extends Dialog {
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
$(function () {
$("#diffConditions").val(0);
});

View File

@ -13,7 +13,7 @@ export class RdDAudio {
let audioData = context2file[context];
if ( audioData ) {
let audioPath = "systems/foundryvtt-reve-de-dragon/sounds/" + audioData.file;
console.log(`wfrp4e | Playing Sound: ${audioPath}`)
console.log(`foundryvtt-reve-de-dragon | Playing Sound: ${audioPath}`)
AudioHelper.play({ src: audioPath }, audioData.isGlobal);
}
}

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