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
39 if world_data["map_center"][i] * (i + 1) > win_size[i] / 2 and \
40 win_size[i] < world_data["map_size"] * (i + 1):
41 if world_data["map_center"][i] * (i + 1) \
42 < world_data["map_size"] * (i + 1) - win_size[i] / 2:
43 offset[i] = world_data["map_center"][i] * (i + 1) \
44 - int(win_size[i] / 2)
46 offset[1] = offset[1] + world_data["map_center"][0] % 2
48 offset[i] = world_data["map_size"] * (i + 1) - win_size[i] + i
49 winmap_size = [world_data["map_size"], world_data["map_size"] * 2 + 1]
51 curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLACK)
52 #curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_BLACK)
53 #curses.init_pair(3, curses.COLOR_CYAN, curses.COLOR_BLACK)
54 curses.init_pair(4, curses.COLOR_GREEN, curses.COLOR_BLACK)
55 curses.init_pair(5, curses.COLOR_YELLOW, curses.COLOR_BLACK)
56 curses.init_pair(6, curses.COLOR_RED, curses.COLOR_BLACK)
57 curses.init_pair(7, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
58 curses.init_pair(8, curses.COLOR_BLACK, curses.COLOR_WHITE)
59 #curses.init_pair(9, curses.COLOR_BLACK, curses.COLOR_BLUE)
60 curses.init_pair(10, curses.COLOR_BLACK, curses.COLOR_CYAN)
61 curses.init_pair(11, curses.COLOR_BLACK, curses.COLOR_GREEN)
62 curses.init_pair(12, curses.COLOR_BLACK, curses.COLOR_YELLOW)
63 curses.init_pair(13, curses.COLOR_BLACK, curses.COLOR_RED)
64 curses.init_pair(14, curses.COLOR_BLACK, curses.COLOR_MAGENTA)
65 col_unknown = curses.color_pair(1)
66 col_mem = curses.color_pair(1)
67 col_player = curses.color_pair(8)
77 curses.color_pair(10),
78 curses.color_pair(11),
79 curses.color_pair(12),
80 curses.color_pair(13),
81 curses.color_pair(14),
83 for y in range(world_data["map_size"]):
84 for x in range(world_data["map_size"]):
85 pos = y * world_data["map_size"] + x
86 char = world_data["fov_map"][pos]
87 if world_data["look_mode"] and y == world_data["map_center"][0] \
88 and x == world_data["map_center"][1]:
90 char = world_data["mem_map"][pos]
91 winmap += [(char, curses.A_REVERSE), ("?", curses.A_REVERSE)]
94 char = world_data["mem_map"][pos]
96 attribute = col_unknown
101 bonus = (" ", attribute)
102 winmap += [(char, attribute), bonus]
105 attribute = col_unknown
106 wetval = ord(world_data["wetmap"][pos]) - ord("0")
107 if ord("0") <= ord(char) <= ord("5"):
108 mapval = ord(char) - ord("0")
110 attribute = water_colors[wetval + (mapval - 1)]
112 attribute = earth_colors[mapval]
116 attribute = col_player
117 winmap += [(char, attribute), bonus]
120 return offset, winmap_size, winmap
123 from client.config.world_data import world_data
124 world_data["bowel"] = 0
125 world_data["bladder"] = 0
126 world_data["wetmap"] = " " * (world_data["map_size"] ** 2)
127 from client.config.io import io
128 io["worldstate_read_order"] += [["bowel", "int"]]
129 io["worldstate_read_order"] += [["bladder", "int"]]
130 io["worldstate_read_order"] += [["wetmap", "map"]]
131 from client.config.windows import windows_config
132 from client.windows import win_log
133 windows_config[:] = [
134 {"config": [0, -34], "func": win_map, "title": "The Crawling Eater"},
135 {"config": [1, 33], "func": win_bowel, "title": "bowel"},
136 {"config": [1, 33], "func": win_bladder, "title": "bladder"},
137 {"config": [-4, 33], "func": win_log, "title": "log"}
139 from client.window_management import set_windows
141 from client.commands import command_sender
142 from client.config.commands import commands
143 commands["S"] = (command_sender("drop"),)
144 commands["D"] = (command_sender("drink"),)
145 commands["P"] = (command_sender("pee"),)