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 curses.init_pair(77, curses.COLOR_WHITE, curses.COLOR_GREEN)
7 curses.init_pair(78, curses.COLOR_BLACK, curses.COLOR_RED)
8 curses.init_pair(79, curses.COLOR_WHITE, curses.COLOR_BLUE)
9 curses.init_pair(80, curses.COLOR_BLACK, curses.COLOR_YELLOW)
12 def win_bar_maker(color_number, symbol, title):
15 for i in range(world_data[title]):
16 winmap += [(symbol, curses.color_pair(color_number))]
17 winmap_size = [1, len(winmap)]
19 return offset, winmap_size, winmap
36 if world_data["map_center"][i] * (i + 1) > win_size[i] / 2 and \
37 win_size[i] < world_data["map_size"] * (i + 1):
38 if world_data["map_center"][i] * (i + 1) \
39 < world_data["map_size"] * (i + 1) - win_size[i] / 2:
40 offset[i] = world_data["map_center"][i] * (i + 1) \
41 - int(win_size[i] / 2)
43 offset[1] = offset[1] + world_data["map_center"][0] % 2
45 offset[i] = world_data["map_size"] * (i + 1) - win_size[i] + i
46 winmap_size = [world_data["map_size"], world_data["map_size"] * 2 + 1]
48 curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLACK)
49 #curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_BLACK)
50 #curses.init_pair(3, curses.COLOR_CYAN, curses.COLOR_BLACK)
51 curses.init_pair(4, curses.COLOR_GREEN, curses.COLOR_BLACK)
52 curses.init_pair(5, curses.COLOR_YELLOW, curses.COLOR_BLACK)
53 curses.init_pair(6, curses.COLOR_RED, curses.COLOR_BLACK)
54 curses.init_pair(7, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
55 curses.init_pair(8, curses.COLOR_BLACK, curses.COLOR_WHITE)
56 #curses.init_pair(9, curses.COLOR_BLACK, curses.COLOR_BLUE)
57 curses.init_pair(10, curses.COLOR_BLACK, curses.COLOR_CYAN)
58 curses.init_pair(11, curses.COLOR_BLACK, curses.COLOR_GREEN)
59 curses.init_pair(12, curses.COLOR_BLACK, curses.COLOR_YELLOW)
60 curses.init_pair(13, curses.COLOR_BLACK, curses.COLOR_RED)
61 curses.init_pair(14, curses.COLOR_BLACK, curses.COLOR_MAGENTA)
62 curses.init_pair(15, curses.COLOR_RED, curses.COLOR_GREEN)
63 col_unknown = curses.color_pair(1)
64 col_mem = curses.color_pair(1)
65 col_creature = curses.color_pair(15)
66 col_player = curses.color_pair(8)
76 curses.color_pair(10),
77 curses.color_pair(11),
78 curses.color_pair(12),
79 curses.color_pair(13),
80 curses.color_pair(14),
82 for y in range(world_data["map_size"]):
83 for x in range(world_data["map_size"]):
84 pos = y * world_data["map_size"] + x
85 char = world_data["fov_map"][pos]
86 if world_data["look_mode"] and y == world_data["map_center"][0] \
87 and x == world_data["map_center"][1]:
89 char = world_data["mem_map"][pos]
90 winmap += [(char, curses.A_REVERSE), ("?", curses.A_REVERSE)]
94 if world_data["soundmap"][pos] != "0":
96 char = world_data["mem_map"][pos]
98 attribute = col_unknown
103 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_creature
117 av_pos = world_data["avatar_position"]
118 if pos == av_pos[0] * world_data["map_size"] + av_pos[1]:
119 attribute = col_player
120 winmap += [(char, attribute), bonus]
123 return offset, winmap_size, winmap
126 from client.config.world_data import world_data
127 world_data["kidney"] = 0
128 world_data["stomach"] = 0
129 world_data["bowel"] = 0
130 world_data["bladder"] = 0
131 world_data["wetmap"] = " " * (world_data["map_size"] ** 2)
132 world_data["soundmap"] = " " * (world_data["map_size"] ** 2)
133 from client.config.io import io
134 io["worldstate_read_order"] += [["stomach", "int"]]
135 io["worldstate_read_order"] += [["kidney", "int"]]
136 io["worldstate_read_order"] += [["bowel", "int"]]
137 io["worldstate_read_order"] += [["bladder", "int"]]
138 io["worldstate_read_order"] += [["wetmap", "map"]]
139 io["worldstate_read_order"] += [["soundmap", "map"]]
140 from client.config.windows import windows_config
141 from client.windows import win_log
142 windows_config[:] = [
145 "title": "The Crawling Eater"},
147 "func": win_bar_maker(77, "%", "stomach"),
150 "func": win_bar_maker(79, "~", "kidney"),
153 "func": win_bar_maker(78, "%", "bowel"),
156 "func": win_bar_maker(80, "~", "bladder"),
162 from client.window_management import set_windows
164 from client.commands import command_sender
165 from client.config.commands import commands
166 commands["S"] = (command_sender("drop"),)
167 commands["D"] = (command_sender("drink"),)
168 commands["P"] = (command_sender("pee"),)