Compare commits
427 Commits
Author | SHA1 | Date | |
---|---|---|---|
b548d95203 | |||
b02ac1e7e1 | |||
d0764eb1c5 | |||
4fd822eeee | |||
ac9a35cd63 | |||
100e0b62ab | |||
92f1cbd7c3 | |||
a17715430a | |||
b0a14c5e8c | |||
3f8ab65ba5 | |||
284689b7a8 | |||
3cfc15ebd3 | |||
61165107f0 | |||
3fd49f4909 | |||
93f8cfa452 | |||
b19bc68d22 | |||
c36b32e5e8 | |||
fa060a06a1 | |||
7253b35084 | |||
72dedcca58 | |||
094632734f | |||
43e069cc9b | |||
645c902e06 | |||
8608d153f6 | |||
7c2d18428d | |||
07694158e7 | |||
aaeaedbf40 | |||
b6678823d0 | |||
a9056031a6 | |||
144abe1ddf | |||
a8be0c505d | |||
9b28342c46 | |||
395092558f | |||
986b007633 | |||
9b60583537 | |||
20ae4a9a97 | |||
d3e612104d | |||
c8a5526a5f | |||
8d94cbb056 | |||
af4c9c138c | |||
0a92be0942 | |||
dc09e58b08 | |||
71ce90aa4e | |||
e92f4130f2 | |||
575b8a0a30 | |||
2336289f5a | |||
5373f15e92 | |||
6c893ee526 | |||
99f67565cc | |||
50a72ff4ea | |||
19d8202439 | |||
c7a417fc69 | |||
9a7b01a985 | |||
7ba3b44c87 | |||
e0666b074e | |||
3a0186a15f | |||
0524540f5a | |||
b5c8bb85fd | |||
080a8b51b3 | |||
3a8a8fa5fb | |||
cf01d26bfe | |||
403d94a57f | |||
4371937110 | |||
ebb6b34cce | |||
a059d69acd | |||
d3be1d52b4 | |||
a5581e7443 | |||
2cf9d0f37c | |||
6508a529e5 | |||
2cd607e199 | |||
60a7b551af | |||
b0da6ca8ea | |||
93b8f15df0 | |||
15c07674bc | |||
67a674e7b4 | |||
10ade1789b | |||
6d1a1cef67 | |||
4b26fd575a | |||
560d674a15 | |||
d45f95f1a5 | |||
1a2173e8c1 | |||
39eda96f61 | |||
53bc21eade | |||
ed89ef264f | |||
19c725a6f7 | |||
f04ef45fe1 | |||
4821046c2f | |||
5e68a67583 | |||
e13750ea68 | |||
cc2277c9b7 | |||
43274ca6b7 | |||
d2b612c11c | |||
f807d3cd52 | |||
dd2ce39545 | |||
8e7835c44d | |||
8807ba01dc | |||
09fe695777 | |||
1f77c6227b | |||
b500997277 | |||
c6f51e6e9a | |||
a0bbeea99b | |||
c18fa00a3b | |||
8cbad3b383 | |||
e2139f41b0 | |||
f22622710a | |||
be1ad028a7 | |||
e0aa4ed896 | |||
c6b571b788 | |||
879ae14b11 | |||
41bb5ca919 | |||
63d5281a0c | |||
95bcc2e77c | |||
46642d31a9 | |||
0791fc75fa | |||
458e7ddb9f | |||
2ebd70827b | |||
80629d4a07 | |||
86558c52fa | |||
3793563a2c | |||
d874720973 | |||
6a85073dbb | |||
bd7f3a9b3d | |||
effb50e778 | |||
8ffecc45ca | |||
5aa0f62b83 | |||
22f12b8f06 | |||
8eaa12e2c6 | |||
06cf01b269 | |||
1d10c0bd3f | |||
c77d5e3c93 | |||
d610a92003 | |||
02a17ab712 | |||
0e3e6eb6eb | |||
b08b330e65 | |||
cf75fb82d0 | |||
1624f9292c | |||
164adb41f6 | |||
ebe877400a | |||
e4f668a357 | |||
286eaafe4e | |||
8e53759170 | |||
22bdf60e93 | |||
ef7585fcb9 | |||
96fc42e537 | |||
8e9ae00898 | |||
a22c435ca5 | |||
d201a91d41 | |||
8947681e95 | |||
ffbe251fac | |||
801b69edcd | |||
798743724a | |||
0136cc1bd4 | |||
a77c285ee4 | |||
24a7aad9e5 | |||
270c082032 | |||
fd964690e0 | |||
bb8b56f534 | |||
a448f68190 | |||
c41a7c9250 | |||
958ab1e6df | |||
c3d8f53c1b | |||
04b67f2188 | |||
8c6857693f | |||
862ad1faec | |||
053b949414 | |||
8756dde4e6 | |||
e35fafddf4 | |||
84e4581b34 | |||
04d631e2b4 | |||
61d5e22768 | |||
c68d3e47f3 | |||
69869fb810 | |||
36b3cbcae7 | |||
3621a4e09d | |||
7022c2134e | |||
2316865914 | |||
15874de96b | |||
259f3a0a72 | |||
5b243fe95b | |||
5efb21dac5 | |||
d8d27430ed | |||
e0962506ed | |||
853e7f4334 | |||
d9618c6bbf | |||
88d4c917fc | |||
a48f76e8eb | |||
8fb69b0bc5 | |||
67daa12e66 | |||
d91ab6e478 | |||
6247172372 | |||
a6ee1b613d | |||
4715a75d0b | |||
9ae72e09f5 | |||
f87efee2fe | |||
d1ac4b3d59 | |||
5a452aa17c | |||
ef08dbeb97 | |||
a0f1c36dc6 | |||
2c7b37db04 | |||
73099454b7 | |||
f20a8055c6 | |||
7b78732b13 | |||
8a38a10d16 | |||
82729a9855 | |||
f20487c294 | |||
4f05a5e9ca | |||
2338447b56 | |||
b7b34218c3 | |||
2d777f7ea2 | |||
06cbabb229 | |||
5f314497d4 | |||
51a3c4d04a | |||
11131e3b52 | |||
3625031117 | |||
950ffa3453 | |||
bf9df5d68e | |||
84ba8b0fa1 | |||
27d83cf516 | |||
c4cb3bf60d | |||
65a4e1ec69 | |||
b78d9dd31a | |||
28abc35a21 | |||
56c82d935a | |||
6eb79c3ec7 | |||
e41a936def | |||
6b96f73b7a | |||
474a6a7ed8 | |||
b531e97fd1 | |||
67631a46df | |||
c6c098b635 | |||
4fa3f55a06 | |||
60e11aa234 | |||
2bf718c2f7 | |||
f80a8a8bb2 | |||
b064ce22f0 | |||
c46e92e8f5 | |||
cc103b88ac | |||
74fc9a7af3 | |||
d1802e7496 | |||
8f9346b31c | |||
42407eaa15 | |||
6c783a7139 | |||
8958377fdb | |||
a74ab041f9 | |||
a10311de04 | |||
145ef7a0ba | |||
e98d99638e | |||
93b4d2ce7e | |||
09256ad9a3 | |||
66e4f6ad02 | |||
ef885710d9 | |||
6d7d55e12b | |||
3c6d286713 | |||
a326e43ff6 | |||
06a79cba76 | |||
80b10cbbaa | |||
94136b8879 | |||
caeff1e82a | |||
8e565e3ca6 | |||
c7ba56b90b | |||
65815348f4 | |||
d774e72565 | |||
0c57a243f7 | |||
4e4e75279d | |||
4ecc8826f6 | |||
305e5e9d04 | |||
d486fa7aff | |||
cd95e68854 | |||
c93459b81e | |||
0152607a69 | |||
f2a2b2acda | |||
33ed7bfe2c | |||
d42de6c316 | |||
3be9be92ec | |||
25c8c38722 | |||
79485e828a | |||
fd42634b19 | |||
208dfef83f | |||
3fe8e834c8 | |||
fb490f8ac8 | |||
3646fd2033 | |||
b663560b53 | |||
70b3feede8 | |||
c50c417d5b | |||
8dea766540 | |||
cc2254112f | |||
4b7817c9d8 | |||
710a768bb6 | |||
31c5be26a3 | |||
496a411fcc | |||
226319b067 | |||
a20037698b | |||
d376ba1c26 | |||
8393700ac8 | |||
550f45d14c | |||
3c793296a6 | |||
0e9bc372bf | |||
f0af45d106 | |||
f0b042626f | |||
77f0a93eb6 | |||
a9d49d793c | |||
b7c913ac50 | |||
9e36804244 | |||
a7e9fc6ae4 | |||
66cd0a90ed | |||
afe8e5067a | |||
f05a166d5b | |||
6fc8906d67 | |||
a7b228afe3 | |||
ecba3b32e7 | |||
f349c57a32 | |||
693e3eb6d0 | |||
fde5096c59 | |||
e0ce7d1e33 | |||
94bc70a2c9 | |||
c2f5229ca6 | |||
413893bc67 | |||
a282575422 | |||
b37de0a420 | |||
44e212cd12 | |||
93865f2c4b | |||
91f532409b | |||
b4eb66bef5 | |||
3152d87078 | |||
1cab660a2f | |||
6e29f497eb | |||
84ea567045 | |||
d21cd86ccd | |||
870ca61d7d | |||
99c58233ef | |||
b1f0d54837 | |||
a39e2a3256 | |||
893f2aa835 | |||
b27ff16857 | |||
a13b9f9c56 | |||
df45c4bbbb | |||
3d8453dc2d | |||
6b31e81c72 | |||
7dc1724ab7 | |||
07b68020b2 | |||
daa2421ba4 | |||
1b3c5f524d | |||
1cea9753a9 | |||
cc24471926 | |||
31d2c01ebb | |||
38b58cd4b0 | |||
1f4523930c | |||
0ae77f6889 | |||
f25ae66de1 | |||
8bbf40a84b | |||
dcdfa357c1 | |||
3e5e745067 | |||
8a7d8a6930 | |||
62261d1748 | |||
35004547dd | |||
4efa321693 | |||
8770b29a5e | |||
e8626f3566 | |||
674582d6e8 | |||
4792e36922 | |||
dc48f08203 | |||
9cc73e971d | |||
f7c1ed0749 | |||
18f1d314b7 | |||
a5561b7b88 | |||
e4f432c781 | |||
f8171fecc3 | |||
795e80d575 | |||
4538472fc0 | |||
6955d4597b | |||
8089e0c83e | |||
4730cc9e8d | |||
36695e2d10 | |||
8f4675d717 | |||
31bff0861f | |||
56cf4243a8 | |||
97d53d3f31 | |||
65348b0710 | |||
70add73ad7 | |||
f82d110ce3 | |||
2586fe7e27 | |||
8f58e12c05 | |||
e014541d2a | |||
f26daf4981 | |||
3b2ea7d82f | |||
0bae3e82a8 | |||
852cf51dc1 | |||
74ee2e93cc | |||
f7279bef7c | |||
47484e6a85 | |||
6429eda2d6 | |||
8a95ad6471 | |||
3d866e343b | |||
3691775da0 | |||
62e0153d0d | |||
e1f0d199c1 | |||
81d68e5ba3 | |||
036456e5df | |||
e0eb04d829 | |||
5383bd228d | |||
ee34fad8b1 | |||
5e654bdfa4 | |||
2efb942bea | |||
576088c2bb | |||
3f14d2b833 | |||
86fb6111db | |||
ba41886522 | |||
0cd4c7c158 | |||
7f75361a08 | |||
68cd086a2f | |||
049b46e3cc | |||
3735377a20 | |||
31204cbf51 | |||
592f54af61 | |||
d743578f3f | |||
36df301144 | |||
f043c3b504 | |||
3df76c589f | |||
67bb14795c | |||
5de4dd016f | |||
5b53d4c2c9 | |||
be04157fb0 | |||
ceb73b9944 | |||
1616931476 | |||
fd6c3ac7c6 | |||
43cf091345 | |||
5fb8d22a7a |
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
.vscode/settings.json
|
||||
.idea
|
||||
todo.txt
|
||||
todo.md
|
||||
/.vscode
|
||||
|
43
RdD.geany
@ -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
@ -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 — Aujourd’hui à 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
|
BIN
fonts/heuresdraconiques2.ttf
Normal file
BIN
fonts/heuresdraconiques2.woff
Normal file
BIN
fonts/heuresdraconiques2.woff2
Normal file
BIN
icons/creatures/aligate_t.webp
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
icons/creatures/araflate_t.webp
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
icons/creatures/bandersnatch_t.webp
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
icons/creatures/bramart_t.webp
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
icons/creatures/brolute_t.webp
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
icons/creatures/chamule_t.webp
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
icons/creatures/cheval_t.webp
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
icons/creatures/chiard_t.webp
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
icons/creatures/chien_t.webp
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
icons/creatures/chrasme_t.webp
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
icons/creatures/cornicochon_t.webp
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
icons/creatures/dong_t.webp
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
icons/creatures/drakkule_t.webp
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
icons/creatures/felorn_t.webp
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
icons/creatures/harpie_t.webp
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
icons/heures/de-heures.webp
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
icons/heures/hd01.webp
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
icons/heures/hd02.webp
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
icons/heures/hd03.webp
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
icons/heures/hd04.webp
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
icons/heures/hd05.webp
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
icons/heures/hd06.webp
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
icons/heures/hd07.webp
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
icons/heures/hd08.webp
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
icons/heures/hd09.webp
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
icons/heures/hd10.webp
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
icons/heures/hd11.webp
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
icons/heures/hd12.webp
Normal file
After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 387 KiB |
Before Width: | Height: | Size: 382 KiB |
Before Width: | Height: | Size: 372 KiB |
Before Width: | Height: | Size: 368 KiB |
@ -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
After Width: | Height: | Size: 44 KiB |
@ -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
After Width: | Height: | Size: 25 KiB |
@ -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
After Width: | Height: | Size: 45 KiB |
BIN
icons/tmr/signe_draconique.webp
Normal file
After Width: | Height: | Size: 35 KiB |
@ -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 |
BIN
icons/tmr/treasure-chest.webp
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 23 KiB |
BIN
icons/tmr/wave.webp
Normal file
After Width: | Height: | Size: 13 KiB |
44
lang/fr.json
Normal 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"
|
||||
}
|
||||
}
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
2576
module/actor.js
@ -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
@ -0,0 +1 @@
|
||||
export const SYSTEM_RDD = "foundryvtt-reve-de-dragon";
|
@ -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)
|
||||
}
|
||||
}
|
119
module/dialog-create-signedraconique.js
Normal 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);
|
||||
}
|
||||
|
||||
}
|
71
module/dialog-fabriquer-potion.js
Normal 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();
|
||||
}
|
||||
}
|
95
module/dialog-item-achat.js
Normal 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);
|
||||
}
|
||||
|
||||
}
|
90
module/dialog-item-consommer.js
Normal 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);
|
||||
}
|
||||
}
|
94
module/dialog-item-vente.js
Normal 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)
|
||||
}
|
||||
}
|
52
module/dialog-split-item.js
Normal 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);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -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)) {
|
||||
|
@ -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);
|
||||
// });
|
||||
|
||||
|
@ -112,7 +112,7 @@ export class RdDItemArme extends Item {
|
||||
if (defCategory == 'boucliers') {
|
||||
return false;
|
||||
}
|
||||
// Parer avec une hache ou une arme d’hast exige toujours une signi$cative
|
||||
// Parer avec une hache ou une arme d’hast exige toujours une significative
|
||||
if (defCategory.match(/(hast|haches)/)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
95
module/item-signedraconique-sheet.js
Normal 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}`;
|
||||
}
|
||||
}
|
103
module/item-signedraconique.js
Normal 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);
|
||||
}
|
||||
|
||||
}
|
@ -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
@ -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;
|
||||
}
|
||||
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
@ -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';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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( ) {
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
});
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|