-
Notifications
You must be signed in to change notification settings - Fork 0
/
char_gen.py
34 lines (30 loc) · 1 KB
/
char_gen.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
#!/usr/bin/python
import sys
from randomizer import random_good_traits
from pc import PlayerCharacter
import printer
error_string = "Did not get command. List of commands:\n" \
"traits <amount of traits, optional>. Usage: chargen.py traits 1\n" \
"newpc"
if len(sys.argv) == 1:
print(error_string)
exit(0)
if sys.argv[1] == "traits":
list_good_traits = []
if len(sys.argv) == 2:
list_good_traits = random_good_traits()
else:
list_good_traits = random_good_traits(int(sys.argv[2]))
print("Following good traits were chosen: ")
for trait in list_good_traits:
print("{} - {}".format(trait.name, trait.desc))
elif sys.argv[1] == "background":
print("TODO this command is not implemented :D")
elif sys.argv[1] == "npc":
print("TODO this command is not implemented :D")
elif sys.argv[1] == "newpc":
newchar = PlayerCharacter()
printer.print_char(newchar, "textfile")
printer.print_char_pdf(newchar)
else:
print(error_string)