-
Notifications
You must be signed in to change notification settings - Fork 0
/
srd.py
3234 lines (2986 loc) · 140 KB
/
srd.py
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
import os
import string
import pickle
import time
import xml.dom.minidom
import global_vars as gv
#XP Thresholds by Character Level
EasyXP = [0,25,50,75,125,250,300,350,450,550,600,800,1000,1100,1250,1400,1600,2000,2100,2400,2800]
MediumXP = [0,50,100,150,250,500,600,750,900,1100,1200,1600,2000,2200,2500,2800,3200,3900,4200,4900,5700]
HardXP = [0,75,150,225,375,750,900,1100,1400,1600,1900,2400,3000,3400,3800,4300,4800,5900,6300,7300,8500]
DeadlyXP = [0,100,200,400,500,1100,1400,1700,2100,2400,2800,3600,4500,5100,5700,6400,7200,8800,9500,10900,12700]
DailyXP = [0,300,600,1200,1700,3500,4000,5000,6000,7500,9000,10500,11500,13500,15000,18000,20000,25000,27000,30000,40000]
#These spells included in the Players Handbook Basic Rules
Basic5E_Spells = ['Acid Splash','Aid','Antimagic Field','Arcane Eye','Arcane Lock','Astral Projection',
'Augury','Beacon of Hope','Blade Barrier','Bless','Blur','Burning Hands',
'Chain Lightning','Charm Person','Command','Commune','Comprehend Languages',
'Cone of Cold','Counterspell','Cure Wounds','Dancing Lights','Darkness','Death Ward',
'Delayed Blast Fireball','Detect Magic','Detect Magic','Dimension Door','Disguise Self',
'Disintegrate','Dispel Magic','Dispel Magic','Divination','Dominate Monster',
'Dominate Person','Dream','Earthquake','Etherealness','Find the Path','Finger of Death',
'Fire Bolt','Fire Storm','Fireball','Flame Strike','Flaming Sphere','Fly','Foresight',
'Freedom of Movement','Gate','Globe of Invulnerability','Greater Invisibility',
'Greater Restoration','Guardian of Faith','Guidance','Guiding Bolt','Harm','Haste',
'Heal','Healing Word','Heroes Feast','Hold Person','Hold Person','Holy Aura',
'Ice Storm','Identify','Imprisonment','Inflict Wounds','Invisibility','Knock',
'Lesser Restoration','Levitate','Light','Light','Lightning Bolt','Locate Creature',
'Mage Armor','Mage Hand','Magic Missile','Magic Weapon','Major Image','Mass Cure Wounds',
'Mass Heal','Mass Healing Word','Mass Suggestion','Maze','Meteor Swarm',
'Minor Illusion','Misty Step','Mordenkainens Sword', "Otto's Irresistible Dance",
'Passwall','Poison Spray','Power Word Kill','Power Word Stun','Prayer of Healing',
'Prestidigitation','Protection from Energy','Protection from Energy','Raise Dead',
'Ray of Frost','Regenerate','Remove Curse','Resistance','Resurrection','Revivify',
'Sacred Flame','Sanctuary','Shatter','Shield','Shield of Faith','Shocking Grasp',
'Silence','Silent Image','Sleep','Spare the Dying','Speak with Dead','Spider Climb',
'Spirit Guardians','Spiritual Weapon','Stoneskin','Suggestion','Sunburst','Teleport',
'Thaumaturgy','Thunderwave','Time Stop','True Resurrection','True Seeing','True Seeing',
'Wall of Fire','Wall of Stone','Warding Bond','Web']
#These monsters are included in the D&D DM Basic Rules, version 0.3, retrieved 4/29/2015
Basic5E_Monsters = ["Adult Red Dragon","Air Elemental","Allosaurus","Animated Armor","Ankheg",
"Ankylosaurus","Ape","Awakened Shrub","Awakened Tree","Axe Beak ","Baboon",
"Badger","Banshee","Basilisk","Bat","Black Bear","Blink Dog","Boar","Blood Hawk",
"Brown Bear","Bugbear","Camel","Cat","Centaur","Chimera","Cockatrice ","Crab",
"Crocodile","Constrictor Snake","Cyclops","Death Dog","Deer","Dire Wolf",
"Doppelganger","Draft Horse","Earth Elemental","Elephant","Elk","Fire Elemental",
"Fire Giant","Flameskull","Flesh Golem","Flying Snake","Flying Sword","Frog",
"Frost Giant","Gargoyle","Ghost","Ghoul","Giant Ape","Giant Badger","Giant Bat",
"Giant Boar","Giant Centipede","Giant Constrictor Snake","Giant Crab",
"Giant Crocodile","Giant Eagle","Giant Elk","Giant Fire Beetle","Giant Frog",
"Giant Goat","Giant Hyena","Giant Lizard","Giant Octopus","Giant Owl",
"Giant Poisonous Snake","Giant Rat","Giant Scorpion","Giant Sea Horse",
"Giant Shark","Giant Spider","Giant Toad","Giant Vulture","Giant Wasp",
"Giant Weasel","Giant Wolf Spider","Gnoll","Goat","Goblin","Grick","Griffon",
"Harpy","Hawk","Hell Hound","Hill Giant","Hippogriff","Hobgoblin","Hunter Shark",
"Hydra","Hyena","Jackal","Killer Whale","Kobold","Lion","Lizard","Lizardfolk",
"Mammoth","Manticore","Mastiff","Medusa","Merfolk","Minotaur","Mule","Mummy",
"Nothic","Ochre Jelly","Octopus","Ogre","Orc","Owl","Owlbear","Panther","Pegasus",
"Phase Spider","Plesiosaurus","Poisonous Snake","Polar Bear","Pony","Pteranodon",
"Quipper","Rat","Raven","Reef Shark","Rhinoceros","Riding Horse",
"Saber-Toothed Tiger","Satyr","Scorpion","Sea Horse","Skeleton","Spectator",
"Spider","Stirge","Stone Golem","Swarm of Bats","Swarm of Insects",
"Swarm of Poisonous Snakes","Swarm of Quippers","Swarm of Rats","Swarm of Ravens",
"Tiger","Triceratops","Troll","Twig blight","Tyrannosaurus Rex","Vulture",
"Warhorse","Water Elemental","Weasel","Werewolf","Wight","Winter Wolf","Wolf",
"Worg","Wyvern","Yeti","Young Green Dragon","Zombie"]
#These spells included in the Hoard of the Dragon Queen Online Supplement, retrieved 5/8/15
HotDQ_5E_Spells = ['Animal Friendship','Antimagic Shell','Barkskin','Beast Sense','Blindness/Deafness',
'Calm Emotions','Chromatic Orb','Color Spray','Confusion','Counterspell','Daylight',
'Detect Evil and Good','Detect Thoughts','Disguise Self','Druidcraft','Entangle',
'Evards Black Tentacles','Feather Fall','Fog Cloud','Gaseous Form','Gust of Wind',
'Insect Plague','Longstrider','Mirror Image','Mislead','Phantasmal Force','Plant Growth',
'Poison Spray','Scorching Ray','Seeming','Sending','Shatter','Sleet Storm','Spike Growth',
'Wall of Fire','Water Walk']
#These monsters included in the Hoard of the Dragon Queen Online Supplement, retrieved 5/8/15
HotDQ_5E_Monsters = ['Acolyte','Adult Blue Dragon','Adult White Dragon','Air Elemental','Assassin','Bandit',
'Berserker','Bullywug','Commoner','Crocodile','Cultist','Deer','Doppleganger','Elk',
'Ettercap','Gargoyle','Giant Centipede','Giant Frog','Giant Lizard','Giant Spider','Gray Ooze',
'Griffon','Guard','Helmed Horror','Hobgoblin','Hobgoblin Captain','Knight','Kobold',
'Lizardfolk','Mage','Noble','Ogre','Orc','Otyugh','Peryton','Priest','Roper','Rug of Smothering',
'Scout','Shambling Mound','Specter','Spy','Stirge','Stone Giant','Stone Golem','Swarm of Insects',
'Swarm of Rats','Troglodyte','Troll','Vampire','Vampire Spawn','Veteran','Violet Fungus','Will o Wisp',
'Winged Kobold','Wyvern','Yuan-Ti Malison','Yuan-Ti Pureblood']
#These spells included in the Rise of Tiamat Online Supplement, retrieved 5/8/15
RoT_5E_Spells = ['Animal Messenger','Animate Dead','Animate Objects','Call Lightning','Chromatic Orb','Cloud of Daggers',
'Cloudkill','Color Spray','Confusion','Continual Flame','Detect Thoughts','Divine Word','Enlarge/Reduce',
'Evards Black Tentacles','Feather Fall','Fire Shield','Gaseous Form','Glyph of Warding','Hold Monster',
'Legend Lore','Magic Jar','Magic Mouth','Mirror Image','Mislead','Move Earth','Phantasmal Force','See Invisibility',
'Seeming','Sending','Slow','Speak with Animals','Speak with Plants','Stinking Cloud','Stone Shape',
'Water Breathing','Wish','Zone of Truth']
#These monsters included in the Rise of Tiamat Online Supplement, retrieved 5/8/15
RoT_5E_Monsters = ['Adult White Dragon','Air Elemental','Animated Armor','Assassin','Awakened Tree','Barbed Devil','Bearded Devil',
'Bone Devil','Chimera','Chuul','Clay Golem','Commoner','Cultist','Cult Fanatic','Cyclops','Dao','Druid',
'Earth Elemental','Efreeti','Ettercap','Ettin','Fire Elemental','Ghost','Giant Octopus','Gladiator','Gorgon',
'Guard','Helmed Horror','Knight','Kobold',
'Lizardfolk','Mage','Merrow','Mummy','Mummy Lord','Noble','Ogre','Otyugh','Polar Bear','Pseudodragon',
'Specter','Succubus','Swarm of Poisonous Snakes','Swarm of Ravens','Tribal Warrior','Troll','Vampire',
'Vampire Spawn','Warhorse','Water Elemental','Wight','Wolf','Wraith',
'Yuan-Ti Abomination','Yuan-Ti Malison','Yuan-Ti Pureblood']
#These spells included in the Elemental Evil Players Companion, retrieved 3/17/15
ElementalEvil_5E_Spells = ['Abi-Dalzims horrid wilting','Absorb elements', 'Aganazzars scorcher','Beast bond','Bones of the earth',
'Catapult','Control flames','Control winds','Create bonfire','Dust devil','Earth tremor','Earthbind',
'Elemental bane','Erupting earth','Flame arrows','Frostbite','Gust','Ice knife','Immolation','Investiture of flame',
'Investiture of ice','Investiture of stone','Investiture of wind','Maelstrom','Magic stone','Maximilians earthen grasp',
'Melfs minute meteors','Mold earth','Primordial ward','Pyrotechnics','Shape water','Skywrite','Snillocs snowball swarm',
'Storm sphere','Thunderclap','Tidal wave','Transmute rock','Vitriolic sphere','Wall of sand','Wall of water',
'Warding wind','Watery sphere','Whirlwind']
ElementalEvil_5E_Monsters = []
PotA_5E_Spells = []
PotA_5E_Monsters = []
#These spells are included in the 5th Edition OGL
Bard_0_Spells = ['Dancing Lights','Light','Mage Hand','Mending','Message','Minor Illusion','Prestidigitation','True Strike']
Bard_1_Spells = ['Charm Person','Comprehend Languages','Cure Wounds','Detect Magic','Disguise Self','Faerie Fire','Feather Fall','Healing Word','Heroism','Hideous Laughter','Identify','Illusory Script','Longstrider','Silent Image','Sleep','Speak with Animals','Thunderwave','Unseen Servant']
Bard_2_Spells = ['Animal Messenger','Blindness/Deafness','Calm Emotions','Detect Thoughts','Enhance Ability','Enthrall','Heat Metal','Hold Person','Invisibility','Knock','Lesser Restoration','Locate Animals or Plants','Locate Object','Magic Mouth','See Invisibility','Shatter','Silence','Suggestion','Zone of Truth']
Bard_3_Spells = ['Bestow Curse','Clairvoyance','Dispel Magic','Fear','Glyph of Warding','Hypnotic Pattern','Major Image','Nondetection','Plant Growth','Sending','Speak with Dead','Speak with Plants','Stinking Cloud','Tiny Hut','Tongues']
Bard_4_Spells = ['Confusion','Dimension Door','Freedom of Movement','Greater Invisibility','Hallucinatory Terrain','Locate Creature','Polymorph']
Bard_5_Spells = ['Animate Objects','Awaken','Dominate Person','Dream','Geas','Greater Restoration','Hold Monster','Legend Lore','Mass Cure Wounds','Mislead','Modify Memory','Planar Binding','Raise Dead','Scrying','Seeming','Teleportation Circle']
Bard_6_Spells = ['Eyebite','Find the Path','Guards and Wards','Irresistible Dance','Mass Suggestion','Programmed Illusion','True Seeing']
Bard_7_Spells = ['Arcane Sword','Etherealness','Forcecage','Magnificent Mansion','Mirage Arcane','Project Image','Regenerate','Resurrection','Symbol','Teleport']
Bard_8_Spells = ['Dominate Monster','Feeblemind','Glibness','Mind Blank','Power Word Stun']
Bard_9_Spells = ['Foresight','Power Word Kill','True Polymorph']
Cleric_0_Spells = ['Guidance','Light','Mending','Resistance','Sacred Flame','Thaumaturgy']
Cleric_1_Spells = ['Bane','Bless','Command','Create or Destroy Water','Cure Wounds','Detect Evil and Good','Detect Magic','Detect Poison and Disease','Guiding Bolt','Healing Word','Inflict Wounds','Protection from Evil and Good','Purify Food and Drink','Sanctuary','Shield of Faith']
Cleric_2_Spells = ['Aid','Augury','Blindness/Deafness','Calm Emotions','Continual Flame','Enhance Ability','Find Traps','Gentle Repose','Hold Person','Lesser Restoration','Locate Object','Prayer of Healing','Protection from Poison','Silence','Spiritual Weapon','Warding Bond','Zone of Truth']
Cleric_3_Spells = ['Animate Dead','Beacon of Hope','Bestow Curse','Clairvoyance','Create Food and Water','Daylight','Dispel Magic','Glyph of Warding','Magic Circle','Mass Healing Word','Meld into Stone','Protection from Energy','Remove Curse','Revivify','Sending','Speak with Dead','Spirit Guardians','Tongues','Water Walk']
Cleric_4_Spells = ['Banishment','Control Water','Death Ward','Divination','Freedom of Movement','Locate Creature','Stone Shape']
Cleric_5_Spells = ['Commune','Contagion','Dispel Evil and Good','Flame Strike','Geas','Greater Restoration','Hallow','Insect Plague','Legend Lore','Mass Cure Wounds','Planar Binding','Raise Dead','Scrying']
Cleric_6_Spells = ['Blade Barrier','Create Undead','Find the Path','Forbiddance','Harm','Heal','Heroes Feast','Planar Ally','True Seeing','Word of Recall']
Cleric_7_Spells = ['Conjure Celestial','Divine Word','Etherealness','Fire Storm','Plane Shift','Regenerate','Resurrection','Symbol']
Cleric_8_Spells = ['Antimagic Field','Control Weather','Earthquake','Holy Aura']
Cleric_9_Spells = ['Astral Projection','Gate','Mass Heal','True Resurrection']
Druid_0_Spells = ['Guidance','Mending','Produce Flame','Resistance','Shillelagh']
Druid_1_Spells = ['Charm Person','Create or Destroy Water','Cure Wounds','Detect Magic','Detect Poison and Disease','Entangle','Faerie Fire','Fog Cloud','Healing Word','Jump','Longstrider','Purify Food and Drink','Speak with Animals','Thunderwave']
Druid_2_Spells = ['Animal Messenger','Barkskin','Darkvision','Enhance Ability','Find Traps','Flame Blade','Flaming Sphere','Gust of Wind','Heat Metal','Hold Person','Lesser Restoration','Locate Animals or Plants','Locate Object','Moonbeam','Pass without Trace','Protection from Poison','Spike Growth']
Druid_3_Spells = ['Call Lightning','Conjure Animals','Daylight','Dispel Magic','Meld into Stone','Plant Growth','Protection from Energy','Sleet Storm','Speak with Plants','Water Breathing','Water Walk','Wind Wall']
Druid_4_Spells = ['Blight','Confusion','Conjure Minor Elementals','Conjure Woodland Beings','Control Water','Dominate Beast','Freedom of Movement','Giant Insect','Hallucinatory Terrain','Ice Storm','Locate Creature','Polymorph','Stone Shape','Stoneskin','Wall of Fire']
Druid_5_Spells = ['Antilife Shell','Awaken','Commune with Nature','Conjure Elemental','Contagion','Geas','Greater Restoration','Insect Plague','Mass Cure Wounds','Planar Binding','Reincarnate','Scrying','Tree Stride','Wall of Stone']
Druid_6_Spells = ['Conjure Fey','Find the Path','Heal','Heroes Feast','Move Earth','Sunbeam','Transport via Plants','Wall of Thorns','Wind Walk']
Druid_7_Spells = ['Fire Storm','Mirage Arcane','Plane Shift','Regenerate','Reverse Gravity']
Druid_8_Spells = ['Animal Shapes','Antipathy/Sympathy','Control Weather','Earthquake','Feeblemind','Sunburst']
Druid_9_Spells = ['Foresight','Shapechange','Storm of Vengeance','True Resurrection']
Paladin_0_Spells = []
Paladin_1_Spells = ['Bless','Command','Cure Wounds','Detect Evil and Good','Detect Magic','Detect Poison and Disease','Divine Favor','Heroism','Protection from Evil and Good','Purify Food and Drink','Shield of Faith']
Paladin_2_Spells = ['Aid','Find Steed','Lesser Restoration','Locate Object','Magic Weapon','Protection from Poison','Zone of Truth']
Paladin_3_Spells = ['Create Food and Water','Daylight','Dispel Magic','Magic Circle','Remove Curse','Revivify']
Paladin_4_Spells = ['Banishment','Death Ward','Locate Creature']
Paladin_5_Spells = ['Dispel Evil and Good','Geas','Raise Dead']
Ranger_0_Spells = []
Ranger_1_Spells = ['Alarm','Cure Wounds','Detect Magic','Detect Poison and Disease','Fog Cloud','Jump','Longstrider','Speak with Animals']
Ranger_2_Spells = ['Animal Messenger','Barkskin','Darkvision','Find Traps','Lesser Restoration','Locate Animals or Plants','Locate Object','Pass without Trace','Protection from Poison','Silence','Spike Growth']
Ranger_3_Spells = ['Conjure Animals','Daylight','Nondetection','Plant Growth','Protection from Energy','Speak with Plants','Water Breathing','Water Walk','Wind Wall']
Ranger_4_Spells = ['Conjure Woodland Beings','Freedom of Movement','Locate Creature','Stoneskin']
Ranger_5_Spells = ['Commune with Nature','Tree Stride']
Sorcerer_0_Spells = ['Acid Splash','Chill Touch','Dancing Lights','Light','Mage Hand','Mending','Message','Minor Illusion','Prestidigitation','Ray of Frost','Shocking Grasp','True Strike']
Sorcerer_1_Spells = ['Burning Hands','Charm Person','Color Spray','Comprehend Languages','Detect Magic','Disguise Self','Expeditious Retreat','False Life','Feather Fall','Fog Cloud','Jump','Mage Armor','Magic Missile','Shield','Silent Image','Sleep','Thunderwave']
Sorcerer_2_Spells = ['Alter Self','Blindness/Deafness','Blur','Darkness','Darkvision','Detect Thoughts','Enhance Ability','Enlarge/Reduce','Gust of Wind','Hold Person','Invisibility','Knock','Levitate','Mirror Image','Misty Step','Scorching Ray','See Invisibility','Shatter','Spider Climb','Suggestion','Web']
Sorcerer_3_Spells = ['Blink','Clairvoyance','Daylight','Dispel Magic','Fear','Fireball','Fly','Gaseous Form','Haste','Hypnotic Pattern','Lightning Bolt','Major Image','Protection from Energy','Sleet Storm','Slow','Stinking Cloud','Tongues','Water Breathing','Water Walk']
Sorcerer_4_Spells = ['Banishment','Blight','Confusion','Dimension Door','Dominate Beast','Greater Invisibility','Ice Storm','Polymorph','Stoneskin','Wall of Fire']
Sorcerer_5_Spells = ['Animate Objects','Cloudkill','Cone of Cold','Creation','Dominate Person','Hold Monster','Insect Plague','Seeming','Telekinesis','Teleportation Circle','Wall of Stone']
Sorcerer_6_Spells = ['Chain Lightning','Circle of Death','Disintegrate','Eyebite','Globe of Invulnerability','Mass Suggestion','Move Earth','Sunbeam','True Seeing']
Sorcerer_7_Spells = ['Delayed Blast Fireball','Etherealness','Finger of Death','Fire Storm','Plane Shift','Prismatic Spray','Reverse Gravity','Teleport']
Sorcerer_8_Spells = ['Dominate Monster','Earthquake','Incendiary Cloud','Power Word Stun','Sunburst']
Sorcerer_9_Spells = ['Gate','Meteor Swarm','Power Word Kill','Time Stop','Wish','Warlock Spells']
Warlock_0_Spells = ['Mage Hand','Minor Illusion','Prestidigitation','True Strike']
Warlock_1_Spells = ['Charm Person','Comprehend Languages','Expeditious Retreat','Illusory Script','Protection from Evil and Good','Unseen Servant']
Warlock_2_Spells = ['Darkness','Enthrall','Hold Person','Invisibility','Mirror Image','Misty Step','Ray of Enfeeblement','Shatter','Spider Climb','Suggestion']
Warlock_3_Spells = ['Dispel Magic','Fear','Fly','Gaseous Form','Hypnotic Pattern','Magic Circle','Major Image','Remove Curse','Tongues','Vampiric Touch']
Warlock_4_Spells = ['Banishment','Blight','Dimension Door','Hallucinatory Terrain']
Warlock_5_Spells = ['Contact Other Plane','Dream','Hold Monster','Scrying']
Warlock_6_Spells = ['Circle of Death','Conjure Fey','Create Undead','Eyebite','Flesh to Stone','Mass Suggestion','True Seeing']
Warlock_7_Spells = ['Etherealness','Finger of Death','Forcecage','Plane Shift']
Warlock_8_Spells = ['Demiplane','Dominate Monster','Feeblemind','Glibness','Power Word Stun']
Warlock_9_Spells = ['Astral Projection','Foresight','Imprisonment','Power Word Kill','True Polymorph']
Wizard_0_Spells = ['Acid Splash','Chill Touch','Dancing Lights','Light','Mage Hand','Mending','Message','Minor Illusion','Prestidigitation','Ray of Frost','Shocking Grasp','True Strike']
Wizard_1_Spells = ['Alarm','Burning Hands','Charm Person','Color Spray','Comprehend Languages','Detect Magic','Disguise Self','Expeditious Retreat','False Life','Feather Fall','Floating Disk','Fog Cloud','Grease','Hideous Laughter','Identify','Illusory Script','Jump','Longstrider','Mage Armor','Magic Missile','Protection from Evil and Good','Shield','Silent Image','Sleep','Thunderwave','Unseen Servant']
Wizard_2_Spells = ['Acid Arrow','Alter Self','Arcane Lock','Arcanists Magic Aura','Blindness/Deafness','Blur','Continual Flame','Darkness','Darkvision','Detect Thoughts','Enlarge/Reduce','Flaming Sphere','Gentle Repose','Gust of Wind','Hold Person','Invisibility','Knock','Levitate','Locate Object','Magic Mouth','Magic Weapon','Mirror Image','Misty Step','Ray of Enfeeblement','Rope Trick','Scorching Ray','See Invisibility','Shatter','Spider Climb','Suggestion','Web']
Wizard_3_Spells = ['Animate Dead','Bestow Curse','Blink','Clairvoyance','Dispel Magic','Fear','Fireball','Fly','Gaseous Form','Glyph of Warding','Haste','Hypnotic Pattern','Lightning Bolt','Magic Circle','Major Image','Nondetection','Phantom Steed','Protection from Energy','Remove Curse','Sending','Sleet Storm','Slow','Stinking Cloud','Tiny Hut','Tongues','Vampiric Touch','Water Breathing']
Wizard_4_Spells = ['Arcane Eye','Banishment','Black Tentacles','Blight','Confusion','Conjure Minor Elementals','Control Water','Dimension Door','Fabricate','Faithful Hound','Fire Shield','Greater Invisibility','Hallucinatory Terrain','Ice Storm','Locate Creature','Phantasmal Killer','Polymorph','Private Sanctum','Resilient Sphere','Secret Chest','Stone Shape','Stoneskin','Wall of Fire']
Wizard_5_Spells = ['Animate Objects','Arcane Hand','Cloudkill','Cone of Cold','Conjure Elemental','Contact Other Plane','Creation','Dominate Person','Dream','Geas','Hold Monster','Legend Lore','Mislead','Modify Memory','Passwall','Planar Binding','Scrying','Seeming','Telekinesis','Telepathic Bond','Teleportation Circle','Wall of Force','Wall of Stone']
Wizard_6_Spells = ['Chain Lightning','Circle of Death','Contingency','Create Undead','Disintegrate','Eyebite','Flesh to Stone','Freezing Sphere','Globe of Invulnerability','Guards and Wards','Instant Summons','Irresistible Dance','Magic Jar','Mass Suggestion','Move Earth','Programmed Illusion','Sunbeam','True Seeing','Wall of Ice']
Wizard_7_Spells = ['Arcane Sword','Delayed Blast Fireball','Etherealness','Finger of Death','Forcecage','Magnificent Mansion','Mirage Arcane','Plane Shift','Prismatic Spray','Project Image','Reverse Gravity','Sequester','Simulacrum','Symbol','Teleport']
Wizard_8_Spells = ['Antimagic Field','Antipathy/Sympathy','Clone','Control Weather','Demiplane','Dominate Monster','Feeblemind','Incendiary Cloud','Maze','Mind Blank','Power Word Stun','Sunburst']
Wizard_9_Spells = ['Astral Projection','Foresight','Gate','Imprisonment','Meteor Swarm','Power Word Kill','Prismatic Wall','Shapechange','Time Stop','True Polymorph','Weird','Wish']
SRD_5_Monsters = ["Adult Red Dragon","Air Elemental","Allosaurus","Animated Armor","Ankheg",
"Ankylosaurus","Ape","Awakened Shrub","Awakened Tree","Axe Beak ","Baboon",
"Badger","Banshee","Basilisk","Bat","Black Bear","Blink Dog","Boar","Blood Hawk",
"Brown Bear","Bugbear","Camel","Cat","Centaur","Chimera","Cockatrice ","Crab",
"Crocodile","Constrictor Snake","Cyclops","Death Dog","Deer","Dire Wolf",
"Doppelganger","Draft Horse","Earth Elemental","Elephant","Elk","Fire Elemental",
"Fire Giant","Flameskull","Flesh Golem","Flying Snake","Flying Sword","Frog",
"Frost Giant","Gargoyle","Ghost","Ghoul","Giant Ape","Giant Badger","Giant Bat",
"Giant Boar","Giant Centipede","Giant Constrictor Snake","Giant Crab",
"Giant Crocodile","Giant Eagle","Giant Elk","Giant Fire Beetle","Giant Frog",
"Giant Goat","Giant Hyena","Giant Lizard","Giant Octopus","Giant Owl",
"Giant Poisonous Snake","Giant Rat","Giant Scorpion","Giant Sea Horse",
"Giant Shark","Giant Spider","Giant Toad","Giant Vulture","Giant Wasp",
"Giant Weasel","Giant Wolf Spider","Gnoll","Goat","Goblin","Grick","Griffon",
"Harpy","Hawk","Hell Hound","Hill Giant","Hippogriff","Hobgoblin","Hunter Shark",
"Hydra","Hyena","Jackal","Killer Whale","Kobold","Lion","Lizard","Lizardfolk",
"Mammoth","Manticore","Mastiff","Medusa","Merfolk","Minotaur","Mule","Mummy",
"Nothic","Ochre Jelly","Octopus","Ogre","Orc","Owl","Owlbear","Panther","Pegasus",
"Phase Spider","Plesiosaurus","Poisonous Snake","Polar Bear","Pony","Pteranodon",
"Quipper","Rat","Raven","Reef Shark","Rhinoceros","Riding Horse",
"Saber-Toothed Tiger","Satyr","Scorpion","Sea Horse","Skeleton","Spectator",
"Spider","Stirge","Stone Golem","Swarm of Bats","Swarm of Insects",
"Swarm of Poisonous Snakes","Swarm of Quippers","Swarm of Rats","Swarm of Ravens",
"Tiger","Triceratops","Troll","Twig blight","Tyrannosaurus Rex","Vulture",
"Warhorse","Water Elemental","Weasel","Werewolf","Wight","Winter Wolf","Wolf",
"Worg","Wyvern","Yeti","Young Green Dragon","Zombie"]
Classes5E = {0:'Barbarian', 1:'Bard', 2:'Cleric', 3:'Druid', 4:'Fighter', 5:'Monk', 6:'Paladin', 7:'Ranger', 8:'Rogue', 9:'Sorcerer', 10:'Warlock', 11:'Wizard'}
Races5E = {0:'Human', 1:'Halfling', 2:'Elf', 3:'Half Orc', 4:'Half Elf', 5:'Gnome', 6:'Dragonborn', 7:'Orc', 8:'Goblin', 9:'Other'}
Sizes5E = {0:'Tiny', 1:'Small', 2:'Medium', 3:'Large', 4:'Huge', 5:'Gargantuan'}
MonsterTypes5E = {0:'Aberration', 1:'Beast', 2:'Celestial', 3:'Construct', 4:'Dragon', 5:'Elemental', 6:'Fey', 7:'Fiend', 8:'Giant', 9:'Humanoid', 10:'Monstrosity', 11:'Ooze', 12:'Plant', 13:'Undead'}
class NPC_Record():
def __init__(self):
self.Name = 'Name'
self.Gender = 'random' #male, female, random
self.Alignment = 'Any' #LG, LN, LE, etc. Also, ANY, ANY Good, Any Evil, Any Neutral
self.LawChaosAxis = 'Lawful'
self.GoodEvilAxis = 'Evil'
self.ClassOne = 'Any'
self.LevelOne = 1
self.ClassTwo = 'None'
self.LevelTwo = 0
self.ClassThree = 'None'
self.LevelThree = 0
self.race = None #NPC_Races class
self.height_ft = 99
self.height_in = 13
self.weight = 999
self.STR = 3
self.INT = 3
self.CON = 3
self.WIS = 3
self.DEX = 3
self.CHA = 3
self.Languages = [] #list of languages for the NPC based on race/INT bonus
self.CR = 0
self.size = 'M'
self.HD = 'HD'
self.HP = 0
self.init = 0
self.speed = 30
self.AttackMelee = '+99/+99/+99'
self.AttackRanged = '+99/+99'
self.AC = 99
self.FORT = 0
self.WILL = 0
self.REF = 0
self.BAB = 0
self.special = [] #Special class attributes
self.skills = []
self.ranks = []
self.CCskills = [] #Cross class skills
self.CCranks = [] #Cross class ranks
self.Feats = [] #list of feats
self.spells = None #list of spells available
self.spells_memorized = None #text of spells memorized for use
self.MagicType = None #type of magic #one of Arcane, Divine, Bardic, Ranger, Druid, Paladin
self.spell_0 = 0 #the following detail the
self.spell_1 = 0 #number of spells available
self.spell_2 = 0
self.spell_3 = 0
self.spell_4 = 0
self.spell_5 = 0
self.spell_6 = 0
self.spell_7 = 0
self.spell_8 = 0
self.spell_9 = 0
class NPC_Name_Record():
def __init__(self):
self.DwarfFemaleSuffix = []
self.DwarfMaleSuffix = []
self.DwarfPrefix = []
self.FemaleElfMidfix = []
self.FemaleElfPrefix = []
self.FemaleElfSuffix = []
self.FemaleGnomeNames = []
self.FemaleHalflingNames = []
self.FemaleHumanNames = []
self.MaleElfMidfix = []
self.MaleElfPrefix = []
self.MaleElfSuffix = []
self.MaleGnomeNames = []
self.MaleHalflingNames = []
self.MaleHumanNames = []
self.MonsterMidfix = []
self.MonsterPrefix = []
self.MonsterSuffix = []
class NPC_SkillItem():
def __init__(self):
self.Skill = None
self.Bonus = 0
return
class NPC_Skills():
#the ability bonus is entered. If None, then NPC is untrained in that skill
def __init__(self):
self.Appraise = None
self.Balance = None
self.Bluff = None
self.Climb = None
self.Concentration = None
self.Craft = None
self.DecipherScript = None
self.Diplomacy = None
self.DisableDevice = None
self.Disguise = None
self.EscapeArtist = None
self.Forgery = None
self.GatherInformation = None
self.HandleAnimal = None
self.Heal = None
self.Intimidate = None
self.Jump = None
self.Knowledge = None
self.Listen = None
self.MoveSilently = None
self.OpenLock = None
self.Perform = None
self.Profession = None
self.Ride = None
self.Search = None
self.SenseMotive = None
self.SleightOfHand = None
self.SpeakLanguage = None
self.Spellcraft = None
self.Spot = None
self.Survival = None
self.Swim = None
self.Tumble = None
self.UseMagicDevice = None
self.UseRope = None
return
class NPC_Feats_Record():
def __init__(self):
self.subset = None # 1=General, 2=Melee, 3=Ranged, 4=Magic
self.featlist = []
return
class NPC_Spell_Record():
"""Used for PF/d20 NPC's """
def __init__(self):
self.name = None
self.school = None
self.descriptor = None
self.level = [] #list of class/levels, ie ['Cleric 6', 'Sorcerer/Wizard 5']
self.components = None
self.cast_time = None
self.spell_range = None
self.target = None
self.duration = None
self.saving_throw = None
self.spell_resistance = None
self.text = None
self.effect = None
return
#------------------------------------------------------------------------
class TrapInfo:
"""This is a pickled record"""
def __init__(self):
self.index = 0 #master index when read from disk
self.displayIndex = 0 #changed as the trap display list is modified
self.SRD_Trap = False #set to True if this is a trap found in the SRD
self.show = True #used to filter the TrapInfo item
self.icon = None #wxImage of the trap icon
self.desc = 'None' #description of the trap, text string
self.CR = 1 #challenge rating
self.TrapType = 'None' #magic or mechanical
self.trigger = 'None' #'Location', 'Proximity', 'Sound', 'Visual', 'Touch', 'Timed', 'Spell'
self.reset = 'None'
self.bypass = 'None' # Enter bypass method and search DC (if any)
self.attackbonus = 20 #attack bonus
self.attacktype = 'None' #melee, ranged, pit, other, etc.
self.damage = 'None' #description of the attack, ie, ranged 1d6 19-20(x2)
self.damageDice = '' #dice used to calculate damage, ie, 2d10+2
self.searchDC = 20
self.disableDC = 20
self.saveDC = 20
self.savetype = 'None' #list of saves
self.saveamount = 'None' #save for half or avoid
self.GPcost = 0
self.XPcost = 0
self.optional = "None" #other optional trap features
self.other = "None" #other user defined text
return
class NPC_Skills_Record():
def __init__(self):
self.name = None
self.skills = [] #class skills to this class. all others are cross-class
self.ranks = [] #how many points per skill assigned. list of values corresponding to the skills
self.CCskills = []
self.CCranks = []
class NPC_Class_Info_Record():
def __init__(self):
self.class_name = None
self.level = None
self.BAB = None
self.FORT = None
self.WILL = None
self.REF = None
self.special = []
self.psi_points = None
self.psi_powers_known = None
self.psi_power_level = None
self.caster_level = None
self.AC_bonus = 0
self.spells_known_0 = 0
self.spells_known_1 = 0
self.spells_known_2 = 0
self.spells_known_3 = 0
self.spells_known_4 = 0
self.spells_known_5 = 0
self.spells_known_6 = 0
self.spells_known_7 = 0
self.spells_known_8 = 0
self.spells_known_9 = 0
self.spells_available_0 = 0
self.spells_available_1 = 0
self.spells_available_2 = 0
self.spells_available_3 = 0
self.spells_available_4 = 0
self.spells_available_5 = 0
self.spells_available_6 = 0
self.spells_available_7 = 0
self.spells_available_8 = 0
self.spells_available_9 = 0
self.unarmed_damage = None
self.speed_bonus = 0
self.flurry = None
return
class NPC_Races:
def __init__(self):
self.Name = None
self.speed = None
self.CR = None
self.size = None
self.extraHD_qty = None
self.extraHD = None
self.PrefClass = None
self.LawChaosAxis = None
self.GoodEvilAxis = None
self.Alignment = None
self.maleBonus = None
self.femaleBonus = None
self.maleStatHeightFeet = None
self.maleStatHeightInches = None
self.maleStatHeightModDie = None
self.maleStatHeightModDieQty = None
self.maleStatWeight = None
self.maleStatWeightModDie = None
self.maleStatWeightModDieQty = None
self.femaleStatHeightFeet = None
self.femaleStatHeightInches = None
self.femaleStatHeightModDie = None
self.femaleStatHeightModDieQty = None
self.femaleStatWeight = None
self.femaleStatWeightModDie = None
self.femaleStatWeightModDieQty = None
self.languages = None
self.bonusLanguages = None
self.Skills = NPC_Skills() #list of all skills
self.SkillBonuses = []
self.FeatBonuses = [] #plain text list
self.STR_bonus = 0
self.INT_bonus = 0
self.CON_bonus = 0
self.DEX_bonus = 0
self.WIS_bonus = 0
self.CHA_bonus = 0
self.REF_bonus = 0
self.FORT_bonus = 0
self.WILL_bonus = 0
self.ATT_bonus = 0
self.AC_bonus = 0
########################################################################
class AutolevelFeature_Record():
"""This contains the information under the <autolevel> tag. There may be more than
one feature per <autolevel>
"""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
self.featureName = ''
self.level = 0
self.features = [] # list of Class_5E_Feature items
self.slots = None # if the class has spellcasting, this is a text string of the slots filled, ie '3 3 1'
return
########################################################################
class Class_5E_Feature():
""""""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
self.featureName = ''
self.featureText = [] # list of text strings
return
########################################################################
class Class5E_Record():
"""Holds information for classes in 5E SRD"""
#----------------------------------------------------------------------
def __init__(self):
"""From our classes.xml data, each class and sub-class has an entry"""
self.ClassName = '' # Which of the standard classes, ie, Bard, Cleric, etc.
self.SubClass = None # Which sub-class, ie, Path, College, School, etc.
self.HD = 6 # Hit dice number
self.proficiency = '' # Full name of attribute, ie, Strength, Wisdom, etc
self.spellAbility = '' # Attribute name if class can cast spells
self.features = [] # list of AutolevelFeature_Record items
self.isCore = False # True if this is part of the core game rules
self.isSRD = True # True if released under the OGL/SRD
return
class Monster_Record():
def __init__(self):
"""This is a pickled record. Conversion necessary if additions are made"""
self.version = None #Which version of the monster is this 3E, PATH, 5E_OLD, USER, etc.
self.uniqueID = 0 #Each monster has a unique identifier, used in the hover dialog lookup
self.index = 0 #used in the wxListBox display, not unique to any monster
self.user_defined = False
self.show = False
self.family = 'None'
self.name = 'None' #name as recorded in the monster data list
self.customName = None #name as defined by the user
self.size = 'None'
self.monster_type = 0 #An integer for 5E monsters; used for the wxChoice widget
self.monster_subtype = 'None'
self.descriptor = 'None'
self.HD = 'None'
self.init = 'None'
self.speed = '0'
self.special_speed_type = 0 #integer (0=none, 1=fly, 2=burrow, 3=swim, 4=climb)
self.special_speed = '0'
self.AC = 10
self.BAB = 'None'
self.grapple = 'None'
self.attack = 'None'
self.full_attack = 'None'
self.actions = 'None'
self.space = 'None'
self.reach = 'None'
self.SA = 'None'
self.SQ = 'None'
self.REF = 0
self.WILL = 0
self.FORT = 0
self.saves = 'None'
self.abilities = 'None'
self.STR = '0'
self.INT = '0'
self.DEX = '0'
self.CON = '0'
self.WIS = '0'
self.CHA = '0'
self.skills = 'None'
self.feats = 'None'
self.epic_feats = 'None'
self.environment = 'None'
self.organization = 'None'
self.CR = '0'
self.XP = '0'
self.treasure = 'None'
self.alignment = 'None'
self.HP = 0
self.startHP = 0 #this is the original starting HP of the monster
self.con1 = 'None' # these are for the user defined conditions
self.con2 = 'None'
self.con3 = 'None'
self.con4 = 'None'
self.advancement = 'None'
self.level_adjustment = 'None'
self.stat_block = 'None'
self.SA_text = 'None' #used to define (Ex) (Su) qualities
self.other_text = 'None' #other general text, explanation of behavior, SA, SQ, etc.
self.passive_perception = '0'
self.SRD_Distribution = False #allowed to be distributed under SRD/GPL
self.BasicMonster = False
return
#---------------------------------------------------------------------
class Monster5E_Record():
def __init__(self):
self.version = None #Which version of the monster is this 3E, PATH, 5E, 5E_NPC
self.uniqueID = 0 #Each monster has a unique identifier, used in the hover dialog lookup
self.index = 0 #used in the wxListBox display, not unique to any monster
self.user_defined = False #set to True if it is a custom monster/npc
self.show = False
self.npc_class = 0 #Class of the character, integer: 0:BAR, 1:BRD, 2:CLR, 3:DRD, 4:FTR, 5:MNK, 6:PAL, 7:RGR, 8:RGE, 9:SOR, 10:WLK, 11:WIZ
self.npc_race = 0 #Race of the NPC, integer: 0:Human, 1:Halfling, 2:Elf, 3:Half-Orc, 4:Half-Elf, 5:Gnome, 6:Dragonborn, 7:Orc, 8:Goblin, 9:Other
self.level = 1 #integer of the level of the npc
self.filterValue = 0 #used for filtering monsters in the monster display dialog
self.monster_type = '' #monster type and subtype
self.family = ''
self.name = '' #name as recorded in the monster data list
self.customName = None #name as defined by the user
self.size = 2 # monster size, integer; 0=Tiny, 1=Small, 2=Medium, 3=Large, 4=Huge, 5=Gargantuan
self.monster_type = 0 #An integer for 5E monsters; used for the wxChoice widget 0=Aberration 1=Beast 2=Celestial 3=Construct 4=Dragon 5=Elemental 6=Fey 7=Fiend 8=Giant 9=Humanoid 10=Monstrosity 11=Ooze 12=Plant 13=Undead
self.monster_subtype = '' #Sub-type of the monster
self.descriptor = ''
self.HD = '' #dice value for calculating HP
self.init = ''
self.speed = ''
self.proficiency = 2 #integer value of proficiency bonus.
self.proficiencySkills = [] #list of skills the monster/npc is proficient with
self.AC = 10
self.AC_Type = '' # type of armor (natural, plate, etc)
self.attack = ''
self.actions = ''
self.legendaryAction = ''
self.space = ''
self.reach = ''
self.saves = '' #show on skills tab
self.resistances = '' #show on skills tab
self.vulnerable = '' #show on skills tab
self.immunities = '' #show on skills tab
self.conditionImmune = '' #show on skills tab
self.senses = '' #show on skills tab
self.languages = '' #show on skills tab
self.skills = '' #show on skills tab
self.trait = '' #show on traits tab
self.abilities = '' #show on traits tab
self.userNotes = '' #show on notes tab
self.STR = '0'
self.INT = '0'
self.DEX = '0'
self.CON = '0'
self.WIS = '0'
self.CHA = '0'
self.spells = {'Level0': [],'Level1': [],'Level2': [],'Level3': [],'Level4': [],'Level5': [],'Level6': [],'Level7': [],'Level8': [],'Level9': []}
self.spellSlots = {'Slot0':'0','Slot1':'0', 'Slot2':'0','Slot3':'0','Slot4':'0','Slot5':'0','Slot6':'0','Slot7':'0','Slot8':'0','Slot9':'0'}
self.spellAttackDC = 0
self.spellSaveDC = 8
self.CR = '0' #show on skills tab
self.XP = '0'
self.treasure = '' #show on other info tab
self.alignment = ''
self.HP = 0 # Hit Points remaining
self.startHP = 0 # this is the original starting HP of the monster
self.con1 = 'None' # these are for the user defined conditions
self.con2 = 'None'
self.con3 = 'None'
self.con4 = 'None'
self.deathSavePass = 0 #ranges from 0-3 only
self.deathSaveFail = 0 #ranges from 0-3 only
self.advancement = ''
self.level_adjustment = ''
self.passive_perception = '0'
self.SRD_Distribution = False #allowed to be distributed under SRD/GPL?
self.BasicMonster = False #available from D&D 5th Edition basic rules? (PC/DM/other)
self.other_text = '' #show on other info tab
self.bonds = '' #show on bonds tab; NPC only
self.flaws = '' #show on flaws tab; NPC only
self.ideals = '' #show on ideals tab; NPC only
self.image = None #wxImage, if user selected a custom image
self.filename = None #filename to the custom image; all images located in /artwork/tokens
return
def TypeInfo(self):
"""Returns a string showing the monster size/type, or npc race/class combo"""
if (self.version == '5E'): #this is a monster
try:
size = Sizes5E[self.size]
except:
size = ""
try:
monsterType = MonsterTypes5E[self.monster_type]
except:
monsterType = ""
return (size + " " + monsterType)
elif (self.version == '5E_NPC'):
try:
classNPC = Classes5E[self.npc_class]
except:
classNPC = ""
try:
raceNPC = Races5E[self.npc_race]
except:
raceNPC = ""
return (raceNPC + " " + classNPC)
else:
return ""
class Spell5E_Record():
def __init__(self):
self.MasterIndex = None # unique spell identifier. User defined spells start at index 100000. WotC sourced spells start at 0
self.Name = "" # Name of spell
self.School = "" # School name: "Abjuration" "Conjuration" "Divination" "Enchantment" "Evocation" "Illusion" "Necromancy" "Transmutation"
self.CasterClass = [] # Available to class: "Bard" "Cleric" "Druid" "Paladin" "Ranger" "Sorcerer" "Warlock" "Wizard"
self.Level = 0 # integer, 0 = cantrip
self.VerbalComponent = False # Either true/false
self.SomaticComponent = False # Either true/false
self.FocusComponent = False # Either true/false
self.MaterialComponent = False # Either true/false
self.CastTime = "None" # text string
self.SpellRange = "None" # text string
self.Target = "None"
self.Duration = "None" # text string
self.Concentration = False # set to True if concentration required for this spell
self.Save = "None"
self.BaseDamage = "None" # dice string
self.DamageType = "None" # choice: "Acid" "Bludgeoning" "Cold" "Fire" "Force" "Lightning" "Necrotic" "Piercing" "Poison" "Psychic" "Radiant" "Slashing" "Thunder"
self.Description = "" # text string
self.Ritual = False # either true/false
self.BasicSpell = False # set to True if available in free rules
self.SourceMaterial = "None" # text string, what is the book reference
self.SourceCode = "" # Set to PHB, EE, APOC, USER depending on supplemental source
self.UserDefined = False # set to true if this is a user modified spell.
self.show = True # flag for displaying the spell in a listbox
self.selected = False # flag for whether it is selected
self.filterValue = 15 # used to determine filtering. Level=1, Class=2, School=4, Basic=8
self.deleted = False # set to true if the spell has been deleted. Not removed from list, so as to preserve index values
return
def GetAbilityScoreBonus(score):
if (score == 1):
return -5
elif (score <= 3):
return -4
elif (score <= 5):
return -3
elif (score <= 7):
return -2
elif (score <= 9):
return -1
elif (score <= 11):
return 0
elif (score <= 13):
return 1
elif (score <= 15):
return 2
elif (score <= 17):
return 3
elif (score <= 19):
return 4
elif (score <= 21):
return 5
elif (score <= 23):
return 6
elif (score <= 25):
return 7
elif (score <= 27):
return 8
elif (score <= 29):
return 9
elif (score == 30):
return 10
else:
return 0
def GetMonsterProficiencyBonus(challengeRating):
if ((challengeRating == '5') or (challengeRating == '6') or (challengeRating == '7') or (challengeRating == '8')):
bonus = 3
elif ((challengeRating == '9') or (challengeRating == '10') or (challengeRating == '11') or (challengeRating == '12')):
bonus = 4
elif ((challengeRating == '13') or (challengeRating == '14') or (challengeRating == '15') or (challengeRating == '16')):
bonus = 5
elif ((challengeRating == '17') or (challengeRating == '18') or (challengeRating == '19') or (challengeRating == '20')):
bonus = 6
elif ((challengeRating == '21') or (challengeRating == '22') or (challengeRating == '23') or (challengeRating == '24')):
bonus = 7
elif ((challengeRating == '25') or (challengeRating == '26') or (challengeRating == '27') or (challengeRating == '28')):
bonus = 8
elif ((challengeRating == '29') or (challengeRating == '30')):
bonus = 9
else:
bonus = 2
return bonus
def UpdateXPfromCR(CRvalue):
"""CRvalue is a text loaded from the xml file"""
XPvalue = 0
if (CRvalue == '0'):
XPvalue = 10
elif (CRvalue == '1/8'):
XPvalue = 25
elif (CRvalue == '1/4'):
XPvalue = 50
elif (CRvalue == '1/2'):
XPvalue = 100
elif (CRvalue == '1'):
XPvalue = 200
elif (CRvalue == '2'):
XPvalue = 450
elif (CRvalue == '3'):
XPvalue = 700
elif (CRvalue == '4'):
XPvalue = 1100
elif (CRvalue == '5'):
XPvalue = 1800
elif (CRvalue == '6'):
XPvalue = 2300
elif (CRvalue == '7'):
XPvalue = 2900
elif (CRvalue == '8'):
XPvalue = 3900
elif (CRvalue == '9'):
XPvalue = 5000
elif (CRvalue == '10'):
XPvalue = 5900
elif (CRvalue == '11'):
XPvalue = 7200
elif (CRvalue == '12'):
XPvalue = 8400
elif (CRvalue == '13'):
XPvalue = 10000
elif (CRvalue == '14'):
XPvalue = 11500
elif (CRvalue == '15'):
XPvalue = 13000
elif (CRvalue == '16'):
XPvalue = 15000
elif (CRvalue == '17'):
XPvalue = 18000
elif (CRvalue == '18'):
XPvalue = 20000
elif (CRvalue == '19'):
XPvalue = 22000
elif (CRvalue == '20'):
XPvalue = 25000
elif (CRvalue == '21'):
XPvalue = 33000
elif (CRvalue == '22'):
XPvalue = 41000
elif (CRvalue == '23'):
XPvalue = 50000
elif (CRvalue == '24'):
XPvalue = 62000
elif (CRvalue == '25'):
XPvalue = 75000
elif (CRvalue == '26'):
XPvalue = 90000
elif (CRvalue == '27'):
XPvalue = 105000
elif (CRvalue == '28'):
XPvalue = 120000
elif (CRvalue == '29'):
XPvalue = 135000
elif (CRvalue == '30'):
XPvalue = 155000
return str(XPvalue)
def ReadDnD5_Files(SpellsGauge, MonstersGauge, NPC_Gauge, TrapsGauge):
result = ""
#load class data
if (os.access(os.path.join(gv.srd_directory,'5E','classes.xml'), os.F_OK)):
xmlfile = os.path.join(gv.srd_directory,'5E', 'classes.xml')
gv.Class5E = ReadClass_5E_XML(xmlfile)
else:
result += ' LoadError:Classes '
if (os.access(os.path.join(gv.srd_directory,"5E","spells.xml"), os.F_OK)):
SpellsGauge.SetValue(15)
#read the xml file of the 5E spells
xmlfile = os.path.join(gv.srd_directory,"5E","spells.xml")
gv.Spells5E = ReadSpells5E_XML(xmlfile)
for i in gv.Spells5E:
i.SourceCode = "PHB"
else:
result += " LoadError:Spells "
SpellsGauge.SetValue(50)
if (os.access(os.path.join(gv.srd_directory,"5E","Elemental Evil Spells 1.0.xml"), os.F_OK)):
xmlfile = os.path.join(gv.srd_directory,"5E","Elemental Evil Spells 1.0.xml")
spells = ReadSpells5E_XML(xmlfile, len(gv.Spells5E))
for i in spells:
i.SourceMaterial = "Elemental Evil Players Companion"
i.SourceCode = 'EE'
gv.Spells5E.extend(spells)
else:
result += " LoadError:ElementalEvil Spells "
SpellsGauge.SetValue(85)
if (os.access(os.path.join(gv.srd_directory,"5E","UserSpells.xml"), os.F_OK)):
xmlfile = os.path.join(gv.srd_directory,"5E","UserSpells.xml")
spells = ReadSpells5E_XML(xmlfile, gv.UserSpell5E_NextIndex)
for i in spells:
i.SourceCode = 'USER'
i.SourceMaterial = 'User Defined Spell'
gv.UserSpell5E_NextIndex += 1
gv.Spells5E.extend(spells)
SpellsGauge.SetValue(100)
if (os.access(os.path.join(gv.srd_directory,"5E","CoreMonsters.xml"), os.F_OK)):
MonstersGauge.SetValue(15)
xmlfile = os.path.join(gv.srd_directory,"5E","CoreMonsters.xml")
ReadMonsters5E_XML(xmlfile)
MonstersGauge.SetValue(75)
else:
result += " LoadError:CoreMonsters "
if (os.access(os.path.join(gv.srd_directory,"5E","UserMonsters.xml"), os.F_OK)):
xmlfile = os.path.join(gv.srd_directory,"5E","UserMonsters.xml")
ReadMonsters5E_XML(xmlfile)
MonstersGauge.SetValue(85)
else:
result += " LoadError:UserMonsters "
MonstersGauge.SetValue(100)
if (os.access(os.path.join(gv.srd_directory,"5E","npc.xml"), os.F_OK)):
NPC_Gauge.SetValue(15)
xmlfile = os.path.join(gv.srd_directory,"5E","npc.xml")
gv.NPC_5E = ReadNPC_5E_XML(xmlfile, 0)
else:
result += " LoadError:NPC "
NPC_Gauge.SetValue(100)
if (os.access(os.path.join(gv.srd_directory,"d20","traps.obj"), os.F_OK)):
TrapsGauge.SetValue(15)
#try loading the traps file from a pickle object (v8.5 and beyond)
datafile = open(os.path.join(gv.srd_directory,"d20","traps.obj"), 'r')
gv.TrapList = pickle.load(datafile)
else:
#load the older v8.4 legacy file
ReadTrapsFile(os.path.join(gv.srd_directory,"d20","traps.txt"), TrapsGauge)
if (os.access(os.path.join(gv.srd_directory,"d20","user_traps.txt"), os.F_OK)):
logging.info("SRD Files: Load user traps file")
success = self.ReadTrapsFile(os.path.join(gv.srd_directory,"d20","user_traps.txt"), TrapsGauge)
if (not success):
return False
readfile = True
#result += " LoadError on pickled object:Traps "
TrapsGauge.SetValue(100)
if (result == ''):
time.sleep(1)
return "Files Loaded"
else:
return result
def ReadClass_5E_XML(xmlfile):
""" Read an xml data file with class information. xmlfile is a valid filename """
DOMTree = xml.dom.minidom.parse(xmlfile)
startIndex=0
classList = DOMTree.documentElement
ClassData = classList.getElementsByTagName('class')
for classItem in ClassData:
newRecord = Class5E_Record()
xmldata = classItem.getElementsByTagName('name')
newRecord.ClassName = xmldata[0].childNodes[0].data
xmldata = classItem.getElementsByTagName('hd')
newRecord.HD = int(xmldata[0].childNodes[0].data)
xmldata = classItem.getElementsByTagName('proficiency')
if (xmldata[0].childNodes == []):
newRecord.proficiency = None
else:
newRecord.proficiency = xmldata[0].childNodes[0].data
xmldata = classItem.getElementsByTagName('spellAbility')
if (xmldata[0].childNodes == []): #no data, not a spellcaster
newRecord.spellAbility = None
else:
newRecord.spellAbility = xmldata[0].childNodes[0].data
xmldata = classItem.getElementsByTagName('autolevel')