forked from Anaphory/apocalypse
-
Notifications
You must be signed in to change notification settings - Fork 1
/
AW3.py
43 lines (39 loc) · 896 Bytes
/
AW3.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
#!/usr/bin/python3
# AW3
# ===================================================================
#
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 p
def main():
try:
db=shelve.open('saves/aw_saves3')
except IOError:
print(IOError)
exit()
#p = db['AW3']
p = newGame()
db['AW3']=p
#print(p.display())
db.close()
return
if __name__ == "__main__":
main()