-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.py
83 lines (69 loc) · 2.25 KB
/
constants.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import sys
sys.path.append('__HOME__/DEMMO')
import server_path
# Whether or not we are running __main__ in non-test.py files (e.g. database.py)
TESTING = True
# Whether or not this is the server
IS_SERVER = True
# Change first one to your server directory if you're uploading to your server
PROJECT_HOME = server_path.SERVER_PATH if IS_SERVER else ""
# Default player values
class Player:
DEFAULT_ROW = 0
DEFAULT_COL = 0
DEFAULT_HEALTH = 10
DEFAULT_POWER = 5
DEFAULT_LUCK = 5
DEFAULT_GOLD = 0
DEFAULT_BOSS_DEFEATED = 0
# Shop costs
class Shop:
BASE_HEALTH_COST = 100
BASE_POWER_COST = 100
# Database constants
class Database:
TEST_GAME_DB = "test_game_info.db"
GAME_DB = "game_info.db"
TRUE = "True" # for storing in the database
FALSE = "False"
# JSON files
MAP_FILE = "map.json"
TEST_MAP_FILE = "test_map.json"
MONSTER_FILE = "monsters.json"
# Directory paths
# resources path based on server or local
RESOURCES_DIR = PROJECT_HOME + "resources/"
DATABASE_PATH = RESOURCES_DIR+GAME_DB
MAP_PATH = RESOURCES_DIR+MAP_FILE
MONSTER_PATH = RESOURCES_DIR+MONSTER_FILE
# (Testing) Directory paths
# resources path based on server or local
TEST_RESOURCES_DIR = "test_resources/"
TEST_DATABASE_PATH = TEST_RESOURCES_DIR+TEST_GAME_DB
TEST_MAP_PATH = TEST_RESOURCES_DIR+TEST_MAP_FILE
# Game constants
class Game:
START = "start"
DOWN = "down"
UP = "up"
LEFT = "left"
RIGHT = "right"
FIGHT_RESULT = "fight_result"
BUY = "buy"
STATE = "stat"
HEALTH = "health"
POWER = "power"
LUCK = "luck"
SHOP_EXPONENT = 1.05
HEALTH_INCREASE = 10
POWER_INCREASE = 1
LUCK_INCREASE = 1
class ServerMap:
DIVIDER_MULTIPLIER = 4 # Determines size of the divider -> larger number = longer divider
TILE_SIZE = 3 # size of each tile on the map
ONLY_ID = False # whether or not to display only id of each player or monster
TILE_INDENT = 1 # amount of indent for each tile
# TODO: Rename this
# Constant for within range functions
RANGE = 2 # number of tiles
# TODO: Add constants for player actions i.e. FIGHT = "FIGHT"