1 # This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
2 # or any later version. For details on its copyright, license, and warranties,
3 # see the file NOTICE in the root directory of the PlomRogue source package.
6 from client.config.io import io
7 from client.config.world_data import world_data
8 world_data["log"][-2] = "STATS OVERVIEW: " \
9 "T: turn, H: health, S: satiation, G: god's favor."
10 world_data["GOD_FAVOR"] = 0
11 io["worldstate_read_order"] += [["GOD_FAVOR", "int"]]
12 world_data["metamap_A"] = ""
13 world_data["metamap_B"] = ""
14 io["worldstate_read_order"] += [["metamap_A", "map"]]
15 io["worldstate_read_order"] += [["metamap_B", "map"]]
18 winmap = "T: " + str(world_data["turn"]) \
19 + " H: " + str(world_data["lifepoints"]) \
20 + " S: " + str(world_data["satiation"]) \
21 + " G: " + str(world_data["GOD_FAVOR"])
22 winmap_size = [1, len(winmap)]
24 return offset, winmap_size, winmap
30 if world_data["map_center"][i] * (i + 1) > win_size[i] / 2 and \
31 win_size[i] < world_data["map_size"] * (i + 1):
32 if world_data["map_center"][i] * (i + 1) \
33 < world_data["map_size"] * (i + 1) - win_size[i] / 2:
34 offset[i] = world_data["map_center"][i] * (i + 1) \
35 - int(win_size[i] / 2)
37 offset[1] = offset[1] + world_data["map_center"][0] % 2
39 offset[i] = world_data["map_size"] * (i + 1) - win_size[i] + i
40 winmap_size = [world_data["map_size"], world_data["map_size"] * 2 + 1]
42 curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_WHITE)
43 curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_WHITE)
44 curses.init_pair(3, curses.COLOR_RED, curses.COLOR_WHITE)
45 curses.init_pair(4, curses.COLOR_WHITE, curses.COLOR_BLUE)
46 curses.init_pair(5, curses.COLOR_BLUE, curses.COLOR_RED)
47 curses.init_pair(6, curses.COLOR_BLACK, curses.COLOR_RED)
48 curses.init_pair(7, curses.COLOR_BLUE, curses.COLOR_GREEN)
49 curses.init_pair(8, curses.COLOR_BLUE, curses.COLOR_YELLOW)
50 curses.init_pair(9, curses.COLOR_BLACK, curses.COLOR_MAGENTA)
51 curses.init_pair(10, curses.COLOR_BLACK, curses.COLOR_CYAN)
52 curses.init_pair(11, curses.COLOR_WHITE, curses.COLOR_BLACK)
53 curses.init_pair(12, curses.COLOR_BLUE, curses.COLOR_BLACK)
54 curses.init_pair(13, curses.COLOR_RED, curses.COLOR_BLACK)
55 curses.init_pair(14, curses.COLOR_GREEN, curses.COLOR_BLACK)
56 curses.init_pair(15, curses.COLOR_YELLOW, curses.COLOR_BLACK)
57 curses.init_pair(16, curses.COLOR_CYAN, curses.COLOR_BLACK)
58 curses.init_pair(17, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
59 curses.init_pair(18, curses.COLOR_WHITE, curses.COLOR_MAGENTA)
60 col_unknown = curses.color_pair(1)
61 col_mem = curses.color_pair(4)
62 col_mem_obstacle = curses.color_pair(2)
63 col_mem_altar = curses.color_pair(18)
64 col_plant = curses.color_pair(11)
65 col_altar = curses.color_pair(10)
66 col_tool = curses.color_pair(16)
67 col_corpse = curses.color_pair(17)
68 col_unkraut = curses.color_pair(14)
69 col_animal = curses.color_pair(6)
70 col_player = curses.color_pair(3)
71 col_ground = curses.color_pair(15)
72 col_obstacle = curses.color_pair(9)
73 col_health_good = curses.color_pair(7)
74 col_health_middle = curses.color_pair(8)
75 col_health_bad = curses.color_pair(5)
76 col_lumber = curses.color_pair(13)
77 col_water = curses.color_pair(12)
78 col_stack = curses.color_pair(11)
79 for y in range(world_data["map_size"]):
80 for x in range(world_data["map_size"]):
81 pos = y * world_data["map_size"] + x
82 char = world_data["fov_map"][pos]
83 if world_data["look_mode"] and y == world_data["map_center"][0] \
84 and x == world_data["map_center"][1]:
86 char = world_data["mem_map"][pos]
87 winmap += [(char, curses.A_REVERSE), ("?", curses.A_REVERSE)]
90 char = world_data["mem_map"][pos]
93 attribute = col_unknown
94 elif char == "X" or char == "|":
95 attribute = col_mem_obstacle
97 attribute = col_mem_altar
98 bonus = (" ", attribute)
99 if len(world_data["metamap_A"]) > 0 and \
100 world_data["metamap_A"][pos] == "2":
101 bonus = ("+", col_mem)
102 winmap += [(char, attribute), bonus]
104 attribute = col_water
105 if char == "." or char == ":":
106 attribute = col_ground
108 attribute = col_player
109 elif char == "," or char == "d" or char == "B":
110 attribute = col_animal
112 attribute = col_unkraut
113 elif char == "$" or char == "%" or char == ";" or char == "&":
114 attribute = col_corpse
115 elif char == "-" or char == "/" or char == "]" or char == "[":
117 elif char == "X" or char == "|":
118 attribute = col_obstacle
120 attribute = col_altar
121 elif char == "(" or char == "*":
122 attribute = col_plant
124 attribute = col_lumber
125 bonus = (" ", attribute)
126 if len(world_data["metamap_A"]) > 0:
127 if world_data["metamap_A"][pos] == "2":
128 bonus = ("+", col_stack)
129 elif not world_data["metamap_A"][pos] in "01":
130 c = world_data["metamap_B"][pos]
131 if world_data["metamap_A"][pos] == "a":
132 bonus = (c, col_health_bad)
133 elif world_data["metamap_A"][pos] == "b":
134 bonus = (c, col_health_middle)
135 elif world_data["metamap_A"][pos] == "c":
136 bonus = (c, col_health_good)
137 winmap += [(char, attribute), bonus]
140 return offset, winmap_size, winmap
142 from client.config.windows import windows_config
143 from client.windows import win_log, win_inventory, win_look
144 windows_config[:] = [
145 {"config": [1, 33], "func": win_info, "title": "Stats"},
146 {"config": [-7, 33], "func": win_log, "title": "Log"},
147 {"config": [4, 16], "func": win_inventory, "title": "Inventory"},
148 {"config": [4, 16], "func": win_look, "title": "Things here"},
149 {"config": [0, -34], "func": win_map, "title": "PLEASE THE ISLAND GOD"}
151 from client.window_management import set_windows