-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
61 lines (55 loc) · 1.74 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import json
from player import Player
from inventory_list import inventory_list
from save import check_save
from clear_data import clear_data
from teleport import teleport
from define_location import define_location
from location_list import starterisland
from items_list import *
from check_inv_prices import check_inv_prices
from load import load
from player_profile import player_profile
from find_npc import find_npc
from npc_list import *
from ask_for_npc_to_find import afntf
from settings import settings
def main():
with open('RPG-DATA/save.json', 'w') as file:
json.dump("false", file)
inv = []
player = Player('PLAYER', '1', inv,starterisland.LOCATIONNAME, 100, 0)
with open("RPG-DATA/p_gems.json", 'w') as file:
json.dump(player.PLAYERGEMS, file)
while True:
action = input(">>")
if action == 'q':
check_save(player)
break
elif action == 'i':
inventory_list(player)
#testing
elif action == 'a':
inv.append(dagger.ITEMNAME)
elif action == 'aa':
inv.append(knife.ITEMNAME)
elif action == 's':
check_save(player)
elif action == 'clear_data':
clear_data()
elif action == 'loc':
define_location()
elif action == 't':
teleport(player)
elif action == 'cip':
check_inv_prices(player)
elif action == 'l':
load(player)
elif action == 'pr':
player_profile()
elif action == 'find':
afntf(player)
elif action == 'settings':
settings(player)
else:
print("unknown command.")