-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpdf-edit.js
2347 lines (2124 loc) · 118 KB
/
pdf-edit.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
const { PDFDocument } = PDFLib
async function fillForm() {
// Fetch the PDF with form fields
const formUrl = 'https://raw.githubusercontent.com/birddie721/5e2024Builder/main/Character-Sheet.pdf'
const formPdfBytes = await fetch(formUrl).then(res => res.arrayBuffer())
// Load a PDF with form fields
const pdfDoc = await PDFDocument.load(formPdfBytes)
// Get the form containing all the fields
const form = pdfDoc.getForm()
let proficiencyBonus = 2;
// Get all fields in the PDF by their names
const nameField = form.getTextField('Name')
const backgroundField = form.getTextField('Background')
const classField = form.getTextField('Class')
const speciesField = form.getTextField('Species')
const subclassField = form.getTextField('Subclass')
const speciesTraits = form.getTextField('SPECIES TRAITS')
const classFeatures1 = form.getTextField('CLASS FEATURES 1')
const classFeatures2 = form.getTextField('CLASS FEATURES 2')
const levelField = form.getTextField('Level')
const xpField = form.getTextField('XP Points')
const acField = form.getTextField('Armor Class')
const hpField = form.getTextField('Max HP')
const proficiencyField = form.getTextField('PROF BONUS')
const passivePerceptionField = form.getTextField('PASSIVE PERCEPTION')
const strScoreField = form.getTextField('STR SCORE')
const strModField = form.getTextField('STR MOD')
const dexScoreField = form.getTextField('DEX SCORE')
const dexModField = form.getTextField('DEX MOD')
const conScoreField = form.getTextField('CON SCORE')
const conModField = form.getTextField('CON MOD')
const intScoreField = form.getTextField('INT SCORE')
const intModField = form.getTextField('INT MOD')
const wisScoreField = form.getTextField('WIS SCORE')
const wisModField = form.getTextField('WIS MOD')
const chaScoreField = form.getTextField('CHA SCORE')
const chaModField = form.getTextField('CHA MOD')
const initiativeField = form.getTextField('init')
const speedField = form.getTextField('SPEED')
const sizeField = form.getTextField('SIZE')
const strChk = form.getCheckBox("Check Box18")
const dexChk = form.getCheckBox("Check Box11")
const conChk = form.getCheckBox("Check Box7")
const intChk = form.getCheckBox("Check Box25")
const wisChk = form.getCheckBox("Check Box17")
const chaChk = form.getCheckBox("Check Box6")
const strSaveField = form.getTextField("STR SAVE")
const dexSaveField = form.getTextField("DEX SAVE")
const conSaveField = form.getTextField("CON SAVE")
const intSaveField = form.getTextField("INT SAVE")
const wisSaveField = form.getTextField("Text Field71")
const chaSaveField = form.getTextField("CHA SAVE")
const athleticsChk = form.getCheckBox("Check Box19")
const acrobaticsChk = form.getCheckBox("Check Box8")
const slightOfHandChk = form.getCheckBox("Check Box9")
const stealthChk = form.getCheckBox("Check Box10")
const arcanaChk = form.getCheckBox("Check Box24")
const historyChk = form.getCheckBox("Check Box20")
const investigationChk = form.getCheckBox("Check Box21")
const natureChk = form.getCheckBox("Check Box22")
const religionChk = form.getCheckBox("Check Box23")
const animalHandlingChk = form.getCheckBox("Check Box15")
const insightChk = form.getCheckBox("Check Box13")
const medicineChk = form.getCheckBox("Check Box12")
const perceptionChk = form.getCheckBox("Check Box14")
const survivalChk = form.getCheckBox("Check Box16")
const deceptionChk = form.getCheckBox("Check Box5")
const intimidationChk = form.getCheckBox("Check Box4")
const performanceChk = form.getCheckBox("Check Box3")
const persuasionChk = form.getCheckBox("Check Box2")
const athleticsField = form.getTextField("ATHLETICS")
const acrobaticsField = form.getTextField("ACROBATICS")
const slightOfHandField = form.getTextField("SLEIGHT OF HAND")
const stealthField = form.getTextField("STEALTH")
const arcanaField = form.getTextField("ARCANA")
const historyField = form.getTextField("HISTORY")
const investigationField = form.getTextField("INVESTIGATION")
const natureField = form.getTextField("NATURE")
const religionField = form.getTextField("RELIGION")
const animalHandlingField = form.getTextField("ANIMAL HANDLING")
const insightField = form.getTextField("INSIGHT")
const medicineField = form.getTextField("MEDICINE")
const perceptionField = form.getTextField("PERCEPTION")
const survivalField = form.getTextField("SURVIVAL")
const deceptionField = form.getTextField("DECEPTION")
const intimidationField = form.getTextField("INTIMIDATE")
const performanceField = form.getTextField("PERFORMANCE")
const persuasionField = form.getTextField("PERSUASION")
const lightArmor = form.getCheckBox("Check Box33")
const mediumArmor = form.getCheckBox("Check Box34")
const heavyArmor = form.getCheckBox("Check Box35")
const shieldProf = form.getCheckBox("Check Box36")
const weapon1Name = form.getTextField("NAME - WEAPON 1")
const weapon1Bonus = form.getTextField("BONUS/DC - WEAPON 1")
const weapon1Damage = form.getTextField("DAMAGE/TYPE - WEAPON 1")
const weapon1Notes = form.getTextField("NOTES - WEAPON 1")
const weapon2Name = form.getTextField("NAME - WEAPON 2")
const weapon2Bonus = form.getTextField("BONUS/DC - WEAPON 2")
const weapon2Damage = form.getTextField("DAMAGE/TYPE - WEAPON 2")
const weapon2Notes = form.getTextField("NOTES - WEAPON 2")
const weapon3Name = form.getTextField("NAME - WEAPON 3")
const weapon3Bonus = form.getTextField("BONUS/DC - WEAPON 3")
const weapon3Damage = form.getTextField("DAMAGE/TYPE - WEAPON 3")
const weapon3Notes = form.getTextField("NOTES - WEAPON 3")
const weapon4Name = form.getTextField("NAME - WEAPON 4")
const weapon4Bonus = form.getTextField("BONUS/DC - WEAPON 4")
const weapon4Damage = form.getTextField("DAMAGE/TYPE - WEAPON 4")
const weapon4Notes = form.getTextField("NOTES - WEAPON 4")
const weapon5Name = form.getTextField("NAME - WEAPON 5")
const weapon5Bonus = form.getTextField("BONUS/DC - WEAPON 5")
const weapon5Damage = form.getTextField("DAMAGE/TYPE - WEAPON 5")
const weapon5Notes = form.getTextField("NOTES - WEAPON 5")
const weapon6Name = form.getTextField("NAME - WEAPON 6")
const weapon6Bonus = form.getTextField("BONUS/DC - WEAPON 6")
const weapon6Damage = form.getTextField("DAMAGE/TYPE - WEAPON 6")
const weapon6Notes = form.getTextField("NOTES - WEAPON 6")
const hasShieldChk = form.getCheckBox("shield chk")
const shieldAC = 2;
const spellcastingAbilityField = form.getTextField("SPELLCASTING ABILITY")
const spellcastingModifierField = form.getTextField("SPELLCASTING MOD")
const spellSaveDCField = form.getTextField("SPELL SAVE DC")
const spellAttackBonusField = form.getTextField("SPELL ATTACK BONUS")
const CPField = form.getTextField("CP")
const SPField = form.getTextField("SP")
const EPField = form.getTextField("EP")
const GPField = form.getTextField("GP")
const PPField = form.getTextField("PP")
const weaponProficienciesField = form.getTextField("WEAPON PROF")
const toolProficienciesField = form.getTextField("TOOL PROF")
const featsField = form.getTextField("FEATS")
const equipmentField = form.getTextField("EQUIPMENT")
let goldPieces = 0;
// Fill in the basic info fields
nameField.setText(document.getElementById("playerName").value)
let background = document.getElementById("roleSelect").value;
backgroundField.setText(background);
let selectedClass = document.getElementById("class").value
classField.setText(selectedClass)
let species = document.getElementById("race").value
const speciesList = ["Elf", "Goliath", "Tiefling", "Gnome"]
let subrace = document.getElementById("subrace").value
if (speciesList.includes(species)) {
speciesField.setText(subrace + " " + species)
}else {
speciesField.setText(species)
}
const fastList = ["Goliath"]
if (fastList.includes(species)) {
speedField.setText("35")
} else {
if (subrace == "Wood") {
speedField.setText("35")
}else {
speedField.setText("30")
}
}
const smallList = ["Gnome", "Halfling"]
const otherList = ["Aasimar", "Human", "Tiefling"]
if (smallList.includes(species)) {
sizeField.setText("Small")
} else if (otherList.includes(species)) {
sizeField.setText("")
}else {
sizeField.setText("Medium")
}
levelField.setText('1')
proficiencyField.setText('+' + proficiencyBonus)
const classHP = {
"Barbarian": 12,
"Bard": 8,
"Cleric": 8,
"Druid": 8,
"Fighter": 10,
"Monk": 8,
"Paladin": 10,
"Ranger": 10,
"Rogue": 8,
"Sorcerer": 6,
"Warlock": 8,
"Wizard": 6
}
strScoreField.setText(document.getElementById("total1").innerText)
let strMod = document.getElementById("abilityMod1").innerText;
if (strMod >= 0) {
strModField.setText("+" + strMod)
} else {
strModField.setText(strMod)
}
dexScoreField.setText(document.getElementById("total2").innerText)
let dexMod = document.getElementById("abilityMod2").innerText;
if (dexMod >= 0) {
dexModField.setText("+" + dexMod)
} else {
dexModField.setText(dexMod)
}
conScoreField.setText(document.getElementById("total3").innerText)
let conMod = document.getElementById("abilityMod3").innerText;
if (conMod >= 0) {
conModField.setText("+" + conMod)
} else {
conModField.setText(conMod)
}
intScoreField.setText(document.getElementById("total4").innerText)
let intMod = document.getElementById("abilityMod4").innerText;
if (intMod >= 0) {
intModField.setText("+" + intMod)
} else {
intModField.setText(intMod)
}
wisScoreField.setText(document.getElementById("total5").innerText)
let wisMod = document.getElementById("abilityMod5").innerText;
if (wisMod >= 0) {
wisModField.setText("+" + wisMod)
} else {
wisModField.setText(wisMod)
}
chaScoreField.setText(document.getElementById("total6").innerText)
let chaMod = document.getElementById("abilityMod6").innerText;
if (chaMod >= 0) {
chaModField.setText("+" + chaMod)
} else {
chaModField.setText(chaMod)
}
if (dexMod === "-1") {
initiativeField.setText(dexMod)
} else {
initiativeField.setText("+" + dexMod)
}
let modifiedHP = 0
let hp = classHP[selectedClass]
if (species === "Dwarf") {
modifiedHP = parseInt(hp) + parseInt(conMod) + 1
} else {
modifiedHP = parseInt(hp) + parseInt(conMod)
}
hpField.setText(modifiedHP.toString())
const strSave = ["Barbarian", "Fighter", "Monk", "Ranger"]
const dexSave = ["Bard", "Monk", "Ranger", "Rogue"]
const conSave = ["Barbarian", "Fighter", "Sorcerer"]
const intSave = ["Druid", "Rogue", "Wizard"]
const wisSave = ["Cleric", "Druid", "Paladin", "Warlock", "Wizard"]
const chaSave = ["Bard", "Cleric", "Paladin", "Sorcerer", "Warlock"]
if (strSave.includes(selectedClass)) {
strChk.check();
}
if (dexSave.includes(selectedClass)) {
dexChk.check();
}
if (conSave.includes(selectedClass)) {
conChk.check();
}
if (intSave.includes(selectedClass)) {
intChk.check();
}
if (wisSave.includes(selectedClass)) {
wisChk.check();
}
if (chaSave.includes(selectedClass)) {
chaChk.check();
}
const lightArmorProficiency = ["Barbarian", "Bard", "Cleric", "Druid", "Fighter", "Paladin", "Ranger", "Rogue", "Warlock"]
const mediumArmorProficiency = ["Barbarian", "Cleric", "Fighter", "Paladin", "Ranger"]
const heavyArmorProficiency = ["Fighter", "Paladin"]
const hasShieldProficiency = ["Barbarian", "Cleric", "Druid", "Fighter", "Paladin", "Ranger"]
if (lightArmorProficiency.includes(selectedClass)) {
lightArmor.check();
}
if (mediumArmorProficiency.includes(selectedClass)) {
mediumArmor.check();
}
if (heavyArmorProficiency.includes(selectedClass)) {
heavyArmor.check();
}
if (hasShieldProficiency.includes(selectedClass)) {
shieldProf.check();
}
if (perceptionChk.isChecked()) {
let passivePerception = parseInt(wisMod) + parseInt(proficiencyBonus) + 10
passivePerceptionField.setText(passivePerception.toString())
} else {
let passivePerception = parseInt(wisMod) + 10
passivePerceptionField.setText(passivePerception.toString())
}
let aasimarTraits = [
" * Celestial Resistance - Resistance to Necrotic damage and Radiant damage.",
" * Darkvision - Range 60ft",
" * Healing Hands - Magic Action, range touch, creature heals a number of d4s equal to your proficiency modifier. Once/Long Rest",
" * Light Bearer - Light Cantrip"
];
let dragonbornTraits = [
" * Draconic Ancestry - Based on your dragon color, you gain affinity with an element which impacts your Breath Weapon and Damage Resistance.",
" * Breath Weapon - During attack action, can replace one attack with a 15-foor Cone or 30-foot Line 5-feet wide. Each creature hit makes Dex saving throw (DC 8 + Con mod + proficiency bonus). Damage type determined by Draconic Ancestry. Takes 1d10 -> 2d10 (lvl5) -> 3d10 (lvl 11) - > 4d10 (lvl 17). Can use number of times equal to your proficiency bonus/long rest.",
" * Damage Resistance - You have resistance to the damage type determined by your Draconic Ancestry trait.",
" * Darkvision - Range 60ft",
" * Draconic Flight - As a bonus action, gain Fly Speed equal to your speed that lasts 10 minutes. Can use once per long rest."
]
let dwarfTraits = [
" * Darkvision - Range 120ft",
" * Dwarven Resilience - Resistance to Poison damage. Advantage on saving throws to avoid or end the Poisoned condition.",
" * Dwarven Toughness - +1 Max HP per level.",
" * Stonecunning - Bonus Action, gain Tremorsense with a range of 60ft for 10 minutes. Can only be used on stone surfaces. Can use a number of times equal to Proficiency Bonus per Long Rest."
]
let elfTraits = [
" * Fey Ancestry - Advantage on Saving Throws to avoid or end the Charmed condition.",
" * Keen Senses - Proficiency in the Insight, perceptopn, or Survival skill.",
" * Trance - You don't need to skeep, and magic can't put you to sleep. You can finish a Long Rest in 4 hours if you spend those hours in a trancelike meditation, during which you retain consciousness."
]
let drowTraits = [
" * Darkvision - Range 120ft",
" * Drow Lineage - You know the Dancing Lights cantrip. At 3rd level you know Faerie Fire, at 5th level you know Darkness."
]
let highElfTraits = [
" * Darkvision - Range 60ft",
" * High Elf Lineage - You know one Wizard cantrip and can switch it when you finish a long rest. At 3rd level you know Detect Magic, at 5th level you know Misty Step."
]
let woodElfTraits = [
" * Darkvision - Range 60ft",
" * Wood Elf Lineage - Your speed increases to 35 fet. You know the Druidcraft cantrip. At 3rd level you know Longstrider, at 5th level you know Pass without Trace."
]
let gnomeTraits = [
" * Darkvision - Range 60ft",
" * Gnomish Cunning - Advantage on Intelligence, Wisdom, and Charisma saving throws."
]
let forestGnomeTraits = [
" * Gnomish Lineage - You know the Minor Illusion cantrip. You always have the Speak with Animals spell prepared anc can cast it without a spell slot a number of times equal to your Proficiency Bonus. You regain all expended uses on a Long Rest. You can also use any spell slots you have to cast the spell."
]
let rockGnomeTraits = [
" * Gnomish Lineage - You know the Mending and Prestigitation cantrips. You can also spend 10 minutes casting Prestigitation to create small objects."
]
let goliathTraits = [
" * Large Form - Starting at Level 5, you can change your size to Large as a bonus action for 10 minutes or until you end it. For that duration, you have Advantage on Strength checks, and your Speed increases by 10ft. Once per Long Rest.",
" * Powerful Build - You have Advantage on any saving throw you make to end the Grappled condition. You also count as one size larger when determining your carrying capacity.",
" * Giant Ancestry - You gain a supernatural boon from your ancestry. You can use the benefit a number of times equal to your Proficiency Bonus and regain all expended uses on a Long Rest."
]
let cloudTraits = [
" * Cloud's Jaunt - As a bonus action, you magically teleport up to 30 feet to an unoccupied space you can see."
]
let fireTraits = [
" * Fire's Burn - When you hit a target with an attack roll and deal damage to it, you can also deal 1d10 Fire damage to that target."
]
let frostTraits = [
" * Frost's Chill - When you hit a target with an attack roll and deal damage to it, you can also deal 1d6 Cold damage to that target and reduce its Speed by 10ft until the start of your next turn."
]
let hillTraits = [
" * Hill's Tumble - When you hit a Large or smaller creature with an attack roll and deal damage to it, you can give that target the Prone condition."
]
let stoneTraits = [
" * Stone's Endurance - When you take damage, you can take a Reaction to roll 1d12. Add your Constitution modifier to the number rolled and reduce the damage by that total."
]
let stormTraits = [
" * Storm's Thunder - When you take damage from a creature within 60 feet of you, you can take a Reaction to deal 1d8 Thunder damage to that creature."
]
let halflingTraits = [
" * Brave - You have advantage on saving throws you make to avoid or end the Frightened condition.",
" * Halfling Nimbleness - You can move through the space of any creature that is a size larger than you, but you can't stop in the same space.",
" * Luck - When you roll a 1 on the d20 of a D20 Test, you can reroll the die, and you must use the new roll.",
" * Naturally Stealthy - You can take the Hide action even when you are obscured only by a creature that is at least one size larger than you."
]
let humanTraits = [
" * Resourceful - You gain Heroic Inspiration whenever you finish a Long Rest.",
" * Skillful - You gain proficiency in one skill of your choice.",
" * Versatile - You gain an Origin feat of your choice."
]
let orcTraits = [
" * Adrenaline Rush - You can take the Dash action as a Bonus Action. When you do so, you gain a number of Temporary Hit Points equal to your Proficiency Bonus. You can use this trait a number of times equal to your Proficiency Bonus and regain all uses on a Short or Long Rest.",
" * Darkvision - Range 120ft",
" * Relentless Endurance - When you are reduced to 0 Hit Points but not killed outright, you can drop to 1 Hit Point instead. Once per Long Rest."
]
let tieflingTraits = [
" * Darkvision - Range 60ft",
" * Otherworldly Presence - You know the Thaumaturgy cantrip. When you cast it with this trait, the spell uses the same spellcasting ability you use for your Fiending Legacy trait.",
" * Fiendish Legacy - At levels 3 and 5 you know a spell depending on your chosen Fiendish Legacy. You always have that spell prepared. You can cast it once without a spell slot per Long Rest. You can also cast it with a spell slot. Intelligence, Wisdom, or Charisma is your spellcasting ability for spells you cast with this trait."
]
let abyssalTraits = [
" * Abyssal - You know the Poison Spray cantrip. You have resistance to Poison damage. At 3rd level you know Ray of Sickness. At 5th level you know Hold person."
]
let chthonicTraits = [
" * Chthonic - You know the Chill Touch cantrip. You have resistance to Necrotic damage. At 3rd level you know False Life. At 5th level you know Ray of Enfeeblement."
]
let infernalTraits = [
" * Infernal - You know the Fire Bolt cantrip. You have resistance to Fire damage. At 3rd level you know Hellish Rebuke. At 5th level you know Darkness."
]
switch (species){
case "Aasimar":
speciesTraits.setText(aasimarTraits.join('\n'));
break;
case "Dragonborn":
speciesTraits.setText(dragonbornTraits.join('\n'));
break;
case "Dwarf":
speciesTraits.setText(dwarfTraits.join('\n'));
break;
case "Elf":
switch(subrace) {
case "High":
speciesTraits.setText(elfTraits.join('\n') + '\n' + highElfTraits.join('\n'));
break;
case "Wood":
speciesTraits.setText(elfTraits.join('\n') + '\n' + woodElfTraits.join('\n'));
break;
case "Dark":
speciesTraits.setText(elfTraits.join('\n') + '\n' + drowTraits.join('\n'));
break;
}
break;
case "Gnome":
switch(subrace){
case "Forest":
speciesTraits.setText(gnomeTraits.join('\n') + '\n' + forestGnomeTraits.join('\n'));
break;
case "Rock":
speciesTraits.setText(gnomeTraits.join('\n') + '\n' + rockGnomeTraits.join('\n'));
break;
}
break;
case "Goliath":
switch (subrace) {
case "Cloud Giant":
speciesTraits.setText(goliathTraits.join('\n') + '\n' + cloudTraits.join('\n'));
break;
case "Fire Giant":
speciesTraits.setText(goliathTraits.join('\n') + '\n' + fireTraits.join('\n'));
break;
case "Frost Giant":
speciesTraits.setText(goliathTraits.join('\n') + '\n' + frostTraits.join('\n'));
break;
case "Hill Giant":
speciesTraits.setText(goliathTraits.join('\n') + '\n' + hillTraits.join('\n'));
break;
case "Stone Giant":
speciesTraits.setText(goliathTraits.join('\n') + '\n' + stoneTraits.join('\n'));
break;
case "Storm Giant":
speciesTraits.setText(goliathTraits.join('\n') + '\n' + stormTraits.join('\n'));
break;
}
break;
case "Halfling":
speciesTraits.setText(halflingTraits.join('\n'));
break;
case "Human":
speciesTraits.setText(humanTraits.join('\n'));
break;
case "Orc":
speciesTraits.setText(orcTraits.join('\n'));
break;
case "Tiefling":
switch(subrace) {
case "Abyssal":
speciesTraits.setText(tieflingTraits.join('\n') + '\n' + abyssalTraits.join('\n'));
break;
case "Chthonic":
speciesTraits.setText(tieflingTraits.join('\n') + '\n' + chthonicTraits.join('\n'));
break;
case "Infernal":
speciesTraits.setText(tieflingTraits.join('\n') + '\n' + infernalTraits.join('\n'));
break;
}
break;
}
let barbarianTraits1 = [
" * Rage - You can enter a Rage as a Bonus Action if you are not wearing Heavy armor. You can enter your Rage the number of times shown for your Barbarian level. You regain one expended use when you finish a Short Rest and all uses when you finish a Long Rest. While in your Rage, you gain Resistance to Bludgeoning, Piercing, and Slashing damage and gain Advantage on Strength checks and Strength saving throws. During your rage, when you make an attack using Strength and deal damage to the target, you deal bonus damage shown for your Barbarian level. You cannot maintain Concentration and cannot cast spells during a Rage. The Rage lasts for one turn, but can be extended by one turn if you make an attack roll against an enemy, force an enemy to make a saving throw, or take a Bonus Action to extend your rage. You can maintain a Rage for a maximmum of 10 minutes."
]
let barbarianTraits2 = [
" * Unarmored Defense - While you aren't wearing any armor, your base Armor Class equals 10 plus your Dexterity and Constitution modifiers. You can use a Shield and still gain this benefit.\n",
" * Weapon Mastery - You gain the mastery properties of two kinds of Simple or Martial Melee weapons of your choice. Whenever you Long Rest you can change one of those weapon choices."
]
let bardTraits1 = [
" * Bardic Inspiration - As a Bonus Action you can inspire another creature within 60ft who can hear you. This creature gains one of your Bardic Inspiration dice. A creature can only have one Bardic Inspiration die at a time. This creature can, in the next hour, roll the Bardic Inspiration die and add the number rolled to a d20 test. The Bardic Inspiration die is expended when it's rolled. This feature can be used a number of times equal to your Charisma modifier and all uses are regained on a Long Rest."
]
let bardTraits2 = [
" * Spellcasting - You know two cantrips from the Bard spell list and can replace one cantrip whenever you gain a Bard level. The Bard Features table shows how many spell slots you have to cast your level 1+ spells. You regain all expended slots when you finish a Long Rest. You prepare the list of level 1+ spells that are available for you to cast with this feature. To start, choose four level 1 spells from the Bard spell list. Whenever you gain a Bard level, you can replace one spell on your list with another Bard spell for which you have spell slots."
]
let clericTraits1 = [
" * Divine Order - You have dedicated yourself to one of the following sacred roles of your choice:",
" - Protector: You gain proficiency with martial weapons and training with Heavy armor.",
" - Thaumaturge: You know one extra cantrip from the Cleric spell list. In addition, your mystical connection to the divine gives you a bonus use of your Arcana and Religion checks equal to your Wisdom modifier."
]
let clericTraits2 = [
" * Spellcasting - You know three cantrips from the Cleric spell list and can replace one cantrip whenever you gain a Cleric level. The Cleric Features table shows how many spell slots you have to cast your level 1+ spells. You regain all expended slots when you finish a Long Rest. You prepare the list of level 1+ spells that are available for you to cast with this feature. To start, choose four level 1 spells from the Cleric spell list. Whenever you Long Rest, you can change your list of prepared spells, replacing any of the spells there with other Cleric spells for which you have spell slots."
]
let druidTraits1 = [
" * Druidic - You know Druidic, the secret language of the Druids. You also always have the Speak with Animals spell prepared.\n",
" * Primal Order - You have dedicated yourself to one of the following savred roles of your choice:",
" - Magician: You know one extra cantrip. You gain a bonus to your Arcana and Nature checks equal to your Wisdom modifier.",
" - Warden: You gain proficiency with Martial weapons and training with Medium armor."
]
let druidTraits2 = [
" * Spellcasting - You know two cantrips from the Druid spell list and can replace one cantrip whenever you gain a Druid level. The Druid Features table shows how many spell slots you have to cast your level 1+ spells. You regain all expended slots when you finish a Long Rest. You prepare the list of level 1+ spells that are available for you to cast with this feature. To start, choose four level 1 spells from the Druid spell list. Whenever you Long Rest, you can change your list of prepared spells, replacing any of the spells there with other Druid spells for which you have spell slots."
]
let fighterTraits1 = [
" * Fighting Style - You gain a Fighting Style feat. Whenever you gain a Fighter level, you can replace the feat you chose with a different Fighting Style feat.\n",
" * Weapon Mastery - You gain the mastery properties of two kinds of Simple or Martial Melee weapons of your choice. Whenever you Long Rest you can change one of those weapon choices."
]
let fighterTraits2 = [
" * Second Wind - As a Bonus Action, you can regain Hit Points equal to 1d10 plus your Fighter Level. You can use this feature twice. You regain one expended use when you finish a Short Rest, and regain all expended uses when you finish a Long Rest."
]
let monkTraits1 = [
" * Martial Arts - You gain the following benefits when you are unarmed or wielding only Monk weapons, and not wearing armor or wielding a Shield:",
" - You can make an Unarmed Strike as a Bonus Action",
" - You can roll 1d6 in place of the normal damage of your Unarmed Strike or Monk weapons.",
" - You can use your Dexterity modifier instead of your Strength modifier for the attack and damage rolls of your Unarmed Strikes and Monk weapons. In addition, when you use the Grapple or Shive option of your Unarmed Strike, you can use your Dexterity modifier instead of your Strength modifier to determine the save DC."
]
let monkTraits2 = [
" * Unarmored Defense - While you aren't wearing any armor, your base Armor Class equals 10 plus your Dexterity and Wisdom modifiers.",
" "
]
let paladinTraits1 = [
" * Lay On Hands - You have a pool of healing power that replenishes when you finsh a Long Rest. With that pool, you can restore a total number of Hit Points equal to five times your Paladin level. As a Bonus Action, you can touch a creature (yourself included) and restore a number of Hit Points to that creature up to the maximum amount remaining in the pool. You can also expend 5 Hit Points from the pool to remove the Poisoned condition from the creature; those points don't also restore Hit Points to the creature.\n",
" * Weapon Mastery - You gain the mastery properties of two kinds of weapons of your choice with which you have proficiency. Whenever you Long Rest you can change the kinds of weapons you chose."
]
let paladinTraits2 = [
" * Spellcasting - The Paladin Features table shows how many spell slots you have to cast your level 1+ spells. You regain all expended slots when you finish a Long Rest. You prepare the list of level 1+ spells that are available for you to cast with this feature. To start, choose two level 1 spells from the Paladin spell list. Whenever you Long Rest, you can replace one spell on your list with another Paladin spell for which you have spell slots."
]
let rangerTraits1 = [
" * Favored Enemy - You always have the Hunter's Mark spell prepared. You can cast it twice without expending a spell slot, and regain all expended uses when you finish a Long Rest.\n",
" * Weapon Mastery - You gain the mastery properties of two kinds of weapons of your choice with which you have proficiency. Whenever you Long Rest you can change the kinds of weapons you chose."
]
let rangerTraits2 = [
" * Spellcasting - The Ranger Features table shows how many spell slots you have to cast your level 1+ spells. You regain all expended slots when you finish a Long Rest. You prepare the list of level 1+ spells that are available for you to cast with this feature. To start, choose two level 1 spells from the Ranger spell list. Whenever you Long Rest, you can replace one spell on your list with another Ranger spell for which you have spell slots."
]
let rogueTraits1 = [
" * Expertise - You gain Expertise in two of your skill proficiencies of your choice.\n",
" * Weapon Mastery - You gain the mastery properties of two kinds of weapons of your choice with which you have proficiency. Whenever you Long Rest you can change the kinds of weapons you chose."
]
let rogueTraits2 = [
" * Sneak Attack - Once per turn, you can deal an extra 1d6 damage to one creature you hit with an attack roll if you have Advantage on the roll and the attack uses a Finesse or Ranged weapon. You don't need Advantage on the attack roll if at least one of your allies is within 5 feet of the target, the ally doesn't have the Incapacitated condition, and you don't have Disadvantage on the attack roll.\n",
" * Thieves' Cant - You know Thieves' Cant and one other language of your choice."
]
let sorcererTraits1 = [
" * Spellcasting - You know four cantrips from the Sorcerer spell list and can replace one cantrip whenever you gain a Sorcerer level. The Sorcerer Features table shows how many spell slots you have to cast your level 1+ spells. You regain all expended slots when you finish a Long Rest. You prepare the list of level 1+ spells that are available for you to cast with this feature. To start, choose two level 1 spells from the Sorcerer spell list. Whenever you gain a Sorcerer level, you can replace one spell on your list with another Sorcerer spell for which you have spell slots."
]
let sorcererTraits2 = [
" * Innate Sorcery - On a Bonus Action, for one minute, you gain Advantage on the attack rolls of Sorcerer spells you cast and the spell save DC of your Sorcerer spells increases by 1. You can use this feature twice and regain all expended uses on a Long Rest."
]
let warlockTraits1 = [
" * Eldrich Invocations - You gain one Eldrich invocation of your choice. Whenever you gain a Warlock level, you can replace onw of your invocations with another one for which you qualify. When you gain certain Warlock levels, you gain more invocations of your choice.",
" "
]
let warlockTraits2 = [
" * Pact Magic - You know two cantrips from the Warlock spell list and can replace one cantrip whenever you gain a Warlock level. The Warlock Features table shows how many spell slots you have to cast your Warlock spells of levels 1-5. The table also shows the level of those slots, all of which are the same level. You regain all expended Pact Magic spell slots when you finish a Short or Long Rest. You prepare the list of level 1+ spells that are available for you to cast with this feature. To start, choose two level 1 spells from the Warlock spell list. Whenever you gain a Warlock level, you can replace one spell on your list with another Warlock spell of an eligible level."
]
let wizardTraits1 = [
" * Spellcasting - You know three cantrips from the Wizard spell list and can replace one cantrip whenever you finish a Long Rest. As a Wizard, you have a spellbook. The book contains the level 1+ spells you know. It starts with six level 1 Wizard spells of your choice. Whenever you gain a Wizard level after 1, add two Wizard spells of your choice to your spellbook. The Wizard Features table shows how many spell slots you have to cast your level 1+ spells. You regain all expended slots when you finish a Long Rest. You prepare the list of level 1+ spells that are available for you to cast with this feature. To start, choose four level 1 spells from your spellbook. Whenever you finish a Long Rest, you can change your list of prepared spells, replacing any of the spells there with spells from your spellbook."
]
let wizardTraits2 = [
" * Ritual Adept - You can cast any spell as a Ritual if that spell has the Ritual tag and the spell is in your spellbook. You needn't have the spell prepared, but you must read from the book to cast a spell in this way.\n",
" * Arcane Recovery - When you finish a Short Rest, you can choose expended spell slots to recover. The spell slots can have a combined level equal to no more than half your Wizard level rounded up, and none of the slots can be level 6 or higher. Once you use this feature, you can't do so again until you finish a Long Rest."
]
switch(selectedClass) {
case "Barbarian":
classFeatures1.setText(barbarianTraits1.join('\n'));
classFeatures2.setText(barbarianTraits2.join('\n'));
break;
case "Bard":
classFeatures1.setText(bardTraits1.join('\n'));
classFeatures2.setText(bardTraits2.join('\n'));
break;
case "Cleric":
classFeatures1.setText(clericTraits1.join('\n'));
classFeatures2.setText(clericTraits2.join('\n'));
break;
case "Druid":
classFeatures1.setText(druidTraits1.join('\n'));
classFeatures2.setText(druidTraits2.join('\n'));
break;
case "Fighter":
classFeatures1.setText(fighterTraits1.join('\n'));
classFeatures2.setText(fighterTraits2.join('\n'));
break;
case "Monk":
classFeatures1.setText(monkTraits1.join('\n'));
classFeatures2.setText(monkTraits2.join('\n'));
break;
case "Paladin":
classFeatures1.setText(paladinTraits1.join('\n'));
classFeatures2.setText(paladinTraits2.join('\n'));
break;
case "Ranger":
classFeatures1.setText(rangerTraits1.join('\n'));
classFeatures2.setText(rangerTraits2.join('\n'));
break;
case "Rogue":
classFeatures1.setText(rogueTraits1.join('\n'));
classFeatures2.setText(rogueTraits2.join('\n'));
break;
case "Sorcerer":
classFeatures1.setText(sorcererTraits1.join('\n'));
classFeatures2.setText(sorcererTraits2.join('\n'));
break;
case "Warlock":
classFeatures1.setText(warlockTraits1.join('\n'));
classFeatures2.setText(warlockTraits2.join('\n'));
break;
case "Wizard":
classFeatures1.setText(wizardTraits1.join('\n'));
classFeatures2.setText(wizardTraits2.join('\n'));
break;
}
let intSpellcasting = ["Wizard"]
let wisSpellcasting = ["Cleric", "Druid", "Ranger"]
let chaSpellcasting = ["Bard", "Paladin", "Sorcerer", "Warlock"]
let baseSpellSaveDC = 8
if (intSpellcasting.includes(selectedClass)) {
spellcastingAbilityField.setText("Intelligence");
let spellcastingAbilityModifier = intMod
spellcastingModifierField.setText("+" + spellcastingAbilityModifier.toString())
let spellSaveDC = parseInt(baseSpellSaveDC) + parseInt(proficiencyBonus) + parseInt(spellcastingAbilityModifier);
spellSaveDCField.setText(spellSaveDC.toString())
let spellAttackMod = parseInt(proficiencyBonus) + parseInt(spellcastingAbilityModifier);
spellAttackBonusField.setText("+" + spellAttackMod.toString())
}
if (wisSpellcasting.includes(selectedClass)) {
spellcastingAbilityField.setText("Wisdom");
let spellcastingAbilityModifier = wisMod
spellcastingModifierField.setText("+" + spellcastingAbilityModifier.toString())
let spellSaveDC = parseInt(baseSpellSaveDC) + parseInt(proficiencyBonus) + parseInt(spellcastingAbilityModifier);
spellSaveDCField.setText(spellSaveDC.toString())
let spellAttackMod = parseInt(proficiencyBonus) + parseInt(spellcastingAbilityModifier);
spellAttackBonusField.setText("+" + spellAttackMod.toString())
}
if (chaSpellcasting.includes(selectedClass)) {
spellcastingAbilityField.setText("Charisma");
let spellcastingAbilityModifier = chaMod
spellcastingModifierField.setText("+" + spellcastingAbilityModifier.toString())
let spellSaveDC = parseInt(baseSpellSaveDC) + parseInt(proficiencyBonus) + parseInt(spellcastingAbilityModifier);
spellSaveDCField.setText(spellSaveDC.toString())
let spellAttackMod = parseInt(proficiencyBonus) + parseInt(spellcastingAbilityModifier);
spellAttackBonusField.setText("+" + spellAttackMod.toString())
}
let strengthToHit = (parseInt(strMod) + parseInt(proficiencyBonus)).toString()
let dexterityToHit = (parseInt(dexMod) + parseInt(proficiencyBonus)).toString()
let finesse = false
let hasShield = false
if (parseInt(dexMod) >= parseInt(strMod)){
finesse = true
}
let ac = 10;
let classEquipment = ""
let classToolProficiencies = ""
let hasClassToolProficiencies = false
switch(selectedClass) {
case "Barbarian":
goldPieces = 15;
weaponProficienciesField.setText("Simple and Martial weapons\n")
weapon1Name.setText("Greataxe")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("1d12 + " + strMod + " S")
weapon1Notes.setText("Heavy, Two-Handed")
weapon2Name.setText("Handaxe")
weapon2Bonus.setText("+" + strengthToHit)
weapon2Damage.setText("1d6 + " + strMod + " S")
weapon2Notes.setText("Light, Thrown (Range 20/60)")
ac = ac + parseInt(dexMod) + parseInt(conMod)
classEquipment = "Greataxe, 4 Handaxes, Explorer's Pack"
break;
case "Bard":
goldPieces = 19;
weaponProficienciesField.setText("Simple weapons\n\n")
if (finesse) {
weapon1Name.setText("Dagger")
weapon1Bonus.setText("+" + dexterityToHit)
weapon1Damage.setText("1d4 +" + dexMod + " P")
weapon1Notes.setText("Finesse, Light, Thrown (Range 20/60")
} else{
weapon1Name.setText("Dagger")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("1d4 +" + strMod + " P")
weapon1Notes.setText("Finesse, Light, Thrown (Range 20/60")
}
ac = ac + parseInt(dexMod) + 1
classEquipment = "Leather Armor, 2 Daggers, Musical Instrument, Entertainer's Pack"
hasClassToolProficiencies = true
classToolProficiencies = "3 Musical Instruments"
break;
case "Cleric":
goldPieces = 7;
weaponProficienciesField.setText("Simple weapons\n\n")
hasShield = true
weapon1Name.setText("Mace")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("1d6 +" + strMod + " B")
weapon1Notes.setText("")
let clerDexMod = parseInt(dexMod)
if (clerDexMod > 2){
clerDexMod = 2
}
ac = ac + clerDexMod + 3 + 2
classEquipment = "Chain Shirt, Shield, Mace, Holy Symbol, Priest's Pack"
break;
case "Druid":
goldPieces = 9;
weaponProficienciesField.setText("Simple weapons\n\n")
hasShield = true
weapon1Name.setText("Quarterstaff")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("1d6 +" + strMod + " B")
weapon1Notes.setText("Versatile (1d8)")
weapon2Name.setText("Sickle")
weapon2Bonus.setText("+" + strengthToHit)
weapon2Damage.setText("1d4 + " + strMod + " S")
weapon2Notes.setText("Light")
ac = ac + parseInt(dexMod) + 1
classEquipment = "Leather Armor, Shield, Sickle, Druidic Focus (Quarterstaff), Explorer's Pack, Herbalism Kit"
hasClassToolProficiencies = true
classToolProficiencies = "Herbalism Kit"
break;
case "Fighter":
weaponProficienciesField.setText("Simple and Martial weapons\n")
if (!finesse) {
goldPieces = 4;
weapon1Name.setText("Greatsword")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("2d6 + " + strMod + " S")
weapon1Notes.setText("Heavy, Two-Handed")
weapon2Name.setText("Flail")
weapon2Bonus.setText("+" + strengthToHit)
weapon2Damage.setText("1d8 + " + strMod + " B")
weapon2Notes.setText("")
weapon3Name.setText("Javelin")
weapon3Bonus.setText("+" + strengthToHit)
weapon3Damage.setText("1d6 + " + strMod + " P")
weapon3Notes.setText("Thrown (Range 30/120)")
classEquipment = "Chain Mail, Greatsword, Flail, 8 Javelins, Dungeoneer's Pack"
ac = 16
} else {
goldPieces = 11;
weapon1Name.setText("Longbow")
weapon1Bonus.setText("+" + dexterityToHit)
weapon1Damage.setText("1d8 + " + dexMod + " P")
weapon1Notes.setText("Ammunition (Range 150/600; Arrow), Heavy, Two-Handed")
weapon2Name.setText("Shortsword")
weapon2Bonus.setText("+" + dexterityToHit)
weapon2Damage.setText("1d6 + " + dexMod + " P")
weapon2Notes.setText("Finesse, Light")
weapon3Name.setText("Scimitar")
weapon3Bonus.setText("+" + dexterityToHit)
weapon3Damage.setText("1d6 + " + dexMod + " S")
weapon3Notes.setText("Finesse, Light")
classEquipment = "Studded Leather Armor, Scimitar, Shortsword, Longbow, 20 Arrows, Quiver, Dungeoneer's Pack"
ac = ac + parseInt(dexMod) + 2
}
break;
case "Monk":
goldPieces = 11;
weaponProficienciesField.setText("Simple weapons and Martial weapons that have the Light property")
if (finesse) {
weapon1Name.setText("Unarmed Strike")
weapon1Bonus.setText("+" + dexterityToHit)
weapon1Damage.setText("1d6 +" + dexMod + " B")
weapon1Notes.setText("")
weapon2Name.setText("Spear")
weapon2Bonus.setText("+" + dexterityToHit)
weapon2Damage.setText("1d6 +" + dexMod + " P")
weapon2Notes.setText("Thrown (Range 20/60), Versatile (1d8)")
weapon3Name.setText("Dagger")
weapon3Bonus.setText("+" + dexterityToHit)
weapon3Damage.setText("1d6 +" + dexMod + " P")
weapon3Notes.setText("Finesse, Light, Thrown (Range 20/60)")
} else{
weapon1Name.setText("Unarmed Strike")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("1d6 +" + strMod + " B")
weapon1Notes.setText("")
weapon2Name.setText("Spear")
weapon2Bonus.setText("+" + strengthToHit)
weapon2Damage.setText("1d6 +" + strMod + " B")
weapon2Notes.setText("Thrown (Range 20/60), Versatile (1d8)")
weapon3Name.setText("Dagger")
weapon3Bonus.setText("+" + strengthToHit)
weapon3Damage.setText("1d6 +" + strMod + " B")
weapon3Notes.setText("Finesse, Light, Thrown (Range 20/60)")
}
ac = ac + parseInt(dexMod) + parseInt(wisMod)
classEquipment = "Spear, 5 Daggers, Explorer's Pack"
break;
case "Paladin":
goldPieces = 9;
weaponProficienciesField.setText("Simple and Martial weapons\n")
hasShield = true
weapon1Name.setText("Longsword")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("1d8 +" + strMod + " S")
weapon1Notes.setText("Versatile (1d10)")
weapon2Name.setText("Javelin")
weapon2Bonus.setText("+" + strengthToHit)
weapon2Damage.setText("1d6 + " + strMod + " P")
weapon2Notes.setText("Thrown (Range 30/120)")
ac = 16 + 2
classEquipment = "Chain Mail, Shield, Longsword, 6 Javelins, Holy Symbol, Priest's Pack"
break;
case "Ranger":
goldPieces = 7;
weaponProficienciesField.setText("Simple and Martial weapons\n")
if (finesse) {
weapon1Name.setText("Longbow")
weapon1Bonus.setText("+" + dexterityToHit)
weapon1Damage.setText("1d8 + " + dexMod + " P")
weapon1Notes.setText("Ammunition (Range 150/600; Arrow), Heavy, Two-Handed")
weapon2Name.setText("Shortsword")
weapon2Bonus.setText("+" + dexterityToHit)
weapon2Damage.setText("1d6 + " + dexMod + " P")
weapon2Notes.setText("Finesse, Light")
weapon3Name.setText("Scimitar")
weapon3Bonus.setText("+" + dexterityToHit)
weapon3Damage.setText("1d6 + " + dexMod + " S")
weapon3Notes.setText("Finesse, Light")
} else {
weapon1Name.setText("Longbow")
weapon1Bonus.setText("+" + dexterityToHit)
weapon1Damage.setText("1d8 + " + dexMod + " P")
weapon1Notes.setText("Ammunition (Range 150/600; Arrow), Heavy, Two-Handed")
weapon2Name.setText("Shortsword")
weapon2Bonus.setText("+" + strengthToHit)
weapon2Damage.setText("1d6 + " + strMod + " P")
weapon2Notes.setText("Finesse, Light")
weapon3Name.setText("Scimitar")
weapon3Bonus.setText("+" + strengthToHit)
weapon3Damage.setText("1d6 + " + strMod + " S")
weapon3Notes.setText("Finesse, Light")
}
ac = ac + parseInt(dexMod) + 2
classEquipment = "Studded Leather Armor, Scimitar, Shortsword, Longbow, 20 Arrows, Quiver, Druidic Focus (sprig of mistletoe), Explorer's Pack"
break;
case "Rogue":
goldPieces = 8;
weaponProficienciesField.setText("Simple weapons and Martial weapons that have the Finesse or Light property")
if (finesse) {
weapon1Name.setText("Shortsword")
weapon1Bonus.setText("+" + dexterityToHit)
weapon1Damage.setText("1d6 + " + dexMod + " P")
weapon1Notes.setText("Finesse, Light")
weapon2Name.setText("Shortbow")
weapon2Bonus.setText("+" + dexterityToHit)
weapon2Damage.setText("1d6 + " + dexMod + " P")
weapon2Notes.setText("Ammunition (Range 80/320; Arrow), Two-Handed")
weapon3Name.setText("Dagger")
weapon3Bonus.setText("+" + dexterityToHit)
weapon3Damage.setText("1d4 +" + dexMod + " P")
weapon3Notes.setText("Finesse, Light, Thrown (Range 20/60")
} else {
weapon1Name.setText("Shortsword")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("1d6 + " + strMod + " P")
weapon1Notes.setText("Finesse, Light")
weapon2Name.setText("Shortbow")
weapon2Bonus.setText("+" + dexterityToHit)
weapon2Damage.setText("1d6 + " + dexMod + " P")
weapon2Notes.setText("Ammunition (Range 80/320; Arrow), Two-Handed")
weapon3Name.setText("Dagger")
weapon3Bonus.setText("+" + strengthToHit)
weapon3Damage.setText("1d4 +" + strMod + " P")
weapon3Notes.setText("Finesse, Light, Thrown (Range 20/60")
}
ac = ac + parseInt(dexMod) + 1
classEquipment = "Leather Armor, 2 Daggers, Shortsword, Shortbow, 20 Arrows, Quiver, Thieves' Tools, Burglar's Pack"
hasClassToolProficiencies = true
classToolProficiencies = "Thieves' Tools"
break;
case "Sorcerer":
goldPieces = 28;
weaponProficienciesField.setText("Simple weapons\n\n")
if (finesse) {
weapon1Name.setText("Spear")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("1d6 + " + strMod + " P")
weapon1Notes.setText("Thrown (Range 20/60), Versatile (1d8)")
weapon2Name.setText("Dagger")
weapon2Bonus.setText("+" + dexterityToHit)
weapon2Damage.setText("1d4 +" + dexMod + " P")
weapon2Notes.setText("Finesse, Light, Thrown (Range 20/60")
} else {
weapon1Name.setText("Spear")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("1d6 + " + strMod + " P")
weapon1Notes.setText("Thrown (Range 20/60), Versatile (1d8)")
weapon2Name.setText("Dagger")
weapon2Bonus.setText("+" + strengthToHit)
weapon2Damage.setText("1d4 +" + strMod + " P")
weapon2Notes.setText("Finesse, Light, Thrown (Range 20/60")
}
ac = ac + parseInt(dexMod)
classEquipment = "Spear, 2 Daggers, Arcane Focus (crystal), Dungeoneer's Pack"
break;
case "Warlock":
goldPieces = 15;
weaponProficienciesField.setText("Simple weapons\n\n")
if (finesse) {
weapon1Name.setText("Sickle")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("1d4 + " + strMod + " S")
weapon1Notes.setText("Light")
weapon2Name.setText("Dagger")
weapon2Bonus.setText("+" + dexterityToHit)
weapon2Damage.setText("1d4 +" + dexMod + " P")
weapon2Notes.setText("Finesse, Light, Thrown (Range 20/60")
} else {
weapon1Name.setText("Sickle")
weapon1Bonus.setText("+" + strengthToHit)
weapon1Damage.setText("1d4 + " + strMod + " S")
weapon1Notes.setText("Light")
weapon2Name.setText("Dagger")
weapon2Bonus.setText("+" + strengthToHit)
weapon2Damage.setText("1d4 +" + strMod + " P")
weapon2Notes.setText("Finesse, Light, Thrown (Range 20/60")
}
ac = ac + parseInt(dexMod) + 1