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.
8 curses.init_pair(79, curses.COLOR_WHITE, curses.COLOR_BLUE)
9 for i in range(world_data["bladder"]):
10 winmap += [("~", curses.color_pair(79))]
11 winmap_size = [1, len(winmap)]
13 return offset, winmap_size, winmap
18 curses.init_pair(80, curses.COLOR_YELLOW, curses.COLOR_RED)
19 for i in range(world_data["bowel"]):
20 winmap += [("#", curses.color_pair(80))]
21 winmap_size = [1, len(winmap)]
23 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_BLACK)
43 curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_BLACK)
44 curses.init_pair(3, curses.COLOR_RED, curses.COLOR_BLACK)
45 curses.init_pair(4, curses.COLOR_YELLOW, curses.COLOR_BLACK)
46 curses.init_pair(5, curses.COLOR_CYAN, curses.COLOR_BLACK)
47 curses.init_pair(6, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
48 curses.init_pair(7, curses.COLOR_GREEN, curses.COLOR_BLACK)
49 curses.init_pair(8, curses.COLOR_BLACK, curses.COLOR_MAGENTA)
50 curses.init_pair(9, curses.COLOR_BLACK, curses.COLOR_BLUE)
51 curses.init_pair(10, curses.COLOR_BLACK, curses.COLOR_CYAN)
52 col_unknown = curses.color_pair(1)
53 col_mem_obstacle = curses.color_pair(2)
54 col_mem = curses.color_pair(2)
55 col_stone = curses.color_pair(1)
56 col_player = curses.color_pair(5)
57 col_ground = curses.color_pair(6)
58 col_ground_wet = curses.color_pair(8)
59 col_ground_wetter = curses.color_pair(9)
60 col_ground_wettest = curses.color_pair(10)
61 col_dirt = curses.color_pair(3)
62 col_dirt_wet = curses.color_pair(8)
63 col_dirt_wetter = curses.color_pair(9)
64 col_dirt_wettest = curses.color_pair(10)
65 col_earth = curses.color_pair(3)
66 col_earth_wet = curses.color_pair(8)
67 col_earth_wetter = curses.color_pair(9)
68 col_earth_wettest = curses.color_pair(10)
69 col_wall_dirt = curses.color_pair(4)
70 col_wall_dirt_wet = curses.color_pair(8)
71 col_wall_dirt_wetter = curses.color_pair(9)
72 col_wall_dirt_wettest = curses.color_pair(10)
73 col_wall_earth = curses.color_pair(4)
74 col_wall_earth_wet = curses.color_pair(8)
75 col_wall_earth_wetter = curses.color_pair(9)
76 col_wall_earth_wettest = curses.color_pair(10)
77 col_wall_stone = curses.color_pair(1)
78 col_wall_stone_wet = curses.color_pair(8)
79 col_wall_stone_wetter = curses.color_pair(9)
80 col_wall_stone_wettest = curses.color_pair(10)
81 for y in range(world_data["map_size"]):
82 for x in range(world_data["map_size"]):
83 pos = y * world_data["map_size"] + x
84 char = world_data["fov_map"][pos]
85 if world_data["look_mode"] and y == world_data["map_center"][0] \
86 and x == world_data["map_center"][1]:
88 char = world_data["mem_map"][pos]
89 winmap += [(char, curses.A_REVERSE), ("?", curses.A_REVERSE)]
92 char = world_data["mem_map"][pos]
95 attribute = col_unknown
96 elif char in "%#XABCDEFGHI":
97 attribute = col_mem_obstacle
110 bonus = (" ", attribute)
111 winmap += [(char, attribute), bonus]
113 attribute = col_stone
116 attribute = col_ground
118 attribute = col_ground_wet
121 attribute = col_ground_wetter
124 attribute = col_ground_wettest
129 attribute = col_dirt_wet
132 attribute = col_dirt_wetter
135 attribute = col_dirt_wettest
137 attribute = col_earth
140 attribute = col_earth_wet
143 attribute = col_earth_wetter
146 attribute = col_earth_wettest
148 attribute = col_wall_dirt
151 attribute = col_wall_dirt_wet
154 attribute = col_wall_dirt_wetter
157 attribute = col_wall_dirt_wettest
159 attribute = col_wall_earth
162 attribute = col_wall_earth_wet
165 attribute = col_wall_earth_wetter
168 attribute = col_wall_earth_wettest
170 attribute = col_wall_stone
173 attribute = col_wall_stone_wet
176 attribute = col_wall_stone_wetter
179 attribute = col_wall_stone_wettest
181 attribute = col_player
182 winmap += [(char, attribute), bonus]
185 return offset, winmap_size, winmap
187 from client.config.world_data import world_data
188 world_data["bowel"] = 0
189 world_data["bladder"] = 0
190 from client.config.io import io
191 io["worldstate_read_order"] += [["bowel", "int"]]
192 io["worldstate_read_order"] += [["bladder", "int"]]
193 from client.config.windows import windows_config
194 from client.windows import win_log
195 windows_config[:] = [
196 {"config": [0, -34], "func": win_map, "title": "The Crawling Eater"},
197 {"config": [1, 33], "func": win_bowel, "title": "bowel"},
198 {"config": [1, 33], "func": win_bladder, "title": "bladder"},
199 {"config": [-4, 33], "func": win_log, "title": "log"}
201 from client.window_management import set_windows
203 from client.commands import command_sender
204 from client.config.commands import commands
205 commands["S"] = (command_sender("drop"),)
206 commands["D"] = (command_sender("drink"),)
207 commands["P"] = (command_sender("pee"),)