-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcombat-script.js
1167 lines (1139 loc) · 49.4 KB
/
combat-script.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
//REFERENCES
// const messages = [
// “...”,
// “...”,
// “...”
// ]
// const randIndex = Math.floor(Math.random() * messages.length) // Get random index
// console.log(messages[randIndex]) // Get random message from messages array
//================
function rollEnemyType() {
const enemyType= [
"Aberration",
"Beast",
"Humanoid/Giant",
"Celestial",
"Construct",
"Dragon",
"Elemental",
"Fey",
"Fiend",
"Monstrosity",
"Ooze",
"Plant",
"Undead: Bony",
"Undead: Bloody",
"General/Misc"
]
const enemyTypeIndex = Math.floor(Math.random() * enemyType.length)
blurt({
title: 'Enemy Type',
text: enemyType[enemyTypeIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function rollYesNo2() {
const yesNo= [
"Yes",
"No",
"Yes, and...",
"No, and...",
"Yes, but...",
"No, but..."
]
const yesNoIndex = Math.floor(Math.random() * yesNo.length)
blurt({
title: 'Yes/No, and/but?',
text: yesNo[yesNoIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function rollFate() {
selectedFate = document.getElementById("fateSelect").value;
if(selectedFate == "Lightly Wounded"){
const fatum = [
"Discolored",
"Scratched",
"Bruised",
"Harmful",
"Dented",
"Hurt",
"Marred",
"Flustered",
"Scraped",
"Nicked",
"Blotchy",
"Grazed",
"Damaged",
"Slashed",
"Stubborn"
]
const fatumIndex = Math.floor(Math.random() * fatum.length)
blurt({
title: 'Enemy Health',
text: fatum[fatumIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
else if(selectedFate == "Heavily Wounded"){
const fatum = [
"Ragged",
"Injured",
"Bloodied",
"Hurt",
"Cracked",
"Distressed",
"Bashed",
"Shaken",
"Pounded",
"Mauled",
"Wobbly",
"Hacked",
"Battered",
"Torn",
"Worried"
]
const fatumIndex = Math.floor(Math.random() * fatum.length)
blurt({
title: 'Enemy Health',
text: fatum[fatumIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
else if(selectedFate == "Near Death"){
const fatum = [
"Fragmented",
"Thrashed",
"Staggered",
"Faded",
"Fragile",
"Wrecked",
"Ruined",
"Scathed",
"Weak",
"Beaten",
"Sloshy",
"Tattered",
"Crumbling",
"Mangled",
"Pained"
]
const fatumIndex = Math.floor(Math.random() * fatum.length)
blurt({
title: 'Enemy Health',
text: fatum[fatumIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
else{
blurt({
title: 'Error',
text: "No fate selected.",
type: 'error',
okButtonText: 'Uh oh',
escapable: true
});
}
}
function rollActivities() {
selectedActivityType = document.getElementById("creatureSelect").value;
if(selectedActivityType == "Mindless"){
const activity = [
"Being eaten/consumed",
"Being killed/butchered/harvested",
"Blind/lame/insensate",
"Congregating/amassing/clustering",
"Consuming/eating/feeding",
"Decoy/construct/fake/illusion",
"Digging/burrowing",
"Diseased/sick/poisoned",
"Dismembering/taking apart",
"Dying/dead",
"Fighting/battling",
"Frenzied/berserk/rabid",
"Giving birth/hatching/dividing",
"Going in circles/lost",
"Killing/butchering",
"Meandering aimlessly",
"Mutated/conjoined/albino",
"Nothing",
"Tangled/stuck",
"Trapped/caged"
]
const activityIndex = Math.floor(Math.random() * activity.length)
blurt({
title: 'What are those creatures doing?',
text: activity[activityIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
else if(selectedActivityType == "Animalistic"){
const activity = [
"Being eaten/consumed",
"Being killed/butchered/harvested",
"Blind/lame/insensate",
"Congregating/amassing/clustering",
"Consuming/eating/feeding",
"Decoy/construct/fake/illusion",
"Digging/burrowing",
"Diseased/sick/poisoned",
"Dismembering/taking apart",
"Dying/dead",
"Fighting/battling",
"Frenzied/berserk/rabid",
"Giving birth/hatching/dividing",
"Going in circles/lost",
"Killing/butchering",
"Meandering aimlessly",
"Mutated/conjoined/albino",
"Nothing",
"Tangled/stuck",
"Trapped/caged",
"Being eaten/consumed",
"Being killed/butchered/harvested",
"Blind/lame/insensate",
"Congregating/amassing/clustering",
"Consuming/eating/feeding",
"Decoy/construct/fake/illusion",
"Digging/burrowing",
"Diseased/sick/poisoned",
"Dismembering/taking apart",
"Dying/dead",
"Fighting/battling",
"Frenzied/berserk/rabid",
"Giving birth/hatching/dividing",
"Going in circles/lost",
"Killing/butchering",
"Meandering aimlessly",
"Mutated/conjoined/albino",
"Nothing",
"Tangled/stuck",
"Trapped/caged",
"Caring for/watching over someone",
"Chasing/pursuing",
"Competing/challenging/tourneying",
"Crying/mourning",
"Displaying/signaling/calling",
"Feasting/gorging",
"Fleeing/routing",
"Foraging/seeking food",
"Gathering or marshalling resources",
"Grooming/preening/dressing up",
"Having a psychotic episode",
"Huddling/cuddling/comforting",
"Marking territory/claiming land",
"Mating/flirting/trysting",
"Migrating/moving to a new home",
"Patrolling/guarding/watching",
"Playing/frolicking/gaming/sporting",
"Quarreling/scuffling/arguing",
"Resting/meditating",
"Searching/seeking",
"Seeking shelter or higher ground",
"Sleeping/napping",
"Stalking/tracking",
"Starving/begging",
"Stumbling around disoriented",
"Taking care of young/children",
"Training/trained/domesticated",
"Undead version of creature",
"Wandering/drifting",
"Wounded/injured",
"Caring for/watching over someone",
"Chasing/pursuing",
"Competing/challenging/tourneying",
"Crying/mourning",
"Displaying/signaling/calling",
"Feasting/gorging",
"Fleeing/routing",
"Foraging/seeking food",
"Gathering or marshalling resources",
"Grooming/preening/dressing up",
"Having a psychotic episode",
"Huddling/cuddling/comforting",
"Marking territory/claiming land",
"Mating/flirting/trysting",
"Migrating/moving to a new home",
"Patrolling/guarding/watching",
"Playing/frolicking/gaming/sporting",
"Quarreling/scuffling/arguing",
"Resting/meditating",
"Searching/seeking",
"Seeking shelter or higher ground",
"Sleeping/napping",
"Stalking/tracking",
"Starving/begging",
"Stumbling around disoriented",
"Taking care of young/children",
"Training/trained/domesticated",
"Undead version of creature",
"Wandering/drifting",
"Wounded/injured",
]
const activityIndex = Math.floor(Math.random() * activity.length)
blurt({
title: 'What are those creatures doing?',
text: activity[activityIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
else if(selectedActivityType == "Intelligent"){
const activity = [
"Being eaten/consumed",
"Being killed/butchered/harvested",
"Blind/lame/insensate",
"Congregating/amassing/clustering",
"Consuming/eating/feeding",
"Decoy/construct/fake/illusion",
"Digging/burrowing",
"Diseased/sick/poisoned",
"Dismembering/taking apart",
"Dying/dead",
"Fighting/battling",
"Frenzied/berserk/rabid",
"Giving birth/hatching/dividing",
"Going in circles/lost",
"Killing/butchering",
"Meandering aimlessly",
"Mutated/conjoined/albino",
"Nothing",
"Tangled/stuck",
"Trapped/caged",
"Caring for/watching over someone",
"Chasing/pursuing",
"Competing/challenging/tourneying",
"Crying/mourning",
"Displaying/signaling/calling",
"Feasting/gorging",
"Fleeing/routing",
"Foraging/seeking food",
"Gathering or marshalling resources",
"Grooming/preening/dressing up",
"Having a psychotic episode",
"Huddling/cuddling/comforting",
"Marking territory/claiming land",
"Mating/flirting/trysting",
"Migrating/moving to a new home",
"Patrolling/guarding/watching",
"Playing/frolicking/gaming/sporting",
"Quarreling/scuffling/arguing",
"Resting/meditating",
"Searching/seeking",
"Seeking shelter or higher ground",
"Sleeping/napping",
"Stalking/tracking",
"Starving/begging",
"Stumbling around disoriented",
"Taking care of young/children",
"Training/trained/domesticated",
"Undead version of creature",
"Wandering/drifting",
"Wounded/injured",
"Bathing/bathroom break",
"Bestowing honors/awards",
"Betraying/backstabbing",
"Building/breaking ground",
"Bullying/taunting/teasing",
"Burying/having a funeral",
"Buying/arranging to purchase",
"Camping/making camp",
"Caring for/maintaining tools",
"Celebrating/partying/dancing"
]
const activityIndex = Math.floor(Math.random() * activity.length)
blurt({
title: 'What are those creatures doing?',
text: activity[activityIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
else{
blurt({
title: 'Error',
text: "No type selected.",
type: 'error',
okButtonText: 'Uh oh',
escapable: true
});
}
}
function rollModifiers() {
const modifiers= [
"Reactive Antimagic Zone - once a spell has been cast in the battlefield, no further spells may be cast there until the fight is over.",
"Antimagic Zone - no spells can be cast in the area until the fight is over.",
"Wild Magic Storm - roll on the Wild Magic effects table every time a spell is cast.",
"Corrupted Soil - all movement made on foot deals 1d4 necrotic damage for every 5ft covered. The damage increases to 2d4 at 5th character level, 3d4 at 10th level, and 4d4 at 15th level.",
"Blinding Radiance - all creatures with sunlight sensitivity are completely blind. Undead creatures take 20 radiant damage every turn.",
"Necrotic Shroud - non-undead creatures gain a vulnerability to necrotic damage and come back to life as zombies when killed. Undead creatures have advantage on attack rolls and ability checks.",
"Wicked Thunderbolts - assign a number to every creature and roll a die with that amount of sides. The number rolled has to succeed on a DC 15 DEX saving throw or get hit by a 4d10 lightning damage thunderbolt. Make this roll at the beginning and end of a round.",
"Raging Storms - flying speed is nullified. Ranged attacks are made at disadvantage. Lightning and Cold damage bypass resistances (but not immunities).",
"Fey Field - whenever any creature finishes its turn, it must succeed on a DC 15 CHA saving throw or be teleported to a random location on the battlemap. Fey creatures (or those with fey ancestry) make the saving throw with advantage.",
"Aura of Healing - a healing spirit floats around the battlefield, searching for the wounded. Once a round is over, the last creature to have taken damage receives Xd6+X healing, with X corresponding to its level.",
"Strong Winds - flying speed is nullified. Ranged attacks are made at disadvantage.",
"Foggy Terrain - roll 1d4+2. Place that many fog clouds all over the battlefield. They'll disperse once the fight is over.",
"Magical Mist - the battlefield is covered in a mist that lightly obscures the vision of all creatures present. It is also highly explosive. If a damaging spell is cast inside of the mist, it will cause a reaction that deals 2d12 force damage to everyone inside. Once that happens or combat is over, the mist disperses.",
"Aura of Harming - a harmful spirit floats around the battlefield, looking for those yet unharmed. Once a round is over, creatures who didn't take any damage receive Xd6+X damage that bypasses resistances and immunities, with X corresponding to their levels.",
"Earth Tremors - burrowing speed is nullified. At the beginning of any standing creature's turn, it must succeed on a DC 12 STR saving throw or fall prone and take 1d12 bludgeoning damage.",
"Slippery Ice - the surface of the battlefield is encased in ice that can be melted with fire damage. The ice counts as difficult terrain. Creatures who begin their turn on the ice must succeed on a DC 12 DEX saving throw or fall prone and take 1d8 cold damage.",
"Twisting Vines - strange plants sprout onto the battlefield in random spots. Going 10ft near them forces out a DC 14 STR saving throw. Upon failure, a creature is grappled by the vines.",
"Guiding Wind - all ranged attack rolls are made at advantage. For the duration of the fight, ''Guiding Bolt'' becomes a 100% hit spell (like Magic Missile).",
"Vampiric Hunger - all physical attacks restore the attacker's hit points by an amount equal to damage dealt. Doesn't work against undead or constructs.",
"Deafening Quiet - the battlefield becomes encased inside of a bubble that resembles the ''Silence'' spell. Thunder damage is nullified, no sounds can be heard, and spells with verbal components cannot be cast.",
"Scorching Heat - all fire damage bypasses resistances and inflicts burning upon failing a DC 12 CON save (deals 1d6 fire damage every turn, makes target vulnerable to fire damage)",
"Mechanus Intervention - creatures from the mechanus plane become overseers of the battle that's taking place. No critical successes or critical failures can occur (they must be rerolled).",
"Eldritch Whispers - creatures with an INT score above 3 make a DC 14 INT saving throw at the start of their turns. Upon failure, they go insane from forbidden knowledge being poured into their minds, suffering 1d12 psychic damage and losing their turns, while also having to repeat the saving throw every other turn. Once they succeed, however, they are immune to the effect for the rest of the fight.",
"Twisted Force - until the end of combat, force damage bypasses resistances and immunities.",
"Lucky Charm - all creatures on the battlefield can reroll their natural ones.",
"Low Gravity - jump height and/or distance of all creatures is tripled.",
"Sudden Death - death saving throws are disabled. Whenever someone drops to 0 hit points, they instantly die.",
"Disintegration Field - creatures who drop to 0 hit points during this fight are disintegrated.",
"Aura of Vulnerability - all creatures present on the battlefield become vulnerable to all damage types.",
"Aura of Resistance - all creatures present on the battlefield become resistant to all damage types.",
"Life Drain - every time a creature takes damage, it gains a level of exhaustion, capping at level 6 - which is when the creature finally dies. All exhaustion levels gained this way are instantly dropped the moment combat is over.",
"Dogfight - all creatures gain a 60ft flying speed for the rest of the battle. Creatures who already had it merely increase their flight speed by said amount.",
"Cruel Crits - critical hit range for all creatures is expanded by 1. For example: creatures with already expanded range, such as 18-19, will now crit on a roll of 17-19."
]
const modifiersIndex = Math.floor(Math.random() * modifiers.length)
blurt({
title: 'Modifier',
text: modifiers[modifiersIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function rollVariants() {
const variants= [
"Cursed - radiant resistance, attacks deal bonus 1d8 necrotic damage, vulnerable to fire, cold, poison, acid, and lightning damage. Attacks can spread the curse if the target fails a DC 10 WIS saving throw. A ''Remove Curse'' spell can undo it.",
"Diseased - physical attacks force targets to make DC 14 CON saving throws. Upon failure, the target contracts Cackle Fever/Sewer Plague/Sight Rot (at random).",
"Blessed - necrotic resistance, attacks deal bonus 1d4 radiant damage, has a rechargable (5-6) heal beam with a range of 60ft that heals an ally for 10d4+10 hit points.",
"Blazing - fire resistance, attacks deal bonus 1d6 fire damage. Can summon a 60ft/120ft range AOE fire pillar with the area of a 15ft cube. DC 15 DEX saving throw or you take 4d6 fire damage. Upon success, you only take half. ",
"Infernal - fire immunity, attacks deal bonus 2d6 fire damage. Can cast fireball with a 5-6 recharge.",
"Fiendish - immune to fire, poison and being charmed, resists cold and bludgeoning/piercing/slashing made with non-silvered or non-magical weapons. Can cast Hellish Rebuke at will.",
"Mutant - has 1d4 special traits taken from other creature stat blocks. Highest ability score is increased by 10, and the lowest decreased by 5.",
"Draconic - immune to a damage type correlated to scale colour. Can spread wings for 1 minute as a bonus action (60ft flying speed). Has a rechargable (5-6) 15ft cone breath weapon with a DC 16 DEX or CON saving throw that deals 6d8 damage (depending on damage type).",
"Glacial - cold resistance, attacks deal bonus 1d8 cold damage. Can cast the Ray of Frost cantrip at 11th level and with a +10 to-hit modifier.",
"Iceborne - cold immunity, attacks deal bonus 2d8 cold damage and force out a DC 16 CON save against being frozen (restrained, disadvantage on all melee/ranged attacks).",
"Fey-Touched - advantage on CHA saving throws, can cast Misty Step at will.",
"Mechanus-Touched - cannot roll a natural one, but cannot roll a natural twenty either.",
"Savage Sortilege - the creature's spell attacks crit on a roll of 19 or 20. Furthermore, if something rolls a natural 1 or 2 on a saving throw against that creature's spell, it takes double damage.",
"Savage - this creature critically hits on a roll of 18, 19 or 20.",
"Frenzied - blindly rushes to attack the nearest creature, no matter if it's friend or foe. Its melee attack rolls are always critical hits.",
"Vampiric - the creature's melee weapon or natural attacks heal it for the amount of hit points equal to damage dealt. Doesn't work against undead or constructs.",
"Chosen by a deity - after dying, comes back to life with 50% of maximum health and all wounds and ailments cured. Only once per battle.",
"Sparking - lightning resistance, attacks deal bonus 1d12 lightning damage. Has a doubled movement speed.",
"Lightning Rod - lightning immunity (heals from lightning damage), attacks deal bonus 1d12 lightning damage. Can cast a rechargable (5-6) Lightning Bolt spell and even target himself to heal for the amount of damage rolled.",
"Partially Magicproof - immune to spells of a level lower than 6.",
"Magically Resistant - advantage on saving throws against magic.",
"Deflector - all ranged weapon attacks are deflected back at the shooter if they hit.",
"Magic Mirror - all ranged spell attacks are deflected back at the caster if they hit.",
"Fortified - resistant to all damage types except a randomly selected one - Roll a d12: (1 - Bludgeoning, 2 - Piercing, 3 - Slashing, 4 - Fire, 5 - Cold, 6 - Poison, 7 - Acid, 8 - Lightning, 9 - Force, 10 - Radiant, 11 - Necrotic, 12 - Thunder).",
"Elemental - immune to fire, cold, poison, acid and lightning damage.",
"Blastproof - immune to thunder damage, resistant to force damage, cannot be moved against its will.",
"Eagle-Eyed - ranged attacks have twice the range and are made at advantage when fired from at least 100ft away.",
"Spell Mimic - can cast any spell it sees used in battle and does so at will, without needing material components.",
"Fast Learner - has advantage on saving throws it previously failed. Attack rolls that hit it will be made at disadvantage the next time.",
"Evasive - takes only half damage when failing a saving throw, and takes no damage when succeeding. Can use its reaction to halve the damage of an incoming attack.",
"Agile - has advantage on DEX saving throws and can dash as a bonus action. Doesn't provoke opportunity attacks.",
"Indomitable - has a rechargeable (5-6) ability that allows it to automatically succeed on a saving throw.",
"Fearless - immune to being frightened, has advantage on attack rolls made against creatures larger than itself.",
"Inspiring - has a rechargeable (5-6) ability that allows it to add +10 to an ally's ability check, saving throw or attack roll.",
"Tough - its hit points are twice of that creature's typical average.",
"Resilient - makes all saving throws with advantage.",
"Teleporting - can cast Misty Step at will, but suffers a -2 AC penalty.",
"Immune to Magic - unaffected by spells of all kinds, even healing or divination.",
"Bulky - resistant to bludgeoning, piercing and slashing damage.",
"Demonic - immune to two random damage types, has two special traits of other demons, can cast three 1d4th level spells at will (roll for each one).",
"Celestial - immune to radiant damage, attacks deal an additional 1d8 radiant damage. Below 10th level/CR, can cast Guiding Bolt or Cure Wounds (mutually exclusive) on a recharge of 5-6. At 10th level/CR, can cast Sunbeam or Heal (mutually exclusive) on a recharge of 5-6.",
"Automaton - actually a construct that merely resembles said creature. Has +1 to its AC, is immune to poison damage and being poisoned, can be healed with Mending. Doesn't need to eat, sleep, or drink. Can be a target of heat metal.",
"Undead - undead version of said creature. If it doesn't have one, it instead gains a necrotic immunity, an added 2d6 necrotic damage to all of its attacks, a Turn Resistance, and a 50% chance to come back from the dead after being struck down with anything other than radiant damage."
]
const variantsIndex = Math.floor(Math.random() * variants.length)
blurt({
title: 'Variant',
text: variants[variantsIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function rollMorale() {
const morale= [
"Will surrender after heavy casualties",
"Will surrender after heavy casualties",
"Will surrender after heavy casualties",
"Will try to run away after heavy casualties",
"Will try to run away after heavy casualties",
"Will surrender after light casualties",
"Will try to run away after light casualties",
"Will tactically retreat and come back after light casualties.",
"Will run away and plan an ambush after heavy casualties",
"Will surrender after monetary loss",
"Will run away after monetary loss",
"Will run away after monetary loss",
"Will run away after monetary loss",
"Will surrender if equipment deteriorates",
"Will run away if equipment deteriorates",
"Will surrender if enough resources have been expended",
"Will run away if enough resources have been expended",
"Will run away if enough resources have been expended",
"Will run away if enough resources have been expended",
"Will surrender after failing its objective",
"Will surrender after failing its objective",
"Will run away after failing its objective",
"Will fight to the death",
"Will fight to the death",
"Will fight to the death",
"Will fight to the death",
"Will fight to the death",
"Will fight to the death",
"Will fight to the death",
"Will fight to the death",
"Will fight to the death",
"Will fight to the death",
"Will negotiate peace at advantage",
"Will negotiate peace at advantage",
"Will negotiate surrender at disadvantage",
"Will negotiate surrender at disadvantage",
"Will negotiate surrender at disadvantage",
"Will bargain mid-fight",
"Will beg for mercy at disadvantage",
"Will beg for mercy at disadvantage",
"Doesn't want to fight. Can be persuaded to flee/surrender.",
"Doesn't want to fight. Can be persuaded to flee/surrender.",
"Doesn't want to fight. Can be persuaded to flee/surrender."
]
const moraleIndex = Math.floor(Math.random() * morale.length)
blurt({
title: 'Morale',
text: morale[moraleIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function rollMotivation() {
const motivation= [
"Material Gain",
"Material Gain",
"Material Gain",
"Material Gain",
"Material Gain",
"Material Gain",
"Material Gain",
"Material Gain",
"Material Gain",
"Material Gain",
"Material Gain",
"Material Gain",
"Honour",
"Honour",
"Glory",
"Glory",
"Glory",
"Glory",
"Glory",
"Domination",
"Domination",
"Domination",
"Domination",
"Domination",
"Wrath",
"Wrath",
"Wrath",
"Order/Duty",
"Order/Duty",
"Order/Duty",
"Order/Duty",
"Order/Duty",
"Order/Duty",
"Personal Investment",
"Survival",
"Survival",
"Survival",
"Bloodlust",
"Bloodlust",
"Project power",
"Project power",
"Project power",
"Cause fear",
"Cause fear",
"Reach a place",
"Escape from a place"
]
const motivationIndex = Math.floor(Math.random() * motivation.length)
blurt({
title: 'Motivation',
text: motivation[motivationIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function rollInitiative() {
const initiative= [
"Players go first",
"Enemies go first",
"Alphabetical order",
"Side with a higher sum of initiative rolls goes first",
"Roll normally, but flip the order (last goes first)",
"Low hit points priority. The less you have, the earlier you move",
"High hit points priority. The more you have, the earlier you move",
"Start off normally, and roll on this table in round 2",
"Roll on this table every round",
"Reroll player initiative every round",
"Reroll enemy initiative every round",
"Roll neutral initiative for everyone (no buffs or debuffs)",
"Reroll initiative after every death",
"Flip a coin to see which side goes first",
"Best out of 3 coinflips goes first",
"Flip a coin to see which side rolls with advantage",
"Players roll with advantage",
"Enemies roll with advantage",
"Enemies get two turns, but Players roll with advantage",
"Players go first, but Enemies have two turns"
]
const initiativeIndex = Math.floor(Math.random() * initiative.length)
blurt({
title: 'Initiative',
text: initiative[initiativeIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function rollArchetype() {
const archetypes= [
"Protector - tanks enemy attacks, blocks enemies, shields allies, stays close to the team (e.g. Paladin, Cleric, Barbarian, Fighter, Druid)",
"Mauler - deals damage by any means neccessary, acts recklessly and wastes resources immediately (e.g. Fighter, Barbarian, Sorcerer, Warlock)",
"Zoner - maintains distance, uses ranged attacks, resorts to ambushes or environmental kills when at close range (e.g. Ranger, Rogue, Fighter, Wizard, Sorcerer, Warlock)",
"Support - uses utility spells or items to buff their allies or cripple their enemies, heals using spells/healer's kit/potions (e.g. Cleric, Druid, Bard)",
"Controller - handles multiple enemies at a time, will alter the battlefield if they're a spellcaster, focuses mainly on effective placement and depleting enemy resources (e.g. Wizard, Druid)",
"Assassin - usually stealthy, deals heavy single-target damage, picks off enemies one by one (e.g. Rogue, Ranger, Paladin)"
]
const archetypesIndex = Math.floor(Math.random() * archetypes.length)
blurt({
title: 'Archetype',
text: archetypes[archetypesIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function rollGear() {
const gear= [
"Healing Potion(s)",
"Healing Potion(s)",
"Healing Potion(s)",
"Healing Potion(s)",
"Healing Potion(s)",
"Healing Potion(s)",
"Healing Potion(s)",
"Healing Potion(s)",
"Healing Potion(s)",
"Healing Potion(s)",
"Strength Potion(s)",
"Strength Potion(s)",
"Resistance Potion(s)",
"Resistance Potion(s)",
"Resistance Potion(s)",
"Resistance Potion(s)",
"Resistance Potion(s)",
"Resistance Potion(s)",
"Smoke Grenade (Fog Cloud)",
"Fire Grenade (mini fireball)",
"Smoke Grenade (Fog Cloud)",
"Fire Grenade (mini fireball)",
"Smoke Grenade (Fog Cloud)",
"Fire Grenade (mini fireball)",
"Smoke Grenade (Fog Cloud)",
"Fire Grenade (mini fireball)",
"Smoke Grenade (Fog Cloud)",
"Fire Grenade (mini fireball)",
"Smoke Grenade (Fog Cloud)",
"Fire Grenade (mini fireball)",
"Shocking Grenade (mini shatter, but lightning)",
"Shocking Grenade (mini shatter, but lightning)",
"Shocking Grenade (mini shatter, but lightning)",
"Shocking Grenade (mini shatter, but lightning)",
"Shocking Grenade (mini shatter, but lightning)",
"Shocking Grenade (mini shatter, but lightning)",
"Acid Grenade (AOE acid damage)",
"Acid Grenade (AOE acid damage)",
"Acid Grenade (AOE acid damage)",
"Acid Grenade (AOE acid damage)",
"Acid Grenade (AOE acid damage)",
"Acid Grenade (AOE acid damage)",
"Jar of Grease",
"Jar of Grease",
"Jar of Grease",
"Jar of Grease",
"Jar of Grease",
"Jar of Grease",
"Alcohol Bottle(s)",
"Alcohol Bottle(s)",
"Net",
"Holy Symbol",
"Holy Symbol",
"Crowbar",
"Crowbar",
"Net",
"Net",
"Net",
"Snare",
"Snare",
"Snare",
"Snare",
"Smelling Salts",
"Smudge Sticks",
"Holy Water",
"Mirror",
"Rope",
"Rope",
"Rope",
"Rope",
"Rope with Hook",
"Rope with Hook",
"Rope with Hook",
"Rope with Hook",
"Rope with Hook",
"Rope with Hook",
"Nailbomb Grenade (piercing that bypasses AC)",
"Nailbomb Grenade (piercing that bypasses AC)",
"Nailbomb Grenade (piercing that bypasses AC)",
"Nailbomb Grenade (piercing that bypasses AC)",
"Nailbomb Grenade (piercing that bypasses AC)",
"Nailbomb Grenade (piercing that bypasses AC)",
"Oil of Etherealness",
"Oil of Sharpness",
"Oil of Sharpness",
"Poison Vial",
"Poison Vial",
"Poison Vial",
"Poison Vial",
"Poison Flask",
"Poison Flask",
"Poison Flask",
"Poison Flask",
"Poison Flask",
"Poison Flask",
"Special Arrows/Bolts (flaming/poisoned/thunder/etc)",
"Special Arrows/Bolts (flaming/poisoned/thunder/etc)",
"Special Arrows/Bolts (flaming/poisoned/thunder/etc)",
"Special Arrows/Bolts (flaming/poisoned/thunder/etc)",
"Oil Flask",
"Oil Flask",
"Oil Flask",
"Oil Flask",
"Oil Flask",
"Oil Flask",
"+1 Armor",
"+1 Armor",
"+1 Armor",
"+2 Armor",
"+2 Armor",
"+3 Armor",
"+1 Shield",
"+2 Shield",
"+3 Shield",
"Deployable Trap",
"Deployable Trap",
"Deployable Trap",
"Deployable Trap",
"Runepowder Bomb(s)",
"Runepowder Bomb(s)",
"Runepowder Bomb(s)",
"Healer's Kit",
"Healer's Kit",
"Healer's Kit",
"Healer's Kit",
"Healer's Kit",
"Thieves' Tools",
"Thieves' Tools",
"Thieves' Tools",
"Thieves' Tools",
"Thieves' Tools",
"Thieves' Tools",
"Vehicle",
"Grappling Gun",
"Spell Scroll (1st level)",
"Spell Scroll (1st level)",
"Spell Scroll (1st level)",
"Spell Scroll (1st level)",
"Spell Scroll (1st level)",
"Spell Scroll (1st level)",
"Spell Scroll (1st level)",
"Spell Scroll (1st level)",
"Spell Scroll (1st level)",
"Spell Scroll (1st level)",
"Spell Scroll (1st level)",
"Spell Scroll (2nd level)",
"Spell Scroll (2nd level)",
"Spell Scroll (2nd level)",
"Spell Scroll (2nd level)",
"Spell Scroll (2nd level)",
"Spell Scroll (2nd level)",
"Spell Scroll (3rd level)",
"Spell Scroll (3rd level)",
"Spell Scroll (3rd level)",
"Spell Scroll (3rd level)",
"Spell Scroll (4th level)",
"Spell Scroll (4th level)",
"Spell Scroll (5th level)",
"Spell Scroll (6th level)",
"+1 Weapon",
"+1 Weapon",
"+1 Weapon",
"+1 Weapon",
"+1 Weapon",
"+2 Weapon",
"+2 Weapon",
"+3 Weapon",
"Common Magical Item",
"Common Magical Item",
"Uncommon Magical Item",
"Rare Magical Item",
"Very Rare Magical Item"
]
const gearIndex = Math.floor(Math.random() * gear.length)
blurt({
title: 'Gear',
text: gear[gearIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function rollObstacles() {
const obstacles= [
"1d4 small features (trees, rocks, smaller objects)",
"1d4 small features (trees, rocks, smaller objects)",
"1d4 small features (trees, rocks, smaller objects)",
"1d4 small features (trees, rocks, smaller objects)",
"1 medium feature (rows of trees, boulders, larger objects)",
"1 medium feature (rows of trees, boulders, larger objects)",
"1 medium feature (rows of trees, boulders, larger objects)",
"1 medium and 1 small feature",
"1d4 linear features (walls, fences, rows of objects)",
"1d4 medium featuers and 1d4 linear features",
"1d4 large features",
"1 large features and 1d4 linear features",
"1 large feature and 1d4 medium features"
]
const obstaclesIndex = Math.floor(Math.random() * obstacles.length)
blurt({
title: 'Obstacle',
text: obstacles[obstaclesIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function rollWincon() {
const wincon= [
"Protect an NPC",
"Protect an object",
"Defend a location",
"Survive for X rounds (for example, 1d4+1)",
"Defeat all enemies (can be non-violent)",
"Subdue as many enemies as possible",
"Kill all enemies",
"Defend innocent bystanders",
"Rescue a hostage",
"Save a captive",
"Capture an enemy",
"Take an object",
"Retrieve an item",
"Destroy an object",
"Make a sacrifice",
"Escape",
"Eliminate healers first (otherwise their leader is impervious to damage)",
"Reach a specific location",
"Prevent enemies from reaching a specific location",
"Stand your ground and endure 1d4 waves",
"Make truce",
"Obtain information",
"Close a portal/gate"
]
const winconIndex = Math.floor(Math.random() * wincon.length)
blurt({
title: 'Win Condition',
text: wincon[winconIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function npcRole() {
const role= [
"Criminal",
"Healer",
"Researcher",
"Scholar",
"Foreigner",
"Merchant",
"Collector",
"Agent",
"Ambassador",
"Assassin",
"Government official",
"Adventurer",
"Judge",
"Historian",
"Mage",
"Military official",
"Rebel",
"Servant",
"Spy",
"Business owner",
"Artisan",
"Villain",
"Gang leader/member",
"Gambler",
"Traveler",
"Performance",
"Socialite",
"Mercenary",
"Leader",
"Mystic",
"Artist",
"Hunter",
"Outcast",
"Heretic",
"Guard",
"Investigator",
"Aristocrat",
"Apprentice/Student",
"Emissary",
"Fugitive",
"Law enforcement",
"Celebrity",
"Bounty hunter",
"Explorer",
"Prophet",
"Cultist",
"Innkeeper",
"Alchemist",
"Farmer",
"Smuggler",
"Wanderer",
"Outsider"
]
const roleIndex = Math.floor(Math.random() * role.length)
blurt({
title: 'NPC Role',
text: role[roleIndex],
type: 'info',
okButtonText: 'Click anywhere to exit',
escapable: true
});
}
function npcPersonality() {
const personality= [
"Stoic",
"Intolerant",
"Friendly",
"Cunning",
"Kind",
"Pious",
"Hardhearted",
"Stern",
"Wary",
"Cynical",
"Irritable",
"Nervous",
"Dangerous",
"Cheery",
"Smug",
"Clever",
"Bold",
"Tenacious",
"Cautious",
"Hot-tempered",
"Aggressive",
"Greedy",
"Obsessed",
"Secretive",
"Mischievous",
"Paranoid",
"Sarcastic",
"Aloof",
"Strong-willed",