-
Notifications
You must be signed in to change notification settings - Fork 0
/
NPC_Builder.adb
4450 lines (4316 loc) · 223 KB
/
NPC_Builder.adb
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
-- This is a personal project that was conceived
-- from a lack of really quick Dungeons and
-- Dragons character creation tools.
-- The only content supported in this tool
-- is that which can be found in the
-- Systems Reference Document (SRD)
-- from Wizards of the Coast.
-- Created by Patrick M
-- Start Date: 8 March 2018
-- Major Updates: 24 April 2018
-- 14 January 2019
-- 7 February 2019
--------------- Support from ---------------
-- Kate A (Beta Tester/Ideas)
-- Rebecca N (Beta Tester/Ideas/Problem Solving)
-- Kim O (Beta Tester)
--------------------------------------------
With Ada.Text_IO; Use Ada.Text_IO;
With Ada.Integer_Text_IO; Use Ada.Integer_Text_IO;
Procedure NPC_Builder is
------------------------------------------------------
-- The purpose of this program is to allow DMs and --
-- players the ability to create NPCs and PCs, --
-- respectively, without having to crunch numbers. --
-- This program will also output the various --
-- character sheet information in easy-to-read --
-- text files for future reference and saving. --
------------------------------------------------------
Type Class_List is (Barbarian, Bard, Cleric, Druid, Fighter, Monk,
Paladin, Ranger, Rogue, Sorcerer, Warlock, Wizard);
Package Class_IO is new Ada.Text_IO.Enumeration_IO (Class_List);
Use Class_IO;
Type Subclass_List is (Berserker, Lore, Life, Land, Champion, OpenHand,
Devotion, Hunter, Thief, Draconic, Fiend, Evocation);
Package Subclass_IO is new Ada.Text_IO.Enumeration_IO (Subclass_List);
Use Subclass_IO;
Type Race_List is (Dragonborn, Dwarf, Elf, Gnome, HalfElf, Halfling, HalfOrc, Human, Tiefling);
Package Race_IO is new Ada.Text_IO.Enumeration_IO (Race_List);
Use Race_IO;
Type Subrace_List is (Hill, High, Lightfoot, Rock, None,
Calishite, Chondathan, Damaran, Illuskan,
Mulan, Rashemi, Shou, Tethyrian, Turami,
Black, Blue, Bronze, Brass, Copper,
Gold, Green, Red, Silver, White);
Package Subrace_IO is new Ada.Text_IO.Enumeration_IO (Subrace_List);
Use Subrace_IO;
Type Skills_List is (Acrobatics, Animal_Handling, Arcana, Athletics, Deception, History,
Insight, Intimidation, Investigation, Medicine, Nature, Perception,
Performance, Persuasion, Religion, Sleight_Of_Hand, Stealth, Survival);
Package Skills_IO is new Ada.Text_IO.Enumeration_IO (Skills_List);
Use Skills_IO;
Type Ability_Scores_List is (STR, DEX, CON, INT, WIS, CHA, NA);
Package Scores_IO is new Ada.Text_IO.Enumeration_IO (Ability_Scores_List);
Use Scores_IO;
Type Weapons_List is (Battleaxe, Blowgun, Club, Dagger, Dart, Flail, Glaive,
Greatclub, Greatsword, Halberd, Handaxe, HandCrossbow,
HeavyCrossbow, Javelin, Lance, LightCrossbow, LightHammer,
Longbow, Longsword, Mace, Maul, Morningstar, Net, Pike,
Quarterstaff, Rapier, Scimitar, Shortbow, Shortsword,
Sickle, Sling, Spear, Trident, Warhammer, Warpick, Whip);
Package Weapons_IO is new Ada.Text_IO.Enumeration_IO (Weapons_List);
Use Weapons_IO;
Type Weapon_Classification_List is (Simple, Martial);
Package Weapon_Classification_IO is new Ada.Text_IO.Enumeration_IO (Weapon_Classification_List);
Use Weapon_Classification_IO;
Type Proficient_Type is record
base : Integer := 0;
proficient : Boolean := false;
End Record;
Type Skills_Type is record
acrobatics : Proficient_Type;
animalHandling : Proficient_Type;
arcana : Proficient_Type;
athletics : Proficient_Type;
deception : Proficient_Type;
history : Proficient_Type;
insight : Proficient_Type;
intimidation : Proficient_Type;
investigation : Proficient_Type;
medicine : Proficient_Type;
nature : Proficient_Type;
perception : Proficient_Type;
performance : Proficient_Type;
persuasion : Proficient_Type;
religion : Proficient_Type;
sleightOfHand : Proficient_Type;
stealth : Proficient_Type;
survival : Proficient_Type;
End Record;
Type Class_Type is record
--features : Features_Array;
hitDice : Integer;
main : Class_List;
subclass : Subclass_List;
level : Integer;
skill : Skills_Type;
skillName : Skills_List;
proficiency : Integer;
End record;
Type Health_Type is record
current : Integer;
total : Integer;
End record;
Type Name_Type is record
name : String (1..25);
length : Integer;
End record;
Type Race_Type is record
main : Race_List;
subrace : Subrace_List;
size : Character;
speed : Integer;
End record;
Type Weapon_Info is record
classification : Weapon_Classification_List;
damageAbility : Ability_Scores_List;
die : Positive;
name : String (1..14);
nameLength : Positive := 5;
toHit : Integer;
proficient : Boolean;
End record;
Type Weapons_Type is array (Weapons_List) of Weapon_Info;
Type Ability_Score_Type is record
base : Integer;
modifier : Integer;
End record;
Type Stats_Type is record
STR : Ability_Score_Type;
DEX : Ability_Score_Type;
CON : Ability_Score_Type;
INT : Ability_Score_Type;
WIS : Ability_Score_Type;
CHA : Ability_Score_Type;
End record;
Type Combat_Type is record
STRbased : Integer;
DEXbased : Integer;
STRproficient : Integer;
DEXproficient : Integer;
unarmedAttack : Integer;
spellDC : Integer;
spellAttack : Integer;
spellStat : Ability_Scores_List;
attack : Weapons_Type;
End record;
Type Character_Type is record
class : Class_Type;
health : Health_Type;
name : Name_Type;
race : Race_Type;
stat : Stats_Type;
combat : Combat_Type;
End record;
THIRTY_THREE_DASHES : CONSTANT String := "---------------------------------";
TABLE_BORDER : CONSTANT String := "|----|---------------------------------";
--Subprograms
Procedure getUserInput(character : out Character_Type) is
choosingScoreImprovement : Boolean := True;
levelFlag : Boolean := True;
profFlag : Boolean := True;
scoresFlag : Boolean := True;
subraceFlag : Boolean := True;
Begin -- getUserInput
-- Name the character
Put ("Enter the character's name: ");
New_Line;
Put (">>> ");
Get_Line(character.name.name, character.name.length);
New_Line;
-- Select the character's race
Put ("Choose your character's race from the following list:");
New_Line;
Put ("Dragonborn, Dwarf, Elf, Gnome, HalfElf, Halfling, HalfOrc, Human, Tiefling: ");
--------Data Validation Loop--------
validRaceLoop:
Loop
raceInputBlock:
begin
New_Line;
Put (">>> ");
Race_IO.Get (character.race.main);
exit validRaceLoop;
exception
When Ada.Text_IO.DATA_ERROR =>
New_Line;
Put ("Dragonborn, Dwarf, Elf, Gnome, HalfElf, Halfling, HalfOrc, Human, Tiefling?");
Skip_Line;
End raceInputBlock;
End loop validRaceLoop;
--------Data Validation Loop--------
New_Line;
-- Select the character's subrace/nationality/ancestry.
Case character.race.main is
-- If the character is a Human, have them choose their nationality.
When Human => Put ("Choose your character's nationality from the following list:");
While subraceFlag Loop
New_Line;
Put ("Calishite, Chondathan, Damaran, Illuskan, Mulan,");
New_Line;
Put ("Rashemi, Shou, Tethyrian, or Turami");
validHumanLoop: -- Only allow valid human subrace
Loop
humanInputBlock:
begin
New_Line;
Put (">>> ");
Subrace_IO.Get (character.race.subrace);
If character.race.subrace = Calishite Then
subraceFlag := False;
Elsif character.race.subrace = Chondathan Then
subraceFlag := False;
Elsif character.race.subrace = Damaran Then
subraceFlag := False;
Elsif character.race.subrace = Illuskan Then
subraceFlag := False;
Elsif character.race.subrace = Mulan Then
subraceFlag := False;
Elsif character.race.subrace = Rashemi Then
subraceFlag := False;
Elsif character.race.subrace = Shou Then
subraceFlag := False;
Elsif character.race.subrace = Tethyrian Then
subraceFlag := False;
Elsif character.race.subrace = Turami Then
subraceFlag := False;
Else
subraceFlag := True;
End If;
exit validHumanLoop;
exception
When Ada.Text_IO.DATA_ERROR =>
New_Line;
Put ("Calishite, Chondathan, Damaran, Illuskan, Mulan,");
New_Line;
Put ("Rashemi, Shou, Tethyrian, or Turami");
Skip_Line;
End humanInputBlock;
End Loop validHumanLoop;
End Loop;
-- If the character is a Dragonborn, have them choose their Draconic Ancestry.
When Dragonborn => Put ("Choose your dragonborn's ancestry from the following list:");
While subraceFlag Loop
New_Line;
Put ("Black (Acid), Blue (Lightning), Brass (Fire), Bronze (Lightning), Copper (Acid),");
New_Line;
Put ("Gold (Fire), Green (Poison), Red (Fire), Silver (Cold), White (Cold)");
New_Line;
Put("Enter only the color.");
validDragonbornLoop: -- Only allow valid dragonborn subrace
Loop
dragonbornInputBlock:
begin
New_Line;
Put (">>> ");
Subrace_IO.Get (character.race.subrace);
If character.race.subrace = Black Then
subraceFlag := False;
Elsif character.race.subrace = Blue Then
subraceFlag := False;
Elsif character.race.subrace = Brass Then
subraceFlag := False;
Elsif character.race.subrace = Bronze Then
subraceFlag := False;
Elsif character.race.subrace = Copper Then
subraceFlag := False;
Elsif character.race.subrace = Gold Then
subraceFlag := False;
Elsif character.race.subrace = Green Then
subraceFlag := False;
Elsif character.race.subrace = Red Then
subraceFlag := False;
Elsif character.race.subrace = Silver Then
subraceFlag := False;
Elsif character.race.subrace = White Then
subraceFlag := False;
Else
subraceFlag := True;
End If;
exit validDragonbornLoop;
exception
When Ada.Text_IO.DATA_ERROR =>
New_Line;
Put ("Black, Blue, Bronze, Brass, Copper,");
New_Line;
Put ("Gold, Green, Red, Silver, White");
Skip_Line;
End dragonbornInputBlock;
End Loop validDragonbornLoop;
End Loop;
When others => null;
End Case;
New_Line;
Put ("Choose your character's class from the following list:");
New_Line;
Put ("Barbarian, Bard, Cleric, Druid, Fighter, Monk,");
New_Line;
Put ("Paladin, Ranger, Rogue, Sorcerer, Warlock, Wizard");
--------Data Validation Loop--------
validClassLoop:
Loop
classInputBlock:
begin
New_Line;
Put (">>> ");
Class_IO.Get (character.class.main);
Exit validClassLoop;
exception
When Ada.Text_IO.DATA_ERROR =>
New_Line;
Put ("Barbarian, Bard, Cleric, Druid, Fighter, Monk,");
New_Line;
Put ("Paladin, Ranger, Rogue, Sorcerer, Warlock, or Wizard?");
Skip_Line;
End classInputBlock;
End Loop validClassLoop;
--------Data Validation Loop--------
-- Set the character's subclass based on their main class
Case character.class.main is
When Barbarian => character.class.subclass := Berserker;
When Bard => character.class.subclass := Lore;
When Cleric => character.class.subclass := Life;
When Druid => character.class.subclass := Land;
When Fighter => character.class.subclass := Champion;
When Monk => character.class.subclass := OpenHand;
When Paladin => character.class.subclass := Devotion;
When Ranger => character.class.subclass := Hunter;
When Rogue => character.class.subclass := Thief;
When Sorcerer => character.class.subclass := Draconic;
When Warlock => character.class.subclass := Fiend;
When Wizard => character.class.subclass := Evocation;
End Case;
New_Line;
-- Have the user input their character's level.
-- Levels lesser than or equal to 0 are not valid.
-- Levels greater than 20 are not valid.
-- D&D 5th Edition does not have official character support for
-- levels outside of the valid range.
While levelFlag Loop
Put ("Note: Valid level range is 1-20.");
New_Line;
Put ("Enter the character's level: ");
New_Line;
Put (">>> ");
Get (character.class.level);
If character.class.level >= 1 and character.class.level <=20 Then
levelFlag := False;
Else
levelFlag := True;
End If;
Skip_Line;
New_Line;
End Loop;
-- Have the user input their raw ability score rolls.
-- This program calculates racial bonuses for the user.
While scoresFlag Loop
Put ("Note: Valid unmodified score range is 3-18.");
New_Line;
Put ("Please enter your unmodified scores, in the following order, and on one line: ");
New_Line;
Put ("STR, DEX, CON, INT, WIS, and CHA");
New_Line;
Put (">>> ");
Ada.Integer_Text_IO.Get (character.stat.STR.base);
Ada.Integer_Text_IO.Get (character.stat.DEX.base);
Ada.Integer_Text_IO.Get (character.stat.CON.base);
Ada.Integer_Text_IO.Get (character.stat.INT.base);
Ada.Integer_Text_IO.Get (character.stat.WIS.base);
Ada.Integer_Text_IO.Get (character.stat.CHA.base);
If character.stat.STR.base >= 3 and character.stat.STR.base <= 18 and
character.stat.DEX.base >= 3 and character.stat.DEX.base <= 18 and
character.stat.CON.base >= 3 and character.stat.CON.base <= 18 and
character.stat.INT.base >= 3 and character.stat.INT.base <= 18 and
character.stat.WIS.base >= 3 and character.stat.WIS.base <= 18 and
character.stat.CHA.base >= 3 and character.stat.CHA.base <= 18 Then
scoresFlag := False;
Else
scoresFlag := True;
End If;
Skip_Line;
New_Line;
End Loop;
-- Have the user input their character's total health.
-- No support for auto-calculating based on modifiers.
Put ("Please enter your character's total health: ");
New_Line;
Put (">>> ");
Get (character.health.total);
Skip_Line;
End getUserInput;
------------------------------------------------------------
Procedure caseClassInfo (character : in out Character_type) is
numSkillProfs : Integer := 2;
temp : Skills_List;
Begin -- caseClassInfo
-- Assign the character's hit dice based on their class.
Case character.class.main is
When Barbarian => character.class.hitDice := 12;
When Bard => character.class.hitDice := 8;
When Cleric => character.class.hitDice := 8;
When Druid => character.class.hitDice := 8;
When Fighter => character.class.hitDice := 10;
When Monk => character.class.hitDice := 8;
When Paladin => character.class.hitDice := 10;
When Ranger => character.class.hitDice := 10;
When Rogue => character.class.hitDice := 8;
When Sorcerer => character.class.hitDice := 6;
When Warlock => character.class.hitDice := 8;
When Wizard => character.class.hitDice := 6;
End Case;
-- Have the user select their proficiencies.
Case character.class.main is
When Barbarian => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Animal_Handling, Athletics, Intimidation, Nature, Perception");
New_Line;
When Bard => Put ("You can choose any 3 skill proficiencies. Your options are:");
New_Line;
Put ("Acrobatics, Animal_Handling, Arcana, Athletics, Deception, History,");
New_Line;
Put ("Insight, Intimidation, Investigation, Medicine, Nature, Perception,");
New_Line;
Put ("Performance, Persuasion, Religion, Sleight_of_Hand, Stealth, Survival");
New_Line;
numSkillProfs := 3;
When Cleric => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("History, Insight, Medicine, Persuasion, Religion");
New_Line;
When Druid => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Arcana, Animal_Handling, Insight, Medicine, Nature, Perception, Religion, Survival");
New_Line;
When Fighter => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Acrobatics, Animal_Handling, Athletics, History,");
New_Line;
Put ("Insight, Intimidation, Perception, Survival");
New_Line;
When Monk => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Acrobatics, Athletics, History, Insight, Religion, Stealth");
New_Line;
When Paladin => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Athletics, Insight, Intimidation, Medicine, Persuasion, Religion");
New_Line;
When Ranger => Put ("You can choose 3 skill proficiencies from the following list:");
New_Line;
Put ("Animal_Handling, Athletics, Deception, Insight, Intimidation,");
New_Line;
Put ("Investigation, Perception, Persuasion, Sleight_of_Hand, Stealth");
New_Line;
numSkillProfs := 3;
When Rogue => Put ("You can choose 4 skill proficiencies from the following list:");
New_Line;
Put ("Acrobatics, Athletics, Deception, Insight, Intimidation,");
New_Line;
Put ("Investigation, Perception, Persuasion, Sleight_of_Hand, Stealth");
New_Line;
numSkillProfs := 4;
When Sorcerer => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Arcana, Deception, Insight, Intimidation, Persuasion, Religion");
New_Line;
When Warlock => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Arcana, Deception, History, Intimidation, Investigation, Nature, Religion");
New_Line;
When Wizard => Put ("You can choose 2 skill proficiencies from the following list:");
New_Line;
Put ("Arcana, History, Insight, Investigation, Medicine, Religion");
New_Line;
End Case;
-- Bards get 3 proficiencies
-- Ranger get 3 proficiencies
-- Rogues get 4 proficiencies
If character.class.main = Bard Then
numSkillProfs := 3;
Elsif character.class.main = Ranger Then
numSkillProfs := 3;
Elsif character.class.main = Rogue Then
numSkillProfs := 4;
Else
numSkillProfs := 2;
End If;
-- Proficiency selection loop
For i in 1..numSkillProfs Loop
Put (i, 1);
Put (". ");
Skills_IO.Get (character.class.skillName);
temp := character.class.skillName;
Case temp is
When Acrobatics => character.class.skill.acrobatics.proficient := True;
When Animal_Handling => character.class.skill.animalhandling.proficient := True;
When Arcana => character.class.skill.arcana.proficient := True;
When Athletics => character.class.skill.athletics.proficient := True;
When Deception => character.class.skill.deception.proficient := True;
When History => character.class.skill.history.proficient := True;
When Insight => character.class.skill.insight.proficient := True;
When Intimidation => character.class.skill.intimidation.proficient := True;
When Investigation => character.class.skill.investigation.proficient := True;
When Medicine => character.class.skill.medicine.proficient := True;
When Nature => character.class.skill.nature.proficient := True;
When Perception => character.class.skill.perception.proficient := True;
When Performance => character.class.skill.performance.proficient := True;
When Persuasion => character.class.skill.persuasion.proficient := True;
When Religion => character.class.skill.religion.proficient := True;
When Sleight_of_Hand => character.class.skill.sleightOfHand.proficient := True;
When Stealth => character.class.skill.stealth.proficient := True;
When Survival => character.class.skill.survival.proficient := True;
End Case;
End Loop;
Skip_Line;
-- Add character's proficiency to skills they selected
----------
If character.class.skill.acrobatics.proficient Then
character.class.skill.acrobatics.base := character.stat.DEX.modifier + character.class.proficiency;
Else
character.class.skill.acrobatics.base := character.stat.DEX.modifier;
End If;
----------
If character.class.skill.animalHandling.proficient Then
character.class.skill.animalHandling.base := character.stat.WIS.modifier + character.class.proficiency;
Else
character.class.skill.animalHandling.base := character.stat.WIS.modifier;
End If;
----------
If character.class.skill.arcana.proficient Then
character.class.skill.arcana.base := character.stat.INT.modifier + character.class.proficiency;
Else
character.class.skill.arcana.base := character.stat.INT.modifier;
End If;
----------
If character.class.skill.athletics.proficient Then
character.class.skill.athletics.base := character.stat.STR.modifier + character.class.proficiency;
Else
character.class.skill.athletics.base := character.stat.STR.modifier;
End If;
----------
If character.class.skill.deception.proficient Then
character.class.skill.deception.base := character.stat.CHA.modifier + character.class.proficiency;
Else
character.class.skill.deception.base := character.stat.CHA.modifier;
End If;
----------
If character.class.skill.history.proficient Then
character.class.skill.history.base := character.stat.INT.modifier + character.class.proficiency;
Else
character.class.skill.history.base := character.stat.INT.modifier;
End If;
----------
If character.class.skill.insight.proficient Then
character.class.skill.insight.base := character.stat.WIS.modifier + character.class.proficiency;
Else
character.class.skill.insight.base := character.stat.WIS.modifier;
End If;
----------
If character.class.skill.intimidation.proficient Then
character.class.skill.intimidation.base := character.stat.CHA.modifier + character.class.proficiency;
Else
character.class.skill.intimidation.base := character.stat.CHA.modifier;
End If;
----------
If character.class.skill.investigation.proficient Then
character.class.skill.investigation.base := character.stat.INT.modifier + character.class.proficiency;
Else
character.class.skill.investigation.base := character.stat.INT.modifier;
End If;
----------
If character.class.skill.medicine.proficient Then
character.class.skill.medicine.base := character.stat.WIS.modifier + character.class.proficiency;
Else
character.class.skill.medicine.base := character.stat.WIS.modifier;
End If;
----------
If character.class.skill.nature.proficient Then
character.class.skill.nature.base := character.stat.INT.modifier + character.class.proficiency;
Else
character.class.skill.nature.base := character.stat.INT.modifier;
End If;
----------
If character.class.skill.perception.proficient Then
character.class.skill.perception.base := character.stat.WIS.modifier + character.class.proficiency;
Else
character.class.skill.perception.base := character.stat.WIS.modifier;
End If;
----------
If character.class.skill.performance.proficient Then
character.class.skill.performance.base := character.stat.CHA.modifier + character.class.proficiency;
Else
character.class.skill.performance.base := character.stat.CHA.modifier;
End If;
----------
If character.class.skill.persuasion.proficient Then
character.class.skill.persuasion.base := character.stat.CHA.modifier + character.class.proficiency;
Else
character.class.skill.persuasion.base := character.stat.CHA.modifier;
End If;
----------
If character.class.skill.religion.proficient Then
character.class.skill.religion.base := character.stat.INT.modifier + character.class.proficiency;
Else
character.class.skill.religion.base := character.stat.INT.modifier;
End If;
----------
If character.class.skill.sleightOfHand.proficient Then
character.class.skill.sleightOfHand.base := character.stat.DEX.modifier + character.class.proficiency;
Else
character.class.skill.sleightOfHand.base := character.stat.DEX.modifier;
End If;
----------
If character.class.skill.stealth.proficient Then
character.class.skill.stealth.base := character.stat.DEX.modifier + character.class.proficiency;
Else
character.class.skill.stealth.base := character.stat.DEX.modifier;
End If;
----------
If character.class.skill.survival.proficient Then
character.class.skill.survival.base := character.stat.WIS.modifier + character.class.proficiency;
Else
character.class.skill.survival.base := character.stat.WIS.modifier;
End If;
----------
End caseClassInfo;
------------------------------------------------------------
Procedure caseAbilityScores (character : in out Character_Type) is
Begin -- caseAbilityScores
-- Assign modifiers to ability scores
Case character.stat.STR.base is
When 1 => character.stat.STR.modifier := -5;
When 2..3 => character.stat.STR.modifier := -4;
When 4..5 => character.stat.STR.modifier := -3;
When 6..7 => character.stat.STR.modifier := -2;
When 8..9 => character.stat.STR.modifier := -1;
When 10..11 => character.stat.STR.modifier := 0;
When 12..13 => character.stat.STR.modifier := 1;
When 14..15 => character.stat.STR.modifier := 2;
When 16..17 => character.stat.STR.modifier := 3;
When 18..19 => character.stat.STR.modifier := 4;
When 20 => character.stat.STR.modifier := 5;
When others => character.stat.STR.modifier := -99;
End Case;
Case character.stat.DEX.base is
When 1 => character.stat.DEX.modifier := -5;
When 2..3 => character.stat.DEX.modifier := -4;
When 4..5 => character.stat.DEX.modifier := -3;
When 6..7 => character.stat.DEX.modifier := -2;
When 8..9 => character.stat.DEX.modifier := -1;
When 10..11 => character.stat.DEX.modifier := 0;
When 12..13 => character.stat.DEX.modifier := 1;
When 14..15 => character.stat.DEX.modifier := 2;
When 16..17 => character.stat.DEX.modifier := 3;
When 18..19 => character.stat.DEX.modifier := 4;
When 20 => character.stat.DEX.modifier := 5;
When others => character.stat.DEX.modifier := -99;
End Case;
Case character.stat.CON.base is
When 1 => character.stat.CON.modifier := -5;
When 2..3 => character.stat.CON.modifier := -4;
When 4..5 => character.stat.CON.modifier := -3;
When 6..7 => character.stat.CON.modifier := -2;
When 8..9 => character.stat.CON.modifier := -1;
When 10..11 => character.stat.CON.modifier := 0;
When 12..13 => character.stat.CON.modifier := 1;
When 14..15 => character.stat.CON.modifier := 2;
When 16..17 => character.stat.CON.modifier := 3;
When 18..19 => character.stat.CON.modifier := 4;
When 20 => character.stat.CON.modifier := 5;
When others => character.stat.CON.modifier := -99;
End Case;
Case character.stat.INT.base is
When 1 => character.stat.INT.modifier := -5;
When 2..3 => character.stat.INT.modifier := -4;
When 4..5 => character.stat.INT.modifier := -3;
When 6..7 => character.stat.INT.modifier := -2;
When 8..9 => character.stat.INT.modifier := -1;
When 10..11 => character.stat.INT.modifier := 0;
When 12..13 => character.stat.INT.modifier := 1;
When 14..15 => character.stat.INT.modifier := 2;
When 16..17 => character.stat.INT.modifier := 3;
When 18..19 => character.stat.INT.modifier := 4;
When 20 => character.stat.INT.modifier := 5;
When others => character.stat.INT.modifier := -99;
End Case;
Case character.stat.WIS.base is
When 1 => character.stat.WIS.modifier := -5;
When 2..3 => character.stat.WIS.modifier := -4;
When 4..5 => character.stat.WIS.modifier := -3;
When 6..7 => character.stat.WIS.modifier := -2;
When 8..9 => character.stat.WIS.modifier := -1;
When 10..11 => character.stat.WIS.modifier := 0;
When 12..13 => character.stat.WIS.modifier := 1;
When 14..15 => character.stat.WIS.modifier := 2;
When 16..17 => character.stat.WIS.modifier := 3;
When 18..19 => character.stat.WIS.modifier := 4;
When 20 => character.stat.WIS.modifier := 5;
When others => character.stat.WIS.modifier := -99;
End Case;
Case character.stat.CHA.base is
When 1 => character.stat.CHA.modifier := -5;
When 2..3 => character.stat.CHA.modifier := -4;
When 4..5 => character.stat.CHA.modifier := -3;
When 6..7 => character.stat.CHA.modifier := -2;
When 8..9 => character.stat.CHA.modifier := -1;
When 10..11 => character.stat.CHA.modifier := 0;
When 12..13 => character.stat.CHA.modifier := 1;
When 14..15 => character.stat.CHA.modifier := 2;
When 16..17 => character.stat.CHA.modifier := 3;
When 18..19 => character.stat.CHA.modifier := 4;
When 20 => character.stat.CHA.modifier := 5;
When others => character.stat.CHA.modifier := -99;
End Case;
-- Assign the character's proficiency based on their level
Case character.class.level is
When 0..4 => character.class.proficiency := 2;
When 5..8 => character.class.proficiency := 3;
When 9..12 => character.class.proficiency := 4;
When 13..16 => character.class.proficiency := 5;
When 17..20 => character.class.proficiency := 6;
When others => character.class.proficiency := 0;
End Case;
End caseAbilityScores;
------------------------------------------------------------
Procedure caseRaceInfo (character : in out Character_Type) is
Begin --caseRaceInfo
-- Assign speed, size, and ability score
-- increases based on the character's race.
Case character.race.main is
When Dragonborn => character.race.speed := 30;
character.race.size := 'M';
character.stat.STR.base := character.stat.STR.base +2;
character.stat.CHA.base := character.stat.CHA.base +1;
When Dwarf => character.race.speed := 25;
character.race.size := 'M';
character.stat.CON.base := character.stat.CON.base +2;
character.race.subrace := Hill;
When Elf => character.race.speed := 30;
If character.race.subrace = High Then
character.race.speed := 35;
End if;
character.race.size := 'M';
character.stat.DEX.base := character.stat.DEX.base +2;
character.race.subrace := High;
When Gnome => character.race.speed := 25;
character.race.size := 'S';
character.stat.INT.base := character.stat.INT.base +2;
character.race.subrace := Rock;
When Halfling => character.race.speed := 25;
character.race.size := 'S';
character.stat.DEX.base := character.stat.DEX.base +2;
character.race.subrace := Lightfoot;
When Human => character.race.speed := 30;
character.race.size := 'M';
character.stat.STR.base := character.stat.STR.base +1;
character.stat.DEX.base := character.stat.DEX.base +1;
character.stat.CON.base := character.stat.CON.base +1;
character.stat.INT.base := character.stat.INT.base +1;
character.stat.WIS.base := character.stat.WIS.base +1;
character.stat.CHA.base := character.stat.CHA.base +1;
When HalfElf => character.race.speed := 30;
character.race.size := 'M';
character.stat.CHA.base := character.stat.CHA.base +2;
character.race.subrace := None;
When HalfOrc => character.race.speed := 30;
character.race.size := 'M';
character.stat.STR.base := character.stat.STR.base +2;
character.stat.CON.base := character.stat.CON.base +1;
character.race.subrace := None;
When Tiefling => character.race.speed := 30;
character.race.size := 'M';
character.stat.CHA.base := character.stat.CHA.base +2;
character.stat.INT.base := character.stat.INT.base +1;
character.race.subrace := None;
When others => null;
End Case;
-- Assign ability score increases based on the character's subrace
Case character.race.subrace is
When Hill => character.stat.WIS.base := character.stat.WIS.base +1;
When High => character.stat.INT.base := character.stat.INT.base +1;
When Lightfoot => character.stat.CHA.base := character.stat.CHA.base +1;
When Rock => character.stat.CON.base := character.stat.CON.base +1;
When others => null;
End Case;
End caseRaceInfo;
------------------------------------------------------------
Procedure halfElfAbilities (character : in out Character_Type) is
--------------------Identifiers--------------------
-- num_modified : An integer to keep track of
-- how many scores have been changed.
-- stat_temp : A variable that represents which
-- stat is being modified.
---------------------------------------------------
num_modified : Integer := 0;
stat_temp : String(1..3);
Begin -- halfElfAbilities
-- If the character is a Half Elf, the user can assign
-- 2 ability score increases and they see fit.
Put ("You have chosen Half-Elf as your race. One of your racial traits");
New_Line;
Put ("allows you to increase your ability scores.");
New_Line;
Put ("You have 2 points to allocate where you desire. Your score cannot");
New_Line;
Put ("exceed 20. Your current stats are:");
New_Line;
-- Output the character's stats to the screen
-- so the user can see what they already have.
Put (THIRTY_THREE_DASHES);
New_Line;
Set_Col(1);
Put ("STR");
Set_Col(7);
Put ("DEX");
Set_Col(13);
Put ("CON");
Set_Col(19);
Put ("INT");
Set_Col(25);
Put ("WIS");
Set_Col(31);
Put ("CHA");
New_Line;
Put (THIRTY_THREE_DASHES);
New_Line;
Set_Col(1+1);
Put (character.stat.STR.base, 1);
Set_Col(7+1);
Put (character.stat.DEX.base, 1);
Set_Col(13+1);
Put (character.stat.CON.base, 1);
Set_Col(19+1);
Put (character.stat.INT.base, 1);
Set_Col(25+1);
Put (character.stat.WIS.base, 1);
Set_Col(31+1);
Put (character.stat.CHA.base, 1);
New_Line;
Set_Col(1);
Put("(");
If character.stat.STR.modifier >= 0 Then
Put("+");
Put(character.stat.STR.modifier, 1);
Else
Put(character.stat.STR.modifier, 1);
End If;
Put(")");
Set_Col(7);
Put("(");
If character.stat.DEX.modifier >= 0 Then
Put("+");
Put(character.stat.DEX.modifier, 1);
Else
Put(character.stat.DEX.modifier, 1);
End If;
Put(")");
Set_Col(13);
Put("(");
If character.stat.CON.modifier >= 0 Then
Put("+");
Put(character.stat.CON.modifier, 1);
Else
Put(character.stat.CON.modifier, 1);
End If;
Put(")");
Set_Col(19);
Put("(");
If character.stat.INT.modifier >= 0 Then
Put("+");
Put(character.stat.INT.modifier, 1);
Else
Put(character.stat.INT.modifier, 1);
End If;
Put(")");
Set_Col(25);
Put("(");
If character.stat.WIS.modifier >= 0 Then
Put("+");
Put(character.stat.WIS.modifier, 1);
Else
Put(character.stat.WIS.modifier, 1);
End If;
Put(")");
Set_Col(31);
Put("(");
If character.stat.CHA.modifier >= 0 Then
Put("+");
Put(character.stat.CHA.modifier, 1);
Else
Put(character.stat.CHA.modifier, 1);
End If;
Put(")");
New_Line;
Put (THIRTY_THREE_DASHES);
New_Line(2);
-- Have the user select the stat(s) they would like to increase.
Put ("Enter the 3 letter abbreviation that corresponds to the");
New_Line;
Put ("ability score you would like to increase, one at a time:");
New_Line;
While (num_modified < 2) Loop
Put (">>> ");
Get(stat_temp);
If stat_temp = "STR" and character.stat.STR.base < 20 Then
character.stat.STR.base := character.stat.STR.base + 1;
num_modified := num_modified + 1;
Elsif stat_temp = "DEX" and character.stat.DEX.base < 20 Then
character.stat.DEX.base := character.stat.DEX.base + 1;
num_modified := num_modified + 1;
Elsif stat_temp = "CON" and character.stat.CON.base < 20 Then
character.stat.CON.base := character.stat.CON.base + 1;
num_modified := num_modified + 1;
Elsif stat_temp = "INT" and character.stat.INT.base < 20 Then
character.stat.INT.base := character.stat.INT.base + 1;
num_modified := num_modified + 1;
Elsif stat_temp = "WIS" and character.stat.WIS.base < 20 Then
character.stat.WIS.base := character.stat.WIS.base + 1;
num_modified := num_modified + 1;
Elsif stat_temp = "CHA" and character.stat.CHA.base < 20 Then
character.stat.CHA.base := character.stat.CHA.base + 1;
num_modified := num_modified + 1;
Else
Put ("Invalid selection. Please check you've entered a valid stat.");
End If;
New_Line;
Exit When num_modified = 2;
End Loop;
End halfElfAbilities;
------------------------------------------------------------
Procedure combatReference (character : in out Character_Type) is