pf2e-sage-stats 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -34
- package/dist/app.js +67 -43
- package/dist/index.js +186 -19
- package/package.json +6 -2
- package/src/app.ts +103 -41
- package/src/index.ts +197 -14
package/README.md
CHANGED
|
@@ -4,104 +4,124 @@ sage! macro set name=flat dice="[{o:m} d20 >= {0} flat {...}]" cat=Misc tier=Ser
|
|
|
4
4
|
```
|
|
5
5
|
### Strikes
|
|
6
6
|
```
|
|
7
|
-
sage! macro set name="melee" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::melee.{s:default}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::melee.{s:default}.desc:} {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`({c:+0} AC) `} {ac} {utils::{t:known}:ac} {{t:none}::{r:ac}:} {c} {{p}::melee.{s:default}.damage:} {...}]" cat=Strikes tier=Server -y
|
|
7
|
+
sage! macro set name="melee" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::melee.{s:default}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::melee.{s:default}.desc:} {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`({c:+0} AC) `} {ac} {utils::{t:known}:ac} {{t:none}::{r:ac}:} {c} {{p}::melee.{s:default}.damage:} {...}]" cat=Strikes tier=Server -y
|
|
8
8
|
```
|
|
9
9
|
```
|
|
10
|
-
sage! macro set name="ranged" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::ranged.{s:default}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::ranged.{s:default}.desc:} {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`({c:+0} AC) `} {ac} {utils::{t:known}:ac} {{t:none}::{r:ac}:} {c} {{p}::ranged.{s:default}.damage:} {...}]" cat=Strikes tier=Server -y
|
|
10
|
+
sage! macro set name="ranged" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::ranged.{s:default}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::ranged.{s:default}.desc:} {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`({c:+0} AC) `} {ac} {utils::{t:known}:ac} {{t:none}::{r:ac}:} {c} {{p}::ranged.{s:default}.damage:} {...}]" cat=Strikes tier=Server -y
|
|
11
11
|
```
|
|
12
12
|
```
|
|
13
|
-
sage! macro set name="spell" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::spells:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) Spell Attack {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`({c:+0} AC) `} {ac} {utils::{t:known}:ac} {{t:none}::{r:ac}:} {c} {...}]" cat=Strikes tier=Server -y
|
|
13
|
+
sage! macro set name="spell" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::spells:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) Spell Attack {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`({c:+0} AC) `} {ac} {utils::{t:known}:ac} {{t:none}::{r:ac}:} {c} {...}]" cat=Strikes tier=Server -y
|
|
14
14
|
```
|
|
15
15
|
### Saves
|
|
16
16
|
```
|
|
17
|
-
sage! macro set name="fort" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::
|
|
17
|
+
sage! macro set name="fort" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::fortitude:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::fortitude.info:} Fortitude Save {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Saves tier=Server -y
|
|
18
18
|
```
|
|
19
19
|
```
|
|
20
|
-
sage! macro set name="fortitude" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::
|
|
20
|
+
sage! macro set name="fortitude" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::fortitude:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::fortitude.info:} Fortitude Save {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Saves tier=Server -y
|
|
21
21
|
```
|
|
22
22
|
```
|
|
23
|
-
sage! macro set name="ref" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::reflex:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::reflex.info:} Reflex Save {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Saves tier=Server -y
|
|
23
|
+
sage! macro set name="ref" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::reflex:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::reflex.info:} Reflex Save {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Saves tier=Server -y
|
|
24
24
|
```
|
|
25
25
|
```
|
|
26
|
-
sage! macro set name="reflex" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::reflex:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::reflex.info:} Reflex Save {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Saves tier=Server -y
|
|
26
|
+
sage! macro set name="reflex" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::reflex:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::reflex.info:} Reflex Save {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Saves tier=Server -y
|
|
27
27
|
```
|
|
28
28
|
```
|
|
29
|
-
sage! macro set name="will" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::will:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::will.info:} Will Save {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Saves tier=Server -y
|
|
29
|
+
sage! macro set name="will" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::will:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::will.info:} Will Save {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Saves tier=Server -y
|
|
30
30
|
```
|
|
31
31
|
### Initiative
|
|
32
32
|
```
|
|
33
|
-
sage! macro set name="init" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::{s:Perception}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::initiative.info:} Initiative `({s:Perception}) `{...}]" cat=Initiative tier=Server -y
|
|
33
|
+
sage! macro set name="init" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::{s:Perception}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::initiative.info:} Initiative `({s:Perception}) `{...}]" cat=Initiative tier=Server -y
|
|
34
34
|
```
|
|
35
35
|
```
|
|
36
|
-
sage! macro set name="initiative" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::{s:Perception}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::initiative.info:} Initiative `({s:Perception}) `{...}]" cat=Initiative tier=Server -y
|
|
36
|
+
sage! macro set name="initiative" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::{s:Perception}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::initiative.info:} Initiative `({s:Perception}) `{...}]" cat=Initiative tier=Server -y
|
|
37
37
|
```
|
|
38
|
-
### Skills
|
|
38
|
+
### Skills 1
|
|
39
39
|
```
|
|
40
|
-
sage! macro set name="acrobatics" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::acrobatics:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::acrobatics.info:} Acrobatics Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
40
|
+
sage! macro set name="acrobatics" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::acrobatics:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::acrobatics.info:} Acrobatics Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
41
41
|
```
|
|
42
42
|
```
|
|
43
|
-
sage! macro set name="arcana" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::arcana:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::arcana.info:} Arcana Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
43
|
+
sage! macro set name="arcana" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::arcana:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::arcana.info:} Arcana Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
44
44
|
```
|
|
45
45
|
```
|
|
46
|
-
sage! macro set name="athletics" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::athletics:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::athletics.info:} Athletics Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
46
|
+
sage! macro set name="athletics" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::athletics:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::athletics.info:} Athletics Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
47
47
|
```
|
|
48
48
|
```
|
|
49
|
-
sage! macro set name="crafting" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::crafting:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::crafting.info:} Crafting Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
49
|
+
sage! macro set name="crafting" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::crafting:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::crafting.info:} Crafting Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
50
50
|
```
|
|
51
51
|
```
|
|
52
|
-
sage! macro set name="craft" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::crafting:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::crafting.info:} Crafting Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
52
|
+
sage! macro set name="craft" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::crafting:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::crafting.info:} Crafting Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
53
53
|
```
|
|
54
|
+
### Skills 2
|
|
54
55
|
```
|
|
55
|
-
sage! macro set name="deception" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::deception:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::deception.info:} Deception Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
56
|
+
sage! macro set name="deception" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::deception:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::deception.info:} Deception Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
56
57
|
```
|
|
57
58
|
```
|
|
58
|
-
sage! macro set name="diplomacy" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::diplomacy:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::diplomacy.info:} Diplomacy Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
59
|
+
sage! macro set name="diplomacy" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::diplomacy:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::diplomacy.info:} Diplomacy Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
59
60
|
```
|
|
60
61
|
```
|
|
61
|
-
sage! macro set name="intimidation" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::intimidation:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::intimidation.info:} Intimidation Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
62
|
+
sage! macro set name="intimidation" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::intimidation:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::intimidation.info:} Intimidation Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
62
63
|
```
|
|
63
64
|
```
|
|
64
|
-
sage! macro set name="medicine" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::medicine:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::medicine.info:} Medicine Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
65
|
+
sage! macro set name="medicine" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::medicine:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::medicine.info:} Medicine Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
65
66
|
```
|
|
66
67
|
```
|
|
67
|
-
sage! macro set name="nature" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::nature:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::nature.info:} Nature Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
68
|
+
sage! macro set name="nature" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::nature:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::nature.info:} Nature Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
68
69
|
```
|
|
70
|
+
### Skills 3
|
|
69
71
|
```
|
|
70
|
-
sage! macro set name="occultism" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::occultism:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::occultism.info:} Occultism Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
72
|
+
sage! macro set name="occultism" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::occultism:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::occultism.info:} Occultism Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
71
73
|
```
|
|
72
74
|
```
|
|
73
|
-
sage! macro set name="performance" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::performance:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::performance.info:} Performance Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
75
|
+
sage! macro set name="performance" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::performance:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::performance.info:} Performance Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
74
76
|
```
|
|
75
77
|
```
|
|
76
|
-
sage! macro set name="perfomance" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::performance:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::performance.info:} Performance Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
78
|
+
sage! macro set name="perfomance" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::performance:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::performance.info:} Performance Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
77
79
|
```
|
|
78
80
|
```
|
|
79
|
-
sage! macro set name="religion" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::religion:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::religion.info:} Religion Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
81
|
+
sage! macro set name="religion" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::religion:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::religion.info:} Religion Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
80
82
|
```
|
|
81
83
|
```
|
|
82
|
-
sage! macro set name="society" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::society:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::society.info:} Society Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
84
|
+
sage! macro set name="society" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::society:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::society.info:} Society Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
83
85
|
```
|
|
86
|
+
### Skills 4
|
|
84
87
|
```
|
|
85
|
-
sage! macro set name="stealth" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::stealth:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::stealth.info:} Stealth Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
88
|
+
sage! macro set name="stealth" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::stealth:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::stealth.info:} Stealth Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
86
89
|
```
|
|
87
90
|
```
|
|
88
|
-
sage! macro set name="survival" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::survival:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::survival.info:} Survival Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
91
|
+
sage! macro set name="survival" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::survival:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::survival.info:} Survival Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
89
92
|
```
|
|
90
93
|
```
|
|
91
|
-
sage! macro set name="thievery" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::thievery:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::thievery.info:} Thievery Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
94
|
+
sage! macro set name="thievery" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::thievery:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::thievery.info:} Thievery Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
92
95
|
```
|
|
93
96
|
```
|
|
94
|
-
sage! macro set name="perception" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::perception:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::perception.info:} Perception Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
97
|
+
sage! macro set name="perception" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::perception:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::perception.info:} Perception Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
95
98
|
```
|
|
96
99
|
```
|
|
97
|
-
sage! macro set name="lore" dice="[{{p}::out:m} {flat::{f:none}:} {d:1}d20+{{p}::lore.{0}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::lore.{0}.info:} {{p}::lore.{0}.name:} Lore Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
100
|
+
sage! macro set name="lore" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::lore.{0}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::lore.{0}.info:} {{p}::lore.{0}.name:} Lore Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
98
101
|
```
|
|
102
|
+
### Skills 5
|
|
99
103
|
```
|
|
100
|
-
sage! macro set name="
|
|
104
|
+
sage! macro set name="piloting" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::piloting:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::piloting.info:} Piloting Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
101
105
|
```
|
|
102
106
|
```
|
|
103
|
-
sage! macro set name="
|
|
107
|
+
sage! macro set name="computers" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::computers:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::computers.info:} Computers Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
104
108
|
```
|
|
105
109
|
```
|
|
106
|
-
sage! macro set name="
|
|
110
|
+
sage! macro set name="assurance" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} (10)d20+{0:0}-10 {v} {{p}::name:} Assurance Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
111
|
+
```
|
|
112
|
+
```
|
|
113
|
+
sage! macro set name="skill" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} d20+{0:0} {v} {{p}::name:} Skill Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
114
|
+
```
|
|
115
|
+
```
|
|
116
|
+
sage! macro set name="secret" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} d20+{{p}::{0}:{a:0}} {v} {{p}::name:} Secret {0} Check {utils::{t:known}:vs} {{t:none}::name:} {utils::{t:known}:`{r:Spell} DC ({c:+0} DC) `} {dc} {utils::{t:known}:dc} {{t:none}::dc.{r:spells}:} {c} {...}]" cat=Skills tier=Server -y
|
|
117
|
+
```
|
|
118
|
+
### Legacy
|
|
119
|
+
```
|
|
120
|
+
sage! macro set name="mstrike" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::melee.{s:default}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::melee.{s:default}.desc:} vs {{0}::name:} `({c:+0} AC) ` ac {{0}::{r:ac}:} {c} {{p}::melee.{s:default}.damage:} {...}]" cat=Strikes tier=Server -y
|
|
121
|
+
```
|
|
122
|
+
```
|
|
123
|
+
sage! macro set name="rstrike" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::ranged.{s:default}:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) {{p}::ranged.{s:default}.desc:} vs {{0}::name:} `({c:+0} AC) ` ac {{0}::{r:ac}:} {c} {{p}::ranged.{s:default}.damage:} {...}]" cat=Strikes tier=Server -y
|
|
124
|
+
```
|
|
125
|
+
```
|
|
126
|
+
sage! macro set name="sstrike" dice="[{{p}::{o:out}:{o:m}} {x} {flat::{f:none}:{f}} {dice::{d:none}:{d:1}}d20+{{p}::spells:{a:0}} {m} {v} {{p}::name:} (mod `{m:+0}`) Spell Attack vs {{0}::name:} `({c:+0} AC) ` ac {{0}::{r:ac}:} {c} {...}]" cat=Strikes tier=Server -y
|
|
107
127
|
```
|
package/dist/app.js
CHANGED
|
@@ -12,13 +12,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.sortFolder = exports.formatTracker = exports.newtracker = exports.formatHP = exports.formatTable = exports.formatCommand = exports.formatTSV = exports.flatten = exports.parseStatblock = exports.parseTracker = exports.parseJSON = exports.formatJSON = exports.fromatMap = exports.
|
|
15
|
+
exports.screenPlay = exports.sortFolder = exports.formatTracker = exports.newtracker = exports.formatHP = exports.formatTable = exports.formatCommand = exports.formatTSV = exports.flatten = exports.parseStatblock = exports.parseTracker = exports.parseJSON = exports.formatJSON = exports.fromatMap = exports.diceMap = exports.flatMap = exports.charSchema = exports.stub = void 0;
|
|
16
16
|
const zod_1 = __importDefault(require("zod"));
|
|
17
17
|
const tsv_1 = require("tsv");
|
|
18
18
|
const lodash_1 = require("lodash");
|
|
19
19
|
const dedent_js_1 = __importDefault(require("dedent-js"));
|
|
20
20
|
const abbreviate_1 = __importDefault(require("abbreviate"));
|
|
21
21
|
const pluralize_1 = __importDefault(require("pluralize"));
|
|
22
|
+
const jsdom_1 = require("jsdom");
|
|
22
23
|
const promises_1 = require("fs/promises");
|
|
23
24
|
const schema = zod_1.default.object({
|
|
24
25
|
name: zod_1.default.string(),
|
|
@@ -59,6 +60,8 @@ const schema = zod_1.default.object({
|
|
|
59
60
|
stealth: zod_1.default.coerce.number().optional(),
|
|
60
61
|
survival: zod_1.default.coerce.number().optional(),
|
|
61
62
|
thievery: zod_1.default.coerce.number().optional(),
|
|
63
|
+
piloting: zod_1.default.coerce.number().optional(),
|
|
64
|
+
computers: zod_1.default.coerce.number().optional(),
|
|
62
65
|
}).default({}),
|
|
63
66
|
lores: zod_1.default.record(zod_1.default.string(), zod_1.default.object({
|
|
64
67
|
mod: zod_1.default.coerce.number().default(0),
|
|
@@ -117,6 +120,8 @@ const schema = zod_1.default.object({
|
|
|
117
120
|
stealth: zod_1.default.array(zod_1.default.string()).optional(),
|
|
118
121
|
survival: zod_1.default.array(zod_1.default.string()).optional(),
|
|
119
122
|
thievery: zod_1.default.array(zod_1.default.string()).optional(),
|
|
123
|
+
piloting: zod_1.default.array(zod_1.default.string()).optional(),
|
|
124
|
+
computers: zod_1.default.array(zod_1.default.string()).optional(),
|
|
120
125
|
}).default({}),
|
|
121
126
|
});
|
|
122
127
|
exports.stub = {
|
|
@@ -158,6 +163,8 @@ exports.stub = {
|
|
|
158
163
|
stealth: 0,
|
|
159
164
|
survival: 0,
|
|
160
165
|
thievery: 0,
|
|
166
|
+
piloting: 0,
|
|
167
|
+
computers: 0,
|
|
161
168
|
},
|
|
162
169
|
lores: {},
|
|
163
170
|
melee: {
|
|
@@ -188,7 +195,7 @@ const childSchema = zod_1.default.object({
|
|
|
188
195
|
maxhp: zod_1.default.coerce.number().default(10),
|
|
189
196
|
conditions: zod_1.default.string().default(''),
|
|
190
197
|
});
|
|
191
|
-
|
|
198
|
+
exports.charSchema = zod_1.default.object({
|
|
192
199
|
init: zod_1.default.coerce.number().default(0),
|
|
193
200
|
foe: zod_1.default.boolean().default(false),
|
|
194
201
|
state: zod_1.default.union([zod_1.default.literal('empty'), zod_1.default.literal('arrow'), zod_1.default.literal('check'), zod_1.default.literal('cross')]).default('empty'),
|
|
@@ -201,16 +208,8 @@ const charSchema = zod_1.default.object({
|
|
|
201
208
|
conditions: zod_1.default.string().default(''),
|
|
202
209
|
children: zod_1.default.array(childSchema).default([]),
|
|
203
210
|
});
|
|
204
|
-
exports.
|
|
205
|
-
|
|
206
|
-
'incredibly-easy': '`(Incredibly Easy)`',
|
|
207
|
-
'very-easy': '`(Very Easy)`',
|
|
208
|
-
'easy': '`(Easy)`',
|
|
209
|
-
'hard': '`(Hard)`',
|
|
210
|
-
'very-hard': '`(Very Easy)`',
|
|
211
|
-
'incredibly-hard': '`(Incredibly Hard)`',
|
|
212
|
-
});
|
|
213
|
-
exports.adjustmentMap = adjustmentMap;
|
|
211
|
+
exports.flatMap = Object.assign(Object.assign({}, ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20].map((v) => ([`${v}`, `d20 >= ${v} flat;`])).reduce((p, [k, v]) => { p[k] = v; return p; }, {}))), { c: 'd20 >= 5 flat;', concealed: 'd20 >= 5 flat;', h: 'd20 >= 11 flat;', hidden: 'd20 >= 11 flat;' });
|
|
212
|
+
exports.diceMap = Object.assign(Object.assign({}, ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20].map((v) => ([`${v}`, `(${v})`])).reduce((p, [k, v]) => { p[k] = v; return p; }, {}))), { a: '+2', adv: '+2', advantage: '+2', d: '-2', dis: '-2', disadvantage: '-2', f: '+2', for: '+2', fort: '+2', fortune: '+2', m: '-2', mis: '-2', misfortune: '-2' });
|
|
214
213
|
const fromatMap = (name, map) => {
|
|
215
214
|
return tsv_1.TSV.stringify([Object.assign({ name }, map)]);
|
|
216
215
|
};
|
|
@@ -220,7 +219,7 @@ const formatJSON = (stats) => JSON.stringify(stats, undefined, 2);
|
|
|
220
219
|
exports.formatJSON = formatJSON;
|
|
221
220
|
const parseJSON = (json) => schema.parse(JSON.parse(json));
|
|
222
221
|
exports.parseJSON = parseJSON;
|
|
223
|
-
const parseTracker = (json) => zod_1.default.array(charSchema).parse(JSON.parse(json));
|
|
222
|
+
const parseTracker = (json) => zod_1.default.array(exports.charSchema).parse(JSON.parse(json));
|
|
224
223
|
exports.parseTracker = parseTracker;
|
|
225
224
|
const locateName = (statblock) => {
|
|
226
225
|
const regex = /^([^()]+?)(\s+\(\d+\))?\s+\S+\s+(-?\d+)$/m;
|
|
@@ -283,10 +282,7 @@ const locateStrikes = (statblock, alias) => {
|
|
|
283
282
|
.replace(/\+\d/g, '')
|
|
284
283
|
.replace(/Weapon\s+Striking(\s+\((Greater|Major)\))?/gi, '')
|
|
285
284
|
.replace(/((Greater|Major)\s+)?Striking/gi, '')
|
|
286
|
-
.replace(/\(
|
|
287
|
-
.replace(/\(Finesse\)/gi, '')
|
|
288
|
-
.replace(/\(\+\)/gi, '')
|
|
289
|
-
.replace(/\(\)/gi, '')
|
|
285
|
+
.replace(/\(.*\)/gi, '')
|
|
290
286
|
.replace(/\s+/g, ' ')
|
|
291
287
|
.trim();
|
|
292
288
|
const bps = /(?<=[^\w']|^)[BbPpSs](?=[^\w]|$)/g;
|
|
@@ -305,6 +301,8 @@ const locateStrikes = (statblock, alias) => {
|
|
|
305
301
|
.replace(/Electricity/, 'electricity')
|
|
306
302
|
.replace(/Sonic/, 'sonic')
|
|
307
303
|
.replace(/Spirit/, 'spirit')
|
|
304
|
+
.replace(/Acid/, 'acid')
|
|
305
|
+
.replace(/[pP]lus\s(\d+d)/, '+$1')
|
|
308
306
|
.trim();
|
|
309
307
|
const twoHand = _traits.match(/(two-hand|two-handed)\s+(d\d+)/);
|
|
310
308
|
if (twoHand && twoHand[2]) {
|
|
@@ -358,7 +356,7 @@ const parseStatblock = (name, _statblock, alias) => {
|
|
|
358
356
|
.replace('', '')
|
|
359
357
|
.replace(/–/g, '-') + '\n';
|
|
360
358
|
const basic = locateName(statblock);
|
|
361
|
-
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaults), basic), (name && { name: name })), { alias: alias !== null && alias !== void 0 ? alias : (0, abbreviate_1.default)((_a = name !== null && name !== void 0 ? name : basic === null || basic === void 0 ? void 0 : basic.name) !== null && _a !== void 0 ? _a : defaults.name, { length: 3 }).toLowerCase() }), locateInt('perception', statblock)), locateInt('ac', statblock, null, false, 'AC')), locateInt('maxhp', statblock, null, false, 'HP')), { attributes: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaults.attributes), locateInt('strength', statblock, null, true, 'Str')), locateInt('dexterity', statblock, null, true, 'Dex')), locateInt('constitution', statblock, null, true, 'Con')), locateInt('intelligence', statblock, null, true, 'Int')), locateInt('wisdom', statblock, null, true, 'Wis')), locateInt('charisma', statblock, null, true, 'Cha')), saves: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaults.saves), locateInt('fortitude', statblock, null, true, 'Fortitude')), locateInt('reflex', statblock, null, true, 'Reflex')), locateInt('fortitude', statblock, null, true, 'Fort')), locateInt('reflex', statblock, null, true, 'Ref')), locateInt('will', statblock, null, true, 'Will')), skills: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaults.skills), locateInt('acrobatics', statblock, 'Skills')), locateInt('arcana', statblock, 'Skills')), locateInt('athletics', statblock, 'Skills')), locateInt('crafting', statblock, 'Skills')), locateInt('deception', statblock, 'Skills')), locateInt('diplomacy', statblock, 'Skills')), locateInt('intimidation', statblock, 'Skills')), locateInt('medicine', statblock, 'Skills')), locateInt('nature', statblock, 'Skills')), locateInt('occultism', statblock, 'Skills')), locateInt('performance', statblock, 'Skills')), locateInt('religion', statblock, 'Skills')), locateInt('society', statblock, 'Skills')), locateInt('stealth', statblock, 'Skills')), locateInt('survival', statblock, 'Skills')), locateInt('thievery', statblock, 'Skills')), lores: Object.assign(Object.assign({}, locateInts(statblock, 'Skills', 'Lore')), locateIntsAfter(statblock, 'Lore:')), melee: Object.assign({}, locateStrikes(statblock, 'Melee')), ranged: Object.assign({}, locateStrikes(statblock, 'Ranged')), spells: Object.assign({}, locateSpells(statblock)), extra: {}, extraDCs: Object.assign({}, locateInt('stealth', statblock, null, false, 'Stealth DC')), extraDice: {} });
|
|
359
|
+
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaults), basic), (name && { name: name })), { alias: alias !== null && alias !== void 0 ? alias : (0, abbreviate_1.default)((_a = name !== null && name !== void 0 ? name : basic === null || basic === void 0 ? void 0 : basic.name) !== null && _a !== void 0 ? _a : defaults.name, { length: 3 }).toLowerCase() }), locateInt('perception', statblock)), locateInt('ac', statblock, null, false, 'AC')), locateInt('maxhp', statblock, null, false, 'HP')), { attributes: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaults.attributes), locateInt('strength', statblock, null, true, 'Str')), locateInt('dexterity', statblock, null, true, 'Dex')), locateInt('constitution', statblock, null, true, 'Con')), locateInt('intelligence', statblock, null, true, 'Int')), locateInt('wisdom', statblock, null, true, 'Wis')), locateInt('charisma', statblock, null, true, 'Cha')), saves: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaults.saves), locateInt('fortitude', statblock, null, true, 'Fortitude')), locateInt('reflex', statblock, null, true, 'Reflex')), locateInt('fortitude', statblock, null, true, 'Fort')), locateInt('reflex', statblock, null, true, 'Ref')), locateInt('will', statblock, null, true, 'Will')), skills: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaults.skills), locateInt('acrobatics', statblock, 'Skills')), locateInt('arcana', statblock, 'Skills')), locateInt('athletics', statblock, 'Skills')), locateInt('crafting', statblock, 'Skills')), locateInt('deception', statblock, 'Skills')), locateInt('diplomacy', statblock, 'Skills')), locateInt('intimidation', statblock, 'Skills')), locateInt('medicine', statblock, 'Skills')), locateInt('nature', statblock, 'Skills')), locateInt('occultism', statblock, 'Skills')), locateInt('performance', statblock, 'Skills')), locateInt('religion', statblock, 'Skills')), locateInt('society', statblock, 'Skills')), locateInt('stealth', statblock, 'Skills')), locateInt('survival', statblock, 'Skills')), locateInt('thievery', statblock, 'Skills')), locateInt('piloting', statblock, 'Skills')), locateInt('computers', statblock, 'Skills')), lores: Object.assign(Object.assign({}, locateInts(statblock, 'Skills', 'Lore')), locateIntsAfter(statblock, 'Lore:')), melee: Object.assign({}, locateStrikes(statblock, 'Melee')), ranged: Object.assign({}, locateStrikes(statblock, 'Ranged')), spells: Object.assign({}, locateSpells(statblock)), extra: {}, extraDCs: Object.assign({}, locateInt('stealth', statblock, null, false, 'Stealth DC')), extraDice: {} });
|
|
362
360
|
result.untrained = improvisation ? (result.level >= 7 ? result.level : result.level >= 5 ? result.level - 1 : result.level - 2) : 0;
|
|
363
361
|
result.bullwark = plate ? Math.max(3 - result.attributes.dexterity, 0) : 0;
|
|
364
362
|
return result;
|
|
@@ -379,20 +377,10 @@ const toRanged = ([key, value]) => [
|
|
|
379
377
|
[`ranged.${key}.desc`, value.desc],
|
|
380
378
|
...(value.damage ? [[`ranged.${key}.damage`, value.damage]] : []),
|
|
381
379
|
];
|
|
382
|
-
const
|
|
383
|
-
['dc.recall.incredibly-easy', secret ? `||${value - 10}||` : `${value - 10}`],
|
|
384
|
-
['dc.recall.very-easy', secret ? `||${value - 5}||` : `${value - 5}`],
|
|
385
|
-
['dc.recall.easy', secret ? `||${value - 2}||` : `${value - 2}`],
|
|
386
|
-
['dc.recall.default', secret ? `||${value}||` : `${value}`],
|
|
387
|
-
['dc.recall', secret ? `||${value}||` : `${value}`],
|
|
388
|
-
['dc.recall.hard', secret ? `||${value + 2}||` : `${value + 2}`],
|
|
389
|
-
['dc.recall.very-hard', secret ? `||${value + 5}||` : `${value + 5}`],
|
|
390
|
-
['dc.recall.incredibly-hard', secret ? `||${value + 10}||` : `${value + 10}`],
|
|
391
|
-
])(dcByLevel[Math.max(Math.min(level + 1, dcByLevel.length - 1), 0)] + bump);
|
|
392
|
-
const flatten = (stats, secretDC = false, defaultSkills = false, recallDC = false) => {
|
|
380
|
+
const flatten = (stats, secretDC = false, defaultSkills = false) => {
|
|
393
381
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
394
382
|
const untrained = stats.untrained;
|
|
395
|
-
const skills = defaultSkills ? Object.assign({ acrobatics: untrained + stats.attributes.dexterity, arcana: untrained + stats.attributes.intelligence, athletics: untrained + stats.attributes.strength, crafting: untrained + stats.attributes.intelligence, deception: untrained + stats.attributes.charisma, diplomacy: untrained + stats.attributes.charisma, intimidation: untrained + stats.attributes.charisma, medicine: untrained + stats.attributes.wisdom, nature: untrained + stats.attributes.wisdom, occultism: untrained + stats.attributes.intelligence, performance: untrained + stats.attributes.charisma, religion: untrained + stats.attributes.wisdom, society: untrained + stats.attributes.intelligence, stealth: untrained + stats.attributes.dexterity, survival: untrained + stats.attributes.wisdom, thievery: untrained + stats.attributes.dexterity }, stats.skills) : stats.skills;
|
|
383
|
+
const skills = defaultSkills ? Object.assign({ acrobatics: untrained + stats.attributes.dexterity, arcana: untrained + stats.attributes.intelligence, athletics: untrained + stats.attributes.strength, crafting: untrained + stats.attributes.intelligence, deception: untrained + stats.attributes.charisma, diplomacy: untrained + stats.attributes.charisma, intimidation: untrained + stats.attributes.charisma, medicine: untrained + stats.attributes.wisdom, nature: untrained + stats.attributes.wisdom, occultism: untrained + stats.attributes.intelligence, performance: untrained + stats.attributes.charisma, religion: untrained + stats.attributes.wisdom, society: untrained + stats.attributes.intelligence, stealth: untrained + stats.attributes.dexterity, survival: untrained + stats.attributes.wisdom, thievery: untrained + stats.attributes.dexterity, piloting: untrained + stats.attributes.dexterity, computers: untrained + stats.attributes.intelligence }, stats.skills) : stats.skills;
|
|
396
384
|
const lores = defaultSkills ? Object.assign(Object.assign({}, stats.lores), { other: {
|
|
397
385
|
mod: untrained + stats.attributes.intelligence,
|
|
398
386
|
name: "Other",
|
|
@@ -469,9 +457,6 @@ const flatten = (stats, secretDC = false, defaultSkills = false, recallDC = fals
|
|
|
469
457
|
...(0, lodash_1.entries)(skills).map(mod2DC(true, ((_m = stats.bump.skills) !== null && _m !== void 0 ? _m : stats.bump.default))),
|
|
470
458
|
...(0, lodash_1.entries)(stats.extra).map(mod2DC(true, stats.bump.default)),
|
|
471
459
|
] : []),
|
|
472
|
-
...(recallDC ? [
|
|
473
|
-
...recallDCs(stats.level, secretDC, stats.bump.default),
|
|
474
|
-
] : []),
|
|
475
460
|
...(stats.perceptionInfo.length > 0 ? [
|
|
476
461
|
[`perception.info`, `\`(${stats.perceptionInfo.join(', ')})\``]
|
|
477
462
|
] : []),
|
|
@@ -484,9 +469,9 @@ const flatten = (stats, secretDC = false, defaultSkills = false, recallDC = fals
|
|
|
484
469
|
].reduce((p, [key, value]) => { p[key] = value; return p; }, {});
|
|
485
470
|
};
|
|
486
471
|
exports.flatten = flatten;
|
|
487
|
-
const formatTSV = (stats, secretDC = false, defaultSkills = false
|
|
472
|
+
const formatTSV = (stats, secretDC = false, defaultSkills = false) => (tsv_1.TSV.stringify([(0, exports.flatten)(stats, secretDC, defaultSkills)]));
|
|
488
473
|
exports.formatTSV = formatTSV;
|
|
489
|
-
const formatCommand = (stats, secretDC = false, defaultSkills = false
|
|
474
|
+
const formatCommand = (stats, secretDC = false, defaultSkills = false) => (Object.entries((0, exports.flatten)(stats, secretDC, defaultSkills)).map(([k, v]) => `${k}="${v}"`).join(' '));
|
|
490
475
|
exports.formatCommand = formatCommand;
|
|
491
476
|
const formatTable = (table, season, scenario, _name, gm, players) => {
|
|
492
477
|
const name = _name.replace(/[\s-_]/g, ' ').replace(/[^a-zA-Z0-9 ]/g, '');
|
|
@@ -497,7 +482,7 @@ const formatTable = (table, season, scenario, _name, gm, players) => {
|
|
|
497
482
|
@TableBot create "${gameName}" --gm ${gm} --players ${players} --table-name ${tableName} --ooc-table-name ooc-${tableName} --category Game Tables
|
|
498
483
|
\`\`\`
|
|
499
484
|
\`\`\`
|
|
500
|
-
sage! game create name="${gameName}" gameSystem="pf2e" ic=" #${tableName} " ooc=" #ooc-${tableName} " gms=" ${gm} " players=" @${gameName} " dialogPost="post" diceSecret="gm" diceCrit="timestwo" diceOutput=M gmCharName="Хронист"
|
|
485
|
+
sage! game create name="${gameName}" gameSystem="pf2e" ic=" #${tableName} " ooc=" #ooc-${tableName} " gms=" ${gm} " players=" @${gameName} " dialogPost="post" diceSecret="gm" diceCrit="timestwo" diceOutput=M gmCharName="Хронист"
|
|
501
486
|
\`\`\`
|
|
502
487
|
`;
|
|
503
488
|
};
|
|
@@ -524,11 +509,11 @@ const newtracker = (status) => {
|
|
|
524
509
|
var _a, _b;
|
|
525
510
|
const regex = /((.+)\s+\((\d+)\/(\d+)\s+HP\):(.*)(\n>(.+)\s+\((\d+)\/(\d+)\s+HP\):(.*))*)/gm;
|
|
526
511
|
const match = status.match(regex);
|
|
527
|
-
const tracker = zod_1.default.array(charSchema).parse([]);
|
|
512
|
+
const tracker = zod_1.default.array(exports.charSchema).parse([]);
|
|
528
513
|
for (const m of match !== null && match !== void 0 ? match : []) {
|
|
529
514
|
const mmatch = m.match(/([^>]+)\s+\((\d+)\/(\d+)\s+HP\):(.*)/);
|
|
530
515
|
const cmatch = m.match(/>\s+(\S+)\s+\((\d+)\/(\d+)\s+HP\):(.*)/g);
|
|
531
|
-
const char = charSchema.parse({
|
|
516
|
+
const char = exports.charSchema.parse({
|
|
532
517
|
name: mmatch === null || mmatch === void 0 ? void 0 : mmatch[1],
|
|
533
518
|
hp: mmatch === null || mmatch === void 0 ? void 0 : mmatch[2],
|
|
534
519
|
maxhp: mmatch === null || mmatch === void 0 ? void 0 : mmatch[3],
|
|
@@ -550,8 +535,10 @@ const newtracker = (status) => {
|
|
|
550
535
|
};
|
|
551
536
|
exports.newtracker = newtracker;
|
|
552
537
|
const formatTracker = (tracker) => {
|
|
538
|
+
const aliasSpace = (t) => (t.alias.length > 0 ? 0 : 5);
|
|
539
|
+
const nameLengthWithAlias = (t) => t.name.length - aliasSpace(t);
|
|
553
540
|
const nameLength = tracker.reduce((p, c) => {
|
|
554
|
-
const length = c.children.reduce((pp, cc) => pp > cc
|
|
541
|
+
const length = c.children.reduce((pp, cc) => pp > nameLengthWithAlias(cc) ? pp : nameLengthWithAlias(cc), nameLengthWithAlias(c));
|
|
555
542
|
return p > length ? p : length;
|
|
556
543
|
}, 0);
|
|
557
544
|
const hpLength = tracker.reduce((p, c) => {
|
|
@@ -580,15 +567,15 @@ const formatTracker = (tracker) => {
|
|
|
580
567
|
if (tracker[index - 1] && tracker[index - 1].foe !== char.foe) {
|
|
581
568
|
ls.push('');
|
|
582
569
|
}
|
|
583
|
-
const hp = char.foe ? (`-${char.maxhp - char.hp}${char.temphp > 0 ? `+${char.temphp}` : ''}`.padStart(hpLength)) : (`${char.hp}${char.temphp > 0 ? `+${char.temphp}` : ''}
|
|
570
|
+
const hp = !char.foe && char.hp > 0 ? (`${char.hp}${char.temphp > 0 ? `+${char.temphp}` : ''}/${char.maxhp}`.padStart(hpLength)) : char.hp > 0 ? (`-${char.maxhp - char.hp}${char.temphp > 0 ? `+${char.temphp}` : ''}`.padStart(hpLength)) : (`${char.hp}${char.temphp > 0 ? `+${char.temphp}` : ''}`.padStart(hpLength));
|
|
584
571
|
const hpBar = (value, max) => (value <= 0 ? (':crossed:') : value >= max ? (':healthy:') : (hpMap[Math.round((hpMap.length - 1) * value / max)]));
|
|
585
|
-
ls.push((`${stateMap[char.state]}**\` ${char.name.padEnd(nameLength)} ▏${char.alias.padEnd(3)} ▏${hp} \`** ${hpBar(char.hp, char.maxhp)} `));
|
|
572
|
+
ls.push((`${stateMap[char.hp > 0 ? char.state : 'cross']}**\` ${char.name.padEnd(nameLength + aliasSpace(char))}${char.alias.length > 0 ? ` ▏${char.alias.padEnd(3)}` : ''} ▏${hp} \`** ${hpBar(char.hp, char.maxhp)} `));
|
|
586
573
|
if (char.conditions.length > 0) {
|
|
587
574
|
ls.push(`-# ${char.conditions}`);
|
|
588
575
|
}
|
|
589
576
|
for (const child of char.children) {
|
|
590
|
-
const hhp = char.foe ? (`-${child.maxhp - child.hp}${child.temphp > 0 ? `+${child.temphp}` : ''}`.padStart(hpLength)) : (`${child.hp}${child.temphp > 0 ? `+${child.temphp}` : ''}
|
|
591
|
-
ls.push((`:smallnode:**\` ${child.name.padEnd(nameLength)} ▏${child.alias.padEnd(3)} ▏${hhp} \`** ${hpBar(child.hp, child.maxhp)} `));
|
|
577
|
+
const hhp = !char.foe && child.hp > 0 ? (`${child.hp}${child.temphp > 0 ? `+${child.temphp}` : ''}/${child.maxhp}`.padStart(hpLength)) : child.hp > 0 ? (`-${child.maxhp - child.hp}${child.temphp > 0 ? `+${child.temphp}` : ''}`.padStart(hpLength)) : (`${child.hp}${child.temphp > 0 ? `+${child.temphp}` : ''}`.padStart(hpLength));
|
|
578
|
+
ls.push((`:smallnode:**\` ${child.name.padEnd(nameLength + aliasSpace(child))}${child.alias.length > 0 ? ` ▏${child.alias.padEnd(3)}` : ''} ▏${hhp} \`** ${hpBar(child.hp, child.maxhp)} `));
|
|
592
579
|
if (child.conditions.length > 0) {
|
|
593
580
|
ls.push(`-# ${child.conditions}`);
|
|
594
581
|
}
|
|
@@ -615,3 +602,40 @@ const sortFolder = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
615
602
|
return transformed;
|
|
616
603
|
});
|
|
617
604
|
exports.sortFolder = sortFolder;
|
|
605
|
+
const screenPlay = (htmlContent) => {
|
|
606
|
+
const dom = new jsdom_1.JSDOM(htmlContent);
|
|
607
|
+
const document = dom.window.document;
|
|
608
|
+
const outputLines = [];
|
|
609
|
+
const preambleEntry = document.querySelector('.preamble__entry');
|
|
610
|
+
if (preambleEntry) {
|
|
611
|
+
outputLines.push(`SCENE: ${preambleEntry.textContent}`);
|
|
612
|
+
outputLines.push('');
|
|
613
|
+
}
|
|
614
|
+
// Process all chatlog messages
|
|
615
|
+
const messages = document.querySelectorAll('.chatlog__message');
|
|
616
|
+
messages.forEach(message => {
|
|
617
|
+
var _a, _b, _c, _d;
|
|
618
|
+
const authorElement = message.querySelector('.chatlog__author');
|
|
619
|
+
const contentElement = message.querySelector('.chatlog__content');
|
|
620
|
+
if (!authorElement || !contentElement)
|
|
621
|
+
return;
|
|
622
|
+
const author = (_b = (_a = authorElement.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '';
|
|
623
|
+
const content = (_d = (_c = contentElement.textContent) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : '';
|
|
624
|
+
// Skip bot tags in character names
|
|
625
|
+
const characterName = author.replace(/\s*BOT$/, '');
|
|
626
|
+
// Add character line
|
|
627
|
+
outputLines.push(`${characterName.toUpperCase()}`);
|
|
628
|
+
// Add dialogue/content (wrap long lines)
|
|
629
|
+
const lines = content.split('\n').map((c) => (c
|
|
630
|
+
.replace(/(—|--)/g, '-')
|
|
631
|
+
// eslint-disable-next-line no-irregular-whitespace
|
|
632
|
+
.replace(/(|)/g, '')
|
|
633
|
+
.trim())).filter((c) => c.length);
|
|
634
|
+
for (const line of lines) {
|
|
635
|
+
outputLines.push(` ${line}`);
|
|
636
|
+
}
|
|
637
|
+
outputLines.push('');
|
|
638
|
+
});
|
|
639
|
+
return outputLines.join('\n');
|
|
640
|
+
};
|
|
641
|
+
exports.screenPlay = screenPlay;
|