-
-
Notifications
You must be signed in to change notification settings - Fork 354
/
Copy path_common attributes.js
2714 lines (2233 loc) · 130 KB
/
_common attributes.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
/* -WHAT IS THIS?-
The script featured here is an explanation of how to make your own custom addition to MPMB's D&D 5e Character Tools.
To add your own content to the Character Sheet, use the syntax below and save it in a file.
You can then import this file directly to the sheet using the "Import" button and "Import/Export" bookmark.
There you can either import the file as a whole or just copy the text into a dialog.
-KEEP IN MIND-
Note that you can add as many custom codes as you want, either by importing consecutive files or pasting the scripts into the dialog.
It is recommended to enter the code in a freshly downloaded sheet or to first reset sheet.
Thus you don't run the risk of things that have already been filled out causing conflicts.
-HOW TO READ-
Every line comes with a comment immediately after it to show whether it is // Optional // or // Required //,
followed by a more explanatory comment
-THIS IS JAVASCRIPT-
The imports scripts work by creating a new entry inside an existing object or by calling functions.
You can create new or overwrite existing global variables by omitting 'var'.
You will need to understand the basics of JavaScript variables: strings, arrays, and JSON objects.
Note that every opening symbol must have its closing counterpart: (), {}, [], "", ''.
If these are not present, the code will give an error when imported.
Use proper editing software for code (like Notepad++). Text processors like Microsoft Word will screw up your code.
To help finding syntax errors, use (online) code checking software like https://jshint.com
-COMMENTS IN THE EXAMPLE-
Anything on a line after two forward slashes is a comment and will be ignored when running the code.
Multiline comments are possible. Open them using the forward slash followed by an asterisk and close them with the opposite.
The below contains a lot of these comments. The comments are not necessary for the script to work, so feel free to remove them.
*/
/* -INFORMATION-
Subject: Common attributes
Effect: This is the syntax for common attributes that are shared by multiple things.
The syntax here does not stand on its own.
You will need another syntax file to use alongside this file.
Use one of the syntax files not starting with an underscore and use this file when referred to.
Works with: Class features (and subclass features)
Class feature choices (and subclass feature choices)
Class feature extrachoices (and subclass feature extrachoices)
Race main attributes
Race features
Background main attributes
Background Features main attributes
Feat main attributes
Feat choices
Magic Item main attributes
Magic Item choices
Sheet: v13.1.1 and newer
*/
"example feature name" = { // you can ignore this, it is just here to make this file valid JavaScript
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //
// >>> Actions & Limited Features >>> //
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //
action : [
["reaction", " (start)"],
["bonus action", "Shove"]
],
/* action // OPTIONAL //
TYPE: array (variable length)
USE: add entry to the "Actions", "Bonus Actions", or "Reactions" section on the 1st page
The entries in this array must always be arrays with 2 strings each:
1. The first string in each sub-array is the type of action, written in lowercase.
The options are "action", "bonus action", or "reaction".
2. The second string can be one of two things:
2.1 When the first character of the string is non-alphabetic (e.g. a space or a hyphen), it is amended to the name of the feature.
This amended total is then added as an action.
If you are also using the 'limfeaname' attribute, that string will be used instead of the feature's name.
So this entry will be added to 'limfeaname' string.
2.2 When the first character of the string is an alphabetic character (e.g. everything from a-Z), it is not amended to the name of the feature.
The string is taken as-is and added as an action.
*/
usages : 1,
usages : "Charisma modifier per ",
usages : [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2],
/* usages // OPTIONAL //
TYPE: number, string, or array with 20 entries
USE: value to add in the "Usages" column in the "Limited Features" section
This will only add an entry to "Limited Features" section, if 'recovery' is also present in the same feature.
This attribute can have three type of values:
1. Number
For class features, this value is used to write the text in the "Class Features" section.
A number will be followed by a multiplication sign and 'per', followed by the recovery method.
For example-
usages : 3,
recovery : "long rest",
Will result in-
"3× per long rest"
2. String
Works similar to the 1. Number option, except for class features.
For class features the string is used in the "Class Features" section without changes.
For example-
usages : "Charisma modifier per ",
recovery : "short rest",
Will result in-
"Charisma modifier per short rest"
3. Array
An array signals that the usages vary depending on level.
Each entry is a level, so you will most likely want to add 20 entries.
Each entry can be a number or string, see option 1. Number and 2. String for how those work.
IMPORTANT! Set the value to 0 for levels that the feature is not present.
*/
recovery : "short rest",
recovery : ["", "", "long rest", "long rest", "short rest", "short rest", "short rest", "short rest", "short rest", "short rest", "short rest", "short rest", "short rest", "short rest", "short rest", "short rest", "short rest", "short rest", "short rest", "short rest"],
/* recovery // OPTIONAL //
TYPE: string, or array with 20 strings
USE: value to add in the "Recovery" column in the "Limited Features" section
This will only add an entry to "Limited Features" section, if 'usages' is also present in the same feature.
This attribute can have two type of values:
1. String
For class features, this value is used to write the text in the "Class Features" section.
It will be combined with the 'usages' attribute to create a string of how the class feature works.
For example-
usages : 3,
recovery : "long rest",
Will result in-
"3× per long rest"
2. Array
An array signals that the recovery method varies depending on level.
Each entry is a level, so you will most likely want to add 20 entries.
Each entry has to be a string, see option 1. String for how those work.
IMPORTANT! Set the value to "" for levels that the feature is not present.
Common values are:
"short rest"
"long rest"
"dawn"
"day"
*/
altResource : "SS 5+",
altResource : ["", "", "SS 2+", "SS 2+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+", "SS 1+"],
/* altResource // OPTIONAL //
TYPE: string, or array with 20 strings
USE: value to add in the "Recovery" column in the "Limited Features" section in addition to the 'recovery' attribute
This is useful if the feature offers another way to be used,
in addition to a number of times per time period (e.g. per short rest).
For example, a feature might also be usable by expending spell slots.
This attribute will do nothing if the 'recovery' attribute is not also present.
This attribute can have two type of values:
1. String
For class features, this value is used to write the text in the "Class Features" section.
It will be combined with the 'usages' and 'recovery' attributes to create a string of how the class feature works.
For example-
usages : 1,
recovery : "long rest",
altResource : "SS 5+",
Will result in-
"1× per long rest or SS 5+"
2. Array
An array signals that the altResource method varies depending on level.
Each entry is a level, so you will most likely want to add 20 entries.
Each entry has to be a string, see option 1. String for how those work.
IMPORTANT! Set the value to "" for levels that the feature is not present.
Common values are:
"SS 3+" // spell slot of 3rd level or higher
"3 Ki" // 3 ki points
"5 SP" // 3 sorcery points
*/
usagescalc : "event.value = Math.max(1, What('Wis Mod'));",
usagescalc : ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "event.value = What('Wis Mod') + 5;", "event.value = What('Wis Mod') + 5;", "event.value = What('Wis Mod') + 5;", "event.value = What('Wis Mod') + 6;", "event.value = What('Wis Mod') + 6;", "event.value = What('Wis Mod') + 6;"],
/* usagescalc // OPTIONAL //
TYPE: string, or array with 20 strings
USE: this string is set as the field calculation method for the "Usages" field in the "Limited Features" section
This attribute can have two type of values:
1. String
The string is evaluated as JavaScript code whenever anything changes on the sheet.
To change the value of the field, you will have to set the 'event.value' to something.
The example above sets the field to the Wisdom Modifier, or 1, whichever is higher.
2. Array
An array signals that the usages calculation method varies depending on level.
Each entry is a level, so you will most likely want to add 20 entries.
Each entry has to be a string, see option 1. String for how those work.
IMPORTANT! Set the value to "" for levels that the feature is not present.
This attribute will do nothing if not both the 'usages' and 'recovery' attributes are present in the same feature.
*/
limfeaname : "Hellish Rebuke (3d10)",
/* limfeaname // OPTIONAL //
TYPE: string
USE: value to add in the "Name" column in the "Limited Features" section instead of the feature's name
Use this attribute only if you do not want to use the feature`s name in the "Limited Features" section.
If this attribute is present and the `action` attribute is also present,
the `limfeaname` attribute will be used instead of the feature`s name for actions.
This attribute will do nothing if not both the `usages` and `recovery` attributes or the `action` attribute
are present in the same feature.
*/
limfeaAddToExisting : true,
/* limfeaAddToExisting // OPTIONAL //
TYPE: boolean
USE: set to `true` to have the number set for `usages` be added to an existing limited feature by the same name, instead of overwriting it
ADDED: v13.0.6
Normally, if a limited feature is added while one with the same name already exists,
the usages of the newer limited feature is used, overwriting what was there before.
When you set this to true, the number of usages will be added together instead.
This attribute will do nothing if not both the `usages` and `recovery` attributes
are present in the same feature.
Nor will it do anything if there is no limited feature present by the same name when this feature is called.
Setting this attribute to false is the same as not including it.
*/
additional : "10% chance",
additional : ["", "d6", "d6", "d6", "d6", "d6", "d6", "d6", "d8", "d8", "d8", "d8", "d10", "d10", "d10", "d10", "d12", "d12", "d12", "d12"],
/* additional // OPTIONAL //
TYPE: string, or array with 20 strings
USE: value to add in brackets to the name in the "Limited Features" section
This attribute will do nothing if not a class feature and neither the 'usages' or 'recovery' attribute is present in the same feature.
This attribute can have two type of values:
1. String
This will be added in brackets to the name when adding something to the "Limited Features" section.
For example, if the name of the feature is "featureName", and the 'additional' is "10% chance", it would be-
"featureName (10% chance)"
For class features, this value is used to write the text in the "Class Features" section.
It will be combined with the 'usages' and 'recovery' attributes to create a string of how the class feature works.
For example-
usages : 3,
recovery : "long rest",
additional : "10% chance",
Will result in-
"10% chance; 3× per long rest"
2. Array
An array signals that the recovery method varies depending on level.
Each entry is a level, so you will most likely want to add 20 entries.
Each entry has to be a string, see option 1. String for how those work.
IMPORTANT! Set the value to "" for levels that the feature is not present.
*/
extraLimitedFeatures : [{
name : "Another Limited Feature", // REQUIRED //
usages : 8, // REQUIRED //
recovery : "long rest", // REQUIRED //
usagescalc : "event.value = Math.max(1, What('Cha Mod'));", // OPTIONAL //
additional : "2d8", // OPTIONAL //
altResource : "SS 5+", // OPTIONAL //
addToExisting : true // OPTIONAL // ADDED v13.0.6
}],
/* extraLimitedFeatures // OPTIONAL //
TYPE: array of objects (variable length)
USE: entries to add to the "Limited Features" section which are not level-dependent
Use this attribute only if you have more than one limited feature to add and you already
used the default usages/recovery method described above.
Each object has to contain at least the `name`, `usages`, and `recovery` attributes.
The `usagescalc`, `additional`, `altResource`, and `addToExisting` attributes are optional.
For an explanation of how the different attributes work, see the attributes by the same names above,
except for the following, which have a different name above:
ATTRIBUTE NAME SEE NAME IN MAIN FEATURE
name limfeaname
addToExisting limfeaAddToExisting
The only exception is that attributes in this object can never be an array,
they are always level-independent.
The 'name' attribute can only be a string.
*/
// >>>>>>>>>>>>>>>>>>>>> //
// >>> Proficiencies >>> //
// >>>>>>>>>>>>>>>>>>>>> //
toolProfs : [
"Herbalism kit",
["Thieves' tools", "Dex"],
["Musical instrument", 3]
],
/* toolProfs // OPTIONAL //
TYPE: array (variable length)
USE: add tool proficiencies
This array can have three type of entries:
1. A string, the name of the tool proficiency to add (i.e. no choice).
2. An array with 2 strings:
2.1 The first string is the name of the tool proficiency to add (i.e. no choice).
2.2 The second string is the abbreviation of the ability score the tool proficiency works with.
Only add this if you want the tool to appear in the skill section on the 1st page.
3. An array with a string and a number:
3.1 The first entry is a string, a description of the type of tool proficiency that can be chosen.
3.2 The second entry is a number, representing how many times this type of tool proficiency is to be added.
*/
languageProfs : [
"Common",
2,
["Elvish or Vedalken", 1]
],
/* languageProfs // OPTIONAL //
TYPE: array (variable length)
USE: add language proficiencies
This array can have three type of entries:
1. A string, the name of the language proficiency to add (i.e. no choice).
2. A number, how many language proficiency are to be added with each a free choice for which language.
3. An array with a string and a number:
3.1 The first entry is a string, a description of the type of language proficiency that can be chosen.
3.2 The second entry is a number, representing how many this type of language proficiency is to be added.
*/
saves : ["Str", "Dex", "Con", "Int", "Wis", "Cha", "HoS"],
/* saves // OPTIONAL //
TYPE: array (variable length)
USE: set saving throw proficiencies on the 1st page
This is an array of strings.
Each entry gives proficiency with the saving throw of a certain ability score.
Only use the strings shown in the example, the 3-letter abbreviation with the first letter capitalized (or "HoS" for Honour/Sanity).
*/
skills : [
"Acrobatics",
["Deception", "full"],
["History", "only"],
["Religion", "increment"]
],
/* skills // OPTIONAL //
TYPE: array (variable length)
USE: add skill proficiency and expertise on the 1st page
This array can have two type of entries:
1. A string, the name of the skill proficiency to add (i.e. no expertise).
2. An array with two strings, only needed if you want to add expertise as well:
2.1 The first entry is a string, the name of the skill proficiency.
2.2 The second entry is a string, a command what to do with expertise for the skill.
This can be one of three options:
a) "full" // Add both proficiency and expertise
b) "only" // Add expertise, but only if already proficient with the skill
c) "increment" // Add proficiency if not yet proficient, or add expertise if already proficient with the skill
The array will also be used to generate a textual description of the improvement for the dialog and tooltips,
but only if the attribute 'skillstxt' is not present in the same feature, see below.
*/
skillstxt : "Choose two from Animal Handling, Athletics, Intimidation, Nature, Perception, and Survival",
/* skillstxt // OPTIONAL //
TYPE: string
USE: description of skill proficiencies and skill proficiency choices gained, to use in the tooltips of skills
You do not need this attribute if their is no choice for the skill proficiencies gained,
then you can just use the 'skills' attribute, see above.
You can have both this and the 'skills' attribute, they are not mutually exclusive.
*/
armorProfs : [true, true, false, true],
/* armorProfs // OPTIONAL //
TYPE: array with four entries
USE: adds armour and shield proficiencies
This array must have exactly four entries, all of which are booleans.
These are to add proficiencies in:
["light armour", "medium armour", "heavy armour", "shields"]
Note that a proficiency will only be set if the value is 'true'.
If you set it to 'false' it will do nothing, the proficiency will not be removed.
*/
weaponProfs : [
/* weaponProfs // OPTIONAL //
TYPE: array with two or three entries
USE: adds weapon proficiencies
*/
true,
/* weaponProfs 1st entry // REQUIRED //
TYPE: boolean
USE: add simple weapon proficiency
Set this to true to add proficiency with simple weapons or
set this to false to not add proficiency with simple weapons.
Note that the weaponProfs array requires this entry!
*/
false,
/* weaponProfs 2nd entry // REQUIRED //
TYPE: boolean
USE: add martial weapon proficiency
Set this to true to add proficiency with martial weapons or
set this to false to not add proficiency with martial weapons.
Note that the weaponProfs array requires this entry!
*/
["dagger", "longsword", "firearm", "Improvised Weapons"]
/* weaponProfs 3rd entry // OPTIONAL //
TYPE: array (variable length)
USE: add weapon proficiency with the weapons or weapon-types listed
Add the names of weapons as they appear in the WeaponsList object.
Alternatively, you can use a grouping of weapons, as their 'list' attribute says, for example 'firearm'.
Alternatively, you can use types of weapons, as their 'type' attribute says, for example 'Improvised Weapons'.
For example the High Elf weapon proficiency looks like this:
weaponProfs : [false, false, ["longsword", "shortsword", "longbow", "shortbow"]],
If you don't want to add individual weapon proficiencies, you can simply not set this weaponProfs 3rd entry, or set this to `false`, an empty string `""`, or `0`.
*/
],
// >>>>>>>>>>>>>>>>>>>>>>>> //
// >>> Weapons & Armour >>> //
// >>>>>>>>>>>>>>>>>>>>>>>> //
weaponsAdd : ["Bite", "Longsword +2"], // legacy, before v13.1.14
weaponsAdd : {
select : ["Bite", "Rusty Greataxe"],
options : ["Longsword +2", "Rusty Greataxe"]
},
/* weaponsAdd // OPTIONAL //
TYPE: object
USE: add attack(s) to and/or edit the available options in 1st page attack section
CHANGE: v13.1.14 (changed from array to object)
This does not add automation for the added attack selections or options.
If you want to add automation for an attack option, then don't use this attribute,
but use `weaponOptions` (see below). That can also add it to the current selection.
This is an object with two possible attributes, each is optional.
`select`
OPTIONAL
TYPE: array of strings
USE: fill 1st page attack lines with strings
Each string will be added to the attack section.
An entry will only be added if there is space left in the attack section and
it isn't already present.
The string will be added exactly as written, capitalisation and all.
If no selections have to be added to attack sections, then
don't include this attribute.
`options`
OPTIONAL
TYPE: array of strings
USE: add options to 1st page attack drop-down boxes
Each string in the array will be added as an option in the attack drop-down boxes
on the 1st page.
Each will be added at the top of list, along with those added by
`weaponOptions` (see below), and sorted alphabetically.
The strings will be added exactly as written, capitalisation and all.
If no options have to be added to the list in the drop-down box, then
don't include this attribute.
If a feature with this attribute is removed, these attack selections/options
will be removed as well.
>> Backwards compatible <<
Before v13.1.14, this was an array of strings, not an object.
If `weaponsAdd` is an array, it will be treated as if that array was set for the
`select` attribute, thus preserving the functionality from v13.1.13 and earlier.
*/
armorAdd : "Natural Armor", // legacy, before v13.1.14
armorAdd : {
select : "Breastplate +1",
options : ["Glamoured Studded Leather", "Unarmored Defense (Con)"]
},
/* armorAdd // OPTIONAL //
TYPE: object
USE: select armor as current and/or edit the available options in the drop-down
CHANGE: v13.1.14 (changed from string to object)
This does not add automation for the added armour selection or options.
If you want to add automation for an armour option, then don't use this attribute,
but use `armorOptions` (see below). That can also add it to the current selection.
This is an object with two possible attributes, each is optional.
`select`
OPTIONAL
TYPE: string
USE: sets the value for the armour drop-down on the 1st page
The armour will only be set if there is currently no armour selected, or
if the currently selected armour gives a lower AC total than this armour.
The string will be added exactly as you write it here, capitalisation and all.
If nothing has to change about the current armour selection, then
don't include this attribute.
`options`
OPTIONAL
TYPE: array of strings
USE: add options to 1st page armour drop-down box
Each string in the array will be added as an option in the armour drop-down box
on the 1st page.
Each will be added at the top of list, along with those added by
`armorOptions` (see below), and sorted alphabetically.
The strings will be added exactly as written, capitalisation and all.
If no options have to be added to the list in the drop-down box, then
don't include this attribute.
If a feature with this attribute is removed, the selection/options
will be removed as well.
>> Backwards compatible <<
Before v13.1.14, this was a string, not an object.
If `armorAdd` is a string, it will be treated as if that string was set for the
`select` attribute, thus preserving the functionality from v13.1.13 and earlier.
*/
shieldAdd : "Wooden Buckler",
shieldAdd : ["Magical Buckler", 1, 2],
/* shieldAdd // OPTIONAL //
TYPE: string or array with three entries
USE: set the shield on the 1st page as well as its bonus to AC and weight
This attribute can be one of two type of entries:
1) string
This string is put in the 'Shield' description field just like you would manually type in something.
It is then used to calculate the shield's AC bonus (2 + any magic modifiers you include in the string).
For example, 'Shield +2' will give an AC of 4.
The weight of the shield will be set at 6 lb.
2) array
This array must have 3 entries:
2.1 string
This string is set in the 'Shield' description field.
It can contain a magical modifier (i.e. any number following a + or -).
2.2 number
This is used to fill out the AC of the shield, without counting any magical modifiers in its name.
2.3 number
This is used to fill the weight of the shield in lb.
The shield will only be added if the AC bonus is more or equal to that of the current shield.
If a feature with this attribute is removed, this shield will be removed as well.
*/
ammoAdd : [["Green Arrows", 12], ["Smoke Bombs", 5]],
/* ammoAdd // OPTIONAL //
TYPE: array (variable length) of arrays with 2 entries
USE: adds each entry in the array to one of the ammunition drop-downs on the 1st page
ADDED: v13.0.9
This attribute has to be an array of arrays that have one or two entries each:
1) string
The first entry of each sub-array is the literal text that has to be set for the
ammunition drop-down box on the 1st page.
2) number
This sets what should be entered for the "amount" part of the ammunition on the 1st page.
If this entry is omitted, the sheet will set the amount to 1.
An entry will only be added if there is space left in the ammunition section and
it isn't already present.
The strings will be added exactly as you write them here, capitalisation and all.
If a feature with this attribute is removed, these ammunition entries will be removed as well.
*/
ammoOptions : [{ /* AmmoList object, see "ammunition (AmmoList).js" syntax file */ }],
/* ammoOptions // OPTIONAL //
TYPE: array of objects (variable length)
USE: adds each object in the array to the AmmoList variable
The syntax of the objects is not explained here, but in the "ammunition (AmmoList).js" syntax file.
This way you can have a feature add a type of ammunition to the automation.
It will also be added to the options in each ammunition field drop-down.
This will result in having the ammunition only available if the feature is present.
*/
armorOptions : [{ /* ArmourList object, see "armor (ArmourList).js" syntax file */ }],
/* armorOptions // OPTIONAL //
TYPE: array of objects (variable length)
USE: adds each object in the array to the ArmourList variable
CHANGE: v13.1.14 (added `selectNow` attribute)
The syntax of the objects is not explained here, but in the "armor (ArmourList).js" syntax file.
Since v13.1.14, objects in the `armorOptions` array can use the `selectNow` attribute.
This attribute is also explained in the "armor (ArmourList).js" syntax file.
Adding `selectNow : true` will cause the armour to be immediately select on the 1st page,
but only if it grants higher AC than the current selected armour.
It also means that you don't need to include the `armorAdd` attribute as well.
This way you can have a feature add a type of armour to the automation.
It will also be added at the top of options in the armour field drop-down.
This will result in having the armour only available if the feature is present.
*/
weaponOptions : [{ /* WeaponsList object, see "weapon (WeaponsList).js" syntax file */ }],
/* weaponOptions // OPTIONAL //
TYPE: array of objects (variable length)
USE: adds each object in the array to the WeaponsList variable
CHANGE: v13.1.14 (added `selectNow` attribute)
The syntax of the objects is not explained here, but in the "weapon (WeaponsList).js" syntax file.
Since v13.1.14, objects in the `weaponOptions` array can use the `selectNow` attribute.
This attribute is also explained in the "weapon (WeaponsList).js" syntax file.
Adding `selectNow : true` will cause the weapon to be immediately added to the selection
on the 1st page, if there is space to do so.
It also means that you don't need to include the `weaponsAdd` attribute
next to this attribute.
This way you can have a feature add a type of weapon/attack to the automation.
It will also be added at the top of options in each attack field drop-down.
This will result in having the weapon/attack only available if the feature is present.
*/
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //
// >>> Other Fields on the 1st or 2nd Page >>> //
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //
dmgres : [
"Fire",
["Bludgeoning", "Bludgeon. (in rage)"],
["Slashing", "Slash. (nonmagical)"]
],
/* dmgres // OPTIONAL //
TYPE: array (variable length)
USE: add entry to the "Resistances" section on the 1st page
This array can have two type of entries:
1. A string of the damage type that resistance is gained against.
2. An array of 2 strings:
2.1 The first string is the damage type that resistance is gained against.
2.2 The second string also contains the condition that the resistance works with.
If the same resistance is gained from multiple sources,
but one source has a condition and another doesn't,
only the version without a condition is shown.
*/
savetxt : {
/* savetxt // OPTIONAL //
TYPE: object (optional attributes)
USE: add text to the 1st page "Saving Throws" section
("Saving Throws" section for Printer Friendly,
"Saving Throw Advantages/Disadvantages" section for Colourful)
The attributes of this object can be "text", "immune", and "adv_vs"
*/
text : ["Dex save vs. area effects: fail \u2015 half dmg, success \u2015 no dmg", "Magic can't put me to sleep"],
/* text // OPTIONAL //
TYPE: array of strings
USE: add a text to the 1st page
Each string in the array is added to the 1st page, exactly as given here.
*/
immune : ["poison", "disease", "paralyzed (by magic)"],
/* immune // OPTIONAL //
TYPE: array of strings
USE: add strings to the "Immune to" text on the 1st page
CHANGE: v13.1.0 (conditional added)
Each string in the array is added to the list of "Immune to" things in the 1st page "Saving Throws" section.
Immunities from all sources are combined and listed alphabetically.
In this example it would result in "Immune to disease, paralyzed (by magic), and poison".
If a damage resistance is present while immunity for the same is also present,
then the damage resistance will be hidden as long as the immunity is present.
CONDITIONAL (since v13.1.0)
If the string contains something between brackets, then whatever is between those brackets is seen
as "conditional". This means that if another feature adds the same thing without brackets, only the
version without brackets will be shown.
Thus, using the example above, if something else adds "paralyzed", the entry "paralyzed (by magic)"
will be ignored.
*/
adv_vs : ["traps", "charmed", "sleep (by magic)"]
/* adv_vs // OPTIONAL //
TYPE: array of strings
USE: add strings to the "Adv. on saves vs." text on the 1st page
CHANGE: v13.1.0 (conditional added)
Each string in the array is added to the list of "Adv. on saves vs." things in the 1st page "Saving Throws" section.
Saving throw advantages from all sources are combined and listed alphabetically.
In this example it would result in "Adv. on saves vs. charmed, sleep (by magic), and traps".
CONDITIONAL (since v13.1.0)
If the string contains something between brackets, then whatever is between those brackets is seen
as "conditional". This means that if another feature adds the same thing without brackets, only the
version without brackets will be shown.
Thus, using the example above, if something else adds "sleep", the entry "sleep (by magic)"
will be ignored.
*/
},
vision : [
["Darkvision", 60],
["Sunlight Sensitivity", 0],
["Darkvision", "+30"],
["Darkvision", "fixed 60"]
],
/* vision // OPTIONAL //
TYPE: array (variable length)
USE: add string to the "Senses" field on the 1st page
This array can have three type of entries, each of which is its own array with a length of 2
1. An array with a string and a number:
1.1 The first entry is a string, the name of the thing to add to the "Senses" section on the 1st page.
1.2 The second entry is a number, representing the distance in feet that this vision works on.
You can also enter a 0 for something that doesn't have a range (e.g. Keen Smell).
2. An array with two strings:
2.1 The first string is the name of the thing to add to the "Senses" section on the 1st page.
2.2 The second entry is a string consisting of a logical operator ('+', '-', or '*') followed by a number.
This will add the modifier in feet to the vision if present from another source.
If this is a zero, the text will be added without a range, unless another feature has a range set for this.
Alternatively, you can set this to "unlimited" for something that normally has a range, but this feature makes it unlimited.
3. An array with two strings:
3.1 The first string is the name of the thing to add to the "Senses" section on the 1st page.
3.2 The second entry is a string, the word "fixed" followed by a space and then a number.
This will add the vision with the specified range, but won't let it be modified (e.g. gained from a magic item).
*/
speed : {
/* speed // OPTIONAL //
TYPE: object (optional attributes)
USE: add or edit speed mode(s) to the 1st page
The attributes of this object can be "walk", "burrow", "climb", "fly", "swim", and "allModes"
*/
walk : { spd : 30, enc : 20 },
burrow : { spd : 15, enc : 15 },
/* walk, burrow, climb, fly, or swim // OPTIONAL //
TYPE: object with two attributes, "spd" and "enc".
USE: add movement mode of the object's name
"spd" is the speed in feet
"enc" is the encumbered speed in feet
Note that both "spd" and "enc" have to be present.
If "spd" or "enc" is set to zero it is ignored (i.e. "enc : 0" means no encumbered speed).
Both "spd" and "enc" can also be a string to perform special functions:
1. "walk": If the entry is "walk" the number will be identical to the walking speed.
2. "_walk": Using an underscore as the first character means
the value is only added if the value would otherwise be non-zero.
3. "+30" "-20": If the string starts with a "+", "-", "*", or "/" followed by a number,
this will add, subtract, multiply, or divide the movement mode with the given number, if present from another source.
4. "fixed 60": If the string starts with "fixed" followed by a space and then a number,
it will gain a speed of the number in feet, regardless of modifiers from other features.
*/
// example of using "walk":
fly : { spd : "walk", enc : 0 },
// example of using a modifier:
climb : { spd : "+50", enc : 0 },
// example of using "fixed":
swim : { spd : "fixed 60", enc : "fixed 60" },
allModes : "+10",
/* allModes // OPTIONAL //
TYPE: string
USE: add a modifier to all movement modes, if present
The 'allModes' attribute can only consist of a modifier-string.
It has to be a logical operator ("+", "-", "*", or "/") followed by a number.
Every movement mode of the character, both normal and encumbered, will be subjected to the modifier in feet.
This will only work on movement modes that are non-zero.
It won't give the character a burrow speed if it would otherwise have none, for example.
*/
},
carryingCapacity : 2,
/* carryingCapacity // OPTIONAL //
TYPE: whole number
USE: multiply the carrying capacity (encumbrance) with this number
This number is used to multiple the carrying capacity multiplier with.
You can find the carrying capacity multiplier in the 'mods' field in the Equipment section on the second page.
The number in that field is used to multiply the carrying capacity (encumbrance) with.
By default it is "1".
The carrying capacity multiplier field can only be a positive number (0 or more), thus
if this attribute would bring it below 0, it is set to 0.
The carrying capacity multiplier will always be rounded to the closest multiple of 0.25.
*/
advantages : [
["Initiative", true],
["Stealth", false],
["Wisdom", true]
],
/* advantages // OPTIONAL //
TYPE: array (variable length) with array (length 2)
USE: set advantage on an ability check, saving throw, or attacks
This array can have any number of entries, each of which must be an array of its own with 2 entries:
1. The first entry of each enclosed array is a string
This tells the sheet where to apply the (dis)advantage: ability check, saving throw, or attack.
For skills, use the full name of the skill, or its 4-letter abbreviation (e.g. "Perc" for Perception).
For saving throws, use the full name of the ability, or its 3-letter abbreviation.
For initiative, use "Initiative", or "Init".
For attacks, use "Attack", or "Att".
2. The second entry of each enclosed array is a boolean
Set this to 'true' if you want to give advantage.
Set this to 'false' if you want to give disadvantage.
The Colourful sheets have checkboxes on the first page for both advantage and disadvantage for all
skills, saving throws, initiative, and attacks.
Using this attribute, you can set those checkboxes.
The sheet will automatically determine if advantage, disadvantage, or neither should be checked (as they cancel each other out).
Other effects from advantage/disadvantage are also taken into consideration,
such as 5 being added to Passive Perception when the character has advantage on Perception checks.
Although the Printer Friendly sheets don't have checkboxes for advantage/disadvantage,
this attribute will still be taken into consideration for (dis)advantage on Stealth, and its effect on Passive Perception.
*/
// >>>>>>>>>>>>>>>>>>>>>> //
// >>> Ability Scores >>> //
// >>>>>>>>>>>>>>>>>>>>>> //
scores : [0, 1, 0, 0, 2, 0],
/* scores // OPTIONAL //
TYPE: array of six numbers
USE: add ability score improvements to the Ability Scores dialog
This array requires exactly six entries, each being a number.
The entries are: [Str, Dex, Con, Int, Wis, Cha].
You should put a 0 for an ability score that gets no improvement.
You can use negative numbers.
Where exactly the numbers will be added in the Ability Scores dialog depends on the parent feature.
The array will also be used to generate a textual description of the improvement for the dialog
and tooltips, but only if the attribute 'scorestxt' is not present in the same feature, see below.
Note that if a feature gives you a choice in which ability score to improve,
you should put that information in the 'scorestxt' attribute and not include the improvement here.
*/
scorestxt : "+2 Charisma and +1 to two other ability scores of my choice",
/* scores // OPTIONAL //
TYPE: string
USE: description of ability score improvements to use in the Ability Scores dialog and tooltips
You do not need this attribute if the ability score improvement does not offer a choice,
then you can just use the 'scores' attribute, see above.
You can have both this and the 'scores' attribute, they are not mutually exclusive.
*/
scoresOverride : [0, 0, 0, 19, 0, 0],
/* scores // OPTIONAL //
TYPE: array of six numbers
USE: add ability score overrides to the Ability Scores dialog
This array requires exactly six entries, each being a number.
The entries are: [Str, Dex, Con, Int, Wis, Cha].
You should put a 0 for an ability score that gets no override.
An override will be used for the ability score if it would otherwise be less.
The array will also be used to generate a textual description of the improvement for the dialog and tooltips,
but only if the attribute 'scorestxt' is not present in the same feature.
*/
scoresMaximum : [24, 0, 24, 0, "+2", 0],
/* scores // OPTIONAL //
TYPE: array of six numbers or strings
USE: change ability score maximum in the Ability Scores dialog
CHANGE: v13.0.8 (allow modifiers "+2" as well as fixed numbers)
By default, the ability score increases can never increase an ability score above 20.
Using this attribute, you can change that maximum.
Note that the maximum has no effect on something set by the 'scoresOverride' attribute.
This array requires exactly six entries, each being a number.
The entries are: [Str, Dex, Con, Int, Wis, Cha].
You should put a 0 for an ability score that gets no change in maximum.
You can enter a lower maximum (1-19), the default of 20 will only be used if nothing sets a maximum.
If multiple things change the maximum, the highest of those will be used.
Alternatively, you can enter a string that reads as a mathematical modifier that adds "+X" or
subtracts "-Y". For example, you could set it to "+2" to increase the maximum by 2.
These modifiers will be applied to the highest maximum for the score set by other features, or 20,
if no other features set a maximum. (e.g. the "+2" will result in a maximum of 22).
If the maximum has a requirement, because the feature only increases the maximum if the total
goes over 20, then take a look at the `scoresMaxLimited` attribute below.
The array will also be used to generate a textual description of the improvement for the dialog
and tooltips, but only if the attribute 'scorestxt' is not present in the same feature.
*/
scoresMaxLimited : true,
/* scores // OPTIONAL //
TYPE: boolean
USE: wether to apply the ability score maximum increase only if that maximum is reached (true) or always (false)
ADDED: v13.0.8
By default, the ability score increases can never increase an ability score above 20.
Using the `scoresMaximum` attribute above, you can change that maximum to a higher value.
However, some features only allow the maximum to increase if the new total reaches that maximum.
This attribute only works if the same object also includes both the `scores` and the `scoresMaximum`
attributes.
For example, a magic item might read: "Your Constitution score increases by 2, up to a maximum of 22."
Thus, if the score is currently 18, it is increased to 20, but its maximum should stay 20.
If the feature is worded like that, set this attribute to true and set `scores` and `scoresMaximum`
attributes to the respective bonuses. The result will then look like this:
scores : [0, 0, 2, 0, 0, 0],
scoresMaximum : [0, 0, 22, 0, 0, 0],
scoresMaxLimited : true
// IMPORTANT //
When setting this attribute to `true`, the `scoresMaximum` can't have modifiers (e.g. "+2"), but can
only exists of numbers.
Setting this attribute to false is the same as not including this attribute.
*/
// >>>>>>>>>>>>>>>>>>>> //
// >>> Spellcasting >>> //
// >>>>>>>>>>>>>>>>>>>> //
spellcastingBonus : [{
/* spellcastingBonus // OPTIONAL //
TYPE: array of objects (or just a single object)
USE: adds entries to the "Bonus Spells" section of the spell selection dialog
If the parent attribute doesn't otherwise have spellcasting, the 'spellcastingBonus'
attribute will add it.
This object executes three functions:
1. Make a selection of spells to show in the drop-down in the spell selection dialog (same as a 'common spell list object').
2. Determine how often and with what name the drop-down of spells is present in the "Bonus Spells" section.
3. Determine how the first column of the spell will look on the spell sheet.
For the first function, this object can have all the same attributes as a 'common spell list object'.
For an explanation of those attributes see the file "_common spell list object.js".
For the second and third functions, this object has some specific attributes, which are in addition to a 'common spell list object'.
For those objects, see their individual explanations below.
NOTE
This adds a spell at the level of the parent feature and the spell will be added regardless of
the character otherwise having access to the appropriate spell level.
For adding subclass spells like the ones a cleric gets from its domain, a warlock gets from its patron, or a paladin gets from its oath,
take a look at the `spellcastingExtra` attribute below, as it takes the spell's level into account.
*/
// example of use of a 'common spell list object' attribute:
spells : ["light"],
name : "Arcane Initiate",
/* name // REQUIRED //
TYPE: string
USE: the name as it appears in the "Bonus Spells" section of the spell selection dialog
*/
times : 2,
/* name // OPTIONAL //
TYPE: number or array of numbers with 20 entries
USE: how many times this entry should appear in the "Bonus Spells" section of the spell selection dialog
Setting this attribute to 1 is the same as not including it.
Setting this attribute to an array signals that it varies depending on level.
Each entry in that array is a level, so you will most likely want to add 20 entries.
IMPORTANT! Set the value to 0 for levels that the feature is not present.
This attribute can have two type of values:
*/
selection : ["light"],
/* selection // OPTIONAL //
TYPE: array (variable length)