forked from Anaphory/apocalypse
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
41 lines (37 loc) · 892 Bytes
/
main.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
#!/usr/bin/python
# main.py
# ===================================================================
# Wed Jun 19 15:54:45 CEST 2019
import readline
import json, shelve
from aw_debug import logger
from aw_tools import menu
from aw_save import loadAW, saveAW
from aw_names import namePick
from aw_character import character, player
def newGame():
try:
with open('AW-db/aw_classes.json') as f:
awcl=json.load(f)
except IOError:
print(IOError)
p = player()
p.starterPack(awcl)
m=[]
for i in p.characters:
m.append(i.display())
r=menu(m)
print('selected:'+p.characters[r[0]].display())
return
def main():
try:
db=shelve.open('saves/aw_saves')
except IOError:
print(IOError)
exit()
# p = player()
p = db['AW']
print(p.display())
return
if __name__ == "__main__":
main()