-
Notifications
You must be signed in to change notification settings - Fork 0
/
pf2utils_old.js
2294 lines (2171 loc) · 87.4 KB
/
pf2utils_old.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"use strict";
/** @typedef {{field: string, name: string, type: number, stat: number}} */
let Field;
/** @typedef {{name: string, cat: string, value: number, tags: !Array<string>, targets: !Array<string>}} */
let Modifier;
/** @typedef {{
* name: string,
* tags: !Array<string>,
* skill: string,
* reqprof: string,
* dc: string,
* crit: string,
* hit: string,
* miss: string}}
*/
let Ability;
/** @export */
var Pathfinder2Utils = Pathfinder2Utils || (function() {
/** @enum {number} */
const fieldType = {
stat: 1,
calculated: 2,
skill: 3,
save: 4
};
/** @enum {number} */
const statId = {
str: 1,
dex: 2,
con: 3,
int: 4,
wis: 5,
cha: 6
};
/** @type {!Array<{Field}>} */
const fields = [
{ name:"ac", field: "armor_class", type:fieldType.calculated, stat: statId.dex },
{ name:"strength", field: "strength_modifier", type:fieldType.stat },
{ name:"dexterity", field: "dexterity_modifier", type:fieldType.stat },
{ name:"constitution", field: "constitution_modifier", type:fieldType.stat },
{ name:"intelligence", field: "intelligence_modifier", type:fieldType.stat },
{ name:"wisdom", field: "wisdom_modifier", type:fieldType.stat },
{ name:"charisma", field: "charisma_modifier", type:fieldType.stat },
{ name:"hp", field: "hit_points", type:fieldType.calculated },
{ name:"acrobatics", field: "acrobatics", type:fieldType.skill, stat:statId.dex },
{ name:"arcana", field: "arcana", type:fieldType.skill, stat: statId.int },
{ name:"athletics", field: "athletics", type:fieldType.skill, stat: statId.str },
{ name:"crafting", field: "crafting", type:fieldType.skill, stat: statId.int },
{ name:"deception", field: "deception", type:fieldType.skill, stat: statId.cha },
{ name:"diplomacy", field: "diplomacy", type:fieldType.skill, stat: statId.cha },
{ name:"intimidation", field: "intimidation", type:fieldType.skill, stat: statId.cha },
{ name:"medicine", field: "medicine", type:fieldType.skill, stat: statId.wis },
{ name:"nature", field: "nature", type:fieldType.skill, stat:statId.wis },
{ name:"occultism", field: "occultism", type:fieldType.skill, stat: statId.int },
{ name:"performance", field: "performance", type:fieldType.skill, stat: statId.cha },
{ name:"religion", field: "religion", type:fieldType.skill, stat:statId.wis },
{ name:"society", field: "society", type:fieldType.skill, stat:statId.int },
{ name:"stealth", field: "stealth", type:fieldType.skill, stat:statId.dex },
{ name:"survival", field: "survival", type:fieldType.skill, stat: statId.wis },
{ name:"thievery", field: "thievery", type:fieldType.skill, stat: statId.dex },
{ name:"fortitude", field: "saving_throws_fortitude", type:fieldType.save, stat: statId.con },
{ name:"reflex", field: "saving_throws_reflex", type:fieldType.save, stat: statId.dex },
{ name:"will", field: "saving_throws_will", type:fieldType.save, stat: statId.wis },
{ name:"perception", field: "perception", type:fieldType.skill, stat: statId.wis },
{ name:"level", field: "level", type:fieldType.calculated },
{ name:"initiative", field: "initiative_modifier", type:fieldType.calculated },
{ name:"melee", field: "repeating_melee-strikes_$0_weapon_strike", type:fieldType.calculated, stat:statId.str },
{ name:"ranged", field: "repeating_ranged-strikes_$0_weapon_strike", type:fieldType.calculated, stat:statId.dex }];
/** @type {!Array<{type:string, skill:string}>} */
const creature_identify = [
{ type: "aberrant", skill: "occultism"},
{ type: "animal", skill: "nature"},
{ type: "astral", skill: "occultism"},
{ type: "beast", skill: "nature"},
{ type: "celestial", skill: "religion"},
{ type: "construct", skill: "crafting"},
{ type: "dragon", skill: "arcana"},
{ type: "elemental", skill: "arcana"},
{ type: "ethereal", skill: "occultism"},
{ type: "fey", skill: "nature"},
{ type: "fiend", skill: "religion"},
{ type: "fungus", skill: "nature"},
{ type: "humanoid", skill: "society"},
{ type: "monitor", skill: "religion"},
{ type: "ooze", skill: "occultism"} ,
{ type: "plant", skill: "nature"},
{ type: "spirit", skill: "occultism" },
{ type: "undead", skill: "religion"}
];
/** @type {!Array<number>} */
const offset4xpsimple = [2,3,4,6,8,12,16,24,32];
/** @type {!Array<number>} */
const offset4xpcomplex = [10,15,20,30,40,60,80,120,160];
/** @type {!Array<!Ability>} */
const abilities = [{
name: "Decipher Writing",
tags: ["Concentrate","Exploration","Secret"],
skill: "",
reqprof: "T",
crit: "Understand text, even if in code.",
hit: "Understand text, only vaguely if in code.",
miss: "-2c to any further checks to decipher this text.",
fumble: "You think you understood the text but are wrong."
}, {
name: "Earn Income",
tags: ["Downtime"],
skill: "",
reqprof: "T",
dc: "Per PC's choice of task level, up to the settlement level.",
crit: "Earn money at the task level +1.",
hit: "Earn money at the given task level.",
miss: "Earn the failure amount fo the task level.",
fumble: "Earn nothing and are fired."
}, {
name: "Identify Magic",
tags: ["Concentrate","Exploration","Secret"],
skill: "",
dc: "Per level of the effect, +2/+5/+10 for uncommon/rare/unique or cursed.",
reqprof: "T",
crit: "Learn all attributes of the magic.",
hit: "Get a sense of what the magic does. No retry.",
miss: "Can't identify the magic for 1 day.",
fumble: "Misidentify the magic."
}, {
name: "Learn A Spell",
tags: ["Concentrate","Exploration"],
skill: "",
reqprof: "T",
dc: "Per level of the spell, +2/+5/+10 for uncommon/rare/unique.",
crit: "Spend half materials, learn spell.",
hit: "Spend materials, learn spell.",
miss: "Spend no materials, can't learn spell this level.",
fumble: "Spend half materials, can't learn spell this level."
}, {
name: "Recall Knowledge",
tags: ["Concentrate","Secret"],
skill: "",
reqprof: "U",
crit: "Recall accurate knowledge plus extra information.",
hit: "Recall accurate knowledge.",
miss: "Nil.",
fumble: "You recall wrong information."
}, {
name: "Subsist",
tags: ["Downtime"],
skill: "",
dc: "Typically 15.",
reqprof: "U",
crit: "Provide subsistence for 2, or comfortable for yourself.",
hit: "Provide yourself subsistence.",
miss: "Fatigued until you get food and shelter.",
fumble: "-2c to Subsist for 1 week and in danger of hunger or thirst."
}, {
name: "Balance",
tags: ["Move"],
action: 1,
skill: "acrobatics",
dc: "The Balance DC of the surface.",
reqprof: "U",
crit: "Move up to your speed.",
hit: "Move up to your speed as difficult terrain.",
miss: "Lose the move action, or fall and end your turn.",
fumble: "Fall and end your turn."
}, {
name: "Tumble Through",
tags: ["Move"],
dc: "Enemy Reflex DC",
action: 1,
skill: "acrobatics",
reqprof: "U",
crit: "As success.",
hit: "Move through target as difficult terrain.",
miss: "Movement ends and you trigger reactions.",
fumble: "As failure."
}, {
name: "Maneuver in Flight",
tags: ["Move"],
action: 1,
skill: "acrobatics",
reqprof: "T",
crit: "As success.",
hit: "Succeed at the maneuver.",
miss: "Nil.",
fumble: "The maneuver fails with dire consequences."
}, {
name: "Squeeze",
tags: ["Exploration", "Move"],
skill: "acrobatics",
reqprof: "T",
crit: "Squeeze at 10' per min.",
hit: "Squeeze at 5' per min.",
miss: "Nil.",
fumble: "Stuck. To escape, check again and get better than a fumble."
}, {
name: "Borrow An Arcane Spell",
tags: ["Concentrate", "Exploration"],
skill: "arcana",
reqprof: "T",
crit: "As success.",
hit: "Prepare the borrowed spell.",
miss: "Can't prepare the spell until next preparation, but keep the slot.",
fumble: "As failure."
}, {
name: "Climb",
tags: ["Move"],
action: 1,
skill: "athletics",
reqprof: "U",
crit: "Climb at 5' + a quarter your speed.",
hit: "Climb at a quarter your speed.",
miss: "Nil.",
fumble: "Fall, landing prone if on stable ground."
}, {
name: "Force Open",
tags: ["Attack"],
action: 1,
skill: "athletics",
reqprof: "U",
crit: "Open the item without damaging it.",
hit: "Open the item but break it.",
miss: "Nil.",
fumble: "Jam the item. -2c on future attempts to force."
}, {
name: "Grapple",
tags: ["Attack"],
dc: "Enemy Fortitude DC",
action: 1,
skill: "athletics",
reqprof: "U",
crit: "Target restrained until end of your next turn.",
hit: "Target grabbed until end of your next turn.",
miss: "Release target if they were grabbed.",
fumble: "Target can grab you or force you to fall prone."
}, {
name: "High Jump",
tags: [],
action: 2,
dc: "30",
skill: "athletics",
reqprof: "U",
crit: "Choose: 8' vertical, or 5' vertical and 10' horizontal.",
hit: "5' vertical.",
miss: "Leap normally.",
fumble: "Fall prone in your space."
}, {
name: "Long Jump",
tags: [],
dc: "The number of feet you're attempting to leap.",
action: 2,
skill: "athletics",
reqprof: "U",
crit: "As success.",
hit: "Leap the target distance.",
miss: "Leap normally.",
fumble: "Leap normally, fall prone when you land."
}, {
name: "Shove",
tags: ["Attack"],
action: 1,
dc: "Enemy Fortitude DC",
skill: "athletics",
reqprof: "U",
crit: "Push target <=10' away, and can Stride after it.",
hit: "Push target <=5' back, and can Stride after it.",
miss: "Nil.",
fumble: "Fall prone."
}, {
name: "Swim",
tags: ["Move"],
action: 1,
skill: "athletics",
reqprof: "U",
crit: "Swim 10'+Speed/4.",
hit: "Swim 5'+Speed/4..",
miss: "Nil.",
fumble: "Lose a round of air."
}, {
name: "Trip",
tags: ["Attack"],
action: 1,
dc: "Enemy Reflex DC",
skill: "athletics",
reqprof: "U",
crit: "Target prone and takes [[1d6]] bludgeoning.",
hit: "Target prone.",
miss: "Nil.",
fumble: "You fall prone."
}, {
name: "Disarm",
tags: ["Attack"],
action: 1,
skill: "athletics",
reqprof: "T",
dc: "Enemy Reflex DC",
crit: "Disarm target.",
hit: "Target -2c to use item and others +2c to diarm target until their next turn.",
miss: "Nil.",
fumble: "Fall prone."
}, {
name: "Repair",
tags: ["Exploration", "Manipulate"],
skill: "crafting",
reqprof: "U",
crit: "Repair 10 HP plus 10 HP per proficiency rank.",
hit: "Repair 5 HP plus 5 HP per proficiency rank.",
miss: "Nil.",
fumble: "You deal [[2d6]] damage to the item."
}, {
name: "Craft",
tags: ["Downtime", "Manipulate"],
skill: "crafting",
dc: "Per the item's level, +2/5/10 for Uncommon/Rare/Unique.",
reqprof: "T",
crit: "Make the item. Extra time reduces costs based on level+1.",
hit: "Make the item. Extra times reduces costs based on level.",
miss: "You don't make the item but you can salvage all the materials.",
fumble: "You don't make the item but you can salvage 90% of the materials."
}, {
name: "Identify Alchemy",
tags: ["Concentrate","Exploration","Secret"],
skill: "crafting",
reqprof: "T",
crit: "As success.",
hit: "Identify the item and its activation.",
miss: "Nil.",
fumble: "Misidentify the item."
}, {
name: "Create a Diversion",
tags: ["Mental"],
action: 1,
skill: "deception",
reqprof: "U",
dc: "Perception DC of each target",
crit: "As success.",
hit: "(per target) You are hidden.",
miss: "(per target) You are not hidden, target knows you were trying to hide."
}, {
name: "Impersonate",
tags: ["Concentrate", "Exploration", "Manipulate", "Secret"],
skill: "deception",
reqprof: "U",
crit: "As success.",
dc: "Perception DC of each target.",
hit: "Target thinks you're who you're impersonating.",
miss: "Target can tell you're not that person.",
fumble: "Target can tell you're not that person and recognizes you if they know you."
}, {
name: "Lie",
tags: ["Auditory","Concentrate","Linguistic","Mental","Secret"],
skill: "deception",
reqprof: "U",
dc: "Perception DC of each target.",
crit: "As success.",
hit: "Target believes you.",
miss: "Target doesn't believe you and gains +4c against your lies.",
fumble: "As failure."
}, {
name: "Feint",
tags: ["Mental"],
skill: "deception",
dc: "Perception DC of target.",
reqprof: "T",
action: 1,
crit: "Target flat-footed against your melee until end of your next turn.",
hit: "Target flat-footed against your next melee in the current turn.",
miss: "Nil.",
fumble: "You are flat-footed against their melee until end of your next turn."
}, {
name: "Gather Information",
tags: ["Exploration", "Secret"],
skill: "diplomacy",
reqprof: "U",
crit: "As success.",
hit: "You find information.",
miss: "Nil.",
fumble: "You gather wrong information."
}, {
name: "Make an Impression",
tags: ["Auditory", "Concentrate", "Exploration", "Linguistic", "Mental"],
skill: "diplomacy",
reqprof: "U",
dc: "Target Will DC.",
crit: "Attitude improves by 2 steps.",
hit: "Attitude improves by 1 step.",
miss: "Nil.",
fumble: "Attitude worsens by 1 step."
}, {
name: "Request",
tags: ["Auditory", "Concentrate", "Linguistic", "Mental"],
skill: "diplomacy",
dc: "Automatic failure if Unfriendly or Hostile.",
reqprof: "U",
crit: "Target agrees.",
hit: "Target agrees with caveats.",
miss: "Target refuses the request.",
fumble: "Target refuses and attitude worsens by 1 step."
}, {
name: "Coerce",
tags: ["Auditory", "Concentrate", "Emotion", "Exploration", "Lingustic", "Mental"],
skill: "intimidation",
reqprof: "U",
dc: "Target Will DC.",
crit: "Target obeys, then becomes unfriendly but is too scared to retaliate.",
hit: "Target obeys, then becomes unfriendly and may act against you.",
miss: "Target refuses and becomes unfriendly.",
fumble: "Target refuses, becomes hostile and immune 1 week."
}, {
name: "Demoralize",
tags: ["Auditory", "Concentrate", "Emotion", "Mental"],
skill: "intimidation",
action: 1,
reqprof: "U",
dc: "Target Will DC.",
crit: "Target frightened 2 and immune 10 minutes.",
hit: "Target frightened 1 and immune 10 minutes.",
miss: "Target immune 10 minutes.",
fumble: "As failure."
}, {
name: "Stabilize",
tags: ["Manipulate"],
skill: "medicine",
action: 2,
dc: "5 + the creature's recovery roll DC.",
reqprof: "U",
crit: "As success.",
hit: "Target loses the dying condition.",
miss: "Target's dying value increases by 1.",
fumble: "As failure."
}, {
name: "Stop Bleeding",
tags: ["Manipulate"],
skill: "medicine",
dc: "The DC of the effect that caused the bleeding.",
action: 2,
reqprof: "U",
crit: "As success.",
hit: "Target attempts a flat check to end the bleeding.",
miss: "Target immediately takes their persistent bleed damage.",
fumble: "As failure."
}, {
name: "Treat Disease",
tags: ["Downtime","Manipulate"],
dc: "The disease's DC.",
skill: "medicine",
reqprof: "T",
crit: "Target gets +4c to their next save against the disease.",
hit: "Target gets +2c to their next save against the disease.",
miss: "Nil.",
fumble: "Target gets -2c to their next save against the disease."
}, {
name: "Treat Poison",
tags: ["Manipulate"],
skill: "medicine",
dc: "The poison's DC.",
action: 1,
reqprof: "T",
crit: "Target gets +4c to their next save against the poison.",
hit: "Target gets +2c to their next save against the poison.",
miss: "Nil.",
fumble: "Target gets -2c to their next save against the poison."
}, {
name: "Treat Wounds",
tags: ["Exploration","Healing","Manipulate"],
skill: "medicine",
dc: "15/20/30/40 for +0/+10/+30/+50.",
reqprof: "T",
crit: "Target heals [[4d8]] + difficulty bonus and is no longer wounded.",
hit: "Target heals [[2d8]] + difficulty bonus and is no longer wounded.",
miss: "Nil.",
fumble: "Target takes [[d8]] damage."
}, {
name: "Command an Animal",
tags: ["Auditory", "Concentrate"],
skill: "nature",
dc: "Animal Will DC.",
reqprof: "U",
action: 1,
crit: "As success.",
hit: "Animal obeys.",
miss: "Nil.",
fumble: "Animal misbehaves."
}, {
name: "Perform",
tags: ["Concentrate"],
skill: "performance",
reqprof: "U",
action: 1,
crit: "Your performance is impressive.",
hit: "Your performance is appreciable.",
miss: "Your performance is unsuccessful.",
fumble: "Your performance is degrading."
}, {
name: "Create Forgery",
tags: ["Downtime","Secret"],
skill: "society",
reqprof: "T",
dc: "20 to not be obviously detectable.",
crit: "As success.",
hit: "Observer does not detect the forgery.",
miss: "Observer detects the forgery.",
fumble: "As failure."
}, {
name: "Conceal an Object",
tags: ["Manipulate","Secret"],
skill: "stealth",
reqprof: "U",
dc: "Each observer's Perception DC.",
action: 1,
crit: "As success.",
hit: "(Per observer) Observer does not casually notice the object.",
miss: "(Per observer) Observer notices the object.",
fumble: "As failure."
}, {
name: "Hide",
tags: ["Secret"],
skill: "stealth",
reqprof: "U",
dc: "Each observer's Perception DC.",
action: 1,
crit: "As success.",
hit: "Become Hidden instead of Observed.",
miss: "Remain Observed.",
fumble: "As failure."
}, {
name: "Sneak",
tags: ["Move", "Secret"],
skill: "stealth",
dc: "Each observer's Perception DC.",
reqprof: "U",
action: 1,
crit: "As success.",
hit: "Remained undetected during your move.",
miss: "Become Hidden during your move.",
fumble: "Become Observed during your move if possible, otherwise Hidden."
}, {
name: "Sense Direction",
tags: ["Exploration", "Secret"],
skill: "survival",
dc: "15/20/30/40 for wilderness/underground/featureless/surreal.",
reqprof: "U",
crit: "Know where you are and exactly where cardinal directions are.",
hit: "Oon't get lost and have a sense of the cardinal directions.",
miss: "Nil.",
fumble: "Nil."
}, {
name: "Track",
tags: ["Concentrate", "Exploration", "Move"],
skill: "survival",
reqprof: "T",
dc: "Enemy survival DC or enemy's proficiency at covering tracks.",
action: 1,
crit: "As success.",
hit: "Successfully find or follow the trail.",
miss: "Lose the trail for 1 hour.",
fumble: "Lose the trail for 24 hours."
}, {
name: "Palm an Object",
tags: ["Manipulate"],
skill: "thievery",
reqprof: "U",
dc: "Each observer's Perception DC.",
action: 1,
crit: "As success.",
hit: "Not noticed palming the object.",
miss: "Noticed palming the object.",
fumble: "As failure."
}, {
name: "Steal",
tags: ["Manipulate"],
skill: "thievery",
reqprof: "U",
action: 1,
dc: "Each observer's Perception DC.",
crit: "As success.",
hit: "Take the object and aren't noticed.",
miss: "Fail to take the object, or are noticed taking it.",
fumble: "As failure."
}, {
name: "Disable a Device",
tags: ["Manipulate"],
skill: "thievery",
reqprof: "T",
action: 2,
crit: "Disable the device with no trace, or earn 2 successes.",
hit: "Disable the device, or earn 1 success.",
miss: "Nil.",
fumble: "Trigger the device."
}, {
name: "Pick a Lock",
tags: ["Manipulate"],
skill: "thievery",
dc: "15x2, 20x3, 25x4, 30x5, 40x6.",
reqprof: "T",
action: 2,
crit: "Unlock the lock with no trace, or earn 2 successes.",
hit: "Unlock the lock, or earn 1 success.",
miss: "Nil.",
fumble: "Break your thieves' tools."
}, {
name: "Seek",
tags: ["Concentrate","Secret"],
skill: "perception",
dc: "Target Stealth DC.",
reqprof: "U",
action: 1,
crit: "A creature becomes observed. You know where an object is.",
hit: "An undetected creature becomes hidden, a hidden creature becomes observed. You get a clue as to where an object is.",
miss: "Nil.",
fumble: "Nil.",
}, {
name: "Sense Motive",
tags: ["Concentrate", "Secret"],
skill: "perception",
dc: "Target Deception DC.",
reqprof: "U",
action: 1,
crit: "You know the creature's true intentions, and if magic is affecting it.",
hit: "You know if the creature is behaving normally or not.",
miss: "You believe they're behaving normally and not being deceptive.",
fumble: "You get the wrong idea about their intentions."
}, {
name: "Goblin Song",
tags: ["Goblin"],
skill: "performance",
dc: "Target Will DC.",
reqprof: "U",
action: 1,
crit: "Target takes -1s to Perception and Will saves for 1 minute.",
hit: "Target takes -1s to Perception and Will saves for 1 round.",
miss: "Nil.",
fumble: "Target is immune to Goblin Song for 1 hour."
}, {
name: "Awesome Blow",
tags: ["Barbarian", "Concentrate", "Rage"],
skill: "athletics",
dc: "Target Fortitude DC.",
reqprof: "U",
action: 0,
crit: "Push target <=10' away, they fall prone and take [[1d6]] bludgeoning. You can Stride after them.",
hit: "Push target <=5' away, they fall prone. You can Stride after them.",
miss: "You perform a normal Knockback.",
fumble: "As failure."
}, {
name: "Whirling Throw",
tags: ["Monk"],
skill: "athletics",
dc: "Target Fortitude DC, modified by size.",
reqprof: "U",
action: 1,
crit: "Throw the creature <=(10+Strength*5)' and it lands prone.",
hit: "Throw the creature <=(10+Strength*5)'.",
miss: "Nil.",
fumble: "The creature is no longer grabbed or restrained by you."
}, {
name: "Battle Assessment",
tags: ["Rogue", "Secret"],
skill: "perception",
dc: "Enemy Deception or Stealth DC.",
reqprof: "U",
action: 1,
crit: "Learn two things (GM's choice): highest enemy weakness, worst enemy save, best enemy resistance, one immunity.",
hit: "Learn one thing from the list above.",
miss: "Nil.",
fumble: "Learn false information about a topic from the list."
}, {
name: "Sabotage",
tags: ["Incapacitation", "Rogue"],
skill: "thievery",
dc: "Target's Reflex DC.",
reqprof: "U",
action: 1,
crit: "Deal 4 times your Thievery proficiency bonus in damage.",
hit: "Deal 2 times your Thievery proficiency bonus in damage.",
miss: "Nil.",
fumble: "The target is immune to your Sabotage for 1 day."
}, {
name: "Delay Trap",
tags: ["Rogue"],
skill: "thievery",
dc: "The trap's Disable DC plus 5.",
reqprof: "U",
action: 0,
crit: "Choose: Prevent the trap from being triggered, or delay it until the start/end of your next turn.",
hit: "As above, but the GM chooses whichever is worse. They cannot choose the start of your turn.",
miss: "Nil.",
fumble: "You're flat footed until the start of your next turn."
}, {
name: "Recognize Spell",
tags: ["General", "Skill", "Secret"],
skill: "",
reqprof: "T",
action: 0,
crit: "Recognize the spell and get +1 save or AC against it.",
hit: "Recognize the spell.",
miss: "Nil.",
fumble: "Recognize the spell as something else."
}, {
name: "Scare To Death",
tags: ["Death", "Emotion", "Fear", "General", "Incapacitation", "Skill"],
skill: "intimidation",
dc: "Enemy Will DC.",
reqprof: "L",
action: 1,
crit: "Target must Fortitude save vs your Intimidation DC or die. On non-crit they are frightened 2 and fleeing 1.",
hit: "Target is Frightened 2.",
miss: "Target is Frightened 1,",
fumble: "Nil."
}, {
name: "Identify Creature (Recall Knowledge)",
tags: ["Concentrate","Secret"],
dc: "Per creature level, +2/+5/+10 for uncommon/rare/unique.",
skill: "",
reqprof: "U",
crit: "As success, plus you learn something subtler.",
hit: "You learn one of the creature's best-known attributes.",
miss: "Nil.",
fumble: "You misidentify the creature."
}, {
name: "Train Animal",
tags: ["Downtime","General","Manipulate","Skill"],
dc: "Per creature level, adjusted for attitude.",
skill: "nature",
reqprof: "T",
crit: "As success.",
hit: "Animal learns the action, or upgrades it to not need a roll.",
miss: "Nil.",
fumble: "As failure."
}, {
name: "Trick Magic Item",
tags: ["General","Manipulate","Skill"],
dc: "Per item level.",
skill: "",
reqprof: "T",
action: 1,
crit: "As success.",
hit: "You can use the item until the end of this turn.",
miss: "You can't use the item or trick it again this turn.",
fumble: "You can't use the item or trick it again today."
}, {
name: "AA Befriend a Local",
tags: ["Concentrate","Downtime","Linguistic"],
dc: "20.",
skill: "",
reqprof: "U",
crit: "-10% discount or +1 Diplomacy in Breachill, permanently.",
hit: "Benefits above for weeks equal to your Charisma.",
miss: "Nil.",
fumble: "You lose all benefits and take +5 DC to befriendthis NPC."
}, {
name: "AA Administer Altaerein",
tags: ["Concentrate","Downtime","Linguistic","Mental"],
skill: "society",
dc: "20.",
reqprof: "U",
crit: "Citadel runs for a month and +2c to Organize Labor that month.",
hit: "Citadel runs for a month.",
miss: "-4c to all downtime actions at Altaerin. Can try again tomorrow.",
fumble: "As failure, but can only try again next week."
}, {
name: "AA Organize Labor",
tags: ["Concentrate","Downtime","Linguistic","Mental"],
skill: "",
dc: "13 for regular workers, 18 for specialists.",
reqprof: "U",
crit: "Workers work for the full duration at 0.5 or 2.5 gp per day.",
hit: "Workers work for the full duration at 1 or 5 gp per day.",
miss: "Workers work for one day. If you didn't use Diplomacy, -1c to future labor checks.",
fumble: "Nobody works. If you didn't use Diplomacy, you can't use that skill to organize any more."
}, {
name: "EC Promote the Circus",
tags: ["Circus","Downtime"],
skill: "society",
dc: "Per party level.",
reqprof: "U",
crit: "Gain (2*level)+Cha modifier Anticipation.",
hit: "Gain level+Cha modifier Anticipation.",
miss: "Gain 1 Anticipation.",
fumble: "Nil."
}, {
name: "EC Perform a Trick",
tags: ["Circus","Variable"],
skill: "",
dc: "Per party level.",
reqprof: "U",
crit: "Gain (trick level) Excitement and (Trick level/2) Anticipation.",
hit: "Gain (trick level) Excitement.",
miss: "Nil.",
fumble: "Lose (trick level/2) Excitement."
}, {
name: "Aid",
tags: [],
skill: "",
dc: "Usually 20.",
reqprof: "U",
crit: "Give your ally +2c, or +3c/+4c if master/legend.",
hit: "Give your ally +1c.",
miss: "Nil.",
fumble: "Give your ally -1c."
}, {
name: "Battle Prayer",
tags: ["Divine","General","Skill"],
skill: "religion",
reqprof: "M",
action: 1,
dc: "Enemy Will DC.",
crit: "Deal [[2d6]] damage, or [[6d6]] if legendary. Enemy immune 1 day.",
hit: "Deal [[1d6]] damage, or [[3d6]] if legendary. Enemy immune 1 day.",
miss: "Enemy immune 1 day.",
fumble: "You can't reuse for 10 minutes. Enemy immune 1 day."
}, {
name: "Evangelize",
tags: ["Auditory","General","Linguistic","Mental","Skill"],
skill: "diplomacy",
reqprof: "M",
action: 1,
dc: "Enemy Will DC.",
crit: "Target agrees with you or is stupefied 2 for 1 round. Target immune 1 day.",
hit: "Target agrees with you or stupefied 1 for 1 round. Target immune 1 day.",
miss: "Target unaffected.",
fumble: "As Failure."
}, {
name: "Sacred Defense",
tags: ["Divine","General","Skill"],
skill: "religion",
reqprof: "M",
action: 1,
dc: "30, or 40 for bonus if Legendary.",
crit: "Gain +10thp for 1 min, or 25thp with bonus.",
hit: "Gain +5thp for 1 min, or 15thp with bonus.",
miss: "Nil.",
fumble: "Cannot call your deity for 1 day."
}, { // AoA5
name: "AA Build Connections",
tags: ["Downtime"],
skill: "",
reqprof: "U",
dc: "36.",
crit: "+1c to related downtime actions for 1 month, and earn a favor.",
hit: "+1c to related downtime actions for 1 week.",
miss: "Nil.",
fumble: "-1 to related downtime actions for 3 days."
}, {
name: "AA Host Event",
tags: ["Downtime"],
skill: "",
reqprof: "U",
dc: "36. +1c per extra 250gp spent.",
crit: "All PCs +2c to related downtime actions for 3 days, and two guilds -1sp.",
hit: "All PCs +1c to related downtime actions for 1 day, and one guild -1sp.",
miss: "Nil.",
fumble: "All PCs -2c to related downtime actions for 1 day."
}, {
name: "AA Influence Guild",
tags: ["Downtime"],
skill: "",
reqprof: "U",
dc: "34.",
crit: "-3sp that guild.",
hit: "-1sp that guild.",
miss: "Nil.",
fumble: "+1sp that guild."
}, {
name: "AA Issue Challenge",
tags: ["Downtime"],
skill: "",
reqprof: "U",
dc: "36.",
crit: "Bshez Shak accepts your challenge.",
hit: "+1c to issue challenges for 7 days, stacking to +4.",
miss: "Nil.",
fumble: "You lose bonuses from previous challenges and can't challenge again for a day."
}, { // AoA3
name: "AA Topple Crates",
tags: ["Manipulate"],
skill: "athletics",
reqprof: "U",
dc: "22.",
crit: "As success.",
hit: "Crates fall in 15' line as difficult terrain dealing 3d10+6 B with basic Reflex 26, prone on fumble.",
miss: "Nil.",
fumble: "The hit affect applies to you and your square."
}, { // AoA4
name: "AA Deduce Traditions",
tags: ["Concentrate", "Linguistic", "Secret"],
skill: "",
reqprof: "U",
dc: "30 Perception or 25 Society.",
crit: "You learn a guild's favored skill and the regent's Skepticism.",
hit: "You learn a guild's favored skill.",
miss: "Nil.",
fumble: "You learn a wrong favored skill.",
}, {
name: "AA Influence Regent",
tags: ["Auditory", "Concentrate", "Linguistic", "Mental", "Secret"],
skill: "",
reqprof: "U",
dc: "32 Diplomacy/Lore or 28 favored skill.",
crit: "-2 Skepticism.",
hit: "-1 Skepticism.",
miss: "Nil.",
fumble: "+1 Skepticism."
}, {
name: "AA Check The Walls",
tags: ["Exploration", "Secret"],
skill: "",
reqprof: "U",
dc: "32 Arcana or 27 Crafting.",
crit: "The PC finds the source of irregularities in the runes.",
hit: "The PC finds irregularities in the runes.",
miss: "The PC finds only basic information but can try again.",
fumble: "The PC finds an apparent but incorrect flaw."
}, {
name: "AA Guild Investigation",
tags: ["Concentrate", "Exploration", "Secret"],
skill: "",
reqprof: "U",
dc: "30.",
crit: "As success, plus the PC finds compelling evidence.",
hit: "The PC finds the culprit and his location.",
miss: "The culprit knows the PCs are looking for him.",
fumble: "The culprit flees to his allies."
}, {
name: "AA Seek the Hidden Forge",
tags: ["Downtime", "Secret"],
skill: "",
reqprof: "U",
dc: "36, -2 per Forge clue beyond the first.",
crit: "The PC finds the entrance to the Forge.",
hit: "+4c to the next check to seek the Forge.",
miss: "Nil.",
fumble: "The defenders of the Forge learn the PCs seek them."
}, { // AoA6
name: "AA Distract Guards",
tags: ["Exploration", "Manipulate", "Move"],
skill: "",
reqprof: "U",
dc: "41.",
crit: "The guards are distracted for 1 hour.",
hit: "The guards are distracted for 20 minutes.",
miss: "-2u to any attempt to distract these guards for 10 minutes.",
fumble: "The guards escort you out, or on the third time, arrest you."
}, {
name: "AA Investigate Chamber",
tags: ["Exploration", "Manipulate", "Move"],
skill: "perception",
reqprof: "U",
dc: "36.",
crit: "You learn secret information about the room.",
hit: "You learn basic information about the room.",
miss: "You learn obvious information about the room.",
fumble: "As failure, plus guards escort you out."
}, {
name: "AA Convince Mengkare",
tags: ["Auditory", "Concentrate", "Linguistic", "Mental"],
skill: "",
reqprof: "U",
dc: "Varies, see pages 46-47.",
crit: "+2 Doubt.",
hit: "+1 Doubt.",
miss: "Nil.",
fumble: "-1 Doubt."
}
];
/** @type {!Array<string>} */
const st_names = ["","strength","dexterity","constitution","intelligence","wisdom","charisma"];
/** @type {!Array<number>} */
let level_dcs = [14, 15, 16, 18, 19, 20, 22, 23, 24, 26, 27, 28, 30, 31, 32, 34, 35, 36, 38, 39, 40, 42, 44, 46, 48, 50, 99999];
/** @type {!Array<{
* cmd: string,
* params: !Array<{name: string}>,
* do: function(!Object, !Array<!Roll20Object>, !Array<string>, boolean):string
* }>} */
let commands = [
{cmd: "ability", params: [{ name: "ability"}, {name: "skillchoice", optional: true}],
do: ((p,t,r,a) => doAbility(p.ability, p.skillchoice, t, r))},
{cmd: "get", params: [{ name: "property"}],
do: ((p,t,r,a) => getProperty(p.property,t, r))},
{cmd: "best", params: [{ name: "property"}],
do: ((p,t,r,a) => bestProperty(p.property,t, r))},
{cmd: "roll", params: [{ name: "property"}],
do: ((p,t,r,a) => rollProperty(p.property,t,false,false, r))},
{cmd: "rollinit", params: [{ name: "property", default: "perception"}], activeOption: true,